/* AgentSocket design system. One stylesheet for every page; the console adds styles.css.
   Type: Anton for short headlines, Geist for reading and controls, Geist Mono for IDs,
   protocol names, states and terminal text. Color: deep black canvas, warm white ink,
   electric red for brand and action only. Space: a 4px base that grows by roughly 1.6. */

@font-face {
  font-family: "Anton";
  src: url("/assets/fonts/anton-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 650;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks keep line breaks stable while the real faces load. */
@font-face {
  font-family: "Anton fallback";
  src: local("Impact"), local("Arial Narrow Bold");
  size-adjust: 99.6%;
  ascent-override: 118%;
  descent-override: 33%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 104.9%;
  ascent-override: 95.8%;
  descent-override: 28.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono fallback";
  src:
    local("Menlo"), local("Consolas"), local("Liberation Mono"),
    local("Courier New");
  size-adjust: 99.7%;
  ascent-override: 100.8%;
  descent-override: 29.6%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;
  /* Brand palette (DESIGN.md) */
  --black: #050505;
  --red: #ff3038;
  --white: #e8e5df;
  --gray: #737373; /* strokes and decoration only; never small text on black */
  /* Roles */
  --bg: var(--black);
  --bg-raised: #0d0d0c;
  --bg-sunk: #000;
  --ink: var(--white);
  --ink-2: #b9b6b0; /* secondary text on black, 10:1 */
  --rule: #2b2a28;
  --rule-strong: #4a4945;
  --accent: var(--red); /* brand and action */
  --accent-ink: var(--red); /* red text; darkened on light surfaces */
  --on-accent: var(--black);
  --focus: var(--red);
  /* Type */
  --font-display:
    "Anton", "Anton fallback", Impact, "Arial Narrow Bold", sans-serif;
  --font-text:
    "Geist", "Geist fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:
    "Geist Mono", "Geist Mono fallback", ui-monospace, Menlo, Consolas,
    monospace;
  --t-micro: 0.75rem; /* 12: mono labels */
  --t-small: 0.875rem; /* 14 */
  --t-body: 1rem; /* 16 */
  --t-lede: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); /* 17–20 */
  --t-h3: 1.125rem;
  --t-h2: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); /* Anton */
  --t-h1: clamp(2.75rem, 1.4rem + 5.6vw, 6rem); /* Anton */
  /* Space: 4 · 8 · 16 · 24 · 40 · 64 · 104 */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: 104px;
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1200px;
  --measure: 68ch;
  /* Motion: short and purposeful */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --quick: 140ms;
  --touch: 44px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection {
  background: var(--red);
  color: var(--black);
}
img,
svg,
picture {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-strong);
  transition:
    text-decoration-color var(--quick) var(--ease),
    color var(--quick) var(--ease);
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
code,
kbd,
samp,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
:not(pre) > code {
  padding: 0.05em 0.3em;
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  border-radius: 3px;
  overflow-wrap: anywhere;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link */
.skip {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 20;
  padding: 12px 16px;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* Layout */
.wrap,
.site-header,
.site-footer {
  width: min(var(--page), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Header: a quiet black band, identical on every page */
.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}
.site-header-band {
  background: var(--black);
  color: var(--white);
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 5;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  flex: none;
}
.header-logo {
  width: 132px;
  height: auto;
  aspect-ratio: 2172 / 724;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s1) var(--s4);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
@media (max-width: 600px) {
  .site-nav {
    gap: var(--s1) var(--s3);
  }
  .header-logo {
    width: 112px;
  }
}
.site-nav a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--ink-2);
  font-size: var(--t-small);
  text-decoration: none;
}
.site-nav a:not(.button):hover,
.site-nav a[aria-current="page"] {
  color: var(--white);
}
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--touch);
  padding: 0 var(--s4);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--quick) var(--ease),
    border-color var(--quick) var(--ease),
    color var(--quick) var(--ease);
}
.button:hover {
  border-color: var(--ink-2);
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.button.primary:hover {
  background: #ff545b;
  border-color: #ff545b;
}
.button.small {
  min-height: var(--touch);
  padding: 0 var(--s3);
  font-size: 0.8125rem;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.button.primary:focus-visible {
  outline-color: var(--white);
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  gap: 0.4em;
  font-weight: 600;
  font-size: var(--t-small);
  text-decoration: none;
}
.link-arrow::after {
  content: "→";
  transition: transform var(--quick) var(--ease);
}
.link-arrow:hover::after {
  transform: translateX(3px);
}

/* Labels and headings */
.label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.96;
  margin: 0;
  text-wrap: balance;
}

/* ---------- Home ---------- */
.home section {
  scroll-margin-top: var(--s4);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  padding: var(--s5) 0 var(--s6);
}
.masthead-logo {
  width: min(480px, 100%);
  height: auto;
  aspect-ratio: 2172 / 724;
  margin: -4% 0 -4% -1.6%; /* the bitmap carries generous built-in padding */
}
.hero h1 {
  font-size: clamp(2.6rem, 1rem + 5.4vw, 5.5rem);
}
.hero h1 .quiet {
  color: var(--ink-2);
}
.hero-side {
  display: grid;
  gap: var(--s4);
}
.lede {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0;
}
.lede strong {
  color: var(--ink);
  font-weight: 500;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
}
@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    grid-template-areas: "mark side" "title title";
    align-items: end;
    column-gap: var(--s6);
    row-gap: var(--s5);
  }
  .masthead {
    grid-area: mark;
  }
  .hero h1 {
    grid-area: title;
  }
  .hero h1 .quiet {
    display: block;
  }
  .hero-side {
    grid-area: side;
  }
}

/* Section frame: a hairline, a mono index, an Anton title */
.section {
  border-top: 1px solid var(--rule);
  padding: var(--s6) 0 var(--s6);
}
.section-head {
  display: grid;
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.section-head h2 {
  font-size: var(--t-h2);
}
.section-head p:not(.label) {
  margin: 0;
  color: var(--ink-2);
  max-width: 60ch;
}
@media (min-width: 960px) {
  .section {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--s6);
    padding: var(--s7) 0;
  }
  .section > .section-head {
    margin-bottom: 0;
    align-content: start;
    position: sticky;
    top: var(--s5);
    align-self: start;
  }
}

/* Delivery diagram */
.delivery {
  border-top: 1px solid var(--rule);
  padding: var(--s4) 0 var(--s6);
  margin: 0;
}
.delivery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.delivery-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0 var(--s3);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: none;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.delivery-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}
.delivery-toggle svg {
  width: 10px;
  height: 10px;
}
.delivery-stage {
  position: relative;
}
.delivery-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-mono);
}
.delivery-svg.is-narrow {
  display: none;
  max-width: 420px;
  margin-inline: auto;
}
@media (max-width: 899px) {
  .delivery-svg.is-wide {
    display: none;
  }
  .delivery-svg.is-narrow {
    display: block;
  }
}
/* SVG anatomy */
.d-card {
  fill: var(--bg-raised);
  stroke: var(--rule-strong);
  stroke-width: 1;
}
.d-card-inset {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
}
.d-kind {
  fill: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.d-name {
  fill: var(--white);
  font-family: var(--font-text);
  font-size: 19px;
  font-weight: 600;
}
.d-status {
  fill: var(--ink-2);
  font-size: 12px;
}
.d-lane {
  fill: none;
  stroke: #3a3936;
  stroke-width: 1.25;
}
.d-lane.is-hint {
  stroke-dasharray: 3 5;
}
.d-lane.is-live {
  stroke: var(--ink-2);
}
.d-bracket {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: square;
}
.d-dot {
  fill: var(--red);
}
.d-state {
  fill: var(--white);
  font-size: 20px;
  font-weight: 500;
}
.d-detail {
  fill: var(--ink-2);
  font-size: 12px;
}
.d-slot {
  fill: var(--bg-sunk);
  stroke: var(--rule-strong);
  stroke-dasharray: 2 3;
}
.d-slot.is-full {
  stroke-dasharray: none;
  stroke: var(--ink-2);
}
.d-lease-track {
  fill: var(--rule);
}
.d-lease {
  fill: var(--ink-2);
}
.d-num circle {
  fill: var(--black);
  stroke: var(--rule-strong);
}
.d-num text {
  fill: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
}
.d-num.is-active circle {
  fill: var(--red);
  stroke: var(--red);
}
.d-num.is-active text {
  fill: var(--black);
}
.d-chip rect {
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 1.25;
}
.d-chip text {
  fill: var(--white);
  font-size: 11.5px;
  font-weight: 500;
}
.d-chip.is-wake circle {
  fill: var(--red);
}
.d-chip.is-hidden {
  display: none;
}
.d-arrow {
  fill: none;
  stroke: #57554f;
  stroke-width: 1.25;
}
/* Step list doubles as the static explanation */
.delivery-steps {
  list-style: none;
  margin: var(--s5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  counter-reset: step;
  border-top: 1px solid var(--rule);
}
.delivery-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: var(--s2);
  padding: var(--s3) 2.75rem var(--s3) 0; /* room for the "now" marker, so nothing reflows */
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: var(--t-small);
  line-height: 1.55;
  position: relative;
  transition: color var(--quick) var(--ease);
}
.delivery-steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}
.delivery-steps b {
  color: var(--ink);
  font-weight: 600;
}
.delivery-steps li.is-active {
  color: var(--ink);
}
.delivery-steps li.is-active::before {
  background: var(--red);
  border-color: var(--red);
  color: var(--black);
}
.delivery-steps li.is-active::after {
  content: "now";
  position: absolute;
  right: 0;
  top: var(--s3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
@media (min-width: 720px) {
  .delivery-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s5);
  }
}
@media (min-width: 1100px) {
  .delivery-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.delivery-note {
  margin: var(--s3) 0 0;
  font-size: var(--t-micro);
  color: var(--ink-2);
  font-family: var(--font-mono);
}

/* Terminal */
.terminal {
  border: 1px solid var(--rule-strong);
  background: var(--bg-sunk);
  border-radius: 2px;
  min-width: 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  border-bottom: 1px solid var(--rule);
  padding-left: var(--s3);
  min-height: 48px;
}
.os-switch {
  display: flex;
  gap: 0;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.os-switch label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--s3) 0 0;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
}
.os-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.os-switch label:has(input:checked) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.os-switch label:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.terminal-body {
  margin: 0;
  padding: var(--s4) var(--s3);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre;
}
.terminal-body .prompt {
  color: var(--gray);
  user-select: none;
}
.terminal-body .comment {
  color: var(--ink-2);
}
.terminal:has(#os-win:checked) .os-unix,
.terminal:not(:has(#os-win:checked)) .os-win {
  display: none;
}
.terminal-bar .button {
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  min-height: 48px;
}
.install-notes {
  margin: var(--s4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s2);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.install-notes li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
}
.install-notes li::before {
  content: "—";
  color: var(--gray);
}

/* Evidence marks: shape and text, never color alone */
.evidence {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
}
.evidence::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border: 1.5px solid var(--ink-2);
}
.evidence.is-owner-confirmed {
  color: var(--ink);
}
.evidence.is-owner-confirmed::before {
  background: var(--ink);
  border-color: var(--ink);
}
.evidence.is-client-tested::before,
.evidence.is-sdk-tested::before {
  box-shadow: inset 4px 0 0 var(--ink-2); /* half filled */
}
.evidence.is-planned::before {
  border-style: dashed;
  border-color: var(--gray);
}
.evidence.is-planned {
  color: var(--ink-2);
}

/* Works with */
.compat {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.compat li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s1) var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}
.compat-name {
  font-weight: 600;
  font-size: var(--t-body);
}
.compat-name a {
  text-decoration-color: var(--rule-strong);
}
.compat-path {
  color: var(--ink-2);
  font-size: var(--t-small);
}
.compat .evidence {
  white-space: normal;
}
.compat-planned .compat-path a {
  color: var(--ink-2);
}
@media (min-width: 720px) {
  .compat li {
    grid-template-columns: minmax(7rem, 1fr) minmax(0, 2fr) minmax(0, 1.4fr);
    align-items: baseline;
  }
}
.compat-legend {
  margin: var(--s4) 0 0;
  display: grid;
  gap: var(--s2);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.compat-legend div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
@media (min-width: 720px) {
  .compat-legend div {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
}
.compat-legend dd {
  margin: 0;
}

/* Interfaces */
.ifaces {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--s5);
}
.ifaces li {
  border-top: 1px solid var(--rule);
  padding: var(--s4) 0 var(--s4);
  display: grid;
  gap: var(--s2);
  align-content: start;
}
.ifaces h3 {
  margin: 0;
  font-size: var(--t-h3);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}
.ifaces h3 code {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink-2);
  font-size: var(--t-micro);
  font-weight: 400;
}
.ifaces p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-small);
}
@media (min-width: 640px) {
  .ifaces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ifaces-foot {
  margin: var(--s4) 0 0;
  color: var(--ink-2);
  font-size: var(--t-small);
}

/* Honest limits */
.limits {
  margin: 0;
  display: grid;
  gap: 0;
}
.limits div {
  border-top: 1px solid var(--rule);
  padding: var(--s4) 0;
  display: grid;
  gap: var(--s2);
}
.limits dt {
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.35;
}
.limits dd {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-small);
  max-width: 60ch;
}
@media (min-width: 720px) {
  .limits div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    column-gap: var(--s5);
  }
}

/* Closing call */
.closing {
  border-top: 1px solid var(--rule);
  padding: var(--s7) 0;
  display: grid;
  gap: var(--s4);
  justify-items: start;
}
.closing h2 {
  font-size: var(--t-h2);
  max-width: 18ch;
}

/* Footer */
.site-footer-band {
  border-top: 1px solid var(--rule);
  background: var(--black);
  color: var(--white);
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
  padding: var(--s5) 0;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.site-footer .footer-mark {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.site-footer .footer-mark svg {
  width: 28px;
  height: 28px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s4);
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  text-decoration: none;
  color: var(--ink-2);
}
.site-footer nav a:hover {
  color: var(--white);
}
.site-footer p {
  margin: 0;
}

/* ---------- Reading pages: docs and policies ---------- */
/* Reading surfaces follow the system theme. The black identity stays inside the
   header and footer bands. */
.doc-page {
  --bg: var(--black);
}
@media (prefers-color-scheme: light) {
  .doc-page {
    color-scheme: light;
    --bg: #f1efea;
    --bg-raised: #e8e5df;
    --bg-sunk: #e8e5df;
    --ink: #0b0b0a;
    --ink-2: #47453f; /* 8.6:1 on the page */
    --rule: #d3cfc6;
    --rule-strong: #a9a59c;
    --accent-ink: #b51d2a; /* small red text on light, 5.6:1 */
    --focus: #b51d2a;
    --gray: #6d6b66;
  }
  .doc-page .site-header-band,
  .doc-page .site-footer-band {
    --ink: var(--white);
    --ink-2: #b9b6b0;
    --rule: #2b2a28;
    --rule-strong: #4a4945;
    --focus: var(--red);
    --gray: #737373;
    color-scheme: dark;
  }
  .doc-page .site-header-band .button:not(.primary) {
    color: var(--white);
  }
}
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  padding: var(--s6) 0 var(--s7);
}
.doc-layout.has-toc {
  align-items: start;
}
@media (min-width: 1024px) {
  .doc-layout.has-toc {
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: var(--s6);
  }
}
.doc-toc {
  font-size: var(--t-small);
}
.doc-toc ol {
  list-style: none;
  margin: var(--s3) 0 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}
.doc-toc a {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--s3);
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
}
.doc-toc a:hover {
  color: var(--ink);
  border-left-color: var(--rule-strong);
}
.doc-toc a[aria-current="true"] {
  color: var(--ink);
  border-left-color: var(--accent);
}
.doc-toc-narrow > summary {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  gap: var(--s2);
  border: 1px solid var(--rule-strong);
  padding: 0 var(--s3);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.doc-toc-narrow > summary::-webkit-details-marker {
  display: none;
}
.doc-toc-narrow > summary::after {
  content: "+";
  margin-left: auto;
}
.doc-toc-narrow[open] > summary::after {
  content: "−";
}
.doc-toc-narrow a {
  min-height: var(--touch);
}
.doc-toc-wide {
  display: none;
}
@media (min-width: 1024px) {
  .doc-toc-narrow {
    display: none;
  }
  .doc-toc-wide {
    display: block;
    position: sticky;
    top: var(--s4);
    max-height: calc(100vh - 48px);
    overflow: auto;
  }
}
.doc {
  min-width: 0;
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.doc-head {
  display: grid;
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.doc h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  line-height: 0.96;
  margin: 0;
  text-wrap: balance;
}
.doc .intro {
  font-size: var(--t-lede);
  color: var(--ink-2);
  margin: 0;
}
.doc h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: var(--s6) 0 var(--s3);
  padding-top: var(--s4);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--s4);
}
.doc h2 .label {
  display: block;
  margin-bottom: var(--s2);
}
.doc h3 {
  font-size: var(--t-h3);
  font-weight: 600;
  margin: var(--s5) 0 var(--s2);
  scroll-margin-top: var(--s4);
}
.doc p,
.doc ul,
.doc ol,
.doc dl {
  margin: 0 0 var(--s3);
}
.doc ul,
.doc ol {
  padding-left: 1.25rem;
}
.doc li + li {
  margin-top: var(--s2);
}
.doc li::marker {
  color: var(--ink-2);
}
.doc a {
  color: var(--accent-ink);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
}
.doc a:hover {
  text-decoration-thickness: 2px;
}
.doc strong {
  font-weight: 600;
}
.doc .date {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-2);
  margin: 0;
}
.doc .note {
  border-left: 2px solid var(--rule-strong);
  padding: var(--s1) 0 var(--s1) var(--s3);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.doc .soon {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule-strong);
  padding: 1px 6px;
  margin-right: var(--s2);
  white-space: nowrap;
  color: var(--ink-2);
}
.codeblock {
  position: relative;
  margin: 0 0 var(--s4);
  border: 1px solid var(--rule-strong);
  background: var(--bg-sunk);
  border-radius: 2px;
}
.codeblock pre {
  margin: 0;
  padding: var(--s3) var(--s3);
  padding-right: 5.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.75;
}
.codeblock .copy {
  position: absolute;
  top: 0;
  right: 0;
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0 var(--s3);
  border: 0;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.codeblock .copy:hover {
  color: var(--ink);
}
.doc .codeblock .label {
  margin: 0;
  padding: 14px var(--s3) 0;
}
.codeblock .label + pre {
  padding-top: var(--s2);
}
.table-scroll {
  overflow-x: auto;
  margin: 0 0 var(--s4);
  border-top: 1px solid var(--rule-strong);
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--t-small);
  line-height: 1.5;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: var(--s2) var(--s3) var(--s2) 0;
  border-bottom: 1px solid var(--rule);
}
.doc th {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.doc tbody th {
  font-family: var(--font-text);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.doc td code {
  white-space: nowrap;
}
.doc .wide {
  max-width: none;
}
.doc-wide {
  max-width: 60rem;
}
.state {
  font-family: var(--font-mono);
  font-size: 0.85em;
  white-space: nowrap;
}

/* Reduced motion: nothing slides */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
@media (forced-colors: active) {
  .evidence::before,
  .delivery-steps li::before {
    forced-color-adjust: none;
  }
}
