/* OpenDoc site — design foundation (Overview/Home + shared chrome).
 *
 * Warm off-white paper (#FBFAF8), graphite ink, one blue accent (#3355C4),
 * Instrument Sans (UI/body) + Newsreader (serif display/document) + JetBrains
 * Mono (code), self-hosted in src/fonts.css. This file is the shared base the
 * docs/fidelity pages reuse; their body components (carried below) inherit the
 * new tokens/type. Home components are the pixel-faithful build of the approved
 * redesign's Overview screen. */
:root {
  color-scheme: light;

  /* Surfaces + ink */
  --bg: #fbfaf8;
  --bg-2: #f2f1ed;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --surface-3: #fcfcfb;
  --paper: #f4f3ef;

  --ink: #14161a;
  --muted: #4a4e55;
  --muted-2: #565a61;
  --muted-3: #6c7078;
  --faint: #8a8e95;
  /* The AA-safe faint tone: faint text that has to be READ, on the site's paper
   * grounds (HF-189).
   *
   * `--faint` is not darkened. It carries deliberate visual weight throughout the
   * editor, where `theme-contrast.spec.mjs` already proves it passes, and moving
   * it would restyle a surface this change has no mandate over (`docs/63`: the
   * tokens are deliberate — propose, do not restyle). So there are two faint
   * tones: one for weight, one for legibility, and every site rule that paints
   * TEXT uses this one.
   *
   * Measured (WCAG 2.1 relative luminance, sRGB), against every opaque ground
   * this stylesheet paints behind text. `--faint` (#8a8e95) is shown beside it,
   * because the gap is the whole defect:
   *
   *                                 --faint   --faint-on-paper
   *   --surface            #ffffff   3.29:1       5.35:1
   *   --surface-3          #fcfcfb   3.20:1       5.21:1
   *   --bg                 #fbfaf8   3.15:1       5.13:1
   *   --paper              #f4f3ef   2.96:1       4.82:1
   *   --bg-2 / --surface-2 #f2f1ed   2.91:1       4.73:1
   *   the hero's url pill  #eceff5   2.86:1       4.64:1
   *   the figure hatch     #efeee9   2.83:1       4.60:1
   *
   * #676b73 is the lightest grey in `--faint`'s own hue family that clears 4.5:1
   * on ALL of them, and that matters more than clearing it on the one ground a
   * component happens to use today: `--faint` failed in the editor and failed
   * here for the same reason, a tone chosen against one surface and then painted
   * on a quieter one. `site-contrast.spec.mjs` re-measures all of this against
   * the rendered pages, so the table above is evidence and not a promise.
   *
   * Plainly: all seventeen `color: var(--faint)` rules in this file moved here, so
   * no site rule paints text in `--faint` any more. It is kept declared because
   * removing a token from a deliberate palette is a change this work has no
   * mandate for, and because `--faint-2`/`--faint-3` are the rest of that ladder.
   * A future non-text use of it (a rule, an icon) is fine at the 3:1 floor. */
  --faint-on-paper: #676b73;
  --faint-2: #a9acb2;
  --faint-3: #b4b7bc;
  --on-ink: #fbfaf8;

  /* Lines */
  --line: #edebe6;
  --line-2: #e4e2dd;
  --line-3: #e7e5e0;
  --line-strong: #dedbd4;

  /* Accent (blue — never orange) */
  --accent: #3355c4;
  --accent-2: #22409e;
  --accent-ink: #fbfaf8;
  --accent-tint: #eef1fb;
  --accent-selection: #d8e0f8;
  --accent-soft: rgba(51, 85, 196, 0.08);
  --accent-line: rgba(51, 85, 196, 0.3);

  /* Dark sections */
  --dark: #101215;
  --dark-2: #15181c;
  --dark-line: #262a31;
  --dark-line-2: #2e333b;
  --dark-ink: #f2f1ed;
  --dark-muted: #a8adb6;
  --dark-faint: #7e838c;

  /* Type */
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Radii + shadow */
  --radius: 8px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.05);
  --shadow-card: 0 1px 2px rgba(20, 22, 26, 0.04), 0 8px 24px rgba(20, 22, 26, 0.05);
  --shadow-page: 0 1px 3px rgba(20, 22, 26, 0.13), 0 20px 48px rgba(20, 22, 26, 0.1);
  --shadow-hero: 0 1px 2px rgba(20, 22, 26, 0.04), 0 24px 60px -24px rgba(20, 22, 26, 0.18);

  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

::selection {
  background: var(--accent-selection);
}

svg {
  display: block;
  fill: currentColor;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Centered content column for the secondary pages (docs/blog/examples/
   fidelity). Home opts out via main.home and lays out its own full-bleed
   sections + inner .wrap. Header/footer are full-bleed with their own inner. */
main {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

main.home {
  width: 100%;
  max-width: none;
  margin: 0;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================================
   Shared header + footer (built from _partials/, inlined by build-site.py)
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 248, 0.82);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--max);
  height: 56px;
  margin: 0 auto;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-inline-end: 4px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

/* The brand mark is the vector master (`opendoc-mark.svg`), not a CSS drawing
   of an older mark. One file feeds the favicon, the site header, the editor
   header, the About dialog and the README, so they cannot drift apart. */
.brand-mark {
  flex: none;
  width: 22px;
  height: 22px;
  background: url("../opendoc-mark.svg") center / contain no-repeat;
}

/* The wordmark sets the "D" in the mark's blue — the one piece of colour the
   brand source art gives the name. Deliberately the deeper #1154dc from the
   wordmark rather than the mark's #266bfc: it has to pass as text. */
.brand-d {
  color: #1154dc;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-badge {
  padding: 2px 5px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: var(--faint-on-paper);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-link {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.header-link:hover {
  color: var(--ink);
}

.header-cta {
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.14s ease;
}

.header-cta:hover {
  background: #2c2f35;
  color: var(--on-ink);
}

/* The site language control (`109` HF-198).
   Deliberately a NATIVE `<select>`. It is one control, it is keyboard- and
   screen-reader-operable in every browser without a line of JavaScript beyond
   filling it, and on a phone it opens the platform's own picker — a better list
   of nineteen languages than anything this page would draw. It borrows the type
   and colour `.header-link` already uses, so it reads as part of the header
   rather than as a form; no token is introduced and none is changed. */
.site-lang {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted-2);
}

.site-lang:hover,
.site-lang:focus-within {
  color: var(--ink);
}

.site-lang-icon {
  font-size: 17px;
  line-height: 1;
}

.site-lang select {
  max-width: 140px;
  padding: 3px 2px;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 32px;
  font-size: 13px;
}

.site-footer-copy {
  color: var(--faint-on-paper);
}

.site-footer-spacer {
  flex: 1;
}

.site-footer a {
  color: var(--muted-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ============================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.btn--ink {
  background: var(--ink);
  color: var(--on-ink);
}

.btn--ink:hover {
  background: #2c2f35;
  color: var(--on-ink);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}

.btn--outline:hover {
  border-color: #c9c6bf;
  color: var(--ink);
}

.btn--light {
  background: var(--bg);
  color: var(--ink);
}

.btn--light:hover {
  background: #ffffff;
  color: var(--ink);
}

.btn--outline-dark {
  border-color: #343a42;
  color: var(--dark-ink);
}

.btn--outline-dark:hover {
  border-color: #565d66;
  color: var(--dark-ink);
}

/* ============================================================================
   HOME (Overview)

   Visual system from the 2026-09 landing redesign, built on this file's tokens
   rather than the prototype's own palette: the same graphite ink, the one blue
   accent, Newsreader for the serif accent, JetBrains Mono for code.

   Two rules the prototype did not follow and this page must:
   - The hero embed is a STATIC poster until clicked (src/home-embed.js). The
     prototype booted a live <iframe> on page load; that spends ~100 MB of a
     marketing tab before anyone asks for the editor.
   - Every number on the page has a committed source, and
     webapp/tests/site_claims.test.mjs fails when one drifts from it.
   ========================================================================= */
.home {
  /* #16845c measured 4.48:1 on --bg and 4.14:1 on --bg-2 as `.home-state` text
     and `.home-matrix .is-full` — under the floor by a hair, which is still under
     it. #137a55 is the same hue three steps darker and clears 4.5:1 on every
     ground this stylesheet paints (5.11:1 on --bg, 4.59:1 at worst). It is a
     page-local property on `.home`, not part of the :root palette. HF-189. */
  --home-green: #137a55;
  --home-amber: #9a6212;
  --home-radius: 16px;
  padding-bottom: 4px;
}

.home code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.home-kicker {
  display: block;
  color: var(--muted-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Hero --------------------------------------------------------------- */
.home-hero {
  padding-block: clamp(48px, 9vw, 92px) clamp(36px, 5vw, 56px);
}

.home-hero-copy {
  max-width: 850px;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.home-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--home-green);
  box-shadow: 0 0 0 4px rgba(22, 132, 92, 0.12);
}

.home-hero h1 {
  max-width: 760px;
  margin: 20px 0 24px;
  font-size: clamp(40px, 6.2vw, 78px);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

/* The serif phrase is the one flourish on the page, so it is the real serif the
   site self-hosts rather than a Georgia fallback. */
.home-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.home-lede {
  max-width: 650px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn--accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.home-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--muted-3);
  font-size: 12px;
  list-style: none;
}

.home-checks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-check {
  color: var(--home-green);
  font-weight: 800;
}

/* ---- Hero embed (memory-safe: static poster until clicked) --------------- */
.home-embed {
  position: relative;
  margin-top: clamp(32px, 5vw, 56px);
  border: 1px solid #d7dde8;
  border-radius: 18px;
  background: #eef1f7;
  box-shadow: 0 24px 80px rgba(17, 19, 24, 0.1), 0 2px 8px rgba(17, 19, 24, 0.05);
  overflow: hidden;
}

.home-embed-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid #dde3ec;
  background: #f7f8fb;
}

.home-embed-dots {
  display: flex;
  gap: 6px;
}

.home-embed-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dfe3ea;
}

.home-embed-url {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.home-embed-url span {
  overflow: hidden;
  padding: 3px 12px;
  border-radius: 6px;
  background: #eceff5;
  color: var(--faint-on-paper);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-embed-full {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.home-embed-full:hover {
  color: var(--accent-2);
}

.home-embed-stage {
  position: relative;
}

/* The poster is drawn in the editor's own chrome — one grey field, a white
   ribbon card, a white page — so the preview reads as the product. It is
   aria-hidden: the Run button is the accessible content of the stage. */
.home-embed-poster {
  color: #1f1f1f;
  font-family: var(--font-sans);
  user-select: none;
}

.od-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 5px 12px;
}

.od-logo {
  flex: none;
  width: 24px;
  height: 24px;
  background: url("../opendoc-mark.svg") center / contain no-repeat;
}

.od-doc-chrome {
  flex: 1;
  min-width: 0;
}

.od-doc-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.od-menus {
  display: flex;
  gap: 1px;
  overflow: hidden;
}

.od-menus span {
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 18px;
  white-space: nowrap;
}

.od-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #fff;
  color: #5f6368;
  font-size: 10px;
  white-space: nowrap;
}

.od-state i {
  color: #188038;
  font-style: normal;
}

.od-tabs {
  display: flex;
  gap: 2px;
  height: 30px;
  align-items: flex-end;
  padding: 0 10px;
  overflow: hidden;
}

.od-tabs span {
  padding: 0 9px 7px;
  border-bottom: 2px solid transparent;
  color: #4d525a;
  font-size: 10.5px;
  white-space: nowrap;
}

.od-tabs .is-active {
  border-bottom-color: #3355c4;
  color: #1f1f1f;
  font-weight: 700;
}

.od-band {
  display: flex;
  gap: 0;
  margin: 0 6px 6px;
  padding: 6px 6px 4px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.od-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-inline-end: 1px solid #e3e8f1;
}

.od-group:last-child {
  border-inline-end: 0;
}

.od-group > span {
  color: #686b70;
  font-size: 8.5px;
}

.od-stack,
.od-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.od-font {
  display: grid;
  gap: 4px;
}

.od-stack b,
.od-row b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #30343a;
  font-size: 11px;
  font-weight: 600;
}

.od-field {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border: 1px solid #cfd6e4;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
}

.od-family {
  width: 104px;
}

.od-size {
  width: 34px;
}

.od-styles {
  display: flex;
  gap: 4px;
}

.od-style {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 58px;
  height: 48px;
  padding: 4px 6px;
  border: 1px solid #e3e8f1;
  border-radius: 6px;
  font-size: 8.5px;
}

.od-style em {
  font-family: var(--font-serif);
  font-size: 14px;
}

.od-work {
  display: grid;
  grid-template-columns: 40px 1fr;
  min-height: clamp(260px, 30vw, 340px);
}

.od-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

.od-rail b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #626872;
  font-size: 13px;
  font-weight: 400;
}

.od-rail .is-active {
  background: #e3e8f7;
  color: #3355c4;
}

.od-stage {
  padding: 20px clamp(12px, 3vw, 34px) 0;
  overflow: hidden;
}

.od-page {
  max-width: 520px;
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 38px) clamp(20px, 3.4vw, 46px);
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 22, 26, 0.12), 0 10px 30px rgba(20, 22, 26, 0.09);
}

.od-meta {
  margin-bottom: 12px;
  /* Was #858992, a hand-written copy of --faint measuring 3.51:1 on --surface at
     9px — the smallest text on the site. HF-189. */
  color: var(--faint-on-paper);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.od-h {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.02em;
}

.od-page p {
  margin: 0 0 14px;
  color: #363a43;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.6;
}

.od-table {
  border: 1px solid #e1e5ec;
  font-size: 10px;
}

.od-tr {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.7fr;
  border-top: 1px solid #e8ebf0;
}

.od-tr:first-child {
  border-top: 0;
}

.od-tr span {
  padding: 6px 8px;
}

.od-th {
  background: #f6f7f9;
  font-weight: 700;
}

.home-caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-inline-start: 1px;
  background: #3355c4;
  vertical-align: -0.15em;
  animation: homeCaretBlink 1s steps(1) infinite;
}

@keyframes homeCaretBlink {
  50% {
    opacity: 0;
  }
}

/* Run affordance (mounts exactly one live editor; see src/home-embed.js). */
.home-embed-run {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 34px -10px rgba(17, 19, 24, 0.55);
  transition: background 0.14s ease, transform 0.12s ease;
}

.home-embed-run:hover {
  background: #262a31;
  transform: translate(-50%, calc(-50% - 1px));
}

.home-embed-run:focus-visible {
  outline: 3px solid var(--accent-selection);
  outline-offset: 3px;
}

.home-embed-run .tri {
  font-size: 10px;
}

.home-embed-scrim {
  position: absolute;
  inset: 0;
  /* A veil, not a fade: the button is the focus of this state, and without an
     even wash it sat directly on the preview's heading and cut it off. */
  background: rgba(238, 241, 247, 0.62);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.home-embed.is-live .home-embed-poster,
.home-embed.is-live .home-embed-run,
.home-embed.is-live .home-embed-scrim {
  display: none;
}

.home-embed-frame {
  display: block;
  width: 100%;
  height: clamp(420px, 60vh, 620px);
  border: 0;
  background: #eef1f7;
}

.home-embed-live-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #dde3ec;
  background: #f7f8fb;
  font-size: 12px;
}

.home-embed-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
}

.home-embed-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: homeEmbedPulse 2s infinite;
}

@keyframes homeEmbedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(51, 85, 196, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(51, 85, 196, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(51, 85, 196, 0);
  }
}

.home-embed-live-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-embed-live-open {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.home-embed-live-open:hover {
  text-decoration: underline;
}

.home-embed-live-close {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.home-embed-live-close:hover {
  border-color: #c9c6bf;
}

/* ---- Rail ---------------------------------------------------------------- */
.home-rail {
  border-block: 1px solid var(--line-2);
  background: var(--surface-3);
}

.home-rail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-rail-grid > div {
  padding: 22px 18px;
  border-inline-start: 1px solid var(--line-2);
}

.home-rail-grid > div:first-child {
  border-inline-start: 0;
}

.home-rail-grid b {
  display: block;
  font-size: 13px;
}

.home-rail-grid span {
  color: var(--muted-3);
  font-size: 11.5px;
}

/* ---- Sections ------------------------------------------------------------ */
.home-section {
  padding-block: clamp(72px, 10vw, 110px);
}

.home-section--alt {
  border-block: 1px solid var(--line-2);
  background: var(--surface);
}

.home-head {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(20px, 5vw, 60px);
  align-items: start;
  margin-bottom: clamp(32px, 5vw, 54px);
}

.home-head .home-kicker {
  padding-top: 10px;
}

.home h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.home-head p {
  max-width: 700px;
  margin: 0;
  color: var(--muted-2);
  font-size: clamp(15px, 1.3vw, 17px);
}

/* ---- Why cards ----------------------------------------------------------- */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: var(--home-radius);
  background: var(--surface);
  overflow: hidden;
}

.home-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0, rgba(51, 85, 196, 0.08), transparent 34%);
  pointer-events: none;
}

.home-card-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 36px;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}

.home-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.home-card p {
  margin: 0 0 18px;
  color: var(--muted-2);
}

.home-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-card li {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.home-card li::before {
  content: "↳";
  color: var(--faint-2);
}

/* ---- Architecture (dark) -------------------------------------------------- */
.home-arch {
  padding-block: clamp(72px, 10vw, 110px);
  background: var(--dark);
  color: var(--dark-ink);
}

.home-head--dark p {
  color: var(--dark-muted);
}

.home-head--dark .home-kicker {
  color: var(--dark-faint);
}

.home-pipeline {
  padding: clamp(16px, 2.4vw, 24px);
  border: 1px solid var(--dark-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #15181d, #111318);
}

.home-pipeline-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 12px;
}

.home-hosts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-hosts span {
  padding: 4px 7px;
  border: 1px solid #343944;
  border-radius: 6px;
  color: #bbc0c8;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.home-node {
  padding: 22px 14px;
  border: 1px solid #303540;
  border-radius: 12px;
  background: #1a1e24;
  text-align: center;
}

.home-node strong {
  display: block;
  font-size: 15px;
}

.home-node span {
  display: block;
  margin-top: 5px;
  color: #9298a3;
  font-size: 11px;
}

.home-node--accent {
  border-color: #4c66c5;
  box-shadow: 0 0 0 3px rgba(77, 103, 199, 0.1);
}

.home-arrow {
  /* Was #59606d: 2.81:1 on the pipeline's --dark-2 ground, under even WCAG
     1.4.11's 3:1 floor for a graphical object. --dark-faint is this file's
     existing quiet ink for dark panels and measures 4.67:1. HF-189. */
  color: var(--dark-faint);
  font-size: 18px;
}

.home-boundary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.home-boundary > div {
  padding: 16px 18px;
  border: 1px dashed #343944;
  border-radius: 12px;
  color: var(--dark-muted);
  font-size: 12px;
}

.home-boundary b {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-size: 12px;
}

.home-arch-link {
  display: inline-flex;
  gap: 6px;
  margin-top: 26px;
  color: #b9c7ff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.home-arch-link:hover {
  color: #fff;
}

/* ---- Fidelity proof ------------------------------------------------------ */
.home-proof {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.home-proof-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--line-2);
  border-radius: var(--home-radius);
  background: var(--surface);
}

.home-proof-card--dark {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.home-proof-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.home-tag {
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-tag--dark {
  background: #1e2330;
  color: #b9c7ff;
}

.home-proof-when {
  color: var(--muted-3);
  font-size: 11px;
}

.home-proof-card--dark .home-proof-when {
  color: var(--dark-faint);
}

.home-metric {
  font-size: clamp(44px, 5vw, 58px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.05em;
}

.home-metric-label {
  margin: 10px 0 0;
  color: var(--muted-3);
  font-size: 13px;
}

.home-matrix {
  margin-top: 20px;
}

.home-matrix-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
}

.home-matrix-head {
  color: var(--muted-3);
  font-weight: 700;
}

.home-matrix .is-full {
  color: var(--home-green);
  font-weight: 700;
}

.home-matrix .is-partial {
  color: var(--home-amber);
  font-weight: 700;
}

.home-matrix .is-none {
  color: var(--muted-3);
  font-weight: 700;
}

.home-proof-link {
  align-self: flex-start;
  margin-top: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.home-proof-link:hover {
  color: var(--accent-2);
}

.home-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.home-quote-note {
  margin: 18px 0 0;
  color: var(--dark-muted);
  font-size: 13px;
}

.home-dist {
  margin-top: auto;
  padding-top: 26px;
}

.home-dist-label {
  margin-bottom: 10px;
  color: var(--dark-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-dist-bar {
  display: flex;
  gap: 3px;
  height: 10px;
}

.home-dist-bar span {
  flex: var(--n) 1 0;
  border-radius: 3px;
}

.home-dist .is-full {
  background: #34c28a;
}

.home-dist .is-partial {
  background: #e0a33c;
}

.home-dist .is-preserved {
  background: #7d8cc7;
}

.home-dist .is-none {
  background: #4a505b;
}

.home-dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--dark-muted);
  font-size: 12px;
  list-style: none;
}

.home-dist-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-dist-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.home-dist-legend b {
  color: #fff;
  font-weight: 700;
}

/* ---- Developers ---------------------------------------------------------- */
.home-dev {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.home-dev-copy p {
  color: var(--muted-2);
  font-size: 16px;
}

.home-steps {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.home-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 12px;
  counter-increment: step;
}

.home-steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.home-steps b {
  font-size: 13.5px;
}

.home-steps span {
  color: var(--muted-3);
  font-size: 12.5px;
}

.home-terminal {
  min-width: 0;
  border-radius: 17px;
  background: #111318;
  color: #e8e9ed;
  box-shadow: 0 20px 60px rgba(17, 19, 24, 0.16);
  overflow: hidden;
}

.home-terminal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid #272b33;
  color: #969ca6;
  font-size: 11px;
}

.home-terminal-tabs {
  display: flex;
  gap: 4px;
}

.home-terminal-tabs button {
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9aa0aa;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.home-terminal-tabs button[aria-selected="true"] {
  background: #252a33;
  color: #fff;
}

.home-terminal-tabs button:focus-visible {
  outline: 2px solid #b9c7ff;
  outline-offset: 1px;
}

.home-terminal pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  font: 12.5px/1.8 var(--font-mono);
}

.home-terminal .prompt,
.home-terminal .kw {
  color: #b8c5ff;
}

.home-terminal .comment {
  color: #8b919c;
}

.home-terminal .str {
  color: #7ed7ae;
}

.home-terminal .num {
  color: #f2c98a;
}

/* ---- Roadmap ------------------------------------------------------------- */
#roadmap {
  padding-bottom: clamp(48px, 6vw, 72px);
}

.home-roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-phase {
  padding-top: 16px;
  border-top: 2px solid var(--line-strong);
}

.home-phase.is-done {
  border-color: var(--home-green);
}

.home-phase.is-now {
  border-color: var(--accent);
}

.home-state {
  color: var(--muted-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-phase.is-done .home-state {
  color: var(--home-green);
}

.home-phase.is-now .home-state {
  color: var(--accent);
}

.home-phase h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.home-phase p {
  margin: 0;
  color: var(--muted-3);
  font-size: 13px;
}

.home-gaps {
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  color: var(--muted-2);
  font-size: 13.5px;
}

.home-gaps a {
  margin-inline-start: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* ---- CTA ----------------------------------------------------------------- */
.home-cta {
  padding-block: 0 clamp(48px, 8vw, 90px);
}

.home-cta-box {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 24px;
  background: linear-gradient(135deg, #111318, #191d26);
  color: #fff;
  overflow: hidden;
}

.home-cta-box::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -210px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 100, 221, 0.34), rgba(68, 100, 221, 0) 65%);
  pointer-events: none;
}

.home-cta-box > div {
  position: relative;
  z-index: 1;
}

.home-cta h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.4vw, 42px);
}

.home-cta p {
  margin: 0;
  color: #aeb3bd;
}

.home-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .home-head,
  .home-proof,
  .home-dev {
    grid-template-columns: 1fr;
  }

  .home-cards {
    grid-template-columns: 1fr;
  }

  .home-flow {
    grid-template-columns: 1fr;
  }

  .home-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .home-boundary {
    grid-template-columns: 1fr;
  }

  .home-roadmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-rail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-rail-grid > div:nth-child(odd) {
    border-inline-start: 0;
  }

  .home-rail-grid > div {
    border-top: 1px solid var(--line-2);
  }

  .home-rail-grid > div:first-child,
  .home-rail-grid > div:nth-child(2) {
    border-top: 0;
  }

  /* Five facts in two columns leave one orphan; let it take the whole row so
     the grid closes cleanly instead of ending on a half-width cell. */
  .home-rail-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .od-hide-narrow {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-roadmap {
    grid-template-columns: 1fr;
  }

  .home-rail-grid > div {
    padding: 14px 12px;
  }

  .home-cta-box {
    flex-direction: column;
    align-items: flex-start;
  }

  /* The poster keeps its identity on a phone but sheds the chrome that would
     only shrink into illegibility: menus, the tab strip and the rail. */
  .od-menus,
  .od-tabs,
  .od-rail,
  .od-state {
    display: none;
  }

  .od-work {
    grid-template-columns: 1fr;
  }

  .od-band {
    display: none;
  }

  .home-embed-full {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-caret,
  .home-embed-live-dot {
    animation: none;
  }

  .home-embed-run:hover {
    transform: translate(-50%, -50%);
  }
}

/* ============================================================================
   Legacy button + kicker primitives still used by the secondary pages
   ========================================================================= */
.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--ink);
  color: var(--on-ink);
  background: var(--ink);
}

.button-primary:hover {
  background: #2c2f35;
  border-color: #2c2f35;
  color: var(--on-ink);
}

.button-secondary {
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: #c9c6bf;
}

/* ============================================================================
   Secondary-page primitives (docs / blog / examples / fidelity). Carried from
   the previous build so those pages keep rendering; they inherit the new
   tokens + type and get their own redesign pass next.
   ========================================================================= */
.page-hero {
  max-width: 760px;
  padding: 72px 0 40px;
}

.page-hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.page-hero > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.page-hero-note {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.text-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-2);
}

.example-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 0.86em;
}

/* ============================================================================
   Docs — three-column reference reader (rail · article · on-this-page)
   ========================================================================= */
.doc-reader {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 48px;
  padding: 48px 0 96px;
}

.doc-rail-inner,
.doc-toc-inner {
  position: sticky;
  top: 88px;
  align-self: start;
}

.doc-rail-title,
.doc-toc-title {
  margin: 0 0 12px;
  color: var(--faint-on-paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-rail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.doc-rail-list:last-child {
  margin-bottom: 0;
}

.doc-rail-list a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.doc-rail-list a:hover {
  background: var(--paper);
  color: var(--ink);
}

.doc-rail-list a.is-active {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
}

.doc-article {
  min-width: 0;
}

.doc-eyebrow {
  margin-bottom: 14px;
  color: var(--faint-on-paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-article h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}

.doc-lede {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.6;
}

.doc-langtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 8px;
}

.doc-langtabs .tab {
  padding: 5px 11px;
  border-radius: 7px;
  color: var(--muted-3);
  font-size: 12px;
}

.doc-langtabs .tab.is-active {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
}

.doc-h2 {
  margin: 44px 0 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 600;
  scroll-margin-top: 80px;
}

.doc-body {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.doc-body code,
.doc-lede code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 0.86em;
}

/* Code panel (captioned code block shared by docs + fidelity contexts) */
.code-panel {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.code-panel-head {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

.code-panel-head span {
  color: var(--faint-on-paper);
  font-family: var(--font-mono);
  font-size: 11px;
}

.code-panel pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
}

.code-panel .kw {
  color: #8a5a16;
}

.code-panel .str {
  color: #2e6b4f;
}

.code-panel .cmt {
  color: var(--faint-on-paper);
}

/* Dispositions table (CSS grid — the two-axis import taxonomy) */
.disp-table {
  margin-top: 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
}

.disp-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 2fr;
  border-bottom: 1px solid var(--line);
}

.disp-row:last-child {
  border-bottom: none;
}

.disp-row.head {
  background: var(--surface-3);
}

.disp-row.head > div {
  padding: 11px 16px;
  color: var(--faint-on-paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.disp-row .disp-name {
  padding: 13px 16px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.disp-row .disp-cell {
  padding: 13px 16px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.55;
}

.doc-callout {
  margin-top: 32px;
  padding: 14px 18px;
  border-inline-start: 2px solid var(--accent);
  background: var(--bg);
  scroll-margin-top: 80px;
}

.doc-callout-label {
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doc-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.doc-pager {
  display: flex;
  gap: 16px;
  margin-top: 44px;
}

.doc-pager a {
  flex: 1;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.doc-pager a:hover {
  border-color: #c9c6bf;
}

.doc-pager a.next {
  text-align: end;
}

.doc-pager-dir {
  margin-bottom: 6px;
  color: var(--faint-on-paper);
  font-size: 12px;
}

.doc-pager-title {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
}

.doc-toc-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding-inline-start: 14px;
  border-left: 1px solid var(--line-2);
  list-style: none;
}

.doc-toc-list a {
  color: var(--faint-on-paper);
  font-size: 12.5px;
  text-decoration: none;
}

.doc-toc-list a:hover {
  color: var(--ink);
}

.doc-toc-list a[aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
   Reference pages — the repository's own design docs, rendered as site pages by
   webapp/tools/build-doc-pages.mjs.

   ADDITIVE ONLY, and token-only. `docs/63` is explicit that the palette is
   deliberate and that visual changes are proposed rather than made, so nothing
   above this comment is touched and nothing below it introduces a colour: every
   value here is one of the existing tokens, and every one of them is a tone
   `tests/e2e/site-contrast.spec.mjs` already measures on these grounds. Faint
   text uses `--faint-on-paper` (5.13:1 on `--bg`, 5.21:1 on `--surface-3`), never
   `--faint` (3.15:1), which is the AA defect HF-189 closed.

   What is new is only the shapes Markdown produces and the hand-built docs page
   never needed: prose headings below h2, bulleted and numbered lists, GFM tables,
   block quotes, thematic breaks, and the reference index's entry list.
   ------------------------------------------------------------------------- */

/* Content first in the source, navigation ordered into place beside it.
 *
 * A reference page's rail carries every published document, which is fifteen
 * links and five group headings — fine in a column, two screenfuls on a phone,
 * where `.doc-reader` collapses to one column and a rail-first page would make a
 * reader scroll past the whole navigation to reach the document they asked for.
 * So the article is first in the DOM (which is also the right reading order for
 * a screen reader) and `order` puts the rail back in the left column at the
 * widths that have one. Scoped to `.is-reference`: `docs.html` is authored
 * rail-first and is not touched. */
.doc-reader.is-reference .doc-rail {
  order: -1;
}

@media (max-width: 820px) {
  .doc-reader.is-reference .doc-rail {
    order: 0;
    margin-top: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--line-2);
  }
}

/* The index has no "on this page" column of its own — it IS a list of pages — so
 * it uses the space rather than leaving an empty third column.
 *
 * Guarded by `min-width`, deliberately. The narrow-width rules below are written
 * against the bare `.doc-reader` class, so a two-class selector like this one
 * would out-specify them and keep a 220px sidebar on a 390px phone. A rule that
 * only ever applies above the breakpoint cannot do that. */
@media (min-width: 821px) {
  .doc-reader.is-index {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  /* Two columns instead of three is a wider measure, and a 120-character line is
     harder to read than a narrow one. The column is wide; the text is not. */
  .doc-reader.is-index .doc-article {
    max-width: 780px;
  }
}

/* Where the page comes from. One line, under the lede. */
.doc-provenance {
  margin: 16px 0 0;
  color: var(--faint-on-paper);
  font-size: 12.5px;
  line-height: 1.5;
}

.doc-provenance code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.doc-prose > .doc-h2:first-child {
  margin-top: 34px;
}

.doc-h3 {
  margin: 32px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}

.doc-h4 {
  margin: 26px 0 0;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  scroll-margin-top: 80px;
}

.doc-prose .code-panel {
  margin-top: 20px;
}

/* Lists. Nested lists indent from their parent item rather than from the article,
   so a three-level design note keeps its structure. */
.doc-list {
  margin: 12px 0 0;
  padding-inline-start: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.doc-list li + li,
.doc-list .doc-list {
  margin-top: 7px;
}

.doc-list code,
.doc-table code,
.doc-quote code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* Tables. A reference doc's table is as wide as its widest row, which on a phone
   is wider than the screen — so the TABLE scrolls sideways inside its own box and
   the page never does. */
.doc-table-scroll {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: 12px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doc-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--faint-on-paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: start;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  line-height: 1.55;
  vertical-align: top;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

/* Block quotes carry the status banners and admonitions these documents use, so
   they are set apart without being coloured as a warning. */
.doc-quote {
  margin: 26px 0 0;
  padding: 2px 18px 14px;
  border-inline-start: 2px solid var(--line-strong);
  background: var(--surface-3);
}

.doc-rule {
  margin: 38px 0 0;
  border: 0;
  border-top: 1px solid var(--line-2);
}

/* The reference index: one entry per published document, with its own summary. */
.doc-index-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.doc-index-list li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.doc-index-list li:last-child {
  border-bottom: none;
}

.doc-index-title {
  font-size: 16px;
  font-weight: 500;
}

.doc-index-summary {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Blog / changelog */
.blog-list {
  display: grid;
  gap: 20px;
  max-width: 760px;
  padding-bottom: 96px;
}

.blog-entry {
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.blog-entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--faint-on-paper);
  font-size: 12px;
}

.blog-tag {
  padding: 3px 9px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-entry h2 {
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.blog-entry p {
  margin-bottom: 0;
  color: var(--muted);
}

.blog-entry-links {
  margin-top: 16px;
}

.blog-empty {
  padding: 40px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.blog-empty-mark {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.blog-empty-mark span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.blog-empty h2 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.blog-empty p {
  max-width: 460px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 14px;
}

.blog-empty .hero-actions {
  justify-content: center;
  margin-top: 0;
}

/* Examples gallery — click-to-activate live editor demos */
.example-gallery {
  padding-bottom: 96px;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.example-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.example-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.example-poster {
  position: absolute;
  inset: 0;
}

.example-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.example-poster-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 22, 26, 0) 40%, rgba(20, 22, 26, 0.3));
}

.example-run {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(51, 85, 196, 0.28);
  transition: background 0.15s ease, transform 0.1s ease;
}

.example-run:hover {
  background: var(--accent-2);
  transform: translate(-50%, -50%) translateY(-1px);
}

.example-run:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.example-run-icon {
  font-size: 11px;
}

.example-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.example-card.is-live .example-poster {
  display: none;
}

.example-live-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(251, 250, 248, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.example-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
}

.example-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: examplePulse 2s infinite;
}

@keyframes examplePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(51, 85, 196, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(51, 85, 196, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(51, 85, 196, 0);
  }
}

.example-live-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-live-open {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.example-live-open:hover {
  text-decoration: underline;
}

.example-live-close {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.example-live-close:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.example-live-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.example-body {
  padding: 20px 22px 22px;
}

.example-kicker {
  color: var(--accent);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.example-body h3 {
  margin: 10px 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.example-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.example-fallback {
  margin: 28px 0 0;
  color: var(--faint-on-paper);
  font-size: 13px;
}

.example-fallback a {
  color: var(--accent);
}

/* ============================================================================
   Fidelity — oracle report (hero · metrics · render/diff · corpus fixtures)
   ========================================================================= */
.fid-report {
  padding: 48px 0 96px;
}

.fid-intro {
  max-width: 700px;
}

.fid-kicker {
  display: block;
  margin-bottom: 14px;
  color: var(--faint-on-paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fid-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.032em;
  font-weight: 600;
  text-wrap: balance;
}

.fid-intro p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.6;
}

.fid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 44px 0;
}

.fid-stat {
  padding: 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
}

.fid-stat-num {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: -0.02em;
}

.fid-stat-label {
  margin-top: 6px;
  color: var(--muted-3);
  font-size: 12.5px;
}

.fid-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.fid-panel {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.fid-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.fid-panel-head .title {
  font-size: 13px;
  font-weight: 500;
}

.fid-panel-head .spacer {
  flex: 1;
}

.fid-panel-head .meta {
  color: var(--faint-on-paper);
  font-family: var(--font-mono);
  font-size: 11px;
}

.fid-panel-head .meta.good {
  color: #2e6b4f;
}

.fid-panel-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 320px;
  background: repeating-linear-gradient(135deg, var(--paper) 0 10px, #efeee9 10px 20px);
}

.fid-panel-figure span {
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--faint-on-paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.fid-fixtures {
  margin-top: 44px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
}

.fid-fixtures-scroll {
  overflow-x: auto;
}

.fid-frow {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr;
  align-items: center;
  min-width: 640px;
  border-bottom: 1px solid var(--line);
}

.fid-frow:last-child {
  border-bottom: none;
}

.fid-frow.head {
  background: var(--surface-3);
}

.fid-frow.head > div {
  padding: 12px 18px;
  color: var(--faint-on-paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fid-frow .fx-name {
  padding: 14px 18px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.fid-frow .fx-cell {
  padding: 14px 18px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.fid-frow .fx-cell.mono {
  color: var(--muted-2);
  font-family: var(--font-mono);
}

.fx-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}

.fx-chip.byte {
  color: #2e6b4f;
  background: rgba(46, 107, 79, 0.08);
  border-color: rgba(46, 107, 79, 0.25);
}

.fx-chip.semantic {
  color: var(--accent-2);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.fx-chip.gap {
  color: #8a5a16;
  background: #fbf2e0;
  border-color: rgba(138, 90, 22, 0.28);
}

.fid-foot {
  margin: 24px 0 0;
  color: var(--faint-on-paper);
  font-size: 13px;
}

/* Secondary: per-construct support detail (the honest granular breakdown
   behind the oracle numbers, rendered from src/fidelity.js). */
.fid-matrix {
  margin-top: 88px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
}

.fid-matrix-intro {
  max-width: 760px;
  margin-bottom: 8px;
}

.fid-matrix-intro h2 {
  margin: 24px 0 0;
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.fid-matrix-intro p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.fid-matrix-intro .fidelity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.fid-matrix-intro .fidelity-meta a {
  color: var(--accent);
}

.fidelity-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 24px;
  margin: 8px 0 36px;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.fidelity-legend h2 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint-on-paper, var(--muted));
}
.fidelity-legend li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--muted);
  list-style: none;
}
.fidelity-legend .mark {
  flex: 0 0 auto;
  width: 1.4em;
  text-align: center;
}
.fidelity-legend b {
  color: var(--ink);
  font-weight: 600;
}

.fidelity-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
}
.fidelity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 720px;
}
.fidelity-table caption {
  text-align: start;
  padding: 16px 18px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.fidelity-table th,
.fidelity-table td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.fidelity-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--line-strong);
  z-index: 1;
}
.fidelity-table thead th.stage {
  text-align: center;
}
.fidelity-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--ink);
}
.fidelity-table tbody th[scope="row"] small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}
.fidelity-table td.cell {
  text-align: center;
  white-space: nowrap;
}
.fidelity-table tbody tr:last-child th,
.fidelity-table tbody tr:last-child td {
  border-bottom: 0;
}
.fidelity-table tbody tr:hover td,
.fidelity-table tbody tr:hover th[scope="row"] {
  background: var(--bg-2);
}
.fmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  color: var(--muted);
}
.fmark .glyph {
  font-size: 1.1rem;
  line-height: 1;
}
.fmark.full .glyph {
  color: #2a8a4a;
}
.fmark.partial .glyph {
  color: var(--accent);
}
.fmark.placeholder .glyph {
  color: #b98900;
}
.fmark.preserved .glyph {
  color: #6a7078;
}
.fmark.none .glyph {
  color: var(--line-strong);
}

.fidelity-notes {
  margin: 28px 0 8px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.fidelity-notes h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.fidelity-notes ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}
.fidelity-notes li {
  margin-bottom: 6px;
}
.fidelity-notes code {
  font-size: 0.86em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 5px;
}
.fidelity-owner-note {
  margin: 20px 0 80px;
  padding: 16px 20px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ============================================================================
   Responsive
   ========================================================================= */
@media (max-width: 960px) {
  .home-arch .wrap,
  .home-quickstart .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .home-cap-grid {
    grid-template-columns: 1fr;
  }

  .home-status-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Docs reader: drop the right-hand "On this page" rail first, keep the
     left section rail beside the article. */
  .doc-reader {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 32px;
  }

  .doc-toc {
    display: none;
  }

  .fid-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .example-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  /* The nav used to be `display: none` here with nothing put in its place: no
     toggle, no overflow menu, no footer duplicate. On a phone that left Docs
     and Fidelity reachable only by typing a URL or pressing Back — the site's
     own navigation, gone (HF-087). It does not need to be hidden; it needs a
     row. The header wraps, the brand and the actions keep the first row, and
     the four primary links get the full width of the second one, centred.
     Wrapping rather than a disclosure keeps ONE nav in the DOM: no duplicated
     link set to drift, no second `aria-current`, and no JavaScript on a static
     marketing page that otherwise ships none. */
  .site-header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-block: 10px;
  }

  .site-nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-header-actions {
    margin-inline-start: auto;
  }

  .home-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-roadmap-row {
    grid-template-columns: 48px 1fr;
    gap: 8px 16px;
  }

  .home-roadmap-status {
    grid-column: 2;
  }

  /* Docs reader: stack the section rail above the article. */
  .doc-reader {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .doc-rail-inner {
    position: static;
  }

  .fid-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .wrap {
    padding: 0 20px;
  }

  .site-header-inner {
    padding: 0 20px;
    gap: 16px;
  }

  /* The "Pre-release" chip is decoration and can go; the GitHub link is a
     destination and stays. It was hidden here too, so on a phone the header
     offered exactly one link out of the current page (HF-087). With the nav on
     its own row above, the first row has the width for brand + GitHub + CTA. */
  .brand-badge {
    display: none;
  }

  .site-footer-inner {
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 32px 20px;
  }

  .site-footer-spacer {
    display: none;
  }

  .site-footer-copy {
    flex-basis: 100%;
  }

  .home-hero {
    padding-top: 56px;
  }

  .home-cta-row .btn,
  .home-final-actions .btn {
    flex: 1 1 auto;
  }

  .home-metrics-grid {
    grid-template-columns: 1fr;
  }

  .home-status-cols {
    grid-template-columns: 1fr;
  }

  .home-status-top {
    padding: 28px 24px;
  }

  .home-status-foot {
    padding: 16px 24px;
  }

  .home-final-panel {
    padding: 56px 28px;
  }

  .home-arch .wrap,
  .home-quickstart .wrap,
  .home-metrics,
  .home-cap {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .page-hero {
    padding: 48px 0 32px;
  }

  .blog-entry {
    padding: 22px;
  }

  .fid-stats {
    grid-template-columns: 1fr;
  }

  .fid-report,
  .doc-reader {
    padding-top: 32px;
    padding-bottom: 64px;
  }

  /* Dispositions: stack retention under the name, keep the meaning readable. */
  .disp-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 6px 0;
  }

  .disp-row.head {
    display: none;
  }

  .disp-row .disp-name {
    padding-bottom: 2px;
  }

  .disp-row .disp-cell {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .doc-pager {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---- Right to left (`109` HF-198) ---------------------------------------
   The chrome mirrors for a right-to-left locale, and a DOCUMENT never does on
   its account — that distinction is `localize.mjs`'s and is structural rather
   than left to a stylesheet (docs/124 §3.5). `applyDocumentLocale` puts `dir`
   on `<html>` from the catalogue's own `@@direction`, so this needs no script.

   Almost all of the mirroring is already done by the rules above: every
   direction-sensitive declaration in this file is written with a LOGICAL
   property (`margin-inline-start`, `border-inline-start`, `text-align: start`),
   which renders identically in a left-to-right page and correctly in a
   right-to-left one. That conversion is why this block is four rules and not
   forty.

   What logical properties cannot fix is a GLYPH. An arrow is a picture of a
   direction, and `→` still points right in an Arabic page — so the decorative
   arrows, the ones marked `aria-hidden` because they carry no words, are
   mirrored here. Arrows that sit INSIDE a sentence are not: they went through
   the seam with the sentence, and which way an arrow points in Arabic is the
   translator's decision rather than this file's. */
[dir="rtl"] .site-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

/* The call-to-action box's decorative blob is positioned from the right edge;
   mirrored, it sits where the design puts it rather than over the copy. */
[dir="rtl"] .home-cta-box::after {
  right: auto;
  left: -120px;
}
