:root {
  --bg: #fbfaf8;
  --fg: #1a1c22;
  --muted: #5b6070;
  --surface: #ffffff;
  --line: #e2e0db;
  /* --line falls to ~1.3:1 against --bg/--surface, well under the 3:1 WCAG
     SC 1.4.11 needs for a control boundary. This is a separate, darker token
     for borders that must stay perceivable (.btn, .theme-toggle), so hairline
     dividers using --line elsewhere stay light. */
  --line-strong: #878b97;
  --accent: #1d5fd0;
  --sev-info: #1d5fd0;
  --sev-warn: #9a6100;
  --sev-error: #b3261e;
  --stratum-1: #dfe8fb;
  --stratum-2: #cfdcf7;
  --stratum-3: #bfd0f3;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 68ch;
  --radius: 10px;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #12141a;
  --fg: #e6e8ee;
  --muted: #9aa1b3;
  --surface: #1a1d26;
  --line: #2b2f3b;
  --line-strong: #686d7a;
  --accent: #7fa9f5;
  --sev-info: #7fa9f5;
  --sev-warn: #e8b04b;
  --sev-error: #f28b82;
  --stratum-1: #1f2a41;
  --stratum-2: #26324c;
  --stratum-3: #2d3b58;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.sr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

[data-reveal] { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: calc(var(--reveal-index, 0) * 70ms);
  }
  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

.shiki,
.shiki span {
  color: var(--shiki-light);
  background-color: var(--shiki-light-bg);
}
[data-theme='dark'] .shiki,
[data-theme='dark'] .shiki span {
  color: var(--shiki-dark);
  background-color: var(--shiki-dark-bg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 5;
}
@supports not (backdrop-filter: blur(8px)) {
  .topnav { background: var(--bg); }
}
.wordmark { font-weight: 650; letter-spacing: -0.01em; text-decoration: none; color: var(--fg); }
.topnav nav { margin-left: auto; display: flex; gap: 1.25rem; }
.theme-toggle {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.sitefoot {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.btn {
  display: inline-block;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.copied { border-color: var(--sev-info); }
.btn.copied::after { content: ' ✓'; }

.landing main { max-width: 1040px; margin: 0 auto; padding: 0 1.5rem; }
/* The sticky topnav sits above the content, so a same-page or #main
   skip-link jump must leave room under it instead of landing the heading
   underneath the header. docs.css does the same for docs headings. */
#main,
.landing section[id] { scroll-margin-top: 5rem; }
.landing section { padding: 4.5rem 0; border-bottom: 1px solid var(--line); }
.landing section:last-of-type { border-bottom: 0; }
.landing h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.section-lede, .lede { color: var(--muted); max-width: var(--measure); }

.hero { padding-top: 4rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); margin: 0 0 0.75rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 1.25rem; }
.hero .lede { font-size: 1.1rem; }
.cta { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 2.5rem; }
.cta-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--surface); }
.cta-label { margin: 0 0 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cta-block pre { margin: 0 0 1rem; overflow-x: auto; font-size: 0.85rem; }

.strata { width: 100%; height: auto; }
.strata .chip rect, .strata .stratum > rect { fill: var(--stratum-1); stroke: var(--line); }
.strata .ir > rect { fill: var(--stratum-2); }
.strata .findings > rect { fill: var(--stratum-3); }
.strata text { fill: var(--fg); font-family: var(--mono); font-size: 14px; text-anchor: middle; }
.strata .stratum > text:first-of-type { font-size: 16px; font-weight: 600; }
/* --muted only clears 4.04:1 (light) / 4.33:1 (dark) against the darkest
   stratum fill here, under the 4.5:1 AA text minimum. Darker/lighter than
   --muted just for this label; --muted itself is untouched everywhere else
   it's used. */
.strata text.sub { font-size: 12px; fill: #545867; }
[data-theme='dark'] .strata text.sub { fill: #a0a7ba; }
.strata .rails path { stroke: var(--line); stroke-width: 1.5; fill: none; }

.terminal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.terminal-bar { display: flex; gap: 0.4rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.terminal pre { margin: 0; padding: 1.25rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.7; }
.terminal .prompt { color: var(--muted); }
.sev-warn { color: var(--sev-warn); font-weight: 650; }
.sev-info { color: var(--sev-info); font-weight: 650; }
.sev-error { color: var(--sev-error); font-weight: 650; }
.caption { color: var(--muted); max-width: var(--measure); margin-top: 1.25rem; }

.claim-grid, .analysis-grid, .surface-grid {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.claim-grid li, .analysis-grid li, .surface-grid li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
}
.claim-grid h3, .analysis-grid h3, .surface-grid h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.claim-grid p, .analysis-grid p, .surface-grid p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.surface-grid pre { margin: 0 0 0.75rem; overflow-x: auto; font-size: 0.82rem; }

.matrix-scroll { overflow-x: auto; margin-top: 2rem; }
.matrix { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.9rem; }
.matrix caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: 0.85rem; padding-top: 1rem; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 0.6rem 0.75rem; text-align: left; }
.matrix thead th { background: var(--surface); font-weight: 600; }
.matrix td.yes { color: var(--sev-info); }
.matrix td.pending { color: var(--sev-warn); }

.closing { text-align: center; }
.closing pre { display: inline-block; text-align: left; margin: 1.5rem 0; overflow-x: auto; max-width: 100%; }
