/* =========================================================
   Brair (Tilboon) Elberier — academic homepage
   Motion model: JS sets --p (0→1 scroll progress) on [data-scrub]
   elements and toggles .in / .is-active classes; CSS does the rest.
   Everything is static unless <html> has the .motion class.
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --wash: #f5f7fa;
  --ink: #0f1419;
  --muted: #5b6475;
  --faint: #8a93a3;
  --border: #dde3ec;
  --brand: #2774ae; /* UCLA blue */
  --brand-ink: #005587;
  --accent: #ffb81c; /* UCLA gold */
  --chip-bg: #eaf2fa;
  --chip-ink: #1d4f7a;
  --tile-from: #2f7fbd;
  --tile-to: #0b3a63;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 18px 40px rgba(16, 24, 40, 0.12);
  --header-bg: rgba(255, 255, 255, 0.78);
  --nav-h: 56px;
  --measure: 70ch;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark theme: follows the system unless the visitor picked a theme with the nav toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10;
    --surface: #14181e;
    --wash: #101318;
    --ink: #eef1f5;
    --muted: #a0a9b8;
    --faint: #6e7787;
    --border: #262d38;
    --brand: #6cb4ee;
    --brand-ink: #9ccdf5;
    --chip-bg: #182636;
    --chip-ink: #b5d6f3;
    --tile-from: #22669c;
    --tile-to: #0a2440;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(11, 13, 16, 0.72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b0d10;
    --surface: #14181e;
    --wash: #101318;
    --ink: #eef1f5;
    --muted: #a0a9b8;
    --faint: #6e7787;
    --border: #262d38;
    --brand: #6cb4ee;
    --brand-ink: #9ccdf5;
    --chip-bg: #182636;
    --chip-ink: #b5d6f3;
    --tile-from: #22669c;
    --tile-to: #0a2440;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(11, 13, 16, 0.72);
    color-scheme: dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
.h5 { font-size: 1.05rem; }

p {
  margin: 0 0 1rem;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  border: 2px solid var(--brand);
  padding: 0.5rem;
}
.skip-link:focus {
  left: 1rem;
}

.kicker {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand);
}
.display {
  font-size: clamp(2.1rem, 5.2vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 2.5rem;
}

/* ---------- Pills & chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), border-color 0.2s, background-color 0.2s;
}
.pill:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: var(--brand);
  transform: translateY(-1px);
}
/* Fixed UCLA blue (not the theme token) so white text stays readable in dark mode */
.pill.solid {
  background: #2774ae;
  border-color: #2774ae;
  color: #fff;
}
.pill.solid:hover {
  background: #005587;
  color: #fff;
}
.pill.big {
  padding: 0.85rem 1.6rem;
  font-size: 1.1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.chips li {
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Illustrated tile used where a photo is not available yet */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(255, 184, 28, 0.22), transparent 45%),
    linear-gradient(135deg, var(--tile-from), var(--tile-to));
}
.tile svg {
  width: 34%;
  max-width: 120px;
  height: auto;
}
.tile span {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

.card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---------- Global nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: transform 0.45s var(--ease);
}
.nav-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover {
  color: var(--ink);
  text-decoration: none;
}
.nav ul {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover,
.nav a.active {
  color: var(--ink);
  text-decoration: none;
}
.nav a.active {
  color: var(--brand);
}
.nav a.nav-cv {
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--brand);
}
.theme-toggle:active {
  transform: rotate(-20deg) scale(0.94);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
}
/* Show the icon for the theme you'd switch to */
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}
body.nav-dark .theme-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-toggle {
  display: none;
}

/* Dark nav while the black feature section is under it */
body.nav-dark .site-header {
  background: rgba(0, 0, 0, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
body.nav-dark .brand,
body.nav-dark .nav-toggle {
  color: #fff;
}
/* Desktop only: on phones the links live in a light dropdown panel */
@media (min-width: 861px) {
  body.nav-dark .nav a {
    color: rgba(255, 255, 255, 0.72);
  }
  body.nav-dark .nav a.active,
  body.nav-dark .nav a:hover,
  body.nav-dark .nav a.nav-cv {
    color: #fff;
  }
  body.nav-dark .nav a.nav-cv {
    border-color: rgba(255, 255, 255, 0.3);
  }
}
.site-header,
.brand,
.nav a {
  transition: background-color 0.35s, color 0.35s, border-color 0.35s, transform 0.45s var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-h) + 2rem) 0 5rem;
  overflow: hidden;
  text-align: center;
}
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Soft glows drawn as radial gradients: same look as a blurred circle, but no per-frame blur cost */
.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  will-change: transform;
}
.b1 { width: 760px; height: 760px; left: -18%; top: -6%; background: radial-gradient(closest-side, #2774ae, transparent); }
.b2 { width: 620px; height: 620px; right: -14%; top: 10%; background: radial-gradient(closest-side, #ffb81c, transparent); opacity: 0.22; }
.b3 { width: 580px; height: 580px; left: 30%; bottom: -30%; background: radial-gradient(closest-side, #8bb8e8, transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .blob { opacity: 0.28; }
  :root:not([data-theme="light"]) .b2 { opacity: 0.14; }
}
:root[data-theme="dark"] .blob { opacity: 0.28; }
:root[data-theme="dark"] .b2 { opacity: 0.14; }

.hero-inner {
  position: relative;
  max-width: 1120px;
}
.hero-portrait {
  width: 168px;
  height: 168px;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--border), 0 20px 50px rgba(0, 0, 0, 0.18);
}
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.hero-title {
  margin: 0 0 1.1rem;
  /* One line at every width: the name is ~13em wide, so scale with the viewport */
  font-size: min(5.4rem, 6.8vw);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, var(--ink) 55%, color-mix(in srgb, var(--ink) 55%, var(--brand)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.08em;
}
.hero-tagline {
  max-width: 34ch;
  margin: 0 auto 2rem;
  font-size: clamp(1.2rem, 2.3vw, 1.6rem);
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 2rem;
}
.latest {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.88rem;
  font-weight: 500;
}
.latest:hover {
  text-decoration: none;
  color: var(--chip-ink);
}
.latest-tag {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #2774ae;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid var(--faint);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--faint);
}

/* ---------- Pinned (sticky) scroll scenes ---------- */
.pin-inner {
  position: relative;
}

/* Vision statement */
.vision .pin-inner {
  padding: 7rem 0;
}
.statement {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

/* ---------- Sections ---------- */
.section {
  padding: 7rem 0;
}
.section.alt {
  background: var(--wash);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 4rem;
  align-items: start;
}
.bio {
  max-width: var(--measure);
}
.bio h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
.bio p {
  font-size: 1.08rem;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
}
.glance {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--wash);
}
.glance-title {
  margin: 0 0 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.edu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.edu li {
  padding: 0.45rem 0 0.45rem 0.9rem;
  border-left: 2px solid var(--border);
  line-height: 1.35;
}
.edu-logos li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding-left: 0;
  border-left: 0;
}
.edu-logos img {
  width: 34px;
  height: 34px;
  padding: 5px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--border);
  object-fit: contain;
}
.edu strong {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
}
.edu span {
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- Research slider (sticky visual + scrolling steps) ---------- */
.research-lede {
  max-width: 62ch;
  margin: -1.25rem 0 1rem;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
}
.research-q {
  max-width: 52ch;
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
}
.step .step-thesis {
  margin: -0.35rem 0 1rem;
  font-size: 1.12rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
}
.story {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}
.story-visuals {
  position: sticky;
  top: calc(var(--nav-h) + 8vh);
  height: min(70vh, 560px);
}
.story-visual {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  opacity: 0;
  transform: scale(0.92) translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
}
.story-visual.is-active {
  opacity: 1;
  transform: none;
}
.story-card {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  border-radius: 32px;
  box-shadow: var(--shadow-lift);
}
/* Wide media shown whole rather than cropped to the card */
.story-contain {
  object-fit: contain;
  background: #0b0d10;
}
.story-figure {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.story-figure svg {
  width: 100%;
  height: auto;
}
.story-visual figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--faint);
}
.story-steps {
  padding: 10vh 0 20vh;
}
.step {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.28;
  transition: opacity 0.5s var(--ease);
}
.step.is-active {
  opacity: 1;
}
.step h3 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.9rem;
}
.step p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 44ch;
}
.step .step-meta {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
}
.step .step-links {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Feature (image grows to full screen) ---------- */
.feature {
  --p: 1;
  background: #000;
  color: #fff;
}
.feature .pin-inner {
  --grow: min(1, calc(var(--p) * 2.2));
  --q: clamp(0, calc((var(--p) - 0.45) * 3.5), 1);
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.feature-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: scale(calc(0.5 + 0.5 * var(--grow)));
  border-radius: calc(40px * (1 - var(--grow)));
}
.feature-media img,
.feature-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.8) 100%);
  opacity: var(--q);
}
.feature-copy {
  position: relative;
  width: 100%;
  padding-bottom: 4.5rem;
  opacity: var(--q);
  transform: translateY(calc((1 - var(--q)) * 40px));
}
.feature .display,
.stats dt {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.feature .kicker {
  color: var(--accent);
}
.feature .display {
  max-width: 16ch;
  margin-bottom: 2rem;
  color: #fff;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3.5rem;
  margin: 0;
}
.stats dt {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stats dd {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

/* ---------- Publications ---------- */
.pub-feature {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.section-heading + .pub-feature {
  border-top: none;
}
.pub-feature:has(.pub-media-right:empty) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.pub-feature:has(.pub-media-right:empty) .pub-media-right {
  display: none;
}
.pub-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.pub-feature:hover .pub-thumb,
.pub-feature:hover .pub-video {
  transform: scale(1.02);
  box-shadow: var(--shadow-lift);
}
.pub-thumb.tile svg {
  width: 22%;
}
.pub-details {
  text-align: center;
  padding: 0.25rem 0.5rem;
}
.pub-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}
.pub-authors,
.pub-venue {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.pub-authors strong {
  color: var(--ink);
}
.pub-links {
  margin: 0.6rem 0 0;
  font-weight: 500;
}
.pub-press {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--faint);
}

/* Drawn pipeline figure (CASE 2025) */
.pub-figure {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.14), transparent 50%),
    radial-gradient(circle at 90% 95%, rgba(255, 184, 28, 0.2), transparent 45%),
    linear-gradient(135deg, var(--tile-from), var(--tile-to));
}
.pub-figure svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: Inter, system-ui, sans-serif;
}
.fig-kicker {
  fill: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fig-badge rect {
  fill: var(--accent);
}
.fig-badge text {
  fill: #1f1600;
  font-size: 12px;
  font-weight: 700;
}
.fig-box rect {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.28);
}
.fig-arrow line {
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 2;
}
.fig-ink {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fig-ink text {
  stroke: none;
}
.fig-fill {
  fill: #fff;
}
.fig-fill-soft {
  fill: rgba(255, 255, 255, 0.18);
}
.fig-accent {
  stroke: var(--accent);
  stroke-width: 2.5;
  fill: none;
}
.fig-label text {
  fill: #fff;
  font-size: 14px;
  font-weight: 700;
}
.fig-sub,
.fig-sub text {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
}
.fig-tiny {
  fill: #fff;
  font-size: 11px;
  font-weight: 600;
}

.pub-status {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: color-mix(in srgb, var(--accent) 45%, var(--ink));
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pub-highlight {
  display: inline-block;
  margin: 0.7rem 0 0;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Click-to-expand abstract */
/* Spans the full width of its publication row */
.abstract {
  grid-column: 1 / -1;
  margin: -0.25rem auto 0;
  width: 100%;
  max-width: 78ch;
}
.abstract summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 auto;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.2s;
}
.abstract summary::-webkit-details-marker {
  display: none;
}
.abstract summary::after {
  content: "+";
  font-weight: 700;
  color: var(--brand);
}
.abstract[open] summary::after {
  content: "−";
}
.abstract summary:hover {
  border-color: var(--brand);
}
.abstract {
  text-align: center;
}
.abstract p {
  margin: 1rem 0 0;
  text-align: left;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--muted);
}
.motion .abstract[open] p {
  animation: rise 0.5s var(--ease) both;
}

.pub-video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.pub-video img,
.pub-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.pub-video img {
  transition: filter 0.3s ease;
}
.yt:hover img {
  filter: brightness(0.8);
}
.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s var(--ease);
}
.yt:hover .yt-play {
  transform: translate(-50%, -50%) scale(1.1);
}
.yt-play svg {
  display: block;
  width: 100%;
  height: auto;
}

video.pub-video {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.pub-subhead {
  margin: 3.5rem 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.pub-subhead + .pub-feature {
  border-top: none;
}
/* Posters are 4:3, so show the whole sheet rather than cropping */
.poster-link {
  display: block;
}
.poster-thumb {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--wash);
  border: 1px solid var(--border);
}
/* ---------- Journey timeline ---------- */
.journey {
  --p: 1;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.journey::before,
.journey::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
}
.journey::before {
  bottom: 0;
  background: var(--border);
}
.journey::after {
  height: calc(var(--p) * 100%);
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.milestone {
  position: relative;
  width: 50%;
  padding: 0 3rem 2.75rem 0;
  text-align: right;
}
.milestone:nth-child(even) {
  margin-left: 50%;
  padding: 0 0 2.75rem 3rem;
  text-align: left;
}
.milestone::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  right: -8px;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--brand);
  transition: background-color 0.4s, transform 0.4s var(--ease);
}
.section.alt .milestone::before {
  background: var(--wash);
}
.milestone:nth-child(even)::before {
  right: auto;
  left: -8px;
}
.milestone.in::before {
  background: var(--brand);
  transform: scale(1.15);
}
.m-year {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.m-card {
  display: inline-block;
  max-width: 420px;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.m-card.has-logo {
  display: inline-grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
}
.m-card.has-logo > :not(.m-logo) {
  grid-column: 2;
}
.m-logo {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  padding: 7px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  object-fit: contain;
}
.m-logo[src*="amd"] {
  padding: 14px 5px;
}
.m-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
}
.m-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Featured (press / spotlight) ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}
.featured-media {
  margin: 0;
}
.featured-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow-lift);
}
.featured-media figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--faint);
}
.featured .display {
  margin-bottom: 0.75rem;
}
.featured-source {
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.pull-quote {
  position: relative;
  margin: 0 0 2rem;
  padding-left: 1.4rem;
  border-left: 3px solid var(--accent);
}
.pull-quote p {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* ---------- Teaching & honors ---------- */
.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.bullets {
  padding-left: 1.1rem;
  margin: 0.75rem 0 0;
}
.bullets li {
  margin: 0.4rem 0;
}
.bullets li::marker {
  color: var(--brand);
}
.honors-title {
  margin: 4rem 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.award-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
}
.award-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.award-list span {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

/* ---------- Contact ---------- */
.contact {
  padding: 9rem 0 8rem;
  text-align: center;
  background:
    radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    var(--bg);
}
.contact .display {
  margin-bottom: 1rem;
}
.contact-lede {
  margin: 0 auto 2rem;
  max-width: 40ch;
  font-size: 1.2rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.85rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-footer p {
  margin: 0;
}

/* =========================================================
   MOTION (only when html.motion is set by the inline script)
   ========================================================= */

/* Nav hides over the hero, slides in after */
.motion .site-header {
  transform: translateY(-100%);
}
.motion body.scrolled .site-header,
.motion .site-header:focus-within {
  transform: none;
}

/* Hero: staggered entrance, then shrink + fade on scroll */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 20px) scale(0.96); }
}
@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
.motion .hero-inner > * {
  animation: rise 1s var(--ease) both;
}
.motion .hero-inner > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero-inner > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero-inner > :nth-child(4) { animation-delay: 0.28s; }
.motion .hero-inner > :nth-child(5) { animation-delay: 0.4s; }
.motion .hero-inner > :nth-child(6) { animation-delay: 0.52s; }
.motion .blob {
  animation: drift 18s ease-in-out infinite alternate;
}
.motion .b2 { animation-duration: 22s; animation-delay: -6s; }
.motion .b3 { animation-duration: 26s; animation-delay: -12s; }
/* Stop animating the glows once the hero has scrolled away */
.motion body.scrolled .blob {
  animation-play-state: paused;
}
.motion .scroll-cue span {
  animation: cue 1.8s ease-in-out infinite;
}
.motion .hero-inner {
  opacity: calc(1 - var(--p, 0) * 1.7);
  transform: translateY(calc(var(--p, 0) * -80px)) scale(calc(1 - var(--p, 0) * 0.12));
}
.motion .scroll-cue {
  opacity: calc(1 - var(--p, 0) * 5);
}

/* Pinned scenes: tall section, sticky 100vh stage */
.motion .pin.vision {
  height: 260vh;
}
.motion .pin.feature {
  height: 320vh;
}
.motion .pin-inner {
  position: sticky;
  top: 0;
  height: 100vh;
}
.motion .vision .pin-inner {
  display: flex;
  align-items: center;
  padding: 0;
}

/* Word-by-word highlight */
.motion .statement .w {
  opacity: 0.16;
  transition: opacity 0.35s ease;
}
.motion .statement .w.lit {
  opacity: 1;
}

/* Generic scroll reveal */
.motion .reveal {
  opacity: 0;
  transform: translateY(32px) scale(0.985);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.motion .reveal.in {
  opacity: 1;
  transform: none;
}
.motion .milestone.reveal {
  transform: translateX(-40px);
}
.motion .milestone.reveal:nth-child(even) {
  transform: translateX(40px);
}
.motion .milestone.reveal.in {
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 860px) {
  body {
    font-size: 16px;
  }
  .section {
    padding: 5rem 0;
  }

  /* Nav is always visible on phones */
  .motion .site-header {
    transform: none;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    cursor: pointer;
  }
  .nav-toggle svg {
    display: none;
  }
  .nav-toggle[aria-expanded="false"] .icon-ham,
  .nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
  }
  .nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: max-height 0.35s var(--ease), visibility 0.35s;
  }
  .nav.open {
    max-height: 80vh;
    visibility: visible;
    border-bottom-color: var(--border);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
  }
  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
  }
  .nav a.nav-cv {
    border: 0;
    padding: 0.8rem 0;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 2rem);
  }
  .hero-portrait {
    width: 132px;
    height: 132px;
  }

  .pub-feature,
  .pub-feature:has(.pub-media-right:empty),
  .featured-grid,
  .columns,
  .award-list {
    grid-template-columns: 1fr;
  }
  .pub-feature {
    gap: 16px;
  }
  .featured-grid {
    gap: 2rem;
  }

  /* Research slider: visual sticks to the top, steps scroll beneath */
  .research-lede {
    margin-top: -1rem;
  }
  .story {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .story-visuals {
    top: var(--nav-h);
    z-index: 2;
    height: calc(34vh + 1.5rem);
    padding: 0.75rem 0;
    background: var(--bg);
    box-shadow: 0 0.75rem 0 var(--bg);
  }
  .story-visual {
    inset: 0.75rem 0;
  }
  .story-visual figcaption {
    display: none;
  }
  .story-card {
    border-radius: 22px;
  }
  .story-figure {
    padding: 0.75rem;
  }
  .story-steps {
    padding: 4vh 0 10vh;
  }
  .step {
    min-height: 58vh;
  }

  /* Timeline: single rail on the left */
  .journey::before,
  .journey::after {
    left: 7px;
  }
  .milestone,
  .milestone:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding: 0 0 2rem 2.25rem;
    text-align: left;
  }
  .milestone::before,
  .milestone:nth-child(even)::before {
    left: 0;
    right: auto;
  }
  .motion .milestone.reveal,
  .motion .milestone.reveal:nth-child(even) {
    transform: translateY(28px);
  }
  .motion .milestone.reveal.in {
    transform: none;
  }
  .m-card {
    display: block;
  }
  .m-card.has-logo {
    display: grid;
  }

  .feature .pin-inner {
    min-height: 0;
  }
  .stats {
    gap: 1.25rem 2rem;
  }
}

@media (max-width: 560px) {
  .award-list li {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .eyebrow {
    font-size: 0.85rem;
  }
}
