/* Site stylesheet (every lab page).
   Contrast: every text colour stays >= 4.5:1 (body) and >= 3:1 (large display text) on the page ground even where
   the three.js field is brightest (its peak alpha is --field-alpha); checked numerically, see the PR.
   Nothing is hidden by CSS alone: GSAP sets the start state of a reveal only when motion runs, so each page is
   complete without JS, in print and under prefers-reduced-motion. */

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

:root {
  --display: "Instrument", Georgia, serif;
  --text: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --maxw: 1120px; --pad: clamp(1.15rem, 5vw, 3.2rem); --bar-h: 3.6rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* paper */
  --bg: #f2efe8; --veil: rgba(242, 239, 232, .82); --ink: #15192b; --muted: #3f475b; --faint: #4a5266;
  --accent: #2342b8; --accent-2: #1a5c50; --line: #d3cdc0; --line-strong: #8e94a3; --sel: #c9d5ff; --on-accent: #fff;
  --field-a: 40, 70, 201; --field-b: 31, 107, 93; --field-alpha: .15;
  --th-nmr: #5b4a8a; --th-weather: #245f7e; --th-image: #2b6650; --th-qkd: #3d5873; --th-fpga: #7a5013; --th-vqls: #51541a; --th-tensor: #843d5b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1424; --veil: rgba(14, 20, 36, .8); --ink: #e8edf6; --muted: #c4ccdb; --faint: #b2bccf;
    --accent: #aecbff; --accent-2: #a8e6c8; --line: #253049; --line-strong: #56627d; --sel: #2c3f74; --on-accent: #0e1424;
    --field-a: 127, 168, 255; --field-b: 143, 224, 191; --field-alpha: .22;
    --th-nmr: #b9a6ea; --th-weather: #86c4e6; --th-image: #86d4b2; --th-qkd: #a4c0dc; --th-fpga: #e0b06b; --th-vqls: #cfd27c; --th-tensor: #eaa5c3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1424; --veil: rgba(14, 20, 36, .8); --ink: #e8edf6; --muted: #c4ccdb; --faint: #b2bccf;
  --accent: #aecbff; --accent-2: #a8e6c8; --line: #253049; --line-strong: #56627d; --sel: #2c3f74; --on-accent: #0e1424;
  --field-a: 127, 168, 255; --field-b: 143, 224, 191; --field-alpha: .22;
  --th-nmr: #b9a6ea; --th-weather: #86c4e6; --th-image: #86d4b2; --th-qkd: #a4c0dc; --th-fpga: #e0b06b; --th-vqls: #cfd27c; --th-tensor: #eaa5c3;
  color-scheme: dark;
}
.th-nmr { --th: var(--th-nmr); } .th-weather { --th: var(--th-weather); } .th-image { --th: var(--th-image); }
.th-qkd, .th-crypto { --th: var(--th-qkd); } .th-fpga { --th: var(--th-fpga); } .th-vqls { --th: var(--th-vqls); } .th-tensor { --th: var(--th-tensor); }
.th-magnet { --th: var(--th-fpga); } .th-pinn { --th: var(--th-nmr); } .th-chain { --th: var(--th-weather); } .th-evo { --th: var(--th-image); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 1rem); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.04rem/1.64 var(--text); overflow-x: clip; }
::selection { background: var(--sel); color: var(--ink); }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-weight: 400; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--bg); padding: .5rem .8rem; z-index: 70; }
.skip:focus { left: .5rem; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.err { max-width: var(--maxw); margin: 2rem auto; padding: 0 var(--pad); }
.micro { font-family: var(--mono); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 0 0 1rem; }

/* ---------- three.js field and page curtain ---------- */
.lab-field { position: fixed; inset: 0; width: 100vw !important; height: 100vh !important; z-index: -1; pointer-events: none; }
.curtain { position: fixed; inset: 0; z-index: 60; background: var(--ink); transform: translateY(-100%); pointer-events: none; }
/* Arrival: the curtain lifts by CSS alone, so a script failure can never leave it covering the page. */
html.lab-anim .curtain { animation: curtain-out .9s cubic-bezier(.7, 0, .2, 1) .05s both; }
/* Departure: GSAP owns the transform. */
html.lab-anim .curtain.is-leaving { animation: none; }
@keyframes curtain-out { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem;
  min-height: var(--bar-h); padding: .55rem var(--pad); background: var(--veil); border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) { .bar { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); } }
.mark { font-family: var(--display); font-size: 1.35rem; text-decoration: none; margin-right: auto; display: inline-flex; min-height: 32px; align-items: center; }
.bar-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.15rem; }
.bar-nav a, .bar-tools a, .bar-tools button {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center; min-height: 32px;
}
.bar-nav .num { color: var(--accent); margin-left: .3rem; font-size: .7em; align-self: flex-start; padding-top: .35rem; }
.bar-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .45em; text-decoration-thickness: 2px; }
.bar-tools { display: flex; align-items: center; gap: .9rem; }
.bar-tools button { background: none; border: 1px solid var(--line-strong); color: var(--ink); padding: 0 .6rem; border-radius: 3px; cursor: pointer; }
.bar-tools button:hover { border-color: var(--accent); color: var(--accent); }
.bar-tools button[hidden] { display: none; }
@media (max-width: 720px) {
  .bar-nav { order: 3; flex: 1 0 100%; }
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.more { margin: 2rem 0 0; font-family: var(--mono); font-size: .82rem; letter-spacing: .06em; }
.more a { display: inline-flex; min-height: 32px; align-items: center; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }
.links a { font-family: var(--mono); font-size: .84rem; letter-spacing: .06em; display: inline-flex; min-height: 32px; align-items: center; }

/* ---------- Word masks (GSAP splits headings into these) ---------- */
.wm { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; }
.wi { display: inline-block; }

/* ---------- Layout ---------- */
main { display: block; }
section { padding-left: var(--pad); padding-right: var(--pad); }
.block { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding-top: clamp(5rem, 14vh, 9rem); }
h2 { font-family: var(--display); font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1; margin: 0 0 2.2rem; letter-spacing: -.012em; }
h1 em, h2 em, .foot-big em { color: var(--accent); }
.prose p { margin: 0 0 1em; max-width: 68ch; }

/* ---------- Home: hero ---------- */
.hero {
  max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; min-height: calc(100svh - var(--bar-h));
  display: flex; flex-direction: column; justify-content: center; padding-top: 3rem; padding-bottom: 3rem;
}
.hero-name { font-family: var(--display); margin: 0; letter-spacing: -.025em; font-size: clamp(3.4rem, 13vw, 11.5rem); line-height: .88; }
.hero-name .w { display: inline-block; white-space: nowrap; }
.hero-name .ch { display: inline-block; overflow: hidden; padding: 0 .01em .1em; margin-bottom: -.1em; vertical-align: bottom; }
.hero-name .chi { display: inline-block; }
.hero-plus { font-family: var(--display); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.3rem); margin: 1.4rem 0 .5rem; line-height: 1.2; }
.hero-plus::before { content: "+ "; font-style: normal; color: var(--accent); }
.hero-tag { max-width: 58ch; color: var(--muted); margin: 0; }
.hero-now { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; color: var(--muted); margin: 1.2rem 0 0; }
.hero-now b { color: var(--accent-2); font-weight: 500; letter-spacing: .14em; margin-right: .6rem; text-transform: uppercase; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.cue {
  margin-top: 2.6rem; font-family: var(--mono); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  text-decoration: none; align-self: flex-start; display: inline-flex; min-height: 32px; align-items: center;
}

/* ---------- Home: the question ---------- */
.question { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; min-height: 90svh; display: flex; flex-direction: column; justify-content: center; }
.kinetic { font-family: var(--display); font-size: clamp(2rem, 4.8vw, 3.9rem); line-height: 1.12; margin: 0; max-width: 24ch; }

/* ---------- Home: work (a horizontal track when pinned) ---------- */
.work { padding-top: clamp(5rem, 14vh, 9rem); }
.work-head, .hz { max-width: var(--maxw); margin: 0 auto; }
.work-head h2 { margin-bottom: .8rem; }
.work-hint { font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; color: var(--faint); margin: 0 0 2rem; text-transform: uppercase; }
.hz-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
@media (min-width: 720px) { .hz-track { grid-template-columns: 1fr 1fr; } }
.hz-card { perspective: 900px; }
.hz-card a {
  position: relative; display: flex; flex-direction: column; gap: .5rem; height: 100%; min-height: 22rem; padding: 1.6rem 1.5rem 1.4rem;
  background: var(--veil); border: 1px solid var(--line); border-top: 3px solid var(--th, var(--accent)); border-radius: 6px; text-decoration: none;
  transition: transform .5s var(--ease), border-color .3s var(--ease);
}
@supports (backdrop-filter: blur(1px)) { .hz-card a { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }
.hz-card a:hover, .hz-card a:focus-visible { transform: translateY(-6px); border-color: var(--line-strong); color: inherit; }
.hz-n { font-family: var(--mono); font-size: .8rem; color: var(--accent); }
.hz-of { color: var(--faint); }
.hz-thread { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.hz-title { font-family: var(--display); font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.04; }
.hz-card a:hover .hz-title, .hz-card a:focus-visible .hz-title { color: var(--accent); }
.hz-status { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.hz-blurb { color: var(--muted); }
.hz-metric { margin-top: auto; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.hz-metric .v { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--th, var(--accent-2)); }
.hz-metric .l { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.hz-go { font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: .4rem; }
.hz-metric + .hz-go { margin-top: .4rem; }
.hz-blurb + .hz-go, .hz-status + .hz-go { margin-top: auto; }
/* Pinned (desktop with motion): one row that GSAP moves sideways as you scroll down. */
.work.is-pinned { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: calc(var(--bar-h) + 1.5rem); padding-bottom: 2rem; overflow: hidden; }
.work.is-pinned .work-head { width: 100%; }
.work.is-pinned .hz { max-width: none; width: 100%; }
.work.is-pinned .hz-track { display: flex; gap: 1.6rem; width: max-content; padding-left: max(0px, calc((100vw - var(--maxw)) / 2 - var(--pad))); padding-right: 30vw; }
.work.is-pinned .hz-card { width: min(30rem, 40vw); flex: 0 0 auto; }
.work.is-pinned .hz-card a { min-height: min(31rem, 60vh); }

/* ---------- Home: numbers, short path, citations, contact ---------- */
.nums { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .nums { grid-template-columns: repeat(4, 1fr); } }
.nums li { background: var(--bg); padding: 1.6rem 1.3rem; display: flex; flex-direction: column; gap: .3rem; }
.num-v { font-family: var(--display); font-size: clamp(3rem, 6vw, 4.8rem); line-height: 1; color: var(--accent); }
.num-l { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.num-n { color: var(--muted); font-size: .92rem; }
.mini-path { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mini-path li { display: grid; gap: .1rem 2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .mini-path li { grid-template-columns: 13rem 1fr; } .mini-path .mp-org { grid-column: 2; } }
.mp-when { font-family: var(--mono); font-size: .78rem; color: var(--faint); padding-top: .4rem; }
.mp-role { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; }
.mp-org { color: var(--muted); }
.cites, .biblio { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cite, .bib { padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.cite-k { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 .4rem; }
.cite-t { font-family: var(--display); font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.14; margin: 0 0 .4rem; max-width: 40ch; }
.cite-a, .cite-v { margin: 0; color: var(--muted); }
.cite-a strong { color: var(--ink); font-weight: 600; }
.cite-r { margin: .6rem 0 0; max-width: 70ch; }
.ids { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: .7rem 0 0; }
.ids a { font-family: var(--mono); font-size: .8rem; display: inline-flex; min-height: 24px; align-items: center; overflow-wrap: anywhere; }
.eq { color: var(--accent-2); font-weight: 600; }
.footnote { font-size: .88rem; color: var(--muted); margin: 1rem 0 0; }
.contact { padding-bottom: 4rem; }
.avail { font-family: var(--display); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; max-width: 32ch; margin: 0 0 2rem; }

/* ---------- Inner pages: hero ---------- */
.page-hero { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding-top: clamp(4rem, 14vh, 8rem); }
.page-hero h1 { font-family: var(--display); font-size: clamp(3.1rem, 9vw, 7.6rem); line-height: .94; margin: 0 0 1.4rem; letter-spacing: -.02em; }
.page-lede { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.3; max-width: 42ch; margin: 0; color: var(--muted); }

/* ---------- About ---------- */
.statement p { font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.7; max-width: 64ch; margin: 0 0 1.2em; }
.statement p.first { font-family: var(--display); font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.22; max-width: 32ch; }
.interests { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
@media (min-width: 900px) { .interests { grid-template-columns: repeat(3, 1fr); } }
.interest { padding: 1.5rem 1.3rem; background: var(--veil); border: 1px solid var(--line); border-radius: 6px; }
.in-n { font-family: var(--mono); font-size: .78rem; color: var(--accent); }
.interest h3 { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; margin: .4rem 0 .5rem; }
.interest p { margin: 0; color: var(--muted); }
.looking { font-family: var(--display); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.3; max-width: 42ch; margin: 2.5rem 0 0; }
.edu, .awards { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.edu li { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.edu-when, .aw-y { font-family: var(--mono); font-size: .78rem; color: var(--faint); }
.edu h3 { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.14; margin: .2rem 0; }
.edu-school, .edu-note { margin: 0; color: var(--muted); }
.edu-note { margin-top: .4rem; max-width: 68ch; }
.tools { display: grid; gap: 1.6rem 2.6rem; margin: 0; }
@media (min-width: 720px) { .tools { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .tools { grid-template-columns: 1fr 1fr 1fr; } }
.tools dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .4rem; }
.tools dd { margin: 0; color: var(--muted); }
.awards li { display: grid; gap: .1rem 1.6rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .awards li { grid-template-columns: 8rem 1fr; } }
.aw-t { font-family: var(--display); font-size: 1.35rem; line-height: 1.22; }
.aw-d { display: block; margin-top: .3rem; font-family: Geist, system-ui, sans-serif; font-size: .95rem; line-height: 1.4; opacity: .7; }
#certificates[hidden] { display: none; }

/* ---------- Path: the worldline ---------- */
.worldline-wrap { position: relative; padding-left: 2.4rem; }
.wl-line, .wl-fill { position: absolute; left: .5rem; top: .5rem; bottom: .5rem; width: 1px; background: var(--line-strong); }
.wl-fill { width: 3px; left: calc(.5rem - 1px); background: var(--accent); transform-origin: top center; }
.worldline { list-style: none; margin: 0; padding: 0; }
.event { position: relative; padding: 0 0 3.4rem; }
.ev-dot { position: absolute; left: -2.4rem; top: .5rem; width: 1.05rem; height: 1.05rem; margin-left: .03rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.event.is-now .ev-dot { background: var(--accent); box-shadow: 0 0 0 6px var(--sel); }
.ev-when { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; color: var(--faint); margin: 0; }
.ev-title { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.06; margin: .2rem 0 .3rem; max-width: 26ch; }
.ev-org { margin: 0; color: var(--muted); }
.ev-sum { margin: .8rem 0 0; font-size: 1.1rem; max-width: 64ch; }
.ev-narr { margin-top: .8rem; }
.ev-points { margin: .8rem 0 0; padding-left: 1.1rem; max-width: 68ch; color: var(--muted); }
.ev-points li { margin-bottom: .35rem; }
.ev-tags { font-family: var(--mono); font-size: .76rem; color: var(--faint); margin: .8rem 0 0; }

/* ---------- Papers ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.chip {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; min-height: 36px; padding: 0 .95rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.bib[hidden] { display: none; }
.abs { margin-top: .7rem; }
.abs summary { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); cursor: pointer; display: inline-flex; min-height: 32px; align-items: center; }
.abs p { max-width: 70ch; margin: .6rem 0 0; }

/* ---------- Project breakdown ---------- */
.crumbs { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 3rem; }
.crumbs a { display: inline-flex; min-height: 32px; align-items: center; text-decoration: none; }
.crumbs .micro { margin: 0; }
.project-hero #pr-thread { color: var(--th, var(--accent)); }
.project-hero h1 { max-width: 15ch; }
.pr-status { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: 1.4rem 0 0; }
.pr-tags { display: block; color: var(--faint); margin-top: .3rem; }
.pr-metrics { list-style: none; margin: 2.2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.2rem 3rem; }
.pr-metrics .v { display: block; font-family: var(--display); font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 1; color: var(--th, var(--accent)); }
.pr-metrics .l { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.chapter-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.chapter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 3rem; padding: 2.4rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  .chapter { grid-template-columns: 15rem minmax(0, 1fr); }
  .ch-side { position: sticky; top: calc(var(--bar-h) + 1.5rem); align-self: start; }
}
.ch-n { font-family: var(--mono); font-size: .8rem; color: var(--th, var(--accent)); }
.ch-h { font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.06; margin: .3rem 0 0; }
.ch-body p { font-size: 1.08rem; }
.tbl { overflow-x: auto; margin: 1.2rem 0; }
.tbl table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .94rem; min-width: 26rem; }
.tbl caption { text-align: left; color: var(--muted); padding-bottom: .5rem; font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; }
.tbl th, .tbl td { padding: .4rem 1.1rem .4rem 0; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th[scope="row"], .tbl thead th:first-child { text-align: left; }
.paper-card { padding: 1.8rem 1.6rem; background: var(--veil); border: 1px solid var(--line); border-left: 3px solid var(--th, var(--accent)); border-radius: 6px; }
.abstract { margin-top: 1.4rem; }
.abstract .micro { margin-bottom: .4rem; }
.abstract p:last-child { max-width: 70ch; margin: 0; }
.next { padding-bottom: 4rem; }
.next-grid { display: grid; gap: 1.2rem; }
@media (min-width: 900px) { .next-grid { grid-template-columns: 1fr 1fr; } }
.next-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 2rem 1.6rem; min-height: 13rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; background: var(--veil); transition: transform .5s var(--ease), border-color .3s var(--ease);
}
.next-card:hover, .next-card:focus-visible { transform: translateY(-5px); border-color: var(--line-strong); color: inherit; }
.next-card .micro { margin: 0; }
.next-t { font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.06; }
.next-card:hover .next-t, .next-card:focus-visible .next-t { color: var(--accent); }
.next-b { color: var(--muted); }

/* ---------- Figures (markup from js/figures.js) ---------- */
.fig { margin: 0 0 2rem; }
.fig svg { display: block; width: 100%; height: auto; aspect-ratio: 640 / 360; }
.fig-scroll { overflow-x: auto; background: var(--veil); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
@media (max-width: 560px) { .fig-scroll svg { min-width: 560px; } }
.fig figcaption { margin-top: .8rem; font-size: .92rem; line-height: 1.55; color: var(--muted); max-width: 72ch; }
.fig-data { margin-top: .6rem; font-size: .9rem; }
.fig-data summary { cursor: pointer; color: var(--muted); display: inline-flex; min-height: 28px; align-items: center; }
.fig-data table { border-collapse: collapse; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.fig-data caption { text-align: left; color: var(--muted); padding-bottom: .3rem; }
.fig-data th, .fig-data td { padding: .25rem .9rem .25rem 0; border-bottom: 1px solid var(--line); text-align: right; }
.fig-data th[scope="row"], .fig-data thead th:first-child { text-align: left; }
.fg-t { font-family: var(--text); font-size: 17px; fill: var(--ink); }
.fg-s { font-family: var(--mono); font-size: 14px; fill: var(--muted); }
.fg-ln { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.fg-faint { stroke: var(--faint); stroke-width: 1.4; fill: none; }
.fg-box { fill: var(--bg); stroke: var(--faint); stroke-width: 1.4; }
.fg-hue { stroke: var(--th); fill: none; stroke-width: 2.4; }
.fg-hbox { fill: var(--bg); stroke: var(--th); stroke-width: 2; }
.fg-fill { fill: var(--th); }
.fg-arrow { fill: var(--faint); }
.fg-bar { fill: var(--faint); opacity: .5; }
.fg-grid { stroke: var(--faint); stroke-opacity: .3; stroke-width: 1; }

/* ---------- Footer ---------- */
.foot { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding: 5rem var(--pad) 2.2rem; }
.foot-big { font-family: var(--display); font-size: clamp(3.2rem, 11vw, 9rem); line-height: .92; margin: 0 0 2.4rem; letter-spacing: -.02em; }
.foot-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; color: var(--faint);
}
.foot-row p { margin: 0; }
.foot-row a { display: inline-flex; min-height: 24px; align-items: center; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }

/* ---------- "On this page" navigator (the three.js Bloch sphere is added on wide screens) ---------- */
.page-nav { display: none; }
@media (min-width: 1380px) {
  .page-nav {
    display: block; position: fixed; top: 50%; right: 1.2rem; transform: translateY(-50%); z-index: 20; width: 160px;
    background: var(--veil); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .55rem .55rem; font-family: var(--mono); font-size: .72rem;
  }
  @supports (backdrop-filter: blur(1px)) { .page-nav { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
}
.bn-host { display: flex; justify-content: center; }
.bn-canvas { display: block; width: 96px !important; height: 96px !important; margin: 0 auto .3rem; }
.page-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.page-nav a { display: flex; align-items: center; min-height: 24px; padding: 0 .4rem; color: var(--faint); text-decoration: none; border-left: 2px solid transparent; line-height: 1.25; }
.page-nav a:hover { color: var(--accent); }
.page-nav a[aria-current] { color: var(--ink); border-left-color: var(--accent); }
.page-nav { transition: opacity .4s var(--ease), visibility .4s; }
.page-nav.is-away, .page-nav.is-hero:not(.is-open) { opacity: 0; visibility: hidden; }

/* ---------- Reduced motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  .hz-card a, .next-card, .btn { transition: none; }
  .hz-card a:hover, .hz-card a:focus-visible, .next-card:hover, .next-card:focus-visible { transform: none; }
}
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --veil: #fff; --ink: #000; --muted: #222; --faint: #333; --accent: #000; --accent-2: #000; --line: #bbb; --line-strong: #888;
    --th-nmr: #000; --th-weather: #000; --th-image: #000; --th-qkd: #000; --th-fpga: #000; --th-vqls: #000; --th-tensor: #000;
  }
  .lab-field, .curtain, .bar, .page-nav, .cue, .skip, .hero-cta, .filters, .next, .wl-fill, .view-bar, .toc-toggle, .replay-tools, .ab-controls, .row-ctrl, .fn-open, .play, #abstract, .crumbs-pn, .cv-hero .artifacts { display: none !important; }
  .pub-row { display: block !important; overflow: visible !important; }
  .worldline-sec.is-horizontal .worldline { display: block; transform: none !important; }
  .worldline-sec.is-horizontal .event { width: auto !important; max-height: none !important; overflow: visible !important; }
  .ev-more:not([open]) > :not(summary) { display: block; }
  [data-view] { display: block !important; }
  .cv-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .hero, .question, .work.is-pinned { min-height: 0; }
  .work.is-pinned { overflow: visible; }
  .work.is-pinned .hz-track { display: grid; width: auto; padding: 0; transform: none !important; }
  .work.is-pinned .hz-card { width: auto; }
  .wi, .chi, [data-rv], .hz-card { opacity: 1 !important; transform: none !important; }
  .hz-card a, .interest, .paper-card, .chapter, .event, .cite, .bib, .fig { break-inside: avoid; }
  .ch-side { position: static; }
}


/* =====================================================================================================================
   Revision (19 Nov 2026): contents drawer, reading level, thread pages, abstracts, path, papers, CV, personal, play.
   ===================================================================================================================== */

/* ---------- Contents: panel on wide screens, drawer below 1380px ---------- */
.toc-title { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 .3rem .4rem; }
.toc-row { display: flex; align-items: center; gap: .2rem; }
.toc-row a { flex: 1; }
.toc-more { flex: none; width: 24px; height: 24px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 3px; padding: 0; }
.toc-more::before { content: "▸"; display: inline-block; transition: transform .2s var(--ease); }
.toc-more[aria-expanded="true"]::before { transform: rotate(90deg); }
.toc-more:hover { color: var(--accent); }
.page-nav .toc-sub { margin: .1rem 0 .3rem .7rem; padding-left: .3rem; border-left: 1px solid var(--line); }
.page-nav .toc-sub[hidden] { display: none; }
.page-nav .toc-sub a { font-size: .66rem; min-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-top: 2px; padding-bottom: 2px; }
html[data-view="expert"] .toc-group[data-view="layman"], html[data-view="layman"] .toc-group[data-view="expert"] { display: none; }
.toc-toggle {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 35;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; min-height: 40px; padding: 0 1rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--veil); color: var(--ink); cursor: pointer;
}
@supports (backdrop-filter: blur(1px)) { .toc-toggle { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
.toc-toggle:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 1379px) {
  .page-nav.is-open {
    display: block; position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.2rem); z-index: 36;
    width: min(20rem, calc(100vw - 2rem)); max-height: min(70vh, 32rem); overflow: auto; padding: .8rem .6rem;
    background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 18px 48px rgba(0, 0, 0, .18); font-family: var(--mono); font-size: .76rem;
  }
  .page-nav.is-open .bn-host { display: none; }
}
@media (min-width: 1380px) {
  .toc-toggle { display: none; } .page-nav { max-height: 80vh; overflow: auto; }
  /* keep the content column clear of the fixed contents panel */
  body.has-toc main, body.has-toc .foot { padding-right: 190px; }
  body.has-toc .foot { max-width: none; padding-left: max(var(--pad), calc((100vw - 190px - var(--maxw)) / 2)); }
}

/* ---------- Replay intro (every page) ---------- */
.replay-tools { position: fixed; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 34; display: flex; gap: .4rem; }
.replay-intro {
  font: inherit; cursor: pointer;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--muted);
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--veil);
}
.replay-intro:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) { .replay-intro { font-size: .6rem; padding: 0 .6rem; } }

/* ---------- Reading level (Layman / Expert) ---------- */
html[data-view="expert"] [data-view="layman"], html[data-view="layman"] [data-view="expert"] { display: none; }
.view-bar { position: sticky; top: calc(var(--bar-h) + .5rem); z-index: 25; max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding: .6rem var(--pad) 0; display: flex; justify-content: flex-end; pointer-events: none; }
.view-toggle { pointer-events: auto; display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--veil); }
@supports (backdrop-filter: blur(1px)) { .view-toggle { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
.view-toggle button { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; min-height: 32px; padding: 0 .85rem; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.view-toggle button:hover:not([aria-pressed="true"]) { color: var(--accent); }
.project-hero { padding-top: clamp(1.5rem, 6vh, 4rem); }

/* ---------- Thread pages: crumbs, artifacts, notes, my role ---------- */
.crumbs { justify-content: flex-start; gap: .4rem 1.4rem; margin-bottom: 2.2rem; }
.crumbs-pn { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: .68rem; letter-spacing: .06em; text-transform: none; }
.crumbs-pn a { color: var(--faint); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 32px; }
.crumbs-pn a:hover { color: var(--accent); }
.artifact-row { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.artifact-row .btn { min-height: 40px; font-size: .72rem; }
.draft-note { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--muted); border-left: 3px solid var(--th, var(--accent)); padding: .5rem .8rem; background: var(--veil); max-width: 68ch; }
.coming-soon { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; color: var(--faint); }
.plain p { font-size: clamp(1.08rem, 1.4vw, 1.2rem); line-height: 1.7; }
.pipe-fig { margin: 1.6rem 0 0; }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; counter-reset: st; }
.pipe li { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--veil); min-width: 9rem; max-width: 15rem; }
.pipe li:not(:last-child)::after { content: "→"; position: absolute; right: -1.25rem; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); }
.pipe-stage { font-size: .92rem; line-height: 1.3; }
.pipe-by { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pipe li.is-mine { background: var(--th, var(--accent)); border-color: var(--th, var(--accent)); color: var(--on-accent); }
.pipe li.is-mine .pipe-by { color: var(--on-accent); }
.pipe li.is-open { border-style: dashed; }
.pipe-fig figcaption { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.pipe-key { display: inline-flex; align-items: center; gap: .4rem; }
.pk { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--veil); }
.pk-mine { background: var(--th, var(--accent)); border-color: var(--th, var(--accent)); }
.next-card { min-height: 0; padding: 1.1rem 1.2rem; }
.next-card .next-t { font-size: clamp(1.25rem, 2vw, 1.6rem); }

/* ---------- Interactive abstracts ---------- */
.ab-host { min-height: 12rem; }
.ab-fallback { color: var(--muted); font-style: italic; }
.ab { display: grid; gap: 1.4rem 2.4rem; padding: 1.4rem; border: 1px solid var(--line); border-top: 3px solid var(--th, var(--accent)); border-radius: 8px; background: var(--veil); }
@media (min-width: 980px) { .ab { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .ab-note { grid-column: 1 / -1; } }
.ab-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.ab-title { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; margin: 0 0 .5rem; }
.ab-lede { color: var(--muted); margin: 0 0 1rem; }
.ab-controls { display: grid; gap: .8rem; }
.ab-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.ab-btn {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; min-height: 36px; padding: 0 .8rem; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer;
}
.ab-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ab-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ab-btn:disabled { opacity: .45; cursor: default; }
.ab-btn[hidden] { display: none; }
.ab-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.ab-step { font-family: var(--mono); font-size: .74rem; color: var(--muted); min-width: 6.5rem; text-align: center; }
.ab-slider { display: grid; gap: .25rem; }
.ab-slider label { font-family: var(--mono); font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; }
.ab-slider output { color: var(--ink); font-weight: 600; }
.ab-slider input[type="range"] { width: 100%; accent-color: var(--th, var(--accent)); min-height: 28px; }
.ab-select { font-family: var(--mono); font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.ab-select select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; min-height: 32px; padding: 0 .4rem; }
.ab-readout { font-family: var(--mono); font-size: .8rem; line-height: 1.6; margin: 0; padding: .6rem .8rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow-wrap: anywhere; }
.ab-k { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-right: .4rem; }
.ab-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ab-stepnote { font-size: .9rem; color: var(--muted); margin: 0; min-height: 3em; }
.ab-fig svg.ab-matrix { max-width: 420px; }
.ab-note { font-size: .82rem; color: var(--muted); margin: 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.ab-mini { display: grid; grid-template-columns: 120px 1fr; gap: .8rem; align-items: center; }
.ab-mini svg { width: 120px; height: 120px; }
.fg-neg { fill: var(--accent-2); }
.ab-pixel { cursor: pointer; stroke: var(--line-strong); stroke-width: 1; }
.ab-pixel:focus-visible, .ab-pulse:focus-visible { outline: none; stroke: var(--accent); stroke-width: 3; }
.ab-pulse { cursor: pointer; }
.ab-pulse:focus-visible circle { stroke: var(--accent); stroke-width: 3; }
.ab-funnel { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .35rem; }
.ab-funnel li { font-size: .86rem; color: var(--muted); padding: .3rem .6rem; width: max(var(--w), 14rem); max-width: 100%; border-left: 4px solid var(--th, var(--accent)); background: var(--bg); }
.ab-funnel-n { font-family: var(--mono); font-weight: 600; color: var(--ink); margin-right: .3rem; }
.ab-results { margin-top: 1rem; }
.ab-bars { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .45rem; }
.ab-bars li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .1rem .8rem; align-items: center; }
.ab-bar-l { font-family: var(--mono); font-size: .74rem; }
.ab-bar { height: 12px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ab-bar > span { display: block; height: 100%; background: var(--th, var(--accent)); }
.ab-bar-v, .ab-bar-c { grid-column: 2; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.ab-pair { display: grid; gap: .8rem; }
@media (min-width: 640px) { .ab-pair { grid-template-columns: 1fr 1fr; } }
.ab-pair figure { margin: 0; }
.ab-canvas { display: block; width: 100%; height: auto; aspect-ratio: 96 / 32; image-rendering: pixelated; border-radius: 4px; border: 1px solid var(--line); }

/* ---------- Home: photo and the qubit playground ---------- */
.hero { position: relative; }
.hero-photo { margin: 0 0 1.4rem; width: 92px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--bg-2, var(--veil)); }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1040px) {
  .hero-photo { position: absolute; right: var(--pad); top: 50%; transform: translateY(-50%); width: clamp(200px, 21vw, 300px); margin: 0; border-radius: 10px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35); }
  .hero > :not(.hero-photo) { max-width: calc(100% - clamp(200px, 21vw, 300px) - 3rem); }
  .hero-name { font-size: clamp(3.4rem, 9.2vw, 9.6rem); }
}
.play-lede { color: var(--muted); max-width: 60ch; margin: -1.2rem 0 2rem; }
.play-host { display: grid; gap: 1.6rem 2.4rem; align-items: start; }
@media (min-width: 900px) { .play-host { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } }
.play-stage { position: relative; max-width: 420px; }
.play-canvas { aspect-ratio: 1; cursor: grab; border-radius: 50%; }
.play-canvas:active { cursor: grabbing; }
.play-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.play-labels { position: absolute; inset: 0; pointer-events: none; }
.play-labels span { position: absolute; left: 0; top: 0; margin: -.6em 0 0 -.9em; font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: nowrap; }
.play-side { display: grid; gap: .9rem; }

/* ---------- Field notes (featured media + gallery) ---------- */
.ev-media { margin-top: 1rem; display: grid; gap: .6rem; }
.fn-featured { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.fn-featured img, .fn-featured video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--line); }
.fn-empty { display: grid; place-items: center; aspect-ratio: 16 / 5; max-width: 26rem; border: 1px dashed var(--line-strong); border-radius: 6px; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.fn-empty--wide { max-width: none; aspect-ratio: 16 / 4; }
.fn-open { justify-self: start; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; min-height: 36px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; }
.fn-open:hover { border-color: var(--accent); color: var(--accent); }
.fn-n { color: var(--faint); }
.fn-dialog { width: min(1000px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); }
.fn-dialog::backdrop { background: rgba(5, 8, 16, .72); }
.fn-head { display: flex; align-items: center; gap: 1rem; }
.fn-head .micro { margin: 0; }
.fn-count { margin-left: auto !important; }
.fn-stage { margin-top: .8rem; display: grid; place-items: center; background: #000; border-radius: 6px; min-height: 40vh; }
.fn-stage img, .fn-stage video { max-width: 100%; max-height: 70vh; display: block; }
.fn-cap { color: var(--muted); margin: .6rem 0 0; min-height: 1.4em; }
.fn-nav { display: flex; justify-content: space-between; margin-top: .6rem; }
.fn-nav button, .fn-close { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; min-height: 36px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; }

/* ---------- Path: vertical by default, horizontal when pinned ---------- */
.worldline-sec { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding-top: clamp(3rem, 9vh, 6rem); }
.worldline-sec .work-hint { margin-bottom: 1.2rem; }
.ev-more { margin-top: .9rem; }
.ev-more summary { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); cursor: pointer; display: inline-flex; min-height: 32px; align-items: center; }
.worldline-sec.is-horizontal { max-width: none; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: calc(var(--bar-h) + 1rem); padding-bottom: 1.5rem; overflow: hidden; }
.worldline-sec.is-horizontal .work-hint { max-width: var(--maxw); width: 100%; margin: 0 auto 1rem; }
.worldline-sec.is-horizontal .worldline-wrap { padding: 2.2rem 0 0; }
.worldline-sec.is-horizontal .wl-line, .worldline-sec.is-horizontal .wl-fill { left: 0; right: 0; top: 1rem; bottom: auto; width: auto; height: 1px; }
.worldline-sec.is-horizontal .wl-fill { height: 3px; top: calc(1rem - 1px); transform-origin: left center; }
.worldline-sec.is-horizontal .worldline { display: flex; gap: 2rem; width: max-content; padding-left: max(0px, calc((100vw - var(--maxw)) / 2 - var(--pad))); padding-right: 20vw; }
.worldline-sec.is-horizontal .event { width: min(27rem, 34vw); flex: 0 0 auto; max-height: calc(100vh - var(--bar-h) - 7rem); overflow: auto; padding: 0 .4rem 1rem 0; overscroll-behavior: contain; }
.worldline-sec.is-horizontal .ev-dot { left: 0; top: -1.75rem; }
.worldline-sec.is-horizontal .ev-title { font-size: clamp(1.5rem, 2.2vw, 2.1rem); }

/* ---------- Papers: one row per type ---------- */
.pub-group { padding-top: clamp(3rem, 8vh, 5rem); }
.pub-group[hidden] { display: none; }
.pub-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.pub-head h2 { margin: 0; }
.pub-n { font-family: var(--mono); font-size: .9rem; color: var(--faint); vertical-align: super; }
.row-ctrl { display: flex; gap: .4rem; }
.pub-row { list-style: none; margin: 0; padding: .2rem .2rem 1rem; display: grid; grid-auto-flow: column; grid-auto-columns: min(24rem, 84%); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; border-top: 0; }
.pub-row .bib { scroll-snap-align: start; padding: 1.3rem 1.2rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 8px; background: var(--veil); align-self: start; }
.pub-row .cite-t { font-size: clamp(1.2rem, 1.8vw, 1.45rem); }
.page-hero .filters { margin-top: 2rem; }

/* ---------- CV (LaTeX look; Latin Modern under the GUST font licence) ---------- */
@font-face { font-family: "Latin Modern Roman"; src: url("../assets/fonts/lm-roman-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url("../assets/fonts/lm-roman-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url("../assets/fonts/lm-roman-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Latin Modern Roman Caps"; src: url("../assets/fonts/lm-roman-caps.woff2") format("woff2"); font-display: swap; }
.cv-sheet {
  --cv: "Latin Modern Roman", "CMU Serif", Georgia, serif;
  max-width: 54rem; margin: 2.5rem auto 0; padding: clamp(1.4rem, 5vw, 3.6rem) clamp(1.1rem, 5vw, 3.8rem);
  font-family: var(--cv); font-size: 1.04rem; line-height: 1.45; background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .35);
}
.cv-head { text-align: center; margin-bottom: 1.6rem; }
.cv-name { font-family: "Latin Modern Roman Caps", var(--cv); font-size: clamp(1.9rem, 4vw, 2.5rem); margin: 0; letter-spacing: .02em; }
.cv-tag { font-size: 1.15rem; margin: .2rem 0 .3rem; }
.cv-contact { font-size: .9rem; margin: 0; color: var(--muted); }
.cv-contact a, .cv-sheet a { color: inherit; text-decoration-color: var(--line-strong); }
.cv-sec { margin-top: 1.4rem; }
.cv-sec h2 { font-family: "Latin Modern Roman Caps", var(--cv); font-size: 1.25rem; line-height: 1.2; letter-spacing: .03em; color: var(--accent); margin: 0 0 .7rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line-strong); }
.cv-h3 { font-family: var(--cv); font-style: italic; font-weight: 400; font-size: 1rem; margin: .8rem 0 .3rem; }
.cv-entry { margin-bottom: .75rem; }
.cv-line, .cv-awards li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.cv-r { white-space: nowrap; flex: none; }
.cv-sub { font-style: italic; }
.cv-p { margin: .15rem 0 0; }
.cv-ul { margin: .2rem 0 0; padding-left: 1.2rem; }
.cv-ul li { margin-bottom: .1rem; }
.cv-refs { list-style: none; margin: 0; padding: 0; }
.cv-refs li { padding-left: 3rem; text-indent: -3rem; margin-bottom: .35rem; }
.cv-key { display: inline-block; width: 3rem; text-indent: 0; }
.cv-awards { list-style: none; margin: 0; padding: 0; }
.cv-awards li { margin-bottom: .25rem; }
.cv-proof { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; margin-left: .4rem; color: var(--accent) !important; }
.cv-skills { margin: 0; display: grid; gap: .25rem; }
.cv-skills div { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 1rem; }
.cv-skills dt { font-weight: 700; }
.cv-skills dd { margin: 0; }
.cv-foot { font-size: .82rem; margin: .4rem 0 0; }
@media (max-width: 600px) { .cv-line, .cv-awards li { flex-direction: column; gap: 0; } .cv-r { white-space: normal; } .cv-skills div { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Personal ---------- */
.ps-sec .ev-media { max-width: 48rem; }

/* ---------- Deep-dive pages (paper-*.html, role-*.html; markup from scripts/build.py) ---------- */
.dd-hero h1 { font-size: clamp(2.2rem, 5.2vw, 4.2rem); line-height: 1.04; max-width: 24ch; }
.dd-hero .page-lede { max-width: 52ch; font-size: clamp(1.15rem, 2vw, 1.5rem); }
.dd-meta { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 1rem 0 0; overflow-wrap: anywhere; }
.dd-meta + .dd-meta { margin-top: .3rem; }
.dd-hero .crumbs { margin-bottom: 2.2rem; }
.dd-body { padding-top: clamp(2.5rem, 7vh, 4.5rem); padding-left: var(--pad); padding-right: var(--pad); padding-bottom: 1rem; }
.dd-body > * { max-width: 68ch; }
.dd-body > .dd-fig-wide { max-width: none; }
.dd-sec { padding: 0; margin: 0 0 2.6rem; }
.dd-sec h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.08; margin: 0 0 .9rem; }
.dd-sec p, .dd-sec li { max-width: 68ch; }
.dd-sec ul { padding-left: 1.2rem; color: var(--muted); line-height: 1.68; }
.dd-sec .abstract { font-family: var(--display); font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.4; color: var(--ink); border-left: 2px solid var(--accent); padding-left: 1.1rem; }
.dd-sec a, .dd-body > p a { text-underline-offset: .2em; }
.dd-sec .coming-soon { color: var(--muted); font-style: italic; }
.dd-body .draft-note { border: 1px dashed var(--accent); border-radius: 6px; padding: .6rem .8rem; font-size: .94rem; color: var(--muted); }
.dd-body .tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.dd-body .tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line-strong); border-radius: 999px; padding: .2rem .7rem; color: var(--muted); }
.dd-body .read-more { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.dd-body .read-more:hover { text-decoration: underline; }
.detail-fig { margin: 2rem 0; }
.detail-fig svg { width: 100%; height: auto; display: block; }
.detail-fig figcaption { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--faint); margin-top: .5rem; }
.fl-box { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.fl-txt { fill: var(--ink); font-family: var(--mono); font-size: 11px; }
.fl-arrow { stroke: var(--faint); stroke-width: 1.2; fill: none; }
.fl-head { fill: var(--faint); }
.tl-bar { fill: var(--faint); opacity: .55; }
.tl-bar.is-this { fill: var(--accent); opacity: 1; }
.tl-tick { fill: var(--faint); font-family: var(--mono); font-size: 11px; }
.tl-label { fill: var(--muted); font-family: var(--text); font-size: 14px; }
.tl-label.is-this { fill: var(--ink); font-weight: 600; }
.tl-grid { stroke: var(--line); stroke-width: 1; }
.tl-fig svg { max-width: 480px; }
.ev-link { margin: .7rem 0 0; font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; }
.ev-link a { display: inline-flex; min-height: 32px; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .toc-more::before { transition: none; }
}
