/* ZEROTRUST — zerotrust-cli.com
   Two colors. No noise. Color supports hierarchy, never trust:
   every status on this site is a text label, never a hue. */

/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
}
/* Metric-matched fallbacks so text does not reflow when Plex arrives. */
@font-face {
  font-family: "Plex Sans Fallback";
  font-weight: 400;
  src: local("Arial"), local("Helvetica");
  size-adjust: 101.57%;
  ascent-override: 100.92%;
  descent-override: 27.07%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Plex Sans Fallback";
  font-weight: 500;
  src: local("Arial"), local("Helvetica");
  size-adjust: 103.82%;
  ascent-override: 98.73%;
  descent-override: 26.49%;
  line-gap-override: 0%;
}
/* The hero is set on a character grid, so the mono fallbacks are matched to
   Plex Mono's 0.6em advance: nothing moves when the real font swaps in. */
@font-face {
  font-family: "Plex Mono Fallback A";
  src: local("Menlo");
  size-adjust: 99.66%;
}
@font-face {
  font-family: "Plex Mono Fallback B";
  src: local("Consolas");
  size-adjust: 109.13%;
}

/* ── Tokens ────────────────────────────────────────────── */
/* --carbon and --chalk drive the page, the hero and (through main.js) the browser's
   toolbar colour. Three static copies of Carbon are not read from here: the theme-color
   tags in index.html and 404.html, and theme_color in site.webmanifest. */
:root {
  --carbon: #0a0a0a;
  --chalk: #F1F0EB;

  /* Chalk theme (default) */
  --bg: var(--chalk);
  --surface: #FCFCF9;
  --ink: var(--carbon);
  --muted: #626A65;
  --line: #D1D4CC;
  --inv-bg: var(--carbon);
  --inv-ink: var(--chalk);
  --inv-muted: #ADB7AE;
  --term-bg: #151918;
  --term-bar: #242A26;
  --term-edge: #151918;
  --term-ink: #F1F0EB;
  --term-muted: #ADB7AE;
  color-scheme: light;

  /* The hero is Carbon in both themes, so in the dark theme it and the page are one surface. */
  --hero-bg: var(--carbon);
  --hero-ink: var(--chalk);
  --hero-muted: #ADB7AE;
  --hero-line: #272D2A;

  --sans: "IBM Plex Sans", "Plex Sans Fallback", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Plex Mono Fallback A", "Plex Mono Fallback B", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --gap: 1.5rem;
  --bar: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="chalk"]) {
    --bg: var(--carbon);
    --surface: #1B201E;
    --ink: var(--chalk);
    --muted: #ADB7AE;
    --line: #2F3632;
    --inv-bg: var(--chalk);
    --inv-ink: var(--carbon);
    --inv-muted: #626A65;
    --term-bg: #0B0D0C;
    --term-bar: #1B201E;
    --term-edge: #2F3632;
    color-scheme: dark;
  }
}
:root[data-theme="carbon"] {
  --bg: var(--carbon);
  --surface: #1B201E;
  --ink: var(--chalk);
  --muted: #ADB7AE;
  --line: #2F3632;
  --inv-bg: var(--chalk);
  --inv-ink: var(--carbon);
  --inv-muted: #626A65;
  --term-bg: #0B0D0C;
  --term-bar: #1B201E;
  --term-edge: #2F3632;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--bar);
  background: var(--bg);
}
/* While the hero is on screen the canvas matches it, so overscroll at the top stays dark. */
.js[data-hero]:not(.past-hero) { background: var(--hero-bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, dl, dd, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }

h2 {
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}
h2 { font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem); }
p { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

button { font: inherit; color: inherit; cursor: pointer; border-radius: 0; }
code, pre, textarea { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

.wrap {
  width: min(100% - 2 * var(--gutter), 75rem);
  margin-inline: auto;
}
/* Single-column grids must not grow to fit long code lines. */
.split, .band-grid, .section-head, .step, .lab, .foot-grid { grid-template-columns: minmax(0, 1fr); }
.block { padding-block: clamp(4.5rem, 9vw, 9rem); }
.block + .block { padding-top: 0; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: var(--gutter); top: -4rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  font: 500 0.8125rem var(--mono);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

/* Sheet labels: mono, uppercase, quiet. */
.label {
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.slash { margin-inline: 0.55em; }
.n {
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sheet-row {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
}
.sheet-row .label:last-child { flex: none; }
.prompt { color: var(--muted); user-select: none; }

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
/* While the hero is on screen the bar takes its colors, so the two read as one surface.
   theme.js sets .js before first paint; main.js adds .past-hero once the hero has gone. */
.js[data-hero]:not(.past-hero) .site-header {
  --bg: var(--hero-bg);
  --ink: var(--hero-ink);
  --muted: var(--hero-muted);
  --line: var(--hero-line);
  border-bottom-color: transparent;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--bar);
}
/* The signature. Keep intact: no stretch, no effects. */
.sig {
  font: 500 1.0625rem/1 var(--mono);
  color: var(--ink);
  text-decoration: none;
  white-space: pre;
}

/* The release stage: a quiet tag beside the signature, never part of it. */
.brand { display: flex; align-items: center; gap: 0.75rem; }
.stage {
  padding: 0.125rem 0.375rem 0.1875rem;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, currentColor 40%, transparent);
  color: var(--muted);
  font: 400 0.6875rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
a.stage:hover { color: var(--ink); border-color: var(--ink); }
/* Below this width the bar has no room for it beside the full wordmark and tabs. */
@media (max-width: 45.99rem) {
  .stage { display: none; }
}

/* Tabs, numbered in the mark's own brackets. */
.nav ol { display: flex; gap: clamp(0.875rem, 2.4vw, 2.25rem); }
.nav a {
  display: inline-flex;
  align-items: center;
  padding-block: 0.5rem;
  font: 400 0.8125rem/1 var(--mono);
  color: var(--muted);
  text-decoration: none;
  white-space: pre;
  transition: color 0.2s ease;
}
.nav .k { display: inline-flex; }
.nav .k span { transition: transform 0.2s ease; }
.nav .t { margin-left: 1ch; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] .k { font-weight: 500; }
/* Hover opens the brackets a little. */
.nav a:hover .k span:first-child { transform: translateX(-2px); }
.nav a:hover .k span:last-child { transform: translateX(2px); }

.ext {
  font: 400 0.8125rem/1 var(--mono);
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.5rem;
  transition: color 0.2s ease;
}
.ext:hover { color: var(--ink); }
.tools { display: flex; align-items: center; gap: 1.25rem; }

/* Theme picker: the brand's two swatches. Follows the system until one is chosen. */
.swatches { display: flex; gap: 0.25rem; }
.swatch {
  width: 1.5rem; height: 1.5rem;
  padding: 3px;
  background: none;
  border: 1px solid transparent;
}
.swatch::before {
  content: "";
  display: block;
  width: 100%; height: 100%;
  border: 1px solid var(--line);
}
.swatch-chalk::before { background: var(--chalk); }
.swatch-carbon::before { background: var(--carbon); }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch:hover { border-color: var(--muted); }

/* ── Controls ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.8125rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font: 500 0.875rem/1.4 var(--mono);
  text-decoration: none;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn span { transition: transform 0.2s ease; }
.btn:hover span { transform: translateX(3px); }

.copy {
  padding: 0.3125rem 0.625rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 400 0.75rem/1.4 var(--mono);
  white-space: pre;
}
.copy:hover { color: var(--ink); border-color: var(--ink); }

/* ── 01 Intro: hero ────────────────────────────────────── */
/* One full-window field of [0] marks. On load the marks resolve into the text, and
   afterwards the field follows the pointer.
   Everything is set on the field's grid: a cell is 4ch wide and one row (1.7em) tall.
   Body text is 1x the field size (four letters to a cell); the headline is --h1-scale
   times that, with lines a whole number of rows tall, so text and marks share rows. */
.hero {
  --f: max(clamp(0.75rem, calc((100vw - 2 * var(--gutter)) / 25.5), 1rem), min(0.55rem + 0.75vw, 1.5rem));
  --row: calc(var(--f) * 1.7);
  --h1-scale: 2;                       /* 1, 2 or 4 keep the headline locked to the grid */

  /* Components inside the hero pick up its colors. */
  --bg: var(--hero-bg);
  --ink: var(--hero-ink);
  --muted: var(--hero-muted);
  --line: var(--hero-line);

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--bar);
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
  border-bottom: 1px solid var(--hero-line);
  touch-action: pan-y;
}
.hero ::selection { background: var(--hero-ink); color: var(--hero-bg); }

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero-type {
  margin-block: auto;
  padding-block: calc(var(--row) * 2);
  font: 400 var(--f)/1.7 var(--mono);
  text-align: center;
}
h1 {
  max-width: 38ch;
  margin-inline: auto;
  font: 500 calc(var(--f) * var(--h1-scale))/1.7 var(--mono);
  letter-spacing: 0;
  text-wrap: balance;
}
.nb { white-space: nowrap; }             /* keeps a hyphenated word on one line */
.lead {
  max-width: 56ch;
  margin: var(--row) auto 0;
  color: var(--muted);
  text-wrap: balance;
}
.install { margin-top: calc(var(--row) * 2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.install a { text-decoration: none; }
.install a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.install .more {
  /* margin-left: 4ch; */
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.install .more:hover { color: var(--ink); }

/* The field. Cells are drawn by main.js, which also drives their brightness;
   each cell is one [0] and a space. The opacity on `.field i` is how bright a mark is
   at rest: change it here and main.js picks it up. */
.field {
  position: absolute;
  inset: 0;
  z-index: 0;
  font: 400 var(--f)/1.7 var(--mono);
  pointer-events: none;
  user-select: none;
}
.field-grid {
  position: absolute;
  left: 0; top: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), 4ch);
}
.field i {
  display: block;
  width: 4ch;
  height: 1.7em;
  font-style: normal;
  white-space: pre;
  opacity: 0.03;
}
.field i::before { content: "[0]"; }
.field i.x { visibility: hidden; }

/* Typed entrance. The text is in the document from the start; it is only held back until
   the field resolves into it. If the script never runs, it appears on its own. */
.js .hero:not(.typing):not(.typed) [data-type] {
  visibility: hidden;
  animation: appear 0s linear 4s forwards;
}
.hero.typing .ch {
  visibility: hidden;
  animation: appear 0s linear 8s forwards;
}
.hero.typing .ch.v { visibility: visible; }
@keyframes appear { to { visibility: visible; } }

/* Four properties, along the foot of the window. */
.props {
  display: grid;
  gap: 1.25rem var(--gap);
  padding-block: 1.25rem clamp(1.5rem, 3.5vh, 2.5rem);
  border-top: 1px solid var(--line);
}
.props dt {
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.props dd {
  max-width: 17.5rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── 01.1 The evidence chain ───────────────────────────── */
.split {
  display: grid;
  gap: 2.5rem var(--gap);
}
.split-head h2 { margin-top: 1.25rem; max-width: 12em; }
.split-head > p:last-child {
  max-width: 31em;
  margin-top: 1.5rem;
  color: var(--muted);
}
.classes li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.25rem var(--gap);
  align-items: baseline;
  padding-block: 1.375rem;
  border-top: 1px solid var(--line);
}
.classes li:last-child { border-bottom: 1px solid var(--line); }
.classes h3 { font: 500 1.125rem/1.4 var(--mono); }
.classes p, .classes li > code { grid-column: 2; }
.classes li > code {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── 01.2 The honest limit: inverted band ──────────────── */
.band {
  background: var(--inv-bg);
  color: var(--inv-ink);
  padding-block: clamp(4rem, 8vw, 7.5rem);
}
.band ::selection { background: var(--inv-ink); color: var(--inv-bg); }
.band .label { color: var(--inv-muted); }
.band-grid { display: grid; gap: 1.5rem var(--gap); }
.band h2 { font-size: clamp(2rem, 1rem + 4.4vw, 4.25rem); }
.band-grid > p:last-child {
  max-width: 28em;
  color: var(--inv-muted);
}
.neq { font-weight: 400; }

/* ── Section heads ─────────────────────────────────────── */
.section-head {
  display: grid;
  gap: 1.25rem var(--gap);
  margin-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 5vw, 4rem);
}
.section-head p { max-width: 30em; color: var(--muted); }

/* ── 02 Quickstart ─────────────────────────────────────── */
.step {
  display: grid;
  gap: 1.25rem var(--gap);
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-copy {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: var(--gap);
  align-items: baseline;
  align-content: start;
}
.step-copy h3 { font-size: 1.375rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.step-copy p {
  grid-column: 2;
  max-width: 26em;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
}
.code {
  position: relative;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
}
.code pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.code .in, .code .out { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .in { padding-left: 2ch; padding-right: 3.75rem; text-indent: -2ch; }
.code .out { color: var(--muted); }
.code .copy { position: absolute; top: 0.9375rem; right: 0.9375rem; background: var(--surface); }

/* ── 03 Demo ───────────────────────────────────────────── */
/* The example projects. The pressed one is in reverse video, as a failure is. */
.cases { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cases button {
  padding: 0.5rem 0.875rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 400 0.8125rem/1.4 var(--mono);
}
.cases button:hover { color: var(--ink); border-color: var(--ink); }
.cases button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.case-about {
  max-width: 46em;
  min-height: 3.2em;
  margin-block: 1rem var(--gap);
  color: var(--muted);
}

.lab { display: grid; gap: var(--gap); }

.bundle {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
}
.bundle-head, .term-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font: 400 0.8125rem/1.4 var(--mono);
}
.bundle-head > span:last-child, .term-head > span:last-child {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bundle-head {
  padding: 0.8125rem 1.25rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.bundle-head > span:first-child { color: var(--ink); font-weight: 500; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-inline: 0.25rem;
}
.tabs button {
  flex: none;
  padding: 0.625rem 0.875rem;
  margin-bottom: -1px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: 400 0.8125rem/1.4 var(--mono);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button.dirty::after { content: "*"; }
.tabs button.out { margin-left: auto; }             /* the anchor: not a file of the project */
.tabs button:focus-visible { outline-offset: -2px; }

.tabpanel { display: flex; flex-direction: column; flex: 1; }
.tabpanel[hidden] { display: none; }
.tabpanel label {
  padding: 1rem 1.25rem 0;
  font: 400 0.75rem/1.4 var(--mono);
  color: var(--muted);
}
.tabpanel label .kind { margin-left: 0.75em; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.6875rem; }
.tabpanel textarea {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 14.5rem;
  padding: 0.625rem 1.25rem 1.25rem;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  resize: none;
}
.tabpanel textarea.wrap-all { white-space: pre-wrap; word-break: break-all; }
.tabpanel textarea:focus-visible { outline-offset: -2px; }

.cheats {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
}
.cheat-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.cheat-row button {
  padding: 0.4375rem 0.6875rem;
  background: transparent;
  border: 1px solid var(--line);
  font: 400 0.78125rem/1.4 var(--mono);
}
.cheat-row button:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cheat-row .reset { color: var(--muted); border-style: dashed; }
.cheat-row .reset:hover { color: var(--bg); border-style: solid; }

/* The terminal is carbon in both themes. */
.term {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--term-bg);
  color: var(--term-ink);
  border: 1px solid var(--term-edge);
  border-radius: 0.5rem;
  font-family: var(--mono);
}
.term ::selection { background: var(--term-ink); color: var(--term-bg); }
.term :focus-visible { outline-color: var(--term-ink); }
.term-head {
  padding: 0.8125rem 1.75rem;
  background: var(--term-bar);
  color: var(--term-muted);
}
.term-body {
  flex: 1;
  min-height: 12rem;
  padding: 1.75rem 1.75rem 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.term .prompt { color: var(--term-muted); }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl.sub { padding-left: 4ch; color: var(--term-muted); }
.tl.after { margin-top: 0.75rem; color: var(--term-muted); }
.tl.after + .tl { color: var(--term-muted); }
/* The verdict is the first word. Fail loudly, in plain text: reverse video, never red. */
.st { font-weight: 500; }
.st-fail, .st-error {
  padding-inline: 0.5ch;
  margin-left: -0.5ch;
  background: var(--term-ink);
  color: var(--term-bg);
}

.rerun {
  padding: 0.75rem 1.75rem 1.5rem;
  background: none;
  border: 0;
  color: var(--term-muted);
  font: 400 0.9375rem/1.7 var(--mono);
  text-align: left;
}
.rerun:hover { color: var(--term-ink); }
.rerun:focus-visible { outline-offset: -4px; }

.coach {
  margin-top: var(--gap);
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--ink);
  max-width: 46em;
  min-height: 3.2em;
  font-size: 1.0625rem;
  font-weight: 500;
}
.fine {
  max-width: 52em;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Today and tomorrow, side by side: what is built, and what is not. */
.roadmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem var(--gap);
  margin-block: clamp(3rem, 6vw, 5rem) 2rem;
}
.roadmap dl { margin: 1rem 0 0; }
.roadmap dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem var(--gap);
  padding-block: 0.875rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.roadmap dl > div:last-child { border-bottom: 1px solid var(--line); }
.roadmap dd { color: var(--muted); }
.roadmap code { font-size: 0.875em; color: var(--ink); }
.roadmap .n { display: block; margin-bottom: 0.125rem; }

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  border-top: 1px solid var(--line);
}
/* The evidence chain: an identity motif. Not a progress bar, score or seal. */
.chain {
  font: 500 clamp(1.375rem, 7.4vw, 3.25rem)/1 var(--mono);
  white-space: nowrap;
  user-select: none;
}
.foot-grid {
  display: grid;
  gap: 2rem var(--gap);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.foot-id p { max-width: 20em; margin-top: 0.875rem; color: var(--muted); font-size: 0.9375rem; }
.site-footer ul { display: grid; gap: 0.625rem; font: 400 0.8125rem/1.4 var(--mono); }
.site-footer ul a { color: var(--muted); text-decoration: none; }
.site-footer ul a:hover { color: var(--ink); }
.foot-zero { max-width: 24em; font: 400 0.8125rem/1.7 var(--mono); color: var(--muted); }
.foot-rule {
  flex-wrap: wrap;
  row-gap: 0.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* ── 404 ───────────────────────────────────────────────── */
.lost {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2rem;
  max-width: 44rem;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 3rem;
}
.lost .term { width: 100%; }
.lost .term-body { min-height: 0; padding-bottom: 1.75rem; }
.lost-note { margin-top: 0.75rem; padding-left: 0; }

/* ── Without JavaScript ────────────────────────────────── */
html:not(.js) .swatches,
html:not(.js) .copy,
html:not(.js) .cheats,
html:not(.js) .rerun,
html:not(.js) .bundle,
html:not(.js) .cases,
html:not(.js) .case-about,
html:not(.js) .coach { display: none; }
html:not(.js) .term-body { padding-bottom: 1.75rem; }

/* ── Small screens ─────────────────────────────────────── */
@media (max-width: 39.99rem) {
  :root { --bar: 3.5rem; }
  .ext { display: none; }
  .hero-type { padding-block: var(--row); }
  .nav ol { gap: 0.75rem; }
  /* Only the current tab spells out its name; the others fold down to their brackets. */
  .js .nav .t {
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.3s ease, margin-left 0.3s ease, opacity 0.3s ease;
  }
  .js .nav a[aria-current] .t { max-width: 11ch; margin-left: 1ch; opacity: 1; }
  /* The narrowest phones have no room for a spelled-out tab: brackets only. */
  @media (max-width: 22.49rem) {
    .js .nav a[aria-current] .t { max-width: 0; margin-left: 0; opacity: 0; }
  }
  /* The mark stands alone on small screens; the wordmark stays in the accessible name. */
  .sig-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tools { gap: 0; }
  .term-head, .term-body, .rerun { padding-inline: 1.125rem; }
  .term-body { font-size: 0.8125rem; min-height: 9rem; }
  .tabpanel textarea { min-height: 11.5rem; }
  .rerun { font-size: 0.8125rem; }
  .code pre { padding-inline: 1.125rem; font-size: 0.8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
  .tabs button { padding-inline: 0.5rem; font-size: 0.75rem; }
  .wide { display: none; }
}

/* ── Medium and up ─────────────────────────────────────── */
@media (min-width: 23.4375rem) {
  .props { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 40rem) {
  .foot-grid { grid-template-columns: 5fr 3fr 4fr; }
}



@media (min-width: 56rem) {
  .props { grid-template-columns: repeat(4, 1fr); }

  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .classes li { grid-template-columns: 2.5rem 8.5rem 1fr; }
  .classes p, .classes li > code { grid-column: 3; }

  .band-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .band-grid .label { grid-column: 1 / -1; }

  .section-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .step { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .lab { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roadmap dl > div { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* ── Motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .tl.in { animation: rise 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(3px); }
  }
  .field { animation: field-in 0.9s ease-out both; }
  @keyframes field-in {
    from { opacity: 0; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn span, .nav .k span, .nav .t { transition: none; }
  .js .hero [data-type] { visibility: visible; animation: none; }
}
