/* Redline — the whole site is one variable.
   --rev (0 → 1) is set by the throttle: gear 1 = 0, gear 5 = 1.
   --night flips to 1 at gear 5 only, so the middle gears never sit in a muddy grey. */

@property --rev { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --night { syntax: '<number>'; inherits: true; initial-value: 0; }
/* --grev is the committed gear's rev. While the throttle is dragged, --rev runs ahead of it:
   letterforms stretch live, but anything that would reflow the layout waits for the shift. */
@property --grev { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --paper: #F3F0E9;
  --ink: #121212;
  --coal: #0C0C0D;
  --bone: #F3F0E9;
  --verm: #E8431F;
  --verm-hot: #FF4A1F;

  --bg: color-mix(in oklab, var(--paper), var(--coal) calc(var(--night) * 100%));
  --fg: color-mix(in oklab, var(--ink), var(--bone) calc(var(--night) * 100%));
  --muted: color-mix(in oklab, var(--fg) 60%, var(--bg));
  --rule: color-mix(in oklab, var(--fg) 20%, var(--bg));
  --wash: color-mix(in oklab, var(--fg) 5%, var(--bg));
  --accent: color-mix(in oklab, var(--verm), var(--verm-hot) calc(var(--rev) * 100%));
  /* Small vermillion text needs 4.5:1. On paper that means a deeper print vermillion; at night the hot one passes. */
  --accent-text: color-mix(in oklab, #B03014, var(--accent) calc(var(--night) * 100%));

  --ease: cubic-bezier(.2, .8, .16, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --display: 'Anybody', 'IBM Plex Sans', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --pad: clamp(16px, 3.4vw, 48px);
  --wrap: 1360px;
  --vw: 100vw;

  /* The display axes. Everything Anybody touches stretches and thickens with the throttle. */
  --stretch: calc((55 + var(--rev) * 95) * 1%);
  --heft: calc(450 + var(--rev) * 450);

  /* How much of the hero width the name fills: 30% at Skim, 100% at Full send. */
  --nf0: 0.27;
  --nf1: 0.73;

  transition: --rev 700ms var(--ease), --grev 700ms var(--ease);
  overflow-anchor: none;
  background: var(--bg);
  color: var(--fg);
  color-scheme: light;
}
html[data-gear="5"] { color-scheme: dark; }
html.no-tween { transition: none; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: calc(15px + var(--grev) * 2px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; }
p, h1, h2, h3, blockquote, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code, pre { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

::selection { background: var(--accent); color: var(--bone); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  padding: 8px 12px; background: var(--fg); color: var(--bg);
  font: 500 12px/1 var(--mono); text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* Gear visibility helpers */
html:not(.gte-2) .g2up,
html:not(.gte-3) .g3up,
html:not(.gte-5) .g5only,
html.gte-3 .lt3 { display: none !important; }

.mono-label {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- top bar */

.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px var(--pad) 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.brand { text-decoration: none; display: flex; gap: 12px; }
.brand span { color: var(--muted); }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 28px); }
.top nav a { text-decoration: none; color: var(--muted); transition: color 200ms var(--ease); }
.top nav a:hover, .top nav a:focus-visible { color: var(--fg); }

/* ---------------------------------------------------------------- hero */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: calc(22px + var(--grev) * 54px) var(--pad) 0;
  container-type: inline-size;
}
.hero-grid { display: grid; gap: 20px 56px; align-items: end; }
html:not(.gte-3) .hero-grid { grid-template-columns: auto minmax(0, 1fr); }

.name {
  font-family: var(--display);
  font-stretch: var(--stretch);
  font-weight: var(--heft);
  font-size: calc(
    100cqw * (var(--nf0) + var(--nf1) * var(--grev)) * 0.985 /
    (var(--nm-a, 2.05) + var(--nm-b, 1.9) * var(--rev) + var(--nm-c, 0) * var(--rev) * var(--rev))
  );
  line-height: .8;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: -0.035em;
  view-transition-name: name;
  width: max-content;
}
.name .tick { color: var(--accent-text); }

/* Gear 3–4: an index sits in the space the name has not grown into yet. */
html.gte-3:not(.gte-5) .hero-grid { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
html.gte-3 .hero-meta { grid-column: 1 / -1; }
html.gte-5 .hero-index { display: none; }
.hero-index { justify-self: end; width: min(100%, 300px); padding-top: .4em; }
.hero-index ol { margin-top: 10px; border-top: 1px solid var(--fg); }
.hero-index li { border-bottom: 1px solid var(--rule); }
.hero-index a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-areas: "n t" ". s";
  padding: 9px 0 8px;
  text-decoration: none;
  transition: padding 280ms var(--ease);
}
.hero-index .n { grid-area: n; font: 500 11px/1.5 var(--mono); color: var(--accent-text); }
.hero-index .t { grid-area: t; font-size: 15px; line-height: 1.3; font-weight: 500; }
.hero-index .s { grid-area: s; font-size: 12.5px; color: var(--muted); }
.hero-index a:hover, .hero-index a:focus-visible { padding-left: 6px; }
.hero-index a:hover .t { color: var(--accent-text); }

.hero-meta { display: grid; gap: 18px 48px; align-content: end; }
html.gte-3 .hero-meta {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  margin-top: calc(16px + var(--grev) * 22px);
  align-items: end;
}

.role {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}
.statement {
  font-size: calc(19px + var(--grev) * 15px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  max-width: 28ch;
  text-wrap: balance;
}
.persona {
  margin-top: 12px;
  color: var(--muted);
  max-width: 44ch;
  font-size: calc(14.5px + var(--grev) * 1.5px);
}

.hero-side { display: grid; gap: 16px; align-content: end; }
.invite {
  font: 400 12px/1.5 var(--mono);
  color: var(--fg);
  max-width: 40ch;
  display: flex;
  gap: 10px;
}
.invite::before {
  content: '';
  flex: none;
  width: 8px; height: 8px; margin-top: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.invite b { font-weight: 500; color: var(--accent-text); white-space: nowrap; }

.contact { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact a {
  display: inline-flex; align-items: baseline; gap: 8px;
  text-decoration: none;
  font-size: 15px;
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
}
.contact a span { font: 400 12px/1 var(--mono); color: var(--muted); }
.contact a:hover { color: var(--accent-text); }

/* The oscilloscope strip under the hero */
.signal {
  position: relative;
  height: calc(60px + var(--grev) * 160px);
  margin-top: calc(22px + var(--grev) * 34px);
  border-block: 1px solid var(--rule);
  view-transition-name: signal;
}
.signal canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sig-labels {
  position: absolute;
  left: var(--pad); right: var(--pad); top: 9px;
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  font: 400 10.5px/1.3 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.sig-labels .hot { color: var(--accent-text); }

/* ---------------------------------------------------------------- work */

.work {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: calc(34px + var(--grev) * 74px) var(--pad) 0;
}
.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 10px;
}
.work-head h2 {
  font-family: var(--display);
  font-stretch: var(--stretch);
  font-weight: var(--heft);
  font-size: calc(22px + var(--grev) * 34px);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.work-head p { color: var(--muted); text-align: right; }

.proj {
  display: grid;
  column-gap: calc(24px + var(--grev) * 24px);
  padding-block: calc(24px + var(--grev) * 76px);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 16px;
}
.proj:last-child { border-bottom: 0; }

/* Gear 1 — a tight list a recruiter can skim. */
html[data-gear="1"] .proj {
  grid-template-columns: 44px minmax(0, 1fr) 300px;
  grid-template-areas: "num head plate" "num body plate";
  align-items: start;
}
/* Gear 2 — room for the details, plate beside the text. */
html[data-gear="2"] .proj {
  grid-template-columns: 44px minmax(0, .95fr) minmax(0, 1.25fr);
  grid-template-areas: "num head plate" "num body plate";
  align-items: start;
}
/* Gear 3+ — the plate takes the stage. */
html.gte-3 .proj {
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas: "num head" "plate plate" "body body";
}

.proj-num {
  grid-area: num;
  font: 500 12px/1 var(--mono);
  color: var(--accent-text);
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
}
html.gte-3 .proj-num { font-size: calc(12px + var(--grev) * 6px); padding-top: calc(10px + var(--grev) * 14px); }

.proj-head { grid-area: head; min-width: 0; container-type: inline-size; }
html.gte-3 .proj-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30ch);
  grid-template-areas: "kicker kicker" "title line";
  column-gap: 40px;
  align-items: end;
  margin-bottom: calc(18px + var(--grev) * 22px);
}
.proj-kicker {
  grid-area: kicker;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.proj-title {
  grid-area: title;
  font-size: min(calc(28px + var(--grev) * 70px), 11.5cqi);
  line-height: .95;
  margin: 8px 0 10px;
  text-wrap: balance;
  width: fit-content;
  max-width: 100%;
}
html.gte-3 .proj-title { margin-bottom: 0; }
.proj-line {
  grid-area: line;
  font-size: calc(15px + var(--grev) * 2px);
  line-height: 1.45;
  max-width: 56ch;
  color: var(--fg);
}
html.gte-3 .proj-line { color: var(--muted); padding-bottom: .35em; }

/* Each project titles itself in its own voice. */
.t-neuroflux {
  font-family: var(--display);
  font-stretch: calc((62 + var(--rev) * 78) * 1%);
  font-weight: calc(520 + var(--rev) * 330);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.t-automata {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.015em;
}
.t-luna {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.t-luna i { font-style: italic; }
.t-labyrinthus {
  font-family: 'IM Fell English SC', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
}

/* The plate holds the live miniature. */
.plate { grid-area: plate; min-width: 0; }
.plate-frame {
  position: relative;
  overflow: hidden;
  background: var(--tone);
  border-radius: 3px;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--fg) 10%, transparent);
}
[data-tone="lab"] { --tone: #0F1214; --tone-fg: #E6EEF0; }
[data-tone="paper"] { --tone: #F6F1E2; --tone-fg: #15130E; }
[data-tone="night"] { --tone: #16131C; --tone-fg: #F2E9EF; }
[data-tone="parchment"] { --tone: #EDE0C4; --tone-fg: #2B1810; }

.mini { position: absolute; inset: 0; }

html[data-gear="1"] .plate-frame { aspect-ratio: 16 / 10; }
html[data-gear="1"] .mini {
  inset: auto;
  left: 0; top: 0;
  width: 200%; height: 200%;
  transform: scale(.5);
  transform-origin: 0 0;
  pointer-events: none;
}
html[data-gear="2"] .plate-frame { height: clamp(360px, 33vw, 520px); }
html.gte-3 .plate-frame { height: clamp(400px, 64vh, 720px); }
html[data-gear="5"] .plate {
  width: calc(var(--vw) - 24px);
  margin-left: calc(50% - var(--vw) / 2 + 12px);
}
html[data-gear="5"] .plate-frame { height: clamp(440px, 82vh, 900px); border-radius: 2px; }

.plate > figcaption {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  font: 400 11px/1.5 var(--mono);
  color: var(--muted);
  max-width: 90ch;
}
html[data-gear="1"] .plate > figcaption { display: none; }
html[data-gear="5"] .plate > figcaption { padding-inline: 4px; }
.fig { color: var(--accent-text); white-space: nowrap; }

.plate-debug {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 8px;
  padding: 9px 4px 0;
  border-top: 1px solid var(--rule);
  font: 400 11px/1.4 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 2.2em;
}
.plate-debug .live { color: var(--accent-text); }
.plate-debug b { color: var(--fg); font-weight: 500; }

/* Placeholder until a miniature module mounts */
.plate-frame { container-type: size; }
.is-live .mini-ph { display: none; }
.mini-ph {
  position: absolute; inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--tone-fg);
  background:
    repeating-linear-gradient(90deg, color-mix(in oklab, var(--tone-fg) 7%, transparent) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, color-mix(in oklab, var(--tone-fg) 7%, transparent) 0 1px, transparent 1px 48px);
}
.mini-ph .ph-title { font-size: clamp(18px, 8cqw, 64px); line-height: 1; }
.mini-ph .ph-note { font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .6; }

/* Project body */
.proj-body { grid-area: body; min-width: 0; display: grid; gap: 18px; }
html.gte-3 .proj-body {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .85fr);
  column-gap: calc(28px + var(--grev) * 24px);
  margin-top: calc(22px + var(--grev) * 18px);
  align-items: start;
}
html[data-gear="2"] .proj-body { margin-top: 16px; }

.proj-thesis p {
  font-size: calc(18px + var(--grev) * 6px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.proj-detail { margin-top: 12px; color: var(--muted); max-width: 60ch; }
.proj-stack {
  margin-top: 14px;
  font: 400 11px/1.6 var(--mono);
  color: var(--muted);
  letter-spacing: .02em;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  align-content: start;
}
.fact { display: flex; flex-direction: column-reverse; gap: 6px; min-width: 0; container-type: inline-size; }
.fact dd {
  font-family: var(--display);
  font-stretch: calc((72 + var(--rev) * 50) * 1%);
  font-weight: calc(600 + var(--rev) * 200);
  /* Never wider than its column, however hard the throttle stretches it. */
  font-size: min(calc(22px + var(--grev) * 16px), 15.5cqw);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fact dd .sign { font-family: var(--sans); font-weight: 500; margin-right: .04em; }
.fact dt { font-size: 12.5px; line-height: 1.35; color: var(--muted); }

html[data-gear="1"] .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; gap: 12px 20px; }
html[data-gear="1"] .fact:nth-child(4) { display: none; }
html[data-gear="1"] .fact dd { font-size: 19px; }
html[data-gear="1"] .fact dt { font-size: 11.5px; }

.proj-side { display: grid; gap: 16px; align-content: start; }
.limits { font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 48ch; }
.limits b {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  color: var(--accent-text);
  font-size: 1.08em;
}

.proj-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
.proj-links a, .run-it {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid currentColor;
}
.proj-links a:hover { color: var(--accent-text); }
.run-it { color: var(--accent-text); }
.run-it:hover { color: var(--fg); }

/* ---------------------------------------------------------------- under the hood */

.hood {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: calc(48px + var(--grev) * 90px) var(--pad) calc(40px + var(--grev) * 60px);
}
.hood-inner {
  border-top: 1px solid var(--fg);
  padding-top: 14px;
}
html[data-gear="5"] .hood-inner {
  border: 1px solid color-mix(in oklab, var(--accent) 60%, transparent);
  padding: 18px clamp(16px, 2.4vw, 32px) 26px;
  background: color-mix(in oklab, var(--fg) 3%, var(--bg));
}
.hood-kicker { color: var(--accent-text); }
.hood-inner { container-type: inline-size; }
.hood-title {
  margin-top: 14px;
  font-family: var(--display);
  font-stretch: var(--stretch);
  font-weight: var(--heft);
  /* the longest word, "variable.", must fit at any stretch */
  font-size: min(calc(26px + var(--grev) * 50px), 10.8cqi);
  line-height: .95;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 18ch;
}
.hood-grid { display: grid; gap: 28px 56px; margin-top: calc(18px + var(--grev) * 22px); }
html.gte-3 .hood-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.hood-body { max-width: 52ch; color: var(--muted); }
.hood-body code { color: var(--fg); background: var(--wash); padding: 1px 5px; border-radius: 3px; font-size: .9em; }

.rev-line {
  display: flex; align-items: baseline; gap: 16px;
  margin-top: 22px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.rev-line code { font-size: 13px; color: var(--muted); }
.rev-val {
  font-size: calc(40px + var(--grev) * 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent-text);
}
.hood-summary {
  margin-top: 16px;
  font: 400 12px/1.6 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hood-summary b { color: var(--fg); font-weight: 500; }
.hood-summary code { white-space: nowrap; }
.hood-low { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 46ch; }

.fps-fig canvas { display: block; width: 100%; height: calc(64px + var(--grev) * 40px); }
.fps-fig figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 6px;
  font: 400 11px/1.4 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.css-lines {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--wash);
  border: 1px solid var(--rule);
  font-size: 11.5px;
  line-height: 1.7;
  overflow-x: auto;
  max-height: 340px;
  tab-size: 2;
}
.css-lines .sel { color: var(--muted); }
.css-lines .prop { color: var(--fg); }
.css-lines .rev { color: var(--accent-text); font-weight: 500; }
.css-lines .more { color: var(--muted); font-style: italic; }

.mini-table {
  width: 100%;
  margin-top: 32px;
  border-collapse: collapse;
  table-layout: fixed;
  font: 400 12px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.mini-table th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--fg);
}
.mini-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.mini-table th:nth-child(1) { width: 26%; }
.mini-table th:nth-child(2) { width: 14%; }
.mini-table td { overflow-wrap: anywhere; }
.mini-table .ok { color: var(--accent-text); }
.mini-table .kv { display: inline-block; margin-right: 18px; color: var(--muted); max-width: 100%; }
.mini-table .kv b { color: var(--fg); font-weight: 500; }

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad) calc(150px + env(safe-area-inset-bottom));
}
.foot-inner {
  border-top: 1px solid var(--fg);
  padding-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 48px;
}
.foot h2, .foot h3 { margin-bottom: 14px; }
.foot h3 { color: var(--muted); }
.foot-contact { container-type: inline-size; }
.big-mail {
  display: inline-block;
  font-family: var(--display);
  font-stretch: calc((55 + var(--rev) * 45) * 1%);
  font-weight: var(--heft);
  font-size: min(calc(24px + var(--grev) * 30px), 8.2cqw);
  line-height: 1;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}
.big-mail:hover { color: var(--accent-text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 16px; }
.foot-links a { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.foot p { font-size: 13.5px; color: var(--muted); max-width: 46ch; }
.foot p + p { margin-top: 10px; }
.foot-erratae h3 i {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--accent-text);
}

/* ---------------------------------------------------------------- throttle */

.throttle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: 252px;
  padding: 12px 14px 10px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--rule);
  box-shadow: 0 24px 48px -28px rgb(0 0 0 / .45);
  view-transition-name: throttle;
  user-select: none;
  -webkit-user-select: none;
}
html[data-gear="5"] .throttle { border-color: color-mix(in oklab, var(--accent) 70%, transparent); }

.th-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.th-label { font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.th-label b { color: var(--fg); font-weight: 500; }
.th-name {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-stretch: var(--stretch);
  font-weight: var(--heft);
  font-size: calc(40px - var(--rev) * 15px);
  line-height: .9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  height: 36px;
  display: flex;
  align-items: flex-end;
}
html[data-gear="5"] .th-name { color: var(--accent-text); }

/* Once you scroll past the hero the gauge folds away. Dragging the rail or tabbing in unfolds it
   upward; the panel is anchored at the bottom, so nothing moves under your pointer. */
.th-instrument {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 420ms var(--ease), opacity 300ms var(--ease);
}
.th-instrument > * { min-height: 0; }
.th-instrument-inner { overflow: hidden; }
.throttle.compact:not(:has(:focus-visible)):not(:has(.dragging)) .th-instrument { grid-template-rows: 0fr; opacity: 0; }
.throttle.compact .th-hint { display: none; }
.th-gauge { position: relative; margin: 8px auto 0; width: 78%; }
.th-gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.th-gauge .tk { stroke: var(--fg); stroke-width: 1; opacity: .5; }
.th-gauge .tk.major { opacity: 1; stroke-width: 1.4; }
.th-gauge .tk.red { stroke: var(--accent); opacity: 1; }
.th-gauge .tn { fill: var(--muted); font: 500 7px var(--mono); text-anchor: middle; }
.th-gauge .arc { fill: none; stroke: var(--rule); stroke-width: 1; }
.th-gauge .redarc { fill: none; stroke: var(--accent); stroke-width: 3.5; }
.th-gauge .needle { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.th-gauge .hub { fill: var(--fg); }
.th-rpm {
  margin-top: 4px;
  text-align: center;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.th-rpm b { color: var(--fg); font-weight: 500; font-size: 13px; }
html[data-gear="5"] .th-rpm b { color: var(--accent-text); }

.th-rail { position: relative; height: 46px; margin-top: 8px; }
.th-track { position: absolute; left: 0; right: 0; top: 10px; height: 18px; }
.th-track::before {
  content: '';
  position: absolute; left: 10px; right: 10px; top: 8px;
  height: 2px;
  background: var(--rule);
}
.th-fill {
  position: absolute; left: 10px; top: 8px; height: 2px;
  width: calc((100% - 20px) * var(--p, .5));
  background: var(--fg);
  transition: width 420ms var(--spring);
}
.th-red {
  position: absolute; top: 7px; height: 4px;
  left: calc(10px + (100% - 20px) * .75);
  right: 10px;
  background: var(--accent);
}
.th-notch {
  position: absolute; top: 3px;
  width: 1px; height: 12px;
  left: calc(10px + (100% - 20px) * var(--n) - .5px);
  background: var(--fg);
  opacity: .45;
}
.th-thumb {
  position: absolute; top: -2px;
  width: 12px; height: 22px;
  left: calc(10px + (100% - 20px) * var(--p, .5) - 6px);
  background: var(--fg);
  border-radius: 2px;
  transition: left 420ms var(--spring), background 300ms var(--ease);
}
html[data-gear="5"] .th-thumb { background: var(--accent); }
.th-rail:has(.th-input:focus-visible) .th-thumb { outline: 2px solid var(--accent); outline-offset: 3px; }
.th-rail.dragging .th-thumb { transform: scaleY(1.12); }

.th-input {
  position: absolute; inset: 0 0 18px;
  width: 100%; height: 28px;
  margin: 0;
  opacity: 0;
  cursor: grab;
  touch-action: none;
}
.th-input:active { cursor: grabbing; }
.th-input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 28px; }
.th-input::-moz-range-thumb { width: 20px; height: 28px; border: 0; }

.th-labels { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; }
.th-labels li {
  position: absolute; bottom: 0;
  left: calc(10px + (100% - 20px) * var(--n));
  transform: translateX(-50%);
  font: 500 8.5px/1 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.th-labels li:first-child { transform: translateX(-10px); }
.th-labels li:last-child { transform: translateX(calc(-100% + 10px)); }
.th-labels li.on { color: var(--fg); }
html[data-gear="5"] .th-labels li.on { color: var(--accent-text); }

.th-hint { margin-top: 9px; font: 400 10px/1 var(--mono); color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.th-hint kbd {
  font: inherit;
  display: inline-block;
  min-width: 14px;
  padding: 2px 3px;
  margin-right: 2px;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--fg);
}
.th-sound {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 5px 7px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: inline-flex; gap: 6px; align-items: center;
}
.th-sound .bars { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 9px; }
.th-sound .bars i { width: 2px; background: currentColor; height: 4px; opacity: .5; }
.th-sound .bars i:nth-child(2) { height: 7px; }
.th-sound .bars i:nth-child(3) { height: 10px; }
.th-sound .bars { height: 10px; }
.th-sound[aria-pressed="true"] { color: var(--accent-text); border-color: currentColor; }
.th-sound[aria-pressed="true"] .bars i { opacity: 1; animation: eq 900ms ease-in-out infinite alternate; }
.th-sound[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -300ms; }
.th-sound[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -600ms; }
@keyframes eq { from { height: 3px; } to { height: 10px; } }

/* ---------------------------------------------------------------- debug HUD (gear 5) */

.hud {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 59;
  width: 232px;
  padding: 10px 12px 11px;
  background: #0C0C0D;
  color: #F3F0E9;
  border: 1px solid rgb(243 240 233 / .16);
  font: 400 10.5px/1.55 var(--mono);
  font-variant-numeric: tabular-nums;
  display: none;
  view-transition-name: hud;
}
html[data-gear="5"] .hud { display: block; transition: opacity .3s var(--ease), translate .3s var(--ease); }
html[data-gear="5"].mini-focus .hud { opacity: 0; translate: 0 8px; pointer-events: none; }
.hud-row { display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; }
.hud-row .k { color: rgb(243 240 233 / .5); }
.hud-row .v { overflow: hidden; text-overflow: ellipsis; }
.hud-title { letter-spacing: .1em; text-transform: uppercase; font-weight: 500; margin-bottom: 4px; }
.hud-title .dot { color: var(--verm-hot); }
.hud-title .red { color: var(--verm-hot); }
.hud-graph { display: block; width: 100%; height: 26px; margin: 4px 0 6px; }
.hud-stats { margin-top: 4px; padding-top: 5px; border-top: 1px solid rgb(243 240 233 / .14); min-height: 3.1em; }
.hud.booting > * { animation: boot 240ms steps(3, end) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes boot { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

/* ---------------------------------------------------------------- the redline moment */

@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-4px, 1px); }
  30% { transform: translate(4px, -2px); }
  45% { transform: translate(-3px, 2px); }
  60% { transform: translate(3px, -1px); }
  80% { transform: translate(-1px, 1px); }
}
html.shaking #app { animation: shake 260ms linear; }

/* View transitions: gear changes morph, crossing into or out of gear 5 floods. */
::view-transition-group(*) { animation-duration: 640ms; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 340ms; }
html.vt-flood * { view-transition-name: none !important; }
html.vt-flood::view-transition-old(root),
html.vt-flood::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 860px) {
  :root { --nf0: 0.44; --nf1: 0.56; }
  .top nav a:nth-child(2) { display: none; }
  html:not(.gte-3) .hero-grid, html.gte-3 .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-index { display: none; }
  html.gte-3 .hero-meta { grid-template-columns: minmax(0, 1fr); }
  .statement { font-size: calc(19px + var(--grev) * 7px); }

  html[data-gear="1"] .proj,
  html[data-gear="2"] .proj,
  html.gte-3 .proj {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas: "num head" "plate plate" "body body";
  }
  html.gte-3 .proj-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kicker" "title" "line"; }
  html.gte-3 .proj-title { margin-bottom: 10px; }
  .proj-title { font-size: min(calc(30px + var(--grev) * 22px), 11.5cqi); }
  html[data-gear="1"] .plate { margin-top: 14px; }
  html[data-gear="2"] .plate { margin-top: 16px; }
  html[data-gear="2"] .plate-frame,
  html.gte-3 .plate-frame { height: clamp(420px, 118vw, 560px); }
  html[data-gear="5"] .plate { width: calc(var(--vw) - 16px); margin-left: calc(50% - var(--vw) / 2 + 8px); }
  html[data-gear="5"] .plate-frame { height: 76svh; }
  html.gte-3 .proj-body { grid-template-columns: minmax(0, 1fr); }
  html[data-gear="1"] .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html[data-gear="1"] .fact dd { font-size: 17px; }

  html.gte-3 .hood-grid { grid-template-columns: minmax(0, 1fr); }
  .mini-table thead { display: none; }
  .mini-table, .mini-table tbody, .mini-table tr, .mini-table td { display: block; width: auto; }
  .mini-table tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .mini-table td { border: 0; padding: 2px 0; }
  .mini-table td:nth-child(1) { font-weight: 500; }
  .foot { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .foot-inner { grid-template-columns: minmax(0, 1fr); }

  /* The throttle becomes a bottom bar. */
  .throttle {
    left: 8px; right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    padding: 7px 10px 5px 12px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    grid-template-areas: "label rail sound" "name rail sound";
    align-items: center;
    column-gap: 12px;
  }
  .th-head { display: contents; }
  .th-label { grid-area: label; align-self: end; font-size: 9.5px; }
  .th-sound { grid-area: sound; padding: 7px 7px; }
  .th-sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .th-name { grid-area: name; margin-top: 2px; height: auto; font-size: calc(22px - var(--rev) * 10.5px); align-self: start; }
  .th-instrument, .th-hint { display: none !important; }
  .th-rail { grid-area: rail; margin-top: 0; height: 42px; }
  .th-labels li { font-size: 7.5px; }

  .hud {
    left: 8px; right: 8px; top: 8px; bottom: auto;
    width: auto;
    padding: 6px 10px;
    display: none;
  }
  html[data-gear="5"] .hud { display: flex; gap: 18px; align-items: center; }
  html[data-gear="5"] .top { margin-top: 34px; }
  .hud-graph, .hud-stats, .hud .hud-row.mini-row, .hud-title .red { display: none !important; }
  .hud-row { justify-content: flex-start; gap: 6px; }
  .hud-title { margin: 0; }
}

@media (max-width: 420px) {
  .sig-labels span:nth-child(n + 3) { display: none; }
  html[data-gear="1"] .facts { gap: 10px 12px; }
  html[data-gear="1"] .fact dd { font-size: 15.5px; }
}

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  .th-thumb, .th-fill { transition: none; }
  .th-sound[aria-pressed="true"] .bars i { animation: none; height: 7px; }
  html.shaking #app { animation: none; }
  .hud.booting > * { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

.noscript { max-width: 640px; margin: 0 auto; padding: 48px 20px; }
.noscript h1 { font-family: var(--display); font-size: 64px; text-transform: uppercase; }
