/*
 * Story Board landing page.
 * Tokens follow the board itself (story-board/src/index.css): one blue accent, cool greys, verdict colours that carry
 * meaning. Radius rule, same as the board: chips 6px, buttons and inputs 8px, panels and images 12px.
 * Theme: follows the system, or the choice in the header (data-theme on <html>).
 * Layers: header 10, nothing else stacks.
 */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #fcfcfd;
  --sunk: #eceef2;
  --border: #dadee5;
  --border-strong: #c3c9d3;
  --text: #15171c;
  --muted: #5a6170;
  --accent: #1f4fd1;
  --accent-hover: #1a41ad;
  --accent-soft: #e6edfc;
  --on-accent: #fcfcfd;
  --code-bg: #15171c;
  --code-text: #e7e9ee;
  --code-muted: #9ba2b0;
  --shadow: 0 1px 2px rgb(30 41 66 / 0.06), 0 0 0 1px rgb(30 41 66 / 0.03);
  --shadow-lift: 0 30px 60px -20px rgb(30 41 66 / 0.35), 0 8px 20px -8px rgb(30 41 66 / 0.18);

  --v-not-ready: #b42318;  --v-not-ready-bg: #fce9e7;
  --v-refine: #b54708;     --v-refine-bg: #fdefdf;
  --v-discuss: #876b00;    --v-discuss-bg: #faf2d0;
  --v-ready: #067647;      --v-ready-bg: #ddf4e7;
  --human: #6b3fc6;        --human-bg: #efeafb;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1014;
    --surface: #171a20;
    --sunk: #13151a;
    --border: #272c35;
    --border-strong: #363c47;
    --text: #e7e9ee;
    --muted: #9ba2b0;
    --accent: #6b93ff;
    --accent-hover: #86a7ff;
    --accent-soft: #18223d;
    --on-accent: #0a0f1e;
    --code-bg: #0a0c10;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.03);
    --shadow-lift: 0 30px 60px -20px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(107 147 255 / 0.12);
    --v-not-ready: #ff8a80;  --v-not-ready-bg: #361a1a;
    --v-refine: #ffb366;     --v-refine-bg: #362511;
    --v-discuss: #f0d060;    --v-discuss-bg: #312a10;
    --v-ready: #6ee7a8;      --v-ready-bg: #10301f;
    --human: #c4b5fd;        --human-bg: #2a2142;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014;
  --surface: #171a20;
  --sunk: #13151a;
  --border: #272c35;
  --border-strong: #363c47;
  --text: #e7e9ee;
  --muted: #9ba2b0;
  --accent: #6b93ff;
  --accent-hover: #86a7ff;
  --accent-soft: #18223d;
  --on-accent: #0a0f1e;
  --code-bg: #0a0c10;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.03);
  --shadow-lift: 0 30px 60px -20px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(107 147 255 / 0.12);
  --v-not-ready: #ff8a80;  --v-not-ready-bg: #361a1a;
  --v-refine: #ffb366;     --v-refine-bg: #362511;
  --v-discuss: #f0d060;    --v-discuss-bg: #312a10;
  --v-ready: #6ee7a8;      --v-ready-bg: #10301f;
  --human: #c4b5fd;        --human-bg: #2a2142;
}

/* Screenshots exist in both themes; show the one that matches. */
.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-light { display: none; }
  :root:not([data-theme="light"]) .shot-dark { display: block; }
}
:root[data-theme="dark"] .shot-light { display: none; }
:root[data-theme="dark"] .shot-dark { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body { margin: 0; background: var(--bg); line-height: 1.55; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.025em; }
p { margin: 0; text-wrap: pretty; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.08; font-weight: 600; }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.0625rem; max-width: 60ch; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font: 500 0.9375rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--text); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn i { font-size: 1.05em; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--bg); backdrop-filter: none; } }
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-size: 16px;
}
.nav-links { display: flex; gap: 24px; margin-left: 8px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; transition: color 160ms var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-end .btn { height: 36px; padding: 0 14px; font-size: 0.875rem; }
@media (max-width: 860px) { .nav-links, .nav-github { display: none; } }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center;
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 56px; }
}
.hero h1 { font-size: clamp(2.4rem, 4.6vw, 3.625rem); line-height: 1.02; font-weight: 600; letter-spacing: -0.04em; }
.hero-sub { margin-top: 22px; font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); color: var(--muted); max-width: 34rem; }
.hero-actions { margin-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.cmd {
  display: flex; align-items: flex-start; gap: 10px; max-width: 34rem;
  padding: 6px 6px 6px 14px; border-radius: 8px;
  background: var(--code-bg); color: var(--code-text); font-size: 0.8125rem;
  box-shadow: var(--shadow);
}
.cmd code { padding: 6px 0; line-height: 1.6; overflow-wrap: anywhere; }
.cmd .prompt { color: var(--code-muted); user-select: none; }

.copy {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px;
  border: 0; background: transparent; color: var(--code-muted); cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.copy:hover { color: var(--code-text); background: rgb(255 255 255 / 0.08); }
.copy .ph-check { display: none; color: #6ee7a8; }
.copy.is-copied .ph-copy { display: none; }
.copy.is-copied .ph-check { display: inline; }

.hero-shot { position: relative; }
@media (min-width: 1024px) { .hero-shot { margin-right: calc(-1 * var(--gutter) - 120px); } }
.frame {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-lift);
}

/* ─── Agents strip ─────────────────────────────────────────────────────────── */
.agents { padding: 0 0 clamp(56px, 8vw, 96px); }
.agents-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px;
  padding-top: 28px; border-top: 1px solid var(--border);
}
.agents-row h2 { font-size: 0.9375rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-right: 8px; }
.agent { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); }
.logo {
  width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.agent i { font-size: 22px; }

/* ─── Gallery ──────────────────────────────────────────────────────────────── */
.gallery { padding-top: 0; }
.gallery-head { display: flex; align-items: flex-end; gap: 24px; }
.gallery-head .section-head { margin-bottom: 0; }
.gallery-nav { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 640px) { .gallery-nav { display: none; } }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, 860px); gap: 20px;
  margin-top: clamp(32px, 5vw, 48px);
  padding: 4px max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter))) 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.slide { scroll-snap-align: start; margin: 0; }
.slide .frame { box-shadow: var(--shadow); }
.slide figcaption { margin-top: 14px; color: var(--muted); font-size: 0.9375rem; max-width: 60ch; }
.slide figcaption strong { color: var(--text); font-weight: 500; }

/* ─── Use cases (bento) ────────────────────────────────────────────────────── */
.bento { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
}
.cell {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: clamp(22px, 2.6vw, 32px); border-radius: 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.cell h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.cell p { color: var(--muted); max-width: 52ch; }
.cell .ico { font-size: 22px; color: var(--accent); }
.cell-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.cell-human { background: var(--human-bg); border-color: color-mix(in srgb, var(--human) 25%, var(--border)); }
.cell-human .ico { color: var(--human); }
.cell-media { padding-bottom: 0; }
.cell-media .crop {
  margin-top: auto; margin-right: calc(-1 * clamp(22px, 2.6vw, 32px));
  border-top-left-radius: 12px; overflow: hidden; border: 1px solid var(--border); border-right: 0; border-bottom: 0;
  height: 260px;
}
/* Show the activity log: the right-hand drawer of the screenshot, from its Activity heading down. */
.cell-media .crop img { width: 190%; max-width: none; height: auto; margin-left: -90%; margin-top: -28%; }

.say {
  margin-top: auto; padding: 14px 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; color: var(--text);
}
.cell-accent .say { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.say::before { content: "you  "; color: var(--accent); white-space: pre; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 0.875rem; font-weight: 500; }
.v-ready { color: var(--v-ready); background: var(--v-ready-bg); }
.v-discuss { color: var(--v-discuss); background: var(--v-discuss-bg); }
.v-refine { color: var(--v-refine); background: var(--v-refine-bg); }
.v-not-ready { color: var(--v-not-ready); background: var(--v-not-ready-bg); }
.v-human { color: var(--human); background: color-mix(in srgb, var(--human) 14%, var(--surface)); }

.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 4px 0 0; padding: 0; list-style: none; }
@media (max-width: 560px) { .checks { grid-template-columns: minmax(0, 1fr); } }
.checks li { display: flex; gap: 10px; color: var(--muted); font-size: 0.9375rem; }
.checks li i { color: var(--accent); font-size: 18px; margin-top: 2px; flex: none; }
.checks code { font-size: 0.8125rem; color: var(--text); }

/* ─── How it works ─────────────────────────────────────────────────────────── */
.how { background: var(--sunk); border-block: 1px solid var(--border); }
.flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; }
@media (min-width: 960px) { .flow { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr) auto minmax(0, 1fr); } }
.node { padding: 22px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.node h3 { font-size: 1.0625rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.node h3 i { color: var(--accent); font-size: 20px; }
.node p { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.node code { font-size: 0.8125rem; color: var(--text); }
.node-core { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 0 0 4px var(--accent-soft); }
.arrow { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
@media (max-width: 959px) { .arrow i { transform: rotate(90deg); } }

.tools { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 900px) { .tools { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.tools h3 { font-size: 1rem; font-weight: 600; }
.tools p { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px;
  font: 500 0.8125rem/1 var(--mono); background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.rules { margin: 40px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 40px; }
@media (min-width: 800px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rules li { display: flex; gap: 12px; color: var(--muted); }
.rules li i { color: var(--accent); font-size: 18px; margin-top: 3px; flex: none; }
.rules strong { color: var(--text); font-weight: 500; }

/* ─── Install ──────────────────────────────────────────────────────────────── */
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1024px) { .install-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; } }
.prereq { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.prereq li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; }
.prereq i { font-size: 22px; color: var(--accent); grid-row: span 2; }
.prereq strong { font-weight: 600; }
.prereq span { color: var(--muted); font-size: 0.9375rem; }
.prereq code { font-size: 0.8125rem; color: var(--text); }
.prereq a { color: var(--accent); }

.tabs { border-radius: 12px; overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-lift); }
.tablist { display: flex; gap: 2px; padding: 8px; overflow-x: auto; border-bottom: 1px solid rgb(255 255 255 / 0.08); scrollbar-width: none; }
.tab {
  flex: none; height: 34px; padding: 0 14px; border-radius: 6px; border: 0; cursor: pointer;
  background: transparent; color: var(--code-muted); font: 500 0.875rem/1 var(--sans);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.tab:hover { color: var(--code-text); }
.tab[aria-selected="true"] { background: rgb(255 255 255 / 0.1); color: var(--code-text); }
.panel { padding: 8px 8px 12px; }
.panel[hidden] { display: none; }
.block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.block + .block { margin-top: 4px; }
.block-label { grid-row: 1; padding: 8px 12px 0; color: var(--code-muted); font-size: 0.8125rem; }
.block .copy { grid-row: 1; grid-column: 2; margin: 4px 4px 0 0; }
.block pre {
  grid-row: 2; grid-column: 1 / -1;
  margin: 0; padding: 8px 12px 12px; overflow-x: auto;
  color: var(--code-text); font-size: 0.8125rem; line-height: 1.7; white-space: pre;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 0.2) transparent;
}
.tok-c { color: var(--code-muted); }
.tok-s { color: #9fd3a8; }
.tok-k { color: #8fb0ff; }

.after { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px; }
@media (min-width: 760px) { .after { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.after h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.after h3 i { color: var(--accent); }
.after p { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; }
.after code { font-size: 0.8125rem; color: var(--text); }
.after a { color: var(--accent); }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot p { color: var(--muted); font-size: 0.9375rem; }
.foot p a { color: var(--text); }
.foot nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 20px; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.foot nav a:hover { color: var(--text); }

/* ─── Motion ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .enter { animation: enter 900ms var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
  .hero-shot.enter { animation-name: enter-shot; animation-duration: 1200ms; }
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@keyframes enter { from { opacity: 0; transform: translateY(18px); } }
@keyframes enter-shot { from { opacity: 0; transform: translateY(32px) scale(0.985); } }
.v-neutral { color: var(--muted); background: var(--sunk); }
