/* ═══════════════════════════════════════════════════
   DESIGN SYSTEM — Neumorphic Sage
   ═══════════════════════════════════════════════════ */

:root {
  /* Palette — dimmer and warmer than a fresh-mint photograph; this is the
     reference panel as it actually appears under soft indirect light, with
     the wall's warm-gray pulling the whole scene down. */
  --bg:             #C9D2BC;  /* page bg — dim, slightly warm sage */
  --surface:        #B4BFA5;  /* projects-bg & similar layered surfaces */
  --surface-light:  #C2CDB3;
  --surface-dark:   #97A188;
  --card:           #E4DFD2;  /* warm off-white — never pure white */
  --card-highlight: #EDE8DA;  /* highlight side of neu shadow */
  --card-shadow:    #AFA89B;  /* shadow side — warm gray, not cool */

  --text-primary:   #232E26;
  --text-secondary: #4A584D;
  --text-muted:     #74806E;
  --accent:         #6B9B6F;
  --accent-dark:    #4F7A55;

  /* Per-section tints — same dim-sage family, ±5% luminance and small hue
     shifts. Subtle enough that no section feels like a different theme,
     distinct enough that the eye registers each as its own "page". */
  --bg-hero:         #CDD3BB;
  --bg-about:        #C9D2BC;  /* matches --bg, the "neutral" tone */
  --bg-projects:     #B6BFA6;  /* darkest — the recessed module */
  --bg-publications: #C0CDB8;
  --bg-contact:      #C6CCB7;

  /* LEDs */
  --led-cyan:   #3BF1FF;
  --led-yellow: #FDE86F;
  --led-pink:   #FFAAD2;
  --led-green:  #39FF6A;
  --led-blue:   #9BAECB;
  --led-coral:  #E89AA8;

  /* Typography */
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Neumorphic shadows — tight, defined edges. Real hardware has crisp plastic
     edges with soft cast shadows. We mimic that: tight blur radius for edge
     definition, paired with a 1px hairline-shadow that gives every "object"
     a clear silhouette against the dim sage. */
  --neu-raised:
    -2px -2px 4px var(--card-highlight),
    2px 2px 4px var(--card-shadow),
    0 0 0 1px rgba(151, 161, 136, 0.20);
  --neu-pressed:
    inset 2px 2px 4px rgba(35, 46, 38, 0.14),
    inset -2px -2px 4px rgba(237, 232, 218, 0.6),
    0 0 0 1px rgba(151, 161, 136, 0.20);
  --neu-hover:
    -1px -1px 3px var(--card-highlight),
    1px 1px 3px var(--card-shadow),
    0 0 0 1px rgba(151, 161, 136, 0.30);
  --neu-surface:
    -4px -4px 10px var(--surface-light),
    4px 4px 10px var(--surface-dark),
    0 0 0 1px rgba(151, 161, 136, 0.18);

  /* Layout */
  --section-pad-y: clamp(80px, 10vw, 140px);
  --content-max:   1200px;
  --nav-height:    72px;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  scroll-snap-type: y mandatory;
}

.snap-section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* Non-hero sections fit exactly between the bottom of the fixed nav
     and the bottom of the viewport — no wiggle room, no overflow. */
  min-height: calc(100vh - var(--nav-height));
  box-sizing: border-box;
}

/* Hero is special: it starts at scrollY=0, so the nav overlays it.
   It needs to fill the full viewport, with content padded down to clear nav. */
#hero.snap-section {
  min-height: 100vh;
}

/* Vertically center content in non-hero snap sections. */
.snap-section:not(#hero) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#hero {
  position: relative;
  background: var(--bg-hero);
}

#about        { background: var(--bg-about); }
.projects-bg  { background: var(--bg-projects); }
#publications { background: var(--bg-publications); }
#contact      { background: var(--bg-contact); }

/* For non-hero snap sections, the inner .section is the content container.
   Section sits below the nav (snap aligns its top to nav-height), so the
   inner padding is just breathing room — no nav-clearance needed. */
.snap-section:not(#hero) .section {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* On short viewports, fall back to proximity snap so users aren't trapped
   in over-tall sections. */
@media (max-height: 720px) {
  html { scroll-snap-type: y proximity; }
  .snap-section { min-height: auto; }
  .snap-section:not(#hero) .section {
    padding-top: 60px;
    padding-bottom: 80px;
  }
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.site-nav.scrolled {
  background: rgba(201, 210, 188, 0.55);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: 0 1px 0 rgba(35, 46, 38, 0.05);
}

.nav-inner {
  width: 100%;
  max-width: var(--content-max);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand .brand-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led-coral);
  box-shadow: 0 0 6px rgba(232, 154, 168, 0.6);
  animation: ledPulse 2.6s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.nav-brand-text {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-brand .brand-status {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 8px;
  border-left: 1px solid var(--surface-dark);
  margin-left: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.25s ease;
  position: relative;
}

.nav-links a .nav-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nav-links a .nav-led.cyan   { background: #BBDDDE; }
.nav-links a .nav-led.yellow { background: #E5D59C; }
.nav-links a .nav-led.pink   { background: #DABBD2; }
.nav-links a .nav-led.green  { background: #B4DFB8; }
.nav-links a .nav-led.blue   { background: var(--led-blue); opacity: 0.5; }

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(194, 223, 184, 0.35);
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--card);
  box-shadow: var(--neu-hover);
}

.nav-links a.active .nav-led.cyan   { background: var(--led-cyan);   box-shadow: 0 0 10px 3px rgba(59,241,255,0.6); }
.nav-links a.active .nav-led.yellow { background: var(--led-yellow); box-shadow: 0 0 10px 3px rgba(253,232,111,0.6); }
.nav-links a.active .nav-led.pink   { background: var(--led-pink);   box-shadow: 0 0 10px 3px rgba(255,170,210,0.6); }
.nav-links a.active .nav-led.green  { background: var(--led-green);  box-shadow: 0 0 10px 3px rgba(57,255,106,0.6); }
.nav-links a.active .nav-led.blue   { background: var(--led-blue);   box-shadow: 0 0 10px 3px rgba(155,174,203,0.6); opacity: 1; }

.nav-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 16px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--neu-raised);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.nav-cv-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--neu-hover);
  color: var(--accent);
}

.nav-cv-btn:active {
  transform: translateY(0);
  box-shadow: var(--neu-pressed);
}

.cv-btn-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════
   SECTIONS – Common
   ═══════════════════════════════════════════════════ */

.section {
  padding: var(--section-pad-y) 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.section-label .label-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.section-label .label-led.cyan   { background: var(--led-cyan);   box-shadow: 0 0 8px rgba(59,241,255,0.5); }
.section-label .label-led.yellow { background: var(--led-yellow); box-shadow: 0 0 8px rgba(253,232,111,0.5); }
.section-label .label-led.pink   { background: var(--led-pink);   box-shadow: 0 0 8px rgba(255,170,210,0.5); }
.section-label .label-led.green  { background: var(--led-green);  box-shadow: 0 0 8px rgba(57,255,106,0.5); }

.section-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* ── Scroll reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Section dividers */
.section-divider {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-divider .divider-line {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface-dark) 20%,
    var(--surface-dark) 80%,
    transparent 100%
  );
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════ */

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-height) + 40px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-text-block {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.hero-name {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-tagline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-tagline-line {
  display: block;
}

.hero-tagline-line:first-child {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-tagline-line:last-child {
  color: var(--text-secondary);
  max-width: 38ch;
}

.hero-tagline .typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-subtitle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  box-shadow: -2px -2px 5px var(--surface-light), 2px 2px 5px var(--surface-dark);
}

.hero-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(76,175,80,0.5);
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 0.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 14px;
  background: var(--card);
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--neu-raised);
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: -8px -8px 18px var(--card-highlight), 8px 8px 18px var(--card-shadow);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--neu-pressed);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  background: transparent;
  border: 2px solid var(--surface-dark);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--surface);
  transform: translateY(-2px);
}

/* Hero photo */
.hero-photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo-frame {
  width: clamp(280px, 28vw, 420px);
  height: clamp(340px, 34vw, 500px);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow:
    var(--neu-surface),
    inset 0 0 0 4px rgba(237, 232, 218, 0.4);
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(0.98) saturate(0.78) brightness(0.96);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.hero-photo-frame:hover img {
  filter: contrast(1.02) saturate(0.88) brightness(1);
}

.hero-photo-frame:hover img {
  transform: scale(1.03);
}

/* Decorative elements around photo */
.hero-photo-wrapper::before {
  content: '';
  position: absolute;
  width: clamp(280px, 28vw, 420px);
  height: clamp(340px, 34vw, 500px);
  border-radius: 28px;
  border: 2px dashed var(--surface-dark);
  opacity: 0.3;
  transform: translate(12px, 12px);
  z-index: -1;
}

.hero-photo-wrapper {
  position: relative;
}

/* Hero scroll hint — small, calm, signal-only */
.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  animation: heroScrollPulse 2.6s ease-in-out infinite;
}

.hero-scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  display: block;
}

@keyframes heroScrollPulse {
  0%, 100% { opacity: 0.45; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 0.85; transform: translateX(-50%) translateY(4px); }
}

/* Old scroll-hint (unused) — kept for backward compat, can remove later */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-hint .scroll-line {
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ═══════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════ */

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  margin-top: 2rem;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
}

.about-text .highlight {
  color: var(--accent);
  font-weight: 600;
}


/* Milestones */
.milestones {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.milestone-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--neu-raised);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.milestone-card:hover {
  transform: translateY(-3px);
  box-shadow: -8px -8px 18px var(--card-highlight), 8px 8px 18px var(--card-shadow);
}

/* Award cards — a slight visual cue (★ marker) is enough to distinguish
   them from position cards. No background tint, no recolored year pill. */
.milestone-award-star {
  color: #d9a441;
  margin-right: 0.45em;
  font-size: 0.95em;
  line-height: 1;
}

.milestone-year {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(76,175,80,0.1);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.milestone-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.milestone-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   PROJECTS SECTION
   ═══════════════════════════════════════════════════ */

.projects-bg {
  border-radius: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 2rem;
}

@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* "View all" tile — different visual register from the project tiles */
.project-card--all {
  background: transparent;
  box-shadow: none;
  border: 2px dashed var(--surface-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  padding: 32px;
  border-radius: 20px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.project-card--all::before { display: none; }
.project-card--all:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: var(--accent);
  border-style: solid;
  transform: translateY(-3px);
  box-shadow: none;
}
.card-all-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.card-all-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.card-all-arrow {
  font-size: 1.4rem;
  color: var(--accent);
  margin-top: 4px;
  transition: transform 0.25s ease;
}
.project-card--all:hover .card-all-arrow {
  transform: translateX(6px);
}
.card-all-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* Flat content tile — deliberately NOT a button. The music-board buttons
   (nav, CV knob) get the neumorphic treatment; project cards stay flat
   so the two visual languages don't compete. */
.project-card {
  background: var(--card);
  border-radius: 14px;
  padding: 28px;
  border: 1px solid rgba(151, 161, 136, 0.45);
  box-shadow: 0 1px 2px rgba(35, 46, 38, 0.04);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(35, 46, 38, 0.08);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-figure {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow:
    inset 1.5px 1.5px 3px rgba(35, 46, 38, 0.10),
    inset -1.5px -1.5px 3px rgba(237, 232, 218, 0.5);
  position: relative;
  overflow: hidden;
}

.project-card-figure img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-card:hover .project-card-figure img {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

.project-card-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 6px;
}

.status-prod {
  color: var(--accent-dark);
  background: rgba(107, 155, 111, 0.18);
}

.status-pub {
  color: #5a6f8a;
  background: rgba(155, 174, 203, 0.22);
}

.status-wip {
  color: #a47538;
  background: rgba(232, 184, 74, 0.18);
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.project-tag {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════
   PUBLICATIONS SECTION
   ═══════════════════════════════════════════════════ */

.pub-list {
  list-style: none;
  margin-top: 2.5rem;
  max-width: 900px;
}

.pub-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(163, 191, 155, 0.35);
  align-items: baseline;
  transition: padding-left 0.25s ease;
  position: relative;
}

.pub-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--led-yellow);
  box-shadow: 0 0 8px rgba(253, 232, 111, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pub-item:hover::before {
  opacity: 1;
}

.pub-item:hover {
  padding-left: 18px;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pub-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
}

.pub-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-footer {
  margin-top: 1.8rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   MUSIC / ART SECTION (unused — kept for future)
   ═══════════════════════════════════════════════════ */

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 2rem;
}

.art-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--neu-raised);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease;
}

.art-card:hover {
  transform: translateY(-6px);
  box-shadow: -10px -10px 22px var(--card-highlight), 10px 10px 22px var(--card-shadow);
}

.art-card-visual {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}

.art-card-visual .art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59,241,255,0.08) 0%, rgba(255,170,210,0.08) 100%);
}

.art-card-body {
  padding: 24px;
}

.art-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.art-card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════════════ */

.contact-section {
  text-align: center;
}

.contact-section .section-heading {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-description {
  max-width: 550px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.contact-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 4rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: var(--card);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--neu-raised);
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: -8px -8px 18px var(--card-highlight), 8px 8px 18px var(--card-shadow);
  color: var(--accent);
}

.contact-card:active {
  transform: translateY(0);
  box-shadow: var(--neu-pressed);
}

.contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neu-pressed);
}

.contact-card-icon svg {
  width: 20px;
  height: 20px;
}

/* ═══════════════════════════════════════════════════
   PROJECT DETAIL PAGE
   ═══════════════════════════════════════════════════ */

.project-page-body {
  /* On project pages, opt out of section-snap */
}
.project-page-body html { scroll-snap-type: none; }

.project-page {
  max-width: 880px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 60px) 2rem 80px;
}

.project-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 60px 0;
}
.project-loading[hidden] {
  display: none;
}
.project-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led-coral);
  box-shadow: 0 0 6px rgba(232, 154, 168, 0.6);
  animation: ledPulse 1.6s ease-in-out infinite;
}

.project-error {
  padding: 60px 0;
}
.project-error h1 {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.project-error p {
  color: var(--text-muted);
}

/* ── Header ── */
.project-header {
  margin-bottom: 56px;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  margin-bottom: 32px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.project-back:hover {
  color: var(--text-primary);
  transform: translateX(-3px);
}

.project-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.project-eyebrow .eyebrow-divider {
  opacity: 0.5;
}

.project-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.project-subtitle {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 720px;
  margin-bottom: 24px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

/* ── Key result card ── */
.project-key {
  margin-bottom: 56px;
}

.project-key-card {
  background: var(--card);
  border-radius: 18px;
  padding: 32px 36px;
  box-shadow: var(--neu-raised);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}

.project-key-label {
  grid-column: 1 / -1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: -16px;
}

.project-key-figure {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.project-key-number {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 600;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}
.project-key-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
  text-transform: uppercase;
}

.project-key-caption {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
}

@media (max-width: 820px) {
  .project-key-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ── Body (rendered markdown) ── */
.project-body {
  margin-bottom: 64px;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 720px;
}

.project-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 56px;
  margin-bottom: 18px;
  letter-spacing: -0.015em;
}
.project-body h2:first-child {
  margin-top: 0;
}

.project-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.project-body p {
  margin-bottom: 1.2rem;
}

.project-body ul,
.project-body ol {
  margin: 1rem 0 1.4rem 1.5rem;
  padding-left: 0.5rem;
}

.project-body li {
  margin-bottom: 0.6rem;
  padding-left: 6px;
}

.project-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.project-body em {
  color: var(--text-primary);
  font-style: italic;
}

.project-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-primary);
}

/* Particle-physics overline (anti-particle notation, e.g. b̄ or c̄).
   line-height:1 collapses the inline-block to the letter's natural height,
   then the pseudo-element bar sits a fixed distance above the ascender. */
.project-body .pbar {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.project-body .pbar::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  top: -0.08em;
  height: 1.5px;
  background: currentColor;
  pointer-events: none;
}

.project-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(79, 122, 85, 0.4);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}
.project-body a:hover {
  text-decoration-color: var(--accent-dark);
}

.project-body img,
.project-body video {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 32px auto 12px;
  background: var(--card);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--neu-raised);
}

.project-body video {
  cursor: pointer;
  /* videos sit edge-to-edge inside the rounded container — no cream padding
     framing the black video content, which clashes against the cream palette */
  background: transparent;
  padding: 0;
}

/* Figure caption: the paragraph immediately after a figure-image paragraph.
   (Earlier version used `em:only-child` but :only-child ignores text nodes,
   so inline italics in regular paragraphs were getting caption-styled.) */
.project-body p:has(> img) + p {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 36px;
  font-style: italic;
  line-height: 1.5;
}
.project-body p:has(> img) + p em {
  color: var(--text-muted);
}

.project-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 1.4rem 0;
  color: var(--text-primary);
  font-style: italic;
}

/* Award / recognition callout — subtle amber-tinted card with a star marker. */
.project-body .award-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(232, 184, 74, 0.12);
  border-left: 3px solid #E8B84A;
  border-radius: 4px;
  margin: 1.6rem 0;
  color: var(--text-primary);
  font-size: 0.98rem;
}
.project-body .award-callout::before {
  content: '★';
  color: #C99A3B;
  font-size: 1.2em;
  line-height: 1.5;
  flex-shrink: 0;
}
.project-body .award-callout strong {
  font-weight: 600;
}

/* ── Resources ── */
.project-resources {
  margin-bottom: 56px;
}

.project-resources-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.project-resources-label .label-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led-yellow);
  box-shadow: 0 0 8px rgba(253, 232, 111, 0.5);
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-links-group {
  margin-bottom: 36px;
}
.project-links-group:last-child {
  margin-bottom: 0;
}
.project-links-group-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.project-links-group .project-link:first-of-type {
  border-top: 0;
}
/* Rows without the type chip — collapse the grid to 2 columns */
.project-link.project-link--no-type {
  grid-template-columns: 1fr auto;
}

.project-link {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(163, 191, 155, 0.35);
  text-decoration: none;
  color: var(--text-primary);
  transition: padding-left 0.2s ease;
}
.project-link:hover {
  padding-left: 12px;
}

.project-link--noref {
  cursor: default;
}
.project-link--noref:hover {
  padding-left: 0;
}

/* Paired arXiv row — sits indented under a paper/workshop/briefing it belongs to,
   visually conveying "same publication, alternate open-access link" rather than
   double-counting as a separate entry. */
.project-link--paired {
  margin-left: 28px;
  margin-top: -4px;            /* pull tight to parent */
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.92em;
  opacity: 0.85;
}
.project-link--paired .project-link-label {
  font-size: 0.86rem;
}
.project-link--paired .project-link-type {
  font-size: 0.62rem;
}

.project-link-type {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-link-label {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.project-link-arrow {
  font-size: 1rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.project-link:hover .project-link-arrow {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .project-link {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .project-link-type {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .project-link-label {
    grid-column: 1;
    grid-row: 2;
  }
  .project-link-arrow {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ── Footer nav (next/prev / contact) ── */
.project-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 40px;
  border-top: 1px solid rgba(163, 191, 155, 0.35);
}

@media (max-width: 480px) {
  .project-footer-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .project-footer-nav .btn-primary,
  .project-footer-nav .btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════
   PROJECTS INDEX PAGE (/projects.html)
   ═══════════════════════════════════════════════════ */

.projects-index-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 60px) 2rem 80px;
}

.projects-index-header {
  margin-bottom: 56px;
}

.projects-index-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 18px;
}
.projects-index-eyebrow .label-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led-yellow);
  box-shadow: 0 0 8px rgba(253, 232, 111, 0.5);
}

.projects-index-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.projects-index-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Filter chips */
.projects-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(163, 191, 155, 0.5);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.filter-chip.is-active {
  background: var(--card);
  border-color: transparent;
  color: var(--text-primary);
  box-shadow: var(--neu-hover);
}
.filter-chip .chip-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.filter-chip.is-active .chip-count {
  background: rgba(0, 0, 0, 0.05);
}

.projects-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 28px;
}

@media (max-width: 1024px) {
  .projects-index-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .projects-index-grid { grid-template-columns: 1fr; }
}

.projects-empty {
  margin-top: 40px;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--surface-dark);
  border-radius: 14px;
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid rgba(163,191,155,0.3);
  padding: 40px 2rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-brand .led-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(107, 155, 111, 0.55);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-text-block {
    align-items: center;
    order: 2;
  }

  .hero-photo-wrapper {
    order: 1;
  }

  .hero-subtitle {
    justify-content: center;
  }

  .hero-cta-row {
    justify-content: center;
  }

  .hero-photo-frame {
    width: 260px;
    height: 320px;
  }

  .hero-photo-wrapper::before {
    width: 260px;
    height: 320px;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .art-grid {
    grid-template-columns: 1fr;
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
    --section-pad-y: 60px;
  }

  .nav-links,
  .nav-cv-btn {
    display: none;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(226, 236, 224, 0.96);
    backdrop-filter: blur(20px);
    padding: 2rem;
    gap: 8px;
    z-index: 999;
    animation: slideDown 0.3s ease;
  }

  .nav-links.mobile-open a {
    padding: 14px 20px;
    font-size: 1rem;
    justify-content: center;
  }

  .nav-links.mobile-open .nav-cv-mobile {
    display: flex;
    justify-content: center;
    margin-top: 8px;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .menu-toggle {
    display: flex;
  }

  .hero-name {
    font-size: 2.4rem;
  }

  .section-heading {
    font-size: 1.8rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
  }

}

@media (max-width: 480px) {
  .hero-photo-frame {
    width: 220px;
    height: 280px;
  }

  .hero-photo-wrapper::before {
    width: 220px;
    height: 280px;
  }

  .hero-cta-row {
    flex-direction: column;
    width: 100%;
  }

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

  .contact-grid {
    flex-direction: column;
    align-items: stretch;
  }
}
