/* LagrangeCloud landing page. Uses the console's tokens, type and brand mark so
   the two read as one product; fonts are served locally. */

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

:root {
  --page: #ffffff;
  --band: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #e8ecf2;
  --border: #e1e6ee;
  --border-strong: #c9d0db;
  --fg: #0e1626;
  --fg-2: #48536a;
  --fg-3: #616c81;
  --accent: #2b55e6;
  --accent-fg: #ffffff;
  --accent-soft: rgba(43, 85, 230, 0.08);
  --accent-line: rgba(43, 85, 230, 0.45);
  --good: #0d7550;
  --good-soft: rgba(17, 132, 90, 0.11);
  --warn: #8a5707;
  --warn-soft: rgba(196, 128, 18, 0.12);
  --k-model: #2b55e6;
  --k-tool: #d18f1f;
  --k-sub: #7a4fd6;
  --k-harness: #0b8a99;
  --k-verify: #11845a;
  --grid-line: rgba(14, 22, 38, 0.06);
  --shadow: 0 1px 2px rgba(14, 22, 38, 0.05), 0 4px 16px rgba(14, 22, 38, 0.04);
  --shadow-lg: 0 2px 6px rgba(14, 22, 38, 0.06), 0 24px 64px rgba(14, 22, 38, 0.14);
  /* Code windows stay dark in both themes. */
  --code-bg: #0b1220;
  --code-bar: #101a2b;
  --code-border: #1b2639;
  --code-fg: #e3e8f0;
  --code-dim: #8d98ac;
  --code-accent: #8ea8ff;
  --code-green: #55d39e;
  --code-string: #9fdcb8;
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 7px;
  --wrap: 1240px;
  --gutter: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0a0e16;
    --band: #0d121b;
    --surface: #10161f;
    --surface-2: #151c28;
    --surface-3: #1b2331;
    --border: #1f2836;
    --border-strong: #2d3849;
    --fg: #e5e9f1;
    --fg-2: #a2acbe;
    --fg-3: #8590a3;
    --accent: #7090ff;
    --accent-fg: #0a0e16;
    --accent-soft: rgba(112, 144, 255, 0.12);
    --accent-line: rgba(112, 144, 255, 0.5);
    --good: #3cc48a;
    --good-soft: rgba(60, 196, 138, 0.13);
    --warn: #e2b143;
    --warn-soft: rgba(226, 177, 67, 0.13);
    --k-model: #7090ff;
    --k-tool: #e2b143;
    --k-sub: #a78bfa;
    --k-harness: #4fc6cf;
    --k-verify: #3cc48a;
    --grid-line: rgba(229, 233, 241, 0.045);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.5);
    --code-bg: #0c121c;
    --code-bar: #111824;
    --code-border: #232d3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0a0e16;
  --band: #0d121b;
  --surface: #10161f;
  --surface-2: #151c28;
  --surface-3: #1b2331;
  --border: #1f2836;
  --border-strong: #2d3849;
  --fg: #e5e9f1;
  --fg-2: #a2acbe;
  --fg-3: #8590a3;
  --accent: #7090ff;
  --accent-fg: #0a0e16;
  --accent-soft: rgba(112, 144, 255, 0.12);
  --accent-line: rgba(112, 144, 255, 0.5);
  --good: #3cc48a;
  --good-soft: rgba(60, 196, 138, 0.13);
  --warn: #e2b143;
  --warn-soft: rgba(226, 177, 67, 0.13);
  --k-model: #7090ff;
  --k-tool: #e2b143;
  --k-sub: #a78bfa;
  --k-harness: #4fc6cf;
  --k-verify: #3cc48a;
  --grid-line: rgba(229, 233, 241, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.5);
  --code-bg: #0c121c;
  --code-bar: #111824;
  --code-border: #232d3d;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
code, pre, .mono { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.86em; padding: 0.1em 0.38em; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg); white-space: nowrap;
}
.ico { flex: none; display: inline-block; vertical-align: middle; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-fg); font-weight: 500; transition: top .15s;
}
.skip:focus { top: 12px; text-decoration: none; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  border-radius: var(--radius-sm); padding: 7px 14px; font-weight: 500; font-size: 14px; line-height: 1.4;
  transition: background-color .12s, border-color .12s, filter .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn .ico { transition: transform .15s; }
.btn:hover .ico { transform: translateX(2px); }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg-2);
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.nav-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-links a {
  color: var(--fg-2); font-size: 14px; font-weight: 450; padding: 6px 11px; border-radius: var(--radius-sm); white-space: nowrap;
}
.nav-links a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(260px, calc(100vw - 32px));
  display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu-panel a { color: var(--fg); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 15px; }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel .menu-signin { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(38px, 3.9vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.038em;
  text-wrap: balance;
}
.h1-soft { display: block; color: var(--fg-2); }
h2 {
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; font-weight: 600; letter-spacing: -0.03em;
  text-wrap: balance;
}
h2 .line { display: block; color: var(--fg-2); }
h3 { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.012em; }
.lead { font-size: 19px; line-height: 1.6; color: var(--fg-2); max-width: 62ch; text-wrap: pretty; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.band { background: var(--band); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 760px; margin: 0 auto 52px; text-align: center; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 104px 0; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 20%, #000 20%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 480px at 78% 8%, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-visual { min-width: 0; }

/* ---------- Code windows ---------- */
.term, .tabs-window {
  background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0;
}
.term-bar {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px;
  background: var(--code-bar); border-bottom: 1px solid var(--code-border);
}
.lights { display: inline-flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #2a3446; display: block; }
.term-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--code-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-body, .tabs-window pre {
  margin: 0; padding: 18px 20px 20px; font-size: 13px; line-height: 1.7; color: var(--code-fg);
  white-space: pre; overflow-x: auto; tab-size: 2;
  scrollbar-width: thin; scrollbar-color: #2a3446 transparent;
}
.term-body code, .tabs-window pre code { font: inherit; }
.p { color: var(--code-accent); user-select: none; }
.d { color: var(--code-dim); }
.g { color: var(--code-green); }
.st { color: var(--code-string); }
.fn { color: var(--code-accent); }


/* ---------- Demos ---------- */
/* site.js plays each [data-demo] once in view, showing every [data-at] element
   at its time; without it, or with reduced motion, the demo shows finished.
   A .cue stays visible and only changes look when its time comes. */
[data-demo][data-state] [data-at]:not(.cue) { transition: opacity .35s ease, transform .35s ease; }
[data-demo][data-state] [data-at]:not(.shown):not(.cue) { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: no-preference) {
  /* Hold the finished state back until site.js starts playing, so it doesn't flash. */
  .js [data-demo]:not([data-state]) [data-at], .js [data-demo]:not([data-state]) [data-type] { visibility: hidden; }
}
/* A .swap stacks its children and shows one: the latest shown, or the last when finished. */
.swap { display: grid; align-items: center; }
.swap > * { grid-area: 1 / 1; }
.swap.end { justify-items: end; }
[data-demo][data-state] .swap > :has(~ .shown) { opacity: 0; }
[data-demo]:not([data-state]) .swap > :not(:last-child) { visibility: hidden; }
.btn.cue.shown { animation: press .45s ease; filter: brightness(.88); }
@keyframes press { 40% { transform: scale(.94); } }

/* ---------- Hero demo ---------- */
/* Codex deploying the agent, the agent answering on a website, then Lagrange
   finding a cheaper, faster version in its traces. */
/* The cards overlap only the composer, never the steps or the live URL. */
.demo { position: relative; padding-bottom: 156px; }
.term-title b { color: var(--code-fg); font-weight: 500; }
.replay {
  margin-left: auto; padding: 2px 10px; border-radius: 6px; font-size: 12px; line-height: 1.6;
  border: 1px solid var(--code-border); background: transparent; color: var(--code-dim); visibility: hidden;
}
.replay:hover { color: var(--code-fg); border-color: #34405a; }
[data-demo][data-state="done"] .replay { visibility: visible; }
.demo-body { padding: 22px 24px 4px; min-height: 262px; font-size: 14px; line-height: 1.7; }
.demo-ask { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.bubble { background: #1e293d; color: #ffffff; padding: 7px 13px; border-radius: 12px 12px 4px 12px; min-height: 2.3em; }
.caret { display: none; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--code-accent); }
[data-demo][data-state="typing"] .caret { display: inline-block; }
.demo-steps { display: grid; gap: 7px; font-size: 13.5px; }
.demo-steps li { display: flex; gap: 10px; }
.demo-steps li::before { content: "\2713"; color: var(--code-green); font-family: var(--font-mono); }
.demo-live {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--code-border);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--code-dim); overflow-wrap: anywhere;
}
.demo-live .g { font-weight: 500; margin-right: 6px; }
.demo-composer { margin: 12px 16px 16px; padding: 10px 14px; border: 1px solid var(--code-border); border-radius: 10px; color: #5f6b82; font-size: 13.5px; }
.demo-chat { position: absolute; right: -20px; bottom: 0; width: 300px; }
.demo-toast { position: absolute; left: -24px; bottom: 0; width: 300px; }
.toast-swap { justify-items: start; margin-top: 9px; }
.toast-swap .btn { padding: 3px 12px; font-size: 12.5px; }
.toast-done { align-self: center; color: var(--good); font-weight: 500; }
.toast-done::before { content: "\2713"; margin-right: 6px; }
.gains { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1px 0; margin-top: 8px; font-size: 12.5px; color: var(--fg-3); }
.gains > :not(:nth-child(3n + 1)) { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.gains > :nth-child(3n + 2) { margin-left: 14px; }
.gains .to { color: var(--good); font-weight: 600; }
.gains .to::before { content: "\2192"; margin: 0 6px; color: var(--fg-3); font-weight: 400; }

/* ---------- Chat widget ---------- */
.chat { background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
.chat-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; font-size: 13.5px; line-height: 1.45; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; }
.msg.me { align-self: flex-end; background: var(--fg); color: var(--page); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.dots { display: none; gap: 4px; padding: 13px 12px; }
[data-demo][data-state] .msg.dots.shown { display: inline-flex; }
[data-demo] .msg.dots:has(+ .msg.shown) { display: none; }
.msg.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); animation: dot 1s infinite; }
.msg.dots i:nth-child(2) { animation-delay: .15s; }
.msg.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------- Improvement toast ---------- */
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.45;
  background: var(--surface); color: var(--fg-2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.toast b { display: block; color: var(--fg); font-weight: 600; }
.toast-icon {
  width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}

/* ---------- Lagrange improvements ---------- */
/* One optimization going around the loop: observe, propose, review, canary, promote. */
.section-head .lead { margin: 18px auto 0; font-size: 17px; }
.improve { max-width: 940px; margin: 0 auto; }
.loop-row { display: flex; align-items: center; gap: 12px; padding-right: 18px; border-bottom: 1px solid var(--border); }
.loop-row .replay { border-color: var(--border); color: var(--fg-3); }
.loop-row .replay:hover { border-color: var(--border-strong); color: var(--fg); }
.loop { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 13px 18px; font-size: 13.5px; color: var(--fg-3); }
.loop li { display: inline-flex; align-items: center; gap: 8px; transition: color .3s; }
.loop li::before {
  content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong);
  transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.loop .shown, [data-demo]:not([data-state]) .loop li { color: var(--fg-2); }
.loop .shown::before, [data-demo]:not([data-state]) .loop li::before { background: var(--good); border-color: var(--good); }
[data-demo]:not([data-state="done"]) .loop .shown:not(:has(~ .shown)) { color: var(--fg); }
[data-demo]:not([data-state="done"]) .loop .shown:not(:has(~ .shown))::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.improve-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.improve-fix, .improve-compare { padding: 20px 18px; }
.improve-compare { display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--border); font-size: 14px; line-height: 1.45; }
.improve-label { margin-bottom: 4px; color: var(--fg-3); font-size: 12.5px; font-weight: 500; }
.spans.mini { padding: 2px 0 0; }
.spans.mini .span { grid-template-columns: 104px minmax(0, 1fr); height: 22px; font-size: 12px; }
.spans.mini .sp-track i { height: 10px; }
.span.repeat .sp-name, .span.repeat .sp-track i { transition: color .3s, background-color .3s; }
.improve-fix:has(.finding.shown) .span.repeat .sp-name, [data-demo]:not([data-state]) .span.repeat .sp-name { color: var(--warn); }
.improve-fix:has(.finding.shown) .span.repeat .sp-track i, [data-demo]:not([data-state]) .span.repeat .sp-track i { background: var(--warn); }
.finding { margin: 8px 0 18px; color: var(--warn); font-size: 14px; font-weight: 500; }
.improve-change h3 { font-size: 16px; }
.metric { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 3px 12px; }
.metric-name { grid-row: span 2; color: var(--fg-2); font-size: 13.5px; }
.metric-bar { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.metric-bar i { flex: none; width: calc(var(--w) * 0.7%); height: 10px; border-radius: 3px; background: var(--border-strong); transition: width .8s ease; }
.metric-bar.v2 { color: var(--good); font-weight: 600; }
.metric-bar.v2 i { background: var(--good); }
[data-demo][data-state] .metric:not(.shown) .metric-bar.v2 i { width: 0; }
.compare-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.metric-key { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.metric-key span { display: inline-flex; align-items: center; gap: 6px; }
.metric-key span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--border-strong); }
.metric-key .v2::before { background: var(--good); }
.improve-diff {
  margin-top: 10px; padding: 10px 0; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.improve-diff div { padding: 0 14px; }
.improve-diff .add { color: var(--good); background: var(--good-soft); }
.improve-actions { padding: 16px 18px; border-top: 1px solid var(--border); align-items: center; }
.improve-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.improve-buttons .btn { pointer-events: none; }
.canary { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--fg-2); }
.canary-bar { flex: 0 1 220px; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.canary-bar i { display: block; width: 10%; height: 100%; background: var(--good); transition: width 1.2s ease; }
.canary:has(.canary-all.shown) .canary-bar i, [data-demo]:not([data-state]) .canary-bar i { width: 100%; }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.accent { color: var(--accent); background: var(--accent-soft); }
.pill.idle { color: var(--fg-3); background: var(--surface-2); }

/* ---------- What carries over ---------- */
.carry { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; max-width: 1040px; margin: 0 auto; }
.carry-arrow {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent); box-shadow: var(--shadow);
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; }
.rows { padding: 4px 18px 8px; }
.rows div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.rows div:last-child { border-bottom: 0; }
.rows dt { color: var(--fg-3); }
.rows dd { font-family: var(--font-mono); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.rows .soft { color: var(--fg-3); font-family: var(--font-ui); margin-left: 4px; }
.rows .lock::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px; background: var(--good);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 015 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 015 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Ways to use it ---------- */
.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.use {
  display: flex; flex-direction: column; gap: 16px; padding: 22px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.mini-code {
  flex: 1; margin: 0; padding: 16px 18px; border-radius: 10px; font-size: 12.5px; line-height: 1.7;
  background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border);
  white-space: pre; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #2a3446 transparent;
}
.mini-code code { font: inherit; }
.mini-site { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--band); }
.mini-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mini-bar .lights i { width: 9px; height: 9px; background: var(--border-strong); }
.mini-url { flex: 1; margin-right: 39px; padding: 1px 8px; border-radius: 6px; background: var(--surface); text-align: center; font-size: 12px; color: var(--fg-3); }
.mini-page { flex: 1; display: flex; align-items: flex-end; justify-content: flex-end; padding: 16px; }
.mini-page .chat { width: 90%; box-shadow: var(--shadow); }
.mini-page .chat-body { padding: 12px; font-size: 12.5px; }
.sched { flex: 1; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 500; }
.sched-head .mono { color: var(--accent); font-size: 13px; }
.sched-runs li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sched-runs li:last-child { border-bottom: 0; }
.sched-runs .mono { margin-left: auto; color: var(--fg-3); font-size: 12.5px; }
.ok { position: relative; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--good-soft); }
.ok::after {
  content: ""; position: absolute; inset: 3px; background: var(--good);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Trace legend keys ---------- */
.k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--fg-3); }
.k.k-model { background: var(--k-model); }
.k.k-tool { background: var(--k-tool); }
.k.k-sub { background: var(--k-sub); }
.k.k-harness { background: var(--k-harness); }
.k.k-verify { background: var(--k-verify); }

/* ---------- Trace waterfall ---------- */
.trace {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px 20px 16px; min-width: 0;
}
.trace-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.trace-id { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.trace-meta { font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border-radius: 999px; padding: 1px 9px 1px 8px; white-space: nowrap; font-weight: 500; line-height: 19px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: var(--good-soft); }

.spans { padding: 8px 0 0; }
.span {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 52px; align-items: center; gap: 12px;
  height: 30px; font-size: 12.5px;
}
.sp-name { font-family: var(--font-mono); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.span.nested .sp-name { padding-left: 16px; color: var(--fg-2); position: relative; }
.span.nested .sp-name::before {
  content: ""; position: absolute; left: 4px; top: -8px; bottom: 50%; width: 8px;
  border-left: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); border-bottom-left-radius: 4px;
}
.sp-track { position: relative; height: 100%; }
.sp-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border); }
.sp-track i {
  position: absolute; top: 50%; transform: translateY(-50%); height: 12px; border-radius: 3px;
  left: calc(var(--s) * 1%); width: max(calc(var(--w) * 1%), 4px); background: var(--fg-3);
}
.span.k-run .sp-track i { background: color-mix(in srgb, var(--fg-3) 32%, transparent); }
.span.k-model .sp-track i { background: var(--k-model); }
.span.k-tool .sp-track i { background: var(--k-tool); }
.span.k-sub .sp-track i { background: color-mix(in srgb, var(--k-sub) 28%, transparent); border: 1px solid var(--k-sub); }
.span.k-harness .sp-track i { background: var(--k-harness); }
.span.k-verify .sp-track i { background: var(--k-verify); }
.span.mark .sp-track i { width: 10px; height: 10px; border-radius: 2px; transform: translate(-1px, -50%) rotate(45deg); }
.sp-dur { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); text-align: right; font-variant-numeric: tabular-nums; }
.trace-axis { display: grid; grid-template-columns: 168px minmax(0, 1fr) 52px; gap: 12px; margin-top: 6px; }
.trace-axis .ticks { position: relative; height: 26px; border-top: 1px solid var(--border); }
.trace-axis i {
  position: absolute; top: 0; left: calc(var(--at) * 1%); transform: translateX(-50%); padding-top: 7px;
  font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); white-space: nowrap;
}
.trace-axis i::before { content: ""; position: absolute; left: 50%; top: 0; height: 4px; border-left: 1px solid var(--border-strong); }
.trace-axis i:first-child { transform: none; }
.trace-axis i:first-child::before { left: 0; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .k { width: 9px; height: 9px; }
.legend-note { margin-left: auto; color: var(--fg-3); font-size: 12.5px; }


/* ---------- Copy buttons ---------- */
.copy {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--code-border); background: var(--code-bar); color: var(--code-dim);
  transition: color .12s, border-color .12s;
}
.copy::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='5' width='9' height='9' rx='1.5'/%3E%3Cpath d='M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='5' width='9' height='9' rx='1.5'/%3E%3Cpath d='M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.copy[data-state="copied"] { color: var(--code-green); border-color: color-mix(in srgb, var(--code-green) 45%, transparent); }
.copy[data-state="copied"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}
.copy:hover { color: var(--code-fg); border-color: #34405a; }
html:not(.js) .copy { display: none; }


/* ---------- Developers ---------- */
.tabs-window { position: relative; max-width: 880px; margin: 0 auto; }
.tab-bar { display: flex; gap: 2px; padding: 8px 10px 0; background: var(--code-bar); border-bottom: 1px solid var(--code-border); overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 13px 11px;
  font-size: 13.5px; font-weight: 500; color: var(--code-dim); white-space: nowrap; border-radius: 6px 6px 0 0;
}
.tab-bar [role="tab"]:hover { color: var(--code-fg); }
.tab-bar [role="tab"][aria-selected="true"] { color: #ffffff; border-bottom-color: var(--code-accent); }
.tab-bar [role="tab"]:focus-visible { outline-offset: -2px; }
.tab-panel { position: relative; }
.tab-panel .copy { top: 12px; right: 14px; }
.tabs-window pre { padding: 22px 64px 22px 24px; font-size: 13.5px; }
html:not(.js) .tab-bar { display: none; }
html:not(.js) .tab-panel[hidden] { display: block; border-top: 1px solid var(--code-border); }

/* ---------- Pricing ---------- */
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.price {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0;
}
.price h3 { font-size: 15px; color: var(--fg-2); font-weight: 500; }
.price-num { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-num b { font-size: 40px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.price-num span { color: var(--fg-3); font-size: 14.5px; }
.price-num .from { order: -1; }
.price-note { margin-top: 20px; text-align: center; color: var(--fg-3); font-size: 14.5px; }
.cta-row.center { justify-content: center; margin-top: 32px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--border); background: var(--band); padding: 28px 0; font-size: 13.5px; color: var(--fg-3); }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .nav-links { display: none; }
  .menu { display: block; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-copy { max-width: 760px; }
  .demo { max-width: 680px; }
  .demo-chat { right: 0; }
  .demo-toast { left: 0; }
}
@media (max-width: 960px) {
  .prices { grid-template-columns: minmax(0, 1fr); }
  .uses { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
  .carry { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .carry-arrow { justify-self: center; transform: rotate(90deg); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 15.5px; }
  .nav-row { height: 58px; gap: 12px; }
  .nav-signin { display: none; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .hero { padding: 56px 0 64px; }
  .hero-copy { gap: 20px; }
  .lead { font-size: 17px; }
  .demo { padding-bottom: 0; }
  .demo-body { min-height: 0; padding: 18px 16px 4px; font-size: 13px; }
  .demo-steps { font-size: 13px; }
  .demo-chat { position: relative; right: auto; width: min(300px, 88%); margin: -36px 0 0 auto; }
  .demo-toast { position: relative; left: auto; bottom: auto; width: min(300px, 88%); margin-top: 12px; }
  .loop { gap: 6px 16px; padding: 12px 14px; font-size: 13px; }
  .improve-body { grid-template-columns: minmax(0, 1fr); }
  .improve-fix, .improve-compare { padding: 18px 14px; }
  .improve-compare { border-left: 0; border-top: 1px solid var(--border); }
  .improve-actions { padding: 14px; }
  .improve-buttons .btn { padding: 6px 12px; font-size: 13px; }
  .loop-row { padding-right: 14px; }
  .canary-bar { flex-basis: 120px; }
  .rows { padding: 4px 14px 6px; }
  .rows div { grid-template-columns: 92px minmax(0, 1fr); font-size: 13.5px; }
  .use { padding: 18px; }
  /* Code wraps on phones so no line is hidden off-screen; copy buttons keep the exact text. */
  .term-body, .tabs-window pre, .mini-code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; padding-left: 16px; padding-right: 16px; }
  .tabs-window pre { padding-right: 52px; }
  .trace { padding: 14px 14px 12px; }
  .span, .trace-axis { grid-template-columns: 134px minmax(0, 1fr) 38px; gap: 8px; }
  .span { font-size: 11px; height: 28px; }
  .sp-name { font-size: 11px; }
  .span.nested .sp-name { padding-left: 14px; }
  .sp-dur { font-size: 11px; }
  .trace-axis i:nth-child(even) { visibility: hidden; }
  .legend-note { margin-left: 0; width: 100%; }
  .price { padding: 22px 20px; }
}
@media (max-width: 400px) {
  .brand-name { font-size: 15px; }
  .nav-actions .btn.primary { padding: 7px 12px; }
}
