/* Andon site — tokens and rules follow DESIGN.md at the repository root
   (the Vercel analysis from VoltAgent/awesome-design-md). Light is the spec's
   canvas; dark is designed from the spec's own polarity-flipped ink band, not
   inverted from light. The one chromatic device is the andon lamp in the hero,
   which takes its three colours from the semantic tokens. */

:root {
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* surfaces */
  --canvas: #fafafa;
  --card: #ffffff;
  --inset: #f5f5f5;
  --hairline: #ebebeb;
  --hairline-strong: #a1a1a1;
  --ring: rgba(0, 0, 0, 0.08);

  /* text */
  --ink: #171717;
  --body: #4d4d4d;
  --mute: #666666;
  --on-primary: #ffffff;
  --primary: #171717;

  /* semantic — the verdict and attestation ladder */
  --blue: #0070f3;
  --blue-text: #0761d1;
  --blue-soft: #d3e5ff;
  --red: #ee0000;
  --red-text: #c50000;
  --red-soft: #f7d4d6;
  --amber: #f5a623;
  --amber-text: #ab570a;
  --amber-soft: #ffefcf;
  --gray-lamp: #a1a1a1;

  /* tier ladder: one hue (the spec's link blue, OKLCH h 257), darkest =
     strongest evidence. Five steps of OKLCH L 0.48 → 0.76 in 0.07 gaps, so
     the palest step still clears the canvas at 2:1 and the ladder reads as a
     ladder without colour vision. Each step's ink is the one that clears
     WCAG AA on it: white on A 6.69:1 and B 4.92:1, ink on C 4.89:1,
     D 6.40:1 and N 8.34:1 — verified with the dataviz palette validator
     (ordinal mode) rather than by eye. */
  --tier-A: #0159ba;
  --tier-B: #226fd2;
  --tier-C: #3a85ea;
  --tier-D: #539bff;
  --tier-N: #7db3ff;
  --tier-A-ink: #ffffff;
  --tier-B-ink: #ffffff;
  --tier-C-ink: #171717;
  --tier-D-ink: #171717;
  --tier-N-ink: #171717;

  /* the terminal is the same dark object in both themes */
  --term-bg: #0b0b0b;
  --term-ink: #d4d4d4;
  --term-head: #ededed;
  --term-dim: #8a8a8a;
  --term-ring: rgba(0, 0, 0, 0.35);

  --shadow-2: 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 2px rgba(0, 0, 0, 0.04);
  --shadow-4: 0 2px 2px rgba(0, 0, 0, 0.04), 0 8px 16px -4px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --pill: 100px;

  --gutter: 24px;
  --section: 96px;
  --lamp: var(--gray-lamp);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0a0a0a;
    --card: #111111;
    --inset: #171717;
    --hairline: #262626;
    --hairline-strong: #3d3d3d;
    --ring: rgba(255, 255, 255, 0.1);
    --ink: #ededed;
    --body: #a1a1a1;
    --mute: #8a8a8a;
    --on-primary: #0a0a0a;
    --primary: #ededed;
    --blue: #52a8ff;
    --blue-text: #79b8ff;
    --blue-soft: #0f2a4a;
    --red: #ff4d4d;
    --red-text: #ff6166;
    --red-soft: #3c1618;
    --amber: #f5a623;
    --amber-text: #f5a623;
    --amber-soft: #33210a;
    --gray-lamp: #555555;
    /* the same ladder, polarity-flipped: OKLCH L 0.76 → 0.44, brightest =
       strongest. Inks: canvas ink on A 9.21:1, B 6.84:1, C 4.93:1; light ink
       on D 4.81:1 and N 6.79:1. */
    --tier-A: #7db3ff;
    --tier-B: #4d98ff;
    --tier-C: #337ee3;
    --tier-D: #1665c8;
    --tier-N: #004ea6;
    --tier-A-ink: #0a0a0a;
    --tier-B-ink: #0a0a0a;
    --tier-C-ink: #0a0a0a;
    --tier-D-ink: #ededed;
    --tier-N-ink: #ededed;
    --term-ring: rgba(255, 255, 255, 0.12);
    --shadow-2: none;
    --shadow-4: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #0a0a0a;
  --card: #111111;
  --inset: #171717;
  --hairline: #262626;
  --hairline-strong: #3d3d3d;
  --ring: rgba(255, 255, 255, 0.1);
  --ink: #ededed;
  --body: #a1a1a1;
  --mute: #8a8a8a;
  --on-primary: #0a0a0a;
  --primary: #ededed;
  --blue: #52a8ff;
  --blue-text: #79b8ff;
  --blue-soft: #0f2a4a;
  --red: #ff4d4d;
  --red-text: #ff6166;
  --red-soft: #3c1618;
  --amber: #f5a623;
  --amber-text: #f5a623;
  --amber-soft: #33210a;
  --gray-lamp: #555555;
  /* the same ladder, polarity-flipped: OKLCH L 0.76 → 0.44, brightest =
     strongest. Inks: canvas ink on A 9.21:1, B 6.84:1, C 4.93:1; light ink
     on D 4.81:1 and N 6.79:1. */
  --tier-A: #7db3ff;
  --tier-B: #4d98ff;
  --tier-C: #337ee3;
  --tier-D: #1665c8;
  --tier-N: #004ea6;
  --tier-A-ink: #0a0a0a;
  --tier-B-ink: #0a0a0a;
  --tier-C-ink: #0a0a0a;
  --tier-D-ink: #ededed;
  --tier-N-ink: #ededed;
  --term-ring: rgba(255, 255, 255, 0.12);
  --shadow-2: none;
  --shadow-4: none;
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

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

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

code {
  background: var(--inset);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
  line-height: inherit;
  word-break: break-word;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

h3 {
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.03em;
}

p {
  margin: 0 0 16px;
  color: var(--body);
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: 500;
  color: var(--ink);
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
  color: var(--body);
}

li {
  margin-bottom: 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--primary);
  color: var(--on-primary);
  padding: 8px 14px;
  border-radius: var(--pill);
  z-index: 20;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--mute);
  margin: 0 0 16px;
  letter-spacing: 0;
}

.lead {
  font-size: 18px;
  line-height: 28px;
}

.section {
  padding: var(--section) 0;
  border-top: 1px solid var(--hairline);
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-bottom: 16px;
}

/* ---------- nav ---------- */

.top {
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .mark {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0 auto 0 8px;
}

.nav-links a,
.nav-repo,
.theme-toggle {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.28px;
  color: var(--body);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--pill);
  background: transparent;
  border: 0;
  font-family: var(--sans);
  cursor: pointer;
}

.nav-links a:hover,
.nav-repo:hover,
.theme-toggle:hover {
  color: var(--ink);
  background: var(--inset);
}

.nav-repo {
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
  font-weight: 500;
}

.theme-toggle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

/* ---------- hero and the andon board ---------- */

.hero {
  padding: 0 0 var(--section);
}

.board {
  position: relative;
  border-bottom: 1px solid var(--hairline);
  padding: 0;
}

.lamp {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px 24px;
  padding: 16px 0;
}

.lamp[data-state="idle"],
.lamp[data-state="self-report"] {
  --lamp: var(--gray-lamp);
}

.lamp[data-state="confirmed"] {
  --lamp: var(--blue);
}

.lamp[data-state="divergent"] {
  --lamp: var(--red);
}

.lamp-face {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 18px;
  min-width: 0;
}

.lamp-glyph {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--lamp);
}

.lamp-glyph .g {
  display: none;
}

.lamp[data-state="idle"] .g-idle,
.lamp[data-state="self-report"] .g-hollow,
.lamp[data-state="confirmed"] .g-filled,
.lamp[data-state="divergent"] .g-stop {
  display: block;
}

.lamp-text {
  min-width: 0;
}

.lamp-label {
  display: block;
  color: var(--ink);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.lamp[data-state="divergent"] .lamp-label {
  color: var(--red-text);
}

.lamp[data-state="confirmed"] .lamp-label {
  color: var(--blue-text);
}

.lamp-sub {
  display: block;
  color: var(--mute);
  font-size: 12px;
}

.lamp-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--inset);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--ring);
}

.lamp-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40px;
  width: calc(100% + 40px);
  background: repeating-linear-gradient(90deg, var(--lamp) 0 20px, transparent 20px 40px);
  animation: line-run 1.1s linear infinite;
}

.lamp[data-state="divergent"] .lamp-track::after {
  background: var(--lamp);
  animation: none;
  transform: none;
}

@keyframes line-run {
  to {
    transform: translateX(40px);
  }
}

.cord {
  position: absolute;
  right: var(--gutter);
  top: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.cord::before {
  content: "";
  display: block;
  width: 1px;
  height: 40px;
  background: var(--hairline-strong);
}

.cord-handle {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  padding: 6px 12px;
  border-radius: var(--pill);
  border: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  cursor: pointer;
}

.cord-handle:hover {
  background: var(--inset);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
  padding-top: 88px;
}

.hero-copy h1 {
  margin-bottom: 24px;
}

.hero-copy .lead {
  max-width: 44ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--pill);
  text-decoration: none;
  border: 0;
  font-family: var(--sans);
}

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

.btn-primary:hover {
  color: var(--on-primary);
  opacity: 0.88;
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

.btn-secondary:hover {
  background: var(--inset);
}

.hero-note {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 18px;
  color: var(--mute);
}

/* ---------- terminal ---------- */

.terminal {
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--term-bg);
  color: var(--term-ink);
  box-shadow: 0 0 0 1px var(--term-ring), var(--shadow-4);
  overflow: hidden;
  min-width: 0;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #222;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--term-dim);
}

.term-title {
  color: var(--term-head);
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-status {
  white-space: nowrap;
}

.term-btn {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 0;
  background: #1c1c1c;
  color: #ededed;
  box-shadow: inset 0 0 0 1px #333;
  cursor: pointer;
}

.term-btn:hover {
  background: #262626;
}

.term-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.term-screen {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 19px;
  padding: 16px 18px 20px;
  height: 540px;
  max-height: 70vh;
  overflow: auto;
  tab-size: 4;
  /* The transcript's longest lines outrun the 7/12 hero column; wrapping them
     keeps every word in view with no inner scrollbar, and the odd unbroken
     token (the %TEMP% path) may break anywhere on a narrow screen. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--term-ink);
}

.t-line {
  display: inline-block;
  min-width: 100%;
  border-radius: 3px;
}

.t-head {
  color: var(--term-head);
  font-weight: 500;
}

.t-confirmed {
  color: #79c0ff;
  background: rgba(82, 168, 255, 0.12);
}

.t-divergent {
  color: #ff7b72;
  background: rgba(255, 77, 77, 0.16);
}

.t-disagreed,
.t-stub {
  color: var(--term-dim);
}

.t-adversary {
  color: var(--amber);
}

.term-cap {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 18px;
  color: var(--term-dim);
  padding: 10px 14px 12px;
  border-top: 1px solid #222;
}

.term-cap code {
  background: #1c1c1c;
  color: #d4d4d4;
}

/* ---------- diagrams ---------- */

.figure {
  margin: 0 0 40px;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-2);
}

.figure svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  font-family: var(--mono);
}

.figure figcaption {
  margin-top: 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

.diagram text {
  font-family: var(--mono);
  font-size: 12px;
  fill: currentColor;
}

.diagram .head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--mute);
}

.diagram .dim {
  fill: var(--mute);
}

.diagram .box {
  fill: var(--canvas);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.diagram .box-store {
  fill: var(--inset);
  stroke: var(--hairline-strong);
  stroke-dasharray: 4 3;
}

.diagram .box-outcome {
  fill: var(--card);
  stroke: currentColor;
  stroke-width: 1.25;
}

.diagram .edge {
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
}

.diagram .edge-dim {
  stroke: var(--hairline-strong);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 4 3;
}

.diagram .arrow {
  fill: currentColor;
}

.diagram .blue {
  fill: var(--blue-text);
}

.diagram .red {
  fill: var(--red-text);
}

.diagram .lane-fast {
  stroke: var(--blue);
}

.diagram .lane-async {
  stroke: var(--amber);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 24px;
}

.outcomes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.outcomes th,
.outcomes td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--body);
}

.outcomes th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
}

.outcomes td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

.outcomes .yes,
.outcomes .no {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.outcomes .yes {
  color: var(--blue-text);
}

.outcomes .no {
  color: var(--mute);
}

.callout {
  border-left: 2px solid var(--hairline-strong);
  padding: 4px 0 4px 20px;
  margin-top: 40px;
  max-width: 760px;
}

.callout h3 {
  margin-bottom: 8px;
}

.callout p {
  font-size: 15px;
  line-height: 24px;
}

/* ---------- what it measures ---------- */

.derived {
  font-size: 15px;
  line-height: 24px;
  margin-bottom: 32px;
}

.tiers {
  margin: 0 0 40px;
}

.tier-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--mono);
}

.tier-svg .seg-letter {
  font-size: 17px;
  font-weight: 500;
}

.tier-svg .seg-count {
  font-size: 12px;
}

.tier-svg .tier-A { fill: var(--tier-A); }
.tier-svg .tier-B { fill: var(--tier-B); }
.tier-svg .tier-C { fill: var(--tier-C); }
.tier-svg .tier-D { fill: var(--tier-D); }
.tier-svg .tier-N { fill: var(--tier-N); }
.tier-svg .tier-A-ink { fill: var(--tier-A-ink); }
.tier-svg .tier-B-ink { fill: var(--tier-B-ink); }
.tier-svg .tier-C-ink { fill: var(--tier-C-ink); }
.tier-svg .tier-D-ink { fill: var(--tier-D-ink); }
.tier-svg .tier-N-ink { fill: var(--tier-N-ink); }

.tier-chip.tier-A { background: var(--tier-A); color: var(--tier-A-ink); }
.tier-chip.tier-B { background: var(--tier-B); color: var(--tier-B-ink); }
.tier-chip.tier-C { background: var(--tier-C); color: var(--tier-C-ink); }
.tier-chip.tier-D { background: var(--tier-D); color: var(--tier-D-ink); }
.tier-chip.tier-N { background: var(--tier-N); color: var(--tier-N-ink); }

.tiers figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--body);
}

.tiers figcaption b {
  font-family: var(--mono);
  font-weight: 500;
}

.families {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.family {
  margin: 0;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.family h3 {
  font-size: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.family h3 code {
  font-size: 15px;
  background: none;
  padding: 0;
}

.family .engine {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
}

.family .engine code {
  font-size: 12px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 4px 20px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
}

.facts div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.facts dt {
  color: var(--mute);
}

.facts dd {
  margin: 0;
  color: var(--ink);
}

.tier-chip {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  margin-right: 4px;
  font-weight: 500;
}

.dnp {
  font-size: 14px;
  line-height: 20px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.dnp-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--ink);
  padding: 0 6px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  margin-right: 6px;
  vertical-align: 1px;
}

.claim-id {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--mute);
}

.claim-id code {
  font-size: 11px;
  background: none;
  padding: 0;
  color: var(--mute);
}

.scope {
  margin-top: 40px;
  max-width: 760px;
}

/* ---------- verdict ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: start;
}

.json {
  background: var(--inset);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring);
  padding: 18px 20px;
  font-size: 12.5px;
  line-height: 19px;
  color: var(--ink);
}

.json .k {
  color: var(--body);
}

.json .hi {
  background: var(--blue-soft);
  border-radius: 3px;
  padding: 0 3px;
  margin: 0 -3px;
}

.json .hi-red {
  background: var(--red-soft);
  border-radius: 3px;
  padding: 0 3px;
  margin: 0 -3px;
}

.json .elide {
  color: var(--mute);
  font-style: italic;
}

.json-cap {
  font-size: 13px;
  line-height: 20px;
  color: var(--mute);
  margin-top: 12px;
}

.fields {
  margin: 0;
  display: grid;
  gap: 18px;
}

.fields div {
  display: grid;
  gap: 4px;
}

.fields dt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

.fields dd {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

.dnp-list {
  margin-top: 40px;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-2);
}

.dnp-list h3 {
  margin-bottom: 12px;
}

.dnp-list ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
}

.dnp-list li {
  padding-left: 18px;
  position: relative;
  margin: 0;
}

.dnp-list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--mute);
}

.dnp-list .from {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 14px;
}

/* ---------- miss rate ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat {
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.stat-n {
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.stat-n small {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--body);
}

.stat-l {
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
  margin: 0;
}

.stat-src {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--mute);
  margin-top: auto;
}

.cells {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.cells li {
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 2px;
}

.cells .caught {
  background: var(--red);
}

.cells .evaded {
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong);
}

.evasions {
  columns: 2;
  column-gap: 40px;
  list-style: none;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
}

.evasions li {
  break-inside: avoid;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  margin: 0;
}

.evasions .det {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--mute);
  margin-top: 2px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

/* ---------- install ---------- */

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cmd {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-2);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cmd-label {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--mute);
}

.cmd pre {
  font-size: 12.5px;
  line-height: 19px;
  color: var(--ink);
}

.cmd-then {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px;
  align-items: start;
}

.cmd-then .cmd {
  padding: 18px 20px;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
  font-size: 13px;
  line-height: 20px;
  color: var(--mute);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
}

.footer a {
  color: var(--body);
}

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

.footer .lic {
  font-family: var(--mono);
  font-size: 12px;
}

.footer-note {
  margin-top: 16px;
  color: var(--mute);
}

.install-note {
  font-size: 14px;
  line-height: 20px;
  color: var(--mute);
  margin: -8px 0 24px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .families,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .split,
  .cmd-then,
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    padding-top: 72px;
    gap: 40px;
  }

  .nav-links {
    display: none;
  }

  .nav .theme-toggle {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
    --section: 64px;
  }

  .families,
  .stats,
  .install-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .evasions {
    columns: 1;
  }

  .lamp {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0 18px;
  }

  .lamp-track {
    order: -1;
  }

  .cord {
    top: 100%;
  }

  .hero-grid {
    padding-top: 80px;
  }

  .term-screen {
    height: 420px;
    font-size: 12px;
    padding: 14px;
  }

  .term-bar {
    flex-wrap: wrap;
  }

  /* Once the bar wraps, the status line gets a row of its own and may break
     rather than run off the right edge, where the bar clips it. */
  .term-status {
    white-space: normal;
    min-width: 0;
  }

  .facts {
    grid-template-columns: repeat(2, auto);
  }

  .outcomes td:first-child,
  .outcomes .yes,
  .outcomes .no {
    white-space: normal;
    word-break: break-word;
  }

  /* The diagrams keep their drawn scale and scroll inside the figure rather
     than shrinking to an unreadable thumbnail. */
  .figure {
    overflow-x: auto;
  }

  .figure svg {
    min-width: 760px;
  }
}

.cmd pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- motion ---------- */

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

  .lamp-track::after {
    animation: none;
    transform: none;
    left: 0;
    width: 100%;
    background: var(--lamp);
  }
}

:root[data-motion="off"] {
  scroll-behavior: auto;
}

:root[data-motion="off"] .lamp-track::after {
  animation: none;
  transform: none;
  left: 0;
  width: 100%;
  background: var(--lamp);
}
