/* Basequel — site styles
   Tokens first (light default, dark via prefers-color-scheme or [data-theme]),
   then base, layout, components, sections, utilities. No framework. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --accent: #ff4f1a;            /* Signal — brand accent (fills) */
  --accent-ink: #0b0b0c;        /* text on accent fills (5.98:1) */
  --accent-text: #c2350a;       /* accent used as text on light (5.52:1) */
  --accent-soft: rgba(255, 79, 26, 0.1);

  --bg: #ffffff;
  --bg-alt: #f7f7f6;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --text: #0b0b0c;
  --text-2: #3a3a40;
  --muted: #56565e;             /* 7.27:1 on bg */
  --subtle: #6e6e77;            /* 5.05:1 on bg */
  --line: #e7e7e5;
  --line-strong: #d5d5d2;
  --ok: #0f7b3f;
  --danger: #b42318;
  --code-bg: #0b0b0c;
  --code-text: #e9e9ec;
  --code-muted: #8d8d97;
  --shadow: 0 1px 0 rgba(11, 11, 12, 0.04), 0 12px 32px -12px rgba(11, 11, 12, 0.12);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-text);
  --header-bg: rgba(255, 255, 255, 0.78);
  --grid-line: rgba(11, 11, 12, 0.055);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 10px;
  --radius-lg: 16px;
  --section-y: clamp(80px, 11vw, 144px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent-text: #ff6a3d;
    --accent-soft: rgba(255, 79, 26, 0.12);
    --bg: #08090a;
    --bg-alt: #0c0d0f;
    --surface: #0e0f11;
    --surface-2: #141518;
    --text: #ededef;
    --text-2: #c9c9ce;
    --muted: #a1a1aa;
    --subtle: #85858f;
    --line: #1d1e22;
    --line-strong: #2a2b30;
    --ok: #3ccf7a;
    --danger: #ff7a6b;
    --code-bg: #0b0c0e;
    --code-text: #e9e9ec;
    --code-muted: #8d8d97;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    --header-bg: rgba(8, 9, 10, 0.72);
    --grid-line: rgba(255, 255, 255, 0.045);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent-text: #ff6a3d;
  --accent-soft: rgba(255, 79, 26, 0.12);
  --bg: #08090a;
  --bg-alt: #0c0d0f;
  --surface: #0e0f11;
  --surface-2: #141518;
  --text: #ededef;
  --text-2: #c9c9ce;
  --muted: #a1a1aa;
  --subtle: #85858f;
  --line: #1d1e22;
  --line-strong: #2a2b30;
  --ok: #3ccf7a;
  --danger: #ff7a6b;
  --code-bg: #0b0c0e;
  --code-text: #e9e9ec;
  --code-muted: #8d8d97;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(8, 9, 10, 0.72);
  --grid-line: rgba(255, 255, 255, 0.045);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
:not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.86em;
  white-space: nowrap;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.sr-only {
  position: absolute !important; 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: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.frame { position: relative; }
/* Vertical rails: the strong grid that holds the page together */
.rails { position: relative; }
.rails::before, .rails::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); pointer-events: none;
}
.rails::before { left: max(var(--gutter), calc(50% - var(--max) / 2)); }
.rails::after { right: max(var(--gutter), calc(50% - var(--max) / 2)); }

.section { padding-block: var(--section-y); border-top: 1px solid var(--line); position: relative; }
.section--alt { background: var(--bg-alt); }
.section__head { display: grid; gap: 20px; max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section__head--split {
  max-width: none; grid-template-columns: 1fr; align-items: end;
}
@media (min-width: 960px) {
  .section__head--split { grid-template-columns: 1.15fr 1fr; gap: 64px; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);   /* the mark's right-pointing triangle */
}
.h1 {
  font-size: clamp(2.1rem, 0.8rem + 4.4vw, 4.1rem);
  line-height: 0.98; letter-spacing: -0.048em; font-weight: 600;
}
.h2 {
  font-size: clamp(2rem, 1.25rem + 2.9vw, 3.4rem);
  line-height: 1.02; letter-spacing: -0.042em;
}
.h3 { font-size: 1.125rem; letter-spacing: -0.015em; line-height: 1.3; }
.lede { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); color: var(--muted); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--muted); }
.accent { color: var(--accent-text); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 9px;
  border: 1px solid transparent;
  font: 500 0.9375rem/1 var(--font-sans); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.btn:hover { color: inherit; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #ff6232; color: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--invert { background: var(--text); color: var(--bg); }
.btn--invert:hover { color: var(--bg); opacity: 0.9; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 0.875rem; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { height: 26px; width: auto; }
.brand__word { font-weight: 600; font-size: 1.125rem; letter-spacing: -0.03em; }
.nav { display: none; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 450; transition: color 0.15s, background-color 0.15s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 16px; height: 16px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.header-cta-label--short { display: inline; }
.header-cta-label--long { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; }
}
@media (min-width: 520px) {
  .header-cta-label--short { display: none; }
  .header-cta-label--long { display: inline; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 120px); overflow: hidden; }
.hero__grid { display: grid; gap: clamp(48px, 6vw, 72px); align-items: center; }
@media (min-width: 1040px) { .hero__grid { grid-template-columns: 1.12fr 0.88fr; } }
.hero__copy { display: grid; gap: 28px; position: relative; z-index: 1; }
.hero__copy .lede { max-width: 34em; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  padding: 5px 12px 5px 6px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 0.8125rem; color: var(--muted); background: var(--surface); text-decoration: none;
}
.pill:hover { color: var(--text); }
.pill__tag {
  padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font: 500 0.6875rem/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.trust {
  display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none;
  font-size: 0.8125rem; color: var(--muted);
}
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust svg { width: 14px; height: 14px; color: var(--accent-text); flex: none; }
.hero__motif {
  position: absolute; z-index: 0; pointer-events: none;
  right: -120px; top: -40px; height: 130%; width: auto; opacity: 1;
  color: var(--grid-line);
}
@media (max-width: 1039px) { .hero__motif { right: -260px; height: 90%; } }

/* Inline capture */
.capture { display: grid; gap: 10px; max-width: 520px; }
.capture__row {
  display: flex; gap: 6px; padding: 6px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.capture__row:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.capture__row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; background: transparent;
  color: var(--text); font: 400 1rem var(--font-sans);
}
.capture__row input::placeholder { color: var(--subtle); }
.capture__row input:focus-visible { outline: none; }
.form-note { font-size: 0.8125rem; color: var(--muted); }
.form-note a { color: inherit; }
@media (max-width: 479px) {
  .capture__row { flex-direction: column; padding: 6px; }
  .capture__row .btn { width: 100%; }
}

/* Status / messages */
.form-status { font-size: 0.875rem; min-height: 1.4em; }
.form-status[data-state="error"] { color: var(--danger); }
.form-status[data-state="sending"] { color: var(--muted); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.success {
  display: grid; gap: 14px; padding: 22px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow);
  animation: pop 0.5s var(--ease) both;
}
.success__title { display: flex; align-items: center; gap: 12px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }
.success__tick {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); flex: none;
}
.success__tick svg { width: 16px; height: 16px; }
.success__tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.5s 0.2s var(--ease) forwards; }
.success__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Panels (product UI) ---------- */
.panel {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.panel__bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font: 500 0.75rem/1 var(--font-mono); color: var(--muted);
}
.panel__bar .dots { display: flex; gap: 6px; flex: none; }
.panel__bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.panel__bar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel__bar .tag { flex: none; margin-left: auto; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
.stack { list-style: none; }
.stack li {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.stack li:last-child { border-bottom: 0; }
.stack svg { width: 18px; height: 18px; color: var(--muted); }
.stack .meta { font: 400 0.75rem var(--font-mono); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.panel__foot {
  display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted);
}
.panel__foot div { padding: 12px 18px; display: grid; gap: 2px; }
.panel__foot div + div { border-left: 1px solid var(--line); }
.panel__foot b { color: var(--text); font-weight: 500; font-size: 0.82rem; }

/* Code */
.code {
  margin: 0; padding: 18px 20px; overflow-x: auto; background: var(--code-bg); color: var(--code-text);
  font: 400 0.8125rem/1.75 var(--font-mono); tab-size: 2;
}
.code .c { color: var(--code-muted); }
.code .k { color: #ff8a5c; }
.code .s { color: #b9e4c9; }
.code .o { color: #3ccf7a; }
.code .a { color: #ff8a5c; }
.code .w { color: #f5c26b; }
.panel--code { background: var(--code-bg); border-color: #24252a; }
.panel--code .panel__bar { border-bottom-color: #1f2024; color: var(--code-muted); }
.panel--code .panel__bar .dots i { background: #2c2d33; }
.panel--code .panel__bar .tag { border-color: #24252a; }

.hero__visual { position: relative; z-index: 1; display: grid; gap: 14px; }
.hero__visual .panel--code { margin-left: clamp(0px, 4vw, 48px); }
@media (max-width: 1039px) { .hero__visual .panel--code { margin-left: 0; } }

/* ---------- Proof strip ---------- */
.proof { border-top: 1px solid var(--line); }
.proof__inner {
  display: grid; grid-template-columns: 1fr; align-items: center;
}
.proof__label { padding: 22px 0 6px; font-size: 0.8125rem; color: var(--muted); }
.proof__list { display: grid; grid-template-columns: repeat(2, 1fr); list-style: none; }
.proof__list li { padding: 14px 0 16px; display: grid; gap: 2px; }
.proof__name { font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.45rem); font-weight: 600; letter-spacing: -0.035em; color: var(--text); }
.proof__url { font: 400 0.75rem var(--font-mono); color: var(--muted); }
.proof__url a { text-decoration: none; }
@media (min-width: 860px) {
  .proof__inner { grid-template-columns: 240px 1fr; }
  .proof__label { padding: 0; }
  .proof__list { grid-template-columns: repeat(3, 1fr); }
  .proof__list li { padding: 24px 28px; border-left: 1px solid var(--line); }
  .proof__list li:nth-child(n+4) { border-top: 1px solid var(--line); }
}

/* ---------- Problem ---------- */
.cards-3 { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 820px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); padding: clamp(24px, 3vw, 36px); display: grid; gap: 12px; align-content: start; }
.card__num { font: 500 0.75rem var(--font-mono); color: var(--accent-text); letter-spacing: 0.06em; }
.card p { color: var(--muted); }
.resolve {
  margin-top: clamp(32px, 4vw, 48px); display: grid; gap: 20px; align-items: center;
  padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-lg);
  background: var(--text); color: var(--bg);
}
.resolve p { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); letter-spacing: -0.025em; line-height: 1.35; font-weight: 500; }
.resolve p span { opacity: 0.62; }
@media (min-width: 900px) { .resolve { grid-template-columns: 1fr auto; } }

/* ---------- Features ---------- */
.features { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { background: var(--surface); padding: 28px 26px 30px; display: grid; gap: 10px; align-content: start; min-height: 200px; position: relative; }
.feature__icon {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line-strong); color: var(--text); margin-bottom: 8px; background: var(--bg);
}
.feature__icon svg { width: 18px; height: 18px; }
.feature p { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.feature--lead { background: var(--surface); }
@media (min-width: 640px) { .feature--lead { grid-column: span 2; } }
@media (min-width: 1040px) { .feature--wide { grid-column: span 3; } }
.feature--lead .h3, .feature--wide .h3 { font-size: 1.375rem; letter-spacing: -0.03em; }
.feature__tag { font: 500 0.6875rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); }

/* ---------- Steps (migration) ---------- */
.split { display: grid; gap: clamp(40px, 5vw, 72px); align-items: start; }
@media (min-width: 1040px) { .split { grid-template-columns: 0.9fr 1.1fr; } .split--rev { grid-template-columns: 1.05fr 0.95fr; } }
.steps { list-style: none; display: grid; counter-reset: step; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: "0" counter(step); grid-row: span 2;
  font: 500 0.8125rem var(--font-mono); color: var(--accent-text); padding-top: 3px;
}
.steps p { color: var(--muted); font-size: 0.9375rem; }
.checklist { list-style: none; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; color: var(--text-2); font-size: 0.9375rem; }
.checklist svg { width: 16px; height: 16px; margin-top: 4px; color: var(--accent-text); }
.log { list-style: none; font: 400 0.8125rem/1.6 var(--font-mono); color: var(--code-text); padding: 18px 20px; display: grid; gap: 6px; }
.log li { display: grid; grid-template-columns: 16px 140px 1fr; gap: 10px; }
.log .ok { color: #3ccf7a; }
.log .arr { color: #ff8a5c; }
.log .n { color: var(--code-muted); }
@media (max-width: 520px) { .log li { grid-template-columns: 16px 1fr; } .log li .n { grid-column: 2; } }
.note { font-size: 0.8125rem; color: var(--muted); }

/* ---------- Agents ---------- */
.agent-points { list-style: none; display: grid; gap: 0; }
.agent-points li { display: grid; grid-template-columns: 36px 1fr; gap: 4px 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.agent-points li:last-child { border-bottom: 1px solid var(--line); }
.agent-points .feature__icon { margin: 0; grid-row: span 2; width: 34px; height: 34px; }
.agent-points p { color: var(--muted); font-size: 0.9375rem; }
.chat { padding: 18px; display: grid; gap: 14px; font-size: 0.875rem; }
.msg { display: grid; gap: 6px; max-width: 92%; }
.msg__who { font: 500 0.6875rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.msg__body { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); line-height: 1.5; }
.msg--user { justify-self: end; }
.msg--user .msg__body { background: var(--text); color: var(--bg); border-color: transparent; }
.msg--user .msg__who { text-align: right; }
.tools { list-style: none; display: grid; gap: 6px; }
.tool {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg);
  font: 400 0.78rem var(--font-mono); color: var(--text-2);
}
.tool__fn { color: var(--text); font-weight: 500; }
.tool__arg { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool__badge { font-size: 0.6875rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); }
.tool__badge--ro { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tool__badge--lock { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 40%, transparent); }
.tool::before { content: ""; width: 6px; height: 6px; background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.audit { border-top: 1px solid var(--line); }
.audit table { width: 100%; border-collapse: collapse; font: 400 0.75rem var(--font-mono); }
.audit caption { text-align: left; padding: 12px 18px 4px; font: 500 0.6875rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.audit th, .audit td { text-align: left; padding: 7px 18px; border-top: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.audit th { color: var(--muted); font-weight: 400; }
.audit-wrap { overflow-x: auto; }

/* ---------- Security ---------- */
.sec-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 720px) { .sec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .sec-grid { grid-template-columns: repeat(3, 1fr); } }
.sec { background: var(--surface); padding: 28px 26px; display: grid; gap: 10px; align-content: start; }
.sec p { color: var(--muted); font-size: 0.9375rem; }
.sec__k { font: 500 0.75rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.sec .sec__v { color: var(--text); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.timeline { margin-top: clamp(32px, 4vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(20px, 3vw, 32px); display: grid; gap: 18px; }
.timeline__head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: baseline; }
.timeline__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; list-style: none; }
.timeline__days li {
  position: relative; display: grid; gap: 8px; padding: 12px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); font: 400 0.6875rem var(--font-mono); color: var(--muted);
}
.timeline__days li b { font-weight: 500; color: var(--text); font-size: 0.75rem; }
.bar { height: 6px; border-radius: 3px; background: var(--text); opacity: 0.85; }
.timeline__days li.is-test { border-color: var(--accent); background: var(--accent-soft); }
.timeline__days li.is-test .bar { background: var(--accent); opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.8125rem; color: var(--muted); list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 6px; border-radius: 3px; background: var(--text); display: inline-block; }
.legend i.t { background: var(--accent); }
@media (max-width: 560px) {
  .timeline__days { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .timeline__days li { padding: 8px 4px; text-align: center; }
  .timeline__days li span { display: none; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 960px) { .faq { grid-template-columns: 0.8fr 1.2fr; } }
.faq__list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 10px; height: 10px; flex: none; background: var(--muted);
  clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(90deg); background: var(--accent-text); }
.faq summary:hover { color: var(--accent-text); }
.faq details > div { padding: 0 0 24px; color: var(--muted); max-width: 64ch; display: grid; gap: 10px; }

/* ---------- Final CTA / waitlist ---------- */
.cta { position: relative; overflow: hidden; }
.cta__grid { display: grid; gap: clamp(40px, 5vw, 72px); align-items: start; }
@media (min-width: 1040px) { .cta__grid { grid-template-columns: 1fr 1fr; } }
.cta__copy { display: grid; gap: 22px; align-content: start; }
.form { display: grid; gap: 16px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.form__row { display: grid; gap: 16px; }
@media (min-width: 560px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); padding: 0; }
.field .opt { color: var(--subtle); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: 400 1rem var(--font-sans); transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented label {
  position: relative; display: grid; place-items: center; min-height: 44px; padding: 8px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; font-size: 0.875rem; color: var(--text-2); background: var(--bg);
  line-height: 1.2;
}
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented label:has(input:checked) { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.form__foot { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.form__foot .form-note { max-width: 36ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px 40px; font-size: 0.875rem; }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 820px) { .footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer__grid h2 { font: 500 0.75rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
.footer__grid ul { list-style: none; display: grid; gap: 8px; }
.footer__grid a { color: var(--text-2); text-decoration: none; }
.footer__grid a:hover { color: var(--accent-text); }
.footer__brand { display: grid; gap: 14px; align-content: start; }
.footer__brand p { color: var(--muted); max-width: 34ch; }
.footer__base { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: 0.8125rem; }
.footer__mark { margin-top: 56px; color: var(--line); }
.footer__mark svg { display: block; }
.footer__mark svg { width: 100%; height: auto; }

/* ---------- Subpages ---------- */
.page-hero { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(48px, 6vw, 80px); position: relative; overflow: hidden; }
.page-hero .h1 { font-size: clamp(2.4rem, 1.2rem + 4.6vw, 4.6rem); max-width: 16ch; }
.page-hero__inner { display: grid; gap: 24px; position: relative; z-index: 1; }
.prose { max-width: 70ch; display: grid; gap: 18px; color: var(--text-2); }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.03em; margin-top: 24px; color: var(--text); }
.prose h3 { font-size: 1.125rem; margin-top: 8px; color: var(--text); }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose li::marker { color: var(--accent-text); }
.breadcrumb { font: 400 0.75rem var(--font-mono); color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; gap: 8px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--subtle); }
.breadcrumb a { text-decoration: none; }

.conn { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 900px) { .conn { grid-template-columns: repeat(3, 1fr); } }
.conn .card .h3 { font-size: 1.25rem; }
.flow { list-style: none; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; counter-reset: flow; }
@media (min-width: 900px) { .flow { grid-template-columns: repeat(3, 1fr); } }
.flow li { background: var(--surface); padding: 28px; counter-increment: flow; display: grid; gap: 10px; align-content: start; }
.flow li::before { content: "0" counter(flow); font: 500 0.75rem var(--font-mono); color: var(--accent-text); }
.flow p { color: var(--muted); font-size: 0.9375rem; }
.scopes { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.scopes th, .scopes td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scopes th { font: 500 0.75rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.scopes td:first-child { white-space: nowrap; font-weight: 500; }
.scopes td { color: var(--text-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

/* Brand page */
.swatches { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .swatches { grid-template-columns: repeat(4, 1fr); } }
.swatch { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); font-size: 0.8125rem; }
.swatch__chip { height: 88px; border-bottom: 1px solid var(--line); }
.swatch__meta { padding: 10px 12px; display: grid; gap: 2px; }
.swatch__meta b { font-weight: 500; }
.swatch__meta span { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; }
.logo-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 760px) { .logo-grid { grid-template-columns: repeat(2, 1fr); } }
.logo-tile { display: grid; gap: 18px; padding: 24px; align-content: space-between; min-height: 240px; }
.logo-tile--light { background: #ffffff; color: #0b0b0c; }
.logo-tile--dark { background: #0b0b0c; color: #ededef; }
.logo-tile--accent { background: #ff4f1a; color: #0b0b0c; }
.logo-tile__art { display: grid; place-items: center; min-height: 140px; }
.logo-tile__art img { max-height: 96px; width: auto; }
.logo-tile__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font-size: 0.8125rem; }
.logo-tile__meta a { font-family: var(--font-mono); font-size: 0.75rem; padding: 5px 9px; border-radius: 6px; border: 1px solid currentColor; text-decoration: none; opacity: 0.85; }
.logo-tile__meta a:hover { opacity: 1; color: inherit; }
.type-scale { display: grid; border-top: 1px solid var(--line); }
.type-scale div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); overflow: hidden; }
.type-scale span { font: 400 0.75rem var(--font-mono); color: var(--muted); }
.type-scale p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rules { display: grid; gap: 12px; }
@media (min-width: 760px) { .rules { grid-template-columns: repeat(3, 1fr); } }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--surface); display: grid; gap: 10px; align-content: start; }
.rule p { color: var(--muted); font-size: 0.9375rem; }
.rule figure { margin: 0; display: grid; place-items: center; min-height: 150px; background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 8px; }

/* 404 */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 80px; }
.nf__inner { display: grid; gap: 22px; justify-items: center; }
.nf__code { font: 500 0.875rem var(--font-mono); color: var(--accent-text); letter-spacing: 0.1em; }

/* ---------- Reveal motion (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .success__tick path { stroke-dashoffset: 0; }
}

@media print {
  .site-header, .capture, .form, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Utilities (no inline styles: CSP style-src 'self') ---------- */
.u-row { display: flex; flex-wrap: wrap; gap: 10px; }
.u-center { justify-content: center; }
.u-mid { align-items: center; }
.u-end { align-items: flex-end; }
.u-gap6 { gap: 6px; }
.u-gap22 { gap: 22px; }
.u-stack12 { display: grid; gap: 12px; }
.u-stack20 { display: grid; gap: 20px; }
.u-stack28 { display: grid; gap: 28px; align-content: start; }
.u-fs13 { font-size: 0.8125rem; }
.u-h20 { height: 20px; width: auto; }
.u-h60 { height: 60px; width: auto; }
.u-js-start { justify-self: start; }
.u-mt12 { margin-top: 12px; }
.u-mt14 { margin-top: 14px; }
.u-mt16 { margin-top: 16px; }
.u-mt40 { margin-top: 40px; }
.u-mt-lg { margin-top: clamp(32px, 4vw, 48px); }
.u-m0 { margin: 0; }
.u-ac-start { align-content: start; }
.ts-xl { font-size: clamp(2rem, 1rem + 3vw, 3.6rem); font-weight: 600; letter-spacing: -0.048em; line-height: 1; }
.ts-display { font-size: clamp(1.6rem, 1rem + 1.6vw, 2.4rem); font-weight: 600; letter-spacing: -0.042em; line-height: 1.05; }
.ts-heading { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.03em; }
.sw-signal { background: #ff4f1a; } .sw-signal-l { background: #c2350a; } .sw-signal-d { background: #ff6a3d; }
.sw-ink { background: #0b0b0c; } .sw-paper { background: #ffffff; } .sw-night { background: #08090a; }
.sw-muted-l { background: #56565e; } .sw-muted-d { background: #a1a1aa; }
:root[data-theme="dark"] .bq-adapt { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bq-adapt { filter: invert(1); } }

/* Grid children may shrink below their min-content width */
.hero__grid > *, .split > *, .cta__grid > *, .faq > *, .section__head--split > * { min-width: 0; }
.nowrap { white-space: nowrap; }
.btn > svg:not(.arrow) { width: 16px; height: 16px; flex: none; }
