/* immersive.css — staged, scroll-driven layout over a fixed WebGL scene.
   The canvas paints each chapter's ground; this file keeps every word legible on top of it. */

@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(../fonts/geist-mono-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(../fonts/geist-mono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ink: #15201e;
  --ink-2: #44524f;
  --ink-3: #5c6a67;
  --paper: #fbfcfb;
  --line: rgba(21, 32, 30, .10);

  --teal: #3f8f80;
  --teal-deep: #245e55;
  --teal-soft: #d4ebe4;
  --lime: #b4ec78;
  --gold: #f2c94c;

  --on-dark: #eef6f3;
  --on-dark-2: rgba(238, 246, 243, .72);
  --line-dark: rgba(238, 246, 243, .14);

  --display: linear-gradient(100deg, #79b2a4 0%, #5a8c88 46%, #47616e 100%);

  --glass-bg: rgba(255, 255, 255, .5);
  --glass-edge: rgba(255, 255, 255, .78);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(0, 0, 0, .03), 0 14px 44px rgba(22, 62, 54, .12);
  --glass-dark-bg: rgba(8, 26, 27, .46);
  --glass-dark-edge: rgba(238, 246, 243, .14);

  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: max(16px, min(5vw, 48px));
  --hud-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: #9cc6ba; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--sans);
  color: var(--ink);
  background: transparent;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.is-gated, html.is-gated body { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--teal-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none;
  font: 500 13px var(--mono); transition: top .2s;
}
.skip-link:focus { top: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Scene canvas + fallbacks ---------- */
#gl {
  position: fixed; inset: 0; width: 100vw; height: 100lvh; z-index: 0;
  display: block; pointer-events: none;
}
html.no-webgl #gl { display: none; }
html.no-webgl body { background: linear-gradient(160deg, #cfe7df, #7fb3a6 60%, #4f8f80); background-attachment: fixed; }
html.no-webgl [data-stage="white"], html.no-webgl [data-stage="paper"] { background: var(--paper); }
html.no-webgl [data-stage="sky"] { background: linear-gradient(180deg, #f6faf8, #d6e8ec); }
html.no-webgl [data-stage="tunnel"], html.no-webgl [data-stage="sea"] { background: linear-gradient(180deg, #1f4744, #071a1c); }

main, .footer { position: relative; z-index: 1; }

/* ---------- Shared type ---------- */
.mono { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { margin: 0 0 18px; color: var(--ink-3); }
.eyebrow::before { content: ""; display: inline-block; width: 14px; height: 1px; margin: 0 10px 3px 0; background: currentColor; vertical-align: middle; }
.title {
  margin: 0; font: 400 clamp(44px, 6.4vw, 92px)/.98 var(--serif); letter-spacing: -.01em;
  text-wrap: balance;
}
.title em { font-style: italic; }
.title--grad { background: var(--display); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin: 22px 0 0; max-width: 46ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.container { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.on-dark { color: var(--on-dark); }
.on-dark .eyebrow, .on-dark .lede { color: var(--on-dark-2); }

/* ---------- Glass (after the reference's layered glass, pared down) ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  backdrop-filter: saturate(120%) blur(14px);
}
.glass--dark {
  background: var(--glass-dark-bg);
  border-color: var(--glass-dark-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 20px 60px rgba(0, 0, 0, .25);
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass--dark { background: rgba(8, 26, 27, .94); }
}

/* Corner brackets: a detection box drawn around any element */
.brackets { position: relative; }
.brackets::before, .brackets::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border-color: currentColor; border-style: solid; opacity: .55; transition: all .5s var(--ease);
}
.brackets::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; border-top-left-radius: 6px; }
.brackets::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; border-bottom-right-radius: 6px; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--hud-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter); pointer-events: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.hud > * { pointer-events: auto; }
.hud::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent);
}
html.is-gated .hud, html.is-gated .dock { opacity: 0; transform: translateY(-8px); pointer-events: none; }
html.is-gated .dock { transform: translate(-50%, 12px); }

.hud-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--glass-edge); cursor: pointer; color: var(--ink);
}
.hud-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.hud-motion .wave { stroke-dasharray: 4 3; animation: wave-run 1.2s linear infinite; }
.hud-motion[aria-pressed="false"] .wave { animation: none; stroke-dasharray: none; d: path("M3 12h18"); }
@keyframes wave-run { to { stroke-dashoffset: -14; } }

.timeline { justify-self: center; display: grid; justify-items: center; gap: 4px; color: var(--ink); }
.tl-ruler {
  position: relative; width: min(420px, 44vw); height: 22px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.tl-ticks { position: absolute; left: 50%; top: 0; height: 100%; will-change: transform; }
.tl-ticks i { position: absolute; bottom: 4px; width: 1px; height: 9px; background: currentColor; opacity: .32; }
.tl-ticks i.is-major { height: 14px; opacity: .55; }
.tl-ticks i.is-chapter { height: 18px; width: 1.5px; opacity: .9; }
.tl-head { position: absolute; left: 50%; bottom: 2px; width: 2px; height: 20px; margin-left: -1px; border-radius: 2px; background: currentColor; }
.tl-label { display: flex; gap: 14px; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .78; }
.tl-label b { font-weight: 500; opacity: .6; }

.hud-pill {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px 0 14px; border-radius: 999px;
  font: 500 15px/1 var(--sans); color: var(--ink);
}
.hud-pill svg { width: 16px; height: 16px; stroke: var(--teal); fill: none; stroke-width: 2; }
.hud-pill b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.hud-pill span { color: var(--ink-3); font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.hud-pill.is-pop { animation: pop .5s var(--ease); }
@keyframes pop { 40% { transform: scale(1.08); box-shadow: var(--glass-shadow), 0 0 0 6px rgba(180, 236, 120, .35); } }

html[data-tone="dark"] .timeline, html[data-tone="dark"] .hud-btn, html[data-tone="dark"] .hud-pill { color: var(--on-dark); }
html[data-tone="dark"] .hud-btn, html[data-tone="dark"] .hud-pill { background: var(--glass-dark-bg); border-color: var(--glass-dark-edge); box-shadow: none; }
html[data-tone="dark"] .hud-pill span { color: var(--on-dark-2); }
.timeline, .hud-btn, .hud-pill { transition: color .6s, background-color .6s, border-color .6s; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  width: min(600px, 100% - 32px); border-radius: 999px;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.dock-orb {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: block; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95) 0 6%, transparent 22%),
    radial-gradient(circle at 50% 55%, #9fdc7a 0%, #4fae86 46%, #23655a 100%);
  box-shadow: inset 0 -6px 12px rgba(10, 50, 40, .35), 0 4px 14px rgba(30, 90, 70, .3);
}
.dock-orb::after {
  content: ""; position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle, #0e2a28 0 34%, transparent 36%), conic-gradient(from 0deg, #c9f59c, #6cc79a, #2f7f70, #c9f59c);
  -webkit-mask: radial-gradient(circle, #000 64%, transparent 66%); mask: radial-gradient(circle, #000 64%, transparent 66%);
  animation: orb-spin 9s linear infinite; opacity: .9;
}
@keyframes orb-spin { to { transform: rotate(360deg); } }
.dock-cta {
  flex: 1; height: 52px; border-radius: 999px; display: grid; place-items: center;
  background: #1d1f1f; color: #fff; text-decoration: none; font: 600 17px/1 var(--sans); letter-spacing: -.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 18px rgba(0, 0, 0, .18);
  transition: background .3s, transform .3s var(--ease);
}
.dock-cta:hover { background: #000; transform: translateY(-1px); }
.dock-menu {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.dock-menu span { display: block; width: 20px; height: 1.6px; background: var(--ink); border-radius: 2px; box-shadow: 0 6px 0 var(--ink); transform: translateY(-3px); }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto;
  padding: 22px var(--gutter) calc(110px + env(safe-area-inset-bottom));
  background: rgba(246, 250, 248, .78);
  -webkit-backdrop-filter: blur(26px) saturate(130%); backdrop-filter: blur(26px) saturate(130%);
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s .5s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 22px; line-height: 1; }
.menu-list { list-style: none; margin: 0; padding: 0; align-self: center; counter-reset: m; }
.menu-list li { counter-increment: m; overflow: hidden; }
.menu-list a {
  display: flex; align-items: baseline; gap: 18px; padding: 2px 0; text-decoration: none;
  font: 400 clamp(40px, 7.2vw, 92px)/1.04 var(--serif); letter-spacing: -.01em;
  transform: translateY(105%); transition: transform .7s var(--ease), color .3s;
}
.menu-list a::before { content: "0" counter(m); font: 500 13px var(--mono); letter-spacing: .1em; color: var(--ink-3); transform: translateY(-1.6em); }
.menu.is-open .menu-list a { transform: none; }
.menu-list li:nth-child(2) a { transition-delay: .04s; } .menu-list li:nth-child(3) a { transition-delay: .08s; }
.menu-list li:nth-child(4) a { transition-delay: .12s; } .menu-list li:nth-child(5) a { transition-delay: .16s; }
.menu-list li:nth-child(6) a { transition-delay: .2s; } .menu-list li:nth-child(7) a { transition-delay: .24s; }
.menu-list a:hover { font-style: italic; color: var(--teal-deep); }
.menu-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.menu-meta a { color: var(--ink-2); text-decoration: none; }
.menu-meta a:hover { color: var(--ink); }

/* ---------- Gate: load counter, then "draw a box" ---------- */
.gate { display: none; }
html.is-gated .gate, .gate.is-leaving {
  display: grid; position: fixed; inset: 0; z-index: 50; place-items: center;
  touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none;
}
.gate.is-leaving { opacity: 0; transition: opacity 1s var(--ease); pointer-events: none; }
.gate-count {
  grid-area: 1 / 1; font: 400 clamp(120px, 22vw, 300px)/1 var(--serif); color: #fff;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 40px rgba(20, 70, 60, .35); transition: opacity .6s var(--ease), transform .8s var(--ease), filter .8s;
}
.gate.is-ready .gate-count { opacity: 0; transform: scale(.92); filter: blur(10px); }
.gate-prompt {
  grid-area: 1 / 1; display: grid; justify-items: center; gap: 18px; pointer-events: none;
  opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease) .2s, transform .8s var(--ease) .2s;
}
.gate.is-ready .gate-prompt { opacity: 1; transform: none; }
.gate.is-drawing .gate-prompt, .gate.is-done .gate-prompt { opacity: 0; transition-delay: 0s; }
.gate-demo { width: 200px; height: 140px; overflow: visible; }
.gate-demo rect { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 1.5; stroke-dasharray: 600; stroke-dashoffset: 600; animation: demo-draw 2.8s var(--ease) infinite; }
.gate-demo circle { fill: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); animation: demo-cursor 2.8s var(--ease) infinite; }
@keyframes demo-draw { 0% { stroke-dashoffset: 600; opacity: 1; } 55% { stroke-dashoffset: 0; } 80% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes demo-cursor { 0% { transform: translate(14px, 14px); } 55%, 100% { transform: translate(186px, 126px); } }
.gate-hint { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: #fff; font: 500 14px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 12px rgba(20, 70, 60, .5); }
.gate-hint svg { width: 14px; height: 8px; stroke: currentColor; fill: none; stroke-width: 1.5; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
.gate.is-nudge .gate-prompt { animation: nudge .45s; }
@keyframes nudge { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.gate-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gate-draw .box { fill: rgba(255, 255, 255, .08); stroke: rgba(255, 255, 255, .55); stroke-width: 1; }
.gate-draw .corners { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.gate-draw .tag rect { fill: var(--lime); }
.gate-draw .tag text { font: 500 12px var(--mono); letter-spacing: .06em; fill: #0f2a26; }
.gate.is-done .gate-draw g { animation: lock .7s var(--ease) forwards; }
@keyframes lock { 0% { opacity: 1; } 20% { opacity: .2; } 40% { opacity: 1; } 100% { opacity: 1; } }
.gate-skip {
  position: absolute; right: var(--gutter); bottom: max(22px, env(safe-area-inset-bottom)); z-index: 2;
  height: 40px; padding: 0 18px; border-radius: 999px; cursor: pointer; color: var(--ink);
  font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Stages ---------- */
.stage { position: relative; padding: clamp(110px, 16vh, 180px) 0; }

/* Hero (water) */
.hero { min-height: 100svh; padding: 0; display: flex; align-items: flex-end; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 80% at 0% 100%, rgba(16, 58, 51, .62), rgba(16, 58, 51, .22) 45%, transparent 70%);
}
.hero-inner { position: relative; width: 100%; padding: 0 var(--gutter) calc(118px + env(safe-area-inset-bottom)); color: #fff; }
.hero-news {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px 0 6px; margin-bottom: 26px;
  border-radius: 999px; color: var(--ink); text-decoration: none; font: 500 13px/1 var(--sans);
}
.hero-news b { height: 24px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; background: #1d1f1f; color: #fff; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.hero-eyebrow { margin: 0 0 10px; color: rgba(255, 255, 255, .86); text-shadow: 0 1px 14px rgba(12, 50, 44, .45); }
.hero-name {
  margin: 0; font: 400 clamp(58px, 11.5vw, 188px)/.86 var(--serif); letter-spacing: -.025em;
  text-shadow: 0 2px 50px rgba(12, 50, 44, .35);
}
.hero-name em { font-style: italic; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px;
  text-decoration: none; font: 600 15px/1 var(--sans); letter-spacing: -.005em; cursor: pointer;
  transition: transform .3s var(--ease), background .3s;
}
.btn:hover { transform: translateY(-1px); }
.btn--ink { background: #1d1f1f; color: #fff; border: 0; }
.btn--ink:hover { background: #000; }
.btn--glass { color: var(--ink); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: calc(126px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 12px; border-radius: 999px;
  font: 500 12px/1 var(--mono); letter-spacing: .18em; color: var(--ink); transition: opacity .5s;
}
.scroll-cue i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateY(4px); opacity: .4; } }
html.is-scrolled .scroll-cue { opacity: 0; pointer-events: none; }

/* Thesis (white) — the reference's big two-weight serif statement */
.thesis { min-height: 130vh; display: grid; place-items: center; text-align: center; }
.thesis-line { margin: 0; font: 400 clamp(60px, 12.5vw, 210px)/.86 var(--serif); letter-spacing: -.03em; }
.thesis-line span { display: block; background: var(--display); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.thesis-line span:first-child { font-style: italic; transform: translateX(-.35em); }
.thesis-line span:last-child { font-size: .5em; letter-spacing: -.015em; transform: translateX(.6em); }
.thesis-cap { margin: 48px auto 0; max-width: 40ch; color: var(--ink-2); font-size: clamp(14px, 1.15vw, 16px); line-height: 1.7; letter-spacing: .1em; }

/* Research (sky) */
.threads { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 64px; }
.thread { grid-column: span 2; padding: 30px 26px 32px; border-radius: var(--radius); color: var(--ink); }
.thread:nth-child(4), .thread:nth-child(5) { grid-column: span 3; }
.thread h3 { margin: 0 0 10px; font: 400 30px/1.05 var(--serif); letter-spacing: -.005em; }
.thread p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.thread:hover::before, .thread:hover::after { width: 30px; height: 30px; opacity: 1; }

/* About (sky) */
.about { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; margin-top: 56px; }
.about-prose { padding: clamp(26px, 3.4vw, 44px); border-radius: var(--radius); }
.about-prose p { margin: 0 0 1.05em; color: var(--ink-2); font-size: 17.5px; }
.about-prose p:first-child { color: var(--ink); font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; letter-spacing: -.012em; }
.about-prose p:last-child { margin: 0; }
.about-prose a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.facts { padding: 26px; border-radius: var(--radius); }
.facts-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.facts-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.facts-head strong { display: block; font: 400 24px/1.1 var(--serif); }
.facts-head span { color: var(--ink-3); font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.facts dl { margin: 0; }
.facts dl div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--ink-3); font: 500 12px/1.75 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.facts dd { margin: 0; font-size: 15px; }

/* Projects (tunnel) */
.projects-head { max-width: 760px; }
.reel { list-style: none; margin: 18vh 0 0; padding: 0; display: grid; gap: 34vh; }
.shot { width: min(560px, 100%); border-radius: var(--radius); overflow: hidden; color: var(--on-dark); }
.shot:nth-child(even) { justify-self: end; }
.shot-media { position: relative; aspect-ratio: 16 / 9; background: #0b1f20; overflow: hidden; }
.shot-media img { width: 100%; height: 100%; object-fit: cover; }
.shot-media.is-contain { background: #f2f6f4; }
.shot-media.is-contain img { object-fit: contain; padding: 10px; }
.shot-media::after { content: ""; position: absolute; inset: 12px; border: 1.5px solid var(--lime); border-radius: 6px; opacity: .0; transition: opacity .4s; -webkit-mask: linear-gradient(#000 0 0) top left / 22px 22px no-repeat, linear-gradient(#000 0 0) top right / 22px 22px no-repeat, linear-gradient(#000 0 0) bottom left / 22px 22px no-repeat, linear-gradient(#000 0 0) bottom right / 22px 22px no-repeat; mask: linear-gradient(#000 0 0) top left / 22px 22px no-repeat, linear-gradient(#000 0 0) top right / 22px 22px no-repeat, linear-gradient(#000 0 0) bottom left / 22px 22px no-repeat, linear-gradient(#000 0 0) bottom right / 22px 22px no-repeat; }
.shot:hover .shot-media::after, .shot.is-in .shot-media::after { opacity: .95; }
.shot-tag { position: absolute; left: 12px; top: 12px; z-index: 1; padding: 6px 9px; border-radius: 4px; background: var(--lime); color: #0f2a26; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.shot-body { padding: 24px 26px 26px; }
.shot-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor; opacity: .85; }
.chip--lime { border-color: transparent; background: var(--lime); color: #0f2a26; opacity: 1; }
.shot h3 { margin: 0 0 10px; font: 400 clamp(30px, 3vw, 40px)/1.02 var(--serif); letter-spacing: -.01em; }
.shot p { margin: 0; color: var(--on-dark-2); font-size: 16px; line-height: 1.55; }
.shot-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--on-dark-2); font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.shot-tags li::before { content: "#"; opacity: .5; margin-right: 2px; }
.shot-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 20px; }
.more { padding: 0; border: 0; background: none; cursor: pointer; color: var(--on-dark); font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.more::after { content: "+"; font-size: 16px; line-height: 1; transition: transform .3s var(--ease); }
.more[aria-expanded="true"]::after { transform: rotate(45deg); }
.shot-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.shot-details > div { overflow: hidden; }
.shot-details.is-open { grid-template-rows: 1fr; }
.shot-details p { padding-top: 16px; font-size: 15px; }
.shot-links { display: flex; gap: 14px; }
.shot-links a { color: var(--lime); font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid rgba(180, 236, 120, .4); padding-bottom: 2px; }
.shot-links a:hover { border-bottom-color: var(--lime); }

/* Paper chapters: publications, teaching, honors */
.paper-sec { padding-block: clamp(90px, 12vh, 140px); }
.pub-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 48px 0 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(21, 32, 30, .05); }
.seg button { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.select { height: 42px; padding: 0 36px 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2315201e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; -webkit-appearance: none; appearance: none; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pub-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.pub-row h3 { margin: 0; font: 400 clamp(22px, 2.1vw, 28px)/1.18 var(--serif); letter-spacing: -.005em; }
.pub-row h3 a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.pub-row h3 a:hover { background-size: 100% 1px; }
.pub-authors { margin: 0; color: var(--ink-2); font-size: 15px; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; color: var(--ink-3); font: 500 12.5px/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.tag--accent { border-color: transparent; background: var(--lime); color: #0f2a26; }
.link { padding: 0; border: 0; background: none; cursor: pointer; color: var(--teal-deep); text-decoration: none; font: inherit; border-bottom: 1px solid rgba(36, 94, 85, .3); }
.link:hover { border-bottom-color: currentColor; }
.pub-empty { padding: 26px 0; color: var(--ink-3); }

.rows { margin-top: 48px; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.row .row-when { margin: 4px 0 0; color: var(--ink-3); }
.row h3 { margin: 0 0 4px; font: 400 28px/1.1 var(--serif); }
.row p { margin: 0; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.stat { padding: 28px 26px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.stat .stat-num { margin: 0 0 22px; font: 400 clamp(56px, 6vw, 84px)/.9 var(--serif); letter-spacing: -.02em; background: var(--display); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat h3 { margin: 0 0 4px; font: 600 16px/1.3 var(--sans); }
.stat p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* At sea (dark water) */
.sea { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.sea p.lede a { color: var(--lime); text-underline-offset: 3px; }
.sea-frame { position: relative; margin: 0; padding: 12px; border-radius: var(--radius); }
.sea-frame img { border-radius: 12px; width: 100%; height: auto; }
.sea-frame figcaption { margin-top: 12px; color: var(--on-dark-2); font: 500 12.5px/1.55 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.sea-frame .shot-tag { left: 24px; top: 24px; }
.sea .btn--glass { margin-top: 30px; }

/* Contact (water again) */
.contact { min-height: 115vh; display: grid; align-items: end; padding-bottom: calc(110px + env(safe-area-inset-bottom)); text-align: center; }
.contact .title { font-size: clamp(56px, 9vw, 150px); color: #fff; text-shadow: 0 2px 44px rgba(12, 50, 44, .3); }
.contact .lede { margin-inline: auto; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 16px rgba(12, 50, 44, .45); }
.contact .eyebrow { color: rgba(255, 255, 255, .85); }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.profiles a { height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.coords { margin-top: 34px; color: rgba(255, 255, 255, .94); text-shadow: 0 1px 12px rgba(12, 50, 44, .5); }
.footer { padding: 0 var(--gutter) calc(96px + env(safe-area-inset-bottom)); text-align: center; color: rgba(255, 255, 255, .88); font: 500 12px/1.8 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.footer a { color: #fff; }

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); }
html.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .threads { grid-template-columns: 1fr 1fr; }
  .thread, .thread:nth-child(4), .thread:nth-child(5) { grid-column: span 1; }
  .thread:nth-child(5) { grid-column: span 2; }
  .about, .sea { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .reel { gap: 22vh; }
  .shot:nth-child(even) { justify-self: start; }
}
@media (max-width: 640px) {
  :root { --hud-h: 64px; }
  body { font-size: 16px; }
  .tl-ruler { width: 34vw; }
  .tl-label b { display: none; }
  .hud-pill { height: 40px; padding: 0 12px 0 10px; }
  .hud-pill span { display: none; }
  .hud-btn { width: 40px; height: 40px; }
  .threads { grid-template-columns: 1fr; }
  .thread, .thread:nth-child(5) { grid-column: span 1; }
  .scroll-cue { display: none; }
  .thesis-line span:first-child, .thesis-line span:last-child { transform: none; }
  .thesis-line span:last-child { font-size: .56em; }
  .dock-orb, .dock-menu { width: 48px; height: 48px; }
  .dock-cta { height: 48px; font-size: 16px; }
  .facts dl div { grid-template-columns: 88px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .gate-demo rect, .gate-demo circle, .dock-orb::after, .hud-motion .wave, .scroll-cue i { animation: none; }
  .menu-list a { transition: none; }
}
