/* ATCR.dev — "The Artifact" concept — shared stylesheet
   Light-first, true dark mode via prefers-color-scheme.
   The report is the product: the artifact surface is always dark. */

/* Self-hosted IBM Plex (SIL Open Font License). No external CDN — the site
   makes zero network calls for fonts (privacy NFR). Weights map per fonts/README.md. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 450;
  font-display: swap;
  src: url('fonts/IBMPlexSans-Text.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/IBMPlexSans-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/IBMPlexSans-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/IBMPlexSans-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/IBMPlexMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/IBMPlexMono-SemiBold.woff2') format('woff2');
}

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --sunken: #f4f2ec;
  --border: #e4e1da;
  --border-strong: #d2cec4;
  --text: #1b1a17;
  --text-dim: #6c6862;
  --text-faint: #726d64;
  --link: #1357c7;

  --ok: #16834a;
  --ok-bg: #e7f3ec;
  --warn: #b45309;
  --warn-bg: #faf0df;
  --bad: #c5331f;
  --bad-bg: #fbe9e5;
  --persona: #6d5cc6;
  --persona-bg: #eeebfa;

  --btn-bg: #1b1a17;
  --btn-fg: #fbfaf7;

  /* brand mark tile (themes with the buttons) */
  --mark-bg: var(--btn-bg);
  --mark-fg: var(--btn-fg);

  /* artifact surface — theme independent */
  --code-bg: #0e1116;
  --code-fg: #e6e6e6;
  --code-dim: #8a93a0;
  --code-line: #1b2027;
  --code-border: #222a34;
  --code-chrome: #11151b;
  --code-chrome-active: #1b222b;
  --code-dot: #2a323d;

  --maxw: 1080px;
  --maxw-wide: 1180px;
  --radius: 10px;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #151a21;
    --sunken: #1b222b;
    --border: #262d38;
    --border-strong: #333c49;
    --text: #e8e9ec;
    --text-dim: #9aa2ad;
    --text-faint: #8a93a0;
    --link: #6ba8ff;

    --ok: #4ade80;
    --ok-bg: rgba(74, 222, 128, 0.12);
    --warn: #f5b454;
    --warn-bg: rgba(245, 180, 84, 0.12);
    --bad: #ff6b5b;
    --bad-bg: rgba(255, 107, 91, 0.12);
    --persona: #a99bf0;
    --persona-bg: rgba(169, 155, 240, 0.12);

    --btn-bg: #e8e9ec;
    --btn-fg: #0e1116;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Smooth scrolling only for users who have not requested reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Keep in-page anchor targets (e.g. the docs section headings) clear of the sticky nav so a
   jump-link lands on the heading instead of hiding it under the header (Success Criteria —
   anchor links navigate to page segments without offset errors). ~sticky nav height + gap. */
html {
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container.wide {
  max-width: var(--maxw-wide);
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
h3 {
  font-size: 1.18rem;
}
p {
  color: var(--text-dim);
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.overline {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  display: inline-block;
}

.mono {
  font-family: var(--mono);
}
.text-center {
  text-align: center;
}

/* ---------- Nav ---------- */
nav.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
nav.site .inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  font-size: 0.98rem;
}
.brand:hover {
  text-decoration: none;
}
.brand .mark {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}
nav.site .links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
}
nav.site .links a {
  color: var(--text-dim);
  font-size: 0.9rem;
}
nav.site .links a:hover {
  color: var(--text);
  text-decoration: none;
}
nav.site .links a.cta {
  color: var(--btn-fg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn-primary:hover {
  opacity: 0.88;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--sunken);
}
.btn-sm {
  padding: 7px 13px;
  font-size: 0.84rem;
}

/* command pill */
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--code-border);
  max-width: 100%;
  flex-wrap: wrap;
}
.cmd .code {
  overflow-wrap: anywhere;
  min-width: 0;
}
.cmd .prompt {
  color: var(--code-dim);
  user-select: none;
}
.cmd .copy {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--code-dim);
  background: transparent;
  border: 1px solid var(--code-border);
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.cmd .copy:hover {
  color: var(--code-fg);
  border-color: var(--code-dim);
}

.btn:focus-visible,
.cmd .copy:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 40px;
}
.hero h1 {
  margin: 16px 0 18px;
  max-width: 16ch;
}
.hero .lede {
  font-size: 1.18rem;
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- Artifact Viewer ---------- */
.artifact {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.5);
}
.artifact .chrome {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: var(--code-chrome);
  border-bottom: 1px solid var(--code-border);
  /* Below ~820px the tabs + path exceed the card width; scroll them horizontally
     (matching the code pane) instead of clipping them under .artifact's overflow:hidden. */
  overflow-x: auto;
}
.artifact .dots {
  display: flex;
  gap: 6px;
  margin-right: 12px;
}
.artifact .dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--code-dot);
}
.artifact .tab {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--code-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  flex-shrink: 0;
}
.artifact .tab:hover {
  color: var(--code-fg);
}
.artifact .tab.active {
  color: var(--code-fg);
  background: var(--code-chrome-active);
}
.artifact .path {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--code-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.artifact pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--code-fg);
  padding: 18px 20px;
  overflow-x: auto;
  white-space: pre;
}
.artifact .pane {
  display: none;
}
.artifact .pane.active {
  display: block;
}

/* syntax tints inside artifact */
.tok-sev-crit {
  color: #ff6b5b;
  font-weight: 600;
}
.tok-sev-high {
  color: #ff8a5b;
  font-weight: 600;
}
.tok-sev-med {
  color: #f5b454;
  font-weight: 600;
}
.tok-sev-low {
  color: var(--code-dim);
  font-weight: 600;
}
.tok-file {
  color: #6ba8ff;
}
.tok-ok {
  color: #4ade80;
}
.tok-dim {
  color: var(--code-dim);
}
.tok-key {
  color: #a99bf0;
}
.tok-str {
  color: #9ecf8a;
}
.tok-num {
  color: #f5b454;
}
.ln {
  color: #3a434f;
  user-select: none;
  display: inline-block;
  width: 2.2em;
  text-align: right;
  margin-right: 16px;
}

/* ---------- Consensus meter ---------- */
.consensus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.dots-row {
  display: inline-flex;
  gap: 3px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-sizing: border-box;
}
.dot.on {
  background: var(--ok);
}
.dot.off {
  background: transparent;
  border: 1.5px solid var(--border-strong);
}
.dot.no {
  background: transparent;
  border: 1.5px solid var(--bad);
  position: relative;
}
.dot.no::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-top: 1.5px solid var(--bad);
  transform: rotate(45deg);
  transform-origin: center;
}
.consensus .frac {
  color: var(--text-dim);
}
.consensus .pct.ok {
  color: var(--ok);
}
.consensus .pct.warn {
  color: var(--warn);
}
.consensus .pct.bad {
  color: var(--bad);
}

/* ---------- Severity chip ---------- */
.sev {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  border-left: 2px solid;
}
.sev.crit {
  color: var(--bad);
  background: var(--bad-bg);
  border-color: var(--bad);
}
.sev.high {
  color: var(--bad);
  background: var(--bad-bg);
  border-color: var(--bad);
}
.sev.med {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: var(--warn);
}
.sev.low {
  color: var(--text-faint);
  background: var(--sunken);
  border-color: var(--border-strong);
}

/* status word */
.status-ok {
  color: var(--ok);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.status-disputed {
  color: var(--warn);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.status-rejected {
  color: var(--bad);
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* ---------- Section ---------- */
section.block {
  padding: 56px 0;
}
.section-head {
  margin-bottom: 36px;
  max-width: 64ch;
}
.section-head h2 {
  margin: 10px 0 12px;
}
.section-head p {
  font-size: 1.05rem;
}

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid > * {
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.card .step {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.card h3 {
  margin: 8px 0 8px;
}
.card p {
  font-size: 0.95rem;
}

/* finding row */
.finding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.18s ease;
}
.finding:hover {
  border-color: var(--border-strong);
}
.finding .body {
  flex: 1;
  min-width: 0;
}
.finding .loc {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
}
.finding .loc .file {
  color: var(--link);
}
.finding .problem {
  color: var(--text);
  margin: 6px 0 4px;
  font-size: 0.96rem;
}
.finding .fix {
  color: var(--text-dim);
  font-size: 0.9rem;
}
.finding .fix b {
  color: var(--ok);
  font-weight: 600;
}
.finding .meta {
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.finding .srcs {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--persona);
}

/* ---------- Persona card ---------- */
.persona {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 2px solid var(--persona);
  padding: 22px;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
  min-width: 0;
}
.persona:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  border-top-color: var(--persona);
}

/* Reduced-motion: cancel the interactive hover lift (reveal/flow already gated). */
@media (prefers-reduced-motion: reduce) {
  .card:hover,
  .persona:hover {
    transform: none;
  }
}
.persona .handle {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.persona .role {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 2px 0 14px;
}
.persona ul {
  list-style: none;
  margin: 0 0 16px;
}
.persona li {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 3px 0 3px 16px;
  position: relative;
}
.persona li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--persona);
}
.persona .canon-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.persona .canon {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 7px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--code-fg);
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- Ledger table ---------- */
.ledger-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.ledger th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-strong);
}
table.ledger td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
table.ledger tr:last-child td {
  border-bottom: none;
}
table.ledger tr:hover td {
  background: var(--sunken);
}
table.ledger .rank {
  font-family: var(--mono);
  color: var(--text-faint);
}
table.ledger .model {
  color: var(--text);
  font-weight: 500;
}
table.ledger .num {
  font-family: var(--mono);
  text-align: right;
  color: var(--text);
}
.meta-row {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.meta-row b {
  color: var(--text-dim);
  font-weight: 500;
}

/* score bar */
.scorebar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scorebar .track {
  width: 56px;
  height: 6px;
  border-radius: 3px;
  background: var(--sunken);
  overflow: hidden;
}
.scorebar .fill {
  height: 100%;
  background: var(--ok);
}
.scorebar .v {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}

/* ---------- Comparison table ---------- */
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table.compare {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.compare th,
table.compare td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.compare thead th {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-strong);
  font-weight: 500;
}
table.compare tbody th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 500;
  white-space: nowrap;
}
table.compare td {
  color: var(--text-dim);
}
table.compare tr:last-child td,
table.compare tr:last-child th {
  border-bottom: none;
}
table.compare th:nth-child(2),
table.compare td:nth-child(2) {
  background: var(--sunken);
  color: var(--text);
  border-left: 2px solid var(--persona);
  border-right: 1px solid var(--border);
}
table.compare thead th:nth-child(2) {
  color: var(--text);
  font-weight: 700;
}
.compare-dash {
  color: var(--text-faint);
}

/* ---------- Docs / prose ---------- */
.prose {
  max-width: 760px;
}
.prose h2 {
  margin: 40px 0 14px;
}
.prose h3 {
  margin: 28px 0 10px;
}
.prose p {
  margin-bottom: 14px;
}
.prose ul,
.prose ol {
  margin: 0 0 16px 22px;
  color: var(--text-dim);
}
.prose li {
  margin-bottom: 6px;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--sunken);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}
.codeblock {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 8px 0 20px;
  white-space: pre;
}
.codeblock .c {
  color: var(--code-dim);
}
.codeblock .g {
  color: #4ade80;
}
.codeblock .b {
  color: #6ba8ff;
}

/* docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding: 48px 0;
}
.docs-layout > * {
  min-width: 0;
}
.docs-nav {
  position: sticky;
  top: 80px;
}
.docs-nav .group {
  margin-bottom: 22px;
}
.docs-nav .group-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.docs-nav a {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 4px 0;
}
.docs-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---------- FAQ (interactive accordion — native <details>/<summary>) ---------- */
.faq-list {
  max-width: 760px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  cursor: pointer;
  list-style: none; /* hide the default disclosure triangle; custom +/− below */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.faq-item summary h3 {
  margin: 0;
  font: inherit;
}
.faq-item summary::-webkit-details-marker {
  display: none; /* Safari keeps a marker even with list-style:none */
}
/* +/− affordance that flips when the disclosure opens */
.faq-item summary::after {
  content: '+';
  font-family: var(--mono);
  font-weight: 400;
  color: var(--text-faint);
  flex: none;
  transition: color 0.18s ease;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover::after {
  color: var(--text);
}
.faq-item summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 3px;
}
.faq-item > *:not(summary) {
  padding-bottom: 20px;
}
.faq-item p {
  font-size: 0.96rem;
}

/* ---------- Pricing / team ---------- */
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.plan.featured {
  border-color: var(--text);
}
.plan .price {
  font-family: var(--mono);
  font-size: 1.8rem;
  color: var(--text);
  margin: 8px 0 4px;
}
.plan ul {
  list-style: none;
  margin: 18px 0;
}
.plan li {
  font-size: 0.92rem;
  color: var(--text-dim);
  padding: 6px 0 6px 22px;
  position: relative;
}
.plan li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--ok);
  font-family: var(--mono);
}

/* ---------- Callout ---------- */
.callout {
  background: var(--sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--persona);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 20px 0;
}
.callout p {
  color: var(--text-dim);
  font-size: 0.94rem;
}
.callout strong {
  color: var(--text);
}

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 40px 0;
}
footer.site .inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
footer.site .left {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}
footer.site .links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
footer.site .links a {
  color: var(--text-dim);
  font-size: 0.86rem;
}

/* ---------- Reconciler flow diagram ---------- */
.flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 28px;
}
.flow svg {
  display: block;
  width: 100%;
  height: auto;
}
.flow .flow-in line,
.flow .flow-box,
.flow .flow-out {
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
}
.flow.in .flow-in line {
  animation: flow-draw 0.6s ease forwards;
}
.flow.in .flow-in line:nth-child(2) {
  animation-delay: 0.05s;
}
.flow.in .flow-in line:nth-child(3) {
  animation-delay: 0.1s;
}
.flow.in .flow-in line:nth-child(4) {
  animation-delay: 0.15s;
}
.flow.in .flow-in line:nth-child(5) {
  animation-delay: 0.2s;
}
.flow.in .flow-box {
  animation: flow-draw 0.5s ease 0.45s forwards;
}
.flow.in .flow-out {
  animation: flow-draw 0.5s ease 0.85s forwards;
}
.flow.in .flow-node {
  animation: flow-pop 0.3s ease 1.25s both;
}
.flow .flow-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.flow text {
  font-family: var(--mono);
}
.flow .flow-h {
  font-size: 22px;
  fill: var(--text-dim);
  text-anchor: end;
}
.flow .flow-m {
  font-size: 21px;
  fill: var(--text-dim);
  letter-spacing: 0.5px;
}
.flow .flow-out-label {
  font-size: 22px;
  fill: var(--text-dim);
}
.flow .flow-out-label .ok {
  fill: var(--ok);
}
.flow .flow-labels,
.flow .flow-m,
.flow .flow-out-label {
  opacity: 0;
}
.flow.in .flow-labels {
  animation: flow-fade 0.5s ease 0.3s forwards;
}
.flow.in .flow-m {
  animation: flow-fade 0.5s ease 0.6s forwards;
}
.flow.in .flow-out-label {
  animation: flow-fade 0.5s ease 1.2s forwards;
}
@keyframes flow-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes flow-fade {
  to {
    opacity: 1;
  }
}
@keyframes flow-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow .flow-in line,
  .flow .flow-box,
  .flow .flow-out {
    stroke-dashoffset: 0;
  }
  .flow .flow-node,
  .flow .flow-labels,
  .flow .flow-m,
  .flow .flow-out-label {
    opacity: 1;
  }
  /* Suppress the keyframe animations at the SAME specificity that sets them
     (.flow.in ...) so flow-pop's backwards-fill (from{opacity:0;scale:.4}) can't
     hide the node during its 1.25s delay. The static states above then stand. */
  .flow.in .flow-in line,
  .flow.in .flow-box,
  .flow.in .flow-out,
  .flow.in .flow-node,
  .flow.in .flow-labels,
  .flow.in .flow-m,
  .flow.in .flow-out-label {
    animation: none;
  }
}

/* ---------- Reveal animation (progressive enhancement — clarification Q3) ----------
   The hiding rule is scoped under a .js class (set by a tiny inline <head> script in
   index.html) so visitors without JS still see all content. prefers-reduced-motion
   restores content immediately with no transition. */
.js .reveal {
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.3s ease-out,
    transform 0.3s ease-out;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  padding: 64px 0 12px;
}
.page-head h1 {
  margin: 14px 0 14px;
}
.page-head p {
  font-size: 1.12rem;
  max-width: 60ch;
}

/* ---------- Responsive ---------- */
/* tablet: three-up galleries become two-up */
@media (max-width: 1000px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* small tablet / large phone: collapse layout + wrap the nav */
@media (max-width: 820px) {
  html {
    scroll-padding-top: 120px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-nav {
    position: static;
  }
  nav.site .inner {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  nav.site .links {
    width: 100%;
    margin-left: 0;
    gap: 14px 18px;
    flex-wrap: wrap;
    font-size: 0.85rem;
  }
  .finding {
    flex-direction: column;
  }
  .finding .meta {
    text-align: left;
    align-items: flex-start;
  }
}

/* phone: everything single-column */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 120px;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }
  .hero {
    padding: 48px 0 32px;
  }
}

/* === Epic 1.2 / T3 — pilot signup form === */
.pilot-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pilot-form .field + .field {
  margin-top: 14px;
}
.pilot-form .field label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.pilot-form .field input,
.pilot-form .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.pilot-form .field textarea {
  resize: vertical;
  min-height: 84px;
}
.pilot-form .field input:focus-visible,
.pilot-form .field textarea:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-color: var(--link);
}
.pilot-form .actions {
  margin-top: 18px;
}
/* Confirmation state: hidden until the form gains .submitted (T4 AJAX on success). */
.pilot-form .form-success {
  display: none;
}
.pilot-form.submitted .form-success {
  display: block;
}
.pilot-form.submitted .field {
  display: none;
}
.pilot-form.submitted .actions {
  display: none;
}
