/* ============================================================================
 * Z8.run — marketing site design system.
 *
 * A faithful port of the z8_web dashboard design language ("instrument panel,
 * not admin panel"): near-black / near-white canvases, hairline borders instead
 * of shadows, a single accent hue, and color reserved for *state* and
 * *liveness*. The token values below are lifted verbatim from
 * z8/assets/css/app.css so the gestalt is pixel-identical across the product
 * and its site. Hand-authored, zero build step.
 * ========================================================================== */

/* ── Tokens (light) — one source of truth ─────────────────────────────────── */
:root {
  --font-sans: "Inter", "Inter var", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Menlo",
    "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;

  --radius-xs: 0.1875rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Surface scale (light) — canvas is the page, surfaces step inward. */
  --color-canvas: oklch(99% 0.002 270);
  --color-surface: oklch(100% 0 0);
  --color-surface-raised: oklch(97.5% 0.003 270);
  --color-edge: oklch(91% 0.004 270);
  --color-edge-strong: oklch(84% 0.006 270);
  --color-ink: oklch(24% 0.01 270);
  --color-ink-muted: oklch(52% 0.012 270);
  --color-ink-faint: oklch(66% 0.01 270);

  /* One accent hue — focus, links, selection; never for state. */
  --color-accent: oklch(58% 0.16 256);
  --color-accent-ink: oklch(100% 0 0);
  --color-accent-edge: oklch(70% 0.13 256);

  /* State scale — the only place loud color is allowed. */
  --color-state-running: oklch(62% 0.16 250);
  --color-state-awaiting: oklch(72% 0.15 85);
  --color-state-completed: oklch(64% 0.15 150);
  --color-state-failed: oklch(58% 0.19 25);
  --color-state-cancelled: oklch(60% 0.02 270);
  --color-state-idle: oklch(70% 0.012 270);
  --color-state-scheduled: oklch(60% 0.13 300);
  --color-state-poisoned: oklch(50% 0.2 15);

  --color-state-running-bg: color-mix(in oklch, var(--color-state-running) 14%, transparent);
  --color-state-awaiting-bg: color-mix(in oklch, var(--color-state-awaiting) 16%, transparent);
  --color-state-completed-bg: color-mix(in oklch, var(--color-state-completed) 14%, transparent);
  --color-state-failed-bg: color-mix(in oklch, var(--color-state-failed) 14%, transparent);
  --color-state-scheduled-bg: color-mix(in oklch, var(--color-state-scheduled) 14%, transparent);
  --color-state-idle-bg: color-mix(in oklch, var(--color-state-idle) 16%, transparent);

  --color-state-running-edge: color-mix(in oklch, var(--color-state-running) 40%, transparent);
  --color-state-awaiting-edge: color-mix(in oklch, var(--color-state-awaiting) 44%, transparent);
  --color-state-completed-edge: color-mix(in oklch, var(--color-state-completed) 40%, transparent);
  --color-state-failed-edge: color-mix(in oklch, var(--color-state-failed) 40%, transparent);
  --color-state-scheduled-edge: color-mix(in oklch, var(--color-state-scheduled) 40%, transparent);
  --color-state-idle-edge: color-mix(in oklch, var(--color-state-idle) 44%, transparent);

  --shadow-panel: 0 1px 2px oklch(0% 0 0 / 0.04), 0 1px 1px oklch(0% 0 0 / 0.03);
  --shadow-pop: 0 0 0 1px oklch(0% 0 0 / 0.04), 0 8px 24px -6px oklch(0% 0 0 / 0.14),
    0 2px 6px -2px oklch(0% 0 0 / 0.08);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1140px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);

  color-scheme: light;
}

/* ── Dark canvas ~14% lightness; surfaces step *up*, not shadows. ──────────── */
.dark {
  --color-canvas: oklch(14.5% 0.008 270);
  --color-surface: oklch(17.5% 0.009 270);
  --color-surface-raised: oklch(21% 0.01 270);
  --color-edge: oklch(28% 0.012 270);
  --color-edge-strong: oklch(36% 0.014 270);
  --color-ink: oklch(93% 0.006 270);
  --color-ink-muted: oklch(70% 0.012 270);
  --color-ink-faint: oklch(56% 0.012 270);

  --color-accent: oklch(70% 0.14 256);
  --color-accent-ink: oklch(16% 0.01 270);
  --color-accent-edge: oklch(58% 0.13 256);

  --color-state-running: oklch(70% 0.15 250);
  --color-state-awaiting: oklch(78% 0.14 85);
  --color-state-completed: oklch(72% 0.14 150);
  --color-state-failed: oklch(68% 0.18 25);
  --color-state-cancelled: oklch(62% 0.02 270);
  --color-state-idle: oklch(50% 0.012 270);
  --color-state-scheduled: oklch(70% 0.13 300);
  --color-state-poisoned: oklch(62% 0.2 15);

  --shadow-pop: 0 0 0 1px oklch(100% 0 0 / 0.06), 0 12px 32px -8px oklch(0% 0 0 / 0.55),
    0 2px 8px -2px oklch(0% 0 0 / 0.4);

  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums slashed-zero;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

::selection {
  background: color-mix(in oklch, var(--color-accent) 32%, transparent);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Faint blueprint dot-grid — the "z8-graph-canvas" surface, applied to the page
 * as a whole so the whole site reads as an instrument surface. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(
    circle,
    color-mix(in oklch, var(--color-edge-strong) 42%, transparent) 1px,
    transparent 1px
  );
  background-size: 26px 26px;
  background-position: -1px -1px;
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
}

/* A single soft accent aurora behind the hero. */
body::after {
  content: "";
  position: fixed;
  top: -22vh;
  left: 50%;
  width: 80vw;
  height: 70vh;
  z-index: -3;
  transform: translateX(-50%);
  background: radial-gradient(
    50% 50% at 50% 50%,
    color-mix(in oklch, var(--color-accent) 22%, transparent) 0%,
    transparent 70%
  );
  opacity: 0.55;
  pointer-events: none;
}

/* ── Layout primitives ────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }

.section-head { max-width: 60ch; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-ink-muted);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: var(--color-accent-edge);
}
.section-head--center .eyebrow::before { display: none; }

.section-title {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  margin-top: 0.85rem;
}
.section-sub {
  margin-top: 1rem;
  color: var(--color-ink-muted);
  font-size: 1.0625rem;
  max-width: 56ch;
}
.section-head--center .section-sub { margin-inline: auto; }

.label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-muted);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding-inline: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease-out), border-color 0.15s var(--ease-out),
    transform 0.15s var(--ease-out), filter 0.15s var(--ease-out);
}
.btn:hover { background: var(--color-surface-raised); border-color: var(--color-edge-strong); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent-edge);
}
.btn--primary:hover { filter: brightness(1.1); background: var(--color-accent); border-color: var(--color-accent-edge); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--color-ink-muted); }
.btn--ghost:hover { background: var(--color-surface-raised); color: var(--color-ink); border-color: transparent; }

.btn--sm { height: 2rem; padding-inline: 0.75rem; font-size: 0.8125rem; }
.btn .ico { width: 1.05em; height: 1.05em; }

/* ── Pills / badges (state + liveness) ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-state-idle-edge);
  background: var(--color-state-idle-bg);
  color: var(--color-state-idle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}
.badge .dot { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: currentColor; }

.badge--running { color: var(--color-state-running); background: var(--color-state-running-bg); border-color: var(--color-state-running-edge); }
.badge--awaiting { color: var(--color-state-awaiting); background: var(--color-state-awaiting-bg); border-color: var(--color-state-awaiting-edge); }
.badge--completed { color: var(--color-state-completed); background: var(--color-state-completed-bg); border-color: var(--color-state-completed-edge); }
.badge--failed { color: var(--color-state-failed); background: var(--color-state-failed-bg); border-color: var(--color-state-failed-edge); }
.badge--scheduled { color: var(--color-state-scheduled); background: var(--color-state-scheduled-bg); border-color: var(--color-state-scheduled-edge); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* Liveness pulse — the single sanctioned "data is live" animation. */
@keyframes z8-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 0.32rem transparent; opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}
.z8-pulse { animation: z8-pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  color: var(--color-ink);
}
.card__header { border-bottom: 1px solid var(--color-edge); padding: 0.75rem 1rem; }
.card__body { padding: 1rem; }

.stat {
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
}
.stat__label { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-ink-muted); }
.stat__row { margin-top: 0.35rem; display: flex; align-items: baseline; gap: 0.5rem; }
.stat__value { font-family: var(--font-mono); font-size: 1.6rem; line-height: 1; color: var(--color-ink); }
.stat__unit { font-size: 0.75rem; color: var(--color-ink-faint); }
.stat__delta { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-state-completed); }

/* ── Top nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.nav.is-stuck {
  border-color: var(--color-edge);
  background: color-mix(in oklch, var(--color-canvas) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3.85rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  box-shadow: 0 0 0 1px var(--color-accent-edge), 0 0 18px -4px var(--color-accent);
}
.brand__name { font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: -0.02em; }
.brand__name b { color: var(--color-ink); font-weight: 600; }
.brand__name span { color: var(--color-ink-faint); font-weight: 500; }

.nav__links { display: flex; align-items: center; gap: 0.25rem; margin-left: 1.25rem; }
.nav__links a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-ink-muted);
  transition: color 0.15s, background-color 0.15s;
}
.nav__links a:hover { color: var(--color-ink); background: var(--color-surface-raised); }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--color-ink); border-color: var(--color-edge-strong); }
.icon-btn .ico { width: 1.05rem; height: 1.05rem; }

.nav__toggle { display: none; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.3rem 0.4rem;
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  margin-bottom: 1.5rem;
}
.hero__tag .badge { padding: 0.05rem 0.45rem; font-size: 0.68rem; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: linear-gradient(110deg,
    var(--color-ink) 10%,
    color-mix(in oklch, var(--color-accent) 80%, var(--color-ink)) 55%,
    var(--color-ink) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  margin-top: 1.5rem;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--color-ink-muted);
  max-width: 46ch;
}
.hero__cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero__install {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  border: 1px solid var(--color-edge);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.4rem 0.4rem 0.8rem;
}
.hero__install .prompt { color: var(--color-accent); }
.hero__install code { color: var(--color-ink); }
.copy-btn {
  display: grid; place-items: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--color-surface-raised);
  color: var(--color-ink-faint);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.copy-btn:hover { color: var(--color-ink); }
.copy-btn .ico { width: 0.95rem; height: 0.95rem; }

.hero__trust { margin-top: 1.7rem; display: flex; flex-wrap: wrap; gap: 0.55rem 1.4rem; }
.hero__trust span { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--color-ink-muted); }
.hero__trust .ico { width: 0.95rem; height: 0.95rem; color: var(--color-state-completed); flex: 0 0 auto; }

/* ── Swarm visual (hero centerpiece) ──────────────────────────────────────── */
.swarm {
  position: relative;
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle, color-mix(in oklch, var(--color-edge-strong) 55%, transparent) 1px, transparent 1px)
    -1px -1px / 22px 22px,
    var(--color-surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  aspect-ratio: 1 / 0.92;
}
.swarm__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--color-edge);
  background: color-mix(in oklch, var(--color-surface) 70%, transparent);
  backdrop-filter: blur(4px);
}
.swarm__title { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-ink-muted); }
.swarm__title b { color: var(--color-ink); font-weight: 500; }
.swarm__live { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-state-running); }
.swarm svg { width: 100%; height: 100%; display: block; }

.swarm .edge { stroke: var(--color-edge-strong); stroke-width: 1; fill: none; opacity: 0.7; }
.swarm .node-core { fill: var(--color-surface-raised); stroke: var(--color-accent-edge); stroke-width: 1.25; }
.swarm .node { fill: var(--color-surface); stroke: var(--color-edge-strong); stroke-width: 1; }
.swarm .node.ai { stroke: var(--color-state-running-edge); }
.swarm .node.worker { stroke: var(--color-state-scheduled-edge); }
.swarm .node.fsm { stroke: var(--color-state-awaiting-edge); }
.swarm .node.reactor { stroke: var(--color-state-completed-edge); }
.swarm .node-halo { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0; }
.swarm .node-label { fill: var(--color-ink-faint); font-family: var(--font-mono); font-size: 8px; text-anchor: middle; }
.swarm .core-label { fill: var(--color-accent); font-family: var(--font-mono); font-size: 8px; font-weight: 600; text-anchor: middle; }
.swarm .pulse-dot { fill: var(--color-state-running); }

@keyframes halo-ping {
  0% { opacity: 0.55; r: var(--r0); }
  100% { opacity: 0; r: var(--r1); }
}

/* ── Verb strip (the mental model) ────────────────────────────────────────── */
.verbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.verb {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.verb b { font-family: var(--font-mono); font-size: 0.95rem; color: var(--color-ink); font-weight: 600; }
.verb span { font-size: 0.85rem; color: var(--color-ink-faint); }
.verb--accent { border-color: var(--color-accent-edge); }
.verb--accent b { color: var(--color-accent); }

/* ── Feature grid ─────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1px;
  background: var(--color-edge);
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.feature {
  background: var(--color-surface);
  padding: 1.5rem;
  transition: background-color 0.2s var(--ease-out);
}
.feature:hover { background: var(--color-surface-raised); }
.feature__icon {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-edge);
  background: var(--color-surface-raised);
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.feature__icon .ico { width: 1.2rem; height: 1.2rem; }
.feature h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.feature p { font-size: 0.9rem; color: var(--color-ink-muted); line-height: 1.55; }
.feature code { font-size: 0.85em; color: var(--color-ink); background: var(--color-surface-raised); padding: 0.05em 0.35em; border-radius: var(--radius-xs); border: 1px solid var(--color-edge); }

/* ── Code window ──────────────────────────────────────────────────────────── */
.code-window {
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}
.code-window__chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--color-edge);
  background: var(--color-surface-raised);
}
.code-window__dots { display: inline-flex; gap: 0.35rem; }
.code-window__dots i { width: 0.62rem; height: 0.62rem; border-radius: 999px; border: 1px solid var(--color-edge-strong); }
.code-window__file { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-ink-faint); margin-left: 0.4rem; }

.tabs { display: flex; gap: 0.25rem; padding: 0.5rem 0.5rem 0; border-bottom: 1px solid var(--color-edge); background: var(--color-surface-raised); }
.tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.tab[aria-selected="true"] {
  color: var(--color-ink);
  background: var(--color-surface);
  border-color: var(--color-edge);
}

pre.code {
  margin: 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--color-ink);
  tab-size: 2;
}
pre.code code { font-family: var(--font-mono); white-space: pre; }
.code-pane[hidden] { display: none; }

/* Token colors — mirror the dashboard term-renderer hierarchy:
 * values carry color (atoms violet, strings green, numbers blue);
 * structure recedes to muted/faint. */
.tok-com  { color: var(--color-ink-faint); font-style: italic; }
.tok-str  { color: var(--color-state-completed); }
.tok-num  { color: var(--color-state-running); }
.tok-at   { color: var(--color-state-scheduled); }
.tok-attr { color: var(--color-ink-muted); }
.tok-mod  { color: var(--color-accent); }
.tok-k    { color: var(--color-ink-muted); font-weight: 500; } /* structure recedes */
.tok-fn   { color: var(--color-ink); }

/* ── Strategies ───────────────────────────────────────────────────────────── */
.strat {
  background: var(--color-surface);
  padding: 1.15rem 1.25rem;
  transition: background-color 0.2s;
}
.strat:hover { background: var(--color-surface-raised); }
.strat__name { font-family: var(--font-mono); font-size: 0.95rem; color: var(--color-ink); display: flex; align-items: center; gap: 0.5rem; }
.strat__name .k { color: var(--color-accent); font-size: 0.7rem; border: 1px solid var(--color-accent-edge); border-radius: var(--radius-xs); padding: 0.05rem 0.3rem; }
.strat p { margin-top: 0.5rem; font-size: 0.85rem; color: var(--color-ink-muted); }

/* ── Dashboard mock ───────────────────────────────────────────────────────── */
.mock {
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-xl);
  background: var(--color-canvas);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.mock__bar {
  display: flex; align-items: center; gap: 0.75rem;
  height: 3rem; padding-inline: 0.85rem;
  border-bottom: 1px solid var(--color-edge);
  background: var(--color-surface);
}
.mock__brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.mock__brand .brand-mark { width: 1.4rem; height: 1.4rem; font-size: 0.62rem; }
.mock__tabs { display: flex; gap: 0.15rem; margin-left: 0.5rem; overflow: hidden; }
.mock__tabs a { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-ink-muted); padding: 0.3rem 0.55rem; border-radius: var(--radius-sm); }
.mock__tabs a.active { color: var(--color-ink); background: var(--color-surface-raised); position: relative; }
.mock__body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1px; background: var(--color-edge); }
.mock__col { background: var(--color-canvas); padding: 1rem; min-width: 0; }
.mock__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.tbl th {
  text-align: left; padding: 0.4rem 0.6rem;
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-ink-muted); border-bottom: 1px solid var(--color-edge);
}
table.tbl td { padding: 0.5rem 0.6rem; border-bottom: 1px solid color-mix(in oklch, var(--color-edge) 60%, transparent); color: var(--color-ink); }
table.tbl td .mono { font-family: var(--font-mono); color: var(--color-ink-muted); font-size: 0.75rem; }
table.tbl tr:last-child td { border-bottom: none; }

.spark { display: block; color: var(--color-state-running); }

/* ── Architecture flow ────────────────────────────────────────────────────── */
.flow { display: grid; gap: 1rem; }
.flow__lane {
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 1.1rem 1.25rem;
}
.flow__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.85rem; }
.flow__head .dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; }
.flow__head h4 { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-ink); }
.flow__steps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.flow__step {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-ink-muted);
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  background: var(--color-surface-raised);
  white-space: nowrap;
}
.flow__arrow { color: var(--color-ink-faint); }

/* ── CTA band ─────────────────────────────────────────────────────────────── */
.cta {
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(60% 120% at 50% -10%, color-mix(in oklch, var(--color-accent) 16%, transparent), transparent 70%),
    var(--color-surface);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.cta h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.cta p { margin-top: 0.9rem; color: var(--color-ink-muted); max-width: 52ch; margin-inline: auto; }
.cta__row { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--color-edge); padding-block: 2.5rem; margin-top: 2rem; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 2rem 3rem; justify-content: space-between; }
.footer__brand { max-width: 30ch; }
.footer__brand p { margin-top: 0.75rem; font-size: 0.85rem; color: var(--color-ink-muted); }
.footer__cols { display: flex; flex-wrap: wrap; gap: 2.5rem; }
.footer__col h5 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-ink-faint); margin-bottom: 0.75rem; }
.footer__col a { display: block; font-size: 0.875rem; color: var(--color-ink-muted); padding: 0.2rem 0; }
.footer__col a:hover { color: var(--color-ink); }
.footer__base {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-edge);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: 0.8rem; color: var(--color-ink-faint);
}
.footer__base .mono { font-family: var(--font-mono); }

/* ── Checklist ────────────────────────────────────────────────────────────── */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.checklist li { position: relative; padding-left: 1.85rem; color: var(--color-ink-muted); font-size: 0.95rem; line-height: 1.5; }
.checklist li b { color: var(--color-ink); font-weight: 600; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0.1rem;
  width: 1.25rem; height: 1.25rem; display: grid; place-items: center;
  border-radius: 999px;
  background: var(--color-state-completed-bg);
  border: 1px solid var(--color-state-completed-edge);
  color: var(--color-state-completed);
  font-size: 0.68rem; font-weight: 700; line-height: 1;
}
.muted { color: var(--color-ink-faint); }

/* ── Decision record ──────────────────────────────────────────────────────── */
.drec { padding: 0; overflow: hidden; }
.drec__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--color-edge); background: var(--color-surface-raised); }
.drec__title { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-ink); font-weight: 500; }
.rec__section { padding: 0.8rem 1rem; border-top: 1px solid color-mix(in oklch, var(--color-edge) 70%, transparent); }
.drec__bar + .rec__section { border-top: none; }
.rec__label { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-ink-muted); margin-bottom: 0.5rem; }
.rec__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.22rem 0; font-size: 0.875rem; }
.rec__row .k { color: var(--color-ink-muted); flex: 0 0 auto; }
.rec__row .v { color: var(--color-ink); text-align: right; }
.rec__row .v.mono, .rec__row .v .mono { font-family: var(--font-mono); }
.rec__quote { margin: 0; font-size: 0.9rem; color: var(--color-ink); line-height: 1.55; font-style: italic; }
.drec__seal { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-top: 1px solid var(--color-edge); background: var(--color-state-completed-bg); color: var(--color-state-completed); font-size: 0.8rem; }
.drec__seal .ico { width: 1rem; height: 1rem; flex: 0 0 auto; }
.drec__seal .mono { font-family: var(--font-mono); }

/* ── Compliance ───────────────────────────────────────────────────────────── */
/* Hash-chain visual: linked sealed blocks on a blueprint surface. */
.chain {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}
.cblock {
  flex: 1 1 0;
  min-width: 190px;
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 0.85rem 0.95rem;
}
.cblock--genesis { flex: 0 0 auto; min-width: 0; display: grid; place-items: center; border-style: dashed; color: var(--color-ink-faint); font-family: var(--font-mono); font-size: 0.72rem; padding-inline: 0.75rem; }
.cblock__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.cblock__seq { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--color-ink); }
.cblock__row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.68rem; padding: 0.12rem 0; }
.cblock__row .k { color: var(--color-ink-faint); }
.cblock__row .v { color: var(--color-ink-muted); }
.cblock__row .v.is-own { color: var(--color-accent); }
.cblock__row .v.is-prev { color: var(--color-state-completed); }
.chain__link { flex: 0 0 auto; align-self: center; display: grid; place-items: center; color: var(--color-edge-strong); }
.chain__link .ico { width: 1.1rem; height: 1.1rem; }

.verify-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.verify-line {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  border: 1px solid var(--color-edge); border-radius: var(--radius-md);
  background: var(--color-surface); padding: 0.5rem 0.8rem; color: var(--color-ink-muted);
}
.verify-line .ico { width: 0.95rem; height: 0.95rem; }
.verify-line.ok { border-color: var(--color-state-completed-edge); color: var(--color-state-completed); }
.verify-line.bad { border-color: var(--color-state-failed-edge); color: var(--color-state-failed); }
.verify-line .arr { color: var(--color-ink-faint); }

/* Regulatory mapping table */
.reg { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.reg th {
  text-align: left; padding: 0.65rem 1rem; vertical-align: bottom;
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-ink-muted); border-bottom: 1px solid var(--color-edge);
}
.reg td { padding: 0.8rem 1rem; border-bottom: 1px solid color-mix(in oklch, var(--color-edge) 60%, transparent); vertical-align: top; color: var(--color-ink-muted); }
.reg tr:last-child td { border-bottom: none; }
.reg td .reg__name { color: var(--color-ink); font-weight: 600; }
.reg td .reg__cite { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-ink-faint); display: block; margin-top: 0.15rem; }
.reg td.reg__z8 { color: var(--color-ink); }
.reg td.reg__z8 .tag { display: inline-flex; align-items: center; gap: 0.35rem; }
.reg td.reg__z8 .tag .dot { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: var(--color-state-completed); flex: 0 0 auto; }

/* Honest-framing callout */
.note {
  display: flex; gap: 0.85rem; align-items: flex-start;
  border: 1px solid var(--color-edge);
  border-left: 2px solid var(--color-accent-edge);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 1rem 1.15rem;
  color: var(--color-ink-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.note .ico { width: 1.15rem; height: 1.15rem; color: var(--color-ink-faint); flex: 0 0 auto; margin-top: 0.1rem; }
.note b { color: var(--color-ink); font-weight: 600; }

@media (max-width: 760px) {
  .chain { flex-direction: column; align-items: stretch; }
  .cblock { min-width: 0; }
  .chain__link { transform: rotate(90deg); }
  .cblock--genesis { padding-block: 0.5rem; }
  .reg th:nth-child(2), .reg td:nth-child(2) { display: none; } /* hide "requires" col on phones */
}

/* ── Reveal-on-scroll ─────────────────────────────────────────────────────── *
 * Hidden state is gated behind `html.js-reveal`, which JS adds only once it has
 * confirmed it can reveal again. No JS (or a failed script) ⇒ class never set ⇒
 * content is always visible. */
.reveal { transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
html.js-reveal .reveal { opacity: 0; transform: translateY(14px); }
html.js-reveal .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .z8-pulse { animation: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 30rem; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .mock__body { grid-template-columns: 1fr; }
  .mock__col--side { display: none; }
}

@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__toggle { display: grid; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .nav__right .btn--gh-label { display: none; }
}

/* Mobile slide-down menu */
.mobile-menu {
  display: none;
  border-bottom: 1px solid var(--color-edge);
  background: var(--color-surface);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.85rem var(--gutter);
  border-bottom: 1px solid var(--color-edge);
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.mobile-menu a:last-child { border-bottom: none; }
