:root {
  --paper: #F2F5F4; --ink: #1B2A32; --line: #A9BCC4; --muted: #52666F;
  --mark: #D21F6C; --panel: #E6ECEA; --on-mark: #FFFFFF;
  --measure: 68ch;
  --s1: .9375rem; --s2: 1.125rem; --s3: 1.5rem; --s4: 2.25rem; --s5: 3.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101C23; --ink: #DDE7EA; --line: #35505D; --muted: #93A9B2;
    --mark: #FF5C9D; --panel: #172832; --on-mark: #101C23; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101C23; --ink: #DDE7EA; --line: #35505D; --muted: #93A9B2;
  --mark: #FF5C9D; --panel: #172832; --on-mark: #101C23; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--s2)/1.6 "Plus Jakarta Sans", system-ui, sans-serif;
  
}
a { color: inherit; text-decoration-color: var(--mark); text-underline-offset: .2em; }
a:hover { color: var(--mark); }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
h1, h2, .name, .tabs a {  letter-spacing: -.01em; }
h1 { font-size: var(--s4); line-height: 1.12; font-weight: 750; margin: 0 0 1rem; max-width: 24ch; }

h2 { font-size: var(--s3); line-height: 1.25; font-weight: 700; }
p, li { max-width: var(--measure); }
button { font: inherit; color: inherit; }

/* header */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem;
  padding: 1rem clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line);
}
.name { font-weight: 800; font-size: var(--s2); text-decoration: none; margin-right: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.tabs a { text-decoration: none; font-weight: 600; font-size: var(--s1); padding: .25rem 0; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { border-bottom-color: var(--mark); }
.lens { display: flex; align-items: center; gap: .25rem; font-size: var(--s1); }
.lens-label { color: var(--muted); margin-right: .25rem; }
.lens button {
  border: 1px solid var(--line); background: transparent; padding: .25rem .65rem; border-radius: 999px; cursor: pointer;
}
.lens button[aria-checked="true"] { background: var(--mark); border-color: var(--mark); color: var(--on-mark); font-weight: 600; }

main { padding: 0 clamp(16px, 4vw, 48px) 4rem; max-width: 1240px; }
.view { padding-top: 2.5rem; }
.intro { color: var(--muted); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 2.5rem; align-items: center; }
.lede { font-size: var(--s2); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn {
  display: inline-block; padding: .6rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: var(--s1); background: transparent; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--mark); border-color: var(--mark); color: var(--on-mark); }
.sheet { margin: 0; border: 1px solid var(--line); background: var(--paper); }
.sheet svg { display: block; width: 100%; height: auto; }
.sheet figcaption { font-size: var(--s1); color: var(--muted); padding: .6rem .9rem; border-top: 1px solid var(--line); }
.linklike { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--mark); text-underline-offset: .2em; cursor: pointer; }

/* svg drawing */
.g-line { stroke: var(--line); stroke-width: 1; }
.g-bubble { fill: var(--paper); stroke: var(--line); }
.g-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.g-block { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; }
.g-block-t { fill: var(--ink); font-size: 13px; font-weight: 650; font-family: inherit; }
.g-pipe { stroke: var(--ink); stroke-width: 1.2; fill: none; stroke-dasharray: 4 4; }
.g-dot { fill: var(--ink); }
.g-dot.hollow { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.g-dot.out { fill: var(--mark); }
.g-axis { stroke: var(--ink); stroke-width: 1; }
.g-diag { stroke: var(--mark); stroke-width: 1.5; }

/* featured + work */
.section-h { margin-top: 3rem; }
.featured, .entries { list-style: none; padding: 0; margin: 0; }
.featured li, .entry { border-top: 1px solid var(--line); padding: 1.1rem 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .5rem 2rem; max-width: none; }
.featured h3, .entry h3 { margin: 0; font-size: var(--s2); line-height: 1.3; font-weight: 700;  }
.entry p, .featured p { margin: 0 0 .4rem; }
.tier-h { margin-top: 2.5rem; }
.tier-note { color: var(--muted); margin-top: -.5rem; }
.evidence { font-size: var(--s1); }
.tag { display: inline-block; font-size: .8125rem; font-weight: 600; padding: 0 .45rem; border: 1px solid var(--line); border-radius: 3px; margin-right: .4rem; color: var(--muted); }
.tag.measured, .tag.published { border-color: var(--ink); color: var(--ink); }
.src, .caveat, .assist { display: block; font-size: .8125rem; color: var(--muted); }
.assist { color: var(--ink); }
.links a { margin-right: 1rem; font-size: var(--s1); font-weight: 600; }
.proof { margin-top: 2.5rem; color: var(--muted); }

/* lab */
.lab-item { border-top: 1px solid var(--line); padding: 1.25rem 0; }
.lab-item h3 { margin: 0 0 .25rem; font-size: var(--s2); }
.lab-frame { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); margin-top: .75rem; background: var(--panel); }

/* research */
.pub { border-top: 1px solid var(--line); padding: .9rem 0; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; }
.pub .yr { font-weight: 700;  }
.pub p { margin: 0; }
.pub .meta { font-size: var(--s1); color: var(--muted); }

/* about */
.bio-studio { border: 1px solid var(--line); padding: 1rem 1.25rem; max-width: 76ch; }
.bio-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bio-tools [role="tab"] { border: 1px solid var(--line); background: transparent; padding: .2rem .7rem; border-radius: 4px; cursor: pointer; font-size: var(--s1); }
.bio-tools [role="tab"][aria-selected="true"] { border-color: var(--ink); font-weight: 650; }
.bio-tools .linklike { margin-left: auto; font-size: var(--s1); }
.bio[contenteditable="true"] { outline: 1.5px dashed var(--mark); outline-offset: 6px; }
.edit-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: var(--s1); color: var(--muted); }
.status { font-size: var(--s1); color: var(--muted); min-height: 1.4em; margin: .25rem 0 0; }
.timeline { list-style: none; padding: 0; }
.timeline > li { border-left: 2px solid var(--line); padding: 0 0 1.25rem 1.25rem; position: relative; }
.timeline > li::before { content: ""; position: absolute; left: -7px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.timeline .when { font-size: var(--s1); color: var(--muted); }
.timeline ul { margin: .25rem 0 0; padding-left: 1.1rem; font-size: var(--s1); }
.plain { padding-left: 1.1rem; }

/* title block */
.titleblock {
  display: grid; grid-template-columns: auto 1fr; border-top: 2px solid var(--ink);
  font-size: var(--s1); margin: 0 clamp(16px, 4vw, 48px) 2rem;
}
.titleblock > div { padding: .6rem .9rem; border-right: 1px solid var(--line); }
.titleblock > div:last-child { border-right: 0; }
.tb-k { display: block; font-size: .75rem; color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .featured li, .entry { grid-template-columns: 1fr; }
  .titleblock { grid-template-columns: 1fr; }
  .titleblock > div { border-bottom: 1px solid var(--line); border-right: 0; }
  .titleblock > div:last-child { border-bottom: 0; }
}
@media (max-width: 520px) {
  .top { gap: .6rem 1rem; }
  .name { width: 100%; }
  .lens-label { display: none; }
  .pub { grid-template-columns: 1fr; gap: .2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* type tuning for Plus Jakarta Sans */
h1, h2, h3, .name { letter-spacing: -.02em; }
#view-home h1 { font-weight: 800; line-height: 1.08; }

/* home showcase */
.show-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 1.5rem; }
.show { margin: 0; border: 1px solid var(--line); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.show canvas { width: 100%; aspect-ratio: 128 / 132; display: block; }
.show.feature canvas { aspect-ratio: 128 / 124; }
.show:not(.feature) canvas { aspect-ratio: 1 / 1.25; }
.show h3 { margin: 0; font-size: var(--s3); }
.show p { margin: 0 0 .35rem; }

/* entries with media */
.entry.has-media { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.entry:not(.has-media) { grid-template-columns: 1fr; }
.entry-body h3 { margin-bottom: .5rem; }
.media { border: 1px solid var(--line); background: var(--paper); }
.media img { display: block; width: 100%; height: auto; background: #fff; }
.media canvas { display: block; width: 100%; aspect-ratio: 4 / 3; }
.media svg { display: block; width: 100%; height: auto; }
.featured li.entry { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.featured li.entry:not(.has-media) .entry-body { grid-column: 1 / -1; }

/* lab tiles */
#lab-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.lab-tile { border: 1px solid var(--line); padding: 1rem; }
.lab-tile.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-auto-rows: min-content; align-content: start; gap: 0 1.5rem; }
.lab-tile.wide .media { grid-row: 1 / span 20; }
.lab-tile .media { border: 0; margin-bottom: .75rem; }
.lab-tile h3 { margin: 0 0 .4rem; font-size: var(--s3); }
.lab-tile.wide .media canvas { aspect-ratio: 128 / 124; }

@media (max-width: 860px) {
  .show-grid, #lab-list, .lab-tile.wide, .entry.has-media, .featured li.entry { grid-template-columns: 1fr; }
  .lab-tile.wide .media { grid-row: auto; }
}

/* 3D fire (front page) */
.show.feature { padding: 0; overflow: hidden; }
.show.feature figcaption { padding: 1rem 1.25rem 1.25rem; }
.fire3d { position: relative; aspect-ratio: 16 / 9; background: #0b1216; }
.fire3d .fire2d { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.fire3d.is-3d .fire2d { display: none; }
.fire3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.fire3d-hud { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .75rem; align-items: baseline; padding: .7rem 1rem;
  color: #F4F7F8; font-size: var(--s1); background: linear-gradient(transparent, rgba(11, 18, 22, .85)); pointer-events: none; }
.fire3d-hud b { font-weight: 700; font-size: var(--s2); }
.fire3d-hud span { opacity: .8; }
.fire3d-hud { flex-wrap: wrap; row-gap: 0; } .fire3d-hud > * { white-space: nowrap; }
.fire3d-hud .r { margin-left: auto; }
.fire3d:not(.is-3d) .fire3d-hud { display: none; }
@media (max-width: 520px) { .fire3d { aspect-ratio: 4 / 3; } }

/* hero: big name, role in a second typeface, one-line promise */
.top .name { font-size: 1.3rem; }
#view-home .hero-name { font-size: clamp(2.75rem, 6.4vw, 5.25rem); line-height: .98; font-weight: 800; letter-spacing: -.035em; margin: 0 0 .9rem; max-width: none; }
.hero-role { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.05; margin: 0 0 .6rem; color: var(--ink); }
.hero-tag { font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 700; margin: 0 0 1.4rem; color: var(--mark); letter-spacing: -.01em; }

/* hazard chapters + labels */
.hz-chips { position: absolute; top: .8rem; left: .8rem; display: flex; gap: .4rem; z-index: 2; }
.fire3d:not(.is-3d) .hz-chips, .fire3d:not(.is-3d) .hz-labels { display: none; }
.hz-chips button { --p: 0; position: relative; overflow: hidden; font: 600 var(--s1)/1 var(--text); color: #F4F7F8; cursor: pointer;
  padding: .5rem .85rem; border: 1px solid rgba(244, 247, 248, .35); border-radius: 999px; background: rgba(11, 18, 22, .55); backdrop-filter: blur(4px); }
.hz-chips button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p) * 100%); background: var(--peach); }
.hz-chips button[aria-pressed="true"] { border-color: #F4F7F8; background: rgba(11, 18, 22, .8); }
.hz-labels span { position: absolute; left: 0; top: 0; color: #F4F7F8; font-size: .8125rem; font-weight: 600; white-space: nowrap; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9); transition: opacity .3s; margin: -.6em 0 0 .5em; }
.hz-labels span::before { content: ""; position: absolute; left: -.55em; top: .45em; width: 5px; height: 5px; border-radius: 50%; background: #F4F7F8; }
@media (max-width: 520px) { .hz-chips button { padding: .4rem .6rem; font-size: .8125rem; } .fire3d-hud { font-size: .8125rem; } .fire3d-hud b { font-size: var(--s1); } }

/* centre the page so wide screens do not show an empty right band */
main { max-width: 1320px; margin: 0 auto; }
.titleblock { max-width: calc(1320px - 2 * clamp(16px, 4vw, 48px)); margin-left: auto; margin-right: auto; }
@media (min-width: 1400px) { .titleblock { margin-left: auto; margin-right: auto; } }

/* dark mode: soften the white matplotlib figures */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .media img { filter: brightness(.86) contrast(1.05); } }
:root[data-theme="dark"] .media img { filter: brightness(.86) contrast(1.05); }

/* ================= v9: motion layer, dark stage, app reel ================= */
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --stage: #0A1317; --stage-2: #111D23; --stage-ink: #E9F0F2; --stage-muted: #98ADB5; --stage-line: rgba(233, 240, 242, .13);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --stage: #060C0F; --stage-2: #0D171C; } }
:root[data-theme="dark"] { --stage: #060C0F; --stage-2: #0D171C; }
html { overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage { margin-inline: calc(50% - 50vw); }

/* header: sticky glass that steps aside while reading down */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  transition: transform .5s var(--ease), border-color .2s; view-transition-name: top; }
.top:not(.is-scrolled) { border-bottom-color: transparent; }
.top.is-hidden { transform: translateY(-101%); }
.tabs a { transition: color .16s, border-color .26s var(--ease); }
.btn { transition: background .16s, color .16s, border-color .16s, translate .4s var(--ease); }
.btn:hover { translate: 0 -2px; }
.btn:active { translate: 0 0; }

/* hero: one screen tall; the sheet carries a CAD crosshair */
.hero { min-height: calc(100svh - 72px); align-content: center; position: relative; padding-bottom: 3rem; }
#view-home .hero-name { font-size: clamp(3rem, 7.6vw, 7rem); line-height: .92; letter-spacing: -.045em; }
/* SplitText masks clip at the line box; give descenders (y, g, p) room without moving the lines */
.hero-name > div { padding-bottom: .16em; margin-bottom: -.16em; } /* SplitText word masks are the direct children */
.sheet { box-shadow: 0 30px 60px -40px rgba(27, 42, 50, .45); }
.sheet-stage { position: relative; --cx: -100; --cy: -100; cursor: crosshair; }
.crosshair { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); overflow: hidden; }
.sheet-stage.is-aiming .crosshair { opacity: 1; }
.ch-x, .ch-y { position: absolute; background: var(--mark); opacity: .55; }
.ch-x { left: 0; right: 0; height: 1px; transform: translateY(calc(var(--cy) * 1px)); }
.ch-y { top: 0; bottom: 0; width: 1px; transform: translateX(calc(var(--cx) * 1px)); }
.ch-read { position: absolute; left: 0; top: 0; transform: translate(calc(var(--cx) * 1px + 10px), calc(var(--cy) * 1px + 10px));
  font: 600 11px/1 var(--mono); white-space: pre; color: var(--mark); background: var(--paper); padding: 4px 6px; border: 1px solid var(--mark); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.steps li { font-size: .8125rem; line-height: 1.4; padding-top: .45rem; border-top: 2px solid var(--line); transition: opacity .4s var(--ease), border-color .4s var(--ease); max-width: none; }
.steps b { display: block; color: var(--ink); }
.sheet.scrubbing .steps li { opacity: .38; }
.sheet.scrubbing .steps li.is-on { opacity: 1; border-top-color: var(--mark); }
.scroll-cue { position: absolute; left: 0; bottom: .5rem; margin: 0; display: flex; align-items: center; gap: .6rem; font-size: .8125rem; color: var(--muted); }
.scroll-cue span { width: 1px; height: 34px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--mark); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }

/* strip: the hero drawing written as one Trickle pipeline string, with a gloss under each token */
.strip { margin: 0; padding: 1.4rem 0 1.6rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip-steps { list-style: none; margin: 0 0 .7rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 0; }
.strip-steps li { display: grid; gap: .2rem; padding-right: 1.6rem; position: relative; max-width: none; }
.strip-steps li + li::before { content: "→"; position: absolute; left: -1.25rem; top: .05em; color: var(--mark); font: 600 clamp(1.1rem, 2vw, 1.5rem)/1.2 var(--mono); }
.strip-steps li + li { margin-left: 1.25rem; }
.strip-steps code { font: 600 clamp(1.1rem, 2vw, 1.5rem)/1.2 var(--mono); letter-spacing: -.02em; }
.strip-steps span { font-size: .8125rem; color: var(--muted); }
.strip figcaption { font-size: var(--s1); color: var(--muted); max-width: 68ch; }
.strip figcaption em { font-family: "Instrument Serif", Georgia, serif; font-size: 1.15em; color: var(--ink); }

/* the dark stage: apps and the live terrain */
.stage { --stage-mark: #FF5C9D; /* pink at 6.5:1 on the stage; #D21F6C is only 3.7:1 here */
  background: radial-gradient(120% 60% at 50% 0%, var(--stage-2), var(--stage) 60%); color: var(--stage-ink); padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem); margin-top: 0; }
.stage-in { max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.stage a:hover { color: var(--stage-mark); }
.stage-head { max-width: 62ch; }
.stage-head h2 { font-size: clamp(2.3rem, 5.4vw, 4.5rem); line-height: .98; letter-spacing: -.04em; font-weight: 800; margin: .3rem 0 1rem; max-width: 15ch; text-wrap: balance; }
.stage-head p { color: var(--stage-muted); margin: 0; }
.stage-head .kicker { color: var(--stage-mark); font-weight: 700; font-size: var(--s1); }
.stage .src, .stage .caveat { color: var(--stage-muted); }
.stage .btn { border-color: rgba(233, 240, 242, .5); color: var(--stage-ink); }
.stage .btn:hover { border-color: var(--stage-ink); color: var(--stage-ink); }
.stage .btn.primary { background: var(--mark); border-color: var(--mark); color: var(--on-mark); }
.stage .btn.primary:hover { background: #fff; border-color: #fff; color: var(--stage); }

/* app reel: a full-bleed strip; on desktop it pins and moves sideways */
/* the reel is a direct child of the full-width stage: no negative margins, so pinning keeps its width */
.reel { padding-inline: max(clamp(16px, 4vw, 48px), calc((100% - 1320px) / 2 + 48px)); overflow: clip; }
.reel-bar { display: flex; align-items: center; gap: 1.5rem; padding: 1.25rem 0; }
.reel-names { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; }
.reel-names button { background: none; border: 0; padding: .3rem 0; cursor: pointer; color: var(--stage-muted); font-weight: 600; font-size: var(--s1);
  border-bottom: 2px solid transparent; transition: color .16s, border-color .26s var(--ease); }
.reel-names button:hover, .reel-names button.is-on { color: var(--stage-ink); }
.reel-names button.is-on { border-bottom-color: var(--stage-mark); }
.reel-progress { flex: 1; height: 2px; background: var(--stage-line); }
.reel-progress i { display: block; height: 100%; background: var(--mark); transform-origin: left; transform: scaleX(0); }
.reel-track { display: flex; gap: clamp(2rem, 5vw, 5rem); will-change: transform; }
.slide { flex: 0 0 100%; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.slide.is-phone { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.slide h3 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.035em; margin: 0 0 .6rem; }
.slide-q { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.12; margin: 0 0 1.25rem; color: var(--stage-ink); }
.slide-facts { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.slide-facts li { padding: .55rem 0 .55rem 1.1rem; border-top: 1px solid var(--stage-line); font-size: var(--s1); color: var(--stage-muted); position: relative; }
.slide-facts li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 6px; height: 6px; background: var(--stage-mark); }
.slide-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 .75rem; }
.device { display: block; border-radius: 14px; overflow: hidden; background: #0F181D; border: 1px solid var(--stage-line); text-decoration: none;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .03); transition: translate .7s var(--ease), box-shadow .7s var(--ease); }
/* hover uses `translate`, so it never fights GSAP, which owns `transform` */
.device:hover { translate: 0 -6px; box-shadow: 0 60px 100px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(210, 31, 108, .5); }
/* title strip, like the drawing sheet's title block: sheet number, path, scale */
.device-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; height: 30px; border-bottom: 1px solid var(--stage-line); font: 500 11px/30px var(--mono); color: var(--stage-muted); }
.device-bar > * { padding: 0 12px; }
.device-bar b { color: var(--stage-mark); font-weight: 600; border-right: 1px solid var(--stage-line); }
.device-bar span:last-child { border-left: 1px solid var(--stage-line); }
.device-screen { display: block; aspect-ratio: 16 / 10; max-height: 62svh; overflow: hidden; }
.device-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.device.phone { width: min(280px, 100%); justify-self: center; border-radius: 40px; border: 9px solid #1B262C; }
.device.phone .device-screen { aspect-ratio: 390 / 760; }

/* live terrain inside the stage */
.stage .showcase { margin-top: clamp(3rem, 7vw, 5rem); }
.stage .show.feature { border: 1px solid var(--stage-line); border-radius: 14px; margin-top: 2rem; background: var(--stage-2); transform-origin: 50% 0; }
.stage .show.feature figcaption p { color: var(--stage-muted); }
.stage .show.feature h3 { color: var(--stage-ink); }

/* numbers */
.numbers { padding: clamp(3.5rem, 8vw, 6rem) 0 1rem; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0; }
.counts > div { border-top: 2px solid var(--ink); padding-top: .9rem; }
.counts dt { font-size: clamp(2.6rem, 5.4vw, 4.6rem); font-weight: 800; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.counts dt + dd { margin: .5rem 0 0; font-size: var(--s1); color: var(--muted); line-height: 1.4; }

/* work and lab: posters and a quiet hover */
.media { overflow: hidden; }
.media img { transition: transform .9s var(--ease); }
.entry:hover .media img, .lab-tile:hover .media img { transform: scale(1.025); }
.media.poster img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--panel); }
.media.poster.phone { max-width: 240px; border-radius: 26px; border: 6px solid var(--ink); }
.media.poster.phone img { aspect-ratio: 390 / 760; }

/* tab changes cross-fade (View Transitions); the header holds still */
::view-transition-old(root) { animation: vt-out .22s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .46s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 860px) {
  .hero { min-height: 0; padding-bottom: 1rem; }
  .scroll-cue { display: none; }
  .steps { grid-template-columns: 1fr; gap: .4rem; }
  .reel-bar { display: none; }
  .reel-track { flex-direction: column; gap: 4rem; }
  .slide, .slide.is-phone { flex: none; grid-template-columns: 1fr; }
  .slide .device { order: -1; }
  .counts { grid-template-columns: 1fr; gap: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { display: none; }
  .reel-bar { display: none; }
  .reel-track { flex-direction: column; gap: 4rem; }
  .slide { flex: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (min-width: 861px) and (prefers-reduced-motion: no-preference) {
  .reel { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
}
/* grid items default to min-width: auto, so a canvas with a large intrinsic width pushed phones sideways */
.entry > *, .lab-tile > * { min-width: 0; }
.media canvas, .media svg, .media img { max-width: 100%; }
/* long source paths (results/figures/fig1_pareto_plot.png) pushed phones 12 px sideways since v8 */
.evidence, .src, .caveat { overflow-wrap: anywhere; }

/* header turns dark over the stage, and drops the blur there (a blur over a moving reel and WebGL repaints every frame) */
.top.on-stage { --paper: var(--stage); --ink: var(--stage-ink); --line: var(--stage-line); --muted: var(--stage-muted); --mark: #FF5C9D; --on-mark: #0A1317;
  color: var(--stage-ink); background: color-mix(in srgb, var(--stage) 94%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* the hero's proof line under the one-liner */
.hero-proof { font-size: var(--s1); color: var(--muted); border-left: 2px solid var(--mark); padding-left: .8rem; margin: -.4rem 0 0; }
/* dark mode: the stage barely differs from the page, so give it a faint drawing grid */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage { --stage: #02070A; border-top: 1px solid var(--stage-line);
  background-image: linear-gradient(rgba(233, 240, 242, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(233, 240, 242, .045) 1px, transparent 1px), radial-gradient(120% 60% at 50% 0%, var(--stage-2), var(--stage) 60%);
  background-size: 80px 80px, 80px 80px, auto; } }
/* phones: the header scrolls away with the page instead of holding 160 px of an 844 px screen */
@media (max-width: 520px) {
  .top { position: relative; padding-block: .6rem; }
  .top .name { font-size: 1.1rem; }
  .lens button { padding: .2rem .55rem; }
}

/* ================= v10: dusk theme. Dark blue night, pastel light at the horizon ================= */
/* One theme, whatever the OS asks for: deep blue ground, moonlit ink, pastel accents that never shout.
   :root:root out-ranks the older :root:not([data-theme]) blocks above. */
:root:root, :root:root[data-theme] {
  --paper: #1F1517; --panel: #2B1D20; --panel-2: #372529; --ink: #F4EADF; --muted: #C4AFA5; --line: #4C3437;
  --lilac: #DDBFCB; --rose: #E6AE9F; --peach: #EDBE8C; --sky: #E4CFA4; --sage: #C6CDA2;
  --mark: var(--peach); --on-mark: #1F1517;
  --stage: #180F11; --stage-2: #2A1A1D; --stage-ink: #F4EADF; --stage-muted: #C4AFA5; --stage-line: rgba(221, 191, 203, .16);
  --glass: rgba(43, 29, 32, .58); --glass-line: rgba(221, 191, 203, .2);
  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --text: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}
html { background: var(--paper); }
body { font-family: var(--text); background: transparent; font-size: 1.0625rem; }
::selection { background: var(--lilac); color: var(--paper); }
:focus-visible { outline-color: var(--lilac); }
a { text-decoration-color: color-mix(in srgb, var(--peach) 70%, transparent); }
a:hover { color: var(--peach); }

/* the world behind the page: a dusk sky whose glow sinks as you scroll, and slow dust */
.world { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, #170F12 0%, #1F1517 34%, #36202A 62%, #55302F 80%, #77462F 100%); }
.glow { position: absolute; inset: 0; transform-origin: 50% 100%;
  background:
    radial-gradient(60% 46% at 68% 100%, rgba(237, 190, 140, .55), rgba(230, 174, 159, .28) 38%, rgba(221, 191, 203, .1) 62%, transparent 78%),
    radial-gradient(90% 40% at 20% 100%, rgba(228, 207, 164, .16), transparent 70%); }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; }
html:not([data-tab="home"]) .glow { opacity: .22; }
main, .titleblock, .top { position: relative; z-index: 1; }
.top { z-index: 30; }

/* header: quiet glass, wordmark in the wide display face */
.top { background: color-mix(in srgb, var(--paper) 72%, transparent); border-bottom-color: var(--glass-line); }
.top .name { font: 400 .78rem/1 var(--display); letter-spacing: .3em; text-transform: uppercase; }
.tabs a { font-weight: 500; color: var(--muted); }
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] { border-bottom-color: var(--peach); }
.lens button { border-color: var(--glass-line); color: var(--muted); }
.lens button:hover { color: var(--ink); border-color: var(--lilac); }
.lens button[aria-checked="true"] { background: var(--lilac); border-color: var(--lilac); color: var(--paper); }
.top.on-stage { --paper: var(--stage); --mark: var(--peach); --on-mark: var(--paper); }

/* type: wide display caps for names and section titles, serif italic for the human line, Geist for reading */
h1, h2, .section-h, .stage-head h2, .slide h3, .counts dt { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.15; text-transform: uppercase; }
.section-h { font-size: clamp(1.05rem, 1.6vw, 1.3rem); text-transform: uppercase; letter-spacing: .16em; color: var(--lilac); }
h3 { font-weight: 600; letter-spacing: -.01em; }
.tier-h { text-transform: uppercase; letter-spacing: .14em; font-size: 1.05rem; color: var(--lilac); }

/* hero: a dusk horizon. Name in wide caps, the role in serif, a construction skyline along the ground */
.hero { isolation: isolate; padding-top: clamp(1.5rem, 4vh, 3rem); padding-bottom: clamp(7rem, 15vh, 11rem); }
#view-home .hero-name { font: 400 clamp(1.8rem, 3.9vw, 3.75rem)/1.04 var(--display); letter-spacing: .02em; text-transform: uppercase; margin-bottom: 1.1rem; }
.hero-role { font-family: var(--serif); color: var(--lilac); }
.hero-tag { font: 400 .78rem/1.6 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--peach); margin: 0 0 1.6rem; }
.lede { color: var(--ink); max-width: 46ch; }
.hero-proof { border-left-color: var(--rose); color: var(--muted); }
.btn { border-radius: 999px; border-color: var(--glass-line); padding: .7rem 1.35rem; font-weight: 500; }
.btn:hover { border-color: var(--lilac); color: var(--ink); }
.btn.primary { background: var(--peach); border-color: var(--peach); color: var(--on-mark); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.horizon { position: absolute; left: calc(50% - 50vw); width: 100vw; bottom: 0; height: clamp(110px, 15vw, 210px); z-index: -1; overflow: visible; }
.hz-far { fill: rgba(24, 15, 17, .55); }
.hz-ink { fill: none; stroke: color-mix(in srgb, var(--lilac) 55%, transparent); stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.hz-lights circle { fill: var(--peach); }
.scroll-cue span::after { background: var(--peach); }

/* the drawing sheet becomes a glass plate floating over the sky */
.sheet { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 18px; overflow: hidden;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 40px 80px -50px rgba(14, 6, 7, .9); }
.sheet figcaption { border-top-color: var(--glass-line); }
.g-line { stroke: var(--line); } .g-bubble { fill: var(--paper); stroke: var(--line); }
.g-block { fill: var(--panel-2); stroke: var(--lilac); }
.g-block-t { fill: var(--ink); font-family: var(--text); } .g-label { font-family: var(--text); }
.g-pipe { stroke: var(--lilac); } .g-dot { fill: var(--sky); } .g-dot.hollow { fill: var(--paper); stroke: var(--sky); }
.g-dot.out { fill: var(--rose); } .g-axis { stroke: var(--muted); } .g-diag { stroke: var(--peach); }
.ch-x, .ch-y { background: var(--peach); }
.ch-read { color: var(--peach); background: var(--paper); border-color: var(--peach); }
.steps li { border-top-color: var(--glass-line); }
.sheet.scrubbing .steps li.is-on { border-top-color: var(--peach); }

/* strip */
.strip { border-color: var(--glass-line); }
.strip-steps li + li::before { color: var(--peach); }
.strip-steps code { color: var(--ink); }
.strip figcaption em { color: var(--lilac); }

/* the stage is night: deeper blue, a lilac afterglow at the top, pastel marks */
.stage { --stage-mark: var(--lilac);
  background: radial-gradient(90% 50% at 50% 0%, rgba(221, 191, 203, .13), transparent 70%), linear-gradient(180deg, var(--stage-2), var(--stage) 40%);
  border-top: 1px solid var(--stage-line); }
:root:not([data-theme="light"]) .stage { background-size: auto; }
.stage-head .kicker { font: 400 .74rem/1.6 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--peach); }
.stage-head h2 { font-size: clamp(1.8rem, 3.8vw, 3.3rem); line-height: 1.08; text-transform: uppercase; letter-spacing: .01em; max-width: 18ch; }
.slide h3 { font-size: clamp(1.5rem, 2.8vw, 2.4rem); line-height: 1.1; text-transform: uppercase; letter-spacing: .02em; }
.slide-q { color: var(--lilac); }
.slide-facts li::before { background: var(--peach); border-radius: 50%; }
.reel-names button.is-on { border-bottom-color: var(--peach); }
.reel-progress i { background: linear-gradient(90deg, var(--sky), var(--lilac), var(--rose), var(--peach)); }
.stage .btn { border-color: var(--stage-line); }
.stage .btn.primary { background: var(--peach); border-color: var(--peach); color: var(--on-mark); }
.stage .btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--stage); }
.stage a:hover { color: var(--peach); }
.device { background: #1C1214; border-radius: 16px; }
.device:hover { box-shadow: 0 60px 100px -40px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, var(--lilac) 50%, transparent); }
.device-bar b { color: var(--peach); }
.device.phone { border-color: #372529; }
.stage .show.feature { background: var(--stage-2); border-radius: 18px; }
.fire3d { background: #180F11; }
.hz-chips button { background: rgba(24, 15, 17, .6); }

/* numbers and lists: glass where it helps, hairlines elsewhere */
.counts > div { border-top: 1px solid var(--glass-line); position: relative; }
.counts > div::before { content: ""; position: absolute; left: 0; top: -1px; width: 3.5rem; height: 2px; background: var(--peach); }
.counts > div:nth-child(2)::before { background: var(--lilac); } .counts > div:nth-child(3)::before { background: var(--sky); }
.counts dt { font-size: clamp(2.2rem, 4.4vw, 3.8rem); letter-spacing: 0; }
.featured li, .entry, .lab-item, .pub { border-top-color: var(--glass-line); }
.tag { border-color: var(--glass-line); color: var(--muted); border-radius: 999px; padding: 0 .55rem; }
.tag.measured { border-color: var(--sage); color: var(--sage); }
.tag.published { border-color: var(--sky); color: var(--sky); }
.assist { color: var(--muted); }
.links a { font-weight: 500; }
.media { border-color: var(--glass-line); border-radius: 12px; background: var(--panel); }
.media.poster.phone { border-color: var(--panel-2); }
.lab-tile, .bio-studio { border-color: var(--glass-line); border-radius: 16px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
.bio-tools [role="tab"] { border-color: var(--glass-line); border-radius: 999px; }
.bio-tools [role="tab"][aria-selected="true"] { border-color: var(--lilac); color: var(--ink); }
.timeline > li { border-left-color: var(--glass-line); }
.timeline > li::before { background: var(--paper); border-color: var(--lilac); }
.titleblock { border-top: 1px solid var(--glass-line); }
.titleblock > div { border-right-color: var(--glass-line); }
.tb-k { font: 400 .62rem/1.8 var(--display); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.skip:focus { background: var(--paper); }

/* page index on wide screens, like a drawing's sheet list; it steps aside over the apps */
.route { position: fixed; z-index: 25; right: clamp(16px, 2.2vw, 36px); top: 50%; translate: 0 -50%; display: none; flex-direction: column; align-items: flex-end; gap: .15rem;
  transition: opacity .5s var(--ease); }
.route button { background: none; border: 0; cursor: pointer; padding: .35rem 0; display: flex; align-items: center; gap: .7rem;
  font: 400 .6rem/1 var(--display); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); transition: color .16s; }
.route button::after { content: ""; width: 14px; height: 1px; background: currentColor; opacity: .6; transition: width .4s var(--ease), background .2s; }
.route button:hover, .route button.is-on { color: var(--ink); }
.route button.is-on::after { width: 30px; background: var(--peach); opacity: 1; }
@media (min-width: 1680px) { html[data-tab="home"] .route { display: flex; } }
.route.is-away { opacity: 0; pointer-events: none; }

@media (max-width: 860px) {
  #view-home .hero-name { font-size: clamp(1.45rem, 7.15vw, 2.2rem); }
  .hero { padding-bottom: 7.5rem; }
  .horizon { height: 96px; }
}
@media (max-width: 520px) { .top .name { font-size: .7rem; letter-spacing: .24em; } }
@media (prefers-reduced-motion: reduce) { .dust { display: none; } }
.hero-name > div { white-space: nowrap; }

/* the pipeline as one line, inside the drawing it describes; tokens light up as the scrub reaches their stage */
.spec { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--glass-line); }
.spec-line { display: flex; flex-wrap: wrap; gap: .35rem 0; margin: 0 0 .45rem; max-width: none; }
.spec-line span { display: grid; gap: .1rem; padding-right: 1.1rem; position: relative; transition: opacity .4s var(--ease); }
.spec-line span + span { margin-left: .9rem; }
.spec-line span + span::before { content: "→"; position: absolute; left: -.95rem; top: 0; color: var(--peach); font: 500 .95rem/1.3 var(--mono); }
.spec-line code { font: 500 .95rem/1.3 var(--mono); color: var(--ink); }
.spec-line i { font-style: normal; font-size: .72rem; color: var(--muted); }
.sheet.scrubbing .spec-line span { opacity: .35; }
.sheet.scrubbing .spec-line span.is-on { opacity: 1; }
.spec-note { margin: 0; font-size: .78rem; color: var(--muted); max-width: none; }
.spec-note a { color: var(--ink); white-space: nowrap; }

/* the edit bar only appears with ?edit; its display: flex used to beat the hidden attribute */
.edit-bar[hidden] { display: none; }

/* ================= phone composition (≤ 860 px): its own layout, not the desktop squeezed =================
   Tabs live in a dock at the thumb; the header keeps only the name and the lens and scrolls away;
   the apps become a row of cards you swipe; every tap target is at least 44 px. */
@media (max-width: 860px) {
  /* the header no longer blurs or slides, so the dock inside it can be fixed to the screen */
  .top, .top.is-hidden { position: relative; transform: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    background: transparent; border-bottom-color: transparent; padding-block: .9rem .4rem; gap: .7rem 1rem; }
  .top .name { width: 100%; font-size: .72rem; letter-spacing: .26em; padding-block: .35rem; }
  .lens { width: 100%; flex-wrap: wrap; gap: .35rem; }
  .lens-label { display: block; width: 100%; font: 400 .58rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; margin: 0 0 .15rem; }
  .lens button { min-height: 40px; padding: 0 .9rem; font-size: .875rem; white-space: nowrap; }

  .tabs { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 4px; border-radius: 20px;
    background: rgba(31, 21, 23, .82); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 18px 40px -16px rgba(14, 6, 7, .9); }
  .tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 52px;
    border: 0; border-radius: 16px; font-size: .8rem; letter-spacing: 0; -webkit-tap-highlight-color: transparent; }
  .tabs a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; transition: opacity .2s, background .2s, transform .3s var(--ease); }
  .tabs a[aria-current="page"] { background: rgba(221, 191, 203, .12); color: var(--ink); }
  .tabs a[aria-current="page"]::before { background: var(--peach); opacity: 1; transform: scale(1.3); }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .view { padding-top: 1.25rem; }

  /* tap targets */
  .links { display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
  .links a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 0; }
  .hz-chips button { min-height: 40px; }
  .bio-tools [role="tab"], .bio-tools .linklike { min-height: 44px; }
  .spec-note a, #proof a, #scholar-line a { padding-block: .6rem; }
  #contact { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
  #contact a { display: inline-flex; align-items: center; min-height: 44px; }
  .slide-actions .btn, .spec-note a { min-height: 44px; }
  .spec-note a { display: inline-flex; align-items: center; }

  /* apps: one card per swipe, the next one peeking in; the names above are a strip of tabs */
  .stage-head h2 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .reel-bar { display: block; padding: .5rem 0 .9rem; }
  .reel-progress { display: none; }
  .reel-names { flex-wrap: nowrap; overflow-x: auto; gap: .4rem; margin-inline: calc(-1 * clamp(16px, 4vw, 48px)); padding-inline: clamp(16px, 4vw, 48px);
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .reel-names::-webkit-scrollbar { display: none; }
  .reel-names button { flex: none; min-height: 40px; padding: 0 .9rem; border: 1px solid var(--stage-line); border-radius: 999px; font-size: .85rem; font-weight: 500; }
  .reel-names button.is-on { background: var(--lilac); border-color: var(--lilac); color: var(--stage); }
  .reel-track { flex-direction: row; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * clamp(16px, 4vw, 48px)); padding: 2px clamp(16px, 4vw, 48px) 10px; scroll-padding-inline: clamp(16px, 4vw, 48px);
    scrollbar-width: none; will-change: auto; transform: none !important; }
  .reel-track::-webkit-scrollbar { display: none; }
  .slide, .slide.is-phone { flex: 0 0 min(86%, 420px); scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; gap: 0;
    align-items: stretch; padding: 10px 10px 14px; border: 1px solid var(--stage-line); border-radius: 20px; background: rgba(55, 37, 41, .55); }
  .slide .device { order: -1; margin-bottom: .95rem; border-radius: 12px; box-shadow: none; }
  .slide .device-bar { height: 26px; line-height: 26px; font-size: 10px; }
  .slide .device-bar > * { padding: 0 8px; }
  .slide .device-screen { aspect-ratio: 16 / 10; }
  /* the phone app keeps its phone shape, cropped to the same height as the others */
  .slide.is-phone .device.phone { width: auto; align-self: stretch; border-width: 0; border-radius: 12px; background: radial-gradient(80% 90% at 50% 100%, rgba(221, 191, 203, .18), transparent 70%), #1C1214; }
  .slide.is-phone .device-screen { aspect-ratio: 16 / 10; display: grid; place-items: start center; padding-top: 12px; }
  .slide.is-phone .device-screen img { width: 46%; height: auto; aspect-ratio: 390 / 760; border-radius: 18px 18px 0 0; border: 5px solid #372529; border-bottom: 0; }
  .slide-copy { padding-inline: 6px; display: flex; flex-direction: column; flex: 1; }
  .slide h3 { font-size: 1.15rem; margin-bottom: .35rem; }
  .slide-q { font-size: 1.3rem; margin-bottom: .8rem; }
  .slide-facts { margin-bottom: 1rem; }
  .slide-facts li { font-size: .875rem; padding-block: .4rem; }
  .slide-actions { margin: auto 0 0; flex-wrap: nowrap; gap: .5rem; }
  .slide-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 1rem; font-size: .9rem; white-space: nowrap; }
  .slide-actions .btn.primary { flex: 1; }
  .reel-count { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; font: 400 .62rem/1 var(--display); letter-spacing: .22em;
    text-transform: uppercase; color: var(--stage-muted); }
  .reel-count b { font-weight: 400; color: var(--stage-ink); }

  .counts > div { display: flex; align-items: baseline; gap: 1rem; padding-block: .9rem .2rem; }
  .counts dt { font-size: 2.2rem; min-width: 3.2ch; }
  .counts dt + dd { margin: 0; }
  .titleblock { margin-bottom: 1rem; }
}
@media (max-width: 380px) {
  .slide-actions { flex-wrap: wrap; }
  .lens button { padding: 0 .7rem; }
}

/* ================= v10.2: calmer pacing, one ending ================= */
/* spacing: less dead sky between the hero and the apps; the apps fade back into the sky instead of stopping on a hard edge */
.hero { padding-bottom: clamp(4.5rem, 10vh, 7.5rem); }
.stage { padding: clamp(3rem, 6vw, 5rem) 0 clamp(6rem, 11vw, 10rem);
  background: radial-gradient(90% 50% at 50% 0%, rgba(221, 191, 203, .13), transparent 70%),
    linear-gradient(180deg, var(--stage-2), var(--stage) 30%, var(--stage) calc(100% - 200px), color-mix(in srgb, var(--stage) 0%, transparent)); }

/* app screenshots wear the dusk: a little less colour and light, full colour on hover */
.device-screen { position: relative; }
.device-screen img, .media.poster img { filter: saturate(.7) brightness(.86); transition: filter .6s var(--ease), transform .9s var(--ease); }
.device-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(31, 21, 23, 0) 35%, rgba(31, 21, 23, .32)), rgba(221, 191, 203, .05); }
.device:hover .device-screen img, .entry:hover .media.poster img, .lab-tile:hover .media.poster img { filter: none; }

/* reading text: one size up, so the write-ups read without leaning in */
.entry-body p, .lab-tile p { font-size: 1.0625rem; line-height: 1.62; }
.entry-body { max-width: 72ch; }
.evidence { font-size: 1rem; }
.src, .caveat, .assist { font-size: .8125rem; line-height: 1.5; }

/* selected work: three short cards; the long write-ups live in Work */
.selected { padding-top: clamp(3.5rem, 8vw, 6rem); }
.selected h2, .closing h2 { font: 400 clamp(1.6rem, 3.4vw, 2.8rem)/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; max-width: 20ch; }
.cards { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; padding: 1.5rem 1.5rem 1.1rem; border: 1px solid var(--glass-line); border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 62%, transparent); transition: border-color .3s, translate .5s var(--ease); }
.card:hover { border-color: color-mix(in srgb, var(--lilac) 55%, transparent); translate: 0 -4px; }
.card-kind { margin: 0 0 1rem; font: 400 .62rem/1 var(--display); letter-spacing: .24em; text-transform: uppercase; color: var(--peach); }
.card:nth-child(2) .card-kind { color: var(--sky); } .card:nth-child(3) .card-kind { color: var(--sage); }
.card h3 { margin: 0 0 .8rem; font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
.card h3 span { display: block; margin-top: .3rem; font: italic 400 1.2rem/1.25 var(--serif); color: var(--lilac); letter-spacing: 0; }
.card-q { margin: 0 0 .9rem; color: var(--ink); font-size: 1rem; line-height: 1.55; }
.card-ev { margin: 0 0 1rem; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.card-more { margin-top: auto; display: inline-flex; align-items: center; min-height: 44px; align-self: flex-start; font-weight: 500; text-decoration: none; color: var(--ink); }
.card-more:hover { color: var(--peach); }

/* the page ends on a way to get in touch */
.closing { margin: clamp(4rem, 9vw, 7rem) 0 3rem; padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--glass-line); }
.closing .actions { justify-content: center; max-width: none; }
.closing-sub { margin: .8rem 0 1.6rem; color: var(--muted); }
.closing .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; }
.closing .proof { margin: 1.6rem 0 0; font-size: .9375rem; }

@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .closing .actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
}
.card-more .arr { margin-left: .4rem; transition: translate .3s var(--ease); }
.card-more:hover .arr { translate: 3px 0; }

/* v10.3: a reel app that runs only on the author's machine shows a quiet note instead of an Open button. */
.slide-local { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border: 1px dashed color-mix(in srgb, currentColor 35%, transparent); border-radius: 999px; font-size: .875rem; opacity: .85; }

/* v10.4: Lab merged into Work. A row of section jumps under the Work intro. */
.work-index { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 .5rem; }
.work-index a { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .95rem; border: 1px solid var(--glass-line); border-radius: 999px;
  text-decoration: none; color: var(--ink); font-size: .9rem; background: color-mix(in srgb, var(--panel) 55%, transparent); transition: border-color .2s, color .2s; }
.work-index a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.work-index a:hover { border-color: var(--lilac); }
@media (max-width: 860px) { .work-index a { min-height: 44px; } }
.entry-body p.src { font-size: .8125rem; line-height: 1.5; }
.top .name-post { color: var(--muted); text-transform: none; letter-spacing: .12em; }

/* v10.5: the narrow header stays at the top on every screen. Sticky, not fixed, so it keeps its place in the flow;
   on phones it has no transform or backdrop-filter, so the fixed tab dock inside it still anchors to the viewport. */
.top, .top.is-hidden { position: sticky; top: 0; transform: none; }
@media (max-width: 860px) { .top { background: color-mix(in srgb, var(--paper) 94%, transparent); padding-block: .7rem; } .top.is-scrolled { border-bottom-color: var(--glass-line); } }
#bio-status:empty { display: none; }
.bio-studio .bio { margin-bottom: 0; }

/* v10.4: the Contact tab */
.contact-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; }
.contact-cv { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--glass-line); max-width: 40rem; }
.contact-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
