/* ============================================================================
   Pulpum — Stylesheet
   Pure CSS. Control-room agent-OS. All values come from tokens.css.
   RULE: sections are separated by whitespace + surface elevation + tone.
         There are ZERO borders/dividers between sections.
   ========================================================================== */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--nav-h) + var(--space-6)); }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.004em;
  text-wrap: balance;
  font-optical-sizing: auto;
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--fs-h1); line-height: 1.14; letter-spacing: -0.008em; }
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3 { font-family: var(--font-sans); font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-family: var(--font-sans); font-size: var(--fs-h4); line-height: 1.3; }
p  { margin: 0 0 var(--space-4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code, pre, .mono { font-family: var(--font-mono); }
.metric, .ts, .num, td.num, .price__amount { font-variant-numeric: tabular-nums; }

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.lead { font-size: var(--fs-lead); color: var(--text-secondary); max-width: 62ch; line-height: 1.5; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -60px; z-index: 200;
  background: var(--accent); color: var(--text-on-accent);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  font-weight: 600; text-decoration: none;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); color: var(--text-on-accent); }

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

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--container-xl);
  margin-inline: auto; padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-xl); }
.container--md { max-width: var(--container-md); }

/* NO SECTION BORDERS — separation is space + surface + tone */
.section { padding-block: var(--section-y); border: 0; position: relative; }
.section + .section { border-top: 0; }
.section--lg { padding-block: var(--section-y-lg); }
/* The alt, deep and canvas variants keep their names but paint nothing:
   the page carries the one solid colour. */
.section--alt,
.section--deep,
.section--canvas { background: var(--bg-base); }

.section__head { max-width: 68ch; margin-bottom: var(--space-10); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .lead { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(var(--grid-cols), 1fr); }
.cols-2 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, 1fr); }
.cols--stretch { align-items: stretch; }
.cols--stretch > .stretch { display: flex; }
.cols--stretch > .stretch > .console { flex: 1; display: flex; flex-direction: column; }
.cols--stretch > .stretch .log { max-height: none; flex: 1; }
.cols-3 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(3, 1fr); }
.cols-4 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(4, 1fr); }
.split  { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: 1fr 1fr; align-items: center; }
.split--reverse > :first-child { order: 2; }
.split--top { align-items: start; }
.workspace { display: grid; gap: var(--panel-gap); grid-template-columns: 1fr 340px; align-items: start; }
.span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.stack > * + * { margin-top: var(--stack); }
.flow > * + * { margin-top: var(--space-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Panels / surfaces ---------- */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--panel-pad);
  border: 1px solid var(--border-subtle);
}
.panel--raised { background: var(--surface-2); }
.panel--flush { padding: 0; overflow: hidden; }
.panel--hover { transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.panel--hover:hover { transform: translateY(-3px); border-color: var(--border-strong);
  border: 1px solid var(--border-subtle); }
.panel__title { margin: 0 0 var(--space-2); font-size: var(--fs-h4); }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.panel__head h3 { margin: 0; font-size: var(--fs-small); font-family: var(--font-mono); letter-spacing: 0.02em; }
.panel__body { padding: var(--panel-pad); }

.console {
  background: var(--canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-width: 0;
  border: 1px solid var(--border-subtle);
}
.console::before {
  content: ""; position: absolute; inset: 0; background: none;
  pointer-events: none;
}
.console > * { position: relative; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-body);
  line-height: 1; min-height: 44px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-default); }
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--fs-small); }

/* ---------- Status chip (color + dot/glyph + label — never color alone) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  color: var(--text-secondary); background: var(--surface-2);
  white-space: nowrap;
}
.chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: none;
}
.chip .glyph { font-size: 0.75rem; line-height: 1; }
.chip--queued  { color: var(--st-queued);  background: var(--st-queued-soft);  border-color: var(--st-queued); }
.chip--running { color: var(--st-running); background: var(--st-running-soft); border-color: var(--st-running); }
.chip--waiting { color: var(--st-waiting); background: var(--st-waiting-soft); border-color: var(--st-waiting); }
.chip--approve { color: var(--st-approve); background: var(--st-approve-soft); border-color: var(--st-approve); }
.chip--success { color: var(--st-success); background: var(--st-success-soft); border-color: var(--st-success); }
.chip--failed  { color: var(--st-failed);  background: var(--st-failed-soft);  border-color: var(--st-failed); }
.chip--blocked { color: var(--st-blocked); background: var(--st-blocked-soft); border-color: var(--st-blocked); }
.chip--queued .dot { border-radius: 1px; }
.chip--approve .dot { border-radius: 1px; transform: rotate(45deg); }
.chip--failed .dot { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.chip--running .dot { animation: pulse var(--pulse) var(--ease-in-out) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.55); } }

.tag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill); padding: var(--space-1) var(--space-3);
}

/* ---------- Navbar ---------- */
/* The header is the page canvas: solid, unblurred, and it draws no rule. */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-base);
}
.site-header.is-scrolled { background: var(--bg-base); }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  color: var(--text-primary); text-decoration: none; font-weight: 700;
  letter-spacing: -0.02em; font-size: 1.0625rem; flex: none;
}
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__logo { display: block; height: 30px; width: auto; }
.nav__list { display: flex; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav__list li { margin: 0; }
.nav__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text-secondary); text-decoration: none;
  font-size: var(--fs-small); font-weight: 500;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav__link:hover { color: var(--text-primary); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--text-primary); background: var(--surface-2); }
.nav__caret { width: 10px; height: 10px; transition: transform var(--dur-fast) var(--ease-out); }
.nav__link[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: var(--space-2); }

.has-menu { position: relative; }
.megamenu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 110;
  min-width: 560px; padding: var(--space-5);
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);  display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5);
}
.megamenu.is-open { display: grid; }
.megamenu h4 { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-3); }
.megamenu ul { list-style: none; margin: 0; padding: 0; }
.megamenu li { margin: 0; }
.megamenu a {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none; font-size: var(--fs-small);
}
.megamenu a:hover { background: var(--surface-2); color: var(--text-primary); }
.megamenu a span { display: block; color: var(--text-muted); font-size: var(--fs-micro); margin-top: 2px; }

.kbd {
  font-family: var(--font-mono); font-size: var(--fs-micro);
  background: var(--surface-3); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 2px 6px; color: var(--text-secondary);
}
.nav__hamburger { display: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 120; background: var(--bg-base);
  padding: var(--space-6) var(--gutter) var(--space-16);
  overflow-y: auto; display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li { margin: 0; }
.mobile-menu a {
  display: block; padding: var(--space-4) var(--space-2); color: var(--text-primary);
  text-decoration: none; font-size: var(--fs-h4); font-weight: 500;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu a.btn { display: inline-flex; font-size: var(--fs-body); }
.mobile-menu a.btn-primary, .mobile-menu a.btn-primary:hover { color: var(--text-on-accent); }
.mobile-menu__group { margin-bottom: var(--space-6); }
.mobile-menu__group > h4 {
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-1);
}

@media (max-width: 1080px) {
  .nav__list, .nav__actions .btn-primary, .cmdk-trigger { display: none; }
  .nav__hamburger { display: inline-flex; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb { padding-top: var(--space-6); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0;
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted); }
.breadcrumb li { margin: 0; display: flex; gap: var(--space-2); align-items: center; }
.breadcrumb li + li::before { content: "/"; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 5vw, 72px) clamp(48px, 5vw, 80px); position: relative; isolation: isolate; }
.hero::before, .hero::after { content: none; }
.hero__grid > * { min-width: 0; }
.hero__grid { display: grid; gap: clamp(32px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; }
.hero h1 { font-size: var(--fs-display); line-height: 1.06; }
.hero .lead { font-size: var(--fs-lead); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin-top: var(--space-8); align-items: center;
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase; }
.hero__meta span { display: inline-flex; align-items: center; gap: var(--space-2); }
@media (max-width: 1024px) { .hero__grid { grid-template-columns: 1fr; } }

/* ---------- Agent graph (inline SVG) ---------- */
.graph { width: 100%; height: auto; display: block; }
.graph__wrap { padding: var(--space-5) var(--space-5) var(--space-4); overflow-x: auto; min-width: 0; }
.graph .edge { stroke: var(--edge); stroke-width: 1.5; fill: none; }
.graph .edge--dashed { stroke-dasharray: 6 6; }
.graph .edge--active { stroke: var(--edge-active); stroke-width: 1.75; }
.graph .edge--wrap { stroke: var(--edge-wrap); stroke-width: 1.5; stroke-dasharray: 5 5; }
.graph .node-box { fill: var(--node-bg); stroke: var(--node-border); stroke-width: 1; rx: 8; }
.graph .node.is-active .node-box { stroke: var(--node-active); stroke-width: 1.75; }
.graph .node.is-done .node-box { fill: var(--surface-2); }
.graph .node .node-box { transition: stroke var(--dur-base) var(--ease-out), fill var(--dur-base) var(--ease-out); }
.graph .node:hover .node-box { stroke: var(--border-strong); fill: var(--surface-3); }
.graph .node[aria-pressed="true"] .node-box { stroke: var(--accent); stroke-width: 1.75; }
.graph .node-label { font-family: var(--font-mono); font-size: 12px; fill: var(--text-primary); font-weight: 500; }
.graph .node-sub { font-family: var(--font-mono); font-size: 10px; fill: var(--text-muted); letter-spacing: 0.04em; }
.graph .node-status { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.07em; font-weight: 600; }
.graph .node:focus-visible .node-box { stroke: var(--ring); stroke-width: 2; }
.graph .lane-label { font-family: var(--font-mono); font-size: 9px; fill: var(--text-faint);
  letter-spacing: 0.1em; text-transform: uppercase; }
.graph .grid-line { stroke: var(--grid-line); stroke-width: 1; }
.st-queued  { fill: var(--st-queued); }
.st-running { fill: var(--st-running); }
.st-waiting { fill: var(--st-waiting); }
.st-approve { fill: var(--st-approve); }
.st-success { fill: var(--st-success); }
.st-failed  { fill: var(--st-failed); }

/* ---------- Run timeline (<ol>) ---------- */
.run { list-style: none; margin: 0; padding: 0; position: relative; }
.run > li { position: relative; margin: 0; padding: 0 0 var(--step-gap) var(--space-10); }
.run > li::before {
  content: ""; position: absolute; left: 15px; top: 22px; bottom: 0;
  width: 1px; background: var(--border-default);
}
.run > li:last-child::before { display: none; }
.run > li.is-done::before { background: var(--run-done); }
.run__dot {
  position: absolute; left: 8px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface-1);
}
.run > li.is-done .run__dot { border-color: var(--st-success); background: var(--st-success); }
.run > li.is-active .run__dot { border-color: var(--st-running); background: var(--st-running); }
.run > li.is-approve .run__dot { border-color: var(--st-approve); background: var(--st-approve); }
.run__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.run__idx { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint); }
.run__name { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-primary); font-weight: 600; }
.run__dur { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-left: auto; }
.run__detail { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--text-muted); max-width: 62ch; }
.run__agent { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent); }

/* ---------- Tool-call stream / console log ---------- */
.log {
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.55;
  padding: var(--space-4); margin: 0; max-height: 340px; min-height: 340px; overflow-y: auto;
  scrollbar-width: thin;
  color: var(--text-secondary); list-style: none;
}
.log li { margin: 0; padding: var(--log-line-y) 0; display: flex; gap: var(--space-3); align-items: flex-start; }
.log .ts { color: var(--text-faint); font-size: var(--fs-micro); flex: none; padding-top: 2px; min-width: 68px; }
.log .arrow { color: var(--text-faint); flex: none; }
.log .call { color: var(--text-primary); }
.log .fn { color: var(--accent); }
.log .ret { color: var(--text-muted); }
.log .ok { color: var(--st-success); }
.log .warnline { color: var(--st-approve); }
.log__body { min-width: 0; word-break: break-word; }
.console__bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.console__bar .dots { display: flex; gap: 6px; }
.console__bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); display: block; }
.console__bar .spacer { flex: 1; }

/* ---------- Reasoning trace ---------- */
.trace { font-family: var(--font-mono); font-size: var(--fs-mono); }
.trace details {
  border-bottom: 1px solid var(--border-subtle);
}
.trace details:last-child { border-bottom: 0; }
.trace summary {
  cursor: pointer; padding: var(--space-3) var(--space-2); min-height: 44px;
  display: flex; align-items: center; gap: var(--space-3); color: var(--text-primary);
  list-style: none;
}
.trace summary::-webkit-details-marker { display: none; }
.trace summary::before { content: "▸"; color: var(--text-faint); }
.trace details[open] summary::before { content: "▾"; }
.trace__kind {
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: var(--fs-micro); min-width: 76px;
}
.trace__body { padding: 0 var(--space-2) var(--space-4) var(--space-8); color: var(--text-muted);
  font-size: var(--fs-mono); line-height: 1.6; }

/* ---------- Inspector ---------- */
@media (min-width: 981px) {
  .inspector { position: sticky; top: calc(var(--nav-h) + var(--space-6)); align-self: start; }
}
.inspector dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4);
  margin: 0; font-family: var(--font-mono); font-size: var(--fs-small); }
.inspector dt { color: var(--text-muted); font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; }
.inspector dd { margin: 0; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Generic definition list inside panels (contact routes, spec pairs) */
.panel > dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-3) var(--space-5); margin: var(--space-4) 0 0; align-items: baseline; }
.panel > dl > dt { color: var(--text-secondary); font-size: var(--fs-small); }
.panel > dl > dd { margin: 0; color: var(--text-primary); font-size: var(--fs-small); overflow-wrap: anywhere; }
.panel > dl + p { margin-top: var(--space-5); }
@media (max-width: 480px) { .panel > dl { grid-template-columns: 1fr; gap: 2px var(--space-4); }
  .panel > dl > dd { margin-bottom: var(--space-3); } }

/* ---------- Command palette ---------- */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-muted);
  padding: var(--space-2) var(--space-3); min-height: 36px; cursor: pointer;
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.04em;
}
.cmdk-trigger:hover { color: var(--text-primary); border-color: var(--border-strong); }
.cmdk {
  position: fixed; inset: 0; z-index: 150; display: none;
  align-items: flex-start; justify-content: center;
  padding: clamp(48px, 12vh, 140px) var(--space-4) var(--space-4);
  background: var(--scrim);
}
.cmdk.is-open { display: flex; }
.cmdk__panel {
  width: 100%; max-width: 620px; background: var(--surface-1);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden;
}
.cmdk__input {
  width: 100%; border: 0; background: var(--surface-1); color: var(--text-primary);
  font-family: var(--font-mono); font-size: var(--fs-body); padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle); outline: none;
}
.cmdk__list { list-style: none; margin: 0; padding: var(--space-2); max-height: 44vh; overflow-y: auto; }
.cmdk__group { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); padding: var(--space-3) var(--space-3) var(--space-1); }
.cmdk__opt {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer; font-size: var(--fs-small); margin: 0;
}
.cmdk__opt .mono { color: var(--text-faint); font-size: var(--fs-micro); margin-left: auto; }
.cmdk__opt.is-active, .cmdk__opt:hover { background: var(--surface-3); color: var(--text-primary); }
.cmdk__foot { display: flex; gap: var(--space-4); padding: var(--space-3) var(--space-5);
  background: var(--surface-2); font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint); }

/* ---------- Metrics / stats ---------- */
.metric { display: block; font-family: var(--font-mono); font-size: var(--fs-metric);
  font-weight: 600; color: var(--text-primary); line-height: 1; letter-spacing: -0.02em; }
.metric__label { display: block; margin-top: var(--space-3); font-size: var(--fs-small); color: var(--text-muted); }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4);
  min-height: 168px; padding: var(--space-6); }
.stat .metric { letter-spacing: -0.035em; }
.stat .metric__label { margin-top: 0; text-wrap: balance; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-default); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
caption { text-align: left; padding: var(--space-4); color: var(--text-muted); font-size: var(--fs-small); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
thead th { background: var(--surface-2); color: var(--text-primary); font-family: var(--font-mono);
  font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody td { color: var(--text-secondary); }
td .mono, th .mono { font-family: var(--font-mono); }

/* ---------- Feature / card grids ---------- */
.card__icon { width: 32px; height: 32px; margin-bottom: var(--space-4); color: var(--accent); }
.card__meta { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; }
.card p:last-child { margin-bottom: 0; }
.card { display: flex; flex-direction: column; }
.card > .row { margin-top: auto; padding-top: var(--space-4); }
.card > .row + p { margin-top: var(--space-4) !important; }
/* Orchestrator / lead card fills the trailing grid row */
.card--lead { grid-column: 1 / -1; background: var(--surface-2); }
@media (min-width: 861px) {
  .card--lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-10); align-items: start; }
  .card--lead > .card__meta, .card--lead > h3, .card--lead > .small.muted { grid-column: 1; }
  .card--lead > p:not(.card__meta):not(.small) { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .card--lead > .row { grid-column: 2; margin-top: var(--space-4); padding-top: 0; }
  .card--lead > .row + p { grid-column: 2; }
}
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: var(--space-6); font-size: var(--fs-body); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--st-success);
  font-family: var(--font-mono); font-size: var(--fs-small);
}
.numlist { list-style: none; padding: 0; counter-reset: n; }
.numlist li { counter-increment: n; position: relative; padding-left: var(--space-10); margin-bottom: var(--space-5); }
.numlist li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 4px 6px; line-height: 1;
}

/* ---------- Bento ---------- */
.bento { display: grid; gap: var(--panel-gap); grid-template-columns: repeat(6, 1fr); }
.bento > * { grid-column: span 2; }
.bento .b-wide { grid-column: span 4; }
.bento .b-full { grid-column: span 6; }
.bento > .panel { display: flex; flex-direction: column; }
.bento .b-metric { justify-content: center; gap: var(--space-3); min-height: 156px; }
.bento .b-metric .metric__label { margin-top: 0; }
.bento .b-wide > .row, .bento .b-full > .row { margin-top: auto; padding-top: var(--space-5); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); }
  .bento > *, .bento .b-wide, .bento .b-full { grid-column: span 2; } }

/* ---------- Logos ---------- */
.logos { display: flex; flex-wrap: wrap; gap: clamp(20px, 3.2vw, 48px); align-items: center; justify-content: center; }
.section--strip { padding-block: clamp(32px, 3.6vw, 56px); }
.logos span {
  font-family: var(--font-mono); font-size: var(--fs-small); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}

/* ---------- Testimonials ---------- */
blockquote { margin: 0; }
blockquote p { color: var(--text-primary); font-size: var(--fs-body-lg); line-height: 1.55; }
cite { display: block; font-style: normal; font-family: var(--font-mono); font-size: var(--fs-micro);
  color: var(--text-muted); letter-spacing: 0.04em; margin-top: var(--space-4); }

/* ---------- Pricing ---------- */
.price__amount { font-size: var(--fs-price); font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; line-height: 1; display: block; }
.price__unit { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-top: var(--space-2); }
.tier--featured { border-color: var(--accent); }
.tier__badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 3px var(--space-3); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--text-on-accent);
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.tier { position: relative; display: flex; flex-direction: column; }
.tier .btn { width: 100%; margin-top: auto; }
.toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); padding: 4px; gap: 4px; }
.toggle label { position: relative; }
.toggle input { position: absolute; inset: 0; margin: 0; appearance: none; -webkit-appearance: none;
  background: none; border: 0; cursor: pointer; }
.toggle span { display: block; padding: var(--space-2) var(--space-5); border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); cursor: pointer; min-height: 32px; }
.toggle input:checked + span { background: var(--accent); color: var(--text-on-accent); }
.toggle input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- FAQ accordion ---------- */
.faq { max-width: var(--container-md); }
.faq__item + .faq__item { margin-top: var(--space-3); }
.faq__q {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 44px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--fs-body-lg); font-weight: 600;
  padding: var(--space-4) var(--space-5);
}
.faq__q:hover { background: var(--surface-2); }
.faq__q .sign { font-family: var(--font-mono); color: var(--text-muted); flex: none; }
.faq__a { padding: var(--space-4) var(--space-5) var(--space-2); }
.faq__a[hidden] { display: none; }

/* ---------- Code / terminal ---------- */
pre {
  margin: 0; padding: var(--space-5); overflow-x: auto;
  font-family: var(--font-mono); font-size: var(--fs-small); line-height: 1.6;
  color: var(--text-secondary); background: var(--canvas);
}
pre code { font-family: inherit; }
.tok-key { color: var(--accent); }
.tok-str { color: var(--st-success); }
.tok-com { color: var(--text-faint); }
.tok-fn  { color: var(--st-waiting); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: var(--space-5); }
.field > span { display: block; font-family: var(--font-mono); font-size: var(--fs-micro);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--fs-body);
}
textarea { min-height: 132px; resize: vertical; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-900); padding-block: var(--section-y) var(--space-10); }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: 1.4fr repeat(4, 1fr); }
.footer__grid h4 { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-4); }
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: var(--space-2); }
.footer__grid a { color: var(--text-secondary); text-decoration: none; font-size: var(--fs-small); }
.footer__grid a:hover { color: var(--text-primary); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center;
  justify-content: space-between; margin-top: var(--space-12);
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint);
}
.footer__status { display: inline-flex; align-items: center; gap: var(--space-2); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Motion helpers ---------- */
/* Reveals switch visibility and slide, never fade: nothing on the page is
   ever partly transparent. */
.js [data-reveal] { visibility: hidden; transform: translateY(14px);
  transition: visibility var(--dur-slow), transform var(--dur-slow) var(--ease-out); }
.js [data-reveal].in { visibility: visible; transform: none; }

/* Tool-call stream playback. Content is visible by default; JS only staggers it
   in, and the animation's fill state leaves every line readable if JS stops. */
@keyframes logIn { from { clip-path: inset(0 0 100% 0); transform: translateY(6px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.log.is-playing > li { animation: logIn 240ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 150ms); }
.log.is-paused > li { animation-play-state: paused; }
.offscreen-opt { content-visibility: auto; contain-intrinsic-size: 640px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .workspace { grid-template-columns: 1fr; }
  .span-8, .span-4, .span-5, .span-7, .span-6 { grid-column: span 12; }
}
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .split, .cols-2 { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
  .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .megamenu { min-width: 0; }
}

/* ---------- Mobile corrections (must win over later component rules) ---------- */
@media (max-width: 1080px) {
  .nav__list, .nav__actions .btn-primary, .cmdk-trigger { display: none; }
  .nav__hamburger { display: inline-flex; }
}
@media (max-width: 760px) {
  /* Keep the agent graph legible: scroll it rather than shrink it to nothing. */
  .graph { width: 720px; max-width: none; }
  .graph__wrap { padding-inline: var(--space-4); }
  .console__bar { font-size: var(--fs-micro); }
  .log { font-size: var(--fs-micro); min-height: 280px; }
  .stat { min-height: 132px; }
  .hero__meta { gap: var(--space-2) var(--space-4); }
}
@media (max-width: 520px) {
  .hero__cta .btn { width: 100%; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { visibility: visible; transform: none; }
  .log.is-playing > li { animation: none; }
  .chip--running .dot { animation: none; }
}

@media print {
  .site-header, .cmdk, .mobile-menu { display: none !important; }
  body { background: #fff; color: #000; }
}
