/* ─────────────────────────────────────────────────────────────────────────────
   AgentGate — design system ("Checkpoint")

   Principles
   1. Colour means a verdict. The interface is ink and paper; the only saturated
      colours are the four verdicts — allow, redact, review, block — and they are
      never used decoratively for anything else.
   2. Evidence looks like evidence: monospace for anything a machine produced
      (hashes, rule ids, timings), a serif italic for the human voice.
   3. Hairlines over boxes, type over ornament.

   Structure:  tokens → base → layout → navigation → components → patterns →
               legacy aliases (dashboard, docs, admin) → utilities → print
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Tokens ────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #0a0b0e;
  --bg-2: #0d0f13;
  --panel: #111318;
  --panel-2: #161920;
  --panel-3: #1c2029;

  /* hairlines */
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.24);

  /* ink */
  --ink: #f3f2ee;
  --ink-2: #b6b8bf;
  --ink-3: #82858f;
  --ink-4: #555862;

  /* the four verdicts */
  --allow: #3ee08f;
  --allow-bg: rgba(62, 224, 143, 0.11);
  --allow-line: rgba(62, 224, 143, 0.34);
  --redact: #f7b955;
  --redact-bg: rgba(247, 185, 85, 0.11);
  --redact-line: rgba(247, 185, 85, 0.34);
  --review: #8f9dff;
  --review-bg: rgba(143, 157, 255, 0.12);
  --review-line: rgba(143, 157, 255, 0.36);
  --block: #ff646b;
  --block-bg: rgba(255, 100, 107, 0.11);
  --block-line: rgba(255, 100, 107, 0.36);

  /* high-contrast action */
  --inverse: #f3f2ee;
  --inverse-ink: #0a0b0e;
  --focus: #8f9dff;

  /* code tokens */
  --tok-comment: #6b6f7a;
  --tok-string: #9ee6c0;
  --tok-key: #b9c2ff;
  --tok-num: #f7c97a;
  --tok-fn: #f3f2ee;
  --tok-punct: #82858f;

  --dot: rgba(255, 255, 255, 0.11);
  --glow-a: rgba(62, 224, 143, 0.13);
  --glow-b: rgba(143, 157, 255, 0.16);
  --shadow-l: 0 40px 120px -48px rgba(0, 0, 0, 0.85), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-m: 0 16px 40px -20px rgba(0, 0, 0, 0.7);

  /* type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --fs-display: clamp(2.6rem, 1.15rem + 5.9vw, 5.6rem);
  --fs-h1: clamp(2.2rem, 1.35rem + 3.5vw, 3.9rem);
  --fs-h2: clamp(1.8rem, 1.2rem + 2.3vw, 2.9rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --fs-lede: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);

  /* shape + rhythm */
  --r-s: 8px;
  --r: 12px;
  --r-l: 18px;
  --r-xl: 26px;
  --gutter: clamp(18px, 4vw, 32px);
  --section: clamp(72px, 9.5vw, 140px);
  --nav-h: 62px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f5f0;
  --bg-2: #efede6;
  --panel: #ffffff;
  --panel-2: #faf9f5;
  --panel-3: #f0eee7;

  --line: rgba(14, 16, 22, 0.09);
  --line-2: rgba(14, 16, 22, 0.16);
  --line-3: rgba(14, 16, 22, 0.3);

  --ink: #0d0f14;
  --ink-2: #444752;
  --ink-3: #6b6e79;
  --ink-4: #a0a2a9;

  --allow: #0f7f47;
  --allow-bg: rgba(15, 127, 71, 0.09);
  --allow-line: rgba(15, 127, 71, 0.32);
  --redact: #94600a;
  --redact-bg: rgba(148, 96, 10, 0.1);
  --redact-line: rgba(148, 96, 10, 0.32);
  --review: #4151d6;
  --review-bg: rgba(65, 81, 214, 0.09);
  --review-line: rgba(65, 81, 214, 0.32);
  --block: #cc2c35;
  --block-bg: rgba(204, 44, 53, 0.08);
  --block-line: rgba(204, 44, 53, 0.32);

  --inverse: #0d0f14;
  --inverse-ink: #f6f5f0;
  --focus: #4151d6;

  --tok-comment: #8a8d96;
  --tok-string: #0f7f47;
  --tok-key: #4151d6;
  --tok-num: #94600a;
  --tok-fn: #0d0f14;
  --tok-punct: #6b6e79;

  --dot: rgba(14, 16, 22, 0.13);
  --glow-a: rgba(15, 127, 71, 0.1);
  --glow-b: rgba(65, 81, 214, 0.1);
  --shadow-l: 0 40px 100px -50px rgba(20, 22, 30, 0.35), 0 10px 30px -18px rgba(20, 22, 30, 0.2);
  --shadow-m: 0 14px 34px -20px rgba(20, 22, 30, 0.28);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol, pre {
  margin: 0;
}

ul[class], ol[class] {
  list-style: none;
  padding: 0;
}

img, svg, canvas, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

::selection {
  background: var(--review-bg);
  color: var(--ink);
}

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

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero", "ss02";
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r-s);
  background: var(--inverse);
  color: var(--inverse-ink);
  font-weight: 600;
  font-size: 0.875rem;
  transition: top 0.15s var(--ease);
}

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

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

/* ── Type ──────────────────────────────────────────────────────────────────── */

.display {
  font-size: var(--fs-display);
  font-weight: 560;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.h1 {
  font-size: var(--fs-h1);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 560;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* the human voice: a serif italic, a touch larger so the x-heights agree */
.display em, .h1 em, .h2 em, .h3 em, .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: 1.07em;
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 62ch;
}

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.xs { font-size: 0.78125rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow .num {
  color: var(--ink);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}

.dot-allow { background: var(--allow); box-shadow: 0 0 0 4px var(--allow-bg); }
.dot-redact { background: var(--redact); box-shadow: 0 0 0 4px var(--redact-bg); }
.dot-review { background: var(--review); box-shadow: 0 0 0 4px var(--review-bg); }
.dot-block { background: var(--block); box-shadow: 0 0 0 4px var(--block-bg); }

.t-allow { color: var(--allow); }
.t-redact { color: var(--redact); }
.t-review { color: var(--review); }
.t-block { color: var(--block); }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s;
}

.link:hover {
  text-decoration-color: currentColor;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
  font-size: 0.9375rem;
  color: var(--ink);
}

.arrow-link::after {
  content: "→";
  transition: transform 0.2s var(--ease);
}

.arrow-link:hover::after {
  transform: translateX(4px);
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

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

.container-narrow {
  max-width: 820px;
}

.section {
  padding-block: var(--section);
  position: relative;
}

.section-tight {
  padding-block: calc(var(--section) * 0.62);
}

.section-alt {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(36px, 5vw, 64px);
  max-width: 760px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.grid {
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
}

.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)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.split.top { align-items: start; }

.stack { display: grid; gap: 16px; }
.stack-s { display: grid; gap: 8px; }
.stack-l { display: grid; gap: 28px; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.center { text-align: center; }

/* the four-colour bar: the brand reduced to a line */
.quad {
  height: 2px;
  background: linear-gradient(90deg, var(--allow) 0 25%, var(--redact) 25% 50%, var(--review) 50% 75%, var(--block) 75% 100%);
}

/* ── Navigation ────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand svg {
  border-radius: 7px;
}

.brand-name {
  font-weight: 620;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.90625rem;
  font-weight: 480;
  color: var(--ink-2);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  background: var(--panel-2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.nav-signin {
  padding: 8px 10px;
  font-size: 0.90625rem;
  font-weight: 480;
  color: var(--ink-2);
}

.nav-signin:hover {
  color: var(--ink);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--ink-2);
  transition: color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--panel-2);
}

.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }

.nav-burger { display: none; }

.nav-sheet {
  position: fixed;
  inset: calc(var(--nav-h) + 2px) 0 0 0;
  z-index: 99;
  background: var(--bg);
  overflow-y: auto;
  animation: sheet-in 0.22s var(--ease);
}

.nav-sheet[hidden] { display: none; }

.nav-sheet-inner {
  display: grid;
  padding-block: 12px 40px;
}

.nav-sheet-inner > a {
  padding: 16px 2px;
  font-size: 1.25rem;
  font-weight: 520;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}

.nav-sheet-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--inverse);
  color: var(--inverse-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 22px -12px color-mix(in srgb, var(--inverse) 60%, transparent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 14px 30px -12px color-mix(in srgb, var(--inverse) 70%, transparent);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}

.btn-ghost:hover {
  border-color: var(--line-3);
  background: var(--panel-2);
}

.btn-quiet {
  color: var(--ink-2);
  padding-inline: 12px;
}

.btn-quiet:hover {
  color: var(--ink);
  background: var(--panel-2);
}

.btn-danger {
  border-color: var(--block-line);
  color: var(--block);
  background: var(--block-bg);
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.875rem;
  border-radius: 9px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  border-radius: 13px;
}

.btn-block { width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn .kbd {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* ── Chips, pills, stamps ──────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

button.chip:hover,
a.chip:hover {
  color: var(--ink);
  border-color: var(--line-3);
}

.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--inverse);
  color: var(--inverse-ink);
  border-color: var(--inverse);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
}

/* inside a grid these would stretch to the full track; keep them as wide as their text */
.tag, .chip, .stamp, .status-pill { justify-self: start; }

.tag-allow { color: var(--allow); border-color: var(--allow-line); background: var(--allow-bg); }
.tag-redact { color: var(--redact); border-color: var(--redact-line); background: var(--redact-bg); }
.tag-review { color: var(--review); border-color: var(--review-line); background: var(--review-bg); }
.tag-block { color: var(--block); border-color: var(--block-line); background: var(--block-bg); }

/* the verdict, stamped */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 6px;
  border: 2px solid currentColor;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent) inset, 0 0 26px -6px color-mix(in srgb, currentColor 45%, transparent);
}

.stamp-lg {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  padding: 11px 20px 9px;
  border-width: 3px;
  border-radius: 12px;
}

.stamp.is-in {
  animation: stamp-in 0.42s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(-12deg) scale(1.9); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: rotate(-3deg) scale(1); }
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.2s;
}

a.card:hover,
.card.is-interactive:hover {
  border-color: var(--line-3);
}

/* pointer-following light, set from site.js via --mx / --my */
.card.spot {
  overflow: hidden;
  isolation: isolate;
}

.card.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), color-mix(in srgb, var(--ink) 7%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card.spot:hover::before {
  opacity: 1;
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card h3 + p,
.card .h3 + p,
.card .h4 + p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--ink);
  margin-bottom: 18px;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 22px 0;
}

.stat-num {
  font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem);
  font-weight: 540;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--ink-3);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.stat-row > * {
  padding-inline: clamp(14px, 2.4vw, 30px);
  border-left: 1px solid var(--line);
}

.stat-row > *:first-child {
  border-left: 0;
  padding-left: 0;
}

/* ── Code ──────────────────────────────────────────────────────────────────── */

:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 0.86em;
  word-break: break-word;
}

.code {
  border-radius: var(--r-l);
  border: 1px solid var(--line-2);
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 46px;
  padding: 0 8px 0 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}

.code-bar::-webkit-scrollbar { display: none; }

.code-tab {
  padding: 6px 11px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.code-tab:hover { color: var(--ink); }

.code-tab[aria-pressed="true"],
.code-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--panel-3);
}

.code-title {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink-3);
  padding-inline: 6px;
}

.code-copy {
  margin-left: auto;
  flex: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.15s, background 0.15s;
}

.code-copy:hover {
  color: var(--ink);
  background: var(--panel-3);
}

.code-copy.is-done { color: var(--allow); }

.code pre,
pre.pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-2);
  tab-size: 2;
}

pre.pre {
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--panel);
}

.code [hidden] { display: none; }

.tk-c { color: var(--tok-comment); }
.tk-s { color: var(--tok-string); }
.tk-k { color: var(--tok-key); }
.tk-n { color: var(--tok-num); }
.tk-f { color: var(--tok-fn); }
.tk-p { color: var(--tok-punct); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */

.field {
  display: grid;
  gap: 7px;
}

.label {
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--ink-2);
}

.hint {
  font-size: 0.78125rem;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382858f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--review-bg);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--block);
  box-shadow: 0 0 0 4px var(--block-bg);
}

.field-error {
  font-size: 0.8125rem;
  color: var(--block);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  flex: none;
}

.note {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.note strong { color: var(--ink); }
.note-allow { border-color: var(--allow-line); background: var(--allow-bg); }
.note-redact { border-color: var(--redact-line); background: var(--redact-bg); }
.note-review { border-color: var(--review-line); background: var(--review-bg); }
.note-block { border-color: var(--block-line); background: var(--block-bg); }

.switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
}

.switch button {
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 520;
  color: var(--ink-3);
  transition: color 0.15s, background 0.15s;
}

.switch button[aria-pressed="true"] {
  background: var(--inverse);
  color: var(--inverse-ink);
}

/* ── Tables ────────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.90625rem;
}

.table th,
.table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table tr:last-child td { border-bottom: 0; }

.table th {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
}

.table td { color: var(--ink-2); }
.table td strong,
.table td:first-child { color: var(--ink); }

/* ── Disclosure (FAQ) ──────────────────────────────────────────────────────── */

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 2px;
  cursor: pointer;
  list-style: none;
  font-size: 1.0625rem;
  font-weight: 540;
  letter-spacing: -0.015em;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.25s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(225deg) translate(-3px, -3px);
}

.faq .faq-body {
  padding: 0 2px 26px;
  max-width: 70ch;
  color: var(--ink-2);
}

.faq .faq-body p + p { margin-top: 12px; }

/* ── Receipt ticket ────────────────────────────────────────────────────────── */

.ticket {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink-2);
  box-shadow: var(--shadow-m);
}

.ticket-head,
.ticket-body,
.ticket-foot {
  padding: 16px 20px;
}

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

/* the tear line with its two punched notches */
.ticket-tear {
  position: relative;
  height: 0;
  border-top: 1px dashed var(--line-3);
  margin-inline: 14px;
}

.ticket-tear::before,
.ticket-tear::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ticket-cut, var(--bg));
  border: 1px solid var(--line-2);
}

.ticket-tear::before { left: -25px; clip-path: inset(0 0 0 50%); }
.ticket-tear::after { right: -25px; clip-path: inset(0 50% 0 0); }

.ticket dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 18px;
}

.ticket dt {
  color: var(--ink-3);
  white-space: nowrap;
}

.ticket dd {
  color: var(--ink);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barcode {
  display: flex;
  align-items: stretch;
  height: 34px;
  gap: 2px;
  color: var(--ink);
  overflow: hidden;
}

.barcode i {
  display: block;
  background: currentColor;
  border-radius: 1px;
}

/* ── Gate rail ─────────────────────────────────────────────────────────────── */

.gate-list {
  display: grid;
  gap: 2px;
}

.gate-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.84375rem;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}

.gate-row .gate-id {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--ink-3);
}

.gate-row .gate-state {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.gate-row[data-state="passed"] .gate-state { color: var(--allow); border-color: var(--allow-line); background: var(--allow-bg); }
.gate-row[data-state="warning"] .gate-state { color: var(--redact); border-color: var(--redact-line); background: var(--redact-bg); }
.gate-row[data-state="failed"] { color: var(--ink); background: var(--panel-2); }
.gate-row[data-state="failed"] .gate-state { color: var(--block); border-color: var(--block-line); background: var(--block-bg); }
.gate-row[data-state="failed"][data-top="review"] .gate-state { color: var(--review); border-color: var(--review-line); background: var(--review-bg); }
.gate-row[data-state="failed"][data-top="redact"] .gate-state { color: var(--redact); border-color: var(--redact-line); background: var(--redact-bg); }

/* ── Page hero (inner pages) ───────────────────────────────────────────────── */

.page-hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 112px) clamp(36px, 5vw, 64px);
  overflow: hidden;
}

.page-hero > .container {
  position: relative;
  display: grid;
  gap: 20px;
}

.dotgrid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 85% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-center main {
  flex: 1;
  display: grid;
  place-items: center;
}

.notfound {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  padding: 72px var(--gutter);
  max-width: 720px;
}

.notfound-stamp span {
  display: inline-block;
  padding: 10px 26px 4px;
  border: 4px solid var(--block);
  border-radius: 16px;
  color: var(--block);
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 12vw, 6.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  transform: rotate(-5deg);
  box-shadow: 0 0 60px -12px var(--block-line);
}

/* ── Prose (legal, docs, blog) ─────────────────────────────────────────────── */

.prose {
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.72;
}

.prose > * + * { margin-top: 1.05em; }

.prose h2 {
  margin-top: 2.4em;
  font-size: 1.6rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 1.1875rem;
  font-weight: 580;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.prose strong { color: var(--ink); font-weight: 600; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}

.prose a:hover { text-decoration-color: currentColor; }

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--ink-3); }

.prose blockquote {
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--line-3);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
}

.prose pre {
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--panel);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 600;
}

.prose hr { margin-block: 2.4em; }

/* document layout: sticky table of contents + prose */
.doc {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  display: grid;
  gap: 2px;
  max-height: calc(100vh - var(--nav-h) - 56px);
  overflow-y: auto;
  font-size: 0.84375rem;
}

.doc-toc .toc-title {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.doc-toc a {
  padding: 6px 10px;
  border-left: 1px solid var(--line);
  color: var(--ink-3);
  transition: color 0.15s, border-color 0.15s;
}

.doc-toc a:hover,
.doc-toc a.is-active {
  color: var(--ink);
  border-left-color: var(--ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.meta-row b {
  font-weight: 500;
  color: var(--ink-2);
}

/* ── Timeline ──────────────────────────────────────────────────────────────── */

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
}

.timeline > li {
  position: relative;
  padding: 26px 22px 6px 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tl, var(--ink-3));
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline time {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.timeline p {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.timeline p strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
  gap: 36px 28px;
  padding-block: clamp(44px, 6vw, 76px);
}

.footer-brand {
  display: grid;
  gap: 16px;
  align-content: start;
  justify-items: start;
  max-width: 320px;
}

.footer-brand p {
  font-size: 0.9375rem;
  color: var(--ink-3);
}

.footer-col {
  display: grid;
  gap: 2px;
  align-content: start;
}

.footer-col h2 {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.footer-col a {
  padding: 7px 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
  transition: color 0.15s;
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 22px 26px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.footer-bottom .mono { font-size: 0.75rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.8125rem;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}

.status-pill:hover {
  border-color: var(--line-3);
  color: var(--ink);
}

.status-pill[data-state="ok"] .dot { background: var(--allow); box-shadow: 0 0 0 4px var(--allow-bg); }
.status-pill[data-state="degraded"] .dot { background: var(--redact); box-shadow: 0 0 0 4px var(--redact-bg); }
.status-pill[data-state="down"] .dot { background: var(--block); box-shadow: 0 0 0 4px var(--block-bg); }

/* ── Analytics consent bar (consent mode only) ─────────────────────────────── */

.consent {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 150;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  width: min(680px, calc(100vw - 24px));
  padding: 12px 14px 12px 18px;
  border-radius: var(--r-l);
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: var(--shadow-m);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.consent p { flex: 1 1 260px; }

/* ── Motion ────────────────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Legacy aliases ────────────────────────────────────────────────────────────
   The dashboard, docs and admin apps were written against these names. Mapping
   them here re-themes those screens without touching their logic. */

:root {
  --surface: var(--panel);
  --surface2: var(--panel-2);
  --surface3: var(--panel-3);
  --border: var(--line);
  --border2: var(--line-2);
  --text: var(--ink);
  --text2: var(--ink-2);
  --text3: var(--ink-3);
  --accent: #6f7df2;
  --accent2: var(--review);
  --accent-hov: #8390f7;
  --accent-dim: var(--review-bg);
  --accent-glow: var(--review-bg);
  --green: var(--allow);
  --green-dim: var(--allow-bg);
  --green-bg: var(--allow-bg);
  --red: var(--block);
  --red-dim: var(--block-bg);
  --red-bg: var(--block-bg);
  --amber: var(--redact);
  --amber-dim: var(--redact-bg);
  --amber-bg: var(--redact-bg);
  --yellow: var(--redact);
  --yellow-bg: var(--redact-bg);
  --blue: var(--review);
  --blue-bg: var(--review-bg);
  --purple: var(--review);
  --purple-bg: var(--review-bg);
  --sans: var(--font-sans);
  --mono: var(--font-mono);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
}

:root[data-theme="light"] {
  --accent: #4151d6;
  --accent-hov: #3443bd;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */

.mt-0 { margin-top: 0; }
.mt-s { margin-top: 12px; }
.mt { margin-top: 24px; }
.mt-l { margin-top: 40px; }
.mt-xl { margin-top: 64px; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.w-full { width: 100%; }
[hidden] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1020px) {
  .nav-links,
  .nav-signin {
    display: none;
  }

  .nav-burger { display: inline-grid; }
  .nav-inner { justify-content: space-between; }

  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }

  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }

  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .timeline > li:nth-child(n + 3) { border-top: 1px solid var(--line-2); margin-top: 18px; }
}

@media (max-width: 760px) {
  .split,
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row > *:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat-row > *:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .nav .btn-sm { display: none; }

  .timeline { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 1px solid var(--line-2); }
  .timeline > li,
  .timeline > li:nth-child(n + 3) { padding: 0 0 28px 24px; border-top: 0; margin-top: 0; }
  .timeline > li::before { top: 6px; left: -5px; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .cta-row .btn { flex: 1 1 100%; }
  .table th, .table td { padding: 12px 14px; }
}

/* ── Print (legal pages get printed) ───────────────────────────────────────── */

@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #fff;
    --bg-2: #fff;
    --panel: #fff;
    --panel-2: #fff;
    --ink: #000;
    --ink-2: #222;
    --ink-3: #555;
    --line: #ccc;
    --line-2: #bbb;
    --line-3: #999;
  }

  .nav, .nav-sheet, .footer, .quad, .doc-toc, .skip-link { display: none !important; }
  .doc { grid-template-columns: 1fr; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { font-size: 11pt; }
  a { text-decoration: underline; }
}
