:root {
  --bg-0: #0d1014;
  --bg-1: #141821;
  --bg-2: #1a1f2a;
  --bg-3: #232938;
  --ink-0: #f5f1e8;
  --ink-1: #d8d4c9;
  --ink-2: #a8a497;
  --ink-3: #8e8b80;
  --ink-4: #58554d;
  --line: #262b35;
  --accent: #9bbf7a;
  /* pastel multi for accents/highlights */
  --p-pink:   #f5b8c8;
  --p-peach:  #f5c5a3;
  --p-butter: #f1dca0;
  --p-moss:   #bfd9a8;
  --p-mint:   #a9d8c5;
  --p-sky:    #aac6e5;
  --p-lilac:  #cdb8e6;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --hand:  "Caveat", "Bradley Hand", cursive;
  --mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad:   clamp(20px, 4vw, 56px);
  --maxw:  1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────── Bio background (tiled subtle pattern) ─────────────────────── */
.bio-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat;
  background-size: 240px 240px;
  opacity: 0.55;
  animation: tile-drift 80s linear infinite;
}
.bio-wash {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(245,184,200,0.07), transparent 40%),
    radial-gradient(circle at 88% 22%, rgba(205,184,230,0.07), transparent 42%),
    radial-gradient(circle at 78% 82%, rgba(169,216,197,0.06), transparent 44%),
    radial-gradient(circle at 18% 78%, rgba(170,198,229,0.06), transparent 42%);
}
@keyframes tile-drift { from { background-position: 0 0; } to { background-position: 240px 240px; } }

a { color: inherit; }
.mono { font-family: var(--mono); font-feature-settings: "calt" 0; }
.dim  { color: var(--ink-3); }

/* ─────────────────────── Sticky nav ─────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg-0) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; gap: 24px;
}
.nav-brand {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-1);
}
.nav-brand .glyph {
  width: 24px; height: 24px; border: 1.5px solid var(--accent);
  display: inline-grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--accent);
  font-size: 16px;
  border-radius: 50%;
  align-self: center;
  transition: transform 0.4s ease;
}
.nav-brand:hover .glyph { transform: rotate(360deg); }
.nav-links {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-left: auto;
  font-family: var(--mono); font-size: 12px;
}
.nav-link {
  text-decoration: none; color: var(--ink-2);
  padding: 6px 10px; border-radius: 4px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}
.nav-link:hover { color: var(--ink-0); border-color: var(--line); background: var(--bg-1); }
.nav-link .num { color: var(--ink-4); margin-right: 6px; }
.nav-link.active { color: var(--nav-c, var(--accent)); border-color: var(--nav-c, var(--accent)); }
.nav-link.active .num { color: var(--nav-c, var(--accent)); opacity: 0.7; }

/* per-section accents \u2014 each link carries its own hue when active */
.nav-link[data-id="home"]        { --nav-c: var(--accent); }
.nav-link[data-id="research"]    { --nav-c: #86efac; }   /* mint */
.nav-link[data-id="education"]   { --nav-c: #93c5fd; }   /* blue */
.nav-link[data-id="papers"]      { --nav-c: #fcd34d; }   /* amber */
.nav-link[data-id="experience"]  { --nav-c: #fda4af; }   /* rose */
.nav-link[data-id="projects"]    { --nav-c: #d8b4fe; }   /* purple */
.nav-link[data-id="off-screen"]  { --nav-c: #f0abfc; }   /* fuchsia */
.nav-link:hover { color: color-mix(in oklab, var(--nav-c, var(--accent)) 80%, white 20%); }

/* ─────────────────────── Layout ─────────────────────── */
.page { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 56px 0 32px; scroll-margin-top: 16px; position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
}
.section-num { font-size: 13px; letter-spacing: 0.04em; }
.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.005em;
  color: var(--ink-0);
  line-height: 1.05;
}
.section-title-wrap { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.section-sub { font-size: 12px; }
.section-rule { height: 1px; background: var(--line); min-width: 80px; }

/* ─────────────────────── Hero ─────────────────────── */
.hero { padding: 56px 0 28px; }
.hero-stack { max-width: 760px; }

/* Two-column hero with the bio-sidecar floating to the side */
.hero.with-sidecar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}
.hero.with-sidecar .hero-stack,
.hero.with-sidecar .big-stack {
  min-width: 0;
}
@media (max-width: 980px) {
  .hero.with-sidecar { grid-template-columns: 1fr; gap: 32px; }
  .bio-sidecar { max-width: 360px; }
}

/* ─────────── Bio Sidecar (lab notebook panel) ─────────── */
.bio-sidecar {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg-1) 92%, var(--accent) 8%) 0%,
    var(--bg-1) 100%);
  border-radius: 6px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 50px -28px rgba(0,0,0,0.6);
  overflow: hidden;
}
.bio-sidecar::before {
  /* faint grid paper */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse at top right, black 50%, transparent 100%);
}
.bio-sidecar > * { position: relative; z-index: 1; }

.bsc-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.04em;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}
.bsc-corner {
  width: 8px; height: 8px;
  border-left: 2px solid; border-top: 2px solid;
  margin-right: 2px;
}
.bsc-title { text-transform: uppercase; }
.bsc-sub { margin-left: auto; font-size: 10px; }

.bsc-helix {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  border-radius: 4px;
  padding: 6px 8px;
}

.bsc-read {
  display: flex; flex-direction: column; gap: 6px;
}
.bsc-read-head { display: flex; justify-content: space-between; font-size: 10px; }
.bsc-seq {
  display: flex; flex-wrap: wrap; gap: 2px;
  font-size: 12px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.bsc-base { display: inline-block; min-width: 11px; text-align: center; }
.bsc-base-a { color: #d8b4fe; }   /* purple */
.bsc-base-u { color: #fda4af; }   /* rose */
.bsc-base-g { color: #86efac; }   /* mint */
.bsc-base-c { color: #93c5fd; }   /* blue */
.bsc-base-t { color: #fcd34d; }

.bsc-score {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 8px; font-size: 10px;
}
.bsc-score-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.bsc-score-fill {
  display: block; height: 100%;
  transition: width 0.6s cubic-bezier(.2,.7,.2,1);
}

.bsc-heat { display: flex; flex-direction: column; gap: 6px; }
.bsc-heat-head { font-size: 10px; }
.bsc-heat-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}
.bsc-cell {
  height: 10px;
  border-radius: 1px;
  transition: background 0.6s ease;
}

.bsc-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: -2px;
}
.bsc-blink {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  animation: bsc-blink 1.4s ease-in-out infinite;
}
@keyframes bsc-blink { 0%,100% { opacity: 0.3 } 50% { opacity: 1 } }

/* keyword spans inside the bio paragraph */
.bio-kw { font-style: normal; }
.lede .bio-kw, .huge-bio .bio-kw {
  /* slight weight bump so the colored keywords pop without being shouty */
  font-weight: 500;
}

/* Sidecar facts row */
.bsc-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 10.5px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
}
.bsc-fact { display: flex; flex-direction: column; gap: 2px; }
.bsc-fact > :first-child { letter-spacing: 0.06em; text-transform: uppercase; font-size: 9px; }
.bsc-fact > :last-child  { color: var(--ink-1); }

/* Currently-doing label */
.bsc-now {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-0);
  padding: 4px 0 2px;
  animation: bsc-fade 0.6s ease;
}
@keyframes bsc-fade {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

/* Heatmap with row labels */
.bsc-heat-rows { display: flex; flex-direction: column; gap: 3px; }
.bsc-heat-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: center;
}
.bsc-heat-label { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.bsc-heat-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}

.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 12px; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 28%, transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 28%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 0%, transparent); }
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--ink-0);
  margin: 0 0 26px;
}
.display .name-accent {
  font-style: italic;
  position: relative;
  background: linear-gradient(90deg, var(--p-pink), var(--p-peach), var(--p-butter), var(--p-mint), var(--p-sky), var(--p-lilac));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s ease infinite;
}
@keyframes shimmer { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.display .display-soft {
  font-style: italic;
  color: var(--ink-1);
  font-size: 0.78em;
  line-height: 1.18;
  display: inline-block;
}
.cursor {
  display: inline-block;
  width: 0.42em; height: 0.92em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  animation: blink 1s steps(1) infinite;
}
.cursor.inline { width: 0.36em; height: 0.88em; }
@keyframes blink { 50% { opacity: 0; } }

.lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-1);
  max-width: 60ch;
  margin: 0 0 30px;
}

/* "now" block */
.now-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: color-mix(in oklab, var(--bg-1) 75%, transparent);
  margin-bottom: 28px;
  max-width: 580px;
  position: relative;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.now-block:hover {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
  transform: translateY(-1px);
}
.now-block::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px;
  background: linear-gradient(90deg, var(--p-pink), var(--p-peach), var(--p-butter), var(--p-mint), var(--p-sky), var(--p-lilac));
  border-radius: 8px 8px 0 0;
  opacity: 0.55;
}
.now-label { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: 0.08em; }
.now-ticker { position: relative; height: 24px; }
.ticker-item {
  position: absolute; inset: 0;
  font-family: var(--mono); font-size: 13px; color: var(--ink-1);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.ticker-item.on { opacity: 1; transform: translateY(0); }
.ticker-bullet { margin-right: 6px; }

/* hero links */
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-1);
  text-decoration: none;
  background: color-mix(in oklab, var(--bg-1) 80%, transparent);
  transition: 0.2s ease;
}
.link-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in oklab, var(--accent) 18%, transparent);
}

/* research areas inline */
.research-areas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.research-areas.inline { flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }
.ra { display: inline-flex; align-items: center; gap: 10px; opacity: 0; animation: ra-in 0.5s ease forwards; animation-delay: var(--ax-delay); }
@keyframes ra-in { to { opacity: 1; transform: translateY(0); } from { opacity: 0; transform: translateY(6px); } }
.ra-tag {
  font-family: var(--mono); font-size: 11px;
  padding: 4px 9px; border: 1px solid;
  border-radius: 3px; white-space: nowrap;
  transition: 0.2s ease;
}
.ra:hover .ra-tag { transform: translateY(-1px); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.ra-note { font-size: 12px; color: var(--ink-2); }

/* hero-big variant */
.hero-big .big-stack { padding: 0; max-width: 900px; }
.hero-eyebrow { font-size: 11px; margin-bottom: 28px; letter-spacing: 0.05em; }
.display.huge {
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.92;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.huge-paren {
  display: block;
  font-size: 0.28em;
  font-style: italic;
  color: var(--ink-3);
  margin-top: 14px;
  letter-spacing: 0;
  -webkit-text-fill-color: currentColor;
}
.name-paren {
  font-style: italic;
  font-size: 0.7em;
  color: var(--ink-3);
  margin: 0 0.1em;
}
.display.huge span {
  background: linear-gradient(90deg, var(--p-pink), var(--p-lilac), var(--p-sky), var(--p-mint));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 10s ease infinite;
}
.huge-line { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 30px); max-width: 760px; margin: 0 0 24px; line-height: 1.3; }
.huge-line .dim { color: var(--ink-3); }
.huge-bio { font-family: var(--mono); font-size: 13px; max-width: 760px; margin: 0 0 32px; line-height: 1.7; color: var(--ink-2); }
.huge-status { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: -8px 0 32px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,0.015); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.huge-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; animation: pulse 2.4s ease-in-out infinite; }

/* hero-cycler */
.cycler-head { font-size: clamp(36px, 5.4vw, 64px); }
.cyc-line-b {
  display: inline-block;
  font-style: italic;
  animation: cyc-in 0.5s ease;
}
@keyframes cyc-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    filter: blur(0); }
}
.cyc-period { font-style: normal; }

/* ─────────────────────── Papers ─────────────────────── */
.paper-grid { display: flex; flex-direction: column; gap: 28px; }
.paper-card {
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 88%, transparent);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.paper-card:hover {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.paper-head { padding: 22px 24px 14px; }
.paper-meta { font-size: 11px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.paper-meta .venue {
  padding: 3px 8px; border: 1px solid; border-radius: 3px;
  letter-spacing: 0.03em;
}
.paper-title {
  margin: 0 0 4px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.18; color: var(--ink-0);
}
.paper-subtitle { font-size: 13px; margin-bottom: 10px; }
.paper-authors { font-size: 12px; color: var(--ink-2); }
.author { margin-right: 4px; }
.author.self { font-weight: 600; }

.paper-tabs {
  display: flex; gap: 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-2) 70%, transparent);
  padding: 0 16px;
}
.paper-tab {
  background: none; border: none;
  padding: 11px 14px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: 0.15s ease;
}
.paper-tab:hover { color: var(--ink-1); }
.paper-tab.active { color: var(--accent); }

.paper-body { padding: 22px 24px 24px; min-height: 130px; }
.paper-body p { margin: 0; max-width: 70ch; line-height: 1.6; color: var(--ink-1); }
.paper-body .tldr { font-family: var(--serif); font-size: 19px; color: var(--ink-0); }
.paper-body .abstract { font-size: 14px; }
.figure-wrap { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 12px; }
.paper-fig { width: 100%; height: auto; display: block; }
.figure-cap { font-size: 11px; margin-top: 10px; max-width: 70ch; line-height: 1.5; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  text-decoration: none;
  font-size: 12px;
  transition: 0.15s ease;
}
.link-row:hover { padding-left: 6px; }
.link-list li:last-child .link-row { border-bottom: none; }
.link-label { font-weight: 500; min-width: 80px; }
.link-href { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────────────── Education ─────────────────────── */
.edu-list { display: flex; flex-direction: column; }
.edu-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: start;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px dashed var(--line);
  transition: padding 0.2s ease;
}
.edu-row:last-child { border-bottom: none; }
.edu-row:hover { padding-left: 6px; }
.edu-logo-wrap {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  transition: 0.2s ease;
}
.edu-row:hover .edu-logo-wrap {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
}
.edu-logo { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(0.2); }
.edu-degree { font-family: var(--serif); font-size: 22px; color: var(--ink-0); margin-bottom: 4px; line-height: 1.2; min-width: 0; }
.edu-school { font-size: 13px; color: var(--ink-2); }
.edu-side { font-size: 12px; text-align: right; line-height: 1.4; padding-top: 4px; color: var(--ink-2); }
.edu-side > div { white-space: nowrap; }

/* ─────────────────────── Experience ─────────────────────── */
.exp-list { position: relative; padding-left: 28px; }
.exp-rail { position: absolute; left: 9px; top: 8px; bottom: 8px; width: 1px; }
.exp-row { position: relative; padding: 10px 0 24px; }
.exp-marker {
  position: absolute; left: -28px; top: 22px;
  width: 18px; height: 18px;
  border: 1.5px solid; border-radius: 50%;
  display: grid; place-items: center;
  transition: transform 0.25s ease;
}
.exp-row:hover .exp-marker { transform: scale(1.25); }
.exp-dot { width: 6px; height: 6px; border-radius: 50%; }
.exp-card {
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 88%, transparent);
  border-radius: 6px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.exp-card:hover {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--line));
  transform: translateX(4px);
}
.exp-card-head {
  display: grid; grid-template-columns: 60px 1fr auto;
  align-items: center; gap: 28px;
  margin-bottom: 10px;
}
.exp-logo {
  width: 60px; height: 60px; object-fit: contain;
  background: var(--bg-2); border-radius: 4px; padding: 8px;
  border: 1px solid var(--line);
}
.exp-role { font-family: var(--serif); font-size: 19px; color: var(--ink-0); line-height: 1.2; }
.exp-org { font-size: 11px; }
.exp-span { font-size: 11px; white-space: nowrap; }
.exp-detail { margin: 0; font-size: 13px; color: var(--ink-1); max-width: 78ch; line-height: 1.6; }

/* ─────────────────────── Projects ─────────────────────── */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proj-card {
  position: relative;
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 88%, transparent);
  padding: 22px;
  border-radius: 6px;
  color: inherit;
  transition: 0.25s ease;
  overflow: hidden;
}
.proj-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--p-pink), var(--p-lilac), var(--p-sky), var(--p-mint));
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.3s ease;
}
.proj-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); box-shadow: 0 12px 28px rgba(0,0,0,0.22); }
.proj-card:hover::before { transform: scaleY(1); transform-origin: top; }
.proj-num { font-size: 11px; margin-bottom: 8px; letter-spacing: 0.08em; }
.proj-title { font-family: var(--serif); font-size: 24px; color: var(--ink-0); margin-bottom: 4px; line-height: 1.15; }
.proj-span { font-size: 11px; margin-bottom: 12px; }
.proj-detail { font-size: 13px; margin: 0 0 14px; color: var(--ink-1); line-height: 1.55; }
.proj-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stack-chip {
  font-size: 10px;
  padding: 3px 7px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-2);
  transition: 0.15s ease;
}
.proj-card:hover .stack-chip:nth-child(4n+1) { border-color: var(--p-pink);  color: var(--p-pink); }
.proj-card:hover .stack-chip:nth-child(4n+2) { border-color: var(--p-mint);  color: var(--p-mint); }
.proj-card:hover .stack-chip:nth-child(4n+3) { border-color: var(--p-sky);   color: var(--p-sky); }
.proj-card:hover .stack-chip:nth-child(4n)   { border-color: var(--p-lilac); color: var(--p-lilac); }
.proj-foot { font-size: 11px; display: flex; align-items: center; gap: 6px; }

/* ─────────────────────── Off-screen ─────────────────────── */
.off-wrap { display: flex; flex-direction: column; gap: 28px; }
.off-intro { font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink-2); max-width: 780px; margin: 0; }
.off-intro a { text-decoration: none; border-bottom: 1px dotted currentColor; padding-bottom: 1px; }
.off-intro a:hover { border-bottom-style: solid; }
.off-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.off-pane {
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 92%, transparent);
  border-radius: 4px;
  padding: 22px 24px;
  display: flex; flex-direction: column;
}
.off-pane-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 22px;
  font-size: 12px;
}
.off-pane-num { font-weight: 500; }
.off-pane-title { font-family: var(--serif); font-size: 22px; color: var(--ink-0); letter-spacing: -0.01em; white-space: nowrap; }
.off-pane-meta { margin-left: auto; font-size: 11px; }
.off-pane-link {
  font-size: 11px; text-decoration: none;
  margin-top: auto; padding-top: 16px;
  align-self: flex-start;
  letter-spacing: 0.04em;
}
.off-pane-link:hover { text-decoration: underline; }

/* Books — a compact horizontal pile, stacked flat on top of each other */
.books-stack {
  display: flex; flex-direction: column-reverse;
  align-items: center;
  padding: 14px 0 22px;
  margin: 0 auto;
  perspective: 600px;
}
.book-h {
  height: 38px;
  border-radius: 2px 4px 4px 2px;
  padding: 0 18px 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  color: rgba(255, 248, 235, 0.96);
  font-family: var(--serif);
  box-shadow:
    inset 6px 0 0 rgba(0,0,0,0.22),
    inset -1px 0 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 2px 4px rgba(0,0,0,0.35);
  transition: transform 200ms cubic-bezier(.2,.7,.2,1), margin 200ms;
  cursor: default;
  position: relative;
  overflow: hidden;
  margin-top: -2px; /* pages sit nearly touching */
}
.book-h::before {
  content: ""; position: absolute; left: 12px; top: 4px; bottom: 4px;
  width: 1px; background: rgba(0,0,0,0.22);
}
.book-h::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(90deg, rgba(255,250,235,0.16), rgba(255,250,235,0.04));
  border-left: 1px solid rgba(0,0,0,0.18);
}
.book-h:hover {
  transform: translateX(8px) rotate(0deg) !important;
  margin-top: 4px;
}
.book-h-title { font-size: 13px; font-style: italic; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,0.35); white-space: normal; overflow: visible; text-overflow: clip; flex: 1 1 auto; padding-right: 10px; }
.book-h-author { font-size: 9px; opacity: 0.82; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,0.35); white-space: nowrap; flex: 0 0 auto; }

/* Film reel */
.filmreel {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 2px;
  position: relative;
  padding: 0;
  overflow: hidden;
}
.reel-strip {
  display: flex; justify-content: space-between;
  background: #050505;
  padding: 6px 8px;
}
.reel-strip-top { border-bottom: 1px solid #1a1a1a; }
.reel-strip-bot { border-top: 1px solid #1a1a1a; }
.reel-perf {
  width: 14px; height: 10px;
  background: var(--bg-1);
  border-radius: 2px;
  display: block;
}
.film-cards {
  display: flex; flex-direction: column;
}
.film-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 14px 18px;
  align-items: baseline;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  transition: background 0.18s ease, padding 0.18s ease;
}
.film-card:last-child { border-bottom: none; }
.film-card:hover {
  background: rgba(255,255,255,0.02);
  padding-left: 22px;
}
.film-num { font-size: 11px; }
.film-title { font-family: var(--serif); font-size: 18px; color: var(--ink-0); line-height: 1.25; }
.film-meta { font-size: 11px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; grid-column: 2; }
.film-kind {
  border: 1px solid; padding: 1px 6px;
  border-radius: 2px; font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; margin-left: 8px;
}

/* marginalia */
.off-margin {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 24px;
  border-left: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}
.off-margin-mark { font-size: 22px; line-height: 1; margin-top: 4px; }
.off-margin-text { font-family: "Caveat", var(--serif); font-size: 22px; color: var(--ink-1); line-height: 1.4; }

@media (max-width: 860px) {
  .off-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────── Footer ─────────────────────── */
.foot {
  margin-top: 80px;
  padding: 32px 0 60px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ─────────────────────── Scroll progress bar ─────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 60; pointer-events: none;
  background: color-mix(in oklab, var(--bg-0) 60%, transparent);
}
.scroll-progress-fill {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%;
  transition: transform 0.08s linear;
  box-shadow: 0 0 10px color-mix(in oklab, var(--accent) 60%, transparent);
}

/* ─────────────────────── Section outline rail ─────────────────────── */
.rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 45;
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px;
}
.rail-item {
  appearance: none; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 5px 2px; width: 100%;
  color: var(--ink-3);
}
.rail-pip {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: transparent;
  border: 1.5px solid color-mix(in oklab, var(--dot-c) 55%, var(--ink-4));
  transition: transform 0.25s cubic-bezier(.2,.7,.2,1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.rail-item:hover .rail-pip {
  border-color: var(--dot-c);
  background: color-mix(in oklab, var(--dot-c) 35%, transparent);
  transform: scale(1.15);
}
.rail-item.active .rail-pip {
  background: var(--dot-c);
  border-color: var(--dot-c);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--dot-c) 22%, transparent);
}
.rail-label {
  font-size: 10.5px; letter-spacing: 0.04em; white-space: nowrap;
  color: var(--dot-c);
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.rail-item:hover .rail-label,
.rail-item.active .rail-label { opacity: 1; transform: translateX(0); }
.rail-item.active .rail-label { opacity: 0.95; }
@media (max-width: 1340px) { .rail { display: none; } }

/* ─────────────────────── Cursor glow ─────────────────────── */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 460px; height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  pointer-events: none; z-index: 0;
  opacity: 0.7;
  will-change: transform;
  mix-blend-mode: screen;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ─────────────────────── Section reveal-on-scroll ─────────────────────── */
.section.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.section.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .section.reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .cursor-glow { display: none; }
  .scroll-progress-fill { transition: none; }
}

/* ─────────────────────── Responsive ─────────────────────── */
@media (max-width: 860px) {
  .proj-grid { grid-template-columns: 1fr; }
  .edu-row { grid-template-columns: 60px 1fr; gap: 20px; }
  .edu-side { grid-column: 1 / -1; text-align: left; padding-left: 80px; }
  .exp-card-head { grid-template-columns: 60px 1fr; gap: 20px; }
  .exp-span { grid-column: 1 / -1; }
  .nav-links { gap: 0; }
  .nav-link { padding: 6px 6px; }
  .nav-link .num { display: none; }
  .research-areas.inline { flex-direction: column; align-items: flex-start; }
}
