/*
  Theme: Personal Blog — Mustafa Taha Şen
  Style: Light, Calm, Minimal — Psychology & Education
*/

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  /* Light Calm Palette */
  --color-bg: #f8f6f3;
  --color-bg-warm: #f3f0ec;
  --color-bg-section: #fdfcfa;
  --color-bg-white: #ffffff;

  /* Primary: Sage — calming, professional */
  --color-primary: #5b8a72;
  --color-primary-light: #7aab94;
  --color-primary-dark: #3d6b55;
  --color-primary-subtle: rgba(91, 138, 114, 0.08);

  /* Accent: Warm earth */
  --color-accent: #e8a87c;

  /* Text */
  --color-text-main: #2d3436;
  --color-text-body: #4a5568;
  --color-text-muted: #8896a6;
  --color-text-light: #b0bec5;

  /* Glass — light mode */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-subtle: rgba(0, 0, 0, 0.06);
  --glass-blur: 16px;
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --glass-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);

  /* Layout */
  --container-width: 1100px;
  --header-height: 80px;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  /* Transitions — subtle only */
  --transition-smooth: all 0.3s ease;
  --transition-fast: all 0.2s ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg: #0f1410;
  --color-bg-warm: #141a16;
  --color-bg-section: #111714;
  --color-bg-white: #1a211d;

  --color-primary: #6faa8d;
  --color-primary-light: #8cc4a6;
  --color-primary-dark: #4e8b6e;
  --color-primary-subtle: rgba(111, 170, 141, 0.12);

  --color-accent: #d4976a;

  --color-text-main: #e8ede9;
  --color-text-body: #b0c0b5;
  --color-text-muted: #708878;
  --color-text-light: #4a5e52;

  --glass-bg: rgba(20, 28, 23, 0.7);
  --glass-bg-strong: rgba(22, 32, 26, 0.88);
  --glass-border: rgba(111, 170, 141, 0.12);
  --glass-border-subtle: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --glass-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] header .glass {
  background: rgba(15, 20, 16, 0.6);
  border: 1px solid rgba(111, 170, 141, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .ambient-glow {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(111, 170, 141, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(100, 80, 140, 0.04) 0%, transparent 50%);
}

[data-theme="dark"] .social-btn {
  background: rgba(111, 170, 141, 0.12);
  border-color: rgba(111, 170, 141, 0.15);
}

[data-theme="dark"] .contact-input {
  background: rgba(20, 28, 23, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
}

[data-theme="dark"] .contact-input:focus {
  background: rgba(22, 32, 26, 0.9);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(91, 138, 114, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  user-select: none;
}

.theme-toggle .icon-light {
  display: block;
}

.theme-toggle .icon-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle {
  border-color: rgba(111, 170, 141, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(111, 170, 141, 0.1);
}

[data-theme="dark"] .theme-toggle .icon-light {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

.theme-toggle.animating .icon {
  transform: rotate(360deg) scale(0.5);
  opacity: 0;
}

/* Global transition for theme change */
html, body, header, section, footer, .card, .glass, .ambient-glow, .social-btn, .contact-input {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  color: var(--color-text-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  line-height: 1.7;
  font-size: 16px;
  cursor: auto;
  overflow-x: hidden;
  max-width: 100vw;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-light); }

/* ===== UTILITY ===== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-glow {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(91, 138, 114, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(155, 139, 180, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(245, 230, 210, 0.08) 0%, transparent 60%);
  z-index: -2;
  pointer-events: none;
}

.ambient-glow.glow-2 {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(91, 138, 114, 0.04) 0%, transparent 40%);
}

/* ===== SIGNATURE LOGO ===== */
.logo-signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-decoration: none;
  white-space: nowrap;
}

/* ===== HEADER & NAV ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 0;
  transition: padding 0.3s ease;
}

header.scrolled {
  padding: 10px 0;
}

header .glass {
  border-radius: 100px;
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Daha fazla macOS tarzı glass efekti */
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
}

nav ul li a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 4px;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--color-primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero-content .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--color-primary-subtle);
  border: 1px solid rgba(91, 138, 114, 0.12);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 32px;
}

.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.hero-content h1 .text-primary {
  color: var(--color-primary);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--color-text-body);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

.hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 100px;
  text-decoration: none;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--glass-border-subtle);
  color: var(--color-text-main);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* ===== SECTIONS ===== */
section {
  padding: 70px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--color-text-main);
}

.section-subtitle {
  font-size: 1.02rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: 28px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ===== CARDS ===== */
.card {
  padding: 32px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#projects .card {
  /* preserved for hover effects */
}

/* Article cards — more compact */
#articles-grid .card {
  padding: 22px;
  border-radius: var(--radius-md);
}

#articles-grid .card img {
  height: 160px !important;
  margin-bottom: 12px !important;
  border-radius: 8px !important;
}

#articles-grid .card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

#articles-grid .card p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--color-text-main);
  font-weight: 600;
}

.card p {
  color: var(--color-text-body);
  font-size: 0.95rem;
  line-height: 1.7;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 18px;
}

.card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Tool Tags */
.tool-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border: 1px solid rgba(91, 138, 114, 0.12);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 14px;
  margin-right: 6px;
}

/* ===== ABOUT SECTION ===== */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  align-items: start;
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.about-text {
  padding-top: 8px;
}

.about-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  color: var(--color-text-main);
  margin-bottom: 18px;
  margin-top: 14px;
}

.about-text p {
  margin-bottom: 14px;
  font-size: 1rem;
  color: var(--color-text-body);
  line-height: 1.8;
}

/* Compact Timeline inside About */
.about-timeline {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--glass-border-subtle);
  padding-top: 20px;
}

.about-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.timeline-dot-sm {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.timeline-dot-sm.dot-edu {
  background-color: var(--color-primary);
}

.timeline-dot-sm.dot-work {
  background-color: var(--color-accent);
}

.about-timeline-item strong {
  font-size: 0.9rem;
  color: var(--color-text-main);
  font-weight: 600;
  display: block;
  line-height: 1.4;
}

.timeline-meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 40px;
  padding: 60px 24px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border-subtle);
}

.footer-content {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.footer-brand h2 {
  margin-bottom: 12px;
  color: var(--color-text-main);
}

.footer-brand p {
  color: var(--color-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.footer-social {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(91, 138, 114, 0.1);
  color: var(--color-primary);
  transition: background 0.25s ease, color 0.25s ease;
  text-decoration: none;
  font-size: 1rem;
}

.social-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

.footer-form h3 {
  margin-bottom: 20px;
  color: var(--color-text-main);
  font-size: 1.15rem;
}

.contact-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease;
}

.contact-input::placeholder {
  color: var(--color-text-light);
}

.contact-input:focus {
  border-color: var(--color-primary);
  background: #fff;
}

.btn-contact {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.25s ease;
}

.btn-contact:hover {
  background: var(--color-primary-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  body {
    font-size: 15px;
  }

  header {
    padding: 10px 0;
  }

  header .glass {
    flex-direction: column;
    padding: 14px 20px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  nav ul {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav ul li a {
    font-size: 0.85rem;
  }

  .logo-signature {
    font-size: 1.3rem;
  }

  .hero {
    padding-top: 140px;
    min-height: auto;
    padding-bottom: 60px;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 0.95rem;
    padding: 0 10px;
  }

  .hero-btns {
    flex-direction: column;
    padding: 0 20px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  section {
    padding: 50px 0;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  /* Articles & Projects Grid Mobile */
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* About Section Mobile */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .about-image-wrapper img {
    height: 280px;
  }
  
  .about-timeline {
    align-items: center;
    text-align: left;
  }

  /* Footer Mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
    margin: 24px auto 0;
    width: 100%;
  }

  .contact-input-group {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.9rem;
  }
  
  .about-image-wrapper img {
    height: 220px;
  }
}