/* 4DSynth project page */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-var.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic-var.woff") format("woff");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plexmono-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plexmono-500.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plexmono-600.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ee;
  --paper-2: #edeae2;
  --panel: #fcfbf8;
  --ink: #171512;
  --ink-2: #4a463f;
  --ink-3: #7c776b;
  --line: #e1dcd1;
  --line-2: #cbc5b6;
  --accent: #0d5e51;
  --accent-ink: #0a4a41;
  --accent-soft: #e3eeea;
  --actor: #d9642a;
  --cam: #2b6cb0;
  --glass: rgba(20, 24, 26, 0.78);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --w: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 420;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(13, 94, 81, 0.4); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(13, 94, 81, 0.16); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 560; }
em { font-style: italic; }
figure { margin: 0; }
table { border-collapse: collapse; }
q { quotes: "“" "”"; font-style: italic; }

.wrap { width: min(var(--w), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 90;
  padding: 8px 14px; border-radius: 6px;
  background: var(--ink); color: var(--paper); text-decoration: none;
  font-family: var(--mono); font-size: 0.8rem;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

.label, .spec, .eyebrow, .slate, .legend, .readout, .hud, .keys button, .demo-help, .demo-reset, .table, .bibtex, .stats dd, .stages {
  font-family: var(--mono);
}
.label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.spec { margin: 0; color: var(--ink-3); font-size: 0.7rem; line-height: 1.55; letter-spacing: 0.02em; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 244, 238, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  display: flex; align-items: center; gap: 20px;
  width: min(var(--w), 100% - 2 * var(--gutter));
  margin-inline: auto;
  min-height: 54px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--mono); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.brand img { width: 22px; height: 22px; }
.top-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.top-nav a {
  padding: 7px 10px; border-radius: 5px;
  color: var(--ink-2); text-decoration: none;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.top-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.top-actions { display: flex; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 40px; padding: 0 17px; border-radius: 7px;
  border: 1px solid var(--line-2);
  color: var(--ink); background: var(--panel);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 0.66rem; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- hero ---------- */
.hero { padding: clamp(28px, 4vw, 48px) 0 0; }
.eyebrow {
  margin: 0 0 16px;
  display: flex; flex-wrap: wrap; gap: 6px 0;
  color: var(--ink-3); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.eyebrow > * + *::before { content: "·"; margin: 0 10px; color: var(--line-2); }
.eyebrow a { color: var(--accent-ink); text-decoration: none; }
.hero h1 { margin: 0; font-weight: 400; letter-spacing: -0.025em; line-height: 1; text-wrap: balance; }
.t-name { display: block; font-size: clamp(3rem, 6.6vw, 4.8rem); font-weight: 480; }
.t-sub {
  display: block; margin-top: 0.3rem;
  font-size: clamp(1.3rem, 2.7vw, 1.95rem); font-style: italic; font-weight: 400;
  line-height: 1.12; letter-spacing: -0.015em;
  color: var(--ink-2);
  max-width: 34ch;
}
.claim { margin: 18px 0 0; max-width: 64ch; font-size: 1.08rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.hero .actions { margin-top: 20px; }

.teaser { margin-top: clamp(26px, 3.6vw, 40px); }
.teaser .pan { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px; }
.teaser figcaption { margin-top: 10px; }

/* ---------- figures ---------- */
figcaption { color: var(--ink-2); font-size: 0.9rem; line-height: 1.45; text-wrap: pretty; }
figcaption b { color: var(--ink); font-weight: 560; }
figcaption b:first-child::after { content: " "; }
.fig > .pan, .fig > img, .fig > .film { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.fig > .pan { background: #fff; padding: 10px; }
.fig figcaption { margin-top: 9px; max-width: 96ch; }
.pan { overflow: hidden; }
.pan img, .zoom { display: block; width: 100%; }
.zoom img { cursor: zoom-in; }
.pan-hint { display: none; color: var(--ink-3); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; }

.film { position: relative; aspect-ratio: 16 / 9; background: var(--paper-2); overflow: hidden; }
.film .film-poster, .film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film video { opacity: 0; transition: opacity 400ms ease; }
.film.film-live video { opacity: 1; }
.film.film-failed video { display: none; }
.film-alt {
  display: none;
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  padding: 7px 12px; border-radius: 6px;
  background: rgba(252, 251, 248, 0.94); border: 1px solid var(--line-2);
  color: var(--ink-2); font-family: var(--mono); font-size: 0.68rem; text-decoration: none;
}
.film.film-failed .film-alt { display: inline-block; }

/* ---------- sections ---------- */
.sec { padding: clamp(40px, 4.6vw, 64px) 0 0; }
.sec-last { padding-bottom: clamp(40px, 4.6vw, 64px); }
.sec-head { margin-bottom: clamp(16px, 2.2vw, 24px); }
.sec h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 440;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  max-width: 30ch;
}
.sec h2.h-small { font-size: clamp(1.3rem, 2.2vw, 1.65rem); max-width: 32ch; }
.lede { margin: 0; max-width: 78ch; color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; text-wrap: pretty; }

/* overview */
.grid-abs {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.abs { margin: 0; font-size: 1.02rem; line-height: 1.55; text-wrap: pretty; }
.contrib { margin: 0; padding: 0; list-style: none; counter-reset: c; }
.contrib li {
  position: relative;
  padding: 10px 0 10px 34px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.9rem; line-height: 1.45;
}
.contrib li:last-child { border-bottom: 1px solid var(--line); }
.contrib li::before {
  counter-increment: c;
  content: "0" counter(c);
  position: absolute; left: 0; top: 13px;
  color: var(--accent); font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em;
}
.contrib li b { color: var(--ink); font-weight: 560; }
.fig-pipeline { margin-top: clamp(20px, 2.6vw, 30px); }
.stages {
  margin: 10px 0 0; padding: 0; list-style: none; counter-reset: s;
  display: flex; flex-wrap: wrap; gap: 4px 0;
  color: var(--ink-3); font-size: 0.68rem; line-height: 1.5; letter-spacing: 0.01em;
}
.stages li { padding-right: 14px; }
.stages li + li { padding-left: 14px; border-left: 1px solid var(--line-2); }
.stages li b { color: var(--ink); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.stages li b::before { counter-increment: s; content: counter(s) " "; color: var(--accent); }

/* results: four conditions */
.cond-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.cond { position: relative; min-width: 0; }
.cond-out {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
}
.cond-out > img { width: 100%; height: auto; }
.cond-in {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  width: 37%;
  padding: 8px 10px 9px;
  border: 1px solid rgba(23, 21, 18, 0.14); border-radius: 5px;
  background: rgba(252, 251, 248, 0.96);
  box-shadow: 0 6px 22px rgba(23, 21, 18, 0.14);
}
.cond-in .spec { margin-bottom: 5px; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.cond-in-text p:last-child { margin: 0; font-size: 0.78rem; line-height: 1.4; font-style: italic; color: var(--ink); text-wrap: pretty; }
.cond-in-doc { width: 29%; background: #fbfaf6; }
.cond-in-doc img, .cond-in-photo img { width: 100%; height: auto; border-radius: 3px; }
.cond-in-photo { width: 36%; }
.cond figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-top: 8px; }
.cond figcaption b { font-size: 1rem; font-weight: 540; color: var(--ink); }
.cond figcaption span { color: var(--ink-3); font-family: var(--mono); font-size: 0.66rem; line-height: 1.5; letter-spacing: 0.02em; }

/* modules (theater, demo) */
.module {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.slate {
  margin: 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px 18px; flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.64rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
}
.slate > span + span { color: var(--ink-3); letter-spacing: 0.06em; }
.slate b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.module-note { padding: 10px 12px 12px; color: var(--ink-2); font-size: 0.88rem; line-height: 1.45; text-wrap: pretty; }
.module-note > b:first-child { color: var(--ink); font-weight: 560; }
.module-note b[data-drive-scale], .module-note b[data-drive-room-count] { color: var(--ink); font-weight: 560; font-family: var(--mono); font-size: 0.8em; }

/* theater */
.theater { margin-top: 22px; }
.theater-grid {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 10px; padding: 10px; align-items: stretch;
}
.theater-grid > * { min-width: 0; }
.theater-grid .film { border: 1px solid var(--line); border-radius: var(--radius); }
.map {
  display: grid; grid-template-rows: auto 1fr auto; gap: 6px;
  padding: 9px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfaf6;
}
.legend { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-3); font-size: 0.62rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.k-free { background: #d8e6dc; }
.k-obj { background: #e3ded2; border: 1px solid var(--line-2); }
.k-actor { background: var(--actor); }
.k-cam { background: var(--cam); }
.map canvas { width: 100%; height: 100%; min-height: 200px; border-radius: 4px; touch-action: none; cursor: crosshair; }
.readout { margin: 0; color: var(--ink-2); font-size: 0.64rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout b { color: var(--actor); font-weight: 500; }
.readout i { color: var(--cam); font-style: normal; }
.strip {
  position: relative; margin: 0 10px 10px;
  aspect-ratio: 1536 / 72; min-height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: url("assets/filmstrip.webp") 0 0 / 100% 100% no-repeat var(--paper-2);
  cursor: ew-resize; touch-action: none; overflow: hidden;
}
.strip-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--actor); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); pointer-events: none; z-index: 2; }
.theater .module-note { border-top: 1px solid var(--line); }

/* figure 7 rows */
.fourd { margin-top: 20px; display: grid; gap: 8px; }
.fourd-row { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 8px; }
.fourd-row > div { min-width: 0; display: grid; gap: 4px; align-content: start; }
.fourd-row img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-2); }
.fourd span { color: var(--ink-3); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }
.fourd figcaption { margin-top: 4px; max-width: 96ch; }

/* executable world board */
.board { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.proofs { display: grid; gap: 18px; }
.cap-thumb { display: flex; gap: 10px; align-items: flex-start; }
.cap-thumb img { flex: 0 0 76px; width: 76px; border: 1px solid var(--line); border-radius: 4px; }
.cap-thumb span { min-width: 0; }

.demo-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-2);
  isolation: isolate;
}
.demo-stage > canvas[data-drive-canvas] { position: absolute; inset: 0; width: 100%; height: 100%; outline: none; }
.demo-stage > canvas[data-drive-canvas]:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.demo-cover { position: absolute; inset: 0; z-index: 5; background: var(--paper-2); }
.demo-cover img { width: 100%; height: 100%; object-fit: cover; }
.hud {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center;
  max-width: calc(100% - 200px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 7px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: #d8dcd6; font-size: 0.62rem; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none;
}
.drive-live .hud { opacity: 1; }
.hud b { color: #fff; font-weight: 500; }
.hud-dot { width: 7px; height: 7px; border-radius: 50%; background: #46d4b9; box-shadow: 0 0 8px rgba(70, 212, 185, 0.7); }
.demo-stage canvas.mini {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 160px; height: 135px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 7px;
  background: rgba(16, 23, 21, 0.9);
}
.demo-reset {
  position: absolute; top: 152px; right: 10px; z-index: 3;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 6px;
  background: var(--glass); color: #d8dcd6;
  font-size: 0.62rem; cursor: pointer;
}
.demo-reset:hover, .demo-reset:focus-visible { color: #fff; border-color: #fff; }
.keys { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: grid; grid-template-columns: repeat(3, 42px); gap: 5px; }
.keys button {
  width: 42px; height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px;
  background: var(--glass); color: #fff;
  font-size: 0.72rem; font-weight: 500;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.keys button:hover, .keys button:focus-visible, .keys button.is-active { border-color: #46d4b9; color: #46d4b9; background: rgba(24, 58, 48, 0.92); }
.keys .key-blank { visibility: hidden; }
.demo-help {
  position: absolute; left: 10px; bottom: 12px; z-index: 3; margin: 0;
  padding: 6px 9px; border-radius: 6px;
  background: rgba(20, 24, 26, 0.7); color: #c9cfc9;
  font-size: 0.6rem; letter-spacing: 0.04em;
  opacity: 0; pointer-events: none;
}
.drive-live .demo-help { opacity: 1; }
.demo-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 10px 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.drive-live .demo-bar [data-drive-start] { display: none; }
.demo-bar .spec { flex: 1 1 240px; }
.drive-error { color: #a13d1c; }

/* benchmark */
.bench-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.75fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; border-top: 1px solid var(--line); }
.stats > div { padding-top: 10px; }
.stats dt { margin: 0 0 3px; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 400; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats dd { margin: 0; color: var(--ink-3); font-size: 0.62rem; line-height: 1.45; letter-spacing: 0.03em; }
.table-cap { margin: 0 0 6px; color: var(--ink-2); font-size: 0.86rem; line-height: 1.45; text-wrap: pretty; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-x: auto; }
.table { width: 100%; font-size: 0.72rem; }
.table th, .table td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { text-align: left; }
.table thead th { color: var(--ink-3); font-size: 0.6rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.table tbody th { color: var(--ink); font-weight: 500; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.bench-note { margin: 14px 0 0; max-width: 72ch; color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; text-wrap: pretty; }
.bench-fig img { width: 100%; }

/* paper */
.grid-cite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.grid-cite .actions { margin-top: 16px; }
.fine { margin: 16px 0 0; max-width: 62ch; color: var(--ink-3); font-size: 0.86rem; line-height: 1.45; text-wrap: pretty; }
.bibtex {
  margin: 0; overflow-x: auto;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink-2);
  font-size: 0.7rem; line-height: 1.6;
}
.foot { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--ink-3); font-size: 0.86rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.foot a { color: var(--ink-2); font-family: var(--mono); font-size: 0.7rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .proofs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench-grid { grid-template-columns: minmax(0, 1fr); }
  .bench-fig { max-width: 520px; }
}
@media (max-width: 900px) {
  .top-nav { display: none; }
  .grid-abs, .grid-cite, .theater-grid, .cond-grid, .proofs { grid-template-columns: minmax(0, 1fr); }
  .map canvas { min-height: 250px; }
  .hud { max-width: calc(100% - 24px); }
}
@media (max-width: 720px) {
  .pan { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .pan .zoom, .pan img { width: 940px; max-width: none; }
  .pan-hint { display: inline; }
  .fourd-row { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 6px; }
  .fourd-row > div { flex: 0 0 168px; }
  .fourd-row > .fourd-over { flex-basis: 236px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  html { scroll-padding-top: 62px; }
  .top-in { min-height: 50px; gap: 12px; }
  .brand span { display: none; }
  .top-actions { margin-left: auto; }
  .hero { padding-top: 24px; }
  .t-sub { max-width: none; }
  .claim { font-size: 1.02rem; }
  .btn { min-height: 38px; padding: 0 14px; }
  .teaser .pan, .fig > .pan { padding: 6px; }
  .stages { display: grid; grid-template-columns: 1fr; gap: 0; }
  .stages li { padding: 6px 0; border-top: 1px solid var(--line); }
  .stages li + li { padding-left: 0; border-left: 0; }
  .cond { display: grid; }
  .cond-in { position: static; width: auto; order: -1; margin-bottom: 8px; box-shadow: none; }
  .cond-in-photo { width: 58%; }
  .cond-in-doc { width: 46%; }
  .theater-grid { padding: 8px; gap: 8px; }
  .strip { margin: 0 8px 8px; aspect-ratio: auto; height: 40px; background-size: cover; background-position: center; }
  .readout { white-space: normal; overflow: visible; }
  .drive-live .demo-stage { aspect-ratio: 3 / 4; }
  .hud { top: 10px; left: 10px; right: 10px; max-width: none; }
  .demo-stage canvas.mini { display: none; }
  .demo-reset { top: 60px; right: 10px; }
  .keys { right: 10px; bottom: 10px; grid-template-columns: repeat(3, 48px); }
  .keys button { width: 48px; height: 48px; }
  .demo-help { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot .wrap { flex-direction: column; }
}
@media (max-width: 420px) {
  .hero .btn-ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film video { transition: none; }
  .btn { transition: none; }
}
