/*
 * StateProof — product surface.
 *
 * A serious agent-reliability lab, not a landing page.
 *
 * Verdict colour is always paired with a word and a glyph, because a judge
 * deciding whether an agent failed should never have to distinguish two shades
 * of red. The one dramatic moment in the product is the claim/reality contrast;
 * everything else stays quiet so that lands.
 *
 * Every rule lives here. The Content-Security-Policy allows no inline style, so
 * a `style` attribute set from the client is silently dropped by the browser —
 * spacing that only exists in markup is spacing that never renders.
 */

/* ── tokens ──────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg: #08090c;
  --bg-raise: #0f1218;
  --bg-elev: #151922;
  --bg-sink: #06070a;

  --line-soft: #14181f;
  --line: #1c212a;
  --line-strong: #2a313d;
  --line-hover: #3a434f;

  --ink: #e8edf5;
  --ink-dim: #97a2b4;
  --ink-faint: #697384;

  --accent: #4da3ff;
  --accent-hi: #7bbcff;
  --accent-ink: #04121f;
  --accent-tint: rgba(77, 163, 255, 0.1);

  --pass: #35c98b;
  --pass-tint: rgba(53, 201, 139, 0.1);
  --fail: #ff6b6b;
  --fail-tint: rgba(255, 107, 107, 0.1);
  --review: #f0b429;
  --review-tint: rgba(240, 180, 41, 0.1);
  --model: #b98cff;

  /* Raised surfaces are lit from above, so the tint is white here and inverts with
     the theme. Every overlay in this file is rgba(var(--tint), a). */
  --tint: 255, 255, 255;
  /* The sticky topbar sits over scrolling content, so it carries the page colour. */
  --scrim: rgba(8, 9, 12, 0.82);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --section-gap: clamp(28px, 3.2vw, 44px);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.75);
  --hairline: inset 0 1px 0 rgba(var(--tint), 0.035);

  --dur: 160ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.2, 0.65, 0.3, 1);

  --container: 1140px;
  --gutter: clamp(18px, 4vw, 32px);
  --topbar-h: 60px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}


/* ── light ───────────────────────────────────────────────────────────────── */
/*
 * The design is dark first; this redefines the tokens and nothing else, so every
 * rule below is written once and both themes get it.
 *
 * The verdict colours are not the dark ones lightened. A judge reads a verdict as a
 * word and a glyph first, but the colour still has to carry on white, so pass, fail
 * and review are darkened to hold their contrast against the page rather than
 * staying the brighter shades that only work on near-black.
 */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #f6f7f9;
    --bg-raise: #ffffff;
    --bg-elev: #ffffff;
    --bg-sink: #eceef2;

    --line-soft: #edeff3;
    --line: #dee2e9;
    --line-strong: #c6ccd7;
    --line-hover: #a6aebd;

    --ink: #0e131a;
    --ink-dim: #4b5568;
    --ink-faint: #6d7789;

    --accent: #0b62c4;
    --accent-hi: #094e9e;
    --accent-ink: #ffffff;
    --accent-tint: rgba(11, 98, 196, 0.09);

    --pass: #0e7247;
    --pass-tint: rgba(14, 114, 71, 0.1);
    --fail: #bb2436;
    --fail-tint: rgba(187, 36, 54, 0.1);
    --review: #855400;
    --review-tint: rgba(133, 84, 0, 0.12);
    --model: #6636bd;

    /* Depth now comes from a shadow rather than a lit edge, so the tint inverts and
       the hairline becomes the one white line in the file. */
    --tint: 15, 23, 42;
    --scrim: rgba(246, 247, 249, 0.86);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 30px -14px rgba(15, 23, 42, 0.28);
    --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A single wash of colour behind everything, fixed so it never scrolls into
   view as a band. Low enough that it reads as depth, not decoration. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 520px at 50% -240px, rgba(77, 163, 255, 0.1), transparent 65%),
    radial-gradient(760px 420px at 94% -120px, rgba(185, 140, 255, 0.055), transparent 60%);
}

/* The sticky header would otherwise cover any element an evidence link jumps to. */
[id] { scroll-margin-top: calc(var(--topbar-h) + 24px); }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent-hi); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
main:focus { outline: none; }

::selection { background: rgba(77, 163, 255, 0.28); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-hover); background-clip: padding-box; }

/* ── typography ──────────────────────────────────────────────────────────── */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 640;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
h1 { font-size: clamp(26px, 1.1rem + 1.5vw, 34px); margin: 0 0 var(--s-2); }
h2 { font-size: 19px; margin: 0 0 var(--s-3); letter-spacing: -0.012em; }
h3 { font-size: 15px; margin: 0 0 var(--s-2); letter-spacing: -0.008em; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
ul { margin: var(--s-2) 0 10px 20px; padding: 0; }
li { margin-bottom: 4px; }
li:last-child { margin-bottom: 0; }
strong { font-weight: 640; color: var(--ink); }

code, pre, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}
code {
  background: var(--bg-sink);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.12em 0.42em;
  color: var(--ink);
}
pre {
  background: var(--bg-sink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow: auto;
  max-height: 420px;
  line-height: 1.5;
}
pre code { background: none; border: none; padding: 0; }

.lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 68ch;
  text-wrap: pretty;
}
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.warn-text { color: var(--review); }
.flush { margin: 0; }
.mt-1 { margin-top: var(--s-2); }
.mt-2 { margin-top: var(--s-3); }
.mt-3 { margin-top: var(--s-4); }
.mb-3 { margin-bottom: 18px; }

/* ── header ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--scrim);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
/* Aligned to the same container as the content, so the wordmark and the first
   heading share a left edge on wide screens. */
.topbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand:hover .brand-mark { box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.2), 0 0 18px rgba(77, 163, 255, 0.6); }
.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(145deg, var(--accent-hi), var(--accent));
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.14), 0 0 14px rgba(77, 163, 255, 0.45);
  transition: box-shadow var(--dur) var(--ease);
}
.brand-tag {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}
/* The demand carries the emphasis wherever the slogan appears. */
.brand-tag em {
  font-style: italic;
  color: var(--ink-dim);
}
nav.main {
  margin-left: auto;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
nav.main a {
  color: var(--ink-dim);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
nav.main a:hover { background: rgba(var(--tint), 0.05); color: var(--ink); text-decoration: none; }
nav.main a[aria-current="page"] {
  color: var(--ink);
  background: var(--bg-elev);
  box-shadow: var(--hairline), inset 0 0 0 1px var(--line-strong);
}
/* Links that leave the product sit after a rule, quieter than the routes. */
.nav-rule {
  width: 1px;
  align-self: stretch;
  margin: 10px 8px;
  background: var(--line-strong);
}
nav.main a.nav-out { color: var(--ink-faint); font-weight: 450; }
nav.main a.nav-out:hover { color: var(--ink-dim); }

/* In-page navigation for the run inspector. */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--section-gap);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--bg-raise);
  box-shadow: var(--shadow-sm), var(--hairline);
}
.section-nav a {
  padding: 6px 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.section-nav a:hover {
  color: var(--ink);
  background: rgba(var(--tint), 0.05);
  text-decoration: none;
}

/* ── layout ──────────────────────────────────────────────────────────────── */
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter) 96px;
}
section { margin: 0 0 var(--section-gap); }
section:last-child { margin-bottom: 0; }

.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── landing hero ────────────────────────────────────────────────────────── */
/*
 * Centred and near the full container width. The measure is held by the text
 * itself rather than by the section, so the headline can be wide while the
 * paragraph under it stays readable.
 */
.hero {
  text-align: center;
  padding: clamp(12px, 3vw, 40px) 0 0;
}
.hero h1 {
  /* The line break is explicit in the markup, so the measure only has to hold
     the longer of the two lines. */
  max-width: 30ch;
  margin: 0 auto;
  font-size: clamp(30px, 1rem + 2.4vw, 46px);
  text-wrap: pretty;
}
.hero h1 em {
  display: inline-block;
  font-style: italic;
  /* The italic already sets the demand apart; the small weight drop is an
     optical correction, because italics read heavier at the same weight. The
     colour stays full strength — this line is the point of the page. */
  font-weight: 560;
  letter-spacing: -0.012em;
}
.hero .lede {
  max-width: 62ch;
  margin: 18px auto 0;
  font-size: clamp(16px, 0.9rem + 0.3vw, 18px);
}
.hero .actions { justify-content: center; }
.hero-cta { margin-top: clamp(22px, 2.5vw, 32px); }

/* The remaining entry points: present, one click away, and quiet. */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 4px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--line-strong);
}
.hero-links a {
  color: var(--ink-dim);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.hero-links a:hover {
  color: var(--ink);
  background: rgba(var(--tint), 0.05);
  text-decoration: none;
}

/* The hosted-demo disclosure: a band, not a left-accented callout, because a
   left accent on centred text points at nothing. */
.disclosure {
  /* Slightly wider than the lede above it, so it settles into two lines rather
     than stacking into a tall block under a centred headline. */
  max-width: 660px;
  margin: clamp(24px, 3vw, 34px) auto 0;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(var(--tint), 0.02);
  box-shadow: var(--hairline);
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

/*
 * The worked example, and the whole argument of the product in one panel: the
 * agent's own report on the left, what the verifier found in the state on the
 * right. Both halves are real — the claim is the run's final response, the
 * findings are the verifier's own evidence strings.
 */
.proof {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background-color: var(--bg-raise);
  box-shadow: var(--shadow-md), var(--hairline);
}
.proof-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 24px;
}
.proof-claim { border-right: 1px solid var(--line); }
.proof-reality {
  position: relative;
  background-image: linear-gradient(180deg, rgba(255, 107, 107, 0.09), rgba(255, 107, 107, 0) 60%);
}
/* One sweep down the seam, once, while the findings arrive. */
.proof-reality::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 1px;
  transform-origin: top;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  animation: seam 1.5s var(--ease) 150ms both;
}
@keyframes seam {
  0% { opacity: 0; transform: scaleY(0); }
  25% { opacity: 1; }
  60% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); }
}

.proof-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin: 0 0 10px;
}
/* A heading binds to the block under it, not to the one above. */
.proof-head:not(:first-child) { margin-top: 22px; }
.proof-head h3 {
  margin: 0;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.proof-reality .pill { animation: reveal var(--dur-slow) var(--ease) 620ms both; }

.proof-task {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  text-wrap: pretty;
}
.quote {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
/* Pushed to the bottom of each pane, so the two footnotes sit on one line. */
.proof-meta {
  margin: auto 0 0;
  padding-top: 20px;
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(var(--tint), 0.02);
  animation: reveal var(--dur-slow) var(--ease) both;
}
.finding.r-fail { border-color: rgba(255, 107, 107, 0.28); background: var(--fail-tint); }
.finding.r-review { border-color: rgba(240, 180, 41, 0.28); background: var(--review-tint); }
.finding:nth-child(1) { animation-delay: 260ms; }
.finding:nth-child(2) { animation-delay: 360ms; }
.finding:nth-child(3) { animation-delay: 460ms; }
.finding:nth-child(n + 4) { animation-delay: 560ms; }
.finding-mark {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--line-strong);
}
.finding.r-fail .finding-mark { background: var(--fail); }
.finding.r-fail .finding-mark::before { content: "\2715"; }
.finding.r-review .finding-mark { background: var(--review); }
.finding.r-review .finding-mark::before { content: "?"; }
.finding-label {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 620;
}
.finding-evidence {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

/* The submission's headline sentence, and its closing one. */
.claim-line {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}
/*
 * Full width. This is the closing line of the page, sitting under a rule that
 * spans the container — holding it to a prose measure left it looking like a
 * paragraph that had been cut off rather than a statement.
 */
.hot-take {
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

/*
 * The human-review line, beside a verdict. Quiet, but not buried: it belongs
 * with the result, because that is where someone decides what to do next.
 */
.human-review {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-faint);
}
.human-review strong { color: var(--ink-dim); font-weight: 600; }

/* The supported run-package manifest, on the import screen. */
.manifest { margin: 10px 0 0; padding-left: 18px; color: var(--ink-dim); }
.manifest li { margin-bottom: 2px; }

/* ── cards ───────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--bg-raise);
  background-image: linear-gradient(180deg, rgba(var(--tint), 0.022), rgba(var(--tint), 0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--hairline);
}
.card h3 {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.card h3.mt-3 { margin-top: var(--s-4); }
.stat {
  font-size: clamp(28px, 2.2vw, 34px);
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: 0 0 6px;
}

/* ── controls ────────────────────────────────────────────────────────────── */
button, .btn {
  font: inherit;
  font-weight: 620;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent);
  background-image: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 6px 18px -10px rgba(77, 163, 255, 0.7),
    inset 0 1px 0 rgba(var(--tint), 0.25);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
button:hover:not(:disabled), .btn:hover {
  transform: translateY(-1px);
  color: var(--accent-ink);
  text-decoration: none;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 12px 26px -12px rgba(77, 163, 255, 0.85),
    inset 0 1px 0 rgba(var(--tint), 0.3);
}
button:active:not(:disabled), .btn:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.btn.ghost, button.ghost {
  background-image: none;
  background-color: rgba(var(--tint), 0.03);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--hairline);
}
.btn.ghost:hover, button.ghost:hover:not(:disabled) {
  background-color: rgba(var(--tint), 0.07);
  border-color: var(--line-hover);
  color: var(--ink);
}

.field { display: grid; gap: 5px; margin: 0 0 12px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12px; color: var(--ink-dim); font-family: var(--mono); }
input[type="file"] { font: inherit; font-size: 13px; color: var(--ink-dim); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: rgba(var(--tint), 0.03);
  color: var(--ink);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
input[type="file"]::file-selector-button:hover {
  background: rgba(var(--tint), 0.08);
  border-color: var(--line-hover);
}

/* ── verdict pills ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.55;
  white-space: nowrap;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 42%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.pill::before { content: attr(data-glyph); font-size: 11px; }
.v-pass { color: var(--pass); }
.v-fail { color: var(--fail); }
.v-review { color: var(--review); }
.v-model { color: var(--model); }
.pill.solid { color: var(--accent-ink); }
.pill.solid.v-pass { background: var(--pass); border-color: var(--pass); }
.pill.solid.v-fail { background: var(--fail); border-color: var(--fail); }
.pill.solid.v-review { background: var(--review); border-color: var(--review); }

/* ── the one dramatic moment: claim versus verified reality ──────────────── */
.contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background-color: var(--bg-raise);
  box-shadow: var(--shadow-md), var(--hairline);
}
.contrast > div { padding: 22px 24px; }
.contrast .claim { border-right: 1px solid var(--line); }
.contrast .reality {
  background-image: linear-gradient(180deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0) 70%);
}
.contrast h3 {
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.contrast .headline {
  font-size: clamp(19px, 1.6vw, 22px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
  text-wrap: balance;
}
.contrast .reality .headline { color: var(--fail); }

/* ── run inspector ───────────────────────────────────────────────────────── */
.run-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin: 0 0 var(--s-4);
}
.run-title h1 { margin: 0; }

.req {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--bg-raise);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--hairline);
  transition: border-color var(--dur) var(--ease);
}
.req:last-child { margin-bottom: 0; }
.req:hover { border-color: var(--line-strong); }
/* A status edge repeats what the pill already says in words — redundancy, so a
   long list of requirements is scannable without reading each one. */
.req::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--line-strong);
}
.req.r-pass::before { background: var(--pass); }
.req.r-fail::before { background: var(--fail); }
.req.r-review::before { background: var(--review); }

.req-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px 0;
}
.req-key { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.req-body { padding: 10px 18px 16px; }
.req-desc { margin: 0 0 var(--s-2); }
.req-reason {
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 10px;
  white-space: pre-wrap;
}

details { margin-top: 10px; }
details > summary {
  cursor: pointer;
  color: var(--ink-dim);
  font-size: 13px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  transition: color var(--dur) var(--ease);
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "\25B8";
  display: inline-block;
  font-size: 10px;
  color: var(--ink-faint);
  transition: transform var(--dur) var(--ease);
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--accent); }

.ev-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.ev-list li { margin: 0; }
.ev-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  color: var(--ink-dim);
  background: var(--bg-sink);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.ev-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
  text-decoration: none;
}

/* ── timeline ────────────────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline.card { padding: 0; overflow: hidden; }
.event {
  display: grid;
  grid-template-columns: 52px 150px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  transition: background-color var(--dur) var(--ease);
}
.event:last-child { border-bottom: none; }
.event:hover { background-color: rgba(var(--tint), 0.022); }
.event .seq { font-family: var(--mono); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.event .kind { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); line-height: 1.45; }
.event .detail { word-break: break-word; white-space: pre-wrap; }
.event.k-approval { background-color: rgba(240, 180, 41, 0.07); }
.event.k-write { background-color: rgba(77, 163, 255, 0.05); }
.event.k-error { background-color: rgba(255, 107, 107, 0.08); }
.event.is-cited { box-shadow: inset 3px 0 0 var(--accent); }

/* ── state diff ──────────────────────────────────────────────────────────── */
.diff-group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--bg-raise);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--hairline);
}
.diff-group:last-child { margin-bottom: 0; }
.diff-head { padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.diff-row { border-top: 1px solid var(--line-soft); padding: 12px 16px; }
.diff-row-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0 0 8px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: rgba(var(--tint), 0.02);
  color: var(--ink-dim);
  white-space: nowrap;
}
.tag.added { color: var(--pass); border-color: rgba(53, 201, 139, 0.4); background: var(--pass-tint); }
.tag.removed { color: var(--fail); border-color: rgba(255, 107, 107, 0.4); background: var(--fail-tint); }
.tag.modified { color: var(--review); border-color: rgba(240, 180, 41, 0.4); background: var(--review-tint); }

.field-change {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 0;
}
.field-change .was,
.field-change .now {
  border-radius: var(--r-xs);
  padding: 1px 7px;
  word-break: break-word;
}
.field-change .was { color: var(--fail); background: var(--fail-tint); }
.field-change .now { color: var(--pass); background: var(--pass-tint); }

/* ── key/value and tables ────────────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 8px var(--s-4);
  align-items: baseline;
  font-size: 14px;
}
.kv dt { color: var(--ink-dim); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
/* Hairlines make a long provenance list scannable row by row. */
.kv.card dt, .kv.card dd { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.kv.card dt:nth-last-of-type(1), .kv.card dd:nth-last-of-type(1) { padding-bottom: 0; border-bottom: none; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--bg-raise);
  box-shadow: var(--shadow-sm), var(--hairline);
}
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
thead th {
  background-color: var(--bg-sink);
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
tbody tr { transition: background-color var(--dur) var(--ease); }
tbody tr:hover { background-color: rgba(var(--tint), 0.025); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
tbody th[scope="row"] { color: var(--ink); font-weight: 560; }

/* ── callouts and steps ──────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background-color: var(--bg-raise);
  background-image: linear-gradient(90deg, var(--accent-tint), transparent 240px);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.callout.warn {
  border-left-color: var(--review);
  background-image: linear-gradient(90deg, var(--review-tint), transparent 240px);
}
.callout.danger {
  border-left-color: var(--fail);
  background-image: linear-gradient(90deg, var(--fail-tint), transparent 240px);
}
.callout h3 { margin-bottom: 6px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 40px;
  margin: 0 0 0 13px;
  border-left: 1px solid var(--line);
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -14px;
  top: -2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background-color: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--hairline);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
}
.steps h3 { margin-bottom: 2px; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
  background-color: var(--bg-raise);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone.is-over { border-color: var(--accent); background-color: var(--accent-tint); }
.field-error { color: var(--fail); font-family: var(--mono); font-size: 12.5px; padding: 4px 0; margin: 0; }

/* ── motion ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(4, 18, 31, 0.3);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  height: 64px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--bg-raise);
  background-image: linear-gradient(90deg, transparent, rgba(var(--tint), 0.05), transparent);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

.reveal { animation: reveal var(--dur-slow) var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* A short stagger down a list of requirements, capped so it never feels slow. */
.req.reveal:nth-of-type(2) { animation-delay: 40ms; }
.req.reveal:nth-of-type(3) { animation-delay: 80ms; }
.req.reveal:nth-of-type(4) { animation-delay: 120ms; }
.req.reveal:nth-of-type(5) { animation-delay: 160ms; }
.req.reveal:nth-of-type(n + 6) { animation-delay: 200ms; }

.flash { animation: flash 1.6s var(--ease); }
@keyframes flash {
  0%, 30% { background-color: rgba(77, 163, 255, 0.22); box-shadow: inset 3px 0 0 var(--accent); }
  100% { background-color: transparent; }
}

.empty { text-align: center; padding: 48px 20px; color: var(--ink-dim); }

footer {
  border-top: 1px solid var(--line);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter) 56px;
  color: var(--ink-faint);
  font-size: 13px;
}
/*
 * Full width, deliberately. A prose measure is right for body copy, but this is
 * two short lines of fine print sitting above a colophon that spans the whole
 * container — capping it at 78ch left the footer looking like a column that had
 * lost its other half.
 */
footer p { margin-bottom: 6px; }
footer p:first-child { color: var(--ink-dim); }

/* Attribution. Quiet, but present on every page. */
.colophon {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.colophon-mark {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 6px;
  opacity: 0.9;
}
.colophon-credit { margin: 0; line-height: 1.45; color: var(--ink-faint); }
.colophon-credit strong { color: var(--ink-dim); font-weight: 600; }
.colophon-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  color: var(--line-strong);
}
.colophon-links a {
  color: var(--ink-faint);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.colophon-links a:hover {
  color: var(--ink);
  background: rgba(var(--tint), 0.05);
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* The skip link is the one thing that should stop hiding once focused. */
.visually-hidden:focus-visible {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 30;
  width: auto;
  height: auto;
  clip: auto;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .contrast { grid-template-columns: 1fr; }
  .contrast .claim { border-right: none; border-bottom: 1px solid var(--line); }
  .kv { grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); }
  .proof { grid-template-columns: 1fr; }
  .proof-claim { border-right: none; border-bottom: 1px solid var(--line); }
  .proof-reality::before { display: none; }
  .proof-meta { margin-top: 0; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar-inner { gap: var(--s-3); padding-block: var(--s-2); }
  .brand-tag { display: none; }
  nav.main a { padding: 6px 10px; font-size: 13px; }
  main { padding-bottom: 64px; }
  .card { padding: 15px 16px; }
  .contrast > div { padding: 18px; }
  .req-head { padding: 13px 15px 0; }
  .req-body { padding: 9px 15px 14px; }
  .proof-pane { padding: 18px; }
  .quote { font-size: 15px; }
  .grid-4 { grid-template-columns: 1fr; }
  .section-nav { gap: 2px; padding: 5px; }
  .section-nav a { padding: 6px 9px; font-size: 12.5px; }
  .nav-rule { display: none; }
  .colophon { gap: 10px; }
  .colophon-links { margin-left: 0; width: 100%; }

  .event { grid-template-columns: 46px minmax(0, 1fr); gap: 3px 12px; padding: 11px 15px; }
  .event .seq { grid-row: 1; }
  .event .kind { grid-row: 1; grid-column: 2; }
  .event .detail { grid-row: 2; grid-column: 1 / -1; }

  .field-change { grid-template-columns: 1fr; gap: 3px; padding: 6px 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 10px; }
  .kv dt:first-of-type { margin-top: 0; }
  .kv.card dt { padding-bottom: 0; border-bottom: none; }

  th, td { padding: 9px 11px; }
  table { font-size: 13px; }
}

@media (max-width: 480px) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions > * { width: 100%; }
  .hero-links { gap: 0; }
  .hero-links a { padding: 6px 8px; }
  .disclosure { padding: 12px 16px; }
  .steps li { padding-left: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    /* Zeroed too: a staggered `both`-filled reveal would otherwise hold its
       start frame — invisible content — for the length of its delay. */
    animation-delay: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  button:hover:not(:disabled), .btn:hover { transform: none; }
}

/* ---- dashboard layer ---- */

/* --- chrome the dashboard shapes differently ---------------------------- */
.brand-name { font-weight: 650; letter-spacing: -0.01em; }

.page-head { margin-bottom: var(--s-5); }
.page-head h1 { margin: 0 0 6px; }
.page-sub { color: var(--ink-dim); margin: 0; max-width: 78ch; text-wrap: pretty; }

/* --- the case switcher --------------------------------------------------- */
.case-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-5); }
.case-chip {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-dim);
  background: var(--bg-raise);
  box-shadow: var(--hairline);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.case-chip:hover { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.case-chip.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* --- the agent's claim, quoted ------------------------------------------- */
.claim {
  border: 1px solid var(--line);
  border-left: 2px solid var(--review);
  background-color: var(--bg-raise);
  background-image: linear-gradient(90deg, var(--review-tint), transparent 240px);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
}

/* --- pieces the base does not have -------------------------------------- */
.stat-note { color: var(--ink-faint); font-size: 13px; margin: 0; }
.bar {
  height: 8px;
  border-radius: var(--r-xs);
  background: var(--bg-sink);
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.row-highlight td { background: var(--accent-tint); }

/*
 * The base pill carries a glyph from "data-glyph"; the dashboard's pills carry a
 * dot instead. Verdict colour is still always paired with the word beside it.
 */
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.solid::before { background: currentColor; }

/* Evidence that resolves to nothing is named as such, not quietly rendered. */
.ev-link[data-missing="true"] { color: var(--fail); border-color: var(--fail); background: var(--fail-tint); }

/* The base keys these off "k-"; the dashboard generator emits "is-". */
.event.is-approval { background-color: rgba(240, 180, 41, 0.07); }
.event.is-write { background-color: rgba(77, 163, 255, 0.05); }
.event.is-error { background-color: rgba(255, 107, 107, 0.08); }

/* The architecture diagram is a full-width inline SVG. */
.diagram {
  width: 100%;
  height: auto;
  background: var(--bg-sink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
