/* ==========================================================================
   Daydream DD-1
   1 tokens · 2 font fallback · 3 base · 4 layout + plate · 5 header
   6 device · 7 world · 8 sections + footer · 9 dialogs + toasts
   10 motion states · 11 reduced motion + minimal · 12 responsive
   ========================================================================== */

/* 1 ─ TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #EDEEE9; --bg-raised: #F6F7F3; --panel: #FFFFFF; --grid: #1114120D;
  --line: #D2D6CC; --line-strong: #AEB4A8; --line-input: #7D867F;
  --text: #111412; --text-2: #4D5650; --text-3: #7D867F;
  --device: #D9DCD3; --device-rim: #F3F4EF; --device-shadow: #9CA396; --plate: #C9CDC2;
  --key: #F4F5F0; --key-edge: #B9BEB2; --key-ink: #111412; --key-fn: #E3E6DD; --key-op: #1E2320; --key-op-ink: #F4F5F0;
  --focus: #111412; --toast-bg: #111412; --toast-ink: #EDEEE9; --danger: #B3261E;
  --hud-bg: #F6F7F3F0; --plate-bg: #F6F7F3; --on-text-dim: #EDEEE966; --pcb: #2F4A3A;
  --sh-lcd: inset 0 2px 6px #0000001F;
  --sh-panel: 0 1px 0 var(--line), 0 30px 60px -30px #1114122E;
  --lcd-ts: 1.5px 1.5px 0 #00000014;
  --flash: #00000010;
  /* world */
  --sky-top: #EDEEE9; --sky-low: #E4E6DF; --w-sun: #F6F7F3; --w-sun-rim: #D2D6CC;
  --w-far: #DADDD4; --w-far-2: #D2D6CC; --w-near: #C9CDC2; --w-near-2: #BFC4B8;
  --w-mark: #AEB4A8; --w-mark-2: #9CA396; --w-ground: #B9BEB2; --w-win: #C9CDC2; --w-star: transparent;
  /* skin: E-01 Electric — matte lavender (day) */
  --accent: #6A5EA6; --accent-hi: #B9AEE4; --on-accent: #FFFFFF;
  --lcd-bg: #E2DCEF; --lcd-ink: #241C3C; --lcd-ink-2: #4B4173; --lcd-ghost: #D0C7E5;
  --glow: transparent; --focus-halo: #6A5EA659;
  /* shape, space, motion */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 28px; --r-pill: 999px;
  --gutter: clamp(16px, 4vw, 48px);
  --sec-pad: clamp(96px, 12vw, 176px);
  --hud-h: 59px;
  --sh-device: inset 0 1px 0 var(--device-rim), 0 2px 0 var(--key-edge), 0 24px 48px -24px var(--device-shadow);
  --sh-key: 0 3px 0 var(--key-edge);
  --sh-key-down: 0 1px 0 var(--key-edge);
  --ease-hw: cubic-bezier(.2, .8, .2, 1);
  --ease-key: cubic-bezier(.3, .7, .4, 1);
  --t-1: 70ms; --t-2: 140ms; --t-3: 240ms; --t-4: 320ms;
  --f-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --f-dot: "Doto", "Geist Mono", ui-monospace, monospace;
}

:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0B0E0D; --bg-raised: #111513; --panel: #151A17; --grid: #FFFFFF0A;
  --line: #232A26; --line-strong: #36403B; --line-input: #5E6962;
  --text: #E9EFEB; --text-2: #A3AFA7; --text-3: #6D7A72;
  --device: #171C19; --device-rim: #242B27; --device-shadow: #000000; --plate: #101412;
  --key: #222925; --key-edge: #0E1210; --key-ink: #E9EFEB; --key-fn: #1B211E; --key-op: #2C3530; --key-op-ink: var(--accent);
  --focus: #FFFFFF; --toast-bg: #1B211E; --toast-ink: #E9EFEB; --danger: #FF7B72;
  --hud-bg: #111513F0; --plate-bg: #111513; --on-text-dim: #0B0E0D66; --pcb: #10231A;
  --sh-lcd: inset 0 2px 6px #00000059;
  --sh-panel: 0 1px 0 var(--line), 0 30px 60px -30px #00000066;
  --lcd-ts: 0 0 1px var(--lcd-ink), 0 0 14px var(--glow);
  --flash: #FFFFFF14;
  --sky-top: #0B0E0D; --sky-low: #0F1513; --w-sun: #C9D0CB; --w-sun-rim: #C9D0CB;
  --w-far: #131917; --w-far-2: #161D1A; --w-near: #1A211E; --w-near-2: #1E2622;
  --w-mark: #242C28; --w-mark-2: #2A332E; --w-ground: #0E1210; --w-win: #1A211E; --w-star: #E9EFEB;
  --accent: #C0B4EA; --on-accent: #1B1430;
  --lcd-bg: #141026; --lcd-ink: #C0B4EA; --lcd-ink-2: #9186BC; --lcd-ghost: #251D3E;
  --glow: #C0B4EA59; --focus-halo: #C0B4EA59;
}

:root[data-skin="phosphor"] { --accent: #0C5F3C; --accent-hi: #4FBF8B; --on-accent: #FFFFFF; --lcd-bg: #CBDFD2; --lcd-ink: #08281A; --lcd-ink-2: #2A5540; --lcd-ghost: #B7D0BF; --focus-halo: #0C5F3C59; }
:root[data-skin="cobalt"]   { --accent: #0B6C79; --accent-hi: #4FC7D6; --on-accent: #FFFFFF; --lcd-bg: #CBE0E4; --lcd-ink: #06272C; --lcd-ink-2: #235057; --lcd-ghost: #B5D2D8; --focus-halo: #0B6C7959; }
:root[data-skin="signal"]   { --accent: #7C7363; --accent-hi: #C9C0AE; --on-accent: #FFFFFF; --lcd-bg: #F4F1E8; --lcd-ink: #2B2A24; --lcd-ink-2: #5B564A; --lcd-ghost: #E4DFD2; --focus-halo: #7C736359; }
:root[data-mode="dark"][data-skin="phosphor"] { --accent: #4FD69B; --on-accent: #04170E; --lcd-bg: #06170E; --lcd-ink: #4FD69B; --lcd-ink-2: #3AA277; --lcd-ghost: #0E2E1F; --glow: #4FD69B59; --focus-halo: #4FD69B59; }
:root[data-mode="dark"][data-skin="cobalt"]   { --accent: #5CD5E6; --on-accent: #042026; --lcd-bg: #05161A; --lcd-ink: #5CD5E6; --lcd-ink-2: #43A2B0; --lcd-ghost: #0C2B31; --glow: #5CD5E659; --focus-halo: #5CD5E659; }
:root[data-mode="dark"][data-skin="signal"]   { --accent: #EDE7D8; --on-accent: #23201A; --lcd-bg: #1A1814; --lcd-ink: #EDE7D8; --lcd-ink-2: #B5AE9D; --lcd-ghost: #2C2921; --glow: #EDE7D833; --focus-halo: #EDE7D859; }

/* No-JS: follow the system */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    color-scheme: dark;
    --bg: #0B0E0D; --bg-raised: #111513; --panel: #151A17; --grid: #FFFFFF0A; --line: #232A26; --line-strong: #36403B; --line-input: #5E6962;
    --text: #E9EFEB; --text-2: #A3AFA7; --text-3: #6D7A72; --device: #171C19; --device-rim: #242B27; --device-shadow: #000000; --plate: #101412;
    --key: #222925; --key-edge: #0E1210; --key-ink: #E9EFEB; --key-fn: #1B211E; --key-op: #2C3530; --key-op-ink: #C0B4EA;
    --focus: #FFFFFF; --toast-bg: #1B211E; --toast-ink: #E9EFEB; --danger: #FF7B72; --hud-bg: #111513F0; --plate-bg: #111513; --on-text-dim: #0B0E0D66; --pcb: #10231A;
    --sh-lcd: inset 0 2px 6px #00000059; --lcd-ts: 0 0 1px #C0B4EA, 0 0 14px #C0B4EA59; --flash: #FFFFFF14;
    --accent: #C0B4EA; --on-accent: #1B1430; --lcd-bg: #141026; --lcd-ink: #C0B4EA; --lcd-ink-2: #9186BC; --lcd-ghost: #251D3E; --glow: #C0B4EA59; --focus-halo: #C0B4EA59;
  }
}

/* Nightfall palette steps (world tokens only) */
.world.pf-1 { --sky-top: #C7C9C4; --sky-low: #C1C3BD; --w-sun: #EFF1EC; --w-far: #B9BCB5; --w-far-2: #B3B7AE; --w-near: #ACB0A7; --w-near-2: #A4AA9F; --w-mark: #979D93; --w-mark-2: #899085; --w-ground: #9DA197; --w-win: #ACB0A7; }
.world.pf-2 { --sky-top: #A2A3A0; --sky-low: #9DA09B; --w-sun: #E7EAE6; --w-far: #989C95; --w-far-2: #939891; --w-near: #8F948B; --w-near-2: #898F86; --w-mark: #80877D; --w-mark-2: #767E73; --w-ground: #80857C; --w-win: #8F948B; }
.world.pf-3 { --sky-top: #7C7E7B; --sky-low: #7A7E79; --w-sun: #E0E4DF; --w-far: #777B76; --w-far-2: #747A73; --w-near: #727770; --w-near-2: #6F756D; --w-mark: #697068; --w-mark-2: #636B62; --w-ground: #646861; --w-win: #727770; }
.world.pf-4 { --sky-top: #565956; --sky-low: #565B57; --w-sun: #D8DDD8; --w-far: #555A56; --w-far-2: #555B55; --w-near: #545A55; --w-near-2: #545B54; --w-mark: #525953; --w-mark-2: #505851; --w-ground: #474B46; --w-win: #545A55; }
.world.pf-5 { --sky-top: #313332; --sky-low: #333835; --w-sun: #D1D7D2; --w-far: #343A37; --w-far-2: #353C38; --w-near: #373E39; --w-near-2: #39403B; --w-mark: #3B433D; --w-mark-2: #3D463F; --w-ground: #2B2F2B; --w-win: #373E39; }

/* 2 ─ FONT FALLBACK ──────────────────────────────────────────────────────── */
@font-face { font-family: "Geist Fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; }

/* 3 ─ BASE ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; overflow-x: clip; }
html:has(dialog[open]), html.is-locked { overflow: hidden; }
body {
  margin: 0; min-width: 0; overflow-x: clip;
  background: var(--bg); color: var(--text);
  font-family: var(--f-sans); font-size: clamp(1rem, .95rem + .25vw, 1.125rem); line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(a, button, [tabindex], textarea):focus-visible { box-shadow: 0 0 0 8px var(--focus-halo); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden, .m-hide.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.ico { width: 16px; height: 16px; flex: none; }
.nowrap { white-space: nowrap; }

kbd {
  display: inline-block; min-width: 22px; padding: 3px 6px; border-radius: var(--r-xs);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--bg-raised);
  font: 500 12px/1.2 var(--f-mono); color: var(--text); text-align: center; white-space: nowrap; vertical-align: 1px;
}

.skip, .skip-inline {
  position: fixed; left: 12px; top: 8px; z-index: 100; padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font: 500 14px/1 var(--f-sans); text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus, .skip-inline:focus { transform: none; }
.skip-inline { position: absolute; left: auto; right: var(--gutter); top: 12px; z-index: 5; transform: none; }
.skip-inline:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.tag {
  font: 500 .75rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); font-variant-numeric: tabular-nums slashed-zero;
}
h2 { font-size: clamp(2rem, 1.1rem + 3.2vw, 4.25rem); line-height: 1; font-weight: 600; letter-spacing: -.035em; text-wrap: balance; }
h3 { font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.lede { color: var(--text-2); max-width: 58ch; }
.tag + h2 { margin-top: 16px; }
h2 + .lede, h2 ~ .lede.only-touch-block { margin-top: 20px; }
.silk { font: 500 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.silk--xs { font-size: 8px; letter-spacing: .1em; }

.only-coarse { display: none; }
@media (pointer: coarse) { .only-coarse { display: inline; } .only-fine { display: none; } }
.only-touch-block { display: none; }

/* 4 ─ LAYOUT + PLATE ─────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1600px; margin-inline: auto; padding-inline: var(--gutter); }
main { position: relative; padding-top: var(--hud-h); }
.scene { position: relative; z-index: 1; }
.scene:focus { outline: none; }
.plate { background: var(--plate-bg); border-radius: var(--r-lg); padding: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; min-width: 0; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 500 .9375rem/1 var(--f-sans); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-2) var(--ease-hw), background-color var(--t-2) linear;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--text); color: var(--bg); box-shadow: 0 2px 0 var(--line-strong); }
.btn--primary:focus-visible { box-shadow: 0 2px 0 var(--line-strong), 0 0 0 8px var(--focus-halo); }
.btn--primary kbd { background: transparent; border-color: var(--on-text-dim); color: inherit; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn--link { color: var(--text); padding: 0 6px; }
.btn--link:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-raised); }
.text-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none;
  font: 500 14px/1 var(--f-sans); color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
}
.text-btn:hover { text-decoration-color: currentColor; }
.text-btn:disabled { color: var(--text-2); text-decoration: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  width: 44px; height: 44px; padding: 0; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--bg); border-color: var(--line); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn__lbl { font: 500 14px/1 var(--f-sans); white-space: nowrap; }
.hud .icon-btn__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* day/night: both icons visible, the active mode lit */
[data-lights] { display: inline-flex; align-items: center; gap: 6px; }
[data-lights] .ico--sun, [data-lights] .ico--moon { display: block; opacity: .38; transition: opacity var(--t-2) linear, color var(--t-2) linear; }
[data-lights] .ico--moon { order: 2; }
:root:not([data-mode="dark"]) [data-lights] .ico--sun { opacity: 1; color: var(--accent); }
:root[data-mode="dark"] [data-lights] .ico--moon { opacity: 1; color: var(--accent); }

legend { display: block; padding: 0; margin-bottom: 10px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field + .field { margin-top: 24px; }
.hint { font-size: 14px; line-height: 1.5; color: var(--text-2); margin-top: 8px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 3px; border: 1px solid var(--line-input); border-radius: 10px; max-width: 100%; }
.seg label { position: relative; display: block; min-width: 0; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 7px;
  font: 500 14px/1 var(--f-sans); color: var(--text-2); white-space: nowrap; pointer-events: none;
}
.seg input:hover + span { color: var(--text); background: var(--bg); }
.seg input:checked + span { background: var(--text); color: var(--bg); }
.seg input:focus-visible { box-shadow: none; outline: none; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 7px var(--focus-halo); }

/* 5 ─ HEADER ─────────────────────────────────────────────────────────────── */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: var(--hud-bg); }
.hud__bar {
  position: relative; display: flex; align-items: center; gap: 8px; height: 56px;
  max-width: 1600px; margin-inline: auto; padding-inline: var(--gutter); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; margin-right: auto; text-decoration: none; font: 600 18px/1 var(--f-sans); letter-spacing: -.02em; color: var(--text); }
.brand__mark { width: 20px; height: 20px; color: var(--accent); flex: none; shape-rendering: crispEdges; }
.nav { display: none; }
.nav a { position: relative; display: flex; align-items: center; height: 44px; padding: 0 10px; border-radius: 6px; font: 500 14px/1 var(--f-sans); color: var(--text-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--text); }
.nav a::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 16px; height: 2px; margin-left: -8px; background: var(--accent); transform: scaleX(0); transition: transform var(--t-2) steps(2); }
.nav a[aria-current="true"]::after { transform: none; }
.hud__actions { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud__sound { display: none; }
.btn-focus { width: 152px; padding: 0 14px; }
.btn-focus__chip { display: none; }

.dock { display: none; }
.chip {
  position: relative; height: 32px; min-width: 72px; max-width: 160px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: var(--lcd-bg); color: var(--lcd-ink);
  font: 900 16px/32px var(--f-dot); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
  opacity: 0; visibility: hidden; transform: translateX(8px);
  transition: opacity var(--t-2) linear, transform var(--t-3) var(--ease-hw), visibility 0s var(--t-2);
}
.chip.is-long { font: 600 14px/32px var(--f-mono); }
html.is-docked .chip { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-2) linear, transform var(--t-3) var(--ease-hw), visibility 0s; }
html.is-docked .chip.is-waiting .chip__txt { visibility: hidden; }

.xp {
  position: relative; height: 3px;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 24 - 1px), transparent calc(100% / 24 - 1px) calc(100% / 24));
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 24 - 1px), transparent calc(100% / 24 - 1px) calc(100% / 24));
}
.xp::before { content: ""; position: absolute; inset: 0; background: var(--line); }
.xp__lit { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--page-p, 0)); }

/* 6 ─ DEVICE ─────────────────────────────────────────────────────────────── */
.dd1 {
  --key-h: clamp(48px, 5.2vh, 60px);
  --lcd-size: clamp(40px, 4.2vw, 60px);
  position: relative; width: 100%; padding: 20px; border-radius: var(--r-xl);
  background: var(--device); box-shadow: var(--sh-device); color: var(--key-ink);
  -webkit-tap-highlight-color: transparent;
}
.dd1::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dd1:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; box-shadow: var(--sh-device), 0 0 0 10px var(--focus-halo); }
.dd1__body { position: relative; z-index: 1; display: grid; gap: 12px; }
.dd1__top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 24px; padding-inline: 6px; }
.grille { width: 28px; height: 13px; background: radial-gradient(circle, var(--line-strong) 1.4px, transparent 1.6px) 0 0 / 4.66px 4.33px; }
.leds { justify-self: end; display: flex; align-items: center; gap: 4px; }
.leds .silk { margin-right: 2px; }
.led { display: block; width: 6px; height: 6px; border-radius: 1px; background: var(--line-strong); }
.led--pwr, .dd1.kbd-on .led--kbd { background: var(--accent); }
:root[data-mode="dark"] .led--pwr, :root[data-mode="dark"] .dd1.kbd-on .led--kbd { box-shadow: 0 0 6px var(--glow); }
.led--pwr.blink { background: var(--line-strong); box-shadow: none; }

.dd1__bezel { padding: 3px; border-radius: 15px; background: var(--plate); }
.dd1__bezel.fx-err { box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 1px var(--danger); }
.dd1__lcd {
  position: relative; display: grid; grid-template-rows: auto auto 1fr; min-height: 128px; padding: 8px 12px 10px;
  border-radius: var(--r-md); background: var(--lcd-bg); box-shadow: var(--sh-lcd); color: var(--lcd-ink); overflow: hidden;
}
.dd1__lcd::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(var(--lcd-ghost) 1px, transparent 1.2px) 0 0 / 4px 4px; }
:root[data-mode="dark"] .dd1__lcd::after, :root[data-mode="dark"] .mini__lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #0000000F 0 1px, transparent 1px 2px); }
.lcd-status {
  position: relative; z-index: 1; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 32px 32px; align-items: center; gap: 2px;
  height: 30px; margin-right: -6px; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; color: var(--lcd-ink-2); font-variant-numeric: tabular-nums;
}
.lcd-op { display: grid; place-items: center; width: 20px; height: 16px; border: 1px solid var(--lcd-ghost); border-radius: 3px; font: 600 13px/1 var(--f-sans); color: var(--lcd-ink); }
.lcd-op.is-on { border-color: var(--lcd-ink-2); }
.lcd-msg { display: block; min-width: 12ch; white-space: nowrap; overflow: hidden; text-overflow: clip; transform-origin: 0 50%; }
.lcd-snd { display: flex; align-items: center; }
.lcd-note { display: none; padding: 0 6px; font-size: 13px; color: var(--lcd-ink); }
html.sound-on .lcd-note { display: block; }
.lcd-btn { position: relative; display: grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--lcd-ink-2); }
.lcd-btn::after { content: ""; position: absolute; inset: -2px; }
.lcd-btn:hover { background: var(--lcd-ghost); color: var(--lcd-ink); }
.lcd-btn:focus-visible { outline: 2px solid var(--lcd-ink); outline-offset: -2px; box-shadow: none; }
.lcd-btn--snd { display: none; }
.lcd-btn[aria-pressed="true"] { color: var(--lcd-ink); }
.lcd-expr {
  position: relative; z-index: 1; direction: rtl; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  min-height: 19px; font: 400 14px/1.3 var(--f-mono); color: var(--lcd-ink-2); font-variant-numeric: tabular-nums;
}
.lcd-expr span { unicode-bidi: plaintext; }
.lcd-res { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: flex-end; min-height: calc(var(--lcd-size) + 6px); }
.lcd-ghost, .lcd-out { font-family: var(--f-dot); font-weight: 900; font-size: var(--lcd-size); line-height: 1; font-synthesis: none; white-space: nowrap; font-variant-numeric: tabular-nums slashed-zero; }
.lcd-ghost { position: absolute; right: 0; bottom: 0; max-width: 100%; overflow: hidden; color: var(--lcd-ghost); direction: rtl; }
.lcd-out { position: relative; display: block; width: 100%; overflow: hidden; text-align: right; color: var(--lcd-ink); text-shadow: var(--lcd-ts); }
.lcd-out.lcd-compact { font-family: var(--f-mono); font-weight: 600; }
.lcd-out.is-rolling { color: transparent; text-shadow: none; }
.lcd-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; overflow: hidden; }
.lcd-fx::before { content: ""; position: absolute; inset: 0; background: var(--flash); opacity: 0; }
.lcd-fx::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 100%; border-bottom: 1px solid var(--accent); transform: translateY(-102%); }
.odo { position: absolute; right: 0; bottom: 0; display: flex; font-family: var(--f-dot); font-weight: 900; line-height: 1; color: var(--lcd-ink); text-shadow: var(--lcd-ts); white-space: pre; pointer-events: none; }
.odo__c { display: block; height: 1em; overflow: hidden; }
.odo__s { display: block; animation: odo 180ms steps(4) both; }

.dd1__keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 8px; border-radius: var(--r-lg); background: var(--plate); }
.noscript { grid-column: 1 / -1; padding: 16px; font-size: 15px; color: var(--text); }
.key {
  position: relative; height: var(--key-h); min-width: 0; padding: 0; border-radius: var(--r-md); border: 1px solid var(--key-edge);
  background: var(--key); color: var(--key-ink); box-shadow: var(--sh-key); font: 500 20px/1 var(--f-sans);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: transform var(--t-2) var(--ease-key);
}
.key--zero { grid-column: span 2; }
.key--fn { background: var(--key-fn); font: 500 14px/1 var(--f-mono); letter-spacing: .02em; }
.key--op { background: var(--key-op); border-color: var(--key-op); color: var(--key-op-ink); font: 400 24px/1 var(--f-sans); }
:root[data-mode="dark"] .key--op { border-color: var(--key-edge); }
.key--eq { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font: 600 22px/1 var(--f-sans); }
:root[data-mode="dark"] .key--eq { box-shadow: var(--sh-key), 0 0 18px var(--glow); }
@media (hover: hover) { .key:hover { transform: translateY(-1px); } }
.key:active, .key.pressed { transform: translateY(2px); box-shadow: var(--sh-key-down); transition-duration: var(--t-1); }
:root[data-mode="dark"] .key--eq:active, :root[data-mode="dark"] .key--eq.pressed { box-shadow: var(--sh-key-down), 0 0 18px var(--glow); }
.key:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: var(--sh-key); }
.key:focus-visible::after { content: ""; position: absolute; inset: -8px; border: 4px solid var(--focus-halo); border-radius: 18px; pointer-events: none; }
.key--op.is-pending::before { content: ""; position: absolute; left: 30%; right: 30%; bottom: 6px; height: 4px; border-radius: 1px; background: var(--accent-hi); }
:root[data-mode="dark"] .key--op.is-pending::before { background: var(--accent); }
.dd1__foot { text-align: center; height: 10px; }

/* hero tilt: internal depth only while tilting */
.hero__tilt { transform-origin: 50% 40%; }
.hero__tilt.is-tilting, .hero__tilt.is-tilting .dd1, .hero__tilt.is-tilting .dd1__body { transform-style: preserve-3d; }
.hero__tilt.is-tilting .dd1__bezel { transform: translateZ(10px); }
.hero__tilt.is-tilting .dd1__keys { transform: translateZ(14px); }
.hero__tilt.is-tilting .dd1__top, .hero__tilt.is-tilting .dd1__foot { transform: translateZ(6px); }

/* mini devices (mirrors, previews) */
.mini { position: relative; width: 280px; padding: 16px; border-radius: 24px; background: var(--device); box-shadow: var(--sh-device); display: grid; gap: 10px; }
.mini__slot { position: absolute; left: 50%; top: 0; width: 120px; height: 10px; margin-left: -60px; border-radius: 0 0 4px 4px; background: var(--plate); box-shadow: inset 0 3px 3px #00000033; }
.mini__top { display: flex; align-items: center; justify-content: space-between; height: 14px; padding: 0 4px; }
.mini__lcd { position: relative; display: grid; align-content: end; justify-items: end; height: 96px; padding: 8px 12px; overflow: hidden; border-radius: 10px; background: var(--lcd-bg); box-shadow: var(--sh-lcd); }
.mini__lcd::before { content: ""; position: absolute; inset: 0; background: radial-gradient(var(--lcd-ghost) 1px, transparent 1.2px) 0 0 / 4px 4px; }
.mini__expr { position: relative; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 12px/1.3 var(--f-mono); color: var(--lcd-ink-2); }
.mini__out { position: relative; max-width: 100%; overflow: hidden; white-space: nowrap; font: 900 40px/1 var(--f-dot); color: var(--lcd-ink); text-shadow: var(--lcd-ts); }
.mkeys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px; border-radius: 12px; background: var(--plate); }
.mkeys i { display: block; height: 30px; border-radius: 7px; background: var(--key); box-shadow: 0 2px 0 var(--key-edge); }
.mkeys i:nth-child(-n+3) { background: var(--key-fn); }
.mkeys i:nth-child(4n) { background: var(--key-op); }
.mkeys i:nth-child(17) { grid-column: span 2; }
.mkeys i:nth-child(19) { background: var(--accent); }
.mini--sm { width: 200px; padding: 12px; border-radius: 18px; gap: 8px; }
.mini--sm .mini__lcd { height: 64px; }
.mini--sm .mini__out { font-size: 28px; }
.mini--sm .mkeys { gap: 4px; padding: 4px; }
.mini--sm .mkeys i { height: 20px; border-radius: 5px; }

/* 7 ─ WORLD ──────────────────────────────────────────────────────────────── */
.world-wrap { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: clip; }
.world { --px: 3px; position: sticky; top: 0; height: 100lvh; overflow: hidden; contain: strict; transition: opacity var(--t-2) linear; }
@supports not (overflow: clip) { .world-wrap { overflow: visible; } .world { position: fixed; inset: 0; } }
html:not(.js) .world { display: none; }
html.is-jumping .world { opacity: 0; }
.w-sky { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--sky-top) 55%, var(--sky-low)); }
.world::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(to bottom, var(--sky-top), transparent); pointer-events: none; }
.w-plane { position: absolute; left: 0; bottom: 0; }
.strip { height: calc(var(--th) * var(--px)); width: calc(240 * var(--px)); }
.w-far { bottom: calc(18 * var(--px)); --c1: var(--w-far); --c2: var(--w-far-2); }
.w-near { bottom: calc(10 * var(--px)); --c1: var(--w-near); --c2: var(--w-near-2); }
.w-ground { --c1: var(--w-ground); --c2: var(--w-near); }
.t1 { fill: var(--c1); }
.t2 { fill: var(--c2); }
html.motion-ok .w-plane, html.motion-ok .lm.is-near { will-change: transform; }
.w-marks { position: absolute; left: 0; right: 0; bottom: calc(11 * var(--px)); height: 0; }
.lm { position: absolute; left: 0; bottom: 0; visibility: hidden; --c1: var(--w-mark); --c2: var(--w-mark-2); }
.lm.is-near { visibility: visible; }
.lm svg { width: calc(var(--w) * var(--px)); height: calc(var(--h) * var(--px)); }
.world.is-static .lm { visibility: visible; opacity: 0; transition: opacity 200ms linear; }
.world.is-static .lm.is-stage { opacity: 1; }
.win { fill: var(--w-win); }
html.motion-ok .win { transition: fill var(--t-3) steps(3); transition-delay: calc(var(--i, 0) * 40ms); }
.win.is-lit { fill: var(--accent); }
:root[data-mode="dark"] .win.is-lit, :root[data-mode="dark"] .lamp { fill: var(--accent); stroke: var(--glow); stroke-width: 2px; paint-order: stroke; }
.flag--amber { fill: #FFB547; } .flag--phosphor { fill: #7CF0A6; } .flag--cobalt { fill: #8FB3FF; } .flag--signal { fill: #FF7A4D; }
[data-skin="amber"] .flag--amber, [data-skin="phosphor"] .flag--phosphor, [data-skin="cobalt"] .flag--cobalt, [data-skin="signal"] .flag--signal { transform: translateX(2px); }
.lm-halo { position: absolute; left: calc(45 * var(--px)); top: calc(6 * var(--px)); width: calc(16 * var(--px)); height: calc(16 * var(--px)); margin: calc(-8 * var(--px)) 0 0 calc(-8 * var(--px)); border: var(--px) solid var(--accent); opacity: 0; }
html.motion-ok .lm-halo.pulse { animation: halo var(--t-4) steps(3); }

.w-stars { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; }
:root[data-mode="dark"] .w-stars { opacity: 1; }
.w-stars { -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent 24%, transparent 76%, #000 80%); mask-image: linear-gradient(90deg, #000 20%, transparent 24%, transparent 76%, #000 80%); }
:root[data-stage]:not([data-stage="0"]):not([data-stage="6"]) .w-stars, :root[data-stage]:not([data-stage="0"]):not([data-stage="6"]) .w-orb { opacity: 0; }
html.motion-ok .w-orb { transition: opacity 360ms steps(3); }
@media (max-width: 999px) { .w-orb { display: none; } }
html.motion-ok .w-stars { transition: opacity 360ms steps(3); }
.w-stars::before, .w-stars::after { content: ""; position: absolute; left: 0; top: 0; width: calc(2 * var(--px)); height: calc(2 * var(--px)); opacity: .7; }
.w-stars::before {
  box-shadow:
    calc(var(--px) * 14) calc(var(--px) * 40) var(--w-star), calc(var(--px) * 52) calc(var(--px) * 18) var(--w-star), calc(var(--px) * 96) calc(var(--px) * 62) var(--w-star),
    calc(var(--px) * 131) calc(var(--px) * 30) var(--w-star), calc(var(--px) * 176) calc(var(--px) * 88) var(--w-star), calc(var(--px) * 228) calc(var(--px) * 22) var(--w-star),
    calc(var(--px) * 284) calc(var(--px) * 70) var(--w-star), calc(var(--px) * 338) calc(var(--px) * 36) var(--w-star), calc(var(--px) * 410) calc(var(--px) * 96) var(--w-star),
    calc(var(--px) * 472) calc(var(--px) * 26) var(--w-star), calc(var(--px) * 560) calc(var(--px) * 58) var(--w-star), calc(var(--px) * 646) calc(var(--px) * 16) var(--w-star);
}
.w-stars::after {
  opacity: .45;
  box-shadow:
    calc(var(--px) * 34) calc(var(--px) * 96) var(--w-star), calc(var(--px) * 78) calc(var(--px) * 124) var(--w-star), calc(var(--px) * 118) calc(var(--px) * 10) var(--w-star),
    calc(var(--px) * 160) calc(var(--px) * 48) var(--w-star), calc(var(--px) * 205) calc(var(--px) * 116) var(--w-star), calc(var(--px) * 256) calc(var(--px) * 52) var(--w-star),
    calc(var(--px) * 312) calc(var(--px) * 12) var(--w-star), calc(var(--px) * 376) calc(var(--px) * 66) var(--w-star), calc(var(--px) * 444) calc(var(--px) * 44) var(--w-star),
    calc(var(--px) * 518) calc(var(--px) * 106) var(--w-star), calc(var(--px) * 604) calc(var(--px) * 34) var(--w-star), calc(var(--px) * 700) calc(var(--px) * 80) var(--w-star);
}
html.motion-ok[data-mode="dark"]:not(.lowfx) .w-stars::before { animation: twinkle 8s steps(2) infinite; }
html.motion-ok[data-mode="dark"]:not(.lowfx) .w-stars::after { animation: twinkle 8s steps(2) -4s infinite; }
html.is-paused .w-stars::before, html.is-paused .w-stars::after, html.is-locked .w-stars::before, html.is-locked .w-stars::after { animation-play-state: paused; }

.w-orb {
  position: absolute; left: 69%; bottom: calc(76 * var(--px)); width: calc(12 * var(--px)); height: calc(12 * var(--px)); background: var(--w-sun-rim);
  clip-path: polygon(33.33% 0, 66.67% 0, 66.67% 8.33%, 83.33% 8.33%, 83.33% 16.67%, 91.67% 16.67%, 91.67% 33.33%, 100% 33.33%, 100% 66.67%, 91.67% 66.67%, 91.67% 83.33%, 83.33% 83.33%, 83.33% 91.67%, 66.67% 91.67%, 66.67% 100%, 33.33% 100%, 33.33% 91.67%, 16.67% 91.67%, 16.67% 83.33%, 8.33% 83.33%, 8.33% 66.67%, 0 66.67%, 0 33.33%, 8.33% 33.33%, 8.33% 16.67%, 16.67% 16.67%, 16.67% 8.33%, 33.33% 8.33%);
}
.w-orb::before { content: ""; position: absolute; inset: var(--px); background: var(--w-sun); clip-path: inherit; }
:root[data-mode="dark"] .w-orb::after { content: ""; position: absolute; inset: 0; background: var(--sky-top); clip-path: inherit; transform: translate(calc(var(--px) * 4), calc(var(--px) * -3)); }
html.motion-ok.is-nightfall .w-orb { animation: orb 720ms steps(1) both; }
.w-streak { position: absolute; left: 0; right: 0; top: 24%; height: var(--px); transform: translateX(-100%); }
.w-streak::before { content: ""; position: absolute; right: 0; top: 0; width: calc(6 * var(--px)); height: var(--px); background: var(--w-mark-2); }
:root[data-mode="dark"] .w-streak::before { background: #E9EFEB; }
html.motion-ok .w-streak.go { animation: streak 900ms steps(18) both; }

/* 8 ─ SECTIONS ───────────────────────────────────────────────────────────── */
/* 8.1 hero */
.hero { display: flex; min-height: min(calc(100svh - var(--hud-h)), 1000px); }
.hero__grid {
  --dev-w: clamp(300px, calc((100svh - 300px) * .6), 420px);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--dev-w) minmax(0, 1fr); align-content: center;
  column-gap: clamp(24px, 3vw, 64px); padding-block: clamp(16px, 3vh, 40px) clamp(20px, 3.5vh, 44px);
}
:root[data-mode="dark"] .hero::before, :root[data-mode="dark"] .td__stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 85%); mask-image: linear-gradient(to bottom, #000 40%, transparent 85%);
}
.hero__head { grid-column: 1 / -1; position: relative; z-index: 1; text-align: center; }
.hero__tag { display: inline-flex; align-items: center; gap: 10px; }
.tag__px { display: block; width: 6px; height: 6px; background: var(--accent); flex: none; }
.hero__title { margin-top: 14px; font-size: clamp(3rem, 1.2rem + 7.2vw, 9.5rem); line-height: .9; font-weight: 600; letter-spacing: -.05em; text-wrap: balance; }
.hero__stage { grid-column: 2; grid-row: 2; position: relative; z-index: 2; width: var(--dev-w); margin-top: calc(clamp(3rem, 1.2rem + 7.2vw, 9.5rem) * -.01); perspective: 1200px; }
.hero__left, .hero__right { grid-row: 2; align-self: end; margin-bottom: 26px; }
.hero__left { grid-column: 1; justify-self: start; display: grid; gap: 20px; max-width: calc(34ch + 48px); }
.hero__right { grid-column: 3; justify-self: end; width: min(100%, 300px); }
.hero__body { font-size: 1rem; line-height: 1.55; color: var(--text-2); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 20px; }
.scroll-cue { display: flex; align-items: center; gap: 12px; padding-left: 4px; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.scroll-cue::before { content: ""; width: 48px; height: 1px; background: var(--line-strong); }
.readout { display: grid; padding-block: 12px; }
.readout div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.readout div:last-child { border-bottom: 0; }
.readout dt { font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.readout dd { display: flex; align-items: center; gap: 8px; font: 500 15px/1 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums slashed-zero; text-transform: uppercase; }
.readout dd::before { content: ""; width: 6px; height: 6px; background: var(--accent); }

/* 8.2 teardown */
.td { padding-block: var(--sec-pad); }
.td__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); column-gap: clamp(24px, 3vw, 56px); align-items: center; }
.chapter { display: flex; align-items: flex-end; gap: 16px; }
.numeral { font: 900 clamp(4rem, 6vw, 7rem)/.78 var(--f-dot); color: var(--text-3); font-synthesis: none; }
.chapter + h2 { margin-top: 18px; }
.td__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-top: 32px; }
.td__list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; padding: 10px 0 10px 14px; border-left: 2px solid var(--line); }
.td__list li.is-active { border-left-color: var(--accent); }
.td__n { font: 900 24px/1 var(--f-dot); color: var(--text-3); padding-top: 1px; }
.td__list h3 { font-size: 20px; color: var(--text); }
.td__list p { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.td__viz { position: relative; }
.iso-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; margin-inline: auto; perspective: 1600px; container-type: inline-size; }
.iso { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-38deg) scale(.82); }
.ly { position: absolute; left: 34%; top: 12%; width: 32%; height: 76%; border-radius: 7% / 4%; }
.ly0 { background: var(--device); box-shadow: inset 0 0 0 1px var(--device-rim), 0 3px 0 var(--key-edge); transform: translateZ(0); }
.ly1 { background: var(--pcb); transform: translateZ(42px); }
.ly2 { transform: translateZ(84px); }
.ly3 { transform: translateZ(126px); }
.ly4 { transform: translateZ(168px); }
.ly svg { width: 100%; height: 100%; }
.pcb-traces { stroke: var(--accent-hi); stroke-opacity: .5; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.pcb-traces * { vector-effect: non-scaling-stroke; }
.pcb-parts { fill: #0B0E0D; opacity: .55; }
.pcb-chip { fill: #0B0E0D; }
.pcb-label { font: 600 3.3px var(--f-mono); fill: #A3AFA7; letter-spacing: .2px; }
.ly2__lcd { position: absolute; left: 7%; right: 7%; top: 8.75%; height: 21.875%; display: grid; place-items: center end; padding-right: 8%; border-radius: 8% / 22%; background: var(--lcd-bg); box-shadow: 0 0 0 1px var(--lcd-ghost); overflow: hidden; }
.ly2__lcd::before { content: ""; position: absolute; inset: 0; background: radial-gradient(var(--lcd-ghost) 1px, transparent 1.2px) 0 0 / 4px 4px; }
.ly2__txt { position: relative; font: 900 4.6cqw/1 var(--f-dot); color: var(--lcd-ink); text-shadow: var(--lcd-ts); letter-spacing: .02em; }
.ly3 .mkeys { position: absolute; left: 7%; right: 7%; top: 35%; bottom: 5.6%; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 3.5cqw 1.6cqw; gap: 2.2%; padding: 3%; border-radius: 6%; background: transparent; }
.ly3 .mkeys i { height: auto; border-radius: 22%; box-shadow: 0 1px 0 var(--key-edge); }
.face { fill: var(--device); }
.face-rim { stroke: var(--plate); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.face-silk { font: 500 3.6px var(--f-mono); fill: var(--text-3); letter-spacing: .5px; }
html.motion-ok .ly { transition: opacity var(--t-3) linear; }
html.motion-ok .td:not([data-step="0"]) .ly { opacity: .45; }
html.motion-ok .td[data-step="1"] .ly4, html.motion-ok .td[data-step="2"] .ly3, html.motion-ok .td[data-step="3"] .ly2, html.motion-ok .td[data-step="4"] .ly1 { opacity: 1; }
html.motion-ok .td.is-active .iso, html.motion-ok .td.is-active .ly { will-change: transform; }
.co-t { position: absolute; width: 2px; height: 2px; margin: -1px 0 0 -1px; pointer-events: none; }
.callouts { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.co-path { fill: none; stroke: var(--line-strong); stroke-width: var(--co-sw, .5); stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.co-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
html:not(.js) .co-dot { display: none; }
.co-label {
  position: absolute; transform: translateY(-50%); padding: 5px 8px; border-radius: var(--r-xs); background: var(--plate-bg); box-shadow: inset 0 0 0 1px var(--line);
  font: 500 12px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text); white-space: nowrap;
}
html.motion-ok .co-path { stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset var(--t-4) var(--ease-hw), opacity 0s linear var(--t-4); }
html.motion-ok .co-dot, html.motion-ok .co-label { opacity: 0; transition: opacity var(--t-2) linear; }
html.motion-ok .td.co-on[data-step="1"] .co-path[data-s="1"], html.motion-ok .td.co-on[data-step="2"] .co-path[data-s="2"],
html.motion-ok .td.co-on[data-step="3"] .co-path[data-s="3"], html.motion-ok .td.co-on[data-step="4"] .co-path[data-s="4"] { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset var(--t-4) var(--ease-hw), opacity 0s; }
html.motion-ok .td.co-on[data-step="1"] [data-s="1"]:not(path), html.motion-ok .td.co-on[data-step="2"] [data-s="2"]:not(path),
html.motion-ok .td.co-on[data-step="3"] [data-s="3"]:not(path), html.motion-ok .td.co-on[data-step="4"] [data-s="4"]:not(path) { opacity: 1; transition-delay: 120ms; }
.td__hud { position: absolute; right: 0; bottom: 0; display: none; align-items: center; gap: 14px; padding: 12px 14px; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.td__hud b { font-weight: 600; color: var(--text); }
.pips { display: flex; gap: 4px; }
.pips i { width: 8px; height: 8px; background: var(--line-strong); }
.pips i.is-on { background: var(--accent); }
html.motion-ok .td__hud { display: flex; }
html.motion-ok .td__hudtxt.swap { animation: blip var(--t-2) steps(2); }

/* sticky choreography (full effects only) */
html.motion-ok .td { height: 200vh; padding-block: 0; }
@media (min-width: 1000px) and (min-height: 700px) { html.motion-ok .td { height: 300vh; } }
html.motion-ok .td__stage { position: sticky; top: var(--hud-h); height: calc(100svh - var(--hud-h)); overflow: clip; display: flex; align-items: center; padding-block: 24px; }
html.motion-ok .td__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); width: 100%; }
html.motion-ok .td__list { grid-template-columns: minmax(0, 1fr); gap: 2px; margin-top: clamp(16px, 3vh, 32px); }
html.motion-ok .td__list li { border-left-color: transparent; }
html.motion-ok .td__list li.is-active { border-left-color: var(--accent); }
html.motion-ok .iso-wrap { width: min(100%, calc((100svh - var(--hud-h) - 96px) * 4 / 3)); }
html.motion-ok .td__list li { transition: border-color var(--t-2) steps(2); }

/* 8.3 controls */
.ctl { padding-block: var(--sec-pad); }
.divider { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(48px, 6vw, 88px); font: 500 12px/1 var(--f-mono); letter-spacing: .08em; color: var(--text-2); }
.divider::before { content: ""; flex: 1; height: 1px; background: var(--line); }
.ctl__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 80px); align-items: start; }
.ctl__diagram { padding: clamp(24px, 3vw, 40px); perspective: 1200px; }
.ctl__diagram { container-type: inline-size; }
.kbd-3d { --cap: clamp(44px, calc((100cqw - 88px) / 8), 72px); display: flex; align-items: stretch; gap: 32px; transform-origin: 50% 100%; }
.pad { display: grid; grid-template-columns: repeat(4, var(--cap)); grid-auto-rows: var(--cap); gap: 8px; }
.pad--x { grid-template-rows: repeat(2, var(--cap)); }
.ctl__side { display: flex; flex-direction: column; gap: 8px; }
.ctl__readout {
  position: relative; flex: 1; display: grid; align-content: center; gap: 10px; padding: 14px 16px; overflow: hidden;
  border-radius: var(--r-md); background: var(--lcd-bg); box-shadow: var(--sh-lcd); color: var(--lcd-ink);
}
.ctl__readout::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(var(--lcd-ghost) 1px, transparent 1.2px) 0 0 / 4px 4px; }
.ro { position: relative; display: grid; gap: 6px; min-width: 0; }
.ro + .ro { padding-top: 10px; border-top: 1px dashed var(--lcd-ghost); }
.ro__k { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lcd-ink-2); white-space: nowrap; }
.ro__v { display: block; min-height: 36px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 900 clamp(28px, 3.2cqw, 36px)/1 var(--f-dot); color: var(--lcd-ink); text-shadow: var(--lcd-ts); font-synthesis: none; }
.ro__v.is-text { font: 600 18px/36px var(--f-mono); letter-spacing: .02em; text-transform: uppercase; }
.ro__hint { position: relative; font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lcd-ink-2); }
.ctl__readout.blip .ro__v { animation: blip var(--t-2) steps(2); }
.cap {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0;
  border-radius: var(--r-sm); border: 1px solid var(--key-edge); background: var(--key); box-shadow: var(--sh-key);
  font: 500 16px/1 var(--f-mono); color: var(--key-ink); transition: transform var(--t-2) var(--ease-key);
}
.cap small { font: 500 10px/1 var(--f-mono); color: var(--text-2); }
.cap--tall { grid-row: span 2; }
.cap--wide { grid-column: span 2; }
.cap.hit { transform: translateY(2px); box-shadow: var(--sh-key-down); border-top: 2px solid var(--accent); transition-duration: var(--t-1); }
.ctl__copy h2 { font-size: clamp(2rem, 1.1rem + 2.6vw, 3.75rem); }
.kmap-wrap { margin-top: 32px; }
.kmap { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.kmap th { padding: 0 12px 10px 0; border-bottom: 1px solid var(--line-strong); text-align: left; font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.kmap td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.kmap td:last-child { color: var(--text-2); }
.kmap kbd { margin: 1px 0; }
.kmap__alt { font-size: 13px; color: var(--text-2); }
.footnote { margin-top: 16px; font-size: 14px; color: var(--text-2); }
.footnote .text-btn { min-height: 0; padding: 0; font-size: inherit; vertical-align: baseline; }

/* 8.4 finishes */
.fin { padding-block: var(--sec-pad); }
.bgnum { position: absolute; left: 1%; top: 16%; z-index: -1; font: 900 20vw/.8 var(--f-dot); color: var(--grid); pointer-events: none; user-select: none; font-synthesis: none; }
.fin__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 80px); align-items: center; }
.fin__device { display: flex; justify-content: center; }
.carts { margin: 36px 0 0; padding: 0; border: 0; min-width: 0; }
.carts__row { display: grid; grid-template-columns: repeat(4, minmax(0, 160px)); gap: 16px; padding-top: 64px; }
.cart:nth-child(2) .cart__shell { translate: 0 -12px; }
.cart:nth-child(3) .cart__shell { translate: 0 -24px; }
.cart:nth-child(4) .cart__shell { translate: 0 -12px; }
.cart__body { position: relative; display: block; height: 188px; cursor: pointer; transition: transform var(--t-4) var(--ease-hw); }
.cart__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.cart__shell { position: absolute; inset: 0; display: block; border-radius: 10px; }
.cart__shell::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  background: linear-gradient(to top, var(--key-edge) 0 3px, var(--device) 3px);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}
.cart__grip { position: absolute; left: 16px; right: 44px; top: 14px; height: 10px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 2px, transparent 2px 4px); }
.cart__win { position: absolute; left: 12px; right: 12px; top: 36px; bottom: 42px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 6px; background: var(--c-lcd); box-shadow: inset 0 2px 4px #00000026; overflow: hidden; }
.cart__code { font: 900 28px/1 var(--f-dot); color: var(--c-ink); font-synthesis: none; white-space: nowrap; }
.cart__name { font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink2); }
.cart__loaded { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 6px; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); opacity: 0; }
.cart__loaded i { width: 6px; height: 6px; background: var(--accent); }
.cart__body.is-loaded { transform: translateY(-12px); }
.cart__body.is-loaded .cart__shell { outline: 2px solid var(--accent); outline-offset: 2px; }
.cart__body.is-loaded .cart__loaded { opacity: 1; }
.cart__body:hover .cart__shell::before { background: linear-gradient(to top, var(--key-edge) 0 3px, var(--key-fn) 3px); }
.cart__input:focus-visible + .cart__shell { outline: 2px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 9px var(--focus-halo); }
.cart__desc { margin-top: 18px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.fin .field { margin-top: 40px; }
.cart__body[data-sk="amber"], .swatch[data-sk="amber"] { --c-lcd: #E2DCEF; --c-ink: #241C3C; --c-ink2: #4B4173; --c-acc: #6A5EA6; }
.cart__body[data-sk="phosphor"], .swatch[data-sk="phosphor"] { --c-lcd: #0C5F3C; --c-ink: #DFF3E8; --c-ink2: #9BCBB3; --c-acc: #4FD69B; }
.cart__body[data-sk="cobalt"], .swatch[data-sk="cobalt"] { --c-lcd: #0B6C79; --c-ink: #DBF4F8; --c-ink2: #93D2DC; --c-acc: #5CD5E6; }
.cart__body[data-sk="signal"], .swatch[data-sk="signal"] { --c-lcd: #F4F1E8; --c-ink: #2B2A24; --c-ink2: #5B564A; --c-acc: #7C7363; }
:root[data-mode="dark"] .cart__body[data-sk="amber"], :root[data-mode="dark"] .swatch[data-sk="amber"] { --c-lcd: #2A2350; --c-ink: #C0B4EA; --c-ink2: #9186BC; --c-acc: #C0B4EA; }
:root[data-mode="dark"] .cart__body[data-sk="phosphor"], :root[data-mode="dark"] .swatch[data-sk="phosphor"] { --c-lcd: #0A3F2A; --c-ink: #7FE8B5; --c-ink2: #4FA97E; --c-acc: #4FD69B; }
:root[data-mode="dark"] .cart__body[data-sk="cobalt"], :root[data-mode="dark"] .swatch[data-sk="cobalt"] { --c-lcd: #073F48; --c-ink: #8FE4F0; --c-ink2: #4FA8B6; --c-acc: #5CD5E6; }
:root[data-mode="dark"] .cart__body[data-sk="signal"], :root[data-mode="dark"] .swatch[data-sk="signal"] { --c-lcd: #EDE7D8; --c-ink: #23201A; --c-ink2: #6B6559; --c-acc: #23201A; }
.dissolve { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(8, 1fr); pointer-events: none; }
.dissolve i { background: var(--c); opacity: 0; animation: cell var(--t-1) steps(2) forwards; }
html.motion-ok .cart__body.is-slotting { animation: slot var(--t-4) var(--ease-hw); }

/* 8.5 workspace */
.ws { padding-block: var(--sec-pad); }
.ws__head { max-width: 820px; }
.ws__stage { margin-top: clamp(40px, 5vw, 72px); perspective: 1400px; }
.ws-panel {
  --tk: var(--line-strong);
  position: relative; width: min(100%, 1120px); margin-inline: auto; padding-bottom: 44px; border-radius: var(--r-lg); box-shadow: var(--sh-panel); transform-origin: 50% 100%;
  background:
    linear-gradient(var(--tk), var(--tk)) 10px 10px / 10px 1px no-repeat, linear-gradient(var(--tk), var(--tk)) 10px 10px / 1px 10px no-repeat,
    linear-gradient(var(--tk), var(--tk)) calc(100% - 10px) 10px / 10px 1px no-repeat, linear-gradient(var(--tk), var(--tk)) calc(100% - 10px) 10px / 1px 10px no-repeat,
    linear-gradient(var(--tk), var(--tk)) 10px calc(100% - 10px) / 10px 1px no-repeat, linear-gradient(var(--tk), var(--tk)) 10px calc(100% - 10px) / 1px 10px no-repeat,
    linear-gradient(var(--tk), var(--tk)) calc(100% - 10px) calc(100% - 10px) / 10px 1px no-repeat, linear-gradient(var(--tk), var(--tk)) calc(100% - 10px) calc(100% - 10px) / 1px 10px no-repeat,
    var(--panel);
}
.ws-strip { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 32px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.ws-strip__dots { display: flex; gap: 4px; }
.ws-strip__dots i { width: 6px; height: 6px; background: var(--line-strong); }
.ws-strip__dots i:first-child { background: var(--accent); }
.ws-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 28px 32px 0; align-items: start; }
.ws-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.ws-log li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font: 400 14px/1.3 var(--f-mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.ws-log li b { font-weight: 600; font-size: 16px; color: var(--text); }
.ws-notes { min-height: 180px; padding: 16px; border-radius: var(--r-md); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); }
.ws-note { padding: 5px 0; font-size: 15px; color: var(--text); }
.ws-caret i { display: inline-block; width: 8px; height: 2px; margin-top: 8px; background: var(--text-2); }
.ws-dot { width: 6px; height: 6px; background: var(--accent); }
.ws__cta { position: relative; z-index: 2; display: flex; justify-content: center; margin-top: -26px; }
.ws__status { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 6px; margin-top: 28px; font: 500 12px/1.5 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); text-align: center; }
.ws__status span:not(:last-child)::after { content: "·"; margin: 0 10px; }

/* 8.6 specs */
.specs { padding-block: var(--sec-pad); }
.specs__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 4vw, 80px); align-items: start; }
.specs__head { position: sticky; top: 96px; }
.spec-list { border-top: 1px solid var(--line); }
.spec { display: grid; grid-template-columns: 150px 3.6em minmax(0, 1fr); align-items: baseline; gap: 12px 24px; padding: clamp(16px, 2.2vw, 26px) 0; border-bottom: 1px solid var(--line); font-size: clamp(2.5rem, 5vw, 4.5rem); }
.spec dt { font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.spec__fig { font: 900 1em/1 var(--f-dot); color: var(--text); white-space: nowrap; font-synthesis: none; font-variant-numeric: tabular-nums; }
.spec__desc { font-size: 16px; line-height: 1.45; color: var(--text-2); }
.roll { display: inline-block; }
@supports (grid-template-columns: subgrid) {
  .spec-list { display: grid; grid-template-columns: 150px max-content minmax(0, 1fr); column-gap: clamp(24px, 3vw, 48px); }
  .spec { grid-column: 1 / -1; grid-template-columns: subgrid; }
}

/* 8.7 continue */
.cont { min-height: 80svh; padding-block: clamp(64px, 10vh, 120px) clamp(220px, 36vh, 380px); }
.cont__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.countdown { display: block; font: 900 clamp(7.5rem, 18vw, 15rem)/.86 var(--f-dot); color: var(--text-3); font-synthesis: none; font-variant-numeric: tabular-nums; }
.countdown.blip { animation: blip var(--t-2) steps(2); }
.cont__title { margin-top: 12px; font-size: clamp(2.8rem, 1.54rem + 4.48vw, 5.95rem); }
.cont .lede { margin-top: 16px; }
.cont .btn { margin-top: 32px; }
.cont__aside { margin-top: 18px; font: 500 13px/1.4 var(--f-mono); color: var(--text-2); }

/* 8.8 footer */
.foot { position: relative; z-index: 1; padding-block: 24px var(--gutter); background: var(--bg); }
.foot__plate { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; gap: 32px; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.foot__name { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.foot__tag { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.foot__marks { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.foot__marks li { display: flex; align-items: center; gap: 10px; font: 500 12px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.foot__marks svg { width: 24px; height: 24px; color: var(--text); shape-rendering: crispEdges; }
.foot__links { justify-self: end; text-align: right; }
.foot__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 14px; }
.foot__copy { margin-top: 4px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; color: var(--text-2); }

/* 9 ─ DIALOGS + TOASTS ───────────────────────────────────────────────────── */
.dlg { width: min(560px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--panel); color: var(--text); box-shadow: var(--sh-panel); overflow: auto; overscroll-behavior: contain; }
.dlg::backdrop { background: #1114128C; }
:root[data-mode="dark"] .dlg::backdrop { background: #050706CC; }
.dlg__in { padding: 28px; }
.dlg h2 { margin: 8px 0 12px; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); }
.dlg__in > p:not(.tag) { color: var(--text-2); }
.dlg__in > p + p { margin-top: 12px; }
.dlg__intro { margin-bottom: 16px; }
.dlg .kmap { font-size: 14px; }
.dlg .field { margin-top: 24px; }
.dlg .seg { display: grid; }
.dlg__actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.mono-row { margin-top: 16px; font: 500 12px/1.5 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.hint--rm { margin-top: 24px; }
html.motion-ok .dlg[open] { animation: dlg-in var(--t-3) var(--ease-hw); }
html:not(.motion-ok) .dlg[open] { animation: fade var(--t-2) linear; }
.dlg[open]::backdrop { animation: fade var(--t-2) linear; }
html.motion-ok .dlg.is-closing { animation: dlg-out var(--t-2) var(--ease-hw) forwards; }
.dlg.is-closing::backdrop { animation: fade var(--t-2) linear reverse forwards; }

.dlg--focus { width: min(1200px, calc(100% - 32px)); height: min(820px, calc(100dvh - 32px)); max-height: none; overflow: hidden; }
.fm { display: flex; flex-direction: column; height: 100%; }
.fm__head { display: flex; align-items: center; gap: 12px 16px; min-height: 64px; padding: 8px 12px 8px 24px; border-bottom: 1px solid var(--line); }
.fm__title { margin-right: auto; min-width: 0; }
.fm__title .tag { font-size: 11px; }
.fm__title h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.02em; }
.fm__session { font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.swatches { display: flex; margin: 0; padding: 0; border: 0; min-width: 0; }
.swatch { position: relative; display: grid; place-items: center; width: 40px; height: 44px; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch i { position: relative; width: 24px; height: 24px; border-radius: 6px; background: var(--c-lcd); box-shadow: inset 0 0 0 1px var(--line-strong); pointer-events: none; }
.swatch i::after { content: ""; position: absolute; inset: 8px; border-radius: 1px; background: var(--c-acc); }
.swatch input:checked ~ i { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.swatch input:focus-visible { outline: none; box-shadow: none; }
.swatch input:focus-visible ~ i { outline: 2px solid var(--focus); outline-offset: 6px; }
.fm__tools { display: flex; gap: 2px; }
.fm__close { gap: 8px; padding: 0 12px; }
.fm__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 24px; padding: 24px; }
.fm__device { align-self: start; }
.fm__device .dd1 { --lcd-size: 56px; }
.fm__tabs { display: none; }
.fm__panel { display: flex; flex-direction: column; min-height: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.fm__panelhead { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: -8px; }
.fm__panelhead h3 { font-size: 18px; }
.log-empty { padding: 10px 0; font-size: 15px; color: var(--text-2); }
.log { flex: 1; min-height: 0; overflow: auto; margin: 0 -10px; padding: 0 10px; }
.log-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 16px; width: 100%; padding: 12px 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; }
.log-row:hover { background: var(--bg-raised); }
.log-row__expr { grid-column: 1; grid-row: 1; font: 400 13px/1.3 var(--f-mono); color: var(--text-2); overflow-wrap: anywhere; }
.log-row__copy { grid-column: 1; grid-row: 2; font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; color: var(--accent); opacity: 0; }
.log-row__res { grid-column: 2; grid-row: 1 / 3; max-width: 22ch; font: 600 18px/1.25 var(--f-mono); color: var(--text); text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.log-row:hover .log-row__copy, .log-row:focus-visible .log-row__copy, .log-row.is-copied .log-row__copy { opacity: 1; }
.fm__notes textarea { flex: 1; width: 100%; min-height: 140px; resize: none; padding: 14px 16px; border: 1px solid var(--line-input); border-radius: var(--r-md); background: var(--bg-raised); font: 400 16px/1.55 var(--f-sans); color: var(--text); }
.fm__notes textarea::placeholder { color: var(--text-2); }
.fm__notes textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 8px var(--focus-halo); }
.notes-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font: 500 12px/1.3 var(--f-mono); color: var(--text-2); }
html.motion-ok .lcd-fx.fx-flicker::before { animation: flicker 210ms steps(1); }

.toast {
  position: fixed; left: 24px; bottom: 24px; z-index: 90; display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 2px 12px;
  min-height: 48px; max-width: min(320px, calc(100% - 32px)); padding: 10px 16px 10px 16px; overflow: hidden;
  border-radius: var(--r-sm); background: var(--toast-bg); color: var(--toast-ink); box-shadow: 0 16px 32px -16px #00000073;
  opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--t-2) linear, transform var(--t-2) var(--ease-hw), visibility 0s var(--t-2);
}
.toast.is-on { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity var(--t-2) linear, transform var(--t-2) var(--ease-hw), visibility 0s; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent-hi); transform-origin: 50% 0; }
:root[data-mode="dark"] .toast::before { background: var(--accent); }
.toast.is-danger::before { background: #FF7B72; }
html.motion-ok .toast.is-on::before { animation: edge var(--t-2) steps(3); }
.toast__ico { grid-row: 1 / 3; width: 12px; height: 12px; background: var(--accent-hi); clip-path: polygon(0 25%, 25% 25%, 25% 0, 75% 0, 75% 25%, 100% 25%, 100% 75%, 75% 75%, 75% 100%, 25% 100%, 25% 75%, 0 75%); }
:root[data-mode="dark"] .toast__ico { background: var(--accent); }
.toast.is-danger .toast__ico { background: #FF7B72; }
.toast__t { font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.toast__l { font: 400 14px/1.4 var(--f-sans); }

/* 10 ─ MOTION STATES ─────────────────────────────────────────────────────── */
.is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }
html.motion-ok [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 480ms var(--ease-hw), transform 480ms var(--ease-hw); transition-delay: calc(var(--i, 0) * 60ms); animation: reveal-failsafe 0s 4s forwards; }
html.motion-ok [data-reveal].is-in { opacity: 1; transform: none; animation: none; }
html.motion-ok .ctl__diagram .cap { opacity: 0; transform: translateY(12px); }
html.motion-ok .ctl__diagram.is-in .cap { opacity: 1; transform: none; transition: opacity var(--t-3) linear, transform var(--t-3) var(--ease-hw); transition-delay: calc(var(--i, 0) * 20ms); }
html.motion-ok .ctl__diagram.is-waved .cap { transition-delay: 0s; transition-property: transform; }
html.motion-ok .ctl__diagram.is-in .cap.hit { transform: translateY(2px); transition-duration: var(--t-1); }
html.motion-ok .ws-log li { opacity: 0; }
html.motion-ok .ws-panel.is-typed .ws-log li { animation: on 180ms steps(3) forwards; animation-delay: calc(var(--i) * 60ms + 120ms); }
html.motion-ok .ws-panel.is-typed .ws-dot { animation: blink2 400ms steps(1) 2 480ms; }

/* status and LCD effects */
html.motion-ok .lcd-msg.is-idle { animation: blink 1.2s steps(1) 4; }
html.motion-ok .lcd-msg.pop { animation: pop var(--t-2) steps(2); }
html.motion-ok .lcd-fx.fx-flash::before { animation: on 180ms steps(3); }
html.motion-ok .lcd-fx.fx-scan::after { animation: scan var(--t-3) steps(8); }
html.motion-ok .lcd-fx.fx-wipe::after { animation: scan 120ms steps(3); }
html.motion-ok .dd1__lcd.fx-jit { animation: jit 200ms steps(1); }

/* boot (once per session) */
html.is-boot:not(.has-input) .hero__head { animation: rise 480ms var(--ease-hw) backwards; }
html.is-boot:not(.has-input) #hero-device .lcd-ghost { animation: ghost 700ms steps(1) backwards; }
html.is-boot:not(.has-input) #hero-device .lcd-fx::after { animation: scan var(--t-3) steps(8) 80ms backwards; }
html.is-boot:not(.has-input) #hero-device .lcd-out, html.is-boot:not(.has-input) #hero-device .lcd-expr { animation: on 210ms steps(3) 320ms backwards; }
html.is-boot:not(.has-input) #hero-device .led--pwr { animation: on 240ms linear 460ms backwards; }
html.is-boot:not(.has-input) #hero-device .lcd-msg.is-idle { animation: on 70ms steps(1) 600ms backwards, blink 1.2s steps(1) 670ms 4; }
html.is-boot .xp__lit { animation: xpboot 480ms steps(6); }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes on { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes ghost { 0% { color: var(--lcd-ink); } 6% { color: var(--lcd-ghost); } }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes blink2 { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes pop { 50% { transform: scale(1.12); } }
@keyframes blip { 50% { opacity: .2; } }
@keyframes jit { 0% { transform: translateX(0); } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(0); } }
@keyframes flicker { 0% { opacity: 1; } 33% { opacity: 0; } 66% { opacity: 1; } 100% { opacity: 0; } }
@keyframes odo { from { transform: translateY(0); } to { transform: translateY(-1em); } }
@keyframes cell { to { opacity: 1; } }
@keyframes slot { 50% { transform: translateY(-28px) scale(.96); } }
@keyframes edge { from { transform: scaleY(0); } }
@keyframes xpboot { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes halo { from { opacity: .6; transform: scale(.6); } to { opacity: 0; transform: scale(1.4); } }
@keyframes streak { from { transform: translateX(-100%); } to { transform: translateX(calc(6 * var(--px))); } }
@keyframes twinkle { 0%, 100% { opacity: .7; } 50% { opacity: .35; } }
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }
@keyframes orb {
  0% { transform: none; opacity: 1; } 12% { transform: translate(calc(var(--px) * 2), calc(var(--px) * 4)); } 24% { transform: translate(calc(var(--px) * 3), calc(var(--px) * 12)); }
  36% { transform: translate(calc(var(--px) * 4), calc(var(--px) * 22)); } 44% { transform: translate(calc(var(--px) * 4), calc(var(--px) * 30)); opacity: 1; }
  50% { opacity: 0; } 56% { transform: translate(calc(var(--px) * -2), calc(var(--px) * 26)); opacity: 1; }
  66% { transform: translate(calc(var(--px) * -2), calc(var(--px) * 18)); } 76% { transform: translate(calc(var(--px) * -1), calc(var(--px) * 10)); }
  88% { transform: translate(0, calc(var(--px) * 4)); } 100% { transform: none; }
}

html.is-switching body, html.is-switching .hud, html.is-switching .plate, html.is-switching .dd1, html.is-switching .key,
html.is-switching .dd1__lcd, html.is-switching .dlg, html.is-switching .mini, html.is-switching .foot {
  transition: background-color .24s steps(3), color .24s steps(3), border-color .24s steps(3);
}

.lowfx .w-far { --c2: var(--w-far); }
.lowfx .dissolve i { animation-delay: 0s !important; }

/* 11 ─ REDUCED MOTION + MINIMAL ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .key, .cap, .btn, .cart__body { transition: none; }
  .key:hover { transform: none; }
  .key:active, .key.pressed { transform: none; background: var(--plate); }
  .cap.hit { transform: none; background: var(--key-fn); }
  .dd1__bezel.fx-err { box-shadow: none; outline: 2px solid var(--danger); outline-offset: 1px; }
  .toast, .toast.is-on { transform: none; }
  .chip, html.is-docked .chip { transform: none; }
  .nav a::after { transition: none; }
  .dlg[open], .dlg[open]::backdrop { animation: fade var(--t-2) linear; }
}
html[data-fx="minimal"] .key:active, html[data-fx="minimal"] .key.pressed { transform: translateY(1px); }
html[data-fx="minimal"] .key:hover { transform: none; }

/* 12 ─ RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-aspect-ratio: 4/3) and (min-width: 1000px) {
  .ctl__copy, .fin__copy, .ws__head, .specs__head { background: var(--plate-bg); border-radius: var(--r-lg); padding: 24px; }
}

@media (min-width: 760px) {
  .hud__sound { display: inline-flex; }
}
@media (min-width: 1000px) {
  .nav { display: flex; }
}
@media (min-width: 1100px) {
  .hud .icon-btn:has(.icon-btn__lbl) { width: auto; padding: 0 12px; }
  .hud .icon-btn__lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}
@media (min-width: 1400px) {
  .dock { display: flex; justify-content: flex-end; width: 176px; margin-right: 8px; }
}
@media (max-width: 1399px) {
  html.is-docked .btn-focus { background: var(--lcd-bg); color: var(--lcd-ink); box-shadow: inset 0 0 0 1px var(--lcd-ghost); }
  html.is-docked .btn-focus__lbl, html.is-docked .btn-focus .kbd-f { display: none; }
  html.is-docked .btn-focus__chip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 900 16px/1 var(--f-dot); }
  html.is-docked .btn-focus__chip.is-long { font: 600 14px/1 var(--f-mono); }
}
@media (min-width: 1800px) {
  .hero__grid { --dev-w: clamp(300px, calc((100svh - 300px) * .6), 440px); }
}

@media (max-width: 1199px) {
  .carts__row { grid-template-columns: repeat(2, minmax(0, 160px)); row-gap: 28px; }
  .cart:nth-child(n) .cart__shell { translate: none; }
  .carts__row { padding-top: 40px; }
  .ws-grid { grid-template-columns: auto minmax(0, 1fr); }
  .ws-notes { display: none; }
}

@media (max-width: 999px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 24px; }
  .hero__stage { grid-column: 1 / -1; justify-self: center; }
  .hero__left, .hero__right { grid-row: 3; margin-bottom: 0; align-self: start; }
  .hero__right { grid-column: 2; justify-self: stretch; width: auto; }
  .hero__left { max-width: none; }
  .td__grid, html.motion-ok .td__grid { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .ctl__grid, .fin__grid, .specs__grid { grid-template-columns: minmax(0, 1fr); }
  .specs__head { position: static; }
  .ctl__copy, .fin__copy, .ws__head, .specs__head, .td__copy { background: var(--plate-bg); border-radius: var(--r-lg); padding: 24px; }
  .fin__device { order: -1; }
  .fm__body { grid-template-columns: 340px minmax(0, 1fr); }
  .fm__notes { grid-column: 2; }
  .fm__body { grid-template-rows: auto; overflow: auto; }
  .fm__log { grid-column: 2; grid-row: 1; }
  .fm__notes { grid-row: 2; }
  .fm__session { display: none; }
  .scroll-cue { display: none; }
}

@media (max-width: 999px) and (min-width: 760px) {
  html.motion-ok .td__stage { align-items: flex-start; }
  html.motion-ok .td__copy { padding: 16px 20px; }
  html.motion-ok .td__list { display: none; }
  html.motion-ok .iso-wrap { width: min(100%, calc((100svh - var(--hud-h) - 260px) * 4 / 3)); }
}

@media (max-width: 759px) {
  .hud__bar { gap: 8px; }
  .brand { font-size: 17px; gap: 8px; }
  .btn-focus { width: 76px; padding: 0; }
  .btn-focus .m-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .kbd-f { display: none; }
  .hero__grid { display: flex; flex-direction: column; align-items: stretch; padding-block: 22px 56px; }
  .hero__head { text-align: left; }
  .hero__title { font-size: clamp(3rem, 14vw, 4.5rem); line-height: .92; margin-top: 12px; }
  .hero__l2 { display: block; }
  .hero__stage { width: min(100%, 380px); margin: 22px auto 0; perspective: none; }
  .hero__left, .hero__right { align-self: stretch; }
  .hero__left { margin-top: 24px; gap: 0; }
  .hero__plate { padding: 20px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .hero__right { margin-top: 12px; }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
  .readout div { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .readout div:last-child { border-bottom: 1px solid var(--line); }
  .dd1 { --key-h: 56px; --lcd-size: 44px; padding: 16px; border-radius: 22px; }
  .dd1__keys { padding: 6px; }
  #hero-device .lcd-btn--snd { display: grid; }
  #hero-device .lcd-note { display: none; }

  .td__list { grid-template-columns: minmax(0, 1fr); }
  html.motion-ok .td__stage { align-items: stretch; flex-direction: column; padding-block: 16px 16px; }
  html.motion-ok .td__grid { display: flex; flex-direction: column; align-items: stretch; flex: 1; min-height: 0; row-gap: 8px; }
  html.motion-ok .td__copy { position: static; padding: 0; background: none; }
  html.motion-ok .td__copy .numeral, html.motion-ok .td__copy .lede { display: none; }
  html.motion-ok .td__copy h2 { font-size: 1.75rem; margin-top: 8px; }
  html.motion-ok .td__viz { flex: 1; min-height: 0; display: flex; align-items: center; }
  html.motion-ok .iso-wrap { width: min(100%, calc((100svh - 330px) * 3 / 4)); aspect-ratio: 3 / 4; }
  html.motion-ok .td__list { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 16px; z-index: 3; height: 132px; margin: 0; display: block; background: var(--plate-bg); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
  html.motion-ok .td__list li { position: absolute; inset: 0; padding: 16px 18px; border-left: 0; transition: opacity var(--t-3) linear; }
  html.motion-ok .td__list li:not(.is-active) { opacity: 0; clip-path: inset(50%); }
  html.motion-ok .td__list p { font-size: 14px; }
  html.motion-ok .td__hud { display: none; }
  html.motion-ok .skip-inline { top: 8px; }
  .iso { transform: rotateX(40deg) scale(.9); }
  .ly1 { transform: translateZ(21px); } .ly2 { transform: translateZ(42px); } .ly3 { transform: translateZ(63px); } .ly4 { transform: translateZ(84px); }
  html.motion-ok .ly { left: 20%; width: 60%; top: 10%; height: 80%; }
  .callouts, .co-dot, .co-label { display: none; }

  .kbd-3d { --cap: 44px; flex-wrap: wrap; }
  .pad { gap: 6px; }
  .cap { font-size: 14px; }
  .cap small { display: none; }
  .kbd-3d { gap: 16px; }
  .ctl__diagram { padding: 20px; }
  .kmap { font-size: 14px; }
  .kmap th:first-child, .kmap td:first-child { width: 48%; }

  .fin__device .mini { width: 240px; }
  .carts__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cart__body { height: 172px; }
  .cart__win { top: 32px; bottom: 40px; }
  .fin .seg { display: grid; width: 100%; }

  .ws-panel { padding-bottom: 24px; }
  .ws-strip { padding: 0 18px; }
  .ws-grid { grid-template-columns: minmax(0, 1fr); padding: 18px 18px 0; gap: 18px; }
  .ws-dev { display: flex; justify-content: center; }
  .ws-log li:nth-child(4) { display: none; }
  .ws__cta { margin-top: 20px; }
  .ws__cta .btn { width: 100%; }

  .spec-list { display: block; }
  .spec { grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: clamp(2.25rem, 11vw, 3rem); }
  .countdown { font-size: clamp(6rem, 30vw, 10rem); }
  .cont .btn { width: 100%; }

  .foot__plate { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
  .foot__links { justify-self: start; text-align: left; }
  .foot__btns { justify-content: flex-start; margin-left: -4px; }

  .toast { left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); transform: translate(-50%, 8px); width: max-content; }
  .toast.is-on { transform: translate(-50%, 0); }

  .dlg--focus { inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .fm__head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; min-height: 56px; padding: 6px 6px 0 16px; gap: 0 4px; background: var(--panel); }
  .fm__title .tag, .swatches, .fm__closelbl, .fm__close kbd { display: none; }
  .fm__session { display: block; grid-column: 1 / -1; padding: 2px 0 8px; font-size: 11px; }
  .fm__close { width: 44px; padding: 0; }
  .fm__body { display: flex; flex-direction: column; overflow: auto; gap: 16px; padding: 16px; }
  .fm__device { align-self: stretch; }
  .fm__device .dd1 { --lcd-size: 44px; max-width: 380px; margin-inline: auto; }
  .fm__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--line-input); border-radius: 10px; }
  .fm__tab { min-height: 38px; border: 0; border-radius: 7px; background: transparent; font: 500 15px/1 var(--f-sans); color: var(--text-2); }
  .fm__tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
  .fm[data-tab="log"] .fm__notes, .fm[data-tab="notes"] .fm__log { display: none; }
  .fm__panel { min-height: 320px; flex: none; }
  .log { max-height: none; }
}

@media (max-width: 759px) and (max-height: 700px) {
  html.motion-ok .td__list { height: 116px; }
}
@media (max-width: 399px) {
  .dd1 { padding: 14px; }
  .dd1__keys { gap: 6px; }
  .hero__plate { padding: 16px; }
  .cart__code { font-size: 24px; }
}
@media (max-width: 339px) {
  .brand__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (hover: none) and (pointer: coarse) {
  .only-touch-block { display: block; }
  .only-fine-block, .ctl__diagram { display: none; }
  .ctl__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 880px) and (min-width: 1000px) {
  html.motion-ok .td__copy .numeral { display: none; }
  html.motion-ok .td__copy h2 { font-size: clamp(2rem, 1rem + 2.4vw, 3.25rem); }
  html.motion-ok .td__copy .lede { font-size: 1rem; margin-top: 12px; }
  html.motion-ok .td__list p { font-size: 14px; line-height: 1.45; }
  html.motion-ok .td__list li { padding-block: 7px; }
}

/* Calcy: one screen (gauge.png, 1080x1920) sliced into exploded layers.
   Every slice is the full screenshot clipped to one horizontal band, so the
   layers line up exactly when the stack is assembled. */
.ly--base { background: #EFEDE6; box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 12px 28px rgba(0,0,0,.3); overflow: hidden; }
.ly0, .ly1, .ly2, .ly3, .ly4 { background: transparent; box-shadow: none; }
.ly0.ly--base { background: #EFEDE6; }
.slice { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: fill; border-radius: inherit; }
.slice--head   { clip-path: inset(0 0 94.5% 0); }
.slice--panel   { clip-path: inset(12.2% 0 68% 0 round 1.2%); }
.slice--fields   { clip-path: inset(32.2% 0 41% 0); }
.slice--cond   { clip-path: inset(61.4% 0 33.2% 0); }
.slice--keys   { clip-path: inset(67.6% 0 3.8% 0); }
html.motion-ok .td:not([data-step="0"]) .ly { opacity: .72; }


/* ==========================================================================
   Calcy additions: diamond loader, reference-style hero, screenshot frames,
   download rows, PAY ONCE dialog
   ========================================================================== */
[hidden] { display: none !important; }
:root { --f-px: "Press Start 2P", var(--f-dot); }

/* Hero (reference layout) */
.hero2 .hero2__grid { flex: 1; align-self: center; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; padding-block: calc(var(--hud-h) + 48px) 64px; }
.hero2__eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font: 500 12px/1.4 var(--f-mono); letter-spacing: 3px; text-transform: uppercase; color: var(--text-2); }
.app-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; color: var(--accent); }
.app-icon svg { width: 22px; height: 22px; }
.hero2 .hero__title { margin: 0; font: 400 clamp(44px, 2rem + 4vw, 84px)/1 var(--f-px); letter-spacing: 0; color: var(--text); white-space: nowrap; }
.hero2 .hero__title .ltr { display: inline-block; }
.hero2__uline { height: 6px; width: 124px; background: var(--accent); margin-top: 22px; }
.hero2__p { max-width: 520px; margin-top: 28px; font-size: 17px; line-height: 1.8; color: var(--text); }
.hero2__p strong { font-weight: 600; }
.hero2__p .soft { color: var(--text-2); }
.hero2__cta { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.sha { font: 12px/1.5 var(--f-mono); color: var(--text-2); }
.sha__lbl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.hero2__chips { display: flex; flex-wrap: wrap; row-gap: 6px; margin-top: 30px; font: 12px/1.6 var(--f-mono); color: var(--text-2); }
.hero2__chips span { display: inline-flex; align-items: center; }
.hero2__chips i { font-style: normal; color: var(--accent); margin-right: 6px; }
.hero2__chips b { font-weight: 400; color: var(--line-strong); margin: 0 11px; }
.hero2__stage { display: flex; flex-direction: column; align-items: center; gap: 14px; perspective: 1200px; }
.hero2__cap { font: 11.5px/1.4 var(--f-mono); letter-spacing: 1px; color: var(--text-2); }
@keyframes calcySwoop { 0% { opacity: 0; transform: translateY(74%) translateX(-7px) scale(.8); } 100% { opacity: 1; transform: none; } }
@keyframes calcyRise { 0% { opacity: 0; transform: translateY(22px); } 100% { opacity: 1; transform: none; } }
@keyframes calcyPhone { 0% { opacity: 0; transform: translateY(34px) scale(.955); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  html.js .hero2 .ltr, html.js .hero2 .h-anim, html.js .hero2 .h-phone { opacity: 0; }
  html.js.is-loaded .hero2 .ltr { animation: calcySwoop .58s cubic-bezier(.16,1,.3,1) both; }
  html.js.is-loaded .hero2 .h-anim { animation: calcyRise .6s cubic-bezier(.16,1,.3,1) both; }
  html.js.is-loaded .hero2 .h-phone { animation: calcyPhone .8s cubic-bezier(.16,1,.3,1) both; }
  html.js .hero2__uline { width: 0; transition: width .7s cubic-bezier(.16,1,.3,1) .52s; }
  html.js.is-loaded .hero2__uline { width: 124px; }
}
@media (max-width: 900px) {
  .hero2 .hero2__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: calc(var(--hud-h) + 32px) 56px; }
  .hero2__p { font-size: 16px; }
}

/* Download (reference row layout) */
.dls { padding-block: var(--sec-pad); }
.dls__head { max-width: 640px; }
.dl-table { margin-top: 32px; border: 1px solid var(--line); background: var(--bg-raised); border-radius: var(--r-lg); overflow: hidden; }
.dl-row { display: grid; grid-template-columns: 1.2fr .7fr 1.4fr auto; gap: 20px; align-items: center; padding: 18px 22px; }
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-name { display: flex; align-items: center; gap: 9px; font: 700 14px/1.3 var(--f-mono); color: var(--text); }
.dl-name i, .dl-fine i { font-style: normal; color: var(--accent); }
.dl-size { font: 12.5px/1.3 var(--f-mono); color: var(--text-2); }
.dl-meta { font: 12px/1.4 var(--f-mono); color: var(--text-3); }
.dl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; background: var(--text); color: var(--bg); font: 700 14px/1 var(--f-mono); letter-spacing: 1px; padding: 15px 28px; border-radius: var(--r-sm); text-decoration: none; transition: filter .12s, transform .12s; }
.dl-btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.dl-btn:focus-visible, .dl-ghost:focus-visible, .coin:focus-visible, .pay__seg button:focus-visible, .pay__mini:focus-visible, .pay__x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-btn--acc { background: var(--accent); color: var(--on-accent); font-size: 13px; padding: 11px 22px; white-space: nowrap; }
.dl-ghost { border: 1px solid var(--line); color: var(--text-2); font: 700 13px/1 var(--f-mono); letter-spacing: 1px; padding: 11px 22px; text-decoration: none; text-align: center; white-space: nowrap; border-radius: var(--r-sm); transition: border-color .12s, color .12s; }
.dl-ghost:hover { border-color: var(--accent); color: var(--text); }
.dl-fine { margin-top: 18px; max-width: 640px; font: 11.5px/1.75 var(--f-mono); color: var(--text-3); }
@media (max-width: 720px) {
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px; }
  .dl-size { display: none; }
  .dl-meta { grid-column: 1; grid-row: 2; }
  .dl-row > .dl-btn, .dl-row > .dl-ghost { grid-column: 2; grid-row: 1 / span 2; }
}

/* PAY ONCE dialog */
.dlg--pay { width: min(468px, calc(100% - 32px)); border: 1px solid var(--line); }
.pay__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.pay__ttl { display: flex; align-items: baseline; gap: 10px; }
.pay__title { font: 13px/1 var(--f-px); color: var(--text); }
.pay__channel { font: 11px/1 var(--f-mono); color: var(--text-3); }
.pay__x { background: transparent; border: 1px solid var(--line); color: var(--text-2); font: 12px/1 var(--f-mono); width: 30px; height: 30px; cursor: pointer; border-radius: var(--r-xs); }
.pay__x:hover { color: var(--text); border-color: var(--accent); }
.pay__body { padding: 22px; }
.pay__price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.pay__n { font: 30px/1.2 var(--f-px); color: var(--text); }
.pay__t { font: 12px/1.5 var(--f-mono); color: var(--text-2); }
.pay__seg { display: flex; border: 1px solid var(--line); margin: 14px 0 20px; border-radius: var(--r-sm); overflow: hidden; }
.pay__seg button { flex: 1; background: transparent; border: 0; border-right: 1px solid var(--line); font: 12px/1 var(--f-mono); color: var(--text-2); padding: 9px 0; cursor: pointer; letter-spacing: 1px; }
.pay__seg button:last-child { border-right: 0; }
.pay__seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.pay__lbl { font: 11px/1 var(--f-mono); letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.pay__coins { display: flex; flex-direction: column; gap: 10px; }
.coin { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); padding: 14px 16px; cursor: pointer; transition: border-color .12s, transform .12s; font-family: var(--f-mono); color: var(--text); border-radius: var(--r-sm); }
.coin:hover { border-color: var(--accent); transform: translateX(2px); }
.coin__chip { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; color: #fff; font-weight: 700; }
.coin__chip--sm { width: 30px; height: 30px; font-size: 15px; }
.coin__t { flex: 1; }
.coin__t b { display: block; font-size: 14px; }
.coin__t span { font-size: 11px; color: var(--text-2); }
.coin__go { font-size: 12px; color: var(--accent); font-weight: 700; }
.pay__fine { margin-top: 18px; font: 11px/1.7 var(--f-mono); color: var(--text-3); }
#pay-inv:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
.inv__top { display: flex; align-items: center; gap: 10px; }
.inv__h { font: 700 13px/1.4 var(--f-mono); color: var(--text); }
.inv__c { font: 13px/1.4 var(--f-mono); color: var(--accent); }
.inv__card { background: var(--bg); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; border-radius: var(--r-sm); }
.inv__addr { font: 12px/1.5 var(--f-mono); color: var(--text); word-break: break-all; text-align: center; user-select: all; }
.pay__mini { background: transparent; border: 1px solid var(--line); color: var(--text-2); font: 11px/1 var(--f-mono); padding: 8px 12px; cursor: pointer; letter-spacing: 1px; border-radius: var(--r-xs); }
.pay__mini:hover { border-color: var(--accent); color: var(--text); }
.inv__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pixel 6 frame: the user's own frame PNG, with the screenshot behind its screen aperture.
   Aperture measured from the asset: 2.67% / 2.25% / 94.42% / 94.72%. */
.p6 { --w: 296px; position: relative; width: var(--w); flex: 0 0 auto; font-size: calc(var(--w) / 100); }
.p6__frame { position: relative; z-index: 2; display: block; width: 100%; height: auto; pointer-events: none; }
.p6__screen { position: absolute; z-index: 1; left: 2.67%; top: 2.25%; width: 94.42%; height: 94.72%; overflow: hidden; border-radius: 5.4% / 2.5%; background: #F3EFEA; }
.p6__shot { display: block; width: 100%; height: 100%; object-fit: fill; }
.fm__device .p6, .ws-dev .p6, .fin__device .p6 { margin-inline: auto; }

/* Finishes: one screen per Calcy app, shown for the loaded cartridge */
.fin-screen { display: none; }
html[data-skin="amber"] .fin-screen[data-for="amber"], html:not([data-skin]) .fin-screen[data-for="amber"],
html[data-skin="phosphor"] .fin-screen[data-for="phosphor"], html[data-skin="signal"] .fin-screen[data-for="signal"], html[data-skin="cobalt"] .fin-screen[data-for="cobalt"] { display: block; }
.fin-soon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6em; background: #F3EFEA; color: #2b2a24; text-align: center; padding: 8em; }
html[data-skin] .fin-soon[data-for] { display: none; }
html[data-skin="phosphor"] .fin-soon[data-for="phosphor"], html[data-skin="signal"] .fin-soon[data-for="signal"], html[data-skin="cobalt"] .fin-soon[data-for="cobalt"] { display: flex; }
.fin-soon__k { font: 400 4.2em/1 var(--f-px); color: #1B3A31; }
.fin-soon b { font: 700 5.6em/1.2 var(--f-mono); }
.fin-soon__t { font: 500 3.6em/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #736e5f; }
.fin-soon::before { content: ""; width: 30%; height: 1.4em; background: var(--accent); order: -1; }

/* Controls: the real keypad, labelled */
.ctl .kbd-3d { display: block; }
.kp { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.kp__crop { position: relative; aspect-ratio: 900 / 572; overflow: hidden; background: #F3EFEA; box-shadow: 0 0 0 1px var(--line); }
.kp__crop img { position: absolute; left: 0; top: 0; width: 100%; height: auto; transform: translateY(-67.6%); }
.kp__notes { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.kp__notes li { display: flex; align-items: center; gap: 8px; font: 12.5px/1.35 var(--f-mono); color: var(--text-2); }
.kp__notes b { color: var(--text); font-weight: 600; }
.doodle { width: 46px; flex: 0 0 auto; color: var(--accent); }
.kp__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kp__tags span { font: 500 11.5px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line); padding: 8px 10px; }
@media (max-width: 560px) {
  .kp { grid-template-columns: minmax(0, 1fr); }
  .kp__notes { grid-template-rows: none; gap: 8px; margin-top: 4px; }
  .doodle { width: 30px; transform: rotate(90deg); }
}

/* Specs: the reference specification list */
.spx { display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.spx__rail { border-right: 1px solid var(--line); padding: 8px 34px 8px 0; }
.spx__idx { font: 400 15px/1 var(--f-px); color: var(--accent); }
.spx__lab { margin-top: 16px; font: 500 11px/1.4 var(--f-mono); letter-spacing: 3px; text-transform: uppercase; color: var(--text-2); }
.spx__note { margin-top: 14px; max-width: 150px; font: 11.5px/1.7 var(--f-mono); color: var(--text-3); }
.spx__body { padding-left: 44px; min-width: 0; }
.spx__h { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
.spx__list { margin: 28px 0 0; }
.spx__list > div { display: flex; align-items: baseline; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); font: 13px/1.5 var(--f-mono); }
.spx__list dt { flex: 1 1 auto; display: flex; align-items: baseline; gap: 8px; color: var(--text-2); }
.spx__list dt::after { content: ""; flex: 1 1 0; border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.spx__list dd { margin: 0; flex: 0 1 auto; text-align: right; color: var(--text); font-weight: 500; }
@media (max-width: 840px) {
  .spx { grid-template-columns: minmax(0, 1fr); }
  .spx__rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 28px; }
  .spx__body { padding: 28px 0 0; }
}

/* Buttons: plain rectangles, flat highlights, like the reference */
button, .btn, .icon-btn, .chip, .text-btn, .dl-btn, .dl-ghost, .coin, .pay__seg, .pay__seg button, .pay__mini, .pay__x,
.seg, .seg span, .fm__tab, .swatch i, .swatch i::after, .cart__shell, .cart__shell::before, .cart__win, kbd, .skip, .kbd-f { border-radius: 0 !important; }
.btn--primary, .btn--primary:hover { box-shadow: none; }
.btn--primary:focus-visible { box-shadow: 0 0 0 3px var(--focus-halo); }
.btn:active { transform: none; }

/* Made by humans */
.made { margin-top: 10px; font: 500 11.5px/1.7 var(--f-mono); letter-spacing: .06em; color: var(--text-3); }
.policy .made { margin-top: 3.5em; padding-top: 1.6em; border-top: 1px solid var(--line); }

/* Popups keep soft corners: the square-button rule above stops at the dialog edge */
.dlg { border-radius: 18px; }
.dlg :is(button, .btn, .coin, .pay__seg, .pay__mini, .pay__x, .seg, .seg span, kbd, .dl-btn, .dl-ghost, .inv__card, .coin__chip) { border-radius: 10px !important; }
.dlg .coin__chip { border-radius: 50% !important; }
.dlg .pay__seg { overflow: hidden; }
.dlg .pay__seg button { border-radius: 0 !important; }
.toast { border-radius: 12px; }

/* ==========================================================================
   Polish, selected: warm grain, one shadow, one rhythm, accent focus ring,
   drawn bitcoin mark, verify-page styles.
   ========================================================================== */

/* warm grain, so flat surfaces still read as paper */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
:root[data-mode="dark"] body::after { opacity: .02; }

/* one shadow recipe */
:root { --sh-1: 0 1px 2px rgba(17, 20, 18, .04), 0 18px 40px -24px rgba(17, 20, 18, .22); }
:root[data-mode="dark"] { --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -24px rgba(0, 0, 0, .6); }
.dlg, .p6, .toast, .cart__shell, .plate, .dl-table { box-shadow: var(--sh-1) !important; }

/* one vertical rhythm */
:root { --sec-pad: 128px; }
@media (max-width: 720px) { :root { --sec-pad: 88px; } }
.dls, .specs { padding-block: var(--sec-pad); }

/* the focus ring follows the loaded cartridge */
:root { --focus: var(--accent); }

/* the bitcoin mark is drawn, not a font glyph */
.coin__chip svg { width: 58%; height: 58%; }

/* support link inside the download copy */
.lede .text-btn { font: inherit; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* verify page: hash rows */
.hashes > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.hashes dt { font-weight: 600; color: var(--text); }
.hashes dd { margin: 8px 0 0; }
.hash { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 6px; }
.hash span { flex: 0 0 72px; font: 500 11.5px/1.6 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hash code, .cmd code { font: 13px/1.6 var(--f-mono); color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cmd { background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; border-radius: 10px; margin-top: 8px; }

/* release status on each cartridge — only Electrical is on Play */
.cart__stat { display: inline-block; margin-right: 8px; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.cart__stat--live { color: var(--accent); }

/* the method citation under the working panel */
.ws__cite {
  max-width: 68ch; margin: 14px auto 0; text-align: center;
  font: 11.5px/1.7 var(--f-mono); color: var(--text-3);
}
@media (max-width: 720px) { .ws__cite { text-align: left; font-size: 11px; } }

/* ── PRE-LAUNCH ──────────────────────────────────────────────────────────
   A button you cannot press yet should not look like a button you can. These
   read as a stamp: same shape and weight, no hover, no pointer, no promise. */
.dl-btn--soon {
  background: transparent; color: var(--text-2);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  cursor: default; pointer-events: none; letter-spacing: .06em;
}
.dl-btn--soon:hover { background: transparent; color: var(--text-2); filter: none; transform: none; translate: 0 0; }
.dl-btn--soon span { color: var(--accent); }
.dl-row .dl-btn--soon { justify-self: end; }

/* the same stamp inside the support dialog */
.pay__soon {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 12px 14px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.pay__soon b { color: var(--accent); font-weight: 400; }
/* the coin picker and its fine print are hidden until the addresses are real */
#pay-pick { display: none; }

/* ── CONTRAST FIX ────────────────────────────────────────────────────────
   --text-3 carries the smallest type on the page (.dl-meta, .dl-fine, .made,
   .sha__lbl, .spx__note — 10–12px) and was failing WCAG AA in both modes:
   3.22:1 on the light paper and 4.32:1 on the dark. Same hue, same role, just
   enough weight behind it to clear 4.5:1. */
:root { --text-3: #616A63; }                      /* 4.80:1 on --bg */
:root[data-mode="dark"] { --text-3: #7D8A82; }    /* 5.38:1 on --bg */
@media (prefers-color-scheme: dark) { :root:not([data-mode]) { --text-3: #7D8A82; } }

/* ── SHARP EDGES ─────────────────────────────────────────────────────────
   The download table and the footer sheet are square. A soft corner on a
   full-width plate reads as a card from a different site. */
.dl-table, .foot__plate { border-radius: 0; }
.dl-row:first-child, .dl-row:last-child { border-radius: 0; }
.dl-table .dl-btn, .dl-table .dl-ghost { border-radius: 0; }
