/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body { margin: 0; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

/* ============ Tilt / spotlight cards ============ */
.tilt {
  position: relative; will-change: transform; transform: perspective(900px);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.tilt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
  opacity: 0; transition: opacity 0.4s ease;
}
.tilt.is-hovering::before { opacity: 1; }
.tilt > * { position: relative; z-index: 1; }

/* ============ Magnetic buttons ============ */
.magnetic { will-change: transform; }

/* ============ Ambient orbs ============ */
.section-glow { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.section-glow ~ * { position: relative; z-index: 1; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.28; animation: orbfloat 16s ease-in-out infinite; }
.orb-teal { background: var(--accent); }
.orb-violet { background: var(--accent-2); animation-delay: -6s; }
@keyframes orbfloat { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,-22px) scale(1.06); } }

/* ============ Marquee ============ */
.marquee-strip {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  padding: 18px 0; position: relative; z-index: 1;
}
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 34s linear infinite; }
.marquee-strip:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-item {
  padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 0.82rem; color: var(--text-muted); white-space: nowrap;
}
.marquee-item .dot-sep { color: var(--accent); margin-left: 14px; }

/* ============ Design tokens ============ */
:root {
  --bg: #0a0d15;
  --bg-alt: #0f1320;
  --surface: rgba(255,255,255,0.045);
  --surface-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.09);
  --text: #eaeef7;
  --text-muted: #94a0b8;
  --accent: #00e6c3;
  --accent-2: #8b6bff;
  --accent-ink: #04120f;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --radius: 18px;
  --radius-sm: 10px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: rgba(10,14,25,0.035);
  --surface-strong: rgba(10,14,25,0.06);
  --border: rgba(10,14,25,0.10);
  --text: #10121b;
  --text-muted: #565f74;
  --accent: #059c85;
  --accent-2: #6a4bdc;
  --accent-ink: #eafffb;
  --shadow: 0 20px 50px -25px rgba(20,24,40,0.25);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-alt: #ffffff;
    --surface: rgba(10,14,25,0.035);
    --surface-strong: rgba(10,14,25,0.06);
    --border: rgba(10,14,25,0.10);
    --text: #10121b;
    --text-muted: #565f74;
    --accent: #059c85;
    --accent-2: #6a4bdc;
    --accent-ink: #eafffb;
    --shadow: 0 20px 50px -25px rgba(20,24,40,0.25);
    color-scheme: light;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.muted-lead { color: var(--text-muted); max-width: 62ch; font-size: 1.05rem; }
.inline-link {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px; transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.inline-link:hover, .inline-link:focus-visible { text-decoration-color: currentColor; }

/* ============ Skip link ============ */
.skip-link {
  position: absolute; left: 0; top: -60px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ============ Decorative grid bg ============ */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.5;
}

/* ============ Film grain texture ============ */
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ============ Ghost section numerals ============ */
.section-head { position: relative; }
.section-head::before {
  content: attr(data-num); position: absolute; top: -0.5em; left: -0.06em; z-index: -1;
  font-family: var(--font-head); font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-size: clamp(3.6rem, 10vw, 8rem); color: color-mix(in srgb, var(--text) 6%, transparent);
  pointer-events: none; user-select: none;
}

/* ============ Nav ============ */
.site-header { position: sticky; top: 0; z-index: 100; padding: 16px 20px 0; }
.nav {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 14px 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.scrolled .nav {
  padding: 7px 12px 7px 18px;
  box-shadow: 0 12px 30px -16px rgba(0,0,0,0.45);
}
.nav-links a.active { color: var(--accent); }
.glass {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.nav-logo { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.nav-logo .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; font-size: 0.92rem; }
.nav-links a { color: var(--text-muted); transition: color 0.2s ease; white-space: nowrap; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }
.nav-cta {
  color: var(--accent-ink) !important;
  background: var(--accent);
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); display: block; transition: transform 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { transform: scale(1.06); background: var(--surface-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-strong); transform: translateY(-2px); }

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 94vh; display: flex; align-items: center; justify-content: center;
  padding: 140px 24px 60px; overflow: hidden;
}
#heroShader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
@keyframes blobMorph {
  0%, 100% { border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%; }
  50% { border-radius: 60% 40% 40% 60% / 55% 60% 40% 45%; }
}
#networkCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.55; mix-blend-mode: screen; }
.hero-grid {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; width: 100%;
}
.hero-copy { text-align: left; }
.eyebrow { color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 18px; display: block; }
.hero-title {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -0.035em;
  font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.08; margin-bottom: 24px;
}
.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 6s ease-in-out infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
.hero-sub { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--text-muted); max-width: 54ch; margin: 0 0 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: flex-start; flex-wrap: wrap; margin-bottom: 40px; }
.hero-links { display: flex; gap: 10px; justify-content: flex-start; font-size: 0.9rem; color: var(--text-muted); flex-wrap: wrap; }
.hero-links a { display: inline-flex; align-items: center; gap: 6px; }
.hero-links svg { width: 15px; height: 15px; flex-shrink: 0; }
.hero-links a:hover { color: var(--accent); }

/* Hero portrait panel */
.hero-photo-wrap { position: relative; justify-self: center; animation: heroFloat 7s ease-in-out infinite; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.hero-photo-wrap::before {
  content: ""; position: absolute; inset: 8%; z-index: -1;
  background: linear-gradient(160deg, var(--accent), var(--accent-2)); filter: blur(60px); opacity: 0.38;
  animation: blobMorph 15s ease-in-out infinite;
}
.hero-photo {
  position: relative; width: min(320px, 76vw); aspect-ratio: 4 / 5; border-radius: 30px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hero-photo-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 14%;
  filter: grayscale(1) contrast(1.08) brightness(1.05);
}
.hero-photo.no-photo .hero-photo-img { display: none; }
.hero-photo.no-photo::before {
  content: "OBD"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; letter-spacing: 0.02em;
  background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff;
}
.floating-badge {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; box-shadow: var(--shadow);
}
.floating-badge.glass-card {
  padding: 9px 15px; font-size: 0.78rem; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
}
.badge-grad { top: -18px; left: -40px; }
.badge-loc { bottom: -18px; right: -38px; }
@media (max-width: 460px) {
  .floating-badge.glass-card { padding: 6px 11px; font-size: 0.7rem; gap: 4px; box-shadow: none; }
  .badge-grad { top: -16px; left: -18px; }
  .badge-loc { bottom: -16px; right: -18px; }
}

.scroll-cue { position: absolute; z-index: 2; bottom: 28px; left: 50%; transform: translateX(-50%); }
.scroll-cue span {
  display: block; width: 1px; height: 40px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ============ Sections ============ */
.section { padding: 110px 24px; max-width: 1100px; margin: 0 auto; }
.section-alt { background: var(--bg-alt); max-width: none; padding-left: 24px; padding-right: 24px; }
.section-alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 52px; max-width: 700px; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; margin-top: 8px; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: start; }
.about-lede { font-size: 1.15rem; color: var(--text-muted); }
.about-top { margin-bottom: 40px; }
.about-intro { flex: 1; min-width: 0; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat { min-width: 0; }
.stat-num { display: block; font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.stat-num.is-long { font-size: 1.32rem; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); }

/* ============ Timeline ============ */
.timeline { position: relative; display: flex; flex-direction: column; gap: 36px; }
.timeline-item { position: relative; padding-left: 32px; }
.timeline-marker {
  position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.timeline-item::before {
  content: ""; position: absolute; left: 4.5px; top: 22px; bottom: -36px; width: 1px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.glass-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: border-color 0.25s ease, background 0.25s ease;
}
.glass-card.card-compact { padding: 20px; border-radius: var(--radius-sm); }
.glass-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.timeline-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.timeline-top h3 { font-family: var(--font-head); font-size: 1.2rem; }
.timeline-org { color: var(--text-muted); margin: 6px 0 16px; font-size: 0.92rem; }
.timeline-content ul { display: flex; flex-direction: column; gap: 10px; }
.timeline-content li { position: relative; padding-left: 20px; color: var(--text-muted); font-size: 0.96rem; }
.timeline-content li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.timeline-content strong { color: var(--text); }

/* ============ Research ============ */
.interest-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 34px; }
.interest-tags span {
  font-size: 0.76rem; color: var(--text-muted); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 999px; background: var(--surface);
}
.research-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 50px; }
.research-copy p { margin-bottom: 16px; color: var(--text-muted); }
.research-copy p:first-child { color: var(--text); font-size: 1.08rem; }
.note { color: var(--accent); }
.research-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.stat-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stat-big { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--accent-2); overflow-wrap: anywhere; }
.stat-big.is-long { font-size: 1.32rem; }
.stat-desc { font-size: 0.82rem; color: var(--text-muted); }

/* ============ Bento grid ============ */
.bento {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(180px, auto); gap: 18px;
}
.bento-card { display: flex; flex-direction: column; gap: 10px; grid-column: span 2; }
.bento-lg { grid-column: span 4; }
.bento-wide { grid-column: span 4; }
.bento-tag {
  align-self: flex-start; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
.bento-card h3 { font-family: var(--font-head); font-size: 1.25rem; }
.bento-card p { color: var(--text-muted); font-size: 0.94rem; }
.bento-metrics { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); margin-top: auto; }
.bento-metrics span { border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }
.bento-link { color: var(--accent); font-size: 0.88rem; font-weight: 600; margin-top: 4px; }

/* ============ Publications ============ */
.pub-list { display: flex; flex-direction: column; gap: 22px; }
.pub-list li { border-left: 2px solid var(--border); padding-left: 20px; }
.pub-list p { margin-bottom: 6px; }
.pub-list em { color: var(--text); font-style: normal; font-weight: 600; }

/* ============ Skills ============ */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-group h4 { font-family: var(--font-head); font-size: 1rem; margin-bottom: 8px; color: var(--accent); }
.skill-group p { color: var(--text-muted); font-size: 0.92rem; }

/* ============ Education ============ */
.edu-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.edu-item { display: flex; flex-direction: column; gap: 4px; }
.edu-item .edu-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.edu-item p { color: var(--text-muted); font-size: 0.92rem; }
.edu-coursework { grid-column: 1 / -1; }

/* ============ Leadership & Credentials ============ */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; align-items: start; }
.cred-card h4 { font-family: var(--font-head); font-size: 1rem; margin-bottom: 12px; color: var(--accent); }
.cred-card .cred-role { font-weight: 600; color: var(--text); font-size: 0.94rem; }
.cred-card .cred-org { color: var(--text-muted); font-size: 0.84rem; margin: 2px 0 8px; }
.cred-card .cred-desc { color: var(--text-muted); font-size: 0.88rem; }
.cred-card .cred-link { display: inline-block; color: var(--accent); font-size: 0.8rem; font-weight: 600; margin-top: 6px; }
.cred-list { display: flex; flex-direction: column; gap: 16px; }
.cred-list li + li { padding-top: 16px; border-top: 1px solid var(--border); }
.cred-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cred-chips span { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; color: var(--text-muted); }

/* ============ Terminal ============ */
.term-wrap { max-width: 780px; margin: 0 auto; }
.term { padding: 0; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.term-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-red { background: #ff5f57; } .term-yellow { background: #febc2e; } .term-green { background: #28c840; }
.term-title { margin-left: 10px; font-size: 0.78rem; color: var(--text-muted); }
.term-body { height: 260px; overflow-y: auto; padding: 18px 20px; font-size: 0.88rem; display: flex; flex-direction: column; gap: 10px; }
.term-body .line-user::before { content: "> "; color: var(--accent); }
.term-body .line-bot { color: var(--text-muted); white-space: pre-wrap; }
.term-input-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 12px 16px; }
.term-input-row .prompt { color: var(--accent); }
.term-input-row input {
  flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 0.9rem;
}

/* ============ Contact ============ */
.contact-section { text-align: center; }
.contact-inner { max-width: 760px; margin: 0 auto; }
.contact-inner h2 { font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3rem); margin: 10px 0 18px; }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
@media (min-width: 900px) {
  .contact-links { flex-wrap: nowrap; }
}

/* ============ Reveal-on-scroll ============ */
.reveal {
  opacity: 0; transform: translateY(28px) scale(0.98); filter: blur(6px);
  transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1), filter 0.8s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--d, 0) * 70ms);
  will-change: opacity, transform, filter;
}
.reveal.in { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }

/* ============ Scroll progress bar ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 300;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress span { transition: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { padding: 90px 24px 50px; }
  .about-grid, .research-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-lg, .bento-wide { grid-column: span 2; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-links { justify-content: center; }
  .hero-photo-wrap { margin-top: 36px; }
}
@media (max-width: 880px) {
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: 16px;
    padding: 14px; display: flex;
    opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.98); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    box-shadow: 0 20px 40px -16px rgba(0,0,0,0.4);
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
  .nav-links li { width: 100%; opacity: 0; transform: translateY(-6px); transition: opacity 0.3s ease, transform 0.3s ease; }
  .nav-links.open li { opacity: 1; transform: translateY(0); }
  .nav-links.open li:nth-child(1) { transition-delay: 0.04s; }
  .nav-links.open li:nth-child(2) { transition-delay: 0.08s; }
  .nav-links.open li:nth-child(3) { transition-delay: 0.12s; }
  .nav-links.open li:nth-child(4) { transition-delay: 0.16s; }
  .nav-links.open li:nth-child(5) { transition-delay: 0.2s; }
  .nav-links.open li:nth-child(6) { transition-delay: 0.24s; }
  .nav-links.open li:nth-child(7) { transition-delay: 0.28s; }
  .nav-links a { display: block; padding: 10px 6px; }
  .nav-toggle { display: flex; order: 2; }
  .theme-toggle { order: 1; margin-left: auto; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento-card, .bento-lg, .bento-wide { grid-column: span 1; }
  .skills-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .research-stats { grid-template-columns: 1fr 1fr; }
  .stat, .stat-card { padding: 14px; }
  .stat-num { font-size: 1.4rem; }
  .stat-big { font-size: 1.3rem; }
  .section { padding: 80px 20px; }
}
