/* lab.mousabatarseh.com — THE REGISTER — styles */

/* Tokens. Light is the default: it is the main site's palette (paper, near-black ink, the same blue and type);
   dark follows the system or the toggle. Colour tokens are registered so a change cross-fades instead of snapping.
   A build chapter sets html[data-build]; that build's accent takes over --blue / --glow and tints the background,
   so the page and the scene change together at every build boundary (main.js re-reads the tokens while they fade). */
@property --bg { syntax: '<color>'; inherits: true; initial-value: #F0F1FA; }
@property --bg-2 { syntax: '<color>'; inherits: true; initial-value: #E4E6EF; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #0B0B0D; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: #2B2E3A; }
@property --line { syntax: '<color>'; inherits: true; initial-value: rgba(11, 11, 13, .14); }
@property --line-2 { syntax: '<color>'; inherits: true; initial-value: rgba(11, 11, 13, .28); }
@property --blue { syntax: '<color>'; inherits: true; initial-value: #0016EC; }
@property --blue-deep { syntax: '<color>'; inherits: true; initial-value: #0012C7; }
@property --glow { syntax: '<color>'; inherits: true; initial-value: #244BFF; }
@property --pass { syntax: '<color>'; inherits: true; initial-value: #0B0B0D; }
@property --warn { syntax: '<color>'; inherits: true; initial-value: #B27414; }
@property --fail { syntax: '<color>'; inherits: true; initial-value: #B41424; }
@property --glass { syntax: '<color>'; inherits: true; initial-value: rgba(11, 11, 13, .05); }

:root {
  /* the Lab's own accent (main-site blue); a build overrides these six */
  --acc-l: #0016EC; --acc-ld: #0012C7; --acc-lg: #244BFF;
  --acc-d: #244BFF; --acc-dd: #0016EC; --acc-dg: #3B1FD6;
  --paper: #F0F1FA; --paper-2: #E4E6EF; --night: #15161C; --night-2: #1C1E27;
  --bg: var(--paper); --bg-2: var(--paper-2);
  --ink: #0B0B0D; --ink-2: #2B2E3A; --muted: #6B6E7C;
  --line: rgba(11, 11, 13, .14); --line-2: rgba(11, 11, 13, .28);
  --blue: var(--acc-l); --blue-deep: var(--acc-ld); --glow: var(--acc-lg);
  --pass: #0B0B0D; --warn: #B27414; --fail: #B41424; --glass: rgba(11, 11, 13, .05);
  --violet: #3B1FD6; --purple: #7A1FE0;
  /* headings share the bench title's face (THE LAB: Manrope, tight, upper-case), a clean sans for reading, mono for instrument labels */
  --display: "Manrope", "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; /* one face for both halves of the Lab, as on the bench */
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* label plates: every small caption stands on a semi-transparent plate of the room's own colour, in either theme */
  --plate: color-mix(in srgb, var(--bg) 66%, transparent);
  --plate-strong: color-mix(in srgb, color-mix(in srgb, var(--bg) 90%, var(--blue)) 72%, transparent);
  --radius: 5px; /* one corner for every button, tag and label plate: squared-off, not pills */
  --chapter-h: 200vh;
  --copy-w: 38%;
  --gutter: clamp(20px, 5vw, 80px); /* the bench's margin */
  color-scheme: light;
  transition: --bg .9s ease, --bg-2 .9s ease, --ink .9s ease, --ink-2 .9s ease, --line .9s ease, --line-2 .9s ease,
    --blue .9s ease, --blue-deep .9s ease, --glow .9s ease, --pass .9s ease, --warn .9s ease, --fail .9s ease, --glass .9s ease;
}
/* each build's accent comes from that build's own site: text-safe on paper, lighter on night, plus a glow for the scene */
html[data-build="b01"] { --acc-l: #B6381E; --acc-ld: #9E2F17; --acc-lg: #CC4326; --acc-d: #E0704F; --acc-dd: #B6381E; --acc-dg: #CC4326; }  /* Import · terracotta */
html[data-build="b02"] { --acc-l: #1B5E2B; --acc-ld: #164D23; --acc-lg: #47AD48; --acc-d: #47AD48; --acc-dd: #1B5E2B; --acc-dg: #3B9440; }  /* Deals OS · Northgate green */
html[data-build="b03"] { --acc-l: #0C7A73; --acc-ld: #0A5F5A; --acc-lg: #5BCAC4; --acc-d: #5BCAC4; --acc-dd: #0C7A73; --acc-dg: #1B7A6E; }  /* Case Study · Halden teal */
html[data-build="b04"] { --acc-l: #9A5606; --acc-ld: #7C4505; --acc-lg: #D97706; --acc-d: #F2A33A; --acc-dd: #9A5606; --acc-dg: #D97706; }  /* SEO Tools · amber */
html[data-build="b05"] { --acc-l: #6A18C4; --acc-ld: #5A139F; --acc-lg: #7A1FE0; --acc-d: #A97BFF; --acc-dd: #6A18C4; --acc-dg: #7A1FE0; }  /* ASAS · brand purple */
html[data-build] { --bg: color-mix(in srgb, var(--paper) 90%, var(--acc-lg)); --bg-2: color-mix(in srgb, var(--paper-2) 86%, var(--acc-lg)); }

[data-theme="dark"] {
  --bg: var(--night); --bg-2: var(--night-2);
  --ink: #F0F1FA; --ink-2: #B9BCCB;
  --line: rgba(240, 241, 250, .14); --line-2: rgba(240, 241, 250, .28);
  --blue: var(--acc-d); --blue-deep: var(--acc-dd); --glow: var(--acc-dg);
  --pass: #F0F1FA; --warn: #E2A33B; --fail: #FF3B4A; --glass: rgba(240, 241, 250, .06);
  color-scheme: dark;
}
html[data-build][data-theme="dark"] {
  --bg: color-mix(in srgb, var(--night) 86%, var(--acc-dg)); --bg-2: color-mix(in srgb, var(--night-2) 82%, var(--acc-dg));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: var(--night); --bg-2: var(--night-2);
  --ink: #F0F1FA; --ink-2: #B9BCCB;
  --line: rgba(240, 241, 250, .14); --line-2: rgba(240, 241, 250, .28);
  --blue: var(--acc-d); --blue-deep: var(--acc-dd); --glow: var(--acc-dg);
  --pass: #F0F1FA; --warn: #E2A33B; --fail: #FF3B4A; --glass: rgba(240, 241, 250, .06);
  color-scheme: dark;
  }
  html[data-build]:not([data-theme="light"]) {
  --bg: color-mix(in srgb, var(--night) 86%, var(--acc-dg)); --bg-2: color-mix(in srgb, var(--night-2) 82%, var(--acc-dg));
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[data-motion="reduced"] { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1875rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 1200px) { body { font-size: 1.25rem; } }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.skip {
  position: fixed; top: -100px; left: var(--gutter); z-index: 50;
  background: var(--ink); color: var(--bg); padding: .5rem .8rem; font-family: var(--mono); font-size: .85rem;
}
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- stage (canvas + fallback) ---------- */
.stage {
  position: fixed; inset: 0; z-index: 0;
  background: var(--bg);
  overflow: hidden;
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 70% 45%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    radial-gradient(45% 40% at 15% 85%, color-mix(in srgb, var(--blue) 18%, transparent), transparent 70%);
}
[data-theme="light"] .stage::before { opacity: .45; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .stage::before { opacity: .45; } }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
body[data-ready="1"] .stage canvas { opacity: 1; }
body[data-tier="static"] .stage canvas { display: none; }

/* CSS fallback Register (no WebGL / static tier) */
.css-register {
  position: absolute; display: none;
  left: 62%; top: 50%; width: min(34vw, 300px); aspect-ratio: 5 / 7; transform: translate(-50%, -50%);
}
body[data-tier="static"] .css-register { display: block; }
body[data-tier="static"] .stage { background: radial-gradient(56% 48% at 62% 46%, color-mix(in srgb, var(--glow) 24%, transparent), transparent 72%), var(--bg); }
.css-register .pane {
  position: absolute; inset: 0;
  border: 1px solid var(--line-2);
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--line) 9px 10px),
    repeating-linear-gradient(0deg, transparent 0 9px, var(--line) 9px 10px),
    var(--glass);
  backdrop-filter: blur(2px);
}
.css-register .pane:nth-child(1) { transform: translate(-8%, 5%) rotate(-1.2deg); }
.css-register .pane:nth-child(3) { transform: translate(8%, -5%) rotate(1deg); }
.css-register .pane:nth-child(2) { border-color: var(--blue); box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent); }

/* ---------- chrome: the header the hub shares with the hosted builds (see lab-chrome.css) ---------- */
.brand {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 14px var(--gutter);
  pointer-events: none;
}
.brand > * { pointer-events: auto; }
.brand::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 128px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 42%, transparent 100%);
}
.brand-home { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-home small { font-family: var(--mono); font-size: .875rem; font-weight: 400; letter-spacing: .02em; color: var(--muted); }
.brand nav.top { margin-left: auto; display: flex; gap: 28px; font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.brand nav.top a { color: var(--ink-2); text-decoration: none; }
.brand nav.top a:hover { color: var(--ink); }
.brand .tools { display: flex; gap: 14px; }
.brand .tools button {
  display: inline-flex; align-items: center; height: 34px; padding: 0 15px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.brand .tools button:hover { color: var(--ink); border-color: var(--line-2); }
.brand .tools button[aria-pressed="true"] { color: var(--ink); border-color: var(--blue); }
/* ---------- project bar: the current build's title and address, fixed under the header ---------- */
.project-bar {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 19;
  display: flex; align-items: center; gap: 14px;
  min-height: 40px; padding: 0 var(--gutter);
  font-family: var(--mono); font-size: .875rem; letter-spacing: .04em; color: var(--ink-2);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .45s ease, opacity .35s ease, visibility 0s linear .45s;
}
.project-bar[data-show="1"] { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform .45s ease, opacity .35s ease; }
.project-bar::after { content: ""; position: absolute; left: var(--gutter); bottom: -1px; width: 26px; height: 1px; background: var(--blue); }
.pb-title { margin: 0; display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
.pb-num { color: var(--blue); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; white-space: nowrap; }
.pb-name { color: var(--ink); font-family: var(--font); font-weight: 600; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pb-dots { list-style: none; margin: 0; padding: 0; display: flex; }
.pb-dots a { display: block; width: 18px; height: 28px; position: relative; }
.pb-dots a::before { content: ""; position: absolute; left: 6px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background .25s ease; }
.pb-dots a:hover::before { background: var(--ink-2); }
.pb-dots a[aria-current="true"]::before { background: var(--blue); }
.pb-addr { margin-left: auto; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.pb-addr:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--blue); }
.pb-step { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); font-size: 1.15rem; line-height: 1; flex: none; }
.pb-step:hover { border-color: var(--ink); color: var(--ink); }
@media (min-width: 768px) and (max-width: 1359px) { html[data-tray="1"] .pb-addr { display: none; } html[data-tray="1"] .pb-next { margin-left: auto; } } /* the name keeps its room; the way out is the chapter's own button */
@media (max-width: 1023px) { .project-bar { gap: 10px; } .pb-name { font-size: .875rem; } }
@media (max-width: 1023px) and (orientation: portrait) {
  /* the bar closes the scene panel: it sits on the panel's lower edge, the copy scrolls beneath it */
  .project-bar { top: var(--panel-h); z-index: 6; transform: translateY(calc(-100% - 8px)); background: color-mix(in srgb, var(--bg) 82%, transparent); }
  .project-bar[data-show="1"] { transform: translateY(-100%); }
}
@media (max-width: 767px) {
  .project-bar { flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 7px; font-size: .75rem; }
  .pb-title { flex: 1; }
  .pb-name { font-size: .8125rem; }
  .pb-dots { order: 3; }
  .pb-next { order: 4; }
  .pb-addr { order: 5; flex-basis: 100%; margin-left: 0; font-size: .7rem; padding-left: 38px; }
}

@media (max-width: 520px) { .brand-home small { display: none; } .brand .tools { gap: 8px; } .brand .tools button { height: 30px; padding: 0 10px; font-size: 11px; } } /* both switches stay on the screen */
@media (max-width: 767px) {
  .brand { gap: 12px; }
  .brand nav.top { display: none; }
  .brand .tools { margin-left: auto; }
}

.site-foot {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.4rem;
  padding: 1.3rem var(--gutter) calc(1.3rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
  font-family: var(--mono); font-size: .875rem; color: var(--muted);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
@media (max-width: 1023px) { .site-foot { padding-bottom: calc(3.6rem + env(safe-area-inset-bottom)); } }

.rail {
  position: fixed; right: calc(var(--gutter) - 12px); top: 50%; transform: translateY(-50%); z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .04em;
  padding: 10px 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.rail a {
  display: grid; grid-template-columns: 14px auto; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; padding: 2px 6px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .14em;
}
.rail a::before { content: ""; width: 0; height: 1px; background: var(--blue); transition: width .25s ease; justify-self: end; }
.rail a:hover { color: var(--ink-2); }
.rail a[aria-current="true"] { color: var(--ink); }
.rail a[aria-current="true"]::before { width: 12px; }
.rail a[data-first="1"] { margin-top: 8px; position: relative; }
.rail a[data-first="1"]::after { content: ""; position: absolute; left: 6px; right: 6px; top: -4px; height: 1px; background: var(--line-2); }
@media (max-width: 1023px) {
  .rail {
    top: auto; right: 0; left: 0; bottom: 0; transform: none;
    flex-direction: row; gap: 0; overflow-x: auto; scrollbar-width: none;
    padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line); border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail a { grid-template-columns: auto; padding: 6px 8px; }
  .rail a::before { display: none; }
  .rail a[aria-current="true"] { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: .4em; }
  .rail a[data-first="1"] { margin-top: 0; margin-left: 8px; }
  .rail a[data-first="1"]::after { left: -4px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
}

/* ---------- chapters ---------- */
main { position: relative; z-index: 1; }

.chapter {
  position: relative;
  min-height: var(--chapter-h);
  padding: 0 var(--gutter);
}
.chapter.hero { min-height: 160vh; }
.chapter:last-child { min-height: 130vh; }

.copy {
  position: sticky; top: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: flex-start;
  width: var(--copy-w); max-width: 34rem;
  padding: 112px 0 40px;
}
/* auto margins centre the block when it fits and fall back to top alignment when it is taller than the viewport */
.copy > :first-child { margin-top: auto; }
.copy > :last-child { margin-bottom: auto; }
/* the index is the end of the page: it scrolls as a normal column instead of pinning */
.chapter:last-child .copy { position: static; min-height: 0; }
.chapter:last-child .copy > :first-child { margin-top: 0; }
.chapter:last-child .copy > :last-child { margin-bottom: 0; }

.kicker {
  font-family: var(--mono); font-size: 13.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 16px;
  display: flex; align-items: flex-start; gap: .8rem; line-height: 1.5;
  align-self: flex-start; max-width: 100%; padding: 7px 14px 7px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--plate);
}
.kicker::before { content: ""; width: 26px; height: 1px; margin-top: .75em; flex-shrink: 0; background: var(--blue); }
.kicker .num { color: var(--blue); white-space: nowrap; flex-shrink: 0; }
.kicker .part { white-space: nowrap; }

h1, h2 {
  font-family: var(--display); font-weight: 500; font-synthesis: none; letter-spacing: -.03em; line-height: 1.02; /* the bench sheet's heading, exactly */
  margin: 0 0 1.1rem;
  font-size: clamp(32px, 3.45vw, 50px);
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 3.9vw, 58px); }
.hero h1 { font-size: clamp(3rem, 6.2vw, 6.2rem); font-weight: 600; letter-spacing: -.045em; line-height: .86; text-transform: uppercase; margin-bottom: 1.2rem; }

.lede { margin: 0 0 1.2rem; color: color-mix(in srgb, var(--ink) 86%, transparent); max-width: 46ch; font-size: 17px; line-height: 1.58; }
.hero .lede { font-size: clamp(18px, 1.45vw, 22px); line-height: 1.55; }
/* the description sits in a machined metal frame, anodized in the build's own colour */
.chapter:not(.hero) .lede { position: relative; padding: 15px 18px; border-radius: 10px; background: var(--plate-strong); }
.chapter:not(.hero) .lede::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 55%, #fff) 0%, var(--blue) 18%, color-mix(in srgb, var(--blue) 45%, #000) 38%, color-mix(in srgb, var(--blue) 70%, #fff) 52%, color-mix(in srgb, var(--blue) 50%, #000) 72%, var(--blue) 88%, color-mix(in srgb, var(--blue) 60%, #fff) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.lede strong { color: var(--ink); font-weight: 600; }
.lede.small { font-size: 1rem; line-height: 1.5; margin-top: 1.2rem; }

.method-list { list-style: none; margin: 0 0 1.2rem; padding: 0; font-family: var(--mono); font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.method-list li { padding: .55rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 2.2rem 1fr; gap: .6rem; }
.method-list li:last-child { border-bottom: 1px solid var(--line); }
.method-list li b { color: var(--blue); font-weight: 500; }

.index { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0; font-family: var(--mono); font-size: 1rem; }
.index a { color: var(--ink-2); text-decoration: none; display: flex; gap: .7rem; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line); transition: color .15s ease, border-color .15s ease, padding-left .2s ease; }
.index li:last-child a { border-bottom: 1px solid var(--line); }
.index a span { color: var(--blue); transition: color .15s ease; }
/* each row answers in the colour of the build it opens (same accents the chapters switch to) */
.index li { --ia: var(--ia-l); }
.index li:nth-child(1) { --ia-l: #B6381E; --ia-d: #E0704F; }
.index li:nth-child(2) { --ia-l: #1B5E2B; --ia-d: #47AD48; }
.index li:nth-child(3) { --ia-l: #0C7A73; --ia-d: #5BCAC4; }
.index li:nth-child(4) { --ia-l: #9A5606; --ia-d: #F2A33A; }
.index li:nth-child(5) { --ia-l: #6A18C4; --ia-d: #A97BFF; }
[data-theme="dark"] .index li { --ia: var(--ia-d); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .index li { --ia: var(--ia-d); } }
.index a:hover, .index a:focus-visible { color: var(--ia); border-top-color: var(--ia); padding-left: .35rem; }
.index a:hover span, .index a:focus-visible span, .index a:hover em, .index a:focus-visible em { color: var(--ia); }
.index a em { font-style: normal; color: var(--muted); margin-left: auto; padding-left: .8rem; white-space: nowrap; }

/* closing index: every build with its outbound link */
.builds { list-style: none; margin: .4rem 0 0; padding: 0; }
.builds a { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .15rem .8rem; align-items: baseline; padding: .6rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.builds li:last-child a { border-bottom: 1px solid var(--line); }
.builds .n { font-family: var(--mono); font-size: .875rem; color: var(--blue); }
.builds .name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }
.builds .go { font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.builds .for { grid-column: 2 / -1; font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
.builds a:hover .name, .builds a:hover .go { color: var(--blue); }

.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.7rem, 1fr)); gap: .55rem .55rem; margin: 1rem 0 1rem; padding: 0; }
.counters div { border: 1px solid var(--line); border-radius: var(--radius); background: var(--plate); padding: .5rem .7rem .45rem; display: flex; flex-direction: column; }
.counters dt { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0; line-height: 1.35; }
.counters dd { margin: auto 0 0; padding-top: .15rem; font-family: var(--mono); font-size: 1.7rem; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.counters dd small { font-size: .875rem; color: var(--ink-2); margin-left: .2rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin: 0 0 1.2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 22px; border-radius: var(--radius);
  font-family: var(--font); font-size: .875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 8%, transparent); }
a.btn { text-decoration: none; }
.btn.go { background: var(--ink); color: var(--bg); border-color: var(--ink); } /* the bench's filled pill: the way out to the live build */
.btn.go:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.btn[aria-pressed="true"] { background: var(--fail); border-color: var(--fail); color: #fff; }
[data-theme="light"] .btn[aria-pressed="true"] { color: #fff; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

.range { display: grid; gap: .35rem; min-width: 14rem; flex: 1; }
.range { padding: .55rem .75rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plate); }
.range label { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; gap: 1rem; }
.range label output { color: var(--ink); }
.range input { width: 100%; accent-color: var(--blue); }

.state {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.5; letter-spacing: .03em; color: var(--ink-2);
  margin: 1.1rem 0 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plate);
  min-height: 2.2em;
}
.state b { color: var(--ink); font-weight: 500; }
.state .ok { color: var(--blue); }
.state .bad { color: var(--fail); }

.contact-list { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.contact-list a { display: inline-flex; align-items: center; height: 48px; padding: 0 22px; border-radius: var(--radius); font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--line); }
.contact-list a:hover { border-color: var(--ink); }
.colophon { font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); margin: 1.6rem 0 0; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plate); }
.colophon button { font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .2em; }

/* tooltip chip for hovered cells */
#tooltip {
  position: fixed; z-index: 30; pointer-events: none;
  font-family: var(--mono); font-size: .8125rem; letter-spacing: .02em;
  background: var(--ink); color: var(--bg); padding: .45rem .7rem; border-radius: var(--radius);
  transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap;
  opacity: 0; transition: opacity .12s ease;
}
#tooltip[data-show="1"] { opacity: 1; }
#tooltip b { color: var(--blue); font-weight: 500; }
[data-theme="light"] #tooltip b { color: #8FA3FF; }

/* ---------- responsive layout ---------- */
@media (max-width: 1199px) { :root { --copy-w: 42%; } }

/* landscape phones and small landscape tablets keep the side-by-side layout, narrower column */
@media (max-width: 1023px) and (orientation: landscape) {
  :root { --copy-w: 50%; --chapter-h: 180vh; }
  .copy { padding: 72px 0 4.6rem; }
  h1 { font-size: clamp(1.8rem, 4.6vw, 2.8rem); }
  h2 { font-size: clamp(1.55rem, 3.9vw, 2.45rem); }
  .index { font-size: .8125rem; }
}

/* portrait tablets and phones: the scene becomes a fixed display panel; the copy pins beneath it
   and scrolls up under the panel once read — the object is never covered by text */
@media (max-width: 1023px) and (orientation: portrait) {
  :root { --panel-h: 46vh; --copy-w: 100%; --chapter-h: 150vh; }
  .stage { inset: 0 0 auto 0; height: var(--panel-h); z-index: 5; }
  .stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }
  .brand::before { height: 72px; }
  main { padding-top: var(--panel-h); }
  .chapter { scroll-margin-top: var(--panel-h); }
  .chapter.hero { min-height: 170vh; }
  .chapter:last-child { min-height: 0; }
  .copy {
    top: var(--panel-h); min-height: 0;
    justify-content: flex-start; max-width: 40rem;
    padding: 1.4rem 0 calc(4.6rem + env(safe-area-inset-bottom));
  }
  h1 { font-size: clamp(2.1rem, 7vw, 3.5rem); }
  h2 { font-size: clamp(1.7rem, 5.6vw, 2.8rem); }
  .index a em { display: none; }
  .css-register { left: 50%; top: 50%; width: min(46vw, 260px); }
}
@media (max-width: 767px) and (orientation: portrait) {
  :root { --panel-h: 44vh; }
  .copy { padding-top: 1.1rem; }
  .rail { justify-content: space-between; font-size: .6875rem; }
  .rail a { padding: 6px 3px; }
  .brand .tools button { padding: 5px 8px; }
  .counters dd { font-size: 1.25rem; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rail a::before, .btn, .stage canvas, #tooltip, .project-bar, .pb-dots a::before { transition: none; }
  :root { transition: none; }
}
[data-motion="reduced"] .rail a::before, [data-motion="reduced"] .btn, [data-motion="reduced"] .stage canvas, [data-motion="reduced"] .project-bar { transition: none; }
html[data-motion="reduced"] { transition: none; }

/* ---------- the bench layer: the first Lab, embedded; the veil is the dark ground it stands on ---------- */
/* the ground the bench stands on: the same build-tinted night and the same two glows as the Register's room */
#bench-veil {
  position: fixed; inset: 0; z-index: 16; opacity: 0; pointer-events: none; transition: opacity .6s ease;
  background:
    radial-gradient(60% 50% at 70% 45%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    radial-gradient(45% 40% at 15% 85%, color-mix(in srgb, var(--blue) 18%, transparent), transparent 70%),
    var(--bg);
}
#bench-veil[data-state="intro"] { opacity: 1; }   /* title screen: same ground; the Register hangs in the room, drawn in front of the bench layer */
/* the device in the corner is a control: a click target laid over it opens its scene */
#device-hit { position: fixed; z-index: 19; border-radius: var(--radius); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 6px; }
#device-hit[hidden] { display: none; }
#device-hit span { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--radius); white-space: nowrap; transform: translateY(100%);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg) 78%, transparent);
  opacity: 0; transition: opacity .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1); }
#device-hit:hover span, #device-hit:focus-visible span { opacity: 1; transform: translateY(calc(100% + 6px)); }
#device-hit:hover { background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 14%, transparent), transparent); }
/* while it hangs there the Register's canvas is transparent and sits above the bench, so nothing of the bench can cut through it */
html.corner-front .stage { z-index: 19; background: transparent; pointer-events: none; }
html.corner-front .stage::before { display: none; }
/* …except while it stands wholly above the bench's horizon: then it is drawn UNDER the bench's picture (but over the ground), so a specimen
   that passes in front of it really is in front of it */
html.corner-front.corner-back .stage { z-index: 17; }
#device-hit { transition: none; }
/* after Inspect the panes fly in first; the chapter's words follow them */
@keyframes copy-follows { from { opacity: 0; } to { opacity: 1; } }
html.arriving main { animation: copy-follows .5s ease .5s both; }
#bench-veil[data-state="solid"] { opacity: 1; }
#bench {
  position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 18; background: transparent; color-scheme: dark; /* must match the bench document's own scheme, or the UA paints an opaque backdrop */
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, visibility 0s linear .3s; /* the bench's text leaves quickly; the veil carries the slow cross-fade */
}
#bench[data-show="1"] { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .7s ease; }
#bench[hidden] { display: none; }
/* the build's specimen, live, inside the Register's scenes: the bench's own renderer draws just that object through the
   Register's camera, on a clear layer between the scene and the words */
#bench[data-show="spec"] { z-index: 0; opacity: 1; visibility: visible; pointer-events: none; transition: opacity .45s ease; }
#bench[data-show="spec"][data-dim="1"] { opacity: 0; transition: opacity .25s ease; }
#spec-hit { position: fixed; z-index: 2; left: 0; top: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: var(--radius); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
#spec-hit[hidden] { display: none; }
#spec-hit span { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--radius); white-space: nowrap; transform: translateY(100%);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg) 78%, transparent);
  opacity: 0; transition: opacity .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1); }
#spec-hit:hover span, #spec-hit:focus-visible span { opacity: 1; transform: translateY(calc(100% + 4px)); }
#spec-hit:hover { background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 16%, transparent), transparent); }
html.bench-on { overflow: hidden; }
html.bench-on main, html.bench-on .rail, html.bench-on .project-bar { visibility: hidden; }
/* the bench follows the theme switch like every other page of the Lab: the frame's colour scheme must match the document inside it */
[data-theme="light"] #bench { color-scheme: light; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #bench { color-scheme: light; } }
[data-theme="light"] #bench-veil { background:
    radial-gradient(60% 50% at 70% 45%, color-mix(in srgb, var(--glow) 13%, transparent), transparent 70%),
    radial-gradient(45% 40% at 15% 85%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 70%), var(--bg); }
/* Inspect moves focus to the chapter heading for keyboard and screen-reader users; that is not a control, so no ring */
main h1[tabindex="-1"]:focus, main h2[tabindex="-1"]:focus { outline: none; }
html.bench-on .brand::before { background: linear-gradient(to bottom, var(--bg) 0 44%, color-mix(in srgb, var(--bg) 70%, transparent) 70%, transparent 100%); } /* the bench's title scrolls under the header: give it a ground */
html.bench-on #bench-toggle { visibility: hidden; } /* keeps its place, so the nav does not jump between the two halves */
#bench-toggle[hidden] { display: none; }
[data-motion="reduced"] #bench, [data-motion="reduced"] #bench-veil, [data-motion="reduced"] .stage { transition: none; }
@media (prefers-reduced-motion: reduce) { #bench, #bench-veil, .stage { transition: none; } }

/* the parked specimens: the project bar carries the current build's specimen and name, the other four as a menu */
.pb-spec { display: none; flex: none; }
.pb-spec img, .pb-tray img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pb-tray { list-style: none; margin: 0 0 0 6px; padding: 0 0 0 12px; display: flex; gap: 2px; border-left: 1px solid var(--line); }
.pb-tray[hidden], .pb-bench[hidden] { display: none; }
.pb-tray button { display: block; width: 44px; height: 44px; padding: 1px; border-radius: var(--radius); opacity: .8; cursor: pointer; transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease; }
.pb-tray button:hover, .pb-tray button:focus-visible { opacity: 1; transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2); }
.pb-tray button[aria-current="true"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--blue); }
.pb-spec img, .pb-tray img { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .45)); }
.pb-bench { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 15px; border-radius: var(--radius); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 6%, transparent); white-space: nowrap; }
.pb-bench:hover { color: var(--ink); border-color: var(--ink); }
html[data-tray="1"] .project-bar { min-height: 64px; }
html[data-tray="1"] .pb-spec { display: block; width: 84px; height: 84px; margin: -6px -6px -22px -8px; position: relative; z-index: 1; }
html[data-tray="1"] .pb-title { flex-direction: column; align-items: flex-start; gap: 1px; }
html[data-tray="1"] .pb-name { font-family: var(--display); font-weight: 600; font-size: 1.75rem; letter-spacing: -.045em; line-height: .95; text-transform: uppercase; }
@media (min-width: 1024px) { html[data-tray="1"] .copy { padding-top: 136px; } }
@media (min-width: 1024px) and (max-height: 920px) { html[data-tray="1"] .project-bar { min-height: 58px; } html[data-tray="1"] .pb-spec { width: 74px; height: 74px; margin: -4px -6px -18px -8px; } html[data-tray="1"] .pb-name { font-size: 1.5rem; } html[data-tray="1"] .copy { padding-top: 122px; } .pb-tray button { width: 40px; height: 40px; } }
@media (min-width: 1024px) and (max-height: 780px) { html[data-tray="1"] .copy { padding-top: 116px; } html[data-tray="1"] .project-bar { min-height: 50px; } html[data-tray="1"] .pb-spec { width: 62px; height: 62px; margin: -3px -5px -13px -7px; } html[data-tray="1"] .pb-name { font-size: 1.3rem; } .pb-tray button { width: 36px; height: 36px; } }
@media (max-width: 1023px) { html[data-tray="1"] .pb-name { font-size: 1.05rem; } html[data-tray="1"] .pb-spec { width: 56px; height: 56px; margin: -2px -4px -10px -6px; } .pb-tray button { width: 34px; height: 34px; } }
@media (max-width: 767px) { html[data-tray="1"] .pb-spec { display: none; } .pb-tray { order: 6; margin-left: 0; padding-left: 0; border-left: 0; } .pb-bench { order: 7; margin-left: auto; font-size: .7rem; padding: 4px 8px; } html[data-tray="1"] .project-bar { min-height: 0; } }

/* ---------- text plates: copy enters in 3D, scrubbed by scroll ----------
   Each block of copy is a plate. While its chapter rises into place the plates lie tipped back on the floor and
   hinge up on their bottom edges; they are exactly upright at the moment the column locks, whatever the window
   size. When the chapter leaves they tip back on their top edges and recede — the same move the panes make.
   Both moves ride the chapter's own view timeline (compositor-driven transform + opacity). Browsers without
   scroll-driven animations, and anyone asking for reduced motion, simply get the static text. */
@keyframes plate-in {
  from { opacity: 0; transform-origin: 0% 100%; transform: translate3d(0, 30px, -190px) rotateX(70deg) rotateY(-7deg); }
  to { opacity: 1; transform-origin: 0% 100%; transform: none; }
}
/* …and no two neighbours arrive the same way: main.js deals each block one of these at random (--in), never the same twice running */
@keyframes plate-in-left {   /* a door swinging shut from its left edge */
  from { opacity: 0; transform-origin: 0% 50%; transform: translate3d(-34px, 0, -170px) rotateY(76deg); }
  to { opacity: 1; transform-origin: 0% 50%; transform: none; }
}
@keyframes plate-in-right {  /* …or from its right edge */
  from { opacity: 0; transform-origin: 100% 50%; transform: translate3d(26px, 0, -170px) rotateY(-70deg); }
  to { opacity: 1; transform-origin: 100% 50%; transform: none; }
}
@keyframes plate-in-top {    /* lowered from above, hinged on its top edge */
  from { opacity: 0; transform-origin: 0% 0%; transform: translate3d(0, -24px, -180px) rotateX(-72deg) rotateY(6deg); }
  to { opacity: 1; transform-origin: 0% 0%; transform: none; }
}
@keyframes plate-in-depth {  /* flown in from the back of the room, levelling as it lands */
  from { opacity: 0; transform-origin: 30% 60%; transform: translate3d(40px, 22px, -460px) rotateZ(-5deg) rotateY(-18deg); }
  to { opacity: 1; transform-origin: 30% 60%; transform: none; }
}
@keyframes plate-in-twist {  /* raised off the floor on one corner */
  from { opacity: 0; transform-origin: 0% 100%; transform: translate3d(-26px, 34px, -230px) rotateX(46deg) rotateY(34deg) rotateZ(-6deg); }
  to { opacity: 1; transform-origin: 0% 100%; transform: none; }
}
@keyframes plate-out {
  from { opacity: 1; transform-origin: 0% 0%; transform: none; }
  to { opacity: 0; transform-origin: 0% 0%; transform: translate3d(0, -14px, -200px) rotateX(-64deg) rotateY(-5deg); }
}
:root {
  --tl-top: 0px; /* where the pinned column locks: the top of the window, or the bottom of the scene panel on portrait screens */
  /* blocks low in the column only come on screen late in the rise, so most of the swing is kept for the end (and start of the exit) */
  --plate-ease-in: linear(0, .26 40%, .51 70%, .68 85%, .83 95%, 1);
  --plate-ease-out: linear(0, .17 5%, .32 15%, .49 30%, .74 60%, 1);
}
@media (max-width: 1023px) and (orientation: portrait) { :root { --tl-top: var(--panel-h); } }
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .chapter { view-timeline: --chapter block; view-timeline-inset: var(--tl-top) 0px; }
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .chapter:not(:last-child) .copy { perspective: 1000px; perspective-origin: 24% 62%; }
    html:not([data-motion="reduced"]) .chapter:not(:last-child) .copy > * {
      animation: plate-in auto var(--plate-ease-in) backwards, plate-out auto var(--plate-ease-out) forwards;
      animation-name: var(--in, plate-in), plate-out;
      animation-timeline: --chapter;
      animation-range: entry, exit;
    }
    /* the hero is already on screen at load, so its plates stand up on a clock, one after another */
    html:not([data-motion="reduced"]) .chapter.hero .copy > * {
      animation: plate-in .95s cubic-bezier(.2, .7, .2, 1) backwards, plate-out auto var(--plate-ease-out) forwards;
      animation-name: var(--in, plate-in), plate-out;
      animation-timeline: auto, --chapter;
      animation-range: normal, exit;
      animation-delay: calc(120ms + var(--n, 0) * 85ms), 0s;
    }
  }
  /* an explicit "Motion: on" overrides the OS preference here too, exactly as it does for the scene */
  html[data-motion="full"] .chapter:not(:last-child) .copy { perspective: 1000px; perspective-origin: 24% 62%; }
  html[data-motion="full"] .chapter:not(:last-child) .copy > * {
    animation: plate-in auto var(--plate-ease-in) backwards, plate-out auto var(--plate-ease-out) forwards;
    animation-name: var(--in, plate-in), plate-out;
    animation-timeline: --chapter;
    animation-range: entry, exit;
  }
  html[data-motion="full"] .chapter.hero .copy > * {
    animation: plate-in .95s cubic-bezier(.2, .7, .2, 1) backwards, plate-out auto var(--plate-ease-out) forwards;
    animation-name: var(--in, plate-in), plate-out;
    animation-timeline: auto, --chapter;
    animation-range: normal, exit;
    animation-delay: calc(120ms + var(--n, 0) * 85ms), 0s;
  }
  .chapter.hero .copy > :nth-child(2) { --n: 1; } .chapter.hero .copy > :nth-child(3) { --n: 2; }
  .chapter.hero .copy > :nth-child(4) { --n: 3; } .chapter.hero .copy > :nth-child(5) { --n: 4; }
}

/* no-JS: keep the argument readable */
.nojs { position: relative; z-index: 2; font-family: var(--mono); font-size: .85rem; padding: 12px var(--gutter); color: var(--ink-2); border-bottom: 1px solid var(--line); }

/* laptop windows: browser chrome leaves ~790px of a 900px display, so the pinned column must fit in that */
@media (min-width: 1024px) and (max-height: 920px) {
  .index { margin-top: 1rem; font-size: .9375rem; }
  .index a { padding: .3rem 0; }
  .copy { padding-top: 116px; padding-bottom: 26px; }
  h2 { font-size: clamp(30px, 3.2vw, 46px); margin-bottom: 1rem; }
  .lede { font-size: 16px; line-height: 1.55; margin-bottom: 1.05rem; }
  .chapter:not(.hero) .lede { padding: 12px 15px; }
  .controls { margin-bottom: 1rem; }
  .kicker { margin-bottom: 12px; padding-top: 5px; padding-bottom: 5px; }
  .counters { margin: .85rem 0 .85rem; }
  .counters dd { font-size: 1.5rem; }
  .state { margin-top: .9rem; min-height: 0; }
}
@media (min-width: 1024px) and (max-height: 780px) {
  h2 { font-size: clamp(1.6rem, 2.6vw, 2.35rem); margin-bottom: .8rem; }
  .kicker { margin-bottom: 10px; }
  .index { margin-top: .8rem; font-size: .9rem; }
  .index a { padding: .2rem 0; }
  .method-list { font-size: .9375rem; line-height: 1.42; margin-bottom: .9rem; }
  .lede { margin-bottom: 1rem; }
  .copy { padding-top: 112px; padding-bottom: 32px; }
  .counters { margin: .62rem 0 .62rem; }
  .counters dd { font-size: 1.2rem; }
  .controls { margin-bottom: 1rem; }
  .hero .lede { font-size: 16.5px; line-height: 1.5; }
  .chapter:not(.hero) .lede { font-size: 15px; line-height: 1.5; padding: 10px 13px; }
  .counters dt { font-size: 11px; }
  .counters div { padding: .38rem .6rem .34rem; }
  .method-list li { padding: .32rem 0; }
  .btn { height: 42px; padding: 0 18px; font-size: .8125rem; }
  .state { margin-top: .8rem; padding: .45rem .7rem; font-size: 12.5px; }
  .kicker { font-size: 12.5px; }
}
/* short, wide windows (a laptop with a docked console, a small landscape tablet) */
@media (min-width: 1024px) and (max-height: 680px) {
  .hero h1 { font-size: clamp(2.5rem, 5vw, 4.2rem); margin-bottom: .9rem; }
  h2 { font-size: clamp(1.45rem, 2.35vw, 2rem); margin-bottom: .65rem; }
  .hero .lede { font-size: 15px; } .chapter:not(.hero) .lede { font-size: 14px; padding: 9px 12px; margin-bottom: .8rem; }
  .index { margin-top: .6rem; font-size: .85rem; } .index a { padding: .12rem 0; }
  .kicker { font-size: 12px; margin-bottom: 8px; padding: 4px 11px 4px 9px; }
  .counters dd { font-size: 1.2rem; } .counters dt { font-size: 10.5px; }
  .method-list { font-size: .875rem; } .method-list li { padding: .24rem 0; }
  .copy { padding-bottom: 20px; }
  .state { margin-top: .6rem; font-size: 12px; }
}
/* very short windows: the long build chapters keep their narration line for screen readers only */
@media (min-width: 1024px) and (max-height: 700px) {
  .copy.long .state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; border: 0; }
}
