/* quantbase.live — "terminal ledger"
   Dark instrument panel: hairline rules instead of cards, tabular numerals
   everywhere, green/red reserved for genuine market semantics (a number that
   is actually up or actually down), amber for the brand and for actions. */

:root {
  /* The commissioned palette, shared with the console (dashboard/app/dash.css)
     and the landing. These names are the OLD ones on purpose: every rule in
     this file already goes through var(), so re-pointing the values here is
     what converts the docs, agents, check and start pages -- no selector
     changes, no markup changes. */
  --bg:       #08080A;
  --bg-2:     #0C0D0F;
  --bg-3:     #141518;
  --bg-4:     #1A1B1E;
  --line:     rgba(233, 230, 226, 0.10);
  --line-2:   rgba(233, 230, 226, 0.18);
  --ink:      #E9E6E2;
  --ink-2:    #9A9792;
  --ink-3:    #85817C;
  --ink-4:    #5E5B57;
  /* Green and red stay: they are market semantics, not brand. A number that is
     actually up is green on both designs. */
  --up:       #33D69F;
  --down:     #FF5D5D;
  --accent:   #FFB224;
  --accent-2: #FFC257;
  --accent-d: #141009;
  /* Ink on an amber fill. Was hardcoded var(--on-accent) in four places. */
  --on-accent: #08080A;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: 'Archivo Black', 'Helvetica Neue', Arial, sans-serif;
  --body: 'IBM Plex Sans', system-ui, 'Helvetica Neue', Arial, sans-serif;

  /* Full-bleed layout, the way opencode does it: no centred max-width island,
     just a fluid gutter that grows with the viewport. Their steps are 1rem →
     1.5rem → 5rem across breakpoints; clamp() expresses the same curve
     continuously, so there is no width at which the gutter visibly jumps. */
  --pad:  clamp(1rem, 4.2vw, 5rem);
  --vpad: clamp(2.75rem, 5.2vw, 5.5rem);
  --nav-h: 56px;
  --tabbar-h: 0px;              /* becomes real on phones, below */

  /* The frame is full width; READABILITY is bounded on the text itself, not
     by shrinking the container. Long prose measured in ch, so it tracks the
     font rather than a guessed pixel value. */
  --measure: 74ch;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--disp); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0; text-wrap: balance; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

code, kbd, pre, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

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

::selection { background: var(--accent-d); color: #fff; }

/* focus visibility — keyboard users must be able to see where they are */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0;
}

.wrap { width: 100%; padding-inline: var(--pad); }

/* ---------------------------------------------------------------- eyebrow */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.accent { color: var(--accent); }

/* -------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(7,8,10,0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in { width: 100%; padding-inline: var(--pad); height: 100%;
  display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--disp);
  font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { display: block; }

.nav-links { display: flex; align-items: center; gap: 22px; margin-left: 6px; }
.nav-links a { color: var(--ink-2); font-size: 14px; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.nav-icon { color: var(--ink-3); display: flex; }
.nav-icon:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 0; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); background: var(--bg-3); }
.btn-lg { padding: 13px 24px; font-size: 15px; }

/* ------------------------------------------------------------- the dial */
/* Two-position instrument switch: HUMAN | AGENT. It is a link, not a toggle —
   flipping it goes to the other side of the site. */
.dial {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: 0;
  background: var(--bg-2); overflow: hidden; height: 30px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.11em; text-transform: uppercase;
}
.dial span, .dial a { display: flex; align-items: center; padding: 0 11px; color: var(--ink-3); transition: background .14s, color .14s; }
.dial .on { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.dial a:hover { background: var(--bg-4); color: var(--ink); }
.dial .sep { padding: 0; width: 1px; background: var(--line-2); }

/* ---------------------------------------------------------------- ticker */
.ticker { border-bottom: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.ticker-track { display: flex; gap: 0; width: max-content; animation: slide 64s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick { display: flex; align-items: baseline; gap: 9px; padding: 8px 20px;
  border-right: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.tick b { font-weight: 400; color: var(--ink-3); letter-spacing: 0.06em; }
.tick i { font-style: normal; color: var(--ink); }
.tick .up { color: var(--up); }
.tick .down { color: var(--down); }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ----------------------------------------------------------------- hero */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before {
  /* faint ledger grid, fading out downward — texture, not decoration */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.34;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.hero-in { position: relative; display: grid; grid-template-columns: 1.06fr 0.94fr;
  gap: clamp(36px, 4.5vw, 72px); align-items: center;
  padding: calc(var(--vpad) * 0.95) 0 var(--vpad); }
.hero h1 { font-size: clamp(37px, 4.4vw, 64px); letter-spacing: -0.035em;
  margin: 18px 0 20px; }
.hero .lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0 0 14px; max-width: 34em; }
.hero .sub { font-size: 15.5px; line-height: 1.6; color: var(--ink-3); margin: 0 0 28px; max-width: 34em; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-note { font-family: var(--mono); font-size: 12px; color: var(--ink-4); }

.num-up { color: var(--up); }
.num-down { color: var(--down); }

/* ------------------------------------------------------- connect / tabs */
.connect { border: 1px solid var(--line); border-radius: 0; background: var(--bg-2); overflow: hidden; }
.connect-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.connect-tabs::-webkit-scrollbar { display: none; }
.connect-tabs button {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  padding: 11px 16px; cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s;
}
.connect-tabs button:hover { color: var(--ink-2); }
.connect-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.connect-body { position: relative; }
.connect-pane { display: none; }
.connect-pane[data-on="1"] { display: block; }
.connect-pane pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--ink); }
.connect-pane .cap { padding: 0 20px 16px; font-size: 13px; color: var(--ink-3); margin: 0; }
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-4); border: 1px solid var(--line-2); color: var(--ink-3);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 0; cursor: pointer; transition: color .12s, border-color .12s;
}
.copy-btn:hover { color: var(--ink); border-color: var(--ink-4); }
.copy-btn.done { color: var(--up); border-color: var(--up); }

/* --------------------------------------------------------------- section */
.section { border-bottom: 1px solid var(--line); padding: var(--vpad) 0; }
.section-head { max-width: 42em; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3vw, 42px); margin: 14px 0 14px; }
.section-head p { font-size: 17px; color: var(--ink-2); margin: 0; line-height: 1.6; }

/* ------------------------------------------------------------- the proof */
.proof { display: grid; grid-template-columns: 1fr 1.15fr; gap: 52px; align-items: start; }
.proof-stats { display: flex; flex-direction: column; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line); gap: 20px; }
.stat-row:first-child { border-top: 1px solid var(--line); }
.stat-row .k { font-size: 14.5px; color: var(--ink-2); }
.stat-row .v { font-family: var(--mono); font-size: 17px; color: var(--ink); }
.stat-row .v.big { font-size: 25px; }
.callout { border-left: 2px solid var(--accent); background: var(--bg-2);
  padding: 15px 18px; margin-top: 24px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.chart-panel { border: 1px solid var(--line); border-radius: 0; background: var(--bg-2); padding: 22px 24px 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.chart-legend { display: flex; gap: 18px; margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 9px; height: 9px; border-radius: 0; display: block; }

/* --------------------------------------------------------------- feature */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.cell { background: var(--bg); padding: 26px 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.cell:hover { background: var(--bg-2); }
.cell .ic { color: var(--accent); margin-bottom: 2px; }
.cell h3 { font-size: 16.5px; letter-spacing: -0.01em; }
.cell p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-3); }
.cell .tool { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); margin-top: auto; padding-top: 8px; }

/* ------------------------------------------------------------ stats strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* Direct children only. `.strip div` also matched .n and .l, so the number and
   the label each carried the cell's 30px/26px padding -- a 36px line inside a
   96px box, and a cell half again as tall as its content. */
.strip > div { background: var(--bg); padding: 30px 26px; }
.strip .n { font-family: var(--disp); font-size: 36px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.strip .l { font-size: 13.5px; color: var(--ink-3); margin-top: 9px; line-height: 1.45; }

/* ------------------------------------------------------------- steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step .n { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.12em; }
.step h3 { font-size: 17px; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-3); line-height: 1.6; }

/* ------------------------------------------------------------- pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { border: 1px solid var(--line); border-radius: 0; background: var(--bg-2);
  padding: 28px 26px 30px; display: flex; flex-direction: column; gap: 18px; }
.plan.mark { border-color: var(--accent-d); background: var(--bg-3); }
.plan .price { font-family: var(--disp); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-family: var(--body); font-size: 14px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-left: 5px; }
.plan .blurb { font-size: 14px; color: var(--ink-3); margin: 0; min-height: 3.2em; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan li { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); gap: 14px; }
.plan li span:last-child { font-family: var(--mono); color: var(--ink); }
.plan .btn { margin-top: auto; }

/* ----------------------------------------------------------------- FAQ */
.faq { max-width: 46em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 0; font-family: var(--disp); font-weight: 600;
  font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--ink-3); font-weight: 400; font-size: 18px; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq .a { padding: 0 0 20px; font-size: 15px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; }
.faq .a p { margin: 0 0 12px; }
.faq .a p:last-child { margin: 0; }

/* --------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-2);
  padding: clamp(38px, 4vw, 56px) 0 calc(34px + var(--tabbar-h)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; margin: 0 0 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer a { color: var(--ink-3); font-size: 14px; }
.footer a:hover { color: var(--ink); }
.footer-bot { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); }
.disclaimer { font-size: 12.5px; color: var(--ink-4); line-height: 1.6; max-width: 62ch; margin: 14px 0 0; }

/* ----------------------------------------------------------------- docs */
/* Sidebar and TOC keep their measured widths; the article takes the rest and
   is capped by --measure so a 2560px display gives wider margins, not
   200-character lines. */
.docs { display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 188px;
  gap: clamp(28px, 3.2vw, 60px);
  width: 100%; padding-inline: var(--pad); align-items: start; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 26px); max-height: calc(100vh - var(--nav-h) - 52px);
  overflow-y: auto; padding: 32px 0 40px; }
.sidebar h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; margin: 22px 0 10px; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.sidebar a { display: block; color: var(--ink-3); font-size: 13.5px; padding: 5px 10px;
  border-radius: 0; border-left: 2px solid transparent; }
.sidebar a:hover { color: var(--ink); background: var(--bg-2); }
.sidebar a.on { color: var(--accent); border-left-color: var(--accent); background: var(--bg-2); }

.doc { padding: 34px 0 90px; min-width: 0; max-width: var(--measure); }
.doc-crumb { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 14px; }
.doc h1 { font-size: 38px; margin: 0 0 14px; letter-spacing: -0.03em; }
.doc .doc-lede { font-size: 17.5px; color: var(--ink-2); line-height: 1.6; margin: 0 0 34px; }
.doc h2 { font-size: 25px; margin: 46px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 30px 0 10px; }
.doc h4 { font-size: 15.5px; margin: 22px 0 8px; font-family: var(--disp); }
.doc p { margin: 0 0 15px; line-height: 1.72; color: var(--ink-2); }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); line-height: 1.72; }
.doc li { margin-bottom: 7px; }
.doc li::marker { color: var(--ink-4); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc em { color: var(--ink); }
.doc code { background: var(--bg-3); border: 1px solid var(--line); border-radius: 0;
  padding: 1px 5px; font-size: 0.875em; color: var(--accent-2); }
.doc pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 0;
  padding: 16px 18px; overflow-x: auto; margin: 0 0 18px; font-size: 13px; line-height: 1.62; }
.doc pre code { background: none; border: 0; padding: 0; color: var(--ink); font-size: 13px; }
.doc blockquote { margin: 0 0 18px; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent);
  color: var(--ink-2); }
.doc blockquote p:last-child { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; }
.doc td { color: var(--ink-2); }
.doc a { border-bottom: 1px solid var(--accent-d); }
.doc a:hover { border-bottom-color: var(--accent); }
.doc hr { margin: 34px 0; }
.doc img { max-width: 100%; }

.anchor { color: var(--ink-4); opacity: 0; margin-left: 8px; font-weight: 400; border: 0 !important; font-size: 0.8em; }
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; }

.toc { position: sticky; top: calc(var(--nav-h) + 26px); padding: 36px 0; max-height: calc(100vh - var(--nav-h) - 52px); overflow-y: auto; }
.toc h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; margin: 0 0 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.toc a { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; display: block; }
.toc a:hover { color: var(--ink); }
.toc a.lvl3 { padding-left: 12px; font-size: 12px; }

.doc-nav { display: flex; justify-content: space-between; gap: 18px; margin-top: 58px;
  padding-top: 26px; border-top: 1px solid var(--line); }
.doc-nav a { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line);
  border-radius: 0; padding: 14px 18px; flex: 1; max-width: 48%; }
.doc-nav a:hover { border-color: var(--line-2); background: var(--bg-2); }
.doc-nav .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4); }
.doc-nav .ttl { color: var(--ink); font-size: 14.5px; font-weight: 600; font-family: var(--disp); }
.doc-nav .nx { text-align: right; margin-left: auto; }

/* ------------------------------------------------------------ tool cards */
.tool-card { border: 1px solid var(--line); border-radius: 0; background: var(--bg-2);
  margin-bottom: 14px; overflow: hidden; }
.tool-card summary { cursor: pointer; list-style: none; padding: 13px 18px; display: flex;
  align-items: center; gap: 12px; }
.tool-card summary::-webkit-details-marker { display: none; }
.tool-card summary::after { content: "+"; font-family: var(--mono); color: var(--ink-4); margin-left: auto; }
.tool-card[open] summary::after { content: "\2212"; }
.tool-card[open] summary { border-bottom: 1px solid var(--line); }
.tool-card .nm { font-family: var(--mono); font-size: 13.5px; color: var(--accent); }
.tool-card .sm { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; }
.tool-body { padding: 16px 18px 6px; }
.tool-body p { font-size: 14px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.65; }
.tool-body pre { font-size: 12.5px; }
.params { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.params th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; text-align: left; padding: 0 14px 7px 0; border-bottom: 1px solid var(--line); }
.params td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.params td.p { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.params td.t { font-family: var(--mono); color: var(--ink-4); font-size: 12px; white-space: nowrap; }
.req { color: var(--accent); font-size: 11px; font-family: var(--mono); }

.tool-filter { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 0;
  padding: 11px 14px; color: var(--ink); font-family: var(--mono); font-size: 13px; margin-bottom: 20px; }
.tool-filter::placeholder { color: var(--ink-4); }
.tool-filter:focus { border-color: var(--accent); outline: none; }

/* ---------------------------------------------------------- agents page */
.agent-hero { border-bottom: 1px solid var(--line); padding: 62px 0 52px; position: relative; overflow: hidden; }
.agent-hero h1 { font-size: 46px; letter-spacing: -0.032em; margin: 16px 0 18px; }
.agent-hero .lede { font-size: 18px; color: var(--ink-2); max-width: 40em; line-height: 1.6; margin: 0; }

.promptbox { border: 1px solid var(--line-2); border-radius: 0; background: var(--bg-2); overflow: hidden; }
.promptbox-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg); }
.promptbox-head .t { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); }
.promptbox-head .actions { margin-left: auto; display: flex; gap: 8px; }
.promptbox pre { margin: 0; padding: 20px; max-height: 520px; overflow: auto; font-size: 12.5px;
  line-height: 1.68; color: var(--ink-2); white-space: pre-wrap; word-wrap: break-word; }
.promptbox pre::-webkit-scrollbar { width: 10px; }
.promptbox pre::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 0; }

.map-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.map-table th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 400; text-align: left; padding: 0 16px 9px 0; border-bottom: 1px solid var(--line); }
.map-table td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.map-table td.u { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* ------------------------------------------------------------ utilities */
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; z-index: 100; border-radius: 0; font-weight: 600; }
.skip:focus { left: 0; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-3); }

/* --------------------------------------------------------------- mobile */
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); border-radius: 0;
  color: var(--ink-2); padding: 6px 9px; cursor: pointer; }

@media (max-width: 1080px) {
  .docs { grid-template-columns: 210px minmax(0,1fr); gap: 32px; }
  .toc { display: none; }
  .hero-in { grid-template-columns: 1fr; gap: 44px; }
  .hero h1 { font-size: 48px; }
  .proof { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
  .plans { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .nav-links { display: none; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .doc { max-width: none; }
}

@media (max-width: 640px) {
  .hero .lede { font-size: 17px; }
  .grid-3 { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr; }
  .doc h1 { font-size: 30px; }
  .doc h2 { font-size: 22px; }
  .agent-hero h1 { font-size: 34px; }
  .footer-grid { grid-template-columns: 1fr; }
  .doc-nav { flex-direction: column; }
  .doc-nav a { max-width: none; }
}

/* Grid and flex children default to min-width:auto, which means they refuse to
   shrink below their content's min-content width. The connect block holds an
   unbreakable command line, so its column demanded ~640px and widened the BODY
   -- every section below it then laid out against that width and ran off the
   right edge of a phone. overflow-x:auto on the <pre> does not help while its
   ancestors can still grow. min-width:0 is the actual fix: it lets the column
   shrink and hands the overflow to the scroll container that was always there.
   Deliberately NOT paired with overflow-x:hidden on body -- that would hide a
   future regression of exactly this kind instead of showing it. */
.hero-in > *, .proof > *, .grid-3 > *, .strip > *, .plans > *, .steps > *,
.docs > *, .connect, .connect-body, .connect-pane, .promptbox { min-width: 0; }

/* -------------------------------------------------------------- signup form */
.signup { display: flex; flex-direction: column; gap: 10px; max-width: 26rem; }
.signup label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-3); }
.signup input {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 0;
  padding: 13px 15px; color: var(--ink); font-family: var(--body); font-size: 16px;
}
.signup input::placeholder { color: var(--ink-4); }
.signup input:focus { border-color: var(--accent); outline: none; }
.signup input:invalid:not(:placeholder-shown) { border-color: var(--down); }
.signup button { margin-top: 4px; }
.signup .hint { font-size: 13px; color: var(--ink-4); line-height: 1.55; margin: 4px 0 0; }

.flow { list-style: none; margin: 0; padding: 0; counter-reset: s;
  display: flex; flex-direction: column; gap: 18px; }
.flow li { counter-increment: s; position: relative; padding-left: 32px;
  font-size: 14.5px; line-height: 1.6; color: var(--ink-3); }
.flow li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border: 1px solid var(--line-2); border-radius: 0;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
}
.flow b { color: var(--ink); font-weight: 600; }

@media (max-width: 900px) { .signup-grid { grid-template-columns: 1fr !important; gap: 40px !important; } }


/* ========================================================================
   MOBILE APP SHELL
   ========================================================================
   Below 860px this stops behaving like a shrunken web page and behaves like
   an app: a fixed bottom tab bar for primary navigation, a compact header
   that keeps only identity and the human/agent dial, and documentation
   navigation as a horizontally scrolling strip instead of a hidden drawer.

   A bottom bar rather than a hamburger because the destinations are few and
   fixed, thumbs reach the bottom of a phone and not the top, and a menu that
   must be opened hides the fact that there is anywhere to go. */

.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --tabbar-h: 58px; }

  /* Room for the bar, plus the home-indicator strip on notched hardware.
     Without the env() term the last row of content sits under the gesture
     area and cannot be tapped. */
  body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }

  .tabbar {
    display: grid;
    grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(12, 14, 17, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--ink-4); text-decoration: none;
    font-size: 10px; letter-spacing: 0.02em; font-weight: 500;
    min-height: 44px;                      /* the accessible tap target */
    transition: color .12s;
  }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a:active { color: var(--ink-2); }
  /* The active tab gets a rule at the top edge, the way a native tab bar
     marks selection without relying on colour alone. */
  .tabbar a.on::before {
    content: ""; position: absolute; top: -1px; width: 30px; height: 2px;
    background: var(--accent); border-radius: 0;
  }
  .tabbar a { position: relative; }

  /* Header keeps identity and the dial. Everything else it used to carry now
     lives in the bar, so nothing is hidden behind a menu. */
  .nav-right > .btn-primary, .nav-right .nav-icon, .menu-btn { display: none; }
  .nav-in { gap: 12px; }

  /* Docs navigation: a scrolling strip pinned under the header, the pattern
     a native app uses for sibling sections. Replaces a drawer that gave no
     hint the other pages existed. */
  .sidebar {
    display: block; position: sticky; top: var(--nav-h); z-index: 40;
    max-height: none; overflow: visible;
    margin-inline: calc(var(--pad) * -1);
    padding: 0; background: rgba(7, 8, 10, 0.94); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .sidebar h4 { display: none; }
  /* The scroller is the SIDEBAR, not each list. There is one <ul> per section
     ("Start", "Concepts", ...), so making each list scroll produced four
     stacked strips eating four rows of a phone screen. Laying the lists out
     as rows inside one scroller gives a single strip. */
  .sidebar {
    display: flex; overflow-x: auto; scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar ul { flex-direction: row; gap: 0; flex: none; }
  .sidebar ul:first-of-type { padding-left: var(--pad); }
  .sidebar ul:last-of-type { padding-right: var(--pad); }
  .sidebar li { flex: none; scroll-snap-align: start; }
  .sidebar a {
    border-left: 0; border-bottom: 2px solid transparent; border-radius: 0;
    padding: 12px 14px; white-space: nowrap; font-size: 13.5px;
  }
  .sidebar a.on {
    background: transparent; border-bottom-color: var(--accent);
    border-left-color: transparent;
  }
  .doc { padding-top: 26px; }

  /* Comfortable thumbs. 15px keeps iOS from zooming the field on focus. */
  .btn { min-height: 44px; padding: 12px 18px; }
  .dial span, .dial a { min-height: 34px; }
  .signup input { font-size: 16px; padding: 14px 15px; }
  .faq summary { padding: 20px 0; min-height: 48px; }
  .tool-card summary { padding: 15px 16px; min-height: 48px; }
}

/* A pointer that cannot hover is a finger: drop hover-only affordances that
   would otherwise stick after a tap. */
@media (hover: none) {
  .cell:hover { background: var(--bg); }
  .anchor { display: none; }
}

@media (max-width: 420px) {
  .tabbar a { font-size: 9.5px; }
  .dial span, .dial a { padding: 0 9px; font-size: 9.5px; }
}

/* ======================================================================
   MOTION
   ====================================================================== */

/* ---------------------------------------------------------- ParticleText
   The canvas is a transition, not a destination. The <h1> underneath is the
   real headline throughout -- selectable, crawlable, announced by a screen
   reader -- and is simply hidden while the particles form. Without .is-armed
   (JS blocked, old browser, an exception) it is plainly visible, so nothing
   here can produce an empty hero. */
.ptext { position: relative; display: block; --ptext-bleed: 100px; }

/* The headline STAYS in the document. Once the particles are painting it goes
   transparent rather than hidden, which keeps three things the canvas cannot
   provide on its own: the element still sizes the box the particles are
   measured against, the words are still selectable, and a screen reader or a
   crawler still reads a real <h1>. */
.ptext__solid { margin: 0; transition: color .45s ease; }
.ptext.is-armed .ptext__solid { color: transparent; }
.ptext__solid [data-line] { display: block; }

/* Bled out past the text box so particles scattering in from outside are not
   clipped at the edge -- otherwise they appear from nowhere along a hard line. */
.ptext__canvas {
  position: absolute;
  inset: calc(var(--ptext-bleed) * -1);
  width: calc(100% + var(--ptext-bleed) * 2);
  height: calc(100% + var(--ptext-bleed) * 2);
  display: block; opacity: 0; transition: opacity .4s ease;
  touch-action: none;
  /* Bloom on the compositor. Doing it per particle via ctx.shadowBlur costs a
     blur per fill, and there are a few thousand fills a frame. */
  filter: drop-shadow(0 0 7px oklch(0.78 0.16 75 / 0.18));
}
.ptext.is-armed .ptext__canvas { opacity: 1; }

/* ------------------------------------------------------------- LogoLoop */
.logoloop { position: relative; overflow: hidden;
  --logoloop-gap: 46px; --logoloop-h: 26px; }
.logoloop__track { display: flex; width: max-content; will-change: transform; }
.logoloop__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.logoloop__item { flex: none; margin-right: var(--logoloop-gap); }
.logoloop__item a, .logoloop__item span {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-3); text-decoration: none;
  font-family: var(--body); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .22s, transform .22s;
}
.logoloop__item svg { width: var(--logoloop-h); height: var(--logoloop-h); flex: none; }
.logoloop:hover .logoloop__item a { color: var(--ink-4); }
.logoloop .logoloop__item a:hover { color: var(--ink); transform: scale(1.06); }
.logoloop::before, .logoloop::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(40px, 9%, 150px);
  pointer-events: none; z-index: 2;
}
.logoloop::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.logoloop::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* ------------------------------------------------ bento + spotlight cards
   Two custom properties do all the work: --mx/--my track the pointer and
   --near is proximity, so the highlight and the lit border are pure paint on
   the compositor rather than layout. */
.bento {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 14px; grid-auto-rows: minmax(150px, auto);
}
.bento-card {
  --mx: 50%; --my: 50%; --near: 0;
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--bg-2);
  padding: 26px 26px 28px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .3s, transform .3s;
  isolation: isolate;
}
/* the travelling highlight */
.bento-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: calc(var(--near) * 0.9); transition: opacity .3s;
  background: radial-gradient(240px circle at var(--mx) var(--my),
    oklch(0.78 0.16 75 / 0.13), transparent 65%);
}
/* the lit edge */
.bento-card::after {
  content: ""; position: absolute; inset: -1px; z-index: -1; pointer-events: none;
  border-radius: 0; padding: 1px;
  opacity: calc(var(--near) * 0.85); transition: opacity .3s;
  background: radial-gradient(340px circle at var(--mx) var(--my),
    var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.bento-card:hover { transform: translateY(-2px); }
.bento-card .ic { color: var(--accent); }
.bento-card h3 { font-size: 17px; letter-spacing: -0.01em; }
.bento-card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-3); }
.bento-card .tool { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4);
  margin-top: auto; padding-top: 10px; }
.bento-card .big { font-family: var(--disp); font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1; }

.b-3 { grid-column: span 3; } .b-2 { grid-column: span 2; }
.b-4 { grid-column: span 4; } .b-6 { grid-column: span 6; }

/* ------------------------------------------------------- platform stack */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  gap: 10px; }
.plat {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg-2);
  padding: 14px 15px; cursor: pointer; text-align: left;
  color: var(--ink-2); font-family: var(--body); font-size: 14px; font-weight: 500;
  transition: border-color .2s, background .2s, color .2s;
  min-height: 52px; width: 100%;
}
.plat svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); transition: color .2s; }
.plat:hover { border-color: var(--line-2); background: var(--bg-3); color: var(--ink); }
.plat:hover svg { color: var(--ink-2); }
.plat[aria-selected="true"] { border-color: var(--accent-d); background: var(--bg-3); color: var(--ink); }
.plat[aria-selected="true"] svg { color: var(--accent); }
.plat > span:first-of-type { min-width: 0; }
.plat .meta { margin-left: auto; font-family: var(--mono); font-size: 10px;
  color: var(--ink-4); letter-spacing: 0.06em; flex: none; }

.plat-panel { border: 1px solid var(--line); border-radius: 0; background: var(--bg-2);
  margin-top: 16px; overflow: hidden; }
.plat-panel-head { display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: var(--bg); }
.plat-panel-head svg { width: 19px; height: 19px; color: var(--accent); flex: none; }
.plat-panel-head .n { font-family: var(--disp); font-weight: 600; font-size: 15px; }
.plat-panel-head .k { font-family: var(--mono); font-size: 11px; color: var(--ink-4);
  letter-spacing: 0.06em; text-transform: uppercase; margin-left: auto; }
.plat-body { display: none; }
.plat-body[data-on="1"] { display: block; }
.plat-step { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.plat-step:last-child { border-bottom: 0; }
.plat-step .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 9px; }
.plat-step pre { margin: 0; overflow-x: auto; font-size: 12.5px; line-height: 1.62;
  color: var(--ink); }
.plat-step p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* --------------------------------------------------------------- reveal */
.reveal-armed { opacity: 0; transform: translateY(14px);
  transition: opacity .62s cubic-bezier(.2,.7,.3,1), transform .62s cubic-bezier(.2,.7,.3,1); }
.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal-armed { opacity: 1; transform: none; transition: none; }
  .bento-card, .logoloop__item a { transition: none; }
}

@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .b-3, .b-4 { grid-column: span 4; } .b-2 { grid-column: span 2; } .b-6 { grid-column: span 4; }
}
@media (max-width: 700px) {
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .b-2, .b-3, .b-4, .b-6 { grid-column: span 1; }
  .plat-grid { grid-template-columns: 1fr 1fr; }
  .logoloop { --logoloop-gap: 32px; }
}

/* ------------------------------------------------------------ solo hero */
.hero-solo { position: relative; padding: calc(var(--vpad) * 1.05) 0 var(--vpad);
  max-width: 1000px; }
.hero-solo .ptext { margin: 18px 0 26px; --ptext-bleed: 120px; }
.hero-solo .ptext__solid {
  font-family: var(--disp); font-weight: 600;
  font-size: clamp(52px, 9vw, 132px); line-height: 0.98; letter-spacing: -0.045em;
}
.hero-solo .lede { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5;
  color: var(--ink-2); margin: 0 0 14px; max-width: 30em; }
.hero-solo .sub { font-size: clamp(15px, 1.15vw, 16.5px); line-height: 1.6;
  color: var(--ink-3); margin: 0 0 30px; max-width: 30em; }
.hero-solo .hero-cta { margin-bottom: 40px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--line); }
.hero-stats > div { flex: 1 1 190px; padding: 20px 26px 20px 0;
  border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; }
.hero-stats > div + div { padding-left: 26px; }
.hs-n { font-family: var(--mono); font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 500; color: var(--ink); line-height: 1; }
.hs-l { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.45; }

/* ------------------------------------------------------------- loop band */
.loopband { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 0 30px; background: var(--bg); }
.loop-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-4); margin: 0 0 20px; }

@media (max-width: 700px) {
  .hero-solo .ptext { margin: 14px 0 22px; }
  .hero-stats > div { flex: 1 1 100%; border-right: 0;
    border-bottom: 1px solid var(--line); padding: 15px 0; }
  .hero-stats > div + div { padding-left: 0; }
  .hero-stats > div:last-child { border-bottom: 0; }
}

/* ---------------------------------------------- hero: copy + transcript */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(32px, 4vw, 72px); align-items: center; }
.hero-solo { max-width: none; padding-bottom: 34px; }
.hero-aside { min-width: 0; }

/* The up/down colours must beat .hs-n's own colour, which is set later in the
   file and would otherwise win on source order alone. */
.hs-n.num-up { color: var(--up); }
.hs-n.num-down { color: var(--down); }

.term { border: 1px solid var(--line-2); border-radius: 0; background: var(--bg-2);
  overflow: hidden; box-shadow: 0 24px 60px -30px rgba(0,0,0,0.9); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-3); }
.term-bar .dot { width: 9px; height: 9px; border-radius: 0; background: var(--line-2); }
.term-t { margin-left: 8px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-4); letter-spacing: 0.04em; }
.term-body { margin: 0; padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.72; color: var(--ink-2); }
.term-body .c-p { color: var(--accent); }
.term-body .c-f { color: var(--ink); }
.term-body .c-s { color: var(--accent-2); }
.term-body .c-d { color: var(--ink-4); }
.term-body .c-n { color: var(--ink); }
.term-body .c-up { color: var(--up); }
.term-body .c-dn { color: var(--down); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-solo { padding-bottom: 0; }
}

/* ------------------------------------------------------- the check page */
.signup-select {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 0;
  padding: 13px 15px; color: var(--ink); font-family: var(--body); font-size: 16px;
}
.signup-select:focus { border-color: var(--accent); outline: none; }
#out .stat-row .v { font-size: 22px; }
#verdict { border-left-width: 3px; }
#verdict.bad { border-left-color: var(--down); }
#verdict.ok { border-left-color: var(--up); }
@media (max-width: 820px) { .check-grid { grid-template-columns: 1fr !important; } }
