/* Science in 8bit — home, variant A: the wall of screens
   Direction: The well-kept board (dense tiles). Colours sampled from the films:
   night sky ground, caption-box navy, caption yellow as the one accent. */

:root {
  color-scheme: dark;
  --bg: #0a0f26;          /* the night sky behind the owl and the three stars */
  --surface: #151c3f;     /* the caption-box navy */
  --surface-2: #1f2858;
  --ink: #eef1f8;         /* caption white */
  --muted: #b0b6cf;
  --accent: #ffc94a;      /* caption yellow: the action, and the cell that holds it */
  --accent-ink: #0a0f26;
  --accent-strong: #ffd877;

  /* topic fields, taken from the films themselves */
  --space: #2f55b8;       --space-ink: #eef1f8;
  --kitchen: #e5662d;     --kitchen-ink: #0a0f26;
  --animals: #356e34;     --animals-ink: #eef1f8;
  --chem: #a8ef4c;        --chem-ink: #0a0f26;

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.5rem, 1rem + 6.2vw, 7.25rem);

  --margin: 12px;
  --gap: 8px;
  --section: clamp(7.5rem, 11vw, 12rem);
  --radius: 0px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 500; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cell--text :focus-visible { outline-color: var(--accent-ink); }
:target { scroll-margin-top: 24px; }

.skip { position: absolute; left: 12px; top: 12px; z-index: 50; background: var(--accent-ink); color: var(--ink); padding: 10px 14px; text-decoration: none; }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.h2 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.045em; }

/* ---------- controls ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.4rem; border-radius: var(--radius); text-decoration: none; font-weight: 500; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button--ink { background: var(--accent-ink); color: var(--ink); }
.button--cream { background: var(--ink); color: var(--accent-ink); }
.button--small { min-height: 2.75rem; padding: 0 1rem; background: var(--surface-2); color: var(--ink); }
.link { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .button--ink:hover { background: var(--surface-2); }
  .button--cream:hover { background: var(--accent); }
  .button--small:hover { background: var(--accent); color: var(--accent-ink); }
  .link:hover { text-decoration-color: currentColor; }
}

/* =========================================================
   THE WALL
   ========================================================= */
.wall { position: relative; padding: var(--margin); display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap); }
.wall > .cell--text, .wall > .cell--ctrl { grid-column: 1 / -1; }
.js .wall > .cell--ctrl { display: none; }
.js .wall.is-laid > .cell--ctrl { display: flex; }

.wall.is-laid { display: block; overflow: hidden; padding: 0; }
.wall.is-laid > * { position: absolute; top: 0; left: 0; }
.wall.is-moving > * { transition: transform 820ms var(--ease-in-out); }

.cell { background: var(--surface); padding: 22px 22px 20px; display: flex; flex-direction: column; }

/* the text cell: the films' caption yellow */
.cell--text { background: var(--accent); color: var(--accent-ink); gap: 18px; padding: 24px; }
.name { font-size: var(--step-display); line-height: 0.88; letter-spacing: -0.055em; margin-left: -0.04em; }
.cell__line { font-size: var(--step-body); line-height: 1.42; max-width: 36ch; }
.cell--text .button { align-self: flex-start; }
.cell__links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--step-small); font-weight: 500; margin-top: auto; }
.cell__links .link { text-decoration-color: currentColor; padding-block: 6px; }

/* the sort and topic controls */
.cell--ctrl { gap: 14px; padding: 18px 20px 20px; }
.ctrl__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ctrl__label { font-size: var(--step-small); color: var(--muted); width: 100%; flex: none; }
.chip { min-height: 2.5rem; padding: 0 0.85rem; background: var(--surface-2); color: var(--ink); font-size: var(--step-small); font-weight: 500; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .chip[aria-pressed="false"]:hover { background: #2c3878; } }
.ctrl__note { font-size: var(--step-body); line-height: 1.4; color: var(--ink); }

/* figure cells, like the counters inside the films */
.cell--fig { justify-content: flex-start; gap: 12px; padding: 22px 18px 24px; }
.cell--pic { padding: 0; overflow: hidden; position: relative; }
.cell--pic[data-slot="badge"] { background: var(--space); padding: 18px; }
.cell--pic[data-slot="badge"] img { width: 72%; height: auto; image-rendering: pixelated; }
.cell--still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 56%; }
.cell--cream { background: var(--ink); color: var(--accent-ink); }
.fig { font-size: var(--step-display); line-height: 0.85; letter-spacing: -0.06em; font-weight: 500; font-variant-numeric: tabular-nums; margin-left: -0.04em; }
.fig--col { font-size: var(--step-head); }
.fig__cap { font-size: var(--step-body); line-height: 1.35; max-width: 24ch; }
.cell--cream .fig__cap { max-width: 40ch; }
.cell--fig:not(.cell--cream) .fig__cap { color: var(--ink); }

/* film tiles */
.tile { display: block; text-decoration: none; color: var(--ink); background: var(--surface); }
.tile__media { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: var(--surface); }
.tile__media img, .tile__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-soft), opacity 400ms ease; }
.tile__media video { opacity: 0; }
.tile__media video.is-on { opacity: 1; }
.tile__strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 10px; min-height: 52px; padding: 8px 10px 9px; font-size: var(--step-small); line-height: 1.3; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.tile__title { font-weight: 500; }
.tile__metric { font-variant-numeric: tabular-nums; }
.tile[data-topic="space"] .tile__strip { background: var(--space); color: var(--space-ink); }
.tile[data-topic="around"] .tile__strip { background: var(--kitchen); color: var(--kitchen-ink); }
.tile[data-topic="body"] .tile__strip { background: var(--chem); color: var(--chem-ink); }
.tile:active .tile__media img, .tile:active .tile__media video { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile__media img, .tile:hover .tile__media video { transform: scale(1.04); }
  .tile:hover .tile__strip { background: var(--ink); color: var(--accent-ink); }
}
.tile.is-dim .tile__media img, .tile.is-dim .tile__media video { opacity: 0.18; }
.tile.is-dim .tile__media video.is-on { opacity: 0.18; }

/* =========================================================
   THE NUMBERS — stepped figure tiles, then the ledger
   ========================================================= */
.numbers { padding: var(--section) var(--margin) 0; }
.steps { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.step { display: flex; flex-direction: column; justify-content: space-between; padding: 28px; gap: 24px; }
.step__fig { font-size: var(--step-display); line-height: 0.85; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; font-weight: 500; margin-left: -0.04em; }
.step__cap { font-size: var(--step-body); max-width: 30ch; }
.step--a { grid-column: 1 / 7; grid-row: 1 / 3; height: 70vh; min-height: 520px; background: var(--accent); color: var(--accent-ink); }
.steps__head { grid-column: 7 / 13; grid-row: 1; padding: 6px 0 0 4px; display: flex; flex-direction: column; gap: 14px; min-height: 22vh; }
.steps__note { font-size: var(--step-body); max-width: 40ch; }
.step--b { grid-column: 7 / 10; grid-row: 2; height: 44vh; min-height: 300px; background: var(--ink); color: var(--accent-ink); }
.step--c { grid-column: 10 / 13; grid-row: 2; margin-top: 12vh; height: 34vh; min-height: 260px; background: var(--space); color: var(--space-ink); }
.step--b .step__fig, .step--c .step__fig { font-size: var(--step-head); }
.step--b .step__cap, .step--c .step__cap { font-size: var(--step-body); line-height: 1.35; }

.ledger { margin-top: clamp(4rem, 8vw, 7rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.ledger__h { grid-column: 1 / 4; font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; padding: 14px 0 0 4px; }
.ledger__scroll { grid-column: 4 / 13; }
.ledger__foot { grid-column: 4 / 13; font-size: var(--step-small); color: var(--muted); padding-top: 6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-variant-numeric: tabular-nums; }
thead th { font-size: var(--step-small); font-weight: 400; color: var(--muted); text-align: right; padding: 0 14px 6px; }
thead th:first-child { text-align: left; }
tbody tr { background: var(--surface); }
tbody th, tbody td { padding: 14px; text-align: right; }
tbody th { text-align: left; font-weight: 500; }
tbody th button { text-align: left; text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { tbody th button:hover { color: var(--accent); text-decoration-color: currentColor; } }
td.na { color: var(--muted); }
.ledger__aside { display: block; font-size: var(--step-small); color: var(--muted); }
td.ledger__new { text-align: left; color: var(--muted); }

/* =========================================================
   WHY WE MAKE THEM
   ========================================================= */
.why { margin-top: var(--section); padding: clamp(4.5rem, 8vw, 8rem) var(--margin); background: var(--ink); color: var(--accent-ink); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 16px; align-items: start; }
.why__head { grid-column: 1 / 6; padding-left: 4px; display: flex; flex-direction: column; gap: 24px; }
.why__lead { font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; }
.why__list { grid-column: 7 / 13; display: grid; grid-template-columns: 1fr 1fr; gap: 44px 28px; padding-top: 10px; }
.why__list dt { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; font-weight: 500; }
.why__list dd { margin: 10px 0 0; font-size: var(--step-body); line-height: 1.5; max-width: 34ch; }

/* =========================================================
   HOW THEY'RE MADE
   ========================================================= */
.made { padding: var(--section) var(--margin) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap) 16px; }
.made > .h2 { grid-column: 1 / 9; padding-left: 4px; }
.made__lead { grid-column: 1 / 7; font-size: var(--step-lead); line-height: 1.35; max-width: 38ch; padding-left: 4px; margin-top: 16px; }
.made__board { grid-column: 1 / -1; margin-top: 72px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.made__pic { grid-column: 1 / 9; grid-row: 1 / 3; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.made__pic video, .made__pic .made__still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; image-rendering: pixelated; }
.made__pic video { z-index: 1; opacity: 0; transition: opacity 500ms ease; }
.made__pic video.is-on { opacity: 1; }
.made__over { position: absolute; z-index: 2; top: 0; right: 0; width: 330px; padding: 20px; background: var(--ink); color: var(--accent-ink); font-size: var(--step-body); line-height: 1.45; }
.made__mark { grid-column: 9 / 13; grid-row: 1; aspect-ratio: 4 / 3; background: var(--space); display: flex; align-items: flex-start; padding: 24px; overflow: hidden; }
.made__mark img { width: 58%; height: auto; image-rendering: pixelated; }
.made__steps { grid-column: 9 / 13; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; padding: 8px 4px 0; }
.made__steps dt { font-weight: 500; font-size: var(--step-body); }
.made__team { display: block; font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; }
.made__steps dd { font-size: var(--step-body); line-height: 1.45; margin-top: 4px; color: var(--ink); }

/* =========================================================
   THE GUIDE AS A SHELF
   ========================================================= */
.guide { padding: var(--section) var(--margin) 0; }
.guide__top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap) 16px; align-items: start; margin-bottom: 40px; }
.guide__top .h2 { grid-column: 1 / 6; padding-left: 4px; }
.guide__note { grid-column: 7 / 13; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; max-width: 60ch; }
.guide__price { font-weight: 500; }
.shelf { display: flex; gap: 6px; height: 440px; }
.shelf li { flex: 1 1 0; min-width: 0; }
.spine { writing-mode: vertical-rl; display: flex; height: 100%; width: 100%; gap: 14px; padding: 18px 0 0; text-decoration: none; background: var(--surface); color: var(--ink); transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-ui) var(--ease-out); }
.spine__name { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; line-height: 1; padding-inline: 0; }
.spine__text { font-size: var(--step-small); line-height: 1.3; color: var(--muted); transition: color var(--t-hover) ease; flex: 0 1 auto; min-inline-size: 0; overflow: hidden; }
.spine__part { margin-top: auto; padding: 14px 0; font-size: var(--step-small); font-weight: 500; text-align: center; width: 100%; writing-mode: horizontal-tb; }
.spine { align-items: center; }
.spine--setup .spine__part { background: var(--space); color: var(--space-ink); }
.spine--make .spine__part { background: var(--kitchen); color: var(--kitchen-ink); }
.spine--ship .spine__part { background: var(--chem); color: var(--chem-ink); }
.spine--extra .spine__part { background: var(--animals); color: var(--animals-ink); }
.spine:active { transform: translateY(2px); }
.spine:focus-visible, .spine:hover { background: var(--ink); color: var(--accent-ink); }
.spine:focus-visible .spine__text, .spine:hover .spine__text { color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .spine:hover { transform: translateY(-8px); } }

/* =========================================================
   THE ACTION ROW
   ========================================================= */
.act { margin-top: var(--section); display: grid; grid-template-columns: 2fr 8fr 2fr; gap: 10px; height: 380px; }
.act__side { overflow: hidden; height: 100%; }
.act__side--pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.act__side--field { background: var(--kitchen); }
.act__main { background: var(--accent); color: var(--accent-ink); padding: 40px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; }
.act__main p { max-width: 46ch; }

/* =========================================================
   FOOTER — the name, built from blocks
   ========================================================= */
.foot { padding: var(--section) var(--margin) 24px; }
.blocks { display: flex; gap: 4px 16px; align-items: flex-end; height: 34svh; min-height: 220px; }
.blocks__word { display: flex; gap: 4px; align-items: flex-end; height: 100%; flex: var(--n, 1) 1 0; }
.blocks__word:nth-child(1) { --n: 7; }
.blocks__word:nth-child(2) { --n: 2; }
.blocks__word:nth-child(3) { --n: 4; }
.blocks__word > span { flex: 1 1 0; height: calc(var(--h) * 100%); display: flex; align-items: flex-end; padding: 0 0 6px 8px; font-size: var(--step-display); line-height: 0.8; letter-spacing: -0.04em; font-weight: 500; color: var(--bg); overflow: hidden; }
.blocks__word > span:nth-child(5n + 1) { background: var(--accent); }
.blocks__word > span:nth-child(5n + 2) { background: var(--ink); }
.blocks__word > span:nth-child(5n + 3) { background: var(--kitchen); }
.blocks__word > span:nth-child(5n + 4) { background: var(--chem); }
.blocks__word > span:nth-child(5n + 5) { background: #6f8fe6; }
.foot__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 56px; font-size: var(--step-body); }
.foot__links { grid-column: 1 / 9; columns: 2; column-gap: 16px; }
.foot__contact { grid-column: 9 / 13; }
.foot__links li, .foot__contact li { padding-block: 4px; }
.foot__last { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; font-size: var(--step-small); color: var(--muted); }

/* =========================================================
   THE THEATRE
   ========================================================= */
.theatre { /* taste-skill-ignore: a dialog floats above the page */ padding: 0; border: 0; background: var(--surface); color: var(--ink); width: min(1180px, calc(100vw - 24px)); max-width: none; max-height: calc(100svh - 24px); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.theatre::backdrop { background: rgba(4, 6, 18, 0.86); }
.theatre__box { display: grid; grid-template-columns: auto 1fr; max-height: calc(100svh - 24px); }
.theatre__screen { background: #000; height: calc(100svh - 24px); max-height: 960px; aspect-ratio: 9 / 16; }
.theatre__screen video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.theatre__info { overflow-y: auto; padding: 18px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.theatre__bar { display: flex; gap: 6px; flex-wrap: wrap; }
.tbtn { min-height: 2.75rem; padding: 0 1rem; background: var(--surface-2); font-size: var(--step-small); font-weight: 500; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.tbtn:active { transform: scale(0.96); }
.tbtn--close { margin-left: auto; background: var(--ink); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .tbtn:hover { background: var(--accent); color: var(--accent-ink); } }
.theatre__title { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.045em; }
.theatre__hook { font-size: var(--step-lead); line-height: 1.3; max-width: 30ch; color: var(--accent); }
.theatre__stats { display: flex; flex-wrap: wrap; gap: 6px; }
.theatre__stats div { background: var(--surface-2); padding: 10px 14px; }
.theatre__stats dt { font-size: var(--step-small); color: var(--muted); }
.theatre__stats dd { font-size: var(--step-lead); font-weight: 500; font-variant-numeric: tabular-nums; }
.th-h { font-size: var(--step-body); font-weight: 500; margin-bottom: 8px; }
.beats { display: grid; gap: 4px; }
.beats li { background: var(--bg); padding: 12px 14px; display: grid; gap: 2px; }
.beats strong { font-size: var(--step-body); }
.beats span { font-size: var(--step-small); color: var(--muted); }
.facts li { font-size: var(--step-small); padding: 4px 0; }
@media (prefers-reduced-motion: no-preference) {
  .theatre[open] { animation: th-in 340ms var(--ease-out); }
  @keyframes th-in { from { opacity: 0; transform: scale(0.97) translateY(8px); } }
}

/* =========================================================
   MOTION (content stays visible without script)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  /* signature: the wall opens screen by screen, like shutters */
  .js .wall.is-laid .tile .tile__media { clip-path: inset(0 0 100% 0); animation: shutter 1100ms var(--ease-in-out) forwards; animation-delay: var(--d, 0ms); }
  .js .wall.is-laid .tile .tile__media img { animation: settle 1500ms var(--ease-soft) both; animation-delay: var(--d, 0ms); }
  .js .wall.is-laid .tile .tile__strip { opacity: 0; animation: fade-in 500ms ease forwards; animation-delay: calc(var(--d, 0ms) + 600ms); }
  .js .wall.is-laid .cell { opacity: 0; animation: cell-in 800ms var(--ease-out) forwards; animation-delay: var(--d, 0ms); }
  .js .wall.is-laid .cell--text > * { opacity: 0; animation: rise 700ms var(--ease-out) forwards; animation-delay: calc(var(--d, 0ms) + 200ms + var(--i, 0) * 80ms); }

  .js [data-reveal] { opacity: 0; translate: 0 26px; transition: opacity 700ms var(--ease-out), translate 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; translate: 0 0; }
  .js .shutter[data-reveal] { opacity: 1; translate: none; clip-path: inset(0 0 100% 0); transition: clip-path 1100ms var(--ease-in-out); }
  .js .shutter[data-reveal] .made__still, .js .shutter[data-reveal] video { scale: 1.12; transition: scale 1500ms var(--ease-soft), opacity 500ms ease; }
  .js .shutter[data-reveal].is-in { clip-path: inset(0); }
  .js .shutter[data-reveal].is-in .made__still, .js .shutter[data-reveal].is-in video { scale: 1; }
  .js .shelf li { opacity: 0; translate: 0 40px; transition: opacity 600ms var(--ease-out), translate 800ms var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }
  .js .shelf.is-in li { opacity: 1; translate: 0 0; }
}
@keyframes shutter { to { clip-path: inset(0); } }
@keyframes settle { from { scale: 1.12; } to { scale: 1; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes cell-in { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 1099px) {
  .step--a { height: 56vh; min-height: 420px; }
  .made__over { width: 280px; }
  .made__board { gap: 12px; }
  .made__pic { grid-column: 1 / -1; grid-row: auto; }
  .made__mark { grid-column: 1 / 6; grid-row: auto; }
  .made__steps { grid-column: 6 / 13; grid-row: auto; }
  .shelf { height: 400px; gap: 4px; }
  .spine__text { display: none; }
  .why__head, .why__list { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 6px; }
  .steps__head { grid-column: 1 / -1; grid-row: 1; min-height: 0; padding: 0 0 18px; }
  .step { padding: 20px; }
  .step--a { grid-column: 1 / -1; grid-row: 2; height: auto; min-height: 56vw; }
  .step--b { grid-column: 1; grid-row: 3; height: auto; min-height: 240px; }
  .step--c { grid-column: 2; grid-row: 3; margin-top: 32px; height: auto; min-height: 240px; }
  .why__list { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   PHONE — its own board
   ========================================================= */
@media (max-width: 699px) {
  :root { --margin: 10px; --gap: 6px; }
  .cell--text { padding: 20px; gap: 16px; }
  .cell--text .button { align-self: stretch; }
  .ctrl__label { width: 100%; }
  .chip { min-height: 2.75rem; padding: 0 0.6rem; }
  .cell--ctrl { padding: 16px; gap: 10px; }
  .tile__strip { min-height: 0; padding: 7px 8px 8px; }


  .ledger { display: block; }
  .ledger__h { padding: 0 0 12px; }
  table, tbody, tr, tbody th, tbody td { display: block; }
  thead { display: none; }
  tbody tr { padding: 12px 14px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
  tbody th { width: 100%; padding: 0 0 4px; }
  tbody td { padding: 0; text-align: left; }
  tbody td::after { content: " " attr(data-label); color: var(--muted); }
  td.na { display: none; }
  td.ledger__new::after { content: none; }
  .ledger__aside { display: inline; }

  .made { grid-template-columns: 1fr; }
  .made > .h2, .made__lead { grid-column: 1; }
  .made__board { grid-template-columns: 1fr; margin-top: 40px; }
  .made__pic, .made__mark, .made__steps { grid-column: 1; }
  .made__pic { aspect-ratio: auto; overflow: hidden; display: block; }
  .made__pic .made__still { position: static; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .made__pic video { position: absolute; top: 0; left: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .made__over { position: static; width: auto; }
  .made__mark { aspect-ratio: 3 / 2; }
  .made__steps { grid-template-columns: 1fr; }

  .guide__top { grid-template-columns: 1fr; }
  .guide__top .h2, .guide__note { grid-column: 1; }
  .shelf { display: block; height: auto; line-height: 2.4; }
  .shelf li { display: inline; }
  .spine { writing-mode: horizontal-tb; display: inline; background: none; padding: 0; margin-right: 10px; white-space: nowrap; font-size: var(--step-body); }
  .spine__name { font-size: var(--step-body); text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
  .spine__part { display: inline; padding: 3px 6px; margin-left: 6px; width: auto; }
  .spine:hover, .spine:focus-visible { background: none; color: var(--accent); }

  .act { grid-template-columns: 1fr 1fr; grid-template-rows: auto 120px; height: auto; gap: 6px; }
  .act__main { grid-column: 1 / -1; grid-row: 1; padding: 28px 20px; min-height: 300px; }
  .act__main .button { align-self: stretch; }
  .act__side--pic { grid-column: 1; grid-row: 2; }
  .act__side--field { grid-column: 2; grid-row: 2; }

  .blocks { flex-wrap: wrap; height: auto; min-height: 0; }
  .blocks__word { height: 12svh; min-height: 90px; }
  .blocks__word:nth-child(1) { flex-basis: 100%; }
  .blocks__word > span { padding: 0 0 4px 5px; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__links { grid-column: 1 / -1; }
  .foot__contact { grid-column: 1 / -1; }
  .foot__last { flex-wrap: wrap; }

  .theatre { width: 100vw; max-height: 100svh; height: 100svh; overflow-y: auto; }
  .theatre__box { grid-template-columns: 1fr; max-height: none; }
  .theatre__screen { height: auto; width: 100%; max-height: 64svh; aspect-ratio: auto; display: flex; justify-content: center; }
  .theatre__screen video { width: auto; height: 64svh; max-width: 100%; aspect-ratio: 9 / 16; }
  .theatre__info { overflow: visible; padding: 16px 16px 28px; }
  .theatre__bar { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tile__media img, .tile__media video, .spine, .button, .chip { transition: none; }
}
