/* codeweb design tokens — the single source of truth for the public site.
 *
 * Terminal-editorial identity (2026-07 redesign, owner-approved mock): near-black paper,
 * monospace everywhere, dot-matrix display type for the wordmark and big numerals, square
 * corners, film grain, and ONE accent — chartreuse — spent only where meaning lives
 * (the blast radius, the primary action, the winning number). Red stays reserved for
 * risk semantics on research surfaces. Fonts are self-hosted, same-origin. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("jbmono.woff2") format("woff2");
}
@font-face {
  font-family: "Doto";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("doto.ttf") format("truetype");
}

:root {
  /* ---- surfaces (near-black, flat — texture comes from grain, not gradients) ---- */
  --bg: #060608;          /* page background */
  --bg-deep: #060608;     /* kept for compatibility; the identity is one flat black */
  --panel: #0d0d11;       /* cards, raised surfaces */
  --panel-2: #131318;     /* nested / hover surfaces */
  --line: #26242c;        /* borders */
  --line-soft: #1c1b22;   /* hairlines, subtle dividers */

  /* ---- text ---- */
  --fg: #e8e7ee;          /* primary text */
  --muted: #8a8794;       /* secondary text */
  --faint: #6f6c7a;       /* tertiary / labels */

  /* ---- brand accent (the only voice of color) ---- */
  --accent: #c6f24e;
  --accent-2: #b4e13f;    /* pressed / hover */
  /* legacy hue tokens neutralised — nothing on the site speaks purple/teal/pink anymore */
  --purple: #8a8794;
  --teal: #8a8794;
  --pink: #8a8794;

  /* ---- severity / status (brand law: accent = confirmed/act-here, muted = tentative) ---- */
  --hi: var(--accent);
  --med: var(--muted);
  --low: var(--muted);
  --good: var(--accent);

  /* ---- evidence-ledger semantics ---- */
  --validated: var(--accent);
  --preliminary: var(--muted);
  --null: #8a8794;

  /* ---- typography (mono-first; Doto for display numerals + wordmark) ---- */
  --font-sans: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Doto", "JetBrains Mono", monospace;
  --fs-display: clamp(19px, 2.2vw, 23px);   /* caps tagline, not a billboard */
  --fs-h1: clamp(17px, 2vw, 21px);
  --fs-h2: clamp(14px, 1.6vw, 16px);
  --fs-h3: 13px;
  --fs-h4: 12px;
  --fs-body: 14px;
  --fs-sm: 12.5px;
  --fs-xs: 10.5px;
  --lh-tight: 1.35;
  --lh-snug: 1.5;
  --lh-prose: 1.75;
  --tracking-tight: 0.06em;    /* caps headings track OUT, never in */
  --tracking-wide: 0.16em;

  /* ---- spacing scale (4px base) ---- */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 24px;
  --s-6: 32px; --s-7: 48px;  --s-8: 64px;  --s-9: 96px;  --s-10: 128px;

  /* ---- radii / borders / shadow (square world, no glow) ---- */
  --r-sm: 0; --r-md: 0; --r-lg: 0; --r-pill: 0;
  --shadow-1: none;
  --shadow-2: none;
  --glow-accent: none;

  /* ---- layout ---- */
  --content: 1060px;
  --prose: 720px;
  --nav-h: 64px;

  /* ---- motion ---- */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 360ms;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(0, 0, 0, 1);
}

/* codeweb site components — built on tokens.css. Concatenated into docs/assets/site.css
 * by site/build.mjs. Same-origin, cached across pages, zero third-party requests. */

/* ============================ reset + base ============================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--fs-body)/var(--lh-prose) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: var(--lh-snug); font-weight: 650; margin: 0 0 var(--s-3); }
h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 var(--s-4); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
li { margin: var(--s-1) 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-7) 0; }
img, svg { max-width: 100%; }
strong { font-weight: 650; color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 1px 6px;
}
pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  overflow: auto;
  margin: 0 0 var(--s-4);
}
pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.7; }

/* ============================ layout ============================ */
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--s-5); }
.prose { max-width: var(--prose); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-9) 0; }
.section + .section { padding-top: 0; }
.section-tint { background: linear-gradient(180deg, transparent, #15131b 50%, transparent); }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-3);
  display: inline-flex; align-items: center; gap: var(--s-2);
}
.section-head { max-width: 720px; margin: 0 0 var(--s-7); }
.section-head h2 { margin-bottom: var(--s-3); }
.lead { font-size: 18px; color: var(--muted); line-height: 1.55; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.center .section-head, .center.section-head { margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: var(--s-5); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================ nav ============================ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: var(--s-5);
  padding: 0 var(--s-5);
  background: rgba(13, 17, 23, .82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 700; color: var(--fg); font-size: 16px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand .glyph { width: 22px; height: 22px; display: block; }
.nav-links { display: flex; align-items: center; gap: var(--s-2); margin-left: var(--s-4); flex: 1; }
.nav-links a {
  color: var(--muted); font-size: var(--fs-sm); font-weight: 550;
  padding: 7px 11px; border-radius: var(--r-sm); border: 1px solid transparent;
}
.nav-links a:hover { color: var(--fg); background: var(--panel); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--panel); border-color: var(--line); }
.nav-right { display: flex; align-items: center; gap: var(--s-3); }
.nav-ghost { color: var(--muted); font-size: var(--fs-sm); }
.nav-ghost:hover { color: var(--fg); text-decoration: none; }

/* ============================ buttons ============================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: 600 var(--fs-sm)/1 var(--font-sans);
  padding: 11px 17px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--fg); background: var(--panel);
  cursor: pointer; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:hover { border-color: var(--faint); background: var(--panel-2); text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent); color: var(--bg-deep);
  box-shadow: var(--glow-accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* ============================ hero ============================ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(900px 420px at 50% -8%, #1a1726 0%, var(--bg-deep) 58%, var(--bg) 100%);
  z-index: 0;
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .5;
  -webkit-mask-image: radial-gradient(700px 380px at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(700px 380px at 50% 0%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; padding: var(--s-10) 0 var(--s-9); text-align: center; }
.hero h1 { font-size: var(--fs-display); margin: var(--s-4) auto var(--s-4); max-width: 16ch; }
.hero .tagline { color: var(--accent); }
.hero-sub { font-size: 19px; color: var(--muted); max-width: 60ch; margin: 0 auto var(--s-6); line-height: 1.5; }
.hero .btn-row { justify-content: center; }
.hero-note { margin-top: var(--s-5); font-size: var(--fs-xs); color: var(--faint); font-family: var(--font-mono); }

/* node constellation backdrop */
.constellation { display: block; width: 100%; height: 100%; }
.constellation .edge { stroke: var(--line); stroke-width: 1.4; }
.constellation .node { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.4; }
.constellation .node.hub { fill: var(--accent); stroke: var(--accent); }
.constellation .drift { animation: drift 18s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.constellation .pulse { fill: var(--accent); }
@keyframes drift { from { transform: translateY(-6px); } to { transform: translateY(6px); } }

/* ============================ proof stats ============================ */
.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5);
  max-width: 880px; margin: var(--s-7) auto 0;
}
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-5); text-align: left;
}
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--fg); }
.stat .num .unit { font-size: 17px; color: var(--muted); font-weight: 600; }
.stat .label { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s-2); }
.stat .src { font-size: var(--fs-xs); color: var(--faint); font-family: var(--font-mono); margin-top: var(--s-2); }

/* ============================ cards ============================ */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-5);
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.card:hover { border-color: var(--faint); }
.card h3 { font-size: 17px; margin-bottom: var(--s-2); }
.card p { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 0; }
.card-link { display: block; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); }

/* tool cards grouped by phase */
.phase { margin-bottom: var(--s-7); }
.phase-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-4); }
.phase-head h3 { margin: 0; font-size: 16px; }
.phase-head .count { font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); }
.tool {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  border-left: 3px solid var(--phase, var(--accent));
  padding: var(--s-4);
}
.tool .name { font-family: var(--font-mono); font-size: 13px; color: var(--fg); font-weight: 600; }
.tool .desc { font-size: 13px; color: var(--muted); margin-top: var(--s-2); line-height: 1.5; }

/* ============================ chips / tags ============================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--muted);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-validated { color: var(--validated); border-color: color-mix(in srgb, var(--validated) 45%, var(--line)); }
.chip-preliminary { color: var(--preliminary); border-color: color-mix(in srgb, var(--preliminary) 45%, var(--line)); }
.chip-null { color: var(--null); border-color: var(--line); }

/* ============================ evidence ledger ============================ */
.ledger { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ledger th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .04em;
  padding: var(--s-3); border-bottom: 1px solid var(--line);
}
.ledger td { padding: var(--s-3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ledger tr:hover td { background: var(--panel); }
.ledger .claim { color: var(--fg); font-weight: 550; }
.ledger .num { font-family: var(--font-mono); color: var(--accent-2); white-space: nowrap; }
.ledger .src { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--faint); }

/* ============================ callouts ============================ */
.callout {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: var(--s-5); margin: var(--s-5) 0;
}
.callout-warn { border-left-color: var(--med); }
.callout-good { border-left-color: var(--good); }
.callout h3 { margin-bottom: var(--s-2); font-size: 17px; }
.callout p:last-child { margin-bottom: 0; }
.honesty { background: linear-gradient(180deg, #12171e, var(--panel)); }
.honesty ul { margin-bottom: 0; }
.honesty li { color: var(--muted); }
.honesty li strong { color: var(--fg); }

/* ============================ pipeline strip ============================ */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); align-items: stretch; }
.stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); }
.stage .n { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); }
.stage h4 { margin: var(--s-2) 0; font-size: 15px; }
.stage p { font-size: 13px; color: var(--muted); margin: 0; }
.stage:not(:last-child)::after {
  content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%);
  color: var(--faint); z-index: 1; font-size: 14px;
}

/* ============================ split / feature rows ============================ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: center; }
.shot { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); display: block; }
.shot img { display: block; width: 100%; }
.figcap { font-size: var(--fs-xs); color: var(--faint); margin-top: var(--s-2); }
.kicker-list { list-style: none; padding: 0; }
.kicker-list li { display: flex; gap: var(--s-3); margin: var(--s-4) 0; }
.kicker-list .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }

/* ============================ footer ============================ */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); margin-top: var(--s-9); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-6); padding: var(--s-8) 0 var(--s-6); }
.footer-brand .brand { margin-bottom: var(--s-3); }
.footer-brand p { font-size: var(--fs-sm); color: var(--muted); max-width: 34ch; }
.footer-col h5 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 var(--s-3); }
.footer-col a { display: block; color: var(--muted); font-size: var(--fs-sm); padding: 4px 0; }
.footer-col a:hover { color: var(--fg); text-decoration: none; }
.footer-base {
  display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between;
  padding: var(--s-4) 0 var(--s-7); border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs); color: var(--faint); font-family: var(--font-mono);
}

/* ============================ changelog ============================ */
.changelog { max-width: var(--prose); }
.changelog .cl-ver { font-size: 22px; margin: var(--s-7) 0 var(--s-3); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.changelog .cl-ver:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.changelog .cl-grp { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: var(--s-5) 0 var(--s-2); }
.changelog ul { padding-left: var(--s-5); margin-bottom: var(--s-4); }
.changelog li { color: var(--muted); margin: var(--s-2) 0; }
.changelog li strong, .changelog p strong { color: var(--fg); }
.changelog p { color: var(--muted); }

/* ============================ injected nav (demo + paper) ============================ */
.cw-strip {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  height: 38px; padding: 0 14px;
  background: rgba(6, 6, 8, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font: 600 13px/1 var(--font-sans);
}
.cw-strip a { color: var(--muted); text-decoration: none; }
.cw-strip a:hover { color: var(--fg); }
.cw-strip .home { color: var(--fg); }
.cw-strip .sp { flex: 1; }

/* ============================ mobile robustness (no horizontal scroll) ============================ */
/* grid/flex children default to min-width:auto, so a wide child (pre, canvas, table) forces the
   whole page wider on phones. Let them shrink, and keep wide blocks scrolling inside themselves. */
.split > *, .duo > *, .grid > *, .flow-stage, .te-panel, .te-tools > *, .hero-copy, .hero-panel,
.section-head, .prose, .wrap > * { min-width: 0; }
pre { max-width: 100%; }
table.ledger { display: block; overflow-x: auto; }
img, svg, canvas { max-width: 100%; }

/* ============================ responsive ============================ */
@media (max-width: 880px) {
  .cols-3, .cols-4, .stat-strip, .pipeline, .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .stage:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -16px; transform: translateX(50%); }
}
@media (max-width: 620px) {
  .cols-2, .cols-3, .cols-4, .stat-strip, .pipeline, .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .section + .section { padding-top: 0; }
  /* tighter hero rhythm — the desktop hero is far too tall on a phone */
  .hero-inner { padding: var(--s-7) 0 var(--s-6); gap: var(--s-5); }
  .hero h1 { font-size: clamp(32px, 9vw, 46px); line-height: 1.02; }
  .hero-sub { font-size: 16px; }
  #cw-hero-map { height: 260px; }
  .hp-map { min-height: 260px; }
  .stat-strip { gap: var(--s-3); margin-top: var(--s-5); }
  .stat { padding: var(--s-4); }
  .section-head { margin-bottom: var(--s-5); }
  .lead { font-size: 16px; }
  .duo-stage { height: 200px; }
  #cw-mini-map { height: 200px; }
  .te-panel { padding: var(--s-4); }
  .te-station { padding: var(--s-3); }
  pre { padding: var(--s-3) var(--s-4); }
  pre code { font-size: 12px; }
  /* density: a phone shows one column — desktop paddings read as empty crates */
  .section { padding: var(--s-6) 0; }
  .card, .duo-side, .flow-stage { padding: var(--s-4); }
  .grid, .duo, .flow { gap: var(--s-3); }
  .section-head { margin-bottom: var(--s-4); }
  .site-footer { margin-top: var(--s-6); }
  .footer-grid { padding: var(--s-6) 0 var(--s-4); gap: var(--s-5); }
  .footer-base { padding: var(--s-3) 0 var(--s-5); }
  .card.bench h3 { font-size: 28px; }
}

/* ============================ motion preferences ============================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .constellation .drift, .constellation .pulse { animation: none; }
}

/* ============================ terminal editorial (2026-07 redesign) ============================ */
/* Approved direction: mono caps, dot-matrix display numerals, square corners, film grain,
 * one accent. This layer overrides the base components above; markup stays put. */

/* headings + labels: mono, uppercase, tracked out */
h1, h2, h3, h4 { font-weight: 500; text-transform: uppercase; letter-spacing: var(--tracking-tight); }
.lead { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); line-height: 1.9; }
.eyebrow { color: var(--faint); font-weight: 500; }
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--accent); }
.section-tint { background: transparent; border-top: 1px solid var(--line-soft); }
.honesty { background: var(--panel); }
.hero::before { background: none; }
.hl { color: var(--accent); }
strong { font-weight: 600; }

/* film grain + viewfinder frame (injected by base.html) */
.cw-grain { position: fixed; inset: 0; pointer-events: none; opacity: .05; z-index: 90; }
.cw-fr { position: fixed; width: 16px; height: 16px; border: 0 solid rgba(255,255,255,.42); z-index: 40; pointer-events: none; }
.cw-fr.tl { top: 14px; left: 14px; border-left-width: 1px; border-top-width: 1px; }
.cw-fr.tr { top: 14px; right: 14px; border-right-width: 1px; border-top-width: 1px; }
.cw-fr.bl { bottom: 14px; left: 14px; border-left-width: 1px; border-bottom-width: 1px; }
.cw-fr.br { bottom: 14px; right: 14px; border-right-width: 1px; border-bottom-width: 1px; }

/* nav */
.site-nav { background: rgba(6, 6, 8, .92); backdrop-filter: blur(6px); }
.brand { gap: 0; }
.brand .glyph { display: none; }
.brand .wm { font-family: var(--font-display); font-weight: 900; font-size: 21px; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.brand .wm .w { color: #fff; }
.brand .wm::after { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-left: 6px; }
.nav-links a { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.nav-ghost { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; }

/* buttons: boxed, caps */
.btn { font: 600 11.5px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; padding: 12px 18px; background: transparent; border: 1px solid var(--line); }
.btn:hover { transform: none; background: var(--panel); }
.btn-primary { background: #f2f1f5; border-color: #f2f1f5; color: #060608; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 12px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #060608; }

/* flat stages — grain is the texture, not grid paper */
.hp-map, .hp-body, .duo-stage, .flow-viz, .te-viz { background-image: none; }
.chip::before { border-radius: 0; }
.kicker-list .dot { border-radius: 0; margin-top: 7px; }
.hp-bar .dots i { border-radius: 0; }
.cw-legend i { border-radius: 0; }

/* dot-matrix numerals */
.mv, .stat .num { font-family: var(--font-display); font-weight: 900; letter-spacing: .02em; }
.cw-readout .cw-imp { color: var(--accent); }

/* benchmark cards: the number IS the content — display numerals, not a 17px heading */
.card.bench h3 { font-family: var(--font-display); font-weight: 900; font-size: 32px; line-height: 1.1;
  letter-spacing: .02em; color: #fff; margin-bottom: var(--s-3); }

/* ---- index hero (map-first, approved mock) ---- */
.hero2 { text-align: center; padding: var(--s-4) 0 0; }
.hero2 .mapbox { max-width: 760px; margin: 0 auto; position: relative; }
#cw-hero-map { display: block; width: 100%; height: 480px; }
.maphud { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  max-width: 760px; margin: 0 auto; padding: 10px 2px 0; border-top: 1px solid var(--line-soft); }
.maphud .cw-readout { min-height: 0; text-align: left; font-size: 11px; letter-spacing: .04em; flex: 1; }
.maphud .cw-try { margin: 0; flex: none; }
.maphud .cw-chip { font-size: 10.5px; padding: 4px 8px; border-radius: 0; background: transparent; }
.hero2 h1 { font-size: var(--fs-display); letter-spacing: .1em; margin: var(--s-6) 0 0; max-width: none; line-height: 1.5; }
.hero2 h1 b { color: var(--accent); font-weight: 500; }
.hero2 .sub { margin-top: var(--s-3); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.cmd { display: flex; align-items: center; gap: var(--s-4); justify-content: space-between; max-width: 640px;
  margin: var(--s-6) auto 0; background: var(--panel); border: 1px solid var(--line); padding: 14px 18px; text-align: left; }
.cmd .l { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--fg); white-space: nowrap; }
.cmd .l i { width: 8px; height: 8px; background: var(--accent); flex: none; }
.cmd .l .p { color: var(--faint); }
.cmd .r { font-size: var(--fs-xs); letter-spacing: .14em; color: var(--faint); text-transform: uppercase; white-space: nowrap; }
.cmd .r b { color: var(--accent); font-weight: 500; }
.hero2 .btn-row { justify-content: center; margin-top: var(--s-4); }
.hero2 .trust { margin-top: var(--s-5); font-size: var(--fs-xs); letter-spacing: .15em; text-transform: uppercase; color: #57545f; }

/* benchmark meters band */
.meters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-6); border-top: 1px solid var(--line-soft);
  margin-top: var(--s-6); padding: var(--s-5) 0 var(--s-6); text-align: left; }
.meters .k { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.meters .slot { min-height: 52px; display: flex; flex-direction: column; justify-content: center; margin-top: 10px; }
.meters .mv { font-size: 30px; color: #fff; line-height: 1; }
.meters .mv b { color: var(--accent); font-weight: 900; }
.meters .s { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.bars { display: grid; gap: 9px; }
.brow { display: flex; align-items: center; gap: 10px; }
.brow .bl { width: 64px; font-size: 10px; letter-spacing: .14em; color: var(--faint); }
.brow .track { display: inline-block; width: 168px; max-width: 45vw; height: 9px; }
.brow .fill { display: block; height: 100%; background-image: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px); }
.brow .pct { font-size: var(--fs-xs); color: var(--muted); }
.brow.grep .fill { color: #4a4854; width: 44%; }
.brow.cw .fill { color: var(--accent); width: 74%; }
.brow.cw .pct { color: var(--accent); }

@media (max-width: 760px) {
  .cw-fr { display: none; }
  .brand .wm { font-size: 18px; }
  #cw-hero-map { height: 340px; }
  .maphud { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .hero2 h1 { font-size: 15px; letter-spacing: .09em; line-height: 1.7; margin-top: var(--s-5); }
  .hero2 h1 b { display: block; }
  .hero2 .sub { font-size: 9.5px; letter-spacing: .12em; }
  .cmd { flex-direction: column; align-items: flex-start; gap: 9px; padding: 12px 14px; margin-top: var(--s-5); }
  .cmd .l { font-size: 11px; white-space: normal; }
  .meters { grid-template-columns: 1fr; gap: 0; padding: 0 0 var(--s-5); }
  .meters > div { border-bottom: 1px solid var(--line-soft); padding: var(--s-4) 0; }
  .meters > div:last-child { border-bottom: none; }
  .meters .slot { min-height: 0; }
}

/* ============================ live map (hero canvas) ============================ */
.hero-panel { display: flex; flex-direction: column; }
.hp-map { position: relative; flex: 1; min-height: 340px;
  background-color: var(--panel);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 26px 26px; }
#cw-hero-map { display: block; width: 100%; height: 340px; }
.cw-legend { position: absolute; left: 12px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px;
  font: 600 11px/1 var(--font-mono); color: var(--muted); pointer-events: none; }
.cw-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cw-legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.hp-foot { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 12px 16px; }
.cw-readout { font: 12.5px/1.5 var(--font-mono); color: var(--muted); min-height: 38px; }
.cw-readout .cw-hint { color: var(--faint); }
.cw-readout.hot { color: var(--fg); }
.cw-readout b { color: var(--fg); font-weight: 700; }
.cw-readout .cw-imp { color: var(--hi); font-weight: 700; }
.cw-try { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.cw-try > span { font: 600 11px/1 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.cw-chip { font: 600 12px/1 var(--font-mono); color: var(--accent); cursor: pointer;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--r-pill); padding: 5px 10px; transition: background var(--dur-1) var(--ease); }
.cw-chip:hover { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }

/* ============================ duo: one graph, two interfaces ============================ */
.duo { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s-5); align-items: stretch; }
.duo-side { display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); }
.duo-cap { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-4); }
.duo-cap h3 { margin: 0; font-size: 17px; }
.duo-tag { font: 700 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
  color: var(--accent); padding: 4px 8px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); }
.duo-stage { height: 230px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); overflow: hidden; margin-bottom: var(--s-4);
  background-color: var(--bg-deep);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px; }
.duo-side p { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
#cw-mini-map { display: block; width: 100%; height: 230px; }
.duo-link { display: flex; align-items: center; justify-content: center; }
.duo-link span { font: 700 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
  writing-mode: vertical-rl; padding: 10px 0; position: relative; }
.duo-link::before, .duo-link::after { content: ""; }

/* agent console */
.cw-console { height: 100%; padding: 12px 14px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px;
  /* the oldest visible line leaves through a fade, never a hard mid-line slice */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30px); mask-image: linear-gradient(180deg, transparent 0, #000 30px); }
.cw-line { font: 12px/1.45 var(--font-mono); color: var(--muted); animation: cwIn .3s var(--ease) both;
  overflow-wrap: anywhere; }
.cw-line .cw-pfx { color: var(--faint); }
.cw-line .cw-tool { color: var(--teal); font-weight: 700; }
.cw-line.cw-warn { color: var(--fg); } .cw-line.cw-warn .cw-pfx { color: var(--accent); }
.cw-line.cw-good { color: var(--fg); } .cw-line.cw-good .cw-pfx { color: var(--accent); }
.cw-line.cw-ok .cw-pfx { color: var(--accent); }
@keyframes cwIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================ animated pipeline (flow) ============================ */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.flow-stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4);
  transition: opacity .5s var(--ease), transform .5s var(--ease); }
.cw-js .flow-stage { opacity: 0; transform: translateY(12px); }
.flow.in .flow-stage { opacity: 1; transform: none; }
.flow.in .flow-stage:nth-child(2) { transition-delay: .09s; }
.flow.in .flow-stage:nth-child(3) { transition-delay: .18s; }
.flow.in .flow-stage:nth-child(4) { transition-delay: .27s; }
.flow-stage:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: calc(var(--s-4) + 70px); transform: translateY(-50%); color: var(--faint); z-index: 1; font-size: 14px; }
/* the panel keeps the drawing's own aspect, so the pictogram fills it edge to edge instead of
   floating letterboxed in a wide empty strip (worst on phones, where the card is full-width) */
.flow-viz { height: auto; aspect-ratio: 120 / 76; margin-bottom: var(--s-3); background: var(--bg-deep); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 19px 19px; }
.flow-viz svg { display: block; width: 100%; height: 100%; }
.flow-dash { stroke-dasharray: 4 4; animation: flowMarch 1s linear infinite; }
@keyframes flowMarch { to { stroke-dashoffset: -8; } }
.flow-n { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); }
.flow-stage h4 { margin: var(--s-2) 0; font-size: 15px; }
.flow-stage p { font-size: 13px; color: var(--muted); margin: 0; }

/* ============================ tool explorer (lifecycle map) ============================ */
.te-rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-2); margin-bottom: var(--s-5); }
.te-station { display: flex; flex-direction: column; gap: 5px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--phase); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); position: relative;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.te-station:hover { background: var(--panel-2); transform: translateY(-2px); }
.te-station.active { background: var(--panel-2); border-color: color-mix(in srgb, var(--phase) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--phase) 35%, transparent); }
.te-station .te-step { font: 700 11px/1 var(--font-mono); color: var(--phase); }
.te-station .te-title { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.te-station.active .te-title { color: var(--fg); }
.te-station .te-badge { position: absolute; top: var(--s-3); right: var(--s-3); font: 700 10px/1 var(--font-mono);
  color: var(--phase); background: color-mix(in srgb, var(--phase) 14%, transparent); border-radius: var(--r-pill); padding: 3px 7px; }
.te-rail::after { content: ""; }

.te-panel { display: grid; grid-template-columns: 240px 1fr; gap: var(--s-6); align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--phase); border-radius: var(--r-md); padding: var(--s-6); }
.cw-js .te-panel { display: none; }
.cw-js .te-panel.active { display: grid; animation: cwIn .35s var(--ease) both; }
.te-viz { background: var(--bg-deep); border: 1px solid var(--line-soft); border-radius: var(--r-sm); height: 150px;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 22px 22px; }
.te-viz svg { display: block; width: 100%; height: 100%; }
.te-blurb { font-size: 15px; color: var(--fg); font-weight: 550; margin: 0 0 var(--s-4); }
.te-tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.te-tool { border-left: 2px solid color-mix(in srgb, var(--phase) 45%, var(--line)); padding-left: var(--s-3); }
.te-name { display: block; font: 600 13px/1.3 var(--font-mono); color: var(--fg); }
.te-desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.flow-spin { transform-origin: 110px 60px; animation: teSpin 3.4s linear infinite; }
@keyframes teSpin { to { transform: rotate(360deg); } }

/* ============================ scroll reveal ============================ */
.cw-js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.cw-js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .duo { grid-template-columns: 1fr; }
  .duo-link span { writing-mode: horizontal-tb; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-stage:nth-child(2)::after { content: none; }
}
@media (max-width: 880px) {
  .te-rail { grid-template-columns: repeat(3, 1fr); }
  .te-panel { grid-template-columns: 1fr; }
  .te-viz { height: 120px; }
}
@media (max-width: 620px) {
  .flow { grid-template-columns: 1fr; }
  .flow-stage::after { content: none !important; }
  .te-rail { grid-template-columns: 1fr 1fr; }
  .te-tools { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .flow-stage { opacity: 1; transform: none; transition: none; }
  .cw-line, .flow-dash, .flow-spin { animation: none; }
}

/* terminal layer, late overrides (must win over the livemap section above) */
.cw-readout .cw-imp { color: var(--accent); font-weight: 500; }
.te-station.active { border-color: var(--accent); box-shadow: none; }
.te-station.active .te-step { color: var(--accent); }
.hp-map, .hp-body, .duo-stage, .flow-viz, .te-viz { background-image: none; }
