/* Isocast, isocast.com
   Near-black, one copper accent, real depth. Everything that moves is driven
   by springs in js/; CSS holds materials, layout and press states. */

/* A Latin subset of Mona Sans (see fonts/README.md). Preloaded; `optional`
   means it is either there for first paint or the page keeps the
   metric-matched fallback: never a visible swap. */
@font-face {
  font-family: "Isocast Sans";
  src: url("../fonts/isocast-sans.woff2") format("woff2");
  font-weight: 400 650;
  font-stretch: 100% 112.5%;
  font-style: normal;
  font-display: optional;
}
/* Metric-matched fallback so a missing font never moves the layout. */
@font-face {
  font-family: "Isocast Fallback";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Arial");
  size-adjust: 104%;
  ascent-override: 105%;
  descent-override: 31%;
  line-gap-override: 0%;
}

:root {
  --bg: #0a0a0a;
  --ink: #f2efe9;
  --ink-2: #c9c5bd;
  --ink-3: #9b968e;   /* 6.7:1 on the page */
  --ink-4: #827e77;   /* 4.9:1 on the page, 4.6:1 on panels */
  --copper: #b4683f;
  --copper-hi: #e3a27c;

  /* One spacing scale for the whole page. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section: var(--s-9);

  --gutter: 72px;
  --nav-h: 92px;
  --content: 1240px;
  --font: "Isocast Sans", "Isocast Fallback", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --press: cubic-bezier(0.2, 0, 0, 1);
  /* macOS-style focus ring in the accent colour. */
  --ring-color: rgb(196 120 78 / 0.7);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(1200px 900px at 50% 36%, rgb(255 238 224 / 0.05), rgb(255 238 224 / 0) 72%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1 { text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ring-color); outline-offset: 2px; }
::selection { background: rgb(180 104 63 / 0.5); color: #fff; }

/* The hero light is wider than a phone; clip it here so it can never widen the
   layout viewport (iOS honours this where it ignores clipping on <html>). */
main { overflow-x: clip; }

.skip {
  position: fixed; left: var(--s-3); top: var(--s-3); z-index: 50;
  padding: var(--s-2) var(--s-3); border-radius: 8px; background: #1d1e20; color: var(--ink);
  font-size: 14px; transform: translateY(-160%);
}
.skip:focus-visible { transform: none; }

/* Shared content column. */
.nav, .hero, .foot {
  width: min(100%, calc(var(--content) + 2 * var(--gutter)));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Small links: press-in feedback, interruptible. */
.brand, .nav-link, .foot-brand, .foot-link {
  transition: color 160ms ease, background-color 160ms ease, transform 160ms var(--press);
  user-select: none; -webkit-user-select: none;
}
.brand:active, .nav-link:active, .foot-brand:active, .foot-link:active { transform: scale(0.96); }

/* ───────────── Nav ───────────── */
.nav {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; border-radius: 10px; padding: 0 var(--s-2) 0 var(--s-1); margin-left: calc(-1 * var(--s-1)); }
.brand-tile {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0) 46%), linear-gradient(180deg, #3d444c, #22262a);
  box-shadow: inset 0 0.5px 0 rgb(255 255 255 / 0.3), inset 0 0 0 0.5px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.6);
}
.brand-name { font-size: 15px; font-weight: 600; font-stretch: 112.5%; letter-spacing: -0.01em; line-height: 20px; }
.nav-link {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-3); margin-right: calc(-1 * var(--s-3)); border-radius: 10px;
  color: var(--ink-3); font-size: 14px; font-weight: 450; line-height: 20px;
}
.nav-link svg { transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { color: var(--ink); background-color: rgb(255 255 255 / 0.06); }
  .brand:hover .brand-name { color: #fff; }
}

/* ───────────── Hero ───────────── */
/* Centred in the first screen, and no taller than its content needs on tall
   windows, so the diagram follows at the page's section rhythm. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
  grid-template-areas: "copy object";
  column-gap: 56px;
  align-items: center;
  align-content: center;
  min-height: clamp(560px, calc(100svh - var(--nav-h) - env(safe-area-inset-top) - var(--s-8)), 640px);
  isolation: isolate;
}
.hero-light {
  position: absolute; z-index: -1; left: 0; top: 0; width: 1100px; height: 1100px;
  margin: -550px 0 0 -550px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 226 200 / 0.05), rgb(255 226 200 / 0.018) 45%, rgb(255 226 200 / 0) 100%);
  transform: translate3d(70vw, 45vh, 0);
}
.hero-copy { grid-area: copy; position: relative; z-index: 2; }
h1 {
  margin: 0;
  /* One sentence, three balanced lines on desktop. */
  font-size: clamp(42px, 3.9vw, 56px);
  line-height: 1.02;
  font-weight: 600;
  font-stretch: 112.5%;
  font-optical-sizing: auto;
  letter-spacing: -0.034em;
  color: var(--ink);
  /* Optical edge: the E's stem lines up with the text column below; the
     round O overshoots it by a hair, as rounds should. */
  margin-left: -0.058em;
}
.lede {
  margin: var(--s-5) 0 0;
  max-width: 500px;
  font-size: 17px; line-height: 1.6; color: var(--ink-3); font-weight: 400;
}
.download { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); margin-top: var(--s-6); }
.meta { margin: 0; font-size: 12px; line-height: 16px; font-weight: 450; letter-spacing: 0.01em; color: var(--ink-4); }
/* The version is written once, in the meta line's data-version (index.html). */
.meta[data-version]::before { content: "Version " attr(data-version) " · "; }

/* The tactile download key: its thickness is a stacked edge under the face. */
.btn-download {
  display: inline-block; border-radius: 12px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn-download:focus-visible { outline-offset: 4px; }
.btn-face {
  display: flex; align-items: center; gap: var(--s-3); height: 52px; padding: 0 22px 0 var(--s-5); border-radius: 12px;
  background: linear-gradient(180deg, #faf7f1, #e9e4db);
  color: #141210; font-size: 15px; font-weight: 600; line-height: 20px; white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.95),
    inset 0 -1px 0 rgb(0 0 0 / 0.08),
    0 0 0 1px rgb(0 0 0 / 0.6),
    0 2px 0 #a39d92,
    0 3px 0 rgb(0 0 0 / 0.5),
    0 14px 28px -8px rgb(12 8 4 / 0.7);
  transition: transform 140ms var(--press), box-shadow 140ms var(--press), background 160ms ease;
}
.btn-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 36% 33%, #d4916a, #a65c36);
  box-shadow: inset 0 0.5px 0 rgb(255 255 255 / 0.35), 0 0.5px 0 rgb(255 255 255 / 0.6);
}
.btn-arrow { color: #7a766f; flex: none; transition: transform 200ms var(--ease-out), color 160ms ease; }
@media (hover: hover) and (pointer: fine) {
  .btn-download:hover .btn-face { background: linear-gradient(180deg, #fdfbf7, #ede8e0); }
  .btn-download:hover .btn-arrow { transform: translateY(2px); color: #5f5b55; }
}
/* Pressed: the face travels down onto its edge. */
.btn-download:active .btn-face, .btn-download.is-pressed .btn-face {
  transform: translateY(2px);
  background: linear-gradient(180deg, #f1ede5, #e2ddd3);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.8),
    inset 0 1px 3px rgb(0 0 0 / 0.08),
    0 0 0 1px rgb(0 0 0 / 0.6),
    0 0.5px 0 #a39d92,
    0 1px 0 rgb(0 0 0 / 0.5),
    0 6px 14px -6px rgb(12 8 4 / 0.7);
  transition-duration: 60ms;
}

/* The object: a fixed-size stage scaled to fit its box (set in JS). */
.hero-object { grid-area: object; position: relative; display: flex; justify-content: center; min-width: 0; }
.stage {
  --sw: 760; --sh: 640;
  position: relative; z-index: 2;
  width: min(100%, calc(var(--sw) * 1px), calc((100svh - var(--nav-h) - 96px) * var(--sw) / var(--sh)));
  aspect-ratio: var(--sw) / var(--sh);
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  border-radius: 28px;
}
.stage.is-dragging { cursor: grabbing; }
.stage:focus-visible { outline-offset: -2px; }
.stage-inner {
  position: absolute; left: 0; top: 0;
  width: calc(var(--sw) * 1px); height: calc(var(--sh) * 1px);
  transform-origin: 0 0;
  transform: scale(var(--k, 1));
}

/* ───────────── The four files ───────────── */
.merge-unit { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transform-origin: 0 0; }
.file {
  /* Its own stacking context (z-index, not isolation: WebKit drops the
     picture area of an isolated layer that shares a 3D context with the
     slab's edge planes). */
  position: relative; z-index: 0;
  display: flex; flex-direction: column; padding: 8px; border-radius: 16px;
  background: linear-gradient(180deg, var(--top), var(--bot));
  /* A transparent outline makes Chrome antialias the edge of the 3D layer. */
  outline: 1px solid transparent;
  /* Lit top lip; the drop shadow lives under the slab (.slab-shadow). */
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / var(--hl)),
    inset 0 0 0 1px rgb(255 255 255 / 0.05);
}
/* Thickness: the rounded top face extruded (js/slab.js). */
.slab-wall {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  outline: 1px solid transparent; /* antialiased edges on the 3D plane */
}
.slab-core { position: absolute; left: 0; top: 0; border-radius: 15px; background: #0f1012; }
.slab-shadow {
  position: absolute; left: 0; top: 0; border-radius: 16px; background: #0b0b0c;
  box-shadow: 0 12px 20px rgb(10 6 3 / 0.5), 0 40px 70px -20px rgb(10 6 3 / 0.85);
}
/* Contact shadow on the floor under the stack. */
.floor {
  position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(4 3 2 / 0.75), rgb(4 3 2 / 0.35) 55%, rgb(4 3 2 / 0) 100%);
}
.file-head {
  display: flex; align-items: center; justify-content: space-between; padding: 0 10px; gap: 10px;
  overflow: hidden; flex: none;
}
.file-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.file-mark { width: 8px; height: 8px; flex: none; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--ink-4); }
.file[data-kind="program"] .file-mark { border-radius: 50%; box-shadow: none; background: radial-gradient(circle at 35% 30%, #d4916a, #a65c36); }
.file-name { font-size: 14px; line-height: 18px; font-weight: 450; color: #b3aea6; white-space: nowrap; }
.file[data-kind="program"] .file-name { color: var(--ink); font-weight: 550; }
.file-tc { display: flex; flex: none; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); }
/* Fixed-width digits: tabular, but without the font's slashed tabular zero. */
.tk-d { display: inline-block; width: 0.62em; text-align: center; }
.tk-sep { display: inline-block; width: 0.3em; text-align: center; }
.file-body {
  /* Concentric with the window: 16px outer radius minus 8px padding. */
  position: relative; overflow: hidden; border-radius: 8px; background: #0b0b0c;
}
.file-body::after { /* inner hairline above the content */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.04);
}
.content { position: absolute; inset: 0; }
.content img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.file-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; overflow: hidden; }
.file-glare::before {
  content: ""; position: absolute; left: -50%; top: -80%; width: 200%; height: 200%;
  background: radial-gradient(closest-side, rgb(255 246 236 / 0.07), rgb(255 246 236 / 0) 70%);
  transform: translate3d(var(--gx, 0px), var(--gy, 0px), 0);
}
.playhead {
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, #9c5531, #e09a70 50%, #9c5531);
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.4), 0 0 10px rgb(201 116 74 / 0.45);
}
/* The take: real video loops, muted, never controls. */
.take-video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; background: #0d0d0e; pointer-events: none;
}
.wave { position: absolute; }
.wave-dim { position: absolute; inset: 0; z-index: 1; background: rgb(10 11 11 / 0.58); pointer-events: none; }
/* The level at the playhead: a soft verdigris column that rises with the voice. */
.wave-level {
  position: absolute; left: 0; top: 50%; z-index: 2; width: 12px; height: 132px; margin: -66px 0 0 -6px;
  border-radius: 6px; pointer-events: none; transform-origin: 50% 50%;
  background: radial-gradient(closest-side, rgb(120 214 190 / 0.55), rgb(86 173 155 / 0.18) 60%, rgb(86 173 155 / 0) 100%);
}
.cam-brackets { position: absolute; inset: 16px; z-index: 1; }
.cam-brackets i { position: absolute; width: 18px; height: 18px; border: 0 solid rgb(242 239 233 / 0.75); }
.cam-brackets i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.cam-brackets i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.cam-brackets i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.cam-brackets i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

/* The copper playhead through the stack, and where it pierces each layer. */
.rod {
  position: absolute; left: 0; top: 0; width: 3px; height: 1px; transform-origin: 0 0;
  background: linear-gradient(90deg, #9c5531, #e8a77f 50%, #9c5531);
}
.rod-x { width: 1px; height: 3px; background: linear-gradient(180deg, #9c5531, #e8a77f 50%, #9c5531); }
.slab-dot {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; z-index: 5;
  background: radial-gradient(circle, #0a0a0a 0 2.5px, #e09a70 3px 4.5px, rgb(224 154 112 / 0) 6px);
  box-shadow: 0 0 10px rgb(224 154 112 / 0.5);
}
.iso-label {
  position: absolute; left: 0; top: 0; height: 20px;
  font-size: 14px; line-height: 20px; font-weight: 450; color: var(--ink-3); white-space: nowrap;
}
.iso-label.is-program { color: var(--ink); font-weight: 550; }
.is-compact .iso-label { font-size: 22px; line-height: 28px; height: 28px; }
.is-compact .file-head { padding: 0 12px; }
.is-compact .file-name { font-size: 21px; line-height: 26px; }
.is-compact .file-tc { font-size: 20px; line-height: 26px; }
.is-compact .file-title { gap: 11px; }
.is-compact .file-mark { width: 11px; height: 11px; }

/* Timecode badge: the one clock. */
.tc-badge {
  position: absolute; left: 0; top: 0; z-index: 20;
  display: flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 8px;
  background: linear-gradient(180deg, #2b2d30, #1d1e20);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 0 0 1px rgb(0 0 0 / 0.8), 0 2px 0 -0.5px #0f1011, 0 8px 16px rgb(10 6 3 / 0.6);
  font-size: 14px; line-height: 16px; font-weight: 550; color: var(--copper-hi);
  white-space: nowrap; pointer-events: none;
}
.is-compact .tc-badge { height: 40px; padding: 0 14px; font-size: 19px; border-radius: 10px; }

/* ───────────── Below the hero ───────────── */
.fig { display: flex; justify-content: center; padding: var(--section) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.panel {
  border-radius: 14px;
  background: linear-gradient(180deg, #141413, #111110);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.08),
    inset 0 1px 0 rgb(255 255 255 / 0.05),
    0 1px 2px rgb(0 0 0 / 0.6),
    0 12px 24px -6px rgb(10 6 3 / 0.55),
    0 40px 80px -20px rgb(10 6 3 / 0.8);
}
.fig-take .panel { width: min(800px, 100%); }

.flow { display: flex; align-items: center; justify-content: center; padding: var(--s-7) var(--s-5); }
.flow ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flow-sources { gap: 14px; }
.flow-files { gap: var(--s-3); }
.chip {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 10px;
  background: linear-gradient(180deg, #1d1d1c, #181817);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.075), inset 0 1px 0 rgb(255 255 255 / 0.05), 0 1px 2px rgb(0 0 0 / 0.55);
  font-size: 14px; line-height: 18px; font-weight: 450; color: var(--ink-2);
  cursor: default;
  transition: box-shadow 160ms ease, color 160ms ease, background-color 160ms ease;
}
.flow-sources .chip { width: 156px; }
.flow-sources .chip svg { color: var(--ink-3); transition: color 160ms ease; }
.chip-file { width: 216px; justify-content: space-between; }
.chip-file.is-program { color: var(--ink); font-weight: 500; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 3px rgb(180 104 63 / 0.14); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { background-color: #222221; color: var(--ink); }
}
.chip.is-hot {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgb(180 104 63 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.05), 0 1px 2px rgb(0 0 0 / 0.55);
}
.chip.is-hot svg { color: var(--copper-hi); }
.flow-in, .flow-out { flex: none; overflow: visible; }
.flow-in { width: 84px; height: 148px; }
.flow-out { width: 84px; height: 196px; }
.flow-in path, .flow-out path { fill: none; stroke: #3a3836; stroke-width: 1; transition: stroke 160ms ease; }
.flow-in path.is-hot, .flow-out path.is-hot { stroke: var(--copper); }
/* One pulse travels the wires on one clock: sources → mark → files. */
.flow-in path.pulse, .flow-out path.pulse {
  stroke: #e8a77f; stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 0.14 3; stroke-dashoffset: 0.14; opacity: 0;
  transition: none;
}
.flow-hub {
  position: relative;
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 13px; flex: none;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0) 50%), linear-gradient(180deg, #3d444c, #22262a);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 1px rgb(0 0 0 / 0.7), 0 6px 14px rgb(10 6 3 / 0.55);
}
.flow-hub-glow {
  position: absolute; inset: -1px; border-radius: 14px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 1px rgb(224 154 112 / 0.5), 0 0 18px rgb(224 154 112 / 0.35);
}

.facts {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-7);
  width: min(800px, 100% - 40px); margin: var(--section) auto 0;
}
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.points li { font-size: 16px; line-height: 26px; color: var(--ink-3); }
/* Inline code: line-height 1 so the pill never grows the line box. */
code {
  font-family: var(--mono); font-size: 0.8em; font-weight: 400; line-height: 1; letter-spacing: -0.01em;
  color: var(--ink-2); padding: 0.22em 0.42em; margin: 0 0.08em; border-radius: 5px;
  background: rgb(255 255 255 / 0.055); box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.09);
  white-space: nowrap; vertical-align: 0.04em;
}

.cpu { margin: 0; width: 300px; flex: none; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.cpu figcaption { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.cpu-row { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; column-gap: var(--s-4); font-size: 13px; line-height: 18px; }
.cpu-name { color: var(--ink); font-weight: 500; }
.cpu-val { color: var(--ink); font-weight: 450; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.cpu-row.is-dim .cpu-name, .cpu-row.is-dim .cpu-val { color: var(--ink-4); }
.cpu-track { position: relative; height: 8px; border-radius: 4px; background: #0c0c0b; box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.7), 0 1px 0 rgb(255 255 255 / 0.05); overflow: hidden; }
/* Each bar is the measured range: solid to the low value, lighter to the high. */
.cpu-bar { position: absolute; left: 0; top: 0; height: 8px; width: calc(var(--hi) * 100%); border-radius: 4px; transform-origin: 0 50%; }
.cpu-bar::before { content: ""; position: absolute; inset: 0; right: calc((1 - var(--lo) / var(--hi)) * 100%); border-radius: inherit; }
.cpu-bar.is-iso { --lo: 0.25; --hi: 0.29; background: rgb(244 240 232 / 0.32); }
.cpu-bar.is-iso::before { background: linear-gradient(180deg, #f4f0e8, #d9d2c6); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8); }
.cpu-bar.is-obs { --lo: 0.58; --hi: 0.71; background: rgb(74 71 68 / 0.45); }
.cpu-bar.is-obs::before { background: linear-gradient(180deg, #4a4744, #393735); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08); }

.foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  margin-top: var(--section);
  padding-bottom: calc(var(--s-7) + env(safe-area-inset-bottom));
  font-size: 13px; line-height: 18px; color: var(--ink-4);
}
.foot-brand, .foot-link { display: inline-flex; align-items: center; min-height: 40px; border-radius: 8px; }
.foot-brand { gap: var(--s-2); font-weight: 500; }
.foot-link { font-weight: 450; }
@media (hover: hover) and (pointer: fine) { .foot-link:hover, .foot-brand:hover { color: var(--ink-2); } }

/* The 404 page (404.html): the hero's type, without the object. */
.notfound {
  width: min(100%, calc(var(--content) + 2 * var(--gutter)));
  margin-inline: auto;
  padding: var(--s-10) max(var(--gutter), env(safe-area-inset-right)) var(--s-10) max(var(--gutter), env(safe-area-inset-left));
  min-height: calc(100svh - var(--nav-h) - 160px);
}
.notfound h1 { max-width: 12em; }

/* Sections enter on a spring as they scroll in (js/main.js). They start
   hidden only where scripts run; if the script never starts (it marks the
   page .is-live), they show themselves after 2.5 s. */
@media (scripting: enabled) {
  [data-reveal] { opacity: 0; transform: translate3d(0, 16px, 0); animation: reveal-fallback 0.4s ease-out 2.5s forwards; }
  .cpu-bar { transform: scaleX(0); animation: reveal-fallback 0.4s ease-out 2.5s forwards; }
  .is-live [data-reveal], .is-live .cpu-bar { animation: none; }
}
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

/* Mobile dock (iOS-style), shown once the hero's Download scrolls away. */
.dock { display: none; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1180px) {
  :root { --gutter: 48px; }
  .hero { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); column-gap: var(--s-6); }
}
/* Stacked: headline, line, the object, then the download (as in the Paper 3a mobile). */
@media (max-width: 960px) {
  :root { --gutter: 32px; --nav-h: 72px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "lede" "object" "download";
    align-content: start;
    min-height: 0; padding-top: var(--s-2);
  }
  .hero-copy { display: contents; }
  h1 { grid-area: title; }
  .lede { grid-area: lede; }
  .hero-object { margin-top: var(--s-5); }
  .download { grid-area: download; margin-top: var(--s-5); }
  .stage { width: min(100%, 640px, calc(48svh * var(--sw) / var(--sh))); }
}
@media (max-width: 720px) {
  :root { --gutter: 20px; --nav-h: 56px; --section: var(--s-8); }
  body { font-size: 15px; }
  .brand { min-height: 44px; }
  .brand-name { font-size: 16px; }
  .nav-link span { display: none; }
  .nav-link { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; margin-right: calc(-1 * var(--s-3)); }
  .nav-link svg { width: 20px; height: 20px; }
  h1 { font-size: clamp(29px, 9.4vw, 44px); line-height: 1.04; letter-spacing: -0.03em; }
  .lede { font-size: 16px; line-height: 1.5; margin-top: var(--s-3); }
  /* The object runs edge to edge. */
  .hero-object { margin: var(--s-4) calc(-1 * var(--gutter)) 0; }
  .stage { --sw: 640; --sh: 540; width: min(100vw, calc(46svh * var(--sw) / var(--sh))); }
  .download { align-items: stretch; margin-top: var(--s-4); gap: var(--s-3); }
  .btn-download { display: block; border-radius: 14px; }
  .btn-face { justify-content: center; height: 54px; border-radius: 14px; font-size: 16px; }
  .meta { text-align: center; }

  .flow { flex-direction: column; padding: var(--s-6) var(--s-4); }
  .flow-sources { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
  .flow-sources .chip { width: auto; height: 36px; padding: 0 var(--s-3); gap: var(--s-2); font-size: 13.5px; }
  .flow-in, .flow-out { display: none; }
  .flow-hub { margin: var(--s-5) 0; }
  .flow-hub::before, .flow-hub::after { content: ""; position: absolute; left: 50%; width: 1px; height: var(--s-5); background: #3a3836; }
  .flow-hub::before { bottom: 100%; }
  .flow-hub::after { top: 100%; }
  .flow-files { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); width: 100%; }
  .chip-file { width: auto; height: 40px; font-size: 13.5px; }

  .facts { flex-direction: column; align-items: stretch; gap: var(--s-6); width: auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
  .points li { font-size: 15.5px; line-height: 24px; }
  .cpu { width: auto; }
  .foot { flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .foot-brand, .foot-link { min-height: 44px; }

  .dock {
    display: block; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 0 max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    pointer-events: none;
    transform: translate3d(0, 120%, 0);
  }
  .dock-inner {
    display: flex; align-items: center; gap: var(--s-3); height: 64px; padding: 0 var(--s-3) 0 14px; border-radius: 20px;
    background: rgb(28 28 30 / 0.72);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    box-shadow: inset 0 0.5px 0 rgb(255 255 255 / 0.18), 0 0 0 0.5px rgb(0 0 0 / 0.8), 0 12px 32px rgb(10 6 3 / 0.55);
    pointer-events: auto;
  }
  .dock-inner img { border-radius: 8px; }
  .dock-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 18px; }
  .dock-text strong { font-size: 15px; font-weight: 600; font-stretch: 112.5%; }
  .dock-text span { font-size: 12.5px; color: var(--ink-3); }
  .dock-get {
    position: relative;
    height: 34px; padding: 0 var(--s-4); border-radius: 17px; display: grid; place-items: center;
    background: linear-gradient(180deg, #faf7f1, #e9e4db); color: #141210; font-size: 14px; font-weight: 650;
    box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgb(0 0 0 / 0.6), 0 1.5px 0 #a39d92;
    transition: transform 120ms var(--press);
    user-select: none; -webkit-user-select: none;
  }
  .dock-get::after { content: ""; position: absolute; inset: -5px -6px; } /* 44px hit area */
  .dock-get:active { transform: scale(0.96); }
}
@media (max-width: 360px) {
  .brand-name { font-size: 15px; }
}
@media (max-width: 340px) {
  h1 { font-size: 28px; }
}
/* Short phones (SE class): a smaller object keeps Download in the first screen. */
@media (max-width: 720px) and (max-height: 600px) {
  .stage { width: min(100vw, calc(38svh * var(--sw) / var(--sh))); }
  .lede { font-size: 15px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* Landscape phones: side by side, compact. */
  :root { --nav-h: 52px; }
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "copy object";
    align-content: center; min-height: calc(100svh - var(--nav-h)); padding-top: 0; padding-bottom: var(--s-4);
  }
  .hero-copy { display: block; }
  .hero-object { margin: 0; }
  h1 { font-size: clamp(26px, 3.8vw, 34px); }
  .download { margin-top: var(--s-5); }
  .stage { width: min(100%, calc((100svh - var(--nav-h) - 56px) * var(--sw) / var(--sh))); }
  .dock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .cpu-bar { opacity: 1; transform: none; animation: none; }
  .btn-arrow { transition: none; }
}
