/* ============================================================
   DESIGN TOKENS — single source of truth
   Hierarchy: tokens → primitives → components → sections → pages
   Stage A: defines the palette/type/space/motion system the rest
   of the site will migrate onto incrementally.
   ============================================================ */
:root {
  /* --- Surfaces (light mode) --- */
  --bg:            #fafaf7;
  --bg-elev:       #ffffff;
  --bg-sunk:       #f2f1ea;
  --bg-warm:       #fbf7ef;

  /* --- Ink --- */
  --ink:           #0f1419;
  --ink-2:         #3a4048;
  --ink-3:         #6a7078;
  --ink-4:         #9ca3ab;
  --hairline:      rgba(15, 20, 25, 0.08);
  --hairline-strong: rgba(15, 20, 25, 0.14);

  /* --- Accent 1: Ocean / steel blue (engineering precision) --- */
  --a1-50:  #eff6fa;
  --a1-100: #d9e9f1;
  --a1-200: #b6d4e3;
  --a1-300: #86b4cc;
  --a1-400: #548eb0;
  --a1-500: #2e7395;
  --a1-600: #1f5c7b;
  --a1-700: #174862;
  --a1-800: #0a4d6e;
  --a1-900: #0a3048;
  --a1-950: #05192a;
  --accent-1:       var(--a1-800);
  --accent-1-soft:  rgba(10, 77, 110, 0.08);

  /* --- Accent 2: Burnt amber (energy / CTA / warmth) --- */
  --a2-50:  #fdf6ed;
  --a2-100: #faeacf;
  --a2-200: #f5d196;
  --a2-300: #efb15e;
  --a2-400: #e89137;
  --a2-500: #d2761c;
  --a2-600: #c26a12;
  --a2-700: #994f10;
  --a2-800: #783f12;
  --a2-900: #5f3410;
  --a2-950: #331a06;
  --accent-2:       var(--a2-600);
  --accent-2-soft:  rgba(194, 106, 18, 0.10);

  /* --- Accent 3: Sage (organic / microalgae / research) --- */
  --a3-50:  #f2f7f1;
  --a3-100: #e0ecdd;
  --a3-200: #c2d8bc;
  --a3-300: #9bbd93;
  --a3-400: #79a271;
  --a3-500: #5a8559;
  --a3-600: #466d46;
  --a3-700: #3a5739;
  --a3-800: #314630;
  --a3-900: #293b29;
  --a3-950: #141e14;
  --accent-3:       var(--a3-500);
  --accent-3-soft:  rgba(90, 133, 89, 0.10);

  /* --- Spotlight (antigravity cursor glow) --- */
  --spot:          rgba(255, 240, 210, 0.55);
  --spot-outer:    rgba(255, 240, 210, 0);

  /* --- Typography --- */
  --font-display: 'Instrument Serif', 'Playfair Display', Georgia, serif;
  --font-body:    'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --fs-xs:    clamp(0.75rem, 0.7rem + 0.2vw, 0.8rem);
  --fs-sm:    clamp(0.875rem, 0.85rem + 0.2vw, 0.95rem);
  --fs-base:  clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  --fs-lg:    clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --fs-h3:    clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --fs-h2:    clamp(2rem, 1.6rem + 2vw, 3rem);
  --fs-h1:    clamp(3rem, 2rem + 5vw, 6rem);

  --lh-tight:  1.05;
  --lh-snug:   1.25;
  --lh-body:   1.55;
  --lh-loose:  1.75;
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-mono:   -0.01em;

  /* --- Spacing scale --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* --- Radius --- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* --- Shadow --- */
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.04);
  --shadow-md: 0 4px 12px -4px rgba(15, 20, 25, 0.08);
  --shadow-lg: 0 20px 40px -16px rgba(15, 20, 25, 0.12);
  --shadow-accent: 0 20px 40px -16px var(--accent-1-soft);

  /* --- Motion --- */
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out:   cubic-bezier(0.7, 0, 0.3, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   450ms;
  --dur-glacial: 900ms;

  /* --- Layout --- */
  --container: 1200px;
  --container-narrow: 780px;
  --z-base: 0;
  --z-elev: 10;
  --z-nav: 100;
  --z-cursor: 9999;
  --z-modal: 1000;
}

:root[data-theme="dark"] {
  --bg:            #0e1013;
  --bg-elev:       #15181c;
  --bg-sunk:       #0a0c0f;
  --bg-warm:       #16130e;
  --ink:           #e6e8eb;
  --ink-2:         #b4b8bf;
  --ink-3:         #7a8089;
  --ink-4:         #5a5f66;
  --hairline:      rgba(230, 232, 235, 0.08);
  --hairline-strong: rgba(230, 232, 235, 0.14);
  --accent-1:      var(--a1-300);
  --accent-1-soft: rgba(134, 180, 204, 0.12);
  --accent-2:      var(--a2-400);
  --accent-2-soft: rgba(232, 145, 55, 0.14);
  --accent-3:      var(--a3-400);
  --accent-3-soft: rgba(121, 162, 113, 0.14);
  --spot:          rgba(255, 220, 170, 0.10);
  --spot-outer:    rgba(255, 220, 170, 0);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px -4px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 40px -16px rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:            #0e1013;
    --bg-elev:       #15181c;
    --bg-sunk:       #0a0c0f;
    --bg-warm:       #16130e;
    --ink:           #e6e8eb;
    --ink-2:         #b4b8bf;
    --ink-3:         #7a8089;
    --ink-4:         #5a5f66;
    --hairline:      rgba(230, 232, 235, 0.08);
    --hairline-strong: rgba(230, 232, 235, 0.14);
    --accent-1:      var(--a1-300);
    --accent-1-soft: rgba(134, 180, 204, 0.12);
    --accent-2:      var(--a2-400);
    --accent-2-soft: rgba(232, 145, 55, 0.14);
    --accent-3:      var(--a3-400);
    --accent-3-soft: rgba(121, 162, 113, 0.14);
    --spot:          rgba(255, 220, 170, 0.10);
    --spot-outer:    rgba(255, 220, 170, 0);
  }
}

/* ===== DR. AZAN SAPARDI — LIGHT CLAYMORPHISM THEME ===== */
/* Typography: Inter + Playfair Display | Colors: Cream + Teal + Coral */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', sans-serif;
  background: #FFF8F0;
  color: #2D3436;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ===== CLAYMORPHISM ===== */
.clay {
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow:
    8px 8px 16px rgba(45, 52, 54, 0.08),
    -4px -4px 12px rgba(255, 255, 255, 0.9),
    inset 2px 2px 4px rgba(255, 255, 255, 0.6),
    inset -1px -1px 3px rgba(45, 52, 54, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.clay-teal {
  background: linear-gradient(145deg, #e8f6f4, #d4efec);
  border-radius: 24px;
  box-shadow:
    8px 8px 16px rgba(91, 191, 181, 0.15),
    -4px -4px 12px rgba(255, 255, 255, 0.8),
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -1px -1px 3px rgba(91, 191, 181, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.clay-coral {
  background: linear-gradient(145deg, #fde8e4, #fad5cd);
  border-radius: 24px;
  box-shadow:
    8px 8px 16px rgba(240, 128, 128, 0.12),
    -4px -4px 12px rgba(255, 255, 255, 0.8),
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -1px -1px 3px rgba(240, 128, 128, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { font-family: 'Playfair Display', serif; color: #2D3436; font-weight: 600; }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}
.section-subtitle {
  color: #5BBFB5;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .underline-accent {
  width: 60px; height: 4px;
  background: linear-gradient(90deg, #5BBFB5, #F08080);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 0.75rem 2rem;
  background: rgba(255, 248, 240, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(91, 191, 181, 0.1);
  transition: all 0.35s ease;
}
.navbar.scrolled { box-shadow: 0 4px 20px rgba(45, 52, 54, 0.06); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 600;
  color: #2D3436; text-decoration: none;
}
.nav-brand span { color: #5BBFB5; }
.nav-links { display: flex; gap: 0.25rem; list-style: none; }
.nav-links a {
  text-decoration: none; color: #2D3436; font-size: 0.85rem; font-weight: 500;
  padding: 0.5rem 0.85rem; border-radius: 12px;
  transition: all 0.25s ease; cursor: pointer;
}
.nav-links a:hover, .nav-links a.active { background: rgba(91, 191, 181, 0.12); color: #5BBFB5; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span { width: 24px; height: 2.5px; background: #2D3436; border-radius: 2px; transition: all 0.3s ease; }

/* ===== SECTIONS ===== */
section { padding: 5rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }

/* ===== PAGE BANNER ===== */
.page-banner {
  padding-top: 120px; padding-bottom: 3rem; text-align: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(91, 191, 181, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(240, 128, 128, 0.05) 0%, transparent 50%),
    #FFF8F0;
}
.page-banner h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: 0.5rem; }
.page-banner .banner-desc { color: #666; font-size: 1rem; max-width: 600px; margin: 0 auto; }
.page-banner .underline-accent { width: 60px; height: 4px; background: linear-gradient(90deg, #5BBFB5, #F08080); border-radius: 2px; margin: 1rem auto 0; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; padding-top: 100px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(91, 191, 181, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(240, 128, 128, 0.05) 0%, transparent 50%),
    #FFF8F0;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 1; }
.hero-photo-wrapper { display: flex; justify-content: center; }
.hero-photo {
  width: 320px; height: 320px; border-radius: 32px; object-fit: cover;
  box-shadow:
    12px 12px 24px rgba(91, 191, 181, 0.15),
    -6px -6px 16px rgba(255, 255, 255, 0.9),
    inset 3px 3px 6px rgba(255, 255, 255, 0.4),
    inset -2px -2px 4px rgba(45, 52, 54, 0.04);
  border: 4px solid rgba(255, 255, 255, 0.8);
}
.hero-content h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; margin-bottom: 0.5rem; }
.hero-content .title-line { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 500; color: #5BBFB5; margin-bottom: 0.15rem; }
.hero-content .affiliation { font-size: 0.9rem; color: #666; margin-bottom: 1rem; }
.hero-keywords { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.keyword-tag {
  background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85;
  padding: 0.3rem 0.85rem; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  box-shadow: 3px 3px 6px rgba(91, 191, 181, 0.1), -2px -2px 4px rgba(255, 255, 255, 0.8), inset 1px 1px 2px rgba(255, 255, 255, 0.5);
}
.hero-tagline {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.05rem;
  color: #666; margin-bottom: 1.75rem; padding-left: 1rem;
  border-left: 3px solid #F08080;
}
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.75rem; }
.stat-card {
  text-align: center; padding: 1rem 0.5rem; border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 6px 6px 12px rgba(45, 52, 54, 0.06), -3px -3px 8px rgba(255, 255, 255, 0.9), inset 2px 2px 4px rgba(255, 255, 255, 0.5), inset -1px -1px 2px rgba(45, 52, 54, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.stat-card .stat-number { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: #5BBFB5; display: block; }
.stat-card .stat-label { font-size: 0.7rem; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.15rem; }

/* ===== ABOUT ===== */
.about { background: #FFF8F0; }
.about-content { max-width: 800px; margin: 0 auto; font-size: 1rem; color: #444; text-align: center; }
.about-card { padding: 2.5rem; }
.about-content p { margin-bottom: 1rem; }
.about-content p:last-child { margin-bottom: 0; }
.edu-list { list-style: none; margin-top: 1.5rem; }
.edu-item { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 12px; background: linear-gradient(145deg, #e8f6f4, #d4efec); text-align: left; box-shadow: 3px 3px 6px rgba(91, 191, 181, 0.08), -2px -2px 4px rgba(255, 255, 255, 0.8); }
.edu-icon { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.edu-item p { font-size: 0.88rem; color: #2D3436; }
.edu-item .edu-uni { font-size: 0.78rem; color: #888; }

/* ===== RESEARCH ===== */
.research { background: radial-gradient(ellipse at 70% 80%, rgba(240, 128, 128, 0.04) 0%, transparent 50%), #FFF8F0; }
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.research-card { padding: 2rem; text-align: center; transition: transform 0.3s ease; }
.research-card:hover { transform: translateY(-4px); }
.research-icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; font-size: 1.75rem;
  background: linear-gradient(145deg, #e8f6f4, #d4efec);
  box-shadow: 4px 4px 8px rgba(91, 191, 181, 0.12), -2px -2px 6px rgba(255, 255, 255, 0.9), inset 1px 1px 3px rgba(255, 255, 255, 0.5);
}
.research-card h3 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.research-card p { font-size: 0.85rem; color: #666; line-height: 1.6; }

/* ===== QUICK LINKS ===== */
.quick-links { background: #FFF8F0; padding-top: 2rem; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.quick-card { padding: 2rem 1.5rem; text-align: center; text-decoration: none; color: #2D3436; display: block; transition: transform 0.3s ease; }
.quick-card:hover { transform: translateY(-4px); }
.quick-card .quick-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.quick-card h3 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.quick-card p { font-size: 0.82rem; color: #888; }

/* ===== RESEARCH SHOWCASE (CFD-DEM simulation) ===== */
.sim-showcase {
  padding: var(--space-9, 5rem) 0;
  background: var(--bg, #fafaf7);
  position: relative;
}
:root[data-theme="dark"] body.has-tokens .sim-showcase { background: var(--bg); }

.sim-figure {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-6, 2rem);
  align-items: center;
  padding: var(--space-5, 1.5rem);
  border-radius: var(--radius-lg, 24px);
  max-width: 1100px;
  margin: 0 auto;
}

.sim-media {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f1ea; /* matches matplotlib cream before GIF loads */
  box-shadow:
    0 1px 0 rgba(15, 20, 25, 0.04) inset,
    0 10px 40px -12px rgba(15, 20, 25, 0.18),
    0 2px 6px -2px rgba(15, 20, 25, 0.08);
  aspect-ratio: 16 / 10;
}
:root[data-theme="dark"] body.has-tokens .sim-media {
  background: #15181c;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 48px -14px rgba(0, 0, 0, 0.6);
}

.sim-gif {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.sim-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--ink, #0f1419);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(15, 20, 25, 0.08);
}
:root[data-theme="dark"] body.has-tokens .sim-badge {
  color: var(--ink);
  background: rgba(21, 24, 28, 0.72);
  border-color: rgba(230, 232, 235, 0.12);
}
.sim-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-1, #0a4d6e);
  box-shadow: 0 0 0 0 rgba(10, 77, 110, 0.55);
  animation: simPulse 2.1s ease-in-out infinite;
}
@keyframes simPulse {
  0%   { box-shadow: 0 0 0 0 rgba(10, 77, 110, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(10, 77, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 77, 110, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sim-dot { animation: none; }
}

.sim-caption {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
  color: var(--ink-2, #475569);
  font-family: var(--font-body, 'Inter Tight', sans-serif);
}
.sim-desc {
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0;
  color: var(--ink-2, #475569);
}
.sim-desc b { color: var(--ink, #0f1419); font-weight: 600; }
.sim-desc em { color: var(--accent-1, #0a4d6e); font-style: italic; }

.sim-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  padding-top: var(--space-4, 1rem);
  border-top: 1px solid var(--hairline, rgba(15, 20, 25, 0.08));
}
.sim-meta li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
}
.sim-meta .k {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
  color: var(--ink-3, #64748b);
}
.sim-meta .v {
  color: var(--ink, #0f1419);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

@media (max-width: 900px) {
  .sim-figure { grid-template-columns: 1fr; gap: var(--space-5, 1.5rem); }
  .sim-media { aspect-ratio: 16 / 11; }
}

/* ===== PUBLICATIONS ===== */
.publications { background: #FFF8F0; }
.pub-controls { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; justify-content: center; }
.pub-search {
  padding: 0.75rem 1.25rem; border-radius: 16px;
  border: 1px solid rgba(91, 191, 181, 0.2); background: #FFFFFF;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  width: 300px; max-width: 100%; outline: none; transition: all 0.3s ease;
  box-shadow: inset 2px 2px 4px rgba(45, 52, 54, 0.04), inset -1px -1px 3px rgba(255, 255, 255, 0.8);
}
.pub-search:focus { border-color: #5BBFB5; box-shadow: 0 0 0 3px rgba(91, 191, 181, 0.1), inset 2px 2px 4px rgba(45, 52, 54, 0.04); }
.pub-filter-group { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pub-filter-btn {
  padding: 0.5rem 1rem; border-radius: 14px; border: none;
  background: #FFFFFF; font-family: 'Inter', sans-serif;
  font-size: 0.8rem; font-weight: 500; color: #666; cursor: pointer; transition: all 0.25s ease;
  box-shadow: 4px 4px 8px rgba(45, 52, 54, 0.05), -2px -2px 6px rgba(255, 255, 255, 0.9), inset 1px 1px 2px rgba(255, 255, 255, 0.5);
}
.pub-filter-btn:hover { color: #5BBFB5; }
.pub-filter-btn.active { background: linear-gradient(145deg, #5BBFB5, #4aa89f); color: #fff; box-shadow: 4px 4px 8px rgba(91, 191, 181, 0.2), -2px -2px 6px rgba(255, 255, 255, 0.5); }
.pub-list { display: flex; flex-direction: column; gap: 1rem; max-height: 900px; overflow-y: auto; padding-right: 0.5rem; }
.pub-list::-webkit-scrollbar { width: 6px; }
.pub-list::-webkit-scrollbar-track { background: transparent; }
.pub-list::-webkit-scrollbar-thumb { background: rgba(91, 191, 181, 0.3); border-radius: 3px; }
.pub-item {
  padding: 1.5rem; border-radius: 20px; background: #FFFFFF;
  box-shadow: 6px 6px 12px rgba(45, 52, 54, 0.05), -3px -3px 8px rgba(255, 255, 255, 0.9), inset 2px 2px 4px rgba(255, 255, 255, 0.5), inset -1px -1px 2px rgba(45, 52, 54, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pub-item:hover { transform: translateX(4px); box-shadow: 8px 8px 16px rgba(91, 191, 181, 0.1), -4px -4px 10px rgba(255, 255, 255, 0.9), inset 2px 2px 4px rgba(255, 255, 255, 0.5); }
.pub-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; color: #2D3436; line-height: 1.5; }
.pub-meta { font-size: 0.82rem; color: #888; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.pub-year { background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85; padding: 0.15rem 0.6rem; border-radius: 8px; font-weight: 600; font-size: 0.75rem; }
.pub-journal { font-style: italic; }
.pub-citations { color: #D4A853; font-weight: 600; font-size: 0.8rem; }
.pub-citations svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.pub-count-info { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: #888; }

/* ===== GRANTS ===== */
.grants { background: radial-gradient(ellipse at 30% 40%, rgba(91, 191, 181, 0.04) 0%, transparent 50%), #FFF8F0; }
.grants-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; }
.grant-card { padding: 1.75rem; transition: transform 0.3s ease; }
.grant-card:hover { transform: translateY(-3px); }
.grant-card h3 { font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600; line-height: 1.5; margin-bottom: 0.75rem; }
.grant-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.grant-tag { font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.grant-tag.ongoing { background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85; }
.grant-tag.completed { background: linear-gradient(145deg, #fde8e4, #fad5cd); color: #c46b6b; }
.grant-year { font-size: 0.82rem; color: #888; font-weight: 500; }

/* ===== SUPERVISION ===== */
.supervision { background: #FFF8F0; }
.sup-section-label {
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px; color: #5BBFB5;
  margin-bottom: 1.25rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(91, 191, 181, 0.15);
}
.sup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.sup-card { padding: 1.5rem; transition: transform 0.3s ease; }
.sup-card:hover { transform: translateY(-3px); }
.sup-card .sup-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.sup-card .sup-role { font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 8px; display: inline-block; margin-bottom: 0.5rem; }
.sup-role.supervisor { background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85; }
.sup-role.cosupervisor { background: linear-gradient(145deg, #fde8e4, #fad5cd); color: #c46b6b; }
.sup-card .sup-topic { font-size: 0.85rem; color: #666; line-height: 1.5; }
.sup-card .sup-status { font-size: 0.78rem; font-weight: 500; margin-top: 0.5rem; }
.sup-status.ongoing { color: #5BBFB5; }
.sup-status.graduated { color: #D4A853; }

/* ===== COURSES ===== */
.courses { background: radial-gradient(ellipse at 60% 70%, rgba(212, 168, 83, 0.04) 0%, transparent 50%), #FFF8F0; }
.courses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; }
.course-card { padding: 2rem; transition: transform 0.3s ease; }
.course-card:hover { transform: translateY(-3px); }
.course-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; gap: 1rem; }
.course-header h3 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.course-code { font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85; white-space: nowrap; }
.course-sem { font-size: 0.8rem; color: #888; margin-bottom: 1rem; font-weight: 500; }
.resource-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.resource-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem; border-radius: 14px;
  background: rgba(255, 248, 240, 0.6); border: 1px solid rgba(91, 191, 181, 0.08);
  transition: all 0.25s ease;
}
.resource-item:hover { background: rgba(91, 191, 181, 0.06); border-color: rgba(91, 191, 181, 0.15); }
.resource-icon { font-size: 1.1rem; flex-shrink: 0; width: 28px; text-align: center; }
.resource-info { flex: 1; min-width: 0; }
.resource-info .resource-name { font-size: 0.85rem; font-weight: 500; color: #2D3436; }
.resource-info .resource-type { font-size: 0.72rem; color: #888; }
.resource-link {
  font-size: 0.78rem; font-weight: 600; color: #5BBFB5; text-decoration: none;
  padding: 0.3rem 0.75rem; border-radius: 10px;
  background: linear-gradient(145deg, #e8f6f4, #d4efec);
  transition: all 0.25s ease; white-space: nowrap; cursor: pointer;
}
.resource-link:hover { transform: translateY(-1px); }

/* ===== GALLERY ===== */
.gallery { background: radial-gradient(ellipse at 60% 30%, rgba(212, 168, 83, 0.04) 0%, transparent 50%), #FFF8F0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 700px; margin: 0 auto; }
.gallery-item {
  border-radius: 24px; overflow: hidden;
  box-shadow: 8px 8px 16px rgba(45, 52, 54, 0.08), -4px -4px 12px rgba(255, 255, 255, 0.9), inset 2px 2px 4px rgba(255, 255, 255, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.8);
}
.gallery-item img { width: 100%; height: 260px; object-fit: cover; display: block; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption { padding: 1rem 1.25rem; background: #FFFFFF; font-size: 0.85rem; color: #666; text-align: center; }

/* ===== BLOG ===== */
.blog { background: radial-gradient(ellipse at 40% 60%, rgba(91, 191, 181, 0.05) 0%, transparent 50%), #FFF8F0; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; }
.blog-card {
  padding: 2rem; text-decoration: none; color: #2D3436; display: block; cursor: pointer;
  transition: transform 0.3s ease;
}
.blog-card:hover { transform: translateY(-4px); }
.blog-card-date { font-size: 0.78rem; color: #5BBFB5; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.blog-card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.75rem; color: #2D3436; }
.blog-card-excerpt { font-size: 0.88rem; color: #666; line-height: 1.7; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-read-more { font-size: 0.85rem; font-weight: 600; color: #5BBFB5; }

/* ===== BLOG ARTICLE ===== */
.blog-article { padding-top: 2rem; padding-bottom: 4rem; background: #FFF8F0; }
.blog-article-content { max-width: 780px; margin: 0 auto; padding: 2.5rem; }
.blog-article-content p { font-size: 1rem; color: #444; line-height: 1.9; margin-bottom: 1.5rem; text-align: justify; }
.blog-article-content p:last-child { margin-bottom: 0; }

/* ===== CONTACT ===== */
.contact { background: radial-gradient(ellipse at 50% 80%, rgba(91, 191, 181, 0.05) 0%, transparent 50%), #FFF8F0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.contact-form { padding: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: #2D3436; margin-bottom: 0.4rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.75rem 1rem; border-radius: 14px;
  border: 1px solid rgba(91, 191, 181, 0.15); background: rgba(255, 248, 240, 0.6);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; color: #2D3436;
  outline: none; transition: all 0.3s ease;
  box-shadow: inset 2px 2px 4px rgba(45, 52, 54, 0.03), inset -1px -1px 3px rgba(255, 255, 255, 0.8);
}
.form-group input:focus, .form-group textarea:focus { border-color: #5BBFB5; box-shadow: 0 0 0 3px rgba(91, 191, 181, 0.1), inset 2px 2px 4px rgba(45, 52, 54, 0.03); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-submit {
  width: 100%; padding: 0.85rem; border-radius: 16px; border: none;
  background: linear-gradient(145deg, #5BBFB5, #4aa89f); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 6px 6px 12px rgba(91, 191, 181, 0.2), -3px -3px 8px rgba(255, 255, 255, 0.5), inset 2px 2px 4px rgba(255, 255, 255, 0.2);
}
.form-submit:hover { transform: translateY(-2px); box-shadow: 8px 8px 16px rgba(91, 191, 181, 0.25), -4px -4px 10px rgba(255, 255, 255, 0.5); }
.contact-info { padding: 2rem; }
.contact-info h3 { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; }
.contact-detail { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: flex-start; }
.contact-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(145deg, #e8f6f4, #d4efec);
  box-shadow: 3px 3px 6px rgba(91, 191, 181, 0.1), -2px -2px 4px rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}
.contact-detail p { font-size: 0.88rem; color: #555; line-height: 1.6; }
.contact-detail a { color: #5BBFB5; text-decoration: none; font-weight: 500; }
.contact-detail a:hover { text-decoration: underline; }
.contact-links { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.contact-link-btn {
  padding: 0.6rem 1.2rem; border-radius: 14px; text-decoration: none;
  font-size: 0.82rem; font-weight: 600; transition: all 0.25s ease;
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
}
.contact-link-btn.scholar {
  background: linear-gradient(145deg, #e8f6f4, #d4efec); color: #3a8f85;
  box-shadow: 4px 4px 8px rgba(91, 191, 181, 0.1), -2px -2px 6px rgba(255, 255, 255, 0.8);
}
.contact-link-btn.iium {
  background: linear-gradient(145deg, #fde8e4, #fad5cd); color: #c46b6b;
  box-shadow: 4px 4px 8px rgba(240, 128, 128, 0.1), -2px -2px 6px rgba(255, 255, 255, 0.8);
}
.contact-link-btn:hover { transform: translateY(-2px); }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 2rem 1.5rem; background: #FFF8F0; border-top: 1px solid rgba(91, 191, 181, 0.1); font-size: 0.82rem; color: #999; }

/* ===== ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { transition: none; opacity: 1; transform: none; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero-photo-wrapper { order: -1; }
  .hero-photo { width: 240px; height: 240px; }
  .hero-keywords { justify-content: center; }
  .hero-tagline { text-align: center; border-left: none; border-top: 3px solid #F08080; padding-left: 0; padding-top: 0.75rem; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .grants-grid { grid-template-columns: 1fr; }
  .courses-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 260px; height: 100vh;
    background: rgba(255, 248, 240, 0.98); backdrop-filter: blur(20px);
    flex-direction: column; padding: 5rem 1.5rem 2rem;
    transition: right 0.35s ease; box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; }
  section { padding: 3.5rem 1rem; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .sup-grid { grid-template-columns: 1fr; }
  .page-banner { padding-top: 100px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-photo { width: 200px; height: 200px; }
  .pub-search { width: 100%; }
  .quick-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   SCIENTIFIC FX — flow field, glyphs, card micro-animations
   ========================================================== */

/* Hero flow-field canvas sits under everything */
.hero { position: relative; }
.flow-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
  mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,1) 40%, rgba(0,0,0,0.25) 90%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,1) 40%, rgba(0,0,0,0.25) 90%);
}
.hero-grid { z-index: 2; }

/* Floating glyph layer */
.glyph-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.sci-glyph {
  position: absolute;
  opacity: 0.12;
  color: #5BBFB5;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  animation: glyphDrift 22s ease-in-out infinite;
}
.sci-glyph.amber { color: #F5A623; opacity: 0.1; }
.sci-glyph svg { display: block; width: 100%; height: 100%; }

.sci-glyph.g1 { top: 12%; left: 6%;   width: 70px;  height: 70px;  animation-duration: 24s; animation-delay: -3s; }
.sci-glyph.g2 { top: 22%; right: 8%;  width: 90px;  height: 90px;  animation-duration: 28s; animation-delay: -8s; }
.sci-glyph.g3 { bottom: 18%; left: 10%; width: 60px; height: 60px; animation-duration: 20s; animation-delay: -14s; }
.sci-glyph.g4 { top: 58%; right: 18%; width: 80px;  height: 80px;  animation-duration: 26s; animation-delay: -5s; }
.sci-glyph.g5 { top: 8%;  left: 45%;  width: 50px;  height: 50px;  animation-duration: 18s; animation-delay: -11s; }
.sci-glyph.g6 { bottom: 10%; right: 35%; width: 65px; height: 65px; animation-duration: 22s; animation-delay: -2s; }

@keyframes glyphDrift {
  0%,100% { transform: translate3d(0,0,0) rotate(0deg); }
  33%     { transform: translate3d(10px,-14px,0) rotate(6deg); }
  66%     { transform: translate3d(-12px,8px,0) rotate(-6deg); }
}
@media (max-width: 768px) {
  .sci-glyph.g5, .sci-glyph.g6 { display: none; }
  .flow-canvas { opacity: 0.5; }
}

/* ==========================================================
   RESEARCH CARD MICRO-ANIMATIONS (play on hover/focus)
   ========================================================== */
.research-card { position: relative; overflow: hidden; }
.research-card::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at var(--mx,50%) var(--my,50%),
      rgba(91,191,181,0.10) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.research-card:hover::after { opacity: 1; }

.research-icon { position: relative; overflow: visible; }
.research-icon svg { transition: transform 0.35s ease; }

/* gear spin — CFD card */
.research-card .fx-spin {
  transform-origin: 50% 50%;
  animation: fxSpin 6s linear infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-spin { animation-play-state: running; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* streamlines flow — jet card */
.research-card .fx-dash {
  stroke-dasharray: 6 6;
  animation: fxDash 1.4s linear infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-dash { animation-play-state: running; }
@keyframes fxDash { to { stroke-dashoffset: -48; } }

/* MHD field pulse */
.research-card .fx-pulse {
  transform-origin: center;
  animation: fxPulse 1.8s ease-in-out infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-pulse { animation-play-state: running; }
@keyframes fxPulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%     { transform: scale(1.12); opacity: 0.65; }
}

/* oscillating wave — flow stability card */
.research-card .fx-wave {
  animation: fxWave 2s ease-in-out infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-wave { animation-play-state: running; }
@keyframes fxWave {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}

/* vortex rotation — wake card */
.research-card .fx-vortex {
  transform-origin: 50% 50%;
  animation: fxSpin 4s linear infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-vortex { animation-play-state: running; }

/* instrument ping — passive control / shield card */
.research-card .fx-ping {
  transform-origin: center;
  animation: fxPing 2s ease-out infinite;
  animation-play-state: paused;
}
.research-card.fx-play .fx-ping { animation-play-state: running; }
@keyframes fxPing {
  0%   { transform: scale(0.9); opacity: 0.9; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Floating card lift on hover (works for research & quick cards) */
.research-card, .quick-card {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s ease, box-shadow 0.35s ease;
}
.research-card:hover, .quick-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(91, 191, 181, 0.14), 0 0 0 1px rgba(91,191,181,0.14) inset;
}

/* ==========================================================
   SECTION FLOW-WAVE DIVIDER
   ========================================================== */
.flow-divider {
  display: block;
  width: 100%; height: 60px;
  margin: 0; padding: 0;
  background: transparent;
  pointer-events: none;
}
.flow-divider svg { width: 100%; height: 100%; display: block; }
.flow-divider .wline {
  fill: none;
  stroke: rgba(91, 191, 181, 0.22);
  stroke-width: 1.2;
  stroke-dasharray: 4 8;
  animation: flowLine 18s linear infinite;
}
.flow-divider .wline.amber { stroke: rgba(245, 166, 35, 0.16); animation-duration: 26s; animation-direction: reverse; }
@keyframes flowLine { to { stroke-dashoffset: -240; } }

/* ==========================================================
   PREFERS-REDUCED-MOTION — kill everything
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .sci-glyph, .research-card .fx-spin, .research-card .fx-dash,
  .research-card .fx-pulse, .research-card .fx-wave, .research-card .fx-vortex,
  .research-card .fx-ping, .flow-divider .wline {
    animation: none !important;
  }
  .flow-canvas { display: none; }
  .research-card:hover, .quick-card:hover { transform: none; }
}

/* Make page-banner able to host glyph layer (inner pages) */
.page-banner { position: relative; overflow: hidden; }
.page-banner .glyph-layer { opacity: 0.65; }
.page-banner .sci-glyph { opacity: 0.08; }
.page-banner .container { position: relative; z-index: 2; }

/* ============================================================
   STAGE B — Editorial hero + antigravity spotlight + particles + cursor
   Overrides the older .hero block above by cascade order.
   ============================================================ */

/* ---------- Body baseline for new design (incremental) ---------- */
body.has-tokens {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
}

/* ---------- Hero (editorial light) ---------- */
.hero.hero-v2 {
  position: relative;
  overflow: hidden;
  min-height: min(100vh, 920px);
  display: flex;
  align-items: center;
  padding-top: calc(var(--space-9) + 40px);
  padding-bottom: var(--space-9);
  background:
    radial-gradient(ellipse 1200px 600px at 20% 10%, rgba(255, 240, 210, 0.35), transparent 60%),
    radial-gradient(ellipse 900px 500px at 85% 90%, rgba(10, 77, 110, 0.04), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

/* Spotlight: radial brightening that follows the cursor.
   On LIGHT bg we use soft-light + warm cream → reads as a sunbeam. */
.hero.hero-v2::before {
  content: "";
  position: absolute;
  inset: -10%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    520px circle at var(--mouse-x, 50%) var(--mouse-y, 35%),
    var(--spot) 0%,
    var(--spot-outer) 55%
  );
  mix-blend-mode: soft-light;
  transition: opacity var(--dur-slow) var(--ease-out-expo);
  will-change: background;
}
html.no-antigravity .hero.hero-v2::before { opacity: 0.35; }

/* Additional quieter accent-1 glow that also tracks cursor */
.hero.hero-v2::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    800px circle at var(--mouse-x, 50%) var(--mouse-y, 35%),
    rgba(10, 77, 110, 0.06) 0%,
    transparent 45%
  );
  opacity: 0.9;
  mix-blend-mode: multiply;
}

/* Hero content wrapper sits above glow layers */
.hero.hero-v2 .hero-inner {
  position: relative;
  z-index: 4;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}

/* ---------- Editorial content ---------- */
.hero.hero-v2 .hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero.hero-v2 .hero-eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--ink-3);
}

.hero.hero-v2 h1.hero-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  margin: 0 0 var(--space-4) 0;
  position: relative;
}
.hero.hero-v2 h1.hero-display .italicize {
  font-style: italic;
  color: var(--accent-1);
}
.hero.hero-v2 .hero-display-rule {
  display: block;
  margin-top: var(--space-3);
  width: 100%;
  max-width: 420px;
  height: 1px;
  background: currentColor;
  color: var(--hairline-strong);
  transform-origin: left;
  transform: scaleX(0);
  animation: heroRuleIn 900ms var(--ease-out-expo) 400ms forwards;
}
@keyframes heroRuleIn { to { transform: scaleX(1); } }

.hero.hero-v2 .hero-subhead {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  letter-spacing: var(--tracking-mono);
  margin-bottom: var(--space-5);
}
.hero.hero-v2 .hero-subhead .sep { color: var(--accent-2); padding: 0 .35em; }

.hero.hero-v2 .hero-bio {
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 54ch;
  margin-bottom: var(--space-6);
}
.hero.hero-v2 .hero-bio b {
  color: var(--ink);
  font-weight: 500;
}

/* Keyword tags — thin outlined chips (no pill gradient) */
.hero.hero-v2 .hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.hero.hero-v2 .hero-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-2);
  background: transparent;
  transition: border-color var(--dur-base) var(--ease-out-expo),
              color var(--dur-base) var(--ease-out-expo),
              background var(--dur-base) var(--ease-out-expo);
}
.hero.hero-v2 .hero-chip:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  background: var(--accent-1-soft);
}

/* Stat row — mono numbers + thin progress arc */
.hero.hero-v2 .hero-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
}
.hero.hero-v2 .hero-stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.hero.hero-v2 .hero-stat .hs-n {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
  display: block;
}
.hero.hero-v2 .hero-stat .hs-l {
  display: block;
  margin-top: var(--space-2);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Photo: organic blob clip-path ---------- */
.hero.hero-v2 .hero-portrait {
  position: relative;
  aspect-ratio: 1 / 1.05;
  width: 100%;
  max-width: 220px;
  margin-left: auto;
}
.hero.hero-v2 .hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Organic blob, deliberately imperfect so it doesn't feel geometric */
  clip-path: path('M 110,5 C 165,10 210,50 215,105 C 220,160 195,198 145,210 C 100,221 45,205 20,160 C -2.5,120 10,65 45,30 C 70,7.5 90,2.5 110,5 Z');
  -webkit-clip-path: path('M 110,5 C 165,10 210,50 215,105 C 220,160 195,198 145,210 C 100,221 45,205 20,160 C -2.5,120 10,65 45,30 C 70,7.5 90,2.5 110,5 Z');
  animation: portraitMorph 16s var(--ease-in-out) infinite alternate;
  filter: saturate(0.95) contrast(1.02);
}
@keyframes portraitMorph {
  0%   { transform: translateY(0) rotate(-0.6deg); }
  50%  { transform: translateY(-8px) rotate(0.4deg); }
  100% { transform: translateY(0) rotate(-0.2deg); }
}
.hero.hero-v2 .hero-portrait::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2-soft), transparent 60%);
  z-index: -1;
  filter: blur(24px);
}

/* Signature annotation floating beside portrait */
.hero.hero-v2 .hero-sig {
  position: absolute;
  bottom: -4px;
  left: -8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-elev);
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.hero.hero-v2 .hero-sig b { color: var(--ink); font-weight: 500; }

/* ---------- Particle layer (weightless drift) ---------- */
/* Curl-noise flow-field canvas (distill.pub-style hero backdrop) */
.hero.hero-v2 .flow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  /* Light-mode: multiply so ocean ink reads on warm cream without
     muddy black edges. Dark-mode uses screen so trails glow. */
  mix-blend-mode: multiply;
  opacity: 0.55;
  /* Feather the edges so streamlines dissolve into the hero bg */
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 55% 50%, #000 40%, transparent 95%);
          mask-image: radial-gradient(ellipse 90% 85% at 55% 50%, #000 40%, transparent 95%);
}
:root[data-theme="dark"] .hero.hero-v2 .flow-canvas { mix-blend-mode: screen; opacity: 0.7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero.hero-v2 .flow-canvas { mix-blend-mode: screen; opacity: 0.7; }
}

/* Static streamline sketch — gentle flowing lines behind particles */
.hero.hero-v2 .flow-streamlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  color: var(--accent-1);
  opacity: 0.35;
  /* Slow drift so the lines feel alive without distracting */
  animation: streamDrift 24s var(--ease-in-out) infinite alternate;
  will-change: transform;
}
.hero.hero-v2 .flow-streamlines g:first-of-type path {
  stroke-dasharray: 600 1400;
  animation: streamFlow 18s linear infinite;
}
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(2) { animation-duration: 20s; animation-delay: -3s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(3) { animation-duration: 22s; animation-delay: -6s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(4) { animation-duration: 19s; animation-delay: -2s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(5) { animation-duration: 24s; animation-delay: -8s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(6) { animation-duration: 21s; animation-delay: -5s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(7) { animation-duration: 23s; animation-delay: -11s; }
.hero.hero-v2 .flow-streamlines g:first-of-type path:nth-child(8) { animation-duration: 26s; animation-delay: -14s; }
@keyframes streamFlow {
  0%   { stroke-dashoffset: 2000; }
  100% { stroke-dashoffset: 0; }
}
@keyframes streamDrift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -6px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero.hero-v2 .flow-streamlines,
  .hero.hero-v2 .flow-streamlines g path { animation: none !important; }
  .hero.hero-v2 .flow-canvas { display: none; }
}

.hero.hero-v2 .particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.hero.hero-v2 .particle {
  position: absolute;
  opacity: 0;
  color: var(--accent-1);
  animation: partFadeIn 1400ms var(--ease-out-expo) forwards,
             partDrift 22s var(--ease-in-out) infinite;
  transform-origin: center;
  will-change: transform;
}
.hero.hero-v2 .particle.amber { color: var(--accent-2); }
.hero.hero-v2 .particle.sage  { color: var(--accent-3); }
.hero.hero-v2 .particle svg { width: 100%; height: 100%; display: block; }

/* Antigravity parallax: each particle shifts by (mouse - 50%) * weight.
   Because .particle has its own drift animation, we wrap the translate
   onto a CSS variable read by the drift keyframes too. */
.hero.hero-v2 .particle {
  --mx-shift: calc((var(--mouse-x, 50%) - 50%) * var(--w, 0.04));
  --my-shift: calc((var(--mouse-y, 50%) - 50%) * var(--w, 0.04));
  transition: transform 650ms var(--ease-out-expo);
}

/* Position + weight per particle */
.hero.hero-v2 .p1  { top:  8%; left:  6%; width: 56px; height: 56px; --w: 0.045; animation-delay: -2s,  -3s; }
.hero.hero-v2 .p2  { top: 18%; left: 42%; width: 44px; height: 44px; --w: 0.065; animation-delay: -1s,  -9s; }
.hero.hero-v2 .p3  { top: 12%; right: 8%; width: 64px; height: 64px; --w: 0.030; animation-delay: -3s, -13s; }
.hero.hero-v2 .p4  { top: 46%; left:  3%; width: 40px; height: 40px; --w: 0.075; animation-delay: -4s,  -5s; }
.hero.hero-v2 .p5  { top: 70%; left: 22%; width: 54px; height: 54px; --w: 0.050; animation-delay: -5s, -11s; }
.hero.hero-v2 .p6  { top: 80%; left: 48%; width: 36px; height: 36px; --w: 0.035; animation-delay: -6s, -14s; }
.hero.hero-v2 .p7  { top: 36%; right: 30%; width: 72px; height: 48px; --w: 0.060; animation-delay: -2s, -7s; }
.hero.hero-v2 .p8  { top: 72%; right: 18%; width: 42px; height: 42px; --w: 0.040; animation-delay: -4s, -16s; }
.hero.hero-v2 .p9  { top: 28%; right: 46%; width: 50px; height: 50px; --w: 0.055; animation-delay: -1s, -4s;  }
.hero.hero-v2 .p10 { top: 58%; left: 54%; width: 32px; height: 32px; --w: 0.020; animation-delay: -3s,  -8s; }
.hero.hero-v2 .p11 { top: 12%; left: 72%; width: 60px; height: 60px; --w: 0.070; animation-delay: -5s, -10s; }
.hero.hero-v2 .p12 { top: 88%; left: 10%; width: 38px; height: 38px; --w: 0.030; animation-delay: -6s, -12s; }
.hero.hero-v2 .p13 { top: 40%; right: 4%; width: 48px; height: 48px; --w: 0.050; animation-delay: -2s, -15s; }
.hero.hero-v2 .p14 { top: 62%; left: 40%; width: 34px; height: 34px; --w: 0.025; animation-delay: -3s,  -6s; }

@keyframes partFadeIn {
  to { opacity: var(--op, 0.14); }
}
.hero.hero-v2 .particle.amber { --op: 0.20; }
.hero.hero-v2 .particle.sage  { --op: 0.16; }

@keyframes partDrift {
  0%, 100% {
    transform: translate3d(
      calc(var(--mx-shift)),
      calc(var(--my-shift)),
      0
    ) rotate(0deg);
  }
  33% {
    transform: translate3d(
      calc(var(--mx-shift) + 10px),
      calc(var(--my-shift) - 14px),
      0
    ) rotate(4deg);
  }
  66% {
    transform: translate3d(
      calc(var(--mx-shift) - 12px),
      calc(var(--my-shift) + 8px),
      0
    ) rotate(-4deg);
  }
}

/* ---------- Custom cursor (dot + ring) ---------- */
/* Hide default cursor only when antigravity is live on a fine pointer */
html.ag-cursor-on,
html.ag-cursor-on * { cursor: none !important; }

.ag-cursor-dot,
.ag-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  will-change: transform;
  opacity: 0;
  transition: opacity 200ms var(--ease-out-expo);
}
html.ag-cursor-on .ag-cursor-dot,
html.ag-cursor-on .ag-cursor-ring { opacity: 1; }

.ag-cursor-dot {
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
}
.ag-cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: opacity 200ms, width 300ms var(--ease-out-expo),
              height 300ms var(--ease-out-expo),
              border-color 250ms, background 250ms;
}

/* Ring: link/button hover — expand + fill amber */
html.ag-cursor-on .ag-cursor-ring[data-mode="link"] {
  width: 48px; height: 48px;
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
  transform-origin: center;
}
html.ag-cursor-on .ag-cursor-ring[data-mode="link"] ~ .ag-cursor-dot { opacity: 0; }

/* Ring over text — thin I-beam */
html.ag-cursor-on .ag-cursor-ring[data-mode="text"] {
  width: 2px; height: 22px;
  border: none;
  background: var(--accent-1);
  border-radius: 1px;
  margin-left: 15px; margin-top: 5px;
}
html.ag-cursor-on .ag-cursor-ring[data-mode="text"] ~ .ag-cursor-dot { opacity: 0; }

/* Fallback cursor on unsupported contexts */
html.no-antigravity .ag-cursor-dot,
html.no-antigravity .ag-cursor-ring { display: none; }

/* ---------- Responsive / reduce-motion ---------- */
@media (max-width: 900px) {
  .hero.hero-v2 .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: left;
  }
  .hero.hero-v2 .hero-portrait {
    order: -1;
    max-width: 140px;
    margin: 0 auto;
  }
  .hero.hero-v2 .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }
  .hero.hero-v2 .particle-field { opacity: 0.6; }
}
@media (max-width: 520px) {
  .hero.hero-v2 .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero.hero-v2 .hero-stat:nth-child(4),
  .hero.hero-v2 .hero-stat:nth-child(5) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hero-v2 .particle { animation: none !important; opacity: 0.14 !important; }
  .hero.hero-v2 .hero-portrait img { animation: none !important; }
  .hero.hero-v2 .hero-display-rule { animation: none !important; transform: scaleX(1); }
  .ag-cursor-dot, .ag-cursor-ring { display: none !important; }
  html.ag-cursor-on, html.ag-cursor-on * { cursor: auto !important; }
}

/* ---------- Navbar adjustment for new hero ---------- */
body.has-tokens .navbar {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
}
body.has-tokens .nav-brand { font-family: var(--font-display); font-weight: 500; }
body.has-tokens .nav-brand span { color: var(--accent-1); }
body.has-tokens .nav-links a { font-family: var(--font-body); color: var(--ink-2); }
body.has-tokens .nav-links a:hover,
body.has-tokens .nav-links a.active {
  background: var(--accent-1-soft);
  color: var(--accent-1);
}

/* ---------- Focus ring upgrade ---------- */
body.has-tokens :focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   STAGE C — Shared upgrades across all pages (under body.has-tokens)
   ============================================================ */

/* ---------- Scroll-progress bar (top of viewport) ---------- */
body.has-tokens .nav-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  z-index: calc(var(--z-cursor) - 1);
  transform-origin: 0 50%;
  transition: width 90ms linear;
  pointer-events: none;
}

/* ---------- Nav-inner: group right-side items (nav-links + theme-toggle + hamburger) ---------- */
body.has-tokens .nav-inner {
  gap: 0.5rem;
}
body.has-tokens .nav-inner > .nav-brand { margin-right: auto; }

/* ---------- Tokenized navbar (layers on top of claymorphism navbar) ---------- */
body.has-tokens .navbar {
  background: rgba(250, 250, 247, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 20, 25, 0.06);
  box-shadow: none;
}
body.has-tokens .navbar.scrolled {
  background: rgba(250, 250, 247, 0.92);
  border-bottom-color: rgba(15, 20, 25, 0.10);
  box-shadow: 0 6px 24px -18px rgba(15, 20, 25, 0.25);
}
:root[data-theme="dark"] body.has-tokens .navbar {
  background: rgba(14, 16, 19, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
:root[data-theme="dark"] body.has-tokens .navbar.scrolled {
  background: rgba(14, 16, 19, 0.92);
}

body.has-tokens .nav-brand {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
body.has-tokens .nav-brand span {
  font-style: italic;
  color: var(--accent-1);
}

body.has-tokens .nav-links {
  position: relative;
  gap: 0.15rem;
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  background: transparent;
}
body.has-tokens .nav-links > li > a {
  position: relative;
  display: inline-block;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-sm);
  letter-spacing: -0.005em;
  color: var(--ink-3);
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast) var(--ease-out-expo);
  z-index: 1;
}
body.has-tokens .nav-links > li > a:hover,
body.has-tokens .nav-links > li > a.active {
  color: var(--ink);
  background: transparent;  /* the .nav-pill below is the indicator */
}
body.has-tokens .nav-links > li > a.active::after { display: none; }

/* The sliding pill indicator */
body.has-tokens .nav-pill {
  position: absolute;
  top: 0.35rem;
  left: 0;
  height: calc(100% - 0.7rem);
  width: 0;
  background: rgba(10, 77, 110, 0.08);
  border: 1px solid rgba(10, 77, 110, 0.12);
  border-radius: var(--radius-pill);
  z-index: 0;
  transition:
    transform 380ms var(--ease-out-expo),
    width     380ms var(--ease-out-expo),
    opacity   220ms var(--ease-out-expo);
  opacity: 0;
  pointer-events: none;
}
body.has-tokens .nav-pill.ready { opacity: 1; }
:root[data-theme="dark"] body.has-tokens .nav-pill {
  background: rgba(136, 200, 230, 0.10);
  border-color: rgba(136, 200, 230, 0.18);
}

/* ---------- Theme toggle button ---------- */
body.has-tokens .theme-toggle {
  --sz: 38px;
  width: var(--sz); height: var(--sz);
  display: inline-grid;
  place-items: center;
  margin-left: 0.5rem;
  border: 1px solid rgba(15, 20, 25, 0.12);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out-expo),
    background var(--dur-fast) var(--ease-out-expo),
    border-color var(--dur-fast) var(--ease-out-expo),
    transform 220ms var(--ease-out-expo);
}
body.has-tokens .theme-toggle:hover {
  color: var(--accent-1);
  border-color: rgba(10, 77, 110, 0.3);
  background: rgba(10, 77, 110, 0.06);
}
body.has-tokens .theme-toggle:active { transform: scale(0.94); }
body.has-tokens .theme-toggle svg { width: 18px; height: 18px; }
body.has-tokens .theme-toggle .sun  { display: none; }
body.has-tokens .theme-toggle .moon { display: block; }
:root[data-theme="dark"] body.has-tokens .theme-toggle {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-3);
}
:root[data-theme="dark"] body.has-tokens .theme-toggle .sun  { display: block; }
:root[data-theme="dark"] body.has-tokens .theme-toggle .moon { display: none;  }

/* View-transition for theme swap (Chrome/Edge) */
@supports (view-transition-name: root) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 520ms;
    animation-timing-function: var(--ease-out-expo);
  }
  ::view-transition-old(root) { animation-name: fade-out; }
  ::view-transition-new(root) { animation-name: fade-in;  }
  @keyframes fade-out { to   { opacity: 0; } }
  @keyframes fade-in  { from { opacity: 0; } }
}

/* ---------- Page banner v2 (applied to all non-home pages) ---------- */
body.has-tokens .page-banner.page-banner-v2 {
  position: relative;
  padding: clamp(5rem, 3rem + 8vw, 9rem) 0 clamp(3rem, 2rem + 4vw, 5rem);
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(255, 240, 210, 0.45), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elev) 100%);
  overflow: hidden;
  border-bottom: 1px solid rgba(15, 20, 25, 0.06);
}
body.has-tokens .page-banner.page-banner-v2 .container {
  position: relative;
  z-index: 2;
  text-align: center;
}
body.has-tokens .page-banner.page-banner-v2 h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.8rem + 3.2vw, 4.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
body.has-tokens .page-banner.page-banner-v2 .banner-desc {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--ink-3);
  max-width: 54ch;
  margin: 0 auto;
  letter-spacing: -0.005em;
}
body.has-tokens .page-banner.page-banner-v2 .underline-accent {
  margin: 1.25rem auto 0;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 2px;
  opacity: 0.9;
}

/* ---------- Section header tokenization (section-header inside has-tokens) ---------- */
body.has-tokens .section-header .section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}
body.has-tokens .section-header .section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-1);
  opacity: 0.85;
}
body.has-tokens .section-header .underline-accent {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  opacity: 0.9;
}

/* ---------- Drop-cap (long-form article) ---------- */
body.has-tokens .blog-article-content.drop-cap > p:first-of-type {
  font-size: var(--fs-lg);
  line-height: 1.65;
  color: var(--ink-2);
}
body.has-tokens .blog-article-content.drop-cap > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 4.8em;
  float: left;
  line-height: 0.85;
  padding: 0.12em 0.12em 0 0;
  margin: 0.06em 0.08em 0 0;
  color: var(--accent-1);
  font-style: italic;
}
body.has-tokens .blog-article-content {
  font-family: var(--font-body);
  color: var(--ink-2);
}
body.has-tokens .blog-article-content p {
  font-size: var(--fs-md);
  line-height: 1.75;
  margin: 0 0 1.25em;
  max-width: 68ch;
}

/* ---------- Tokenized form controls (contact form) ---------- */
body.has-tokens .contact-form input,
body.has-tokens .contact-form textarea,
body.has-tokens .contact-form select {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  transition: border-color var(--dur-fast) var(--ease-out-expo),
              box-shadow   var(--dur-fast) var(--ease-out-expo),
              background   var(--dur-fast) var(--ease-out-expo);
}
body.has-tokens .contact-form input:focus,
body.has-tokens .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(10, 77, 110, 0.15);
  background: var(--bg);
}
body.has-tokens .contact-form .form-submit {
  font-family: var(--font-body);
  font-weight: 600;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.4rem;
  transition: transform 180ms var(--ease-out-expo),
              background var(--dur-fast) var(--ease-out-expo);
}
body.has-tokens .contact-form .form-submit:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  transform: translateY(-1px);
}

/* ---------- Footer tokenization ---------- */
body.has-tokens .footer {
  background: var(--bg-sunk);
  color: var(--ink-4);
  border-top: 1px solid rgba(15, 20, 25, 0.06);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
}
body.has-tokens .footer p { color: var(--ink-4); }

/* ---------- Responsive: restore mobile drawer under has-tokens ----------
   The has-tokens .nav-links rule sets position:relative (for the pill),
   which breaks the original @(max-width:768px) fixed off-canvas drawer.
   This block re-applies the drawer specifically for tokenized pages. */
@media (max-width: 768px) {
  body.has-tokens .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    gap: 0.5rem;
    background: rgba(250, 250, 247, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(15, 20, 25, 0.06);
    border-radius: 0;
    transition: right 0.35s var(--ease-out-expo);
    z-index: calc(var(--z-cursor) - 2);
  }
  :root[data-theme="dark"] body.has-tokens .nav-links {
    background: rgba(14, 16, 19, 0.98);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  }
  body.has-tokens .nav-links.open { right: 0; }
  body.has-tokens .nav-links > li > a {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: var(--fs-md);
  }
  /* Hide the sliding pill on mobile — the drawer has no use for it */
  body.has-tokens .nav-pill { display: none; }
}

/* ---------- Responsive: ultra-narrow tweaks ---------- */
@media (max-width: 520px) {
  body.has-tokens .theme-toggle { --sz: 34px; margin-left: 0.25rem; }
  body.has-tokens .nav-progress { height: 1.5px; }
}

/* ---------- Dark-mode section background bridging ----------
   The pre-existing claymorphism sections hardcode cream #FFF8F0.
   When data-theme=dark, remap those section backgrounds + surfaces
   to the token scale so the whole page shifts coherently. */
:root[data-theme="dark"] body.has-tokens {
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme="dark"] body.has-tokens .about,
:root[data-theme="dark"] body.has-tokens .research,
:root[data-theme="dark"] body.has-tokens .publications,
:root[data-theme="dark"] body.has-tokens .grants,
:root[data-theme="dark"] body.has-tokens .supervision,
:root[data-theme="dark"] body.has-tokens .courses,
:root[data-theme="dark"] body.has-tokens .quick-links,
:root[data-theme="dark"] body.has-tokens .gallery,
:root[data-theme="dark"] body.has-tokens .contact,
:root[data-theme="dark"] body.has-tokens .blog,
:root[data-theme="dark"] body.has-tokens .blog-article {
  background: var(--bg);
  color: var(--ink-2);
}
:root[data-theme="dark"] body.has-tokens .page-banner {
  background: var(--bg-elev);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
/* Claymorphism cards need lifted surface + adjusted shadow in dark mode */
:root[data-theme="dark"] body.has-tokens .clay {
  background: var(--bg-elev);
  color: var(--ink-2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 10px 30px -18px rgba(0, 0, 0, 0.65),
    0 2px 8px -4px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
:root[data-theme="dark"] body.has-tokens .clay:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 40px -16px rgba(0, 0, 0, 0.7),
    0 3px 10px -4px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] body.has-tokens .clay h3,
:root[data-theme="dark"] body.has-tokens .clay h4 {
  color: var(--ink);
}
:root[data-theme="dark"] body.has-tokens .clay p,
:root[data-theme="dark"] body.has-tokens .clay li,
:root[data-theme="dark"] body.has-tokens .clay span {
  color: var(--ink-3);
}
/* Keyword / filter pills in dark */
:root[data-theme="dark"] body.has-tokens .keyword-tag,
:root[data-theme="dark"] body.has-tokens .pub-filter-btn,
:root[data-theme="dark"] body.has-tokens .year-badge,
:root[data-theme="dark"] body.has-tokens .sponsor-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2);
  border-color: rgba(255, 255, 255, 0.1);
}
:root[data-theme="dark"] body.has-tokens .pub-search,
:root[data-theme="dark"] body.has-tokens .search-box input,
:root[data-theme="dark"] body.has-tokens input,
:root[data-theme="dark"] body.has-tokens textarea {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.12);
}
/* Flow-divider paths brighten in dark */
:root[data-theme="dark"] body.has-tokens .flow-divider { background: var(--bg); }
:root[data-theme="dark"] body.has-tokens .flow-divider .wline {
  stroke: rgba(136, 200, 230, 0.35);
}
:root[data-theme="dark"] body.has-tokens .flow-divider .wline.amber {
  stroke: rgba(252, 211, 77, 0.35);
}
/* About education list */
:root[data-theme="dark"] body.has-tokens .edu-item p { color: var(--ink-2); }
:root[data-theme="dark"] body.has-tokens .edu-uni      { color: var(--ink-3); }
/* Blog-card hover in dark */
:root[data-theme="dark"] body.has-tokens .blog-card:hover .blog-card-title {
  color: var(--accent-1);
}

/* ---------- Reduced motion for Stage-C additions ---------- */
@media (prefers-reduced-motion: reduce) {
  body.has-tokens .nav-progress,
  body.has-tokens .nav-pill,
  body.has-tokens .theme-toggle {
    transition: none !important;
  }
}
