/* 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;
  --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-right: 4px;
  color: var(--ink);
  text-decoration: none;
}

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

.brand-mark {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(150deg, #3b5fd0, #22409e);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 10px;
  border-radius: 1.5px;
  background: var(--bg);
  transform: translate(-50%, -50%);
}

.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);
  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);
}

.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);
}

.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) — pixel build of the approved redesign
   ========================================================================= */
.home {
  padding-bottom: 4px;
}

/* ---- Hero --------------------------------------------------------------- */
.home-hero {
  padding-top: 92px;
}

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

.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.home-eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}

.home-lede {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.home-lede code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.85em;
}

.home-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.home-privacy {
  margin: 20px 0 0;
  color: var(--faint);
  font-size: 13px;
}

/* ---- Live editor embed strip (memory-safe: static poster until clicked) - */
.home-embed {
  margin-top: 56px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}

.home-embed-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

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

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

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

.home-embed-url span {
  padding: 3px 12px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.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-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.home-embed-toolbar .tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
}

.home-embed-toolbar .tb-btn.italic {
  font-style: italic;
  font-family: var(--font-serif);
}

.home-embed-toolbar .tb-sep {
  width: 1px;
  height: 18px;
  margin: 0 6px;
  background: var(--line);
}

.home-embed-toolbar .tb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.home-embed-toolbar .tb-chip .caret {
  color: var(--faint-2);
  font-size: 9px;
}

.home-embed-toolbar .tb-align {
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

.home-embed-toolbar .tb-spacer {
  flex: 1;
}

.home-embed-toolbar .tb-meta {
  color: var(--faint-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.home-embed-stage {
  position: relative;
  background: var(--paper);
}

.home-embed-poster {
  padding: 26px 0 0;
  max-height: 372px;
  overflow: hidden;
}

.home-embed-page {
  width: 620px;
  max-width: 100%;
  margin: 0 auto;
  padding: 44px 60px 40px;
  background: var(--surface);
  border: 1px solid var(--line-3);
  border-bottom: none;
  box-shadow: 0 8px 24px -12px rgba(20, 22, 26, 0.14);
}

.home-embed-title {
  margin-bottom: 14px;
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.25;
}

.home-embed-eyebrow {
  margin-bottom: 22px;
  color: var(--faint);
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.home-embed-body {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
  color: #22252b;
}

.home-caret {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: caretBlink 1.05s steps(1) infinite;
}

@keyframes caretBlink {
  0%,
  45% {
    opacity: 1;
  }
  55%,
  100% {
    opacity: 0;
  }
}

.home-embed-mock-table {
  margin-top: 20px;
  font-family: var(--font-serif);
  font-size: 12.5px;
  border: 1px solid var(--line-3);
  border-bottom: none;
}

.home-embed-mock-table .row {
  display: flex;
  border-bottom: 1px solid var(--line-3);
}

.home-embed-mock-table .row.head .c {
  background: #faf9f6;
  font-weight: 500;
}

.home-embed-mock-table .c {
  padding: 8px 12px;
  border-right: 1px solid var(--line-3);
}

.home-embed-mock-table .c:last-child {
  border-right: none;
}

.home-embed-mock-table .c.doc {
  flex: 2;
}

.home-embed-mock-table .c.num {
  flex: 1;
}

/* Run affordance (mounts exactly one live editor; see src/home-embed.js). */
.home-embed-run {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(51, 85, 196, 0.5);
  transition: background 0.14s ease, transform 0.1s ease;
}

.home-embed-run:hover {
  background: var(--accent-2);
}

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

.home-embed-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 22, 26, 0) 55%, rgba(20, 22, 26, 0.06));
  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: 520px;
  border: 0;
  background: var(--surface);
}

.home-embed-live-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-3);
  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;
}

/* ---- Metrics quad -------------------------------------------------------- */
.home-metrics {
  padding-top: 72px;
  padding-bottom: 72px;
}

.home-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--line-2);
  overflow: hidden;
}

.home-metrics-grid div {
  padding: 24px 26px;
  background: var(--bg);
}

.home-metric-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-metric-sub {
  margin-top: 5px;
  color: var(--muted-3);
  font-size: 13px;
}

/* ---- Shared section intro ----------------------------------------------- */
.home-kicker {
  display: block;
  margin-bottom: 16px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section-intro {
  max-width: 720px;
}

.home-section-intro h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}

.home-section-intro p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

/* ---- Capabilities -------------------------------------------------------- */
.home-cap {
  padding-top: 24px;
  padding-bottom: 96px;
}

.home-cap .home-section-intro {
  margin-bottom: 48px;
}

.home-cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cap-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
}

.cap-card-num {
  color: var(--faint-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cap-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cap-card > p {
  margin: 0;
  color: var(--muted-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.cap-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.cap-card-list li {
  color: var(--muted);
  font-size: 13px;
}

/* ---- Architecture (dark, full-bleed) ------------------------------------ */
.home-arch {
  background: var(--dark);
  color: var(--dark-ink);
}

.home-arch .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

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

.home-arch h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.home-arch-copy p {
  margin: 20px 0 0;
  color: var(--dark-muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.home-arch-link {
  display: inline-block;
  margin-top: 28px;
  padding-bottom: 3px;
  border-bottom: 1px solid #40454e;
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 500;
}

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

.home-arch-panel {
  padding: 28px;
  border: 1px solid var(--dark-line);
  border-radius: 14px;
  background: var(--dark-2);
}

.home-arch-panel-label {
  margin-bottom: 20px;
  color: #6e747e;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-arch-flow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-arch-flow .node {
  flex: 1;
  padding: 12px 0;
  border: 1px solid var(--dark-line-2);
  border-radius: 9px;
  background: #1b1f24;
  color: var(--dark-ink);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.home-arch-flow .node.accent {
  border-color: var(--accent);
  background: #1a2038;
  color: #c3cff5;
}

.home-arch-flow .arrow {
  color: #5a606a;
  font-size: 12px;
}

.home-arch-branch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.home-arch-branch span {
  padding: 10px 0;
  border: 1px dashed var(--dark-line-2);
  border-radius: 9px;
  color: var(--dark-muted);
  font-size: 12px;
  text-align: center;
}

.home-arch-hosts {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--dark-line);
}

.home-arch-hosts span {
  flex: 1;
  color: var(--dark-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ---- Quickstart ---------------------------------------------------------- */
.home-quickstart .wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 64px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

.home-quickstart h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 36px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.home-quickstart-copy p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.6;
}

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

.home-terminal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

.home-terminal-head span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.home-terminal pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 2;
}

.home-terminal .prompt {
  color: var(--faint-2);
}

.home-terminal .comment {
  color: var(--faint);
}

/* ---- Status callout ------------------------------------------------------ */
.home-status {
  padding-bottom: 96px;
}

.home-status-card {
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.home-status-top {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  padding: 44px 44px 40px;
}

.home-status-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 6px;
  background: #fbf2e0;
  color: #8a5a16;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-status-top h2 {
  margin: 18px 0 0;
  font-size: clamp(26px, 3.2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.home-status-lede {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.home-status-col h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-status-col.works h3 {
  color: #2e6b4f;
}

.home-status-col.next h3 {
  color: #8a5a16;
}

.home-status-col p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-status-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 16px 44px;
  border-top: 1px solid var(--line);
  background: var(--surface-3);
}

.home-status-foot a {
  font-size: 13px;
  font-weight: 500;
}

/* ---- Roadmap ------------------------------------------------------------- */
.home-roadmap {
  padding-bottom: 96px;
}

.home-roadmap .home-section-intro {
  max-width: 680px;
  margin-bottom: 40px;
}

.home-roadmap-list {
  border-top: 1px solid var(--line-2);
}

.home-roadmap-row {
  display: grid;
  grid-template-columns: 64px 1fr 200px;
  gap: 24px;
  align-items: baseline;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line-2);
}

.home-roadmap-phase {
  color: var(--faint-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.home-roadmap-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.home-roadmap-detail {
  margin-top: 4px;
  color: var(--muted-3);
  font-size: 13.5px;
}

.home-roadmap-status {
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ---- Final CTA (dark panel) --------------------------------------------- */
.home-final {
  padding-bottom: 120px;
}

.home-final-panel {
  padding: 80px 56px;
  border-radius: 20px;
  background: var(--dark);
  color: var(--dark-ink);
  text-align: center;
}

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

.home-final-panel h2 {
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.home-final-panel p {
  max-width: 520px;
  margin: 20px auto 0;
  color: var(--dark-muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.home-final-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* ============================================================================
   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);
  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);
  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);
  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);
}

/* 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);
  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-left: 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: right;
}

.doc-pager-dir {
  margin-bottom: 6px;
  color: var(--faint);
  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-left: 14px;
  border-left: 1px solid var(--line-2);
  list-style: none;
}

.doc-toc-list a {
  color: var(--faint);
  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;
}

/* 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);
  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);
  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);
  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);
  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);
  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);
  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);
  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, 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: left;
  padding: 16px 18px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.fidelity-table th,
.fidelity-table td {
  padding: 12px 14px;
  text-align: left;
  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-left: 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) {
  .site-nav {
    display: none;
  }

  .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;
  }

  .brand-badge,
  .header-link {
    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;
  }
}
