/* CallAgent — grey/white/black, with yellow used sparingly as an accent.
   1px borders over heavy shadows, fluid spacing, and type doing most of the work. */

/* Self-hosted variable fonts (SIL OFL). Loading them from Google would send every
   visitor's IP address to Google before any consent could be asked. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("/static/fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
             src: url("/static/fonts/jetbrains-mono.woff2") format("woff2"); }

:root {
  --bg:          #FFFFFF;
  --bg-subtle:   #FAFAFA;
  --bg-inset:    #F4F4F5;
  --fg:          #0A0A0A;
  --fg-muted:    #5F5F66;
  --fg-faint:    #8E8E96;
  --border:      #E7E7EA;
  --border-firm: #D4D4D8;
  --accent:      #F5C518;
  --accent-hover:#E8B800;
  --accent-ink:  #0A0A0A;   /* text ON yellow — always near-black, never white */
  --accent-soft: #FEF7DB;
  --ink:         #0B0B0C;   /* dark bands */
  --ink-fg:      #F4F4F5;
  --ink-muted:   #A1A1AA;
  --ink-border:  #26262B;

  --radius:   10px;
  --radius-s: 7px;
  --max:      1160px;
  --gutter:   clamp(16px, 4vw, 32px);
  --section:  clamp(64px, 9vw, 112px);
  --header:   64px;
  --shadow-s: 0 1px 2px rgba(0,0,0,.05);
  --shadow-m: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(0,0,0,.14);
  --shadow-l: 0 1px 2px rgba(0,0,0,.04), 0 30px 60px -24px rgba(0,0,0,.25);
  --ease:     cubic-bezier(.2,.7,.2,1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0B; --bg-subtle: #111113; --bg-inset: #18181B;
    --fg: #FAFAFA; --fg-muted: #A1A1AA; --fg-faint: #71717A;
    --border: #232327; --border-firm: #34343A; --accent-soft: #2A2410;
    --ink: #111113; --ink-border: #2A2A30;
    --shadow-m: 0 12px 32px -12px rgba(0,0,0,.6); --shadow-l: 0 30px 60px -24px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0B; --bg-subtle: #111113; --bg-inset: #18181B;
  --fg: #FAFAFA; --fg-muted: #A1A1AA; --fg-faint: #71717A;
  --border: #232327; --border-firm: #34343A; --accent-soft: #2A2410;
  --ink: #111113; --ink-border: #2A2A30;
}

/* ── base ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
}
main { display: block; }
img, svg { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

a { color: inherit; text-decoration: none; }
p { color: var(--fg-muted); }

h1, h2, h3, h4 { margin: 0; color: var(--fg); line-height: 1.12; letter-spacing: -0.022em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 700; letter-spacing: -0.038em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 660; letter-spacing: -0.03em; }
h3 { font-size: 1.06rem; font-weight: 620; letter-spacing: -0.012em; }
p, li { text-wrap: pretty; }

code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

/* ── header ──────────────────────────────────────────────────────────── */

header.top {
  position: sticky; top: 0; z-index: 50; height: var(--header);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
header.top.scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -18px rgba(0,0,0,.25); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 100%; }

/* LOGO SLOT — swap the span for an <img src="/static/logo.svg" class="mark"> and nothing else changes. */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.02em; font-size: 1.02rem; }
.brand .dot { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); flex: none; position: relative; }
.brand .dot::after { content: ""; position: absolute; inset: 5px; border-radius: 2px; background: var(--accent-ink); }
.brand img.mark { height: 22px; width: auto; display: block; }

nav.links { display: flex; gap: 2px; margin-left: 4px; }
nav.links a {
  position: relative; padding: 7px 12px; border-radius: var(--radius-s);
  font-size: 0.9rem; font-weight: 500; color: var(--fg-muted); transition: color .15s, background .15s;
}
nav.links a:hover { color: var(--fg); background: var(--bg-inset); }
nav.links a.on { color: var(--fg); }
nav.links a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--accent); border-radius: 2px; }

.spacer { flex: 1; }
.top .actions { display: flex; align-items: center; gap: 8px; }
.top .actions form { margin: 0; }

/* ── buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-s);
  font: 550 0.9rem/1 var(--sans); letter-spacing: -0.005em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease), box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -1px 0 rgba(0,0,0,.12), var(--shadow-s); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--fg); color: var(--bg); }
.btn-dark:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg)); }
.btn-line { border-color: var(--border-firm); color: var(--fg); background: var(--bg); box-shadow: var(--shadow-s); }
.btn-line:hover { border-color: var(--fg-faint); background: var(--bg-subtle); }
.btn-ghost { color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: var(--bg-inset); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 0.96rem; border-radius: 9px; }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: var(--fg); font-size: 0.94rem; }
.link-arrow span { transition: transform .2s var(--ease); }
.link-arrow:hover span { transform: translateX(3px); }

/* ── hero ────────────────────────────────────────────────────────────── */

.hero-bg { position: relative; isolation: isolate; overflow: hidden; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
  opacity: .7;
}
.hero-bg::after {
  content: ""; position: absolute; z-index: -1; width: 720px; height: 520px; top: -220px; right: -120px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  pointer-events: none;
}
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero h1 { max-width: 13ch; }
.hero .sub { font-size: clamp(1.04rem, 1.4vw, 1.2rem); line-height: 1.6; max-width: 48ch; margin: 22px 0 0; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: 0.84rem; color: var(--fg-muted); }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230A0A0A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border: 1px solid var(--accent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 0.74rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 100px; padding: 6px 12px; margin-bottom: 24px;
  box-shadow: var(--shadow-s);
}
.eyebrow b { color: var(--fg); font-weight: 600; }
.eyebrow .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ASCII hero (home). The canvas is drawn by static/creation.js; the copy sits on a soft
   dark vignette so it stays readable whatever the animation is doing behind it. */
.hero-ascii {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: clamp(560px, calc(100vh - var(--header)), 980px); min-height: clamp(560px, calc(100svh - var(--header)), 980px);
  background: #0B0B0C; color: #F4F4F5;
}
.hero-ascii canvas.creation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-ascii canvas.creation.on { opacity: 1; }
.hero-ascii::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse min(48%, 640px) 32% at 50% 72%, rgba(11,11,12,.94) 0%, rgba(11,11,12,.7) 55%, transparent 100%),
    linear-gradient(to bottom, transparent 82%, #0B0B0C);
}
.hero-center { text-align: center; padding-top: clamp(230px, 44vh, 420px); padding-bottom: clamp(40px, 7vh, 80px); }
.hero-center h1 { color: #FAFAFA; max-width: 21ch; margin: 0 auto; font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.hero-center .sub { color: #B4B4BC; font-size: clamp(1.02rem, 1.4vw, 1.18rem); max-width: 50ch; margin: 22px auto 0; }
.hero-center .cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
.hero-center .eyebrow { background: rgba(20,20,23,.8); border-color: #2A2A30; color: #A1A1AA; box-shadow: none; }
.hero-center .eyebrow .pip { box-shadow: 0 0 0 3px rgba(245,197,24,.18); }
.hero-center .btn-line { background: rgba(11,11,12,.6); border-color: #3A3A40; color: #F4F4F5; box-shadow: none; }
.hero-center .btn-line:hover { background: #1A1A1D; border-color: #55555C; }
.hero-ascii + .clients { border-top: none; }

/* case studies */
.case-card { gap: 0; }
.case-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.case-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); line-height: 1; }
.case-logo svg { height: 26px; width: auto; flex: none; }
.case-logo b { font-weight: 720; letter-spacing: -0.03em; font-size: 1.05rem; }
.case-logo small { font: 500 0.66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint); align-self: flex-end; margin-bottom: 2px; }
.case-logo.fernweg svg { fill: var(--fg); }
.case-logo.fernweg svg .cut { fill: var(--bg); }
.case-logo.fernweg b { font-style: italic; text-transform: uppercase; letter-spacing: 0; }
.case-logo.schmock svg { fill: #7C5CFF; }
.case-logo.schmock svg .cut { fill: #FFFFFF; }
.case-logo.schmock svg .cut-line { fill: none; stroke: #FFFFFF; stroke-width: 2.2; stroke-linecap: round; }
.case-logo.schmock b { color: #7C5CFF; font-size: 1.15rem; }
.case-logo.moos svg { fill: var(--fg-muted); }
.case-logo.moos b { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: 0; }
.case-top .case-logo small { display: none; }
.case-card .metric { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 4px; }
.case-card .metric b { font-size: 2.4rem; font-weight: 720; letter-spacing: -0.04em; line-height: 1; color: var(--fg); }
.case-card .metric span { font-size: 0.86rem; color: var(--fg-muted); }
.case-card h3 { margin: 14px 0 8px; }
.case-story { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header) + 8px); }
.case-story:first-of-type { border-top: none; }
.case-story aside { position: sticky; top: calc(var(--header) + 24px); align-self: start; display: grid; gap: 18px; }
.case-story .facts { display: grid; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--bg-subtle); }
.case-story .facts div { display: grid; gap: 2px; }
.case-story .facts dt { font: 500 0.7rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint); }
.case-story .facts dd { margin: 0; font-weight: 600; color: var(--fg); }
.case-story .prose h2 { margin-top: 0; }
.chat { border: 1px solid var(--border); border-radius: 14px; background: #ECE5DD; padding: 16px; display: grid; gap: 8px; max-width: 420px; margin: 20px 0; }
.chat .msg { max-width: 82%; padding: 8px 11px; border-radius: 10px; font-size: 0.9rem; line-height: 1.45; color: #111; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chat .msg.me { justify-self: end; background: #DCF8C6; }
.chat .msg.bot { justify-self: start; background: #FFFFFF; }
.chat .msg small { display: block; font-size: 0.7rem; color: #667; margin-top: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat { background: #1B1B1E; } }
:root[data-theme="dark"] .chat { background: #1B1B1E; }

/* client strip under the hero */
.clients { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.clients .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 36px; padding-top: 20px; padding-bottom: 20px; }
.clients .label { font: 500 0.72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.clients .name { font-weight: 600; color: var(--fg-muted); font-size: 0.95rem; letter-spacing: -0.01em; }

/* ── sections ────────────────────────────────────────────────────────── */

section { padding: var(--section) 0; }
section + section { border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin: 14px 0 0; font-size: 1.04rem; }
.kicker { font: 500 0.74rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 14px; }

.page-head { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); max-width: 20ch; }
.page-head p.sub { font-size: clamp(1.02rem, 1.3vw, 1.14rem); max-width: 56ch; margin: 18px 0 0; }
.page-head.center { text-align: center; }
.page-head.center h1, .page-head.center p.sub { margin-left: auto; margin-right: auto; }

/* ── grids and cards ─────────────────────────────────────────────────── */

.grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell { background: var(--bg); padding: 28px 26px; transition: background .2s; }
.cell:hover { background: var(--bg-subtle); }
.cell h3 { margin-bottom: 8px; }
.cell p { margin: 0; font-size: 0.93rem; }
.cell .num { font: 600 0.74rem/1 var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: 5px; padding: 4px 7px; display: inline-block; margin-bottom: 16px; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 26px; box-shadow: var(--shadow-s);
  transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card h3 { margin: 16px 0 8px; }
.card > h3:first-child { margin-top: 0; }
.card p { margin: 0; font-size: 0.93rem; }
.card ul { margin: 12px 0 0; padding-left: 18px; font-size: 0.9rem; color: var(--fg-muted); }
.card .icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft);
              border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.card .icon svg { width: 18px; height: 18px; stroke: var(--fg); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card .eg { margin-top: auto; padding-top: 16px; font: 0.76rem/1.5 var(--mono); color: var(--fg-faint); }
.card .eg::before { content: ""; display: block; border-top: 1px dashed var(--border); margin-bottom: 14px; }
a.card:hover, .card.lift:hover { border-color: var(--border-firm); box-shadow: var(--shadow-m); transform: translateY(-2px); }

/* ── code ────────────────────────────────────────────────────────────── */

pre.code {
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; margin: 0; line-height: 1.7; color: var(--fg); font-size: 0.84rem;
  -webkit-overflow-scrolling: touch;
}
pre.code .k { color: var(--fg-faint); }
pre.code .s { color: var(--fg); font-weight: 500; }
pre.code .y { color: #8A6D00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) pre.code .y { color: var(--accent); } }
:root[data-theme="dark"] pre.code .y { color: var(--accent); }

.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-subtle); padding: 9px 12px 9px 16px; font: 0.76rem/1 var(--mono); color: var(--fg-muted);
}
.code-head::before { content: ""; width: 34px; height: 8px; flex: none; margin-right: 4px;
  background: radial-gradient(circle 4px at 4px 4px, var(--border-firm) 98%, transparent), radial-gradient(circle 4px at 17px 4px, var(--border-firm) 98%, transparent), radial-gradient(circle 4px at 30px 4px, var(--border-firm) 98%, transparent); }
.code-head span { flex: 1; }
.code-head + pre.code { border-radius: 0 0 var(--radius) var(--radius); }
.copy { border: 1px solid var(--border-firm); background: var(--bg); color: var(--fg-muted); border-radius: 6px;
        padding: 4px 9px; font: 0.72rem/1 var(--mono); cursor: pointer; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--fg); border-color: var(--fg-faint); }

/* dark terminal variant */
.dark-band { background: var(--ink); color: var(--ink-fg); border-top: none !important; }
.dark-band + section { border-top: none; }
.dark-band h2, .dark-band h3 { color: var(--ink-fg); }
.dark-band p { color: var(--ink-muted); }
.dark-band .kicker { color: #71717A; }
.dark-band code { color: var(--ink-fg); }
.dark-band .code-head { background: #141416; border-color: var(--ink-border); color: var(--ink-muted); }
.dark-band .code-head::before { background: radial-gradient(circle 4px at 4px 4px, #3A3A40 98%, transparent), radial-gradient(circle 4px at 17px 4px, #3A3A40 98%, transparent), radial-gradient(circle 4px at 30px 4px, #3A3A40 98%, transparent); }
.dark-band pre.code { background: #0F0F11; border-color: var(--ink-border); color: var(--ink-fg); }
.dark-band pre.code .k { color: #6B6B74; }
.dark-band pre.code .s { color: #F4F4F5; }
.dark-band pre.code .y { color: var(--accent); }
.dark-band .copy { background: #1A1A1D; border-color: #333339; color: var(--ink-muted); }
.dark-band .btn-line { background: transparent; border-color: #3A3A40; color: var(--ink-fg); box-shadow: none; }
.dark-band .btn-line:hover { background: #1A1A1D; border-color: #55555C; }
.dark-band .link-arrow { color: var(--ink-fg); }

/* ── call mock ───────────────────────────────────────────────────────── */

.phone { border: 1px solid var(--border); border-radius: 14px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow-l); }
.phone .bar { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--border);
              background: var(--bg-subtle); font: 0.76rem/1 var(--mono); color: var(--fg-muted); }
.phone .bar .rec { margin-left: auto; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.phone .live { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, #E5484D 20%, transparent); }
.phone .body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.phone .foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 8px; flex-wrap: wrap; background: var(--bg-subtle); }
.turn { display: flex; gap: 12px; align-items: baseline; font-size: 0.9rem; }
.turn .who { font: 500 0.68rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-faint); width: 56px; flex: none; }
.turn .what { margin: 0; }
.turn.agent .what { color: var(--fg); }
.turn.them .what { color: var(--fg-muted); }
.turn.you .who, .turn.you .what { color: var(--fg); }
.chip { font: 0.7rem/1 var(--mono); padding: 5px 9px; border-radius: 100px; border: 1px solid var(--border-firm); color: var(--fg-muted); background: var(--bg); }
.chip.done { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.chip.done::before { content: "✓ "; }

.js .phone .turn { opacity: 0; transform: translateY(6px); }
.js .phone.play .turn { animation: turn-in .45s var(--ease) forwards; }
.js .phone.play .turn:nth-child(2) { animation-delay: .35s; }
.js .phone.play .turn:nth-child(3) { animation-delay: .7s; }
.js .phone.play .turn:nth-child(4) { animation-delay: 1.05s; }
.js .phone.play .turn:nth-child(5) { animation-delay: 1.4s; }
.js .phone.play .turn:nth-child(6) { animation-delay: 1.75s; }
@keyframes turn-in { to { opacity: 1; transform: none; } }
.live { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ── steps, flow, states ─────────────────────────────────────────────── */

.steps { display: grid; border-left: 1px solid var(--border-firm); margin-left: 13px; counter-reset: step; }
.step { position: relative; padding: 0 0 34px 34px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: -14px; top: -2px; width: 27px; height: 27px; border-radius: 7px;
  display: grid; place-items: center; font: 600 0.7rem/1 var(--mono); background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--bg);
}
.step h3, .prose .step h3 { margin: 0 0 6px; }
.step p { margin: 0; max-width: 60ch; }
.step code, .card code, .cell code, .section-head code { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 0.82em; }

.flow { display: flex; align-items: stretch; }
.flow .node { flex: 1 1 0; min-width: 0; border: 1px solid var(--border-firm); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); box-shadow: var(--shadow-s); }
.flow .node b { display: block; font-size: 0.94rem; margin-bottom: 2px; }
.flow .node span { font-size: 0.82rem; color: var(--fg-muted); }
.flow .node.hl { border-color: var(--accent); background: var(--accent-soft); }
.flow .arrow { flex: 0 0 36px; display: grid; place-items: center; color: var(--fg-faint); font-family: var(--mono); }

.states { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 0.78rem/1 var(--mono); }
.states .st { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border-firm); background: var(--bg); }
.states .st.end { background: var(--bg-inset); color: var(--fg-muted); }
.states .st.go { border-color: var(--accent); background: var(--accent-soft); }
.states .to { color: var(--fg-faint); }

/* ── faq ─────────────────────────────────────────────────────────────── */

.faq-list { max-width: 760px; border-top: 1px solid var(--border); }
.section-head.center + .faq-list { margin: 0 auto; }
details.faq { border-bottom: 1px solid var(--border); }
details.faq summary { cursor: pointer; font-weight: 560; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; transition: color .15s; }
details.faq summary:hover { color: var(--fg-muted); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: 1.6px solid var(--fg-faint); border-bottom: 1.6px solid var(--fg-faint); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s var(--ease); }
details.faq[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.faq p { margin: 0 0 20px; font-size: 0.95rem; max-width: 64ch; }
details.faq a { text-decoration: underline; text-underline-offset: 3px; }

/* ── prose ───────────────────────────────────────────────────────────── */

.prose { max-width: 72ch; }
.prose h2 { margin: 52px 0 14px; font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.prose h3 { margin: 30px 0 8px; }
.prose p, .prose li { color: var(--fg-muted); }
.prose li { margin: 6px 0; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose code { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 0.84em; }
.prose pre.code code { background: none; border: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font: 600 0.72rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-faint); }
.prose td { color: var(--fg-muted); }
.prose tr:hover td { background: var(--bg-subtle); }
.fineprint a, .prose a, .note a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-firm); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.fineprint a:hover, .prose a:hover, .note a:hover { text-decoration-color: var(--accent); }
.prose .btn { text-decoration: none; }

/* ── dashboard ───────────────────────────────────────────────────────── */

.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-s); }
.panel > header { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel > header h3 { font-size: 0.94rem; }
.panel .inner { padding: 22px 20px; }
.tag { font: 0.72rem/1 var(--mono); padding: 4px 9px; border-radius: 100px; border: 1px solid var(--border-firm); color: var(--fg-muted); white-space: nowrap; }
.tag.ok { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.tag.used { opacity: .7; text-decoration: line-through; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 0.92rem; }
.kv dt { color: var(--fg-faint); font: 0.78rem/1.6 var(--mono); }
.kv dd { margin: 0; color: var(--fg); word-break: break-all; }
.token-box { display: flex; gap: 8px; align-items: center; }
.token-box input { flex: 1; min-width: 0; font: 0.82rem var(--mono); background: var(--bg-inset); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 12px; }
.note { font-size: 0.85rem; color: var(--fg-faint); margin: 10px 0 0; }
.warn { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 0.9rem; color: var(--fg); }

.field { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 540; color: var(--fg); }
.field input, .field select {
  width: 100%; height: 42px; font: 400 0.95rem var(--sans); color: var(--fg); background: var(--bg);
  border: 1px solid var(--border-firm); border-radius: var(--radius-s); padding: 0 12px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--fg-muted); box-shadow: 0 0 0 4px var(--accent-soft); }
.fineprint { font-size: 0.82rem; line-height: 1.55; color: var(--fg-faint); margin: 16px 0 0; }

.auth-card { max-width: calc(420px + 2 * var(--gutter)); margin: 0 auto; padding-top: clamp(56px, 9vw, 104px); padding-bottom: clamp(56px, 9vw, 104px); }
.auth-card .box { border: 1px solid var(--border); border-radius: 14px; padding: 32px; background: var(--bg); box-shadow: var(--shadow-m); }

/* ── pricing ─────────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { border: 1px solid var(--border); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-s); position: relative; }
.plan.featured { border-color: var(--fg); box-shadow: var(--shadow-l); }
.plan.featured::before { content: "Next up"; position: absolute; top: -11px; left: 28px; font: 600 0.68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: var(--fg); color: var(--bg); padding: 5px 9px; border-radius: 100px; }
.plan .price { font-size: 2rem; font-weight: 700; letter-spacing: -0.035em; margin: 14px 0 4px; color: var(--fg); line-height: 1.1; }
.plan .per { font-size: 0.84rem; color: var(--fg-faint); }
.plan ul { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; font-size: 0.91rem; color: var(--fg-muted); }
.plan ul li { display: flex; gap: 10px; }
.plan ul li::before { content: "✓"; color: var(--fg); font-weight: 600; flex: none; }
.plan .btn { margin-top: auto; width: 100%; }
.mock-banner { display: inline-flex; gap: 8px; align-items: center; font-size: 0.82rem; color: var(--fg); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 100px; padding: 5px 13px; margin-top: 22px; }

/* ── docs ────────────────────────────────────────────────────────────── */

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); padding-top: 48px; padding-bottom: 96px; }
.docs aside { position: sticky; top: calc(var(--header) + 24px); align-self: start; max-height: calc(100vh - var(--header) - 48px); overflow: auto; font-size: 0.88rem; }
.docs aside details > summary { display: none; }
.docs aside h4 { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin: 24px 0 8px; }
.docs aside h4:first-of-type { margin-top: 0; }
.docs aside a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px; color: var(--fg-muted); border-left: 2px solid transparent; transition: color .15s, background .15s; }
.docs aside a:hover { color: var(--fg); background: var(--bg-inset); }
.docs aside a.on { color: var(--fg); background: var(--bg-inset); font-weight: 550; }
.docs .prose { max-width: 76ch; }
.docs .prose > h1 { font-size: clamp(2rem, 4vw, 2.7rem); }
.docs .prose > h1 + p { font-size: 1.08rem; }

.tool { border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; overflow: hidden; }
.tool > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.tool > header code { font-size: 0.92rem; font-weight: 600; color: var(--fg); background: none !important; border: none !important; padding: 0 !important; margin-right: auto; }
.tool .body { padding: 4px 16px 12px; }
.tool .body p { margin: 10px 0; }
.tool .body table { margin: 6px 0 !important; }
.badge { display: inline-block; font: 0.68rem/1 var(--mono); padding: 4px 8px; border-radius: 100px; border: 1px solid var(--border-firm); color: var(--fg-muted); background: var(--bg); }
.badge.dials { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.badge.ro { color: var(--fg-faint); }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--bg-subtle); padding: 14px 18px; margin: 20px 0; font-size: 0.93rem; color: var(--fg-muted); }
.callout strong { color: var(--fg); }

/* ── legal ───────────────────────────────────────────────────────────── */

.legal-page { padding: clamp(48px, 7vw, 88px) var(--gutter) 96px; }
.legal-page .prose { margin: 0 auto; max-width: 760px; }
.legal-page .prose h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 10px; }
.legal-page .prose h2 { font-size: 1.22rem; margin: 40px 0 10px; }
.legal-page .prose h3 { font-size: 1rem; margin: 22px 0 6px; }
.legal-page .stand { font: 0.76rem/1.5 var(--mono); color: var(--fg-faint); }
.legal-page address { font-style: normal; color: var(--fg); line-height: 1.75; }
.legal-page .toc { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin: 28px 0; background: var(--bg-subtle); }
.legal-page .toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 0.9rem; }
.legal-page .toc li { margin: 4px 0; break-inside: avoid; }
.legal-page .formbox { border: 1px dashed var(--border-firm); border-radius: var(--radius); padding: 18px 22px; }
/* A detail the operator has not filled in yet (legal.py). Loud on purpose. */
.todo { background: #FFE9A8; color: #5A4500; border-radius: 4px; padding: 1px 6px; font: 0.84em var(--mono); }

/* ── blog ────────────────────────────────────────────────────────────── */

a.post-card .badge { align-self: flex-start; }
a.post-card h3 { margin: 16px 0 8px; }
a.post-card p { margin-bottom: 4px; }
.post-lead { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; border: 1px solid var(--border);
             border-radius: 14px; padding: clamp(22px, 3vw, 36px); background: var(--bg); box-shadow: var(--shadow-s);
             transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); }
.post-lead:hover { border-color: var(--border-firm); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.post-lead h2 { margin: 16px 0 12px; font-size: clamp(1.5rem, 2.8vw, 2rem); }
.post-lead p { margin: 0 0 20px; }
.post-art { height: 210px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); display: flex; align-items: center; justify-content: center; gap: 7px; overflow: hidden; }
.post-art span { width: 9px; border-radius: 9px; background: var(--fg); opacity: .9; animation: wave 1.6s ease-in-out infinite; }
.post-art span:nth-child(1) { height: 24px; } .post-art span:nth-child(2) { height: 58px; animation-delay: .1s; }
.post-art span:nth-child(3) { height: 92px; animation-delay: .2s; } .post-art span:nth-child(4) { height: 124px; animation-delay: .3s; }
.post-art span:nth-child(5) { height: 84px; animation-delay: .4s; } .post-art span:nth-child(6) { height: 48px; animation-delay: .5s; }
.post-art span:nth-child(7) { height: 22px; animation-delay: .6s; }
@keyframes wave { 50% { transform: scaleY(.55); } }

.byline { display: flex; align-items: center; gap: 12px; font-size: 0.86rem; color: var(--fg-muted); }
.byline b { color: var(--fg); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 0.72rem; font-weight: 650; flex: none; }

.article { max-width: 760px; padding-top: clamp(40px, 6vw, 72px); padding-bottom: 96px; }
.article .back { display: inline-flex; gap: 6px; font-size: 0.88rem; color: var(--fg-muted); margin-bottom: 28px; transition: color .15s; }
.article .back:hover { color: var(--fg); }
.article h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 16px 0; }
.article .lede { font-size: clamp(1.06rem, 1.5vw, 1.2rem); margin: 0 0 28px; }
.article .byline { padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.article .prose { max-width: none; font-size: 1.05rem; }
.article .prose p, .article .prose li { line-height: 1.78; }
.article .prose pre.code { margin: 20px 0; }
.article .prose .flow { margin: 28px 0; }
.article-end { margin-top: 64px; }
.read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 60; }

/* ── CTA band ────────────────────────────────────────────────────────── */

.cta-band { text-align: center; background: var(--bg-subtle); position: relative; overflow: hidden; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: auto 0 -60% 0; height: 120%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.cta-band h2 { max-width: 20ch; margin: 0 auto; }
.cta-band p { max-width: 46ch; margin: 14px auto 28px; font-size: 1.04rem; }
.cta-band .btn-row { justify-content: center; }

/* ── footer ──────────────────────────────────────────────────────────── */

footer.foot { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-subtle); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 32px; }
.foot-grid h4 { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 14px; }
.foot-grid a { display: block; width: fit-content; color: var(--fg-muted); font-size: 0.88rem; padding: 4px 0; transition: color .15s; }
.foot-grid a:hover { color: var(--fg); }
.foot-brand p { font-size: 0.88rem; margin: 14px 0 0; max-width: 28ch; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--fg-faint); }

/* ── mobile menu ─────────────────────────────────────────────────────── */

details.menu { display: none; position: relative; }
details.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; border: 1px solid var(--border-firm); border-radius: var(--radius-s); display: grid; place-content: center; gap: 4px; background: var(--bg); }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary span { display: block; width: 16px; height: 1.6px; border-radius: 2px; background: var(--fg); transition: transform .2s var(--ease), opacity .2s; }
details.menu[open] summary span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
details.menu[open] summary span:nth-child(2) { opacity: 0; }
details.menu[open] summary span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }
details.menu nav { position: absolute; right: 0; top: 50px; width: min(280px, calc(100vw - 2 * var(--gutter))); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow-l); display: grid; animation: menu-in .18s var(--ease); }
details.menu nav a { padding: 11px 12px; border-radius: var(--radius-s); font-size: 0.95rem; color: var(--fg-muted); }
details.menu nav a:hover, details.menu nav a.on { background: var(--bg-inset); color: var(--fg); }
details.menu nav hr { border: none; border-top: 1px solid var(--border); margin: 6px 4px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }

/* ── scroll reveal (only when JS runs, so no-JS visitors see everything) ─ */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .phone .turn { opacity: 1 !important; transform: none !important; }
}

/* ── responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1040px) {
  nav.links { display: none; }
  details.menu { display: block; }
}
@media (max-width: 900px) {
  .hero-split { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-bottom: 28px; }
  .hero-split > .phone { margin-bottom: 56px; }
  .cards, .cards.c3, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; }
  .docs aside { position: static; max-height: none; overflow: visible; margin-bottom: 24px; }
  .docs aside details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); }
  .docs aside details > summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; font-weight: 560; list-style: none; }
  .docs aside details > summary::-webkit-details-marker { display: none; }
  .docs aside details > summary::after { content: "+"; font-family: var(--mono); color: var(--fg-faint); }
  .docs aside details[open] > summary::after { content: "−"; }
  .docs aside details .toc-inner { padding: 4px 16px 16px; columns: 2; }
  .docs aside details .toc-inner h4 { break-after: avoid; }
  .post-lead { grid-template-columns: minmax(0, 1fr); }
  .post-art { height: 140px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-story { grid-template-columns: minmax(0, 1fr); }
  .case-story aside { position: static; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .grid.c2 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .flow { flex-direction: column; }
  .flow .arrow { flex-basis: 28px; transform: rotate(90deg); }
  .prose table { display: block; overflow-x: auto; white-space: normal; -webkit-overflow-scrolling: touch; }
  .prose th, .prose td { min-width: 120px; }
}
@media (max-width: 640px) {
  :root { --header: 58px; }
  .top .wrap { gap: 10px; }
  .hide-s { display: none; }
  .cards, .cards.c2, .cards.c3, .plans, .grid.c3 { grid-template-columns: minmax(0, 1fr); }
  .hero .cta .btn, .cta-band .btn-row .btn { flex: 1 1 100%; }
  .legal-page .toc ol { columns: 1; }
  .docs aside details .toc-inner { columns: 1; }
  .auth-card .box { padding: 24px; }
  .turn { flex-direction: column; gap: 2px; }
  .turn .who { width: auto; }
  .plan.featured { margin-top: 8px; }
}
.foot-grid a.brand { display: inline-flex; padding: 0; color: var(--fg); font-size: 1.02rem; }
