/* Autica site: the home page and the chrome every page shares.
 * Look: a pure #000 page with #fff ink, #1a1a1a frames, one flat #1019ec hero field, #388cff for second title
 * lines and focus, and #0ae77a only where a defense held. One face, Rethink Sans. No glows, plates or grain:
 * depth comes from the field's motion, the frames and the viewers.
 * Kept on purpose:
 * - the nav pill's controls are 40px with a 44px hit area, so the wordmark, the booking button and the menu
 *   toggle fit one 60px pill;
 * - h2s stay calm (about 44px at 1440); the field, frames and viewers carry the mass;
 * - two filled pills, both "Book a first test", at the two ends of the page and never side by side;
 * - the #run pin is the one scroll-driven pattern, only from 60rem x 40rem with motion and WebGL2, driven from
 *   requestAnimationFrame because the WebGL scene cannot read animation-timeline;
 * - two measures: frames and viewers in the 1344px container, the report chapter in the 1130px text container;
 *   radii: frames 28px, block viewers 20px, cards and dialogs 14px;
 * - the slopegraph's faint tick dots are the rest of the sample scan, so the three named findings read
 *   against them;
 * - every part that shows sample data says so where it shows it. */

/* tokens.css and base.css are linked before this file in index.html. */

/* ---------- Page ---------- */

:root {
  --ring: var(--color-focus);
  /* The safe-area insets are 0 unless a wrapper sets viewport-fit=cover and pads :root by them. */
  --safe-y: calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --hero-h: max(640px, calc(100svh - var(--safe-y)));
  --frame-x: max(var(--gutter), calc((100% - var(--container)) / 2));  /* a frame's side inset inside a full-width box */
}
@media (min-width: 100rem) { :root { --hero-h: max(640px, calc(94svh - var(--safe-y))); } }
/* Portrait tablets: the hero stops at 860px, so the #exposure frame enters the first screen; on taller screens it
   stops where that frame's top sits just under 85% of the screen, where the hero's drain starts (3.4). */
@media (min-width: 40rem) and (max-width: 59.99rem) and (orientation: portrait) {
  :root { --hero-h: max(640px, min(calc(100svh - var(--safe-y)), max(860px, calc(85lvh - var(--section-gap) + 8px)))); }
}

body { font-weight: var(--weight-text); font-synthesis: none; }
/* Body clips both ways, so its clip can reach under side safe-area insets, where the hero field runs. The margin
   takes a plain length only, so the wider inset is computed in a registered property first. */
@property --safe-x { syntax: "<length>"; inherits: true; initial-value: 0px; }
:root { --safe-x: max(var(--safe-l), var(--safe-r)); }
body { overflow: clip; overflow-clip-margin: var(--safe-x); }
h1, h2, h3 { font-weight: var(--weight-text); color: var(--color-ink); }
h2 { max-width: 22ch; font-size: var(--text-section); line-height: var(--leading-section); letter-spacing: var(--tracking-section); }
h3 { max-width: 22ch; }
figure { margin: 0; }
li, figcaption { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.container { width: calc(100% - 2 * var(--gutter)); max-width: var(--container); margin-inline: auto; padding-inline: 0; }
.container--text { max-width: var(--container-text); }

/* Everything in main paints above the fixed page lights. */
main { position: relative; z-index: var(--z-base); }
main > section, body > footer { position: relative; z-index: var(--z-base); }
.section { padding-block: var(--section-gap) var(--section-gap-s); }

.caption { margin-top: var(--space-sm); font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink-3); }
/* A sample host name wraps as one piece (setHostText in util.js). */
.hostname { white-space: nowrap; }
ol[role="list"] { list-style: none; padding: 0; }

.skip { position: absolute; top: calc(-1 * var(--space-3xl)); left: var(--space-md); z-index: var(--z-toast); display: inline-flex; align-items: center; min-height: var(--control); padding: 0 var(--space-md); border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); text-decoration: none; }
.skip:focus-visible { top: calc(var(--space-md) + env(safe-area-inset-top, 0px)); }

@keyframes show { to { opacity: 1; transform: none; } }

/* ---------- Page lights: none. The page is a flat palette, so no glow, grain or vignette sits behind it. ---------- */

.lights { display: none; }

/* A two-line section title: the second line in grey. The accent blue is kept for focus rings only. */
.h2__second { color: var(--color-ink-3); }
.h2__second--accent { color: var(--color-ink-3); }

/* The typed swap in #exposure (ledger.js): words never break, characters only turn visible. */
.type-word { white-space: nowrap; }
.type-ch { visibility: hidden; }
.type-ch.is-on { visibility: visible; }

/* Headline lines (shell.js wraps them): each line rises out of its own slot as the head comes into view. */
.rl { display: inline-block; vertical-align: top; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.rl__in { display: inline-block; }
html.js:not(.rm) [data-lines]:not(.has-lines) { opacity: 0; animation: show 0s 2s forwards; }
html.js:not(.rm) .has-lines:not(.is-shown) .rl__in { transform: translateY(112%); }
html.js:not(.rm) .has-lines.is-shown .rl__in { transition: transform 800ms var(--ease-quint); transition-delay: calc(var(--i) * 90ms); }

/* Page to page: the old page fades out in 160ms and the new one in over 220ms, where the browser supports it. */
@view-transition { navigation: auto; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
::view-transition-old(root) { animation: page-out 160ms var(--ease-in) both; }
::view-transition-new(root) { animation: page-in 220ms var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Controls ---------- */

/* Pill button. Hover grows fill and label together by 2%, press shrinks them by 3%. */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--control); padding: 0 var(--space-lg);
  border: 1px solid var(--color-ink); border-radius: var(--radius-pill); background: var(--color-ink);
  color: var(--color-paper);
  font: var(--weight-text) var(--text-md)/1 var(--font-body);
  white-space: nowrap; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: scale(1.025); }
}
.btn:active { transform: scale(0.975); }
/* A filled pill carries an arrow that moves 4px on hover. */
.btn__arrow { flex: none; width: 1em; height: 1em; margin-right: calc(-1 * var(--space-3xs)); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__arrow { transform: translateX(4px); }
}
html.js:not(.rm) .btn__arrow { transition: transform 400ms var(--ease-expo); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
html.js:not(.rm) .btn { transition: transform var(--dur-press) var(--ease-quint); }
html.js:not(.rm) .btn:active { transition-duration: var(--dur-micro); }

/* Outlined: a line border on paper and glass. */
.btn--line { border-color: var(--color-line); background: transparent; color: var(--color-ink); }
/* Glass: floating controls over a viewer (Stop). */
.btn--glass { border-color: var(--color-line); background: var(--color-glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: var(--color-ink); }
.btn--round { width: var(--control); padding: 0; }

/* Text link: the underline grows on hover. */
.link { position: relative; display: inline-flex; align-items: center; min-height: var(--control); border-radius: 8px; color: inherit; font-size: var(--text-md); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.link::before, .link::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(50% - 0.62em); height: 1px; }
/* A faint line at rest; on hover an ink line grows over it from the left. */
.link::before { background: var(--color-line); }
.link::after { background: currentColor; transform: scaleX(0); transform-origin: left center; }
@media (hover: hover) and (pointer: fine) {
  .link:hover::after { transform: scaleX(1); }
}
.link:active::after { transform: scaleX(1); }
html.js:not(.rm) .link::after { transition: transform 350ms var(--ease-out); }

.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Canvas hosts: a scene box holding the poster, then the canvases gl.js adds ---------- */

.host { position: relative; min-width: 0; }
.scene { position: relative; overflow: hidden; }
.scene > .scene__poster, .scene > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene__poster { z-index: 1; }
.scene__poster > svg { width: 100%; height: 100%; }
.scene > .scene__freeze, .scene > .scene__still { z-index: 2; opacity: 0; }
.host.has-freeze > .scene > .scene__freeze, .host.has-still > .scene > .scene__still { opacity: 1; }
.scene > canvas.field { z-index: 3; }
/* The live canvas has drawn: the poster fades out under it. */
.host.has-live > .scene > .scene__poster { opacity: 0; }
html.js:not(.rm) .scene__poster { transition: opacity var(--dur-poster) linear; }
/* The viewers' 1px edge, drawn over the canvas so it never changes the scene box. */
.host--sticky > .scene::after, .host--block > .scene::after {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--color-frame-edge);
}
.host--sticky > .scene, .host--block > .scene { background: var(--color-paper-2); color: var(--color-ink); }
.host--block > .scene { aspect-ratio: 4 / 3; border-radius: var(--radius-view); }
.host__controls:empty { display: none; }
/* An overlay button wraps rather than leave the screen (large text on phones). */
.host__controls .btn { max-width: 100%; white-space: normal; line-height: 1.2; text-align: center; }

/* Posters. The thinned web paths show only without the live field, which grows its own webs from
   nothing. A term or the pointer lights a poster mark without WebGL2. */
html.gl .poster__web { display: none; }
.poster [data-node].is-lit { filter: brightness(1.8); }
/* Build-time posters shown at about half their reference room (phones) take the coarser dust patterns,
   so their dots do not shrink into haze. Posters built in the browser draw their own size and ignore these. */
@media (max-width: 35.74rem) {
  svg.poster { --pd-internal: url(#pd-dust-internal-2x); --pd-cloud: url(#pd-dust-cloud-2x); --pd-identity: url(#pd-dust-identity-2x); }
}

/* The one WebGL2 canvas waits in main, unseen, until gl.js moves it into a host. */
main > canvas.field { position: fixed; top: 0; left: 0; width: 100%; height: 100lvh; visibility: hidden; pointer-events: none; }
html:not(.gl) canvas.field { display: none; }

/* ---------- Nav ---------- */

/* Without JS: a bar at the top of the page, over the hero. With JS: fixed, a bar on the field, then a glass pill. */
.nav { --dot: var(--color-attack); position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: var(--z-sticky-nav); }
html.js .nav { pointer-events: none; }
html.booted .nav.is-pill { position: fixed; }

.nav__bar {
  position: relative; display: flex; align-items: center; gap: var(--space-xs);
  width: calc(100% - 2 * var(--gutter)); max-width: var(--container); min-height: var(--nav-h);
  margin: var(--nav-offset) auto 0;
  border-radius: var(--radius-nav); isolation: isolate;
}
html.js:not(.rm) .nav__bar { transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
/* The pill's glass is its own layer, so the menu panel's blur still reaches the page behind it. */
.nav__bar::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; }
html.js .nav__bar { pointer-events: auto; }
/* Until main.js runs, only the menu waits (it is the part that changes); a 2s net if it never runs. */
html.js:not(.booted) .menu { opacity: 0; animation: show 0s 2s forwards; }
.nav.is-out .nav__bar { opacity: 0; pointer-events: none; }
html.js:not(.rm) .nav.is-out .nav__bar { transition: opacity var(--dur-fade-out) var(--ease-in); }
.nav.is-enter .nav__bar { opacity: 0; transform: translateY(-8px); }
html.js:not(.rm) .nav.is-enter .nav__bar { transition: none; }

/* Pill state: after the hero. A glass rectangle with no edge line, at least 300px wide. */
.nav.is-pill .nav__bar { width: max-content; min-width: min(300px, 100% - 2 * var(--gutter)); max-width: calc(100% - 2 * var(--gutter)); padding: 0 calc((var(--nav-h) - var(--control-s)) / 2) 0 var(--space-lg); }
/* The pill is a step lighter than a frame and carries a hairline edge, so it stays a surface over one. */
.nav.is-pill .nav__bar::before { background: var(--color-glass); box-shadow: inset 0 0 0 1px var(--color-frame-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
/* Under 60rem with JS the bar always has the pill's layout; over the hero it is bare, the glass comes with the pill. */
@media (max-width: 59.99rem) {
  html.js .nav .nav__bar { width: max-content; min-width: min(300px, 100% - 2 * var(--gutter)); max-width: calc(100% - 2 * var(--gutter)); padding: 0 calc((var(--nav-h) - var(--control-s)) / 2) 0 var(--space-lg); }
  html.js .nav .menu__list { left: 0; width: auto; }
  /* Over the hero the bar spans the gutters, so the wordmark sits on the copy's left edge; its menu opens
     under the right end. The bar fades out and in between states, so the width never animates. */
  html.js .nav.is-bare .nav__bar { width: calc(100% - 2 * var(--gutter)); min-width: 0; padding: 0; }
  html.js .nav.is-bare .menu__list { left: auto; width: min(100%, 300px); }
}

.wordmark {
  position: relative; display: inline-flex; align-items: center; min-height: var(--control-hit); margin-right: auto;
  border-radius: 8px; color: var(--color-ink); font-size: var(--text-wordmark); font-weight: var(--weight-mark); line-height: 1; letter-spacing: var(--tracking-title);
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.wordmark__word { display: block; white-space: nowrap; }  /* one flex item, so the link's text reads "autica" */
/* The i is drawn dotless; its dot is a round signal dot. The text keeps a plain i for copy and search. */
.wordmark__i { position: relative; display: inline-block; color: transparent; }
.wordmark__i::before { content: "\131"; content: "\131" / ""; position: absolute; left: 0; top: 0; color: var(--color-ink); }
.wordmark__i::after { content: ""; position: absolute; left: 50%; top: 0.02em; width: 0.17em; height: 0.17em; margin-left: -0.085em; border-radius: 50%; background: var(--dot); }

.menu__details { display: block; }
.menu__toggle {
  position: relative; display: grid; place-items: center; width: var(--control-s); height: var(--control-s);
  border-radius: 50%; color: var(--color-ink); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
}
.menu__toggle::-webkit-details-marker { display: none; }
.menu__toggle::marker { content: ""; }
.menu__toggle::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--color-rule); opacity: 0; }
.menu__toggle::after { content: ""; position: absolute; inset: calc((var(--control-s) - var(--control-hit)) / 2); border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .menu__toggle:hover::before { opacity: 1; }
}
.menu__toggle:active::before { opacity: 1; }
.menu__bars { position: relative; display: block; width: 18px; height: 8px; }
.menu__bars::before, .menu__bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; }
.menu__bars::before { top: 0; }
.menu__bars::after { bottom: 0; }
.menu__details[open] .menu__bars::before { transform: translateY(3.25px) rotate(45deg); }
.menu__details[open] .menu__bars::after { transform: translateY(-3.25px) rotate(-45deg); }
html.js:not(.rm) .menu__toggle::before { transition: opacity var(--dur-short) var(--ease-out); }
html.js:not(.rm) .menu__bars::before, html.js:not(.rm) .menu__bars::after { transition: transform var(--dur-short) var(--ease-in-out); }

/* The list: a dropdown panel by default, inline on the field bar. */
.menu__list {
  position: absolute; top: calc(100% + var(--space-xs)); right: 0; width: min(100%, 300px);
  margin: 0; padding: var(--space-xs); list-style: none;
  border-radius: var(--radius-nav);
  background: var(--color-glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.nav.is-pill .menu__list { left: 0; width: auto; }
.menu__link {
  position: relative; display: flex; align-items: center; min-height: var(--control); padding: 0 var(--space-md);
  border-radius: var(--radius-input); color: var(--color-ink-2); font-size: var(--text-md); line-height: var(--leading-body);
  white-space: nowrap; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.menu__link::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--color-rule); opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .menu__link:hover { color: var(--color-ink); }
  .menu__link:hover::before { opacity: 1; }
}
.menu__link:active::before { opacity: 1; }
.menu__link[aria-current="page"] { color: var(--color-ink); }
.menu__link:focus-visible { outline-offset: -2px; }
html.js:not(.rm) .menu__link::before { transition: opacity var(--dur-short) var(--ease-out); }

@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
html.js:not(.rm) .nav:not(.is-field) .menu__details[open] .menu__list { animation: menu-in var(--dur-short) var(--ease-out); }
.nav:not(.is-field) .menu__details.is-closing .menu__list { opacity: 0; transform: translateY(-8px); }
html.js:not(.rm) .nav:not(.is-field) .menu__details.is-closing .menu__list { transition: opacity var(--dur-fade-out) var(--ease-in), transform var(--dur-fade-out) var(--ease-in); }

/* Field state: hero in view, 60rem and wider. JS opens the details; the list sits inline. */
@media (min-width: 60rem) {
  .nav.is-field .wordmark { margin-right: var(--space-2xl); }
  .nav.is-field .menu { margin-right: auto; }
  .nav.is-field .menu__toggle { display: none; }
  .nav.is-field .menu__list { position: static; display: flex; gap: var(--space-xl); width: auto; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav.is-field .menu__link { min-height: var(--control-hit); padding: 0; color: var(--color-ink); }
  .nav.is-field .menu__link::before { display: none; }
  @media (hover: hover) and (pointer: fine) {
    .nav.is-field .menu__link:hover { opacity: 0.7; }
  }
/* Six links: between 60rem and 75rem the gaps tighten so the bar, with its button, fits the frame. */
@media (min-width: 60rem) and (max-width: 74.99rem) {
  .nav.is-field .menu__list { gap: var(--space-lg); }
}
  .nav.is-field .menu__link:active { opacity: 0.85; }
  .nav.is-field .menu__link:focus-visible { outline-offset: 2px; }
  html.js:not(.rm) .nav.is-field .menu__link { transition: opacity var(--dur-hover) var(--ease-out); }
}

/* The nav's booking button: 40px, ink border on the field, line border on glass. It may wrap at large text sizes. */
.btn--nav { border-color: var(--color-ink-2); border-radius: var(--radius-nav-btn); min-height: var(--control-s); padding: 0 var(--space-sm); white-space: nowrap; text-align: center; }
@media (max-width: 22.49rem) { .btn--nav { padding: 0 var(--space-xs); } }
.btn--nav::after { content: ""; position: absolute; inset: calc((var(--control-s) - var(--control-hit)) / 2) 0; }
.nav.is-pill .btn--nav { border-color: var(--color-line); }

/* ---------- Hero #top ---------- */

.hero { --hero-attack: 1; --hero-defense: 0.5; min-height: var(--hero-h); color: var(--color-ink); }
.hero[data-act="b"] { --hero-attack: 0.5; --hero-defense: 1; }
html:not(.js) .hero { --hero-attack: 0.8; --hero-defense: 0.7; }
/* Reduced motion shows the fix state still: act B's lights, line 2 in ink. */
html.rm .hero { --hero-attack: 0.5; --hero-defense: 1; }

/* The field: the hero host fills the section, out under any side safe-area insets. While the live canvas holds
   it, the field stays put as the page scrolls and the drain clears it (3.4); otherwise it scrolls away with the hero. */
.host--hero { position: absolute; inset: 0 calc(-1 * var(--safe-r)) 0 calc(-1 * var(--safe-l)); z-index: 0; }
.host--hero > .scene { position: absolute; inset: 0; background: var(--color-field-hero); color: var(--color-ink); }
html.gl:not(.rm) .host--hero.has-live > .scene { position: fixed; top: 0; left: 0; width: 100%; height: var(--hero-h); background: none; }
html.gl:not(.rm) .host--hero.is-drained > .scene { background: var(--color-paper); color: var(--color-ink); }
/* The canvas draws the field and its lights, so the drain clears to the page lights. */
html.gl:not(.rm) .host--hero.has-live > .scene::before, html.gl:not(.rm) .host--hero.has-live > .scene::after { display: none; }
/* The build-time poster sits over the hero's fit room (scenes.js room()): columns 7-12 of the 1344 container,
   22% to 92% of the height. Its viewBox is the plane's projected box, and it is scaled to 0.94 about the room's
   centre, where the arrival's dolly starts (4.1), so it meets the first GL frame. */
.host--hero .scene__poster > svg { position: absolute; left: calc(50% + 12px); top: 22%; width: calc(min(100% - 96px, 1344px) / 2 - 12px); height: 70%; transform: scale(0.94); }
/* With the field coming, the hero shows no poster: the poster holds the fix, and the live loop opens on the
   attack. Until the field arrives the hero shows its lights and the copy's settle. A fallback drops html.gl. */
html.gl:not(.rm) .host--hero:not(.has-live) .scene__poster { opacity: 0; }
html.js:not(.rm) .host--hero > .scene::before, html.js:not(.rm) .host--hero > .scene::after { transition: opacity var(--dur-act) var(--ease-in-out); }

.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center;
  min-height: var(--hero-h); padding-block: var(--nav-clear) var(--space-xl);
  pointer-events: none;  /* the field under it takes the pointer; the copy takes its own */
}
.hero__copy { grid-column: 1 / span 6; min-width: 0; pointer-events: auto; }
.hero__title { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
/* The h1 emphasis: the line of the act in play is ink, the other ink-2. Without JS, line 2 is ink. */
.hero__line { color: var(--color-ink-2); }
html.js .hero[data-act="a"] .hero__line[data-act="a"],
html.js .hero[data-act="b"] .hero__line[data-act="b"],
html:not(.js) .hero__line[data-act="b"],
html.js.rm .hero .hero__line[data-act="b"] { color: var(--color-ink); }
html.js.rm .hero .hero__line[data-act="a"] { color: var(--color-ink-2); }
html.js:not(.rm) .hero__line { transition: color var(--dur-act) var(--ease-in-out); }
.hero__lead { max-width: 30em; margin-top: var(--space-lg); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-xl); margin-top: var(--space-xl); }
/* On the field, control borders are ink-2 (4.1 to 5.0:1), never the line colour. */
.hero__pause { border-color: var(--color-ink-2); color: var(--color-ink); }
.hero__pause .icon--play { display: none; }
.hero.is-paused .hero__pause .icon--play { display: block; }
.hero.is-paused .hero__pause .icon--pause { display: none; }

/* Settle: visible by default, hidden only under html.js until hero.js runs it; a 2s net if hero.js never does. */
.hero__title { --i: 0; }
.hero__lead { --i: 1; }
.hero__actions { --i: 2; }
html.js:not(.rm) [data-settle] { opacity: 0; transform: translateY(16px); }
html.js:not(.rm) .hero:not(.is-settled) [data-settle] { animation: show 0s 2s forwards; }
html.js:not(.rm) .hero.is-settled [data-settle] {
  opacity: 1; transform: none;
  transition: opacity var(--dur-settle-fade) var(--ease-reveal-fade), transform var(--dur-settle) var(--ease-reveal);
  transition-delay: calc(var(--i) * var(--stagger-settle));
}

/* From 60rem to 75rem the h1 scales with the width, so each sentence keeps its own line, and the actions keep
   one row. */
@media (min-width: 60rem) and (max-width: 74.99rem) {
  .hero__title { font-size: clamp(2.5rem, 4.2vw, 3.25rem); }
  .hero__actions { flex-wrap: nowrap; column-gap: var(--space-md); }
}

/* Under 60rem: the estate above, the copy below, as on phones. The CSS lights follow the estate up, in the boxes
   of scenes.js's narrow set (attack at 70% / 28%, defense at 15% / 62%), so the field's lights take over in
   place. The copy starts 380px above the hero's foot (at 52% of the hero at most), so no empty band is left
   under it. */
@media (max-width: 59.99rem) {
  .hero { --copy-top: clamp(240px, calc(var(--hero-h) - 380px), calc(var(--hero-h) * 0.52)); }
  .hero__inner { align-items: start; padding-top: var(--copy-top); padding-bottom: var(--space-lg); }
  .hero__copy { grid-column: 1 / -1; }
  /* The phone room: the content width, from under the measured nav bar to 94% of the copy's top. */
  .host--hero .scene__poster > svg {
    --poster-top: max(var(--nav-clear), var(--nav-bar, 0px));
    left: 16px; width: calc(100% - 32px); top: var(--poster-top); height: max(1px, calc(0.94 * var(--copy-top) - var(--poster-top)));
  }
}
@media (max-width: 39.99rem) {
  .hero__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); margin-top: var(--space-lg); }
  .hero__actions > .btn:first-child { grid-column: 1 / -1; width: 100%; }
  .hero__follow { justify-self: start; }
  @media (max-height: 43.99rem) {
    .hero { --copy-top: clamp(220px, calc(var(--hero-h) - 380px), calc(var(--hero-h) * 0.52)); }
    .hero__lead { margin-top: var(--space-md); }
  }
}
/* Landscape phones: the copy left and the estate right, as from 60rem, in one short screen, so the h1, the
   sentence and the button share the first screen (T9; scenes.js room() and util.js Q.heroWide agree). */
@media (max-width: 59.99rem) and (orientation: landscape) and (max-height: 30rem) {
  :root { --hero-h: max(360px, calc(100svh - var(--safe-y))); }
  .hero__inner { align-items: center; padding-top: var(--nav-clear); padding-bottom: var(--space-md); }
  .hero__copy { grid-column: 1 / span 7; }
  .hero__title { font-size: var(--text-section); }
  .hero__lead { margin-top: var(--space-sm); font-size: var(--text-md); }
  .hero__actions { display: flex; margin-top: var(--space-md); }
  .hero__actions > .btn:first-child { width: auto; }
  .host--hero > .scene::before { left: 40.5%; top: 29.5%; width: 75%; height: 85%; }
  .host--hero > .scene::after { left: -14%; top: -9%; width: 60%; height: 70%; }
  .host--hero .scene__poster > svg { left: calc(50% + 12px); top: 22%; width: calc(min(100% - 96px, 1344px) / 2 - 12px); height: 70%; }
}
/* From 50rem the actions fit one row there, Pause included. */
@media (min-width: 50rem) and (max-width: 59.99rem) and (orientation: landscape) and (max-height: 30rem) {
  .hero__actions { flex-wrap: nowrap; column-gap: var(--space-md); }
}

/* ---------- Exposure #exposure ---------- */

.exposure { padding-block: var(--section-gap) var(--section-gap-s); }
@media (min-width: 100rem) { .exposure { padding-top: var(--space-xl); } }
/* The frame: paper-2 at 72%, so the page lights reach it, over its tonal plate. */
.exposure__frame {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-xl);
  width: calc(100% - 2 * var(--gutter)); max-width: var(--container); margin-inline: auto;
  padding: var(--space-3xl) var(--space-2xl);
  border-radius: var(--radius-frame); background: var(--color-frame); box-shadow: inset 0 0 0 1px var(--color-frame-edge);
}
.exposure__head { grid-column: 1 / span 6; grid-row: 1; min-width: 0; }
.exposure__lede { margin-top: var(--space-lg); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.exposure .ledger { grid-column: 1 / span 6; grid-row: 2; }
.exposure .chart { grid-column: 7 / -1; grid-row: 1 / span 2; align-self: center; }

/* Plates: none. Frames are flat near-black. */
.plate { display: none; }

/* The findings: tabs (ledger.js builds them), then one panel at a time in one grid cell, so the frame
   keeps its height across findings. */
.ledger { display: grid; grid-template-areas: "tabs" "panel"; row-gap: var(--space-xl); min-width: 0; }
.ledger__tabs { grid-area: tabs; justify-self: start; }
html:not(.js) .ledger__tabs, .ledger__tabs:empty { display: none; }
.ledger__panel { grid-area: panel; min-width: 0; border-radius: var(--radius-input); }
.ledger__panel:focus-visible { outline-offset: var(--space-md); }
.ledger__panel.is-hidden { visibility: hidden; }
.ledger__panel.is-out { opacity: 0; }
html.js:not(.rm) .ledger__panel.is-out { transition: opacity var(--dur-copy) var(--ease-in); }
html.js:not(.rm) .ledger__panel.is-in { transition: opacity var(--dur-long) var(--ease-out); }
/* While the tabs show, the selected tab names the finding; the h3 stays for screen readers. */
.ledger:has(> .ledger__tabs:not(:empty)) .ledger__name { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ledger__name { font-size: var(--text-title); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
.ledger__result { margin-top: var(--space-sm); font-size: var(--text-card); line-height: var(--leading-card); letter-spacing: var(--tracking-card); color: var(--color-ink); }
.ledger__how { margin-top: var(--space-sm); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.ledger__fix { margin-top: var(--space-md); font-size: var(--text-md); color: var(--color-ink); }

/* The slopegraph: end words in HTML beside each axis, at the height fractions the SVG uses (--y). */
.chart { min-width: 0; container-type: inline-size; }
.chart__plot { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: var(--space-md); align-items: stretch; }
.chart__words { display: grid; min-width: 0; }
.chart__word {
  grid-area: 1 / 1; align-self: start; position: relative; top: calc(var(--y) * 100%); transform: translateY(-50%);
  font-size: var(--text-md); line-height: 1.25; color: var(--color-ink-3); white-space: nowrap;
}
.chart__words--left .chart__word { justify-self: end; text-align: right; }
.chart__svg { width: 100%; height: auto; max-width: 440px; justify-self: center; overflow: visible; }
.chart__svg--square { display: none; }
.chart .caption { margin-top: var(--space-lg); }
.chart__axis { stroke: var(--color-line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.chart__tick { fill: var(--color-ink-2); opacity: 0.3; }
/* Each named finding: the selected line in the attack hue if it reached a stake, ink-2 if not; the rest at 0.25. */
.chart__line { --line-c: var(--color-ink-2); opacity: 0.25; }
.chart__line.is-selected { opacity: 1; }
.chart__line.is-selected[data-reached="true"] { --line-c: var(--color-attack); }
.chart__line.is-preview { opacity: 0.6; }
.chart__hit { fill: none; stroke: transparent; stroke-width: 24px; vector-effect: non-scaling-stroke; pointer-events: stroke; }
html.js .chart__hit { cursor: pointer; }
.chart__stroke { fill: none; stroke: var(--line-c); stroke-width: 1.25px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart__end, .chart__bead { fill: var(--line-c); }
.chart__ring { fill: none; stroke: var(--line-c); stroke-width: 1px; vector-effect: non-scaling-stroke; }
/* The pulse: a 4 px attack-hot dot with a soft head. */
.chart__pulse { fill: var(--color-attack-hot); opacity: 0; pointer-events: none; filter: drop-shadow(0 0 1.5px var(--color-attack-hot)); }
/* Before the arrival plays, the ticks and the lines wait (never under rm). Strokes carry pathLength="1". */
.chart.is-armed .chart__tick, .chart.is-armed .chart__end, .chart.is-armed .chart__ring, .chart.is-armed .chart__bead { opacity: 0; }
html.js:not(.rm) .chart__line { transition: opacity var(--dur-copy) var(--ease-out); }

@media (max-width: 74.99rem) {
  .exposure__frame { padding-inline: var(--space-xl); }
}
/* Under 60rem: one column, the chart between the lede and the tabs, square. */
@media (max-width: 59.99rem) {
  .exposure__frame { grid-template-columns: minmax(0, 1fr); padding: var(--space-2xl) var(--space-lg); }
  .exposure__head, .exposure .ledger, .exposure .chart { grid-column: 1; grid-row: auto; }
  .chart__svg--wide { display: none; }
  /* In em, so the plot grows with the text and the end words keep their spacing at larger text sizes. */
  .chart__svg--square { display: block; max-width: 12.5em; }
  .chart__plot { column-gap: var(--space-xs); }
}
@media (max-width: 39.99rem) {
  /* On a phone the frame runs edge to edge with no radius, so the chart
     gets the screen's width instead of losing 32px a side to the inset and the padding. */
  .exposure__frame { width: 100%; padding: var(--space-2xl) var(--gutter); border-radius: 0; box-shadow: inset 0 1px 0 var(--color-frame-edge), inset 0 -1px 0 var(--color-frame-edge); row-gap: var(--space-xl); }
  .ledger__tabs { justify-self: stretch; }
  /* The reach words take two lines, so the square chart keeps its width. */
  .chart__words--right .chart__word { max-width: 4.6em; white-space: normal; line-height: 1.2; }
}
/* On a phone the square SVG takes the width and the end words list under it in reading order: ratings on the
   left, reach on the right. Beside the plot they left it about 150px wide; stacked it is up to 320px. */
@container (max-width: 24em) {
  .chart__plot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: var(--space-sm); }
  .chart__svg--square { grid-column: 1 / -1; grid-row: 1; width: 100%; max-width: 320px; justify-self: center; }
  .chart__words { grid-row: 2; display: flex; flex-direction: column; gap: var(--space-2xs); }
  .chart__words--left { grid-column: 1; flex-direction: column-reverse; justify-content: flex-end; }
  .chart__words--right { grid-column: 2; }
  .chart__word, .chart__words--right .chart__word { position: static; top: auto; transform: none; margin-top: 0; max-width: none; white-space: normal; text-align: left; justify-self: auto; }
}

/* ---------- Segmented control with a sliding pill: #areas toggle, #start choice, #exposure tabs ---------- */

.segmented {
  position: relative; isolation: isolate; display: inline-flex; align-items: stretch; max-width: 100%;
  min-height: var(--control); padding: var(--space-3xs); border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}
/* The pill carries motion only (1.0 to 1.1:1 on its track); JS sets its size and transform. */
.segmented__pill { position: absolute; left: 0; top: 0; z-index: -1; border-radius: var(--radius-pill); background: var(--color-paper-4); transform-origin: 0 0; pointer-events: none; }
html.js:not(.rm) .segmented__pill { transition: transform var(--dur-pill) var(--ease-pill); }
.segmented__option {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control-hit); padding: 0 var(--space-md); margin: 0;
  border: 0; border-radius: var(--radius-pill); background: none;
  color: var(--color-ink-2); font: var(--weight-text) var(--text-md)/1.2 var(--font-body); white-space: nowrap; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .segmented__option:hover { color: var(--color-ink); }
}
/* The selected segment carries its own 1px ink-3 edge, so the state shows at once and no scale stretches it. */
.segmented__option[aria-checked="true"], .segmented__option[aria-selected="true"] { color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink-3); cursor: default; }
.segmented__option:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
/* Stacked when the row does not fit: full width, the pill moves by translateY and scaleY. */
.segmented.is-stacked { display: flex; flex-direction: column; width: 100%; border-radius: calc(var(--control-hit) / 2 + 2px); }
.segmented.is-stacked .segmented__option { width: 100%; white-space: normal; }
/* The #run fix list: always vertical, inside the card's glass, with no glass of its own. */
.segmented--vertical { display: flex; flex-direction: column; width: 100%; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: var(--radius-input); }
.segmented--vertical .segmented__option { justify-content: flex-start; width: 100%; border-radius: var(--radius-input); text-align: left; white-space: normal; }
.segmented--vertical .segmented__pill { border-radius: var(--radius-input); }

/* ---------- Terms: spans in the HTML, buttons under JS; the underline names the node's colour ---------- */

.term { --tone: var(--color-attack); }
.term[data-tone="defense"] { --tone: var(--color-defense); }
.term[data-tone="internal"] { --tone: var(--color-area-internal); }
.term[data-tone="cloud"] { --tone: var(--color-area-cloud); }
.term[data-tone="identity"] { --tone: var(--color-area-identity); }
html.js .term {
  text-decoration-line: underline; text-decoration-color: var(--tone); text-decoration-thickness: 1.5px;
  text-underline-offset: 4px; text-decoration-skip-ink: none;
}
.term-tie { white-space: nowrap; }  /* a term button and the punctuation after it (terms.js) */
button.term {
  display: inline; margin: 0; padding: 0; border: 0; border-radius: 2px; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  html.js .term:hover { text-decoration-thickness: 2.5px; }
}
html.js .term:focus-visible, html.js .term.is-lit { text-decoration-thickness: 2.5px; }
.term:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- Sample attack #run ---------- */

/* Without the pin (phones, short screens, reduced motion, no WebGL2, no JS): the h2, then four blocks, each a
   4:3 viewer above its text. Every pin rule below hangs off .is-pinned, which stage.js sets. */
.run { padding-block: var(--section-gap) var(--section-gap-s); }
/* From 60rem, 144px more above #run keep the #exposure frame and the #run head out of one 900px window, pinned
   or not (7.2, 80 words). */
@media (min-width: 60rem) { .run { margin-top: var(--space-4xl); } }
.run__head, .run__card { width: calc(100% - 2 * var(--gutter)); max-width: var(--container); margin-inline: auto; }
.run__stage > .scene, .run__box, .run__ticks { display: none; }
.run__steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); max-width: 720px; margin: var(--space-2xl) 0 0; }
.run__step { display: flex; flex-direction: column; gap: var(--space-lg); min-width: 0; }
/* From 60rem each step is one row: its text in columns 1-5, its viewer in columns 7-12. */
@media (min-width: 60rem) {
  .run__steps { max-width: none; }
  .run__step { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; }
  .run__step > .run__text { grid-column: 1 / span 5; grid-row: 1; }
  .run__step > .host { grid-column: 7 / -1; grid-row: 1; }
}
.run__name { font-size: var(--text-title); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
.run__line { margin-top: var(--space-xs); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.run__fixes, .run__replay { margin-top: var(--space-md); }
.run__fixes:empty, .run__replay:empty { display: none; }
@media (max-width: 39.99rem) {
  .run__steps { gap: var(--space-xl); margin: var(--space-xl) 0 0; }
  .run__step { gap: var(--space-md); }
}

/* The pin: 520svh with a 100svh sticky stage. The frame (the scene box) is the 1344 container, 40px from
   the stage's top and bottom; gl.js opens it from the placeholder box and draws its light. */
.run.is-pinned { height: 520svh; padding: 0; scroll-margin-top: calc(-1 * var(--nav-clear)); }
.run.is-pinned .run__stage { position: sticky; top: 0; display: flex; flex-direction: column; height: 100svh; }
.run.is-pinned .run__stage > .scene { display: block; position: absolute; z-index: 0; inset: 40px var(--frame-x); border-radius: var(--radius-frame); }
/* The h2 above, under the nav pill. It fades and rises 24px in the middle of the opening band, before the
   estate's webs reach it (--head, 0 to 1, stage.js). */
.run.is-pinned .run__head {
  position: relative; z-index: 2; flex: none; max-width: var(--container-text);
  padding-top: calc(var(--nav-clear) + var(--space-lg));
  opacity: calc(1 - var(--head, 0)); transform: translateY(calc(var(--head, 0) * -24px));
  pointer-events: none;
}
/* The placeholder box the frame opens from: under the h2, to 64px above the bottom. Never painted. */
.run.is-pinned .run__box { display: block; position: relative; flex: 1 1 auto; min-height: 0; width: calc(100% - 2 * var(--gutter)); max-width: var(--container-text); margin: var(--space-xl) auto var(--space-2xl); }
/* The step card: bottom left, 40px in from the frame's left and bottom edges, 440px wide at most. A column:
   the ticks come first in the DOM, so Tab from a tick or next goes into the shown step, and show last. */
.run.is-pinned .run__card {
  position: absolute; z-index: 3; left: calc(var(--frame-x) + 40px); bottom: 80px;
  display: flex; flex-direction: column;
  width: min(440px, 100% - 2 * var(--frame-x) - 80px); max-width: none; margin: 0; padding: var(--space-lg);
  border-radius: var(--radius-card);
}
/* The glass is its own layer, cut to the current step and the ticks (--glass-top, stage.js): the part of the
   fixed cell above a short step stays clear. */
.run.is-pinned .run__card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: var(--radius-card); background: var(--color-glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  clip-path: inset(var(--glass-top, 0px) 0 0 0 round var(--radius-card));
}
html.js:not(.rm) .run.is-pinned .run__card::before { transition: clip-path var(--dur-pill) var(--ease-pill); }
.run.is-pinned .run__card:not(.is-on) { opacity: 0; transform: translateY(12px); pointer-events: none; }
.run.is-pinned .run__ticks { order: 2; }
/* The four steps share one grid cell, so the card's box keeps the tallest step's height; each step sits at the
   cell's foot, above the ticks. */
.run.is-pinned .run__steps { grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
/* A step swap runs in sequence: the leaving step fades out in place over 150ms, then the entering one fades in
   and rises 12px, so two steps never show at once. */
.run.is-pinned .run__step { grid-area: 1 / 1; align-self: end; display: block; opacity: 0; transform: translateY(16px); pointer-events: none; }
.run.is-pinned .run__step.is-current { opacity: 1; transform: none; pointer-events: auto; }
.run.is-pinned .run__step.is-leaving { opacity: 0; transform: none; }
.run.is-pinned .run__step > .host { display: none; }
html.js:not(.rm) .run.is-pinned .run__card { transition: opacity var(--dur-copy) var(--ease-in), transform var(--dur-copy) var(--ease-in); }
html.js:not(.rm) .run.is-pinned .run__card.is-on { transition: opacity var(--dur-long) var(--ease-out) var(--delay-state), transform var(--dur-long) var(--ease-out) var(--delay-state); }
html.js:not(.rm) .run.is-pinned .run__step.is-leaving { transition: opacity var(--dur-fade-out) var(--ease-in); }
html.js:not(.rm) .run.is-pinned .run__step.is-current { transition: opacity 450ms var(--ease-std) var(--dur-fade-out), transform 450ms var(--ease-std) var(--dur-fade-out); }

/* Ticks with previous and next (stage.js builds them): 44px hit areas, a 2px mark. To come: 12px in the
   line colour; done: 24px in ink-3; active: 24px in ink. Length changes by scaleX, never width. */
.run.is-pinned .run__ticks { display: flex; align-items: center; margin-top: var(--space-lg); margin-inline: calc(-1 * var(--space-2xs)); }
.run__tick { display: grid; place-items: center; width: var(--control-hit); height: var(--control-hit); margin: 0; padding: 0; border: 0; border-radius: var(--radius-input); background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.run__mark { display: block; width: 24px; height: 2px; border-radius: 1px; background: var(--color-line); transform: scaleX(0.5); transform-origin: left center; }
.run__tick.is-done .run__mark { background: var(--color-ink-3); transform: scaleX(1); }
.run__tick.is-active .run__mark { background: var(--color-ink); transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .run__tick:hover .run__mark { transform: scaleX(1); }
}
html.js:not(.rm) .run__mark { transition: transform var(--dur-long) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.run__arrow { flex: none; display: grid; place-items: center; width: var(--control-hit); height: var(--control-hit); min-height: 0; margin: 0; padding: 0; border: 1px solid var(--color-line); border-radius: 50%; background: none; color: var(--color-ink); cursor: pointer; }
.run__arrow--prev { margin-right: auto; }
.run__arrow--next { margin-left: auto; }
.run__arrow[aria-disabled="true"] { border-color: var(--color-rule); cursor: default; }
.run__arrow[aria-disabled="true"] .icon { opacity: 0.55; }

/* ---------- Viewers: #areas and #limits ---------- */

/* Without the sticky layout (no JS, narrow or short screens): the h2, then each block with its own viewer
   and, under it, its controls on the page. */
.viewers { display: grid; grid-template-columns: minmax(0, 1fr); }
.viewers__copy { min-width: 0; }
.viewers__copy > h2 { margin-bottom: var(--space-lg); }
.viewers__lede { margin-bottom: var(--space-2xl); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); }
.viewers__box { display: none; }
.viewers__list { margin: 0; padding: 0; list-style: none; }
.block { max-width: 720px; }
.block + .block { margin-top: var(--space-3xl); }
.block__name { font-size: var(--text-title); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
.block__reach { margin-top: var(--space-sm); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.block__fix { margin-top: var(--space-xs); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.block__text { max-width: 30em; font-size: var(--text-title); line-height: var(--leading-title); letter-spacing: var(--tracking-title); color: var(--color-ink); }
.block > .host { margin-top: var(--space-lg); }
/* From 60rem, a block without the sticky viewer sets its text in columns 1-5 and its viewer in columns 7-12. */
@media (min-width: 60rem) {
  .viewers .block { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr repeat(3, auto) 1fr auto; column-gap: var(--gap-columns); max-width: none; }
  .viewers .block > * { grid-column: 1 / span 5; }
  .viewers .block > :nth-child(1) { grid-row: 2; }
  .viewers .block > :nth-child(2) { grid-row: 3; }
  .viewers .block > :nth-child(3) { grid-row: 4; }
  .viewers .block > .host { grid-column: 7 / -1; grid-row: 1 / span 5; margin-top: 0; }
  .viewers .block > .caption { grid-column: 7 / -1; grid-row: 6; }
}
.host--block > .host__controls { margin-top: var(--space-md); }
@media (max-width: 39.99rem) {
  .block + .block { margin-top: var(--space-2xl); }
}

/* Sticky, from 60rem wide and 44rem tall with JS: copy in columns 1-5, the viewer in columns 7-12. The box is
   the viewer plus one 36px caption line, and never slides under the nav pill. */
@media (min-width: 60rem) and (min-height: 44rem) {
  html.js .viewers {
    --viewer-h: min(600px, 100svh - var(--nav-clear) - 36px - 24px);
    --box-h: calc(var(--viewer-h) + 36px);
    grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns);
  }
  html.js .viewers__copy { grid-column: 1 / span 5; padding-bottom: calc(50svh - var(--box-h) / 2); }
  html.js .viewers__box {
    display: block; grid-column: 7 / -1; align-self: start;
    position: sticky; top: max(var(--nav-clear), calc(50svh - var(--box-h) / 2)); height: var(--box-h);
  }
  html.js .viewers .block { display: flex; flex-direction: column; justify-content: center; min-height: 46svh; max-width: none; }
  html.js .viewers .block + .block { margin-top: var(--space-2xl); }
  html.js .viewers .block > .host { display: none; }
  /* The block captions stay for screen readers; the box's caption shows. */
  html.js .viewers .block > .caption { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* The active block is ink and ink-2; the others ink-3. */
  html.js .viewers:has(.block.is-active) .block:not(.is-active) :is(.block__name, .block__reach, .block__fix, .block__text) { color: var(--color-ink-3); }
}
html.js:not(.rm) .viewers :is(.block__name, .block__reach, .block__fix, .block__text) { transition: color var(--dur-copy) var(--ease-out); }

.host--sticky > .scene { height: var(--viewer-h, 600px); border-radius: var(--radius-frame); }
.viewers__caption { display: flex; align-items: flex-end; height: 36px; margin: 0; }

/* Overlay controls (viewer.js builds them into [data-controls]). In the sticky viewer they float over the
   field, bottom left; in a block viewer they sit under it, on the page. Hidden overlays stay tabbable: a
   focus swaps them in at once (T51). */
.host--sticky > .host__controls { position: absolute; inset: 0 0 auto; height: var(--viewer-h, 600px); z-index: 5; pointer-events: none; }
.host--sticky .overlay { position: absolute; left: var(--space-md); bottom: var(--space-md); max-width: calc(100% - 2 * var(--space-md)); pointer-events: auto; transform-origin: left bottom; }
.host--sticky .overlay:has(> .rail-box) { left: var(--space-lg); right: var(--space-lg); bottom: 0; }
.overlay.is-hidden { opacity: 0; transform: scale(0.97); pointer-events: none; }
html.js:not(.rm) .overlay { transition: opacity var(--dur-swap-in) var(--ease-out), transform var(--dur-swap-in) var(--ease-out); }
html.js:not(.rm) .overlay.is-hidden { transition: opacity var(--dur-swap-out) var(--ease-in), transform var(--dur-swap-out) var(--ease-in); }
html.js:not(.rm) .overlay.is-instant, html.js:not(.rm) .overlay.is-hidden.is-instant { transition: none; }
.host--block .overlay + .overlay { margin-top: var(--space-md); }

/* The #limits rail: a 1px line, a 6px dot per step on a 44px button, and one caption. In the sticky viewer
   the line runs 32px in from the bottom with the caption above it on glass; in a block viewer the caption
   sits under the line, in a box as tall as the longest caption at that width (--caption-h, T80). */
.rail-box { position: relative; display: flex; flex-direction: column; }
.rail { position: relative; height: var(--control-hit); }
.rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--color-line); }
.rail__dot {
  position: absolute; top: 0; left: 0; display: grid; place-items: center;
  width: var(--control-hit); height: var(--control-hit); margin: 0 0 0 calc(var(--control-hit) / -2); padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rail__dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-ink-2); }
.rail__dot.is-lit::before { background: var(--color-ink); transform: scale(1.33); }
html.js .rail__dot:not(.is-dropped) { opacity: 0; transform: translateY(-8px); pointer-events: none; }
html.js:not(.rm) .rail__dot { transition: opacity var(--dur-short) var(--ease-out), transform 300ms var(--ease-out); }
.rail__caption { min-height: var(--caption-h, calc(3 * var(--leading-body) * 1em)); margin: var(--space-xs) 0 0; font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink); }
.rail__caption:empty { visibility: hidden; }
.host--sticky .rail-box { flex-direction: column-reverse; padding-bottom: calc(var(--space-2xl) / 2 - var(--control-hit) / 2); }  /* the line 32px in from the bottom */
.host--sticky .rail__caption {
  align-self: flex-start; min-height: 0; max-width: 100%; margin: 0 0 var(--space-xs);
  padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-input);
  background: var(--color-glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* ---------- Report #report: the light chapter ---------- */

/* Paper-light, joined to the dark page by a ramp in (320px; 160px on phones) and a ramp out (300px; 150px),
   10 eased stops each, mixed in Oklab. The ramps lie in the section's padding, so no text sits on them;
   main.js reads --ramp-in and --ramp-out for the nav. Like the hero field, the paper reaches out under any
   side safe-area insets, and the content stays where it was. */
.report {
  --ring: var(--color-focus-on-light);
  margin-inline: calc(-1 * var(--safe-l)) calc(-1 * var(--safe-r));
  padding-inline: var(--safe-l) var(--safe-r);
  padding-block: var(--section-gap) var(--section-gap-s);
  color: var(--color-ink-on-light);
  background: var(--color-paper);
}
.report h2, .report h3 { color: var(--color-ink-on-light); }
.report__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-xl); align-items: start; }
.report__copy { grid-column: 1 / span 5; min-width: 0; }
.report__lede { margin-top: var(--space-lg); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-on-light-2); max-width: 60ch; }
.report__card {
  grid-column: 6 / -1; position: relative; isolation: isolate; overflow: clip; min-width: 0;
  border: 1px solid var(--color-rule-on-light); border-radius: var(--radius-frame); background: var(--color-paper-light); color: var(--color-ink-on-light);
}
/* The art (16:7) over its light plate at full strength; report.js draws the dither, the overlay and the six
   mark buttons over it, and the still is the picture without JS. */
.report__art { position: relative; isolation: isolate; overflow: clip; aspect-ratio: 16 / 7; }
.report__art > .report__still, .report__art > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.report__still { object-fit: cover; }
.report__art:has(> .report__dither) > .report__still { visibility: hidden; }
.report__art > canvas { pointer-events: none; }
.report__marks { position: absolute; inset: 0; }
.report__mark {
  position: absolute; width: var(--control-hit); height: var(--control-hit); margin: calc(var(--control-hit) / -2) 0 0 calc(var(--control-hit) / -2); padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.report__mark:focus-visible { outline: 2px solid var(--color-focus-on-light); outline-offset: -4px; }
.report__info { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: var(--space-md); padding: var(--space-xl); }
.report__title { max-width: none; font-size: var(--text-card); line-height: var(--leading-card); letter-spacing: var(--tracking-card); }
/* The title's hidden full stop stays inline, so its name reads "Sample report. From ..." with no space before it. */
.report__title .visually-hidden { position: static; display: inline; font-size: 1px; }
.report__body { color: var(--color-ink-on-light-2); }
/* It wraps rather than widen the card (large text on narrow phones). */
.report__open { max-width: 100%; margin-top: var(--space-xs); border-color: var(--color-ink-on-light-2); background: transparent; color: var(--color-ink-on-light); white-space: normal; line-height: 1.2; text-align: center; }
@media (max-width: 59.99rem) {
  .report__copy, .report__card { grid-column: 1 / -1; }
}
@media (max-width: 39.99rem) {
  .report__art { aspect-ratio: 16 / 9; }
  .report__info { padding: var(--space-lg); }
  .report__card { border-radius: var(--radius-view); }
}

/* ---------- Close #start ---------- */

/* A 1344x720 frame with its own field (both lights at 0.75, no area lights): the close host fills it from
   60rem, and sits above the copy as a 4:3 block below that. */
.start { padding-bottom: var(--space-2xl); }
.start__frame {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center;
  width: calc(100% - 2 * var(--gutter)); max-width: var(--container); min-height: 720px; margin-inline: auto;
  padding: var(--space-2xl);
  border-radius: var(--radius-frame); background: var(--color-field-ink); color: var(--color-ink);
}
.host--close { position: absolute; inset: 0; z-index: 0; }
.host--close > .scene { position: absolute; inset: 0; }
.start__copy { position: relative; z-index: 1; grid-column: 1 / span 5; min-width: 0; }
/* From 60rem to 75rem the copy takes six columns, so the h2 keeps two lines and the area control one row; the
   field's room moves right with it (util.js Q.closeSix). Without JS the poster keeps the 1440 room, so the copy
   keeps five. */
@media (min-width: 60rem) and (max-width: 74.99rem) {
  html.js .start__copy { grid-column: 1 / span 6; }
}
.start__lead { margin-top: var(--space-lg); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 60ch; }
.start__control { margin-top: var(--space-xl); }
.start__control:empty { display: none; }
.start__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-xl); }
/* Over the field, the caption is ink-2 (ink-3 would be 4.0:1 there). */
.start__caption { margin-top: var(--space-lg); color: var(--color-ink-2); }
/* The one visible slot, without JS: a blank to fill. Gone once main.js runs. */
.fill { padding: var(--space-2xs) var(--space-sm); border: 1px dashed var(--color-ink-2); border-radius: 3px; color: var(--color-ink-2); font-size: var(--text-md); line-height: var(--leading-body); }

@media (max-width: 59.99rem) {
  .start__frame { display: block; min-height: 0; padding: 0; }
  /* The build-time close poster shows its phone picture here (no JS). */
  .host--close { position: relative; inset: auto; --poster-wide: none; --poster-narrow: inline; }
  .host--close > .scene { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .start__frame::before { left: 5%; top: -12%; width: 120%; height: 60%; }
  .start__frame::after { left: -40%; top: 40%; width: 120%; height: 80%; }
  .start__copy { padding: var(--space-lg) var(--space-xl) var(--space-2xl); }
}
@media (max-width: 39.99rem) {
  .start__frame { border-radius: var(--radius-view); }
  .start__copy { padding: var(--space-lg) var(--space-md) var(--space-xl); }
  .start__actions .btn { width: 100%; }
}

/* ---------- Footer: the brand, the site's pages in three lists, the legal line ---------- */

.footer { --dot: var(--color-attack); padding-block: var(--space-2xl) var(--space-3xl); color: var(--color-ink); }
.footer__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-2xl) var(--gap-columns); align-items: start; }
.footer__brand { grid-column: 1 / span 4; }
.footer__mark { margin-right: 0; }
.footer__line { margin-top: var(--space-xs); max-width: 18em; color: var(--color-ink-2); }
.footer__nav { grid-column: 6 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xl) var(--gap-columns); }
.footer__head { max-width: none; font-size: var(--text-md); line-height: var(--leading-body); letter-spacing: 0; color: var(--color-ink-3); }
.footer__list { display: grid; gap: var(--space-2xs); margin: var(--space-sm) 0 0; padding: 0; list-style: none; }
.footer__link { display: inline-flex; align-items: center; min-height: var(--control-s); color: var(--color-ink); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .footer__link:hover { opacity: 0.7; }
}
html.js:not(.rm) .footer__link { transition: opacity var(--dur-hover) var(--ease-sine); }
.footer__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.footer__legal { font-size: var(--text-legal); line-height: var(--leading-legal); color: var(--color-ink-3); }
.footer__top { color: var(--color-ink); min-height: var(--control-s); }
/* The wordmark, as wide as the container, in the frame colour: "autica" is 2.64em wide at this weight and
   tracking, so the type is the container's width over 2.7. Its letters rise one after the other. */
.footer__inner { container-type: inline-size; }
.footer__big { grid-column: 1 / -1; overflow: hidden; margin-bottom: calc(-1 * var(--space-lg)); color: var(--color-paper-2); font-size: min(29vw, 26rem); font-weight: var(--weight-mark); line-height: 0.82; letter-spacing: var(--tracking-display); white-space: nowrap; user-select: none; }
@supports (font-size: 1cqw) {
  .footer__big { font-size: calc(100cqw / 2.7); }
}
.footer__big > span { display: inline-block; }
html.js:not(.rm) .footer__big:not(.is-in) > span { transform: translateY(100%); }
html.js:not(.rm) .footer__big.is-in > span { transition: transform 900ms var(--ease-quint); transition-delay: calc(var(--i) * 60ms); }
.footer__note { color: var(--color-ink-3); }
@media (max-width: 59.99rem) {
  .footer__brand, .footer__nav { grid-column: 1 / -1; }
}
@media (max-width: 39.99rem) {
  .footer { padding-block: var(--space-xl) var(--space-2xl); }
  .footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 29.99rem) {
  .footer__nav { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- The rise: viewers, the report card and the close frame, once, from 88% of the screen ---------- */

html.js:not(.rm):not(.scrub) [data-rise]:not(.is-in) { opacity: 0; transform: translateY(var(--rise-y)) scale(var(--rise-scale)); }
html.js:not(.rm):not(.booted):not(.scrub) [data-rise] { animation: show 0s 2s forwards; }
html.js:not(.rm):not(.scrub) [data-rise].is-in { transition: transform var(--dur-rise) var(--ease-rise), opacity var(--dur-rise-fade) linear; }
/* From 60rem, the scrubbed frame reveal: shell.js writes --reveal (0 to 1, eased out) from the scroll. The frame grows
   from 88%, fades up from 0.2 and rises 30% of its height; scrolling back reverses it. It scales rather than clips, so
   no line of text is ever cut at the frame's edge. */
html.js.scrub:not(.rm) [data-rise] {
  --k: calc(1 - var(--reveal, 1));
  opacity: calc(0.2 + 0.8 * var(--reveal, 1));
  transform: translateY(calc(var(--k) * 30%)) scale(calc(1 - var(--k) * 0.12));
}

/* ---------- Dialogs ---------- */

.dialog {
  width: min(100% - 2 * var(--gutter), 560px); max-width: none; max-height: calc(100% - 2 * var(--space-lg));
  margin: auto; padding: var(--space-xl); overflow: auto;
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-paper-3); color: var(--color-ink);
  opacity: 0; transform: translateY(16px);
}
.dialog::backdrop { background: var(--color-backdrop); opacity: 0; }
.dialog.is-open, .dialog.is-open::backdrop { opacity: 1; transform: none; }
html.js:not(.rm) .dialog, html.js:not(.rm) .dialog::backdrop { transition: opacity var(--dur-dialog) var(--ease-out), transform var(--dur-dialog) var(--ease-out); }
html.js:not(.rm) .dialog.is-closing, html.js:not(.rm) .dialog.is-closing::backdrop { transition-duration: var(--dur-dialog-out); transition-timing-function: var(--ease-in); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.dialog__title { font-size: var(--text-card); line-height: var(--leading-card); letter-spacing: var(--tracking-card); }
.dialog__close { flex: none; }
.dialog__line { margin-top: var(--space-xs); color: var(--color-ink-2); }

.form { display: grid; gap: var(--space-lg); margin-top: var(--space-lg); }
.form__row { display: grid; gap: var(--space-xs); }
.form__label { font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink-2); }
.form__input {
  width: 100%; min-height: var(--control); padding: 0 var(--space-md);
  border: 1px solid var(--color-line); border-radius: var(--radius-input);
  background: var(--color-paper-4); color: var(--color-ink); font-size: var(--text-md);
  outline: 2px solid transparent; outline-offset: -3px;
}
@media (hover: hover) and (pointer: fine) {
  .form__input:hover { border-color: var(--color-ink-3); }
}
html.js:not(.rm) .form__input { transition: border-color var(--dur-short) var(--ease-out); }
.form__input:focus-visible { outline-color: var(--color-focus); outline-offset: -3px; }
.form__input[aria-invalid="true"] { border-color: var(--color-error); }
.form__input:disabled { opacity: 0.55; cursor: not-allowed; }

.form__set { min-width: 0; margin: 0; padding: 0; border: 0; }
.form__set legend { padding: 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); margin-top: var(--space-xs); }
.choice { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.choice__box {
  position: relative; display: flex; align-items: center; gap: var(--space-sm);
  min-height: var(--control); padding: 0 var(--space-md);
  border: 1px solid var(--color-line); border-radius: var(--radius-input); font-size: var(--text-md); line-height: 1.2;
}
.choice__box::before { content: ""; flex: none; width: 16px; height: 16px; border: 1px solid var(--color-line); border-radius: 50%; }
.choice__box::after { content: ""; position: absolute; left: calc(var(--space-md) + 4px); top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--color-ink); opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .choice:hover .choice__box { border-color: var(--color-ink-3); }
}
.choice:active .choice__box { background: var(--color-paper-4); }
.choice input:checked + .choice__box, .choice input:checked + .choice__box::before { border-color: var(--color-ink); }
.choice input:checked + .choice__box::after { opacity: 1; }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.choice input:disabled + .choice__box { opacity: 0.55; cursor: not-allowed; }
html.js:not(.rm) .choice__box { transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
html.js:not(.rm) .choice__box::after { transition: opacity var(--dur-micro) var(--ease-out); }

.form__send { justify-self: start; }
.form__help { min-height: 1lh; margin: 0; font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink-2); }

/* The report dialog (report.js fills it): the six steps as a list, then the held, fix and retest sentences. */
.report-dialog__note { margin-top: var(--space-xs); color: var(--color-ink-2); }
/* Each number sits in its li's own padding, so a step's focus ring goes round the number too. */
.report-dialog__steps { display: grid; gap: var(--space-xs); margin: var(--space-lg) 0 0; padding-inline-start: 0; }
.report-dialog__steps li { padding-inline: calc(var(--space-lg) + var(--space-2xs)) var(--space-2xs); border-radius: var(--radius-input); }
.report-dialog__steps li::marker { color: var(--color-ink-3); }
.report-dialog__steps li:focus-visible { outline-offset: 0; }
.report-dialog__lines { display: grid; gap: var(--space-xs); margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); color: var(--color-ink-2); }

@media (max-width: 39.99rem) {
  .dialog { padding: var(--space-lg); }
  /* On a phone the choices stay in two columns, tighter, so the send button is on the first screen. */
  .choice__box { gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); }
  .choice__box::after { left: calc(var(--space-sm) + 4px); }
}

/* ---------- Solid glass: written into the HTML at build time only if the frame traces need it ---------- */

html.glass-solid :is(.segmented:not(.segmented--vertical), .btn--glass, .menu__list, .host--sticky .rail__caption),
html.glass-solid .run.is-pinned .run__card::before,
html.glass-solid .nav.is-pill .nav__bar::before {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--color-glass-solid);
}

/* ---------- Forced colours ---------- */

@media (forced-colors: active) {
  .wordmark__i { color: inherit; }
  .wordmark__i::before, .wordmark__i::after { content: none; }
  .segmented__option[aria-checked="true"], .segmented__option[aria-selected="true"] { outline: 1px solid CanvasText; outline-offset: -1px; }
  .segmented__pill { background: none; border: 1px solid CanvasText; }
  .run__mark, .rail::before, .rail__dot::before { background: CanvasText; forced-color-adjust: none; }
  .run__tick.is-active .run__mark { background: Highlight; }
  html.js .term { text-decoration-color: CanvasText; }
  .lights { display: none; }
}
