/* ============================================================
   Grixel website — stylesheet
   Dark by default, light on toggle. Mobile-first, no dependencies.
   Palette derives from the logo: Grixel green #00d44c + slate #4d5e6d
   (see branding/BRANDING.md).
   ============================================================ */

:root {
  --max: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --t: 0.18s ease;
}

/* ---- dark (default) ---- */
:root, :root[data-theme="dark"] {
  --bg: #0b0e10;
  --bg-grad-1: #0d2015;
  --bg-grad-2: #0b0e10;
  --surface: #12161a;
  --surface-2: #171c21;
  --surface-3: #1e252c;
  --border: #242c34;
  --border-strong: #323d47;
  --text: #e6ebef;
  --text-dim: #a3b0ba;
  --text-faint: #86939e;
  --accent: #00d44c;
  --accent-2: #8fb0c9;
  --accent-soft: rgba(0, 212, 76, 0.13);
  --accent-border: rgba(0, 212, 76, 0.38);
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --code-bg: #0e1216;
  --term-bg: #090c0f;
  /* shell-session tokens (build-time highlighting; see build.py highlight_shell) */
  --sh-prompt: #00d44c;
  --sh-cmd: #e6ebef;
  --sh-flag: #8fb0c9;
  --sh-str: #7ee0b8;
  --sh-comment: #6b7887;
  --sh-out: #a3b0ba;
  --sh-path: #61c8e8;
  --sh-hash: #86939e;
}

/* ---- light ---- */
:root[data-theme="light"] {
  --bg: #f6f8f9;
  --bg-grad-1: #e3f5e9;
  --bg-grad-2: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #eff2f4;
  --surface-3: #e5eaee;
  --border: #dde3e8;
  --border-strong: #c8d1d9;
  --text: #182027;
  --text-dim: #4d5e6d;
  --text-faint: #66788a;
  --accent: #0a8f3e;   /* logo green darkened for ≥4.5:1 contrast on white */
  --accent-2: #4d5e6d; /* the logo slate, verbatim */
  --accent-soft: rgba(10, 143, 62, 0.10);
  --accent-border: rgba(10, 143, 62, 0.35);
  --warn: #b45309;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 18px 50px -24px rgba(40, 60, 50, 0.35);
  --code-bg: #14181c;  /* code/terminal cards stay dark in light mode */
  --term-bg: #10141a;
  --sh-prompt: #2ee06b;
  --sh-cmd: #e6ebef;
  --sh-flag: #9fbdd4;
  --sh-str: #5ec9a0;
  --sh-comment: #7d8b99;
  --sh-out: #a9b4be;
  --sh-path: #5cc4e8;
  --sh-hash: #8a97a3;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ============================================================ topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; }
.brand:hover { text-decoration: none; }
/* the wordmark artwork from branding/Grixel.svg — its slate + green is designed for both themes */
.brand-logo { display: block; height: 22px; width: auto; }
.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.mainnav a {
  color: var(--text-dim); padding: 8px 12px; border-radius: 8px; font-size: 0.94rem; font-weight: 500;
  transition: background var(--t), color var(--t);
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.mainnav a.active { color: var(--text); background: var(--accent-soft); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-actions button {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  height: 38px; padding: 0 10px; border-radius: 9px; transition: all var(--t);
}
.topbar-actions button:hover { color: var(--text); background: var(--surface-2); }
/* the "Request early access" CTA in the topbar */
.cta-mini {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 9px;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--text);
  font-size: 0.88rem; font-weight: 600; white-space: nowrap; transition: all var(--t);
}
.cta-mini:hover { background: var(--accent); color: #06130a; text-decoration: none; }
.search-trigger { border-color: var(--border); padding: 0 12px; }
.search-hint { font-size: 0.85rem; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: inline; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: transparent; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t), opacity var(--t); }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================ layout */
.layout { max-width: var(--max); margin: 0 auto; }
.layout-wide { max-width: none; margin: 0; }
.layout-doc { padding: 0 20px; }
.layout-doc .content { max-width: 820px; margin: 0 auto; }
.layout-sidebar {
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 200px; gap: 40px;
  padding: 0 20px; align-items: start;
}
.layout-sidebar .content { padding-top: 8px; min-width: 0; }

/* sidebar */
.sidebar {
  position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px);
  overflow-y: auto; padding: 28px 4px 40px; font-size: 0.92rem;
}
.side-group { margin-bottom: 22px; }
.side-group h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-faint); margin: 0 0 8px; font-weight: 700;
}
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group li a {
  display: block; padding: 5px 12px; border-radius: 7px; color: var(--text-dim);
  border-left: 2px solid transparent; transition: all var(--t);
}
.side-group li a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.side-group li a.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }

/* table of contents */
.toc { position: sticky; top: 60px; align-self: start; padding: 32px 0; font-size: 0.86rem; }
.toc h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-faint); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--text-dim); border-left: 2px solid var(--border); transition: all var(--t); }
.toc li a:hover { color: var(--text); border-left-color: var(--accent); text-decoration: none; }

.content { padding-bottom: 80px; }

/* ============================================================ page head + prose */
.page-head { padding: 40px 0 8px; }
.page-head .eyebrow { color: var(--accent-2); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem); line-height: 1.12; margin: 0; letter-spacing: -0.025em; }
.page-head .page-sub { color: var(--text-dim); font-size: 1.08rem; margin: 14px 0 0; max-width: 60ch; }

.prose { font-size: 1.02rem; }
.prose > * { max-width: 70ch; }
.prose pre, .prose table, .prose .table-wrap { max-width: 100%; }
.prose h2 { font-size: 1.5rem; margin: 2.4em 0 0.7em; letter-spacing: -0.02em; line-height: 1.2; padding-top: 0.3em; }
.prose h3 { font-size: 1.18rem; margin: 1.9em 0 0.6em; letter-spacing: -0.01em; }
.prose h4 { font-size: 1.02rem; margin: 1.6em 0 0.5em; color: var(--text); }
.prose h2 + h3 { margin-top: 1em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: 0.3em 0; }
.prose li > ul { margin: 0.3em 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose blockquote {
  margin: 1.4em 0; padding: 2px 18px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text-dim);
}
.prose blockquote p { margin: 0.7em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }

.anchor {
  color: var(--text-faint); opacity: 0; margin-left: -1.1em; padding-right: 0.35em;
  font-weight: 400; text-decoration: none; transition: opacity var(--t);
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }

/* inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.12em 0.4em; border-radius: 6px; color: var(--accent-2);
  word-break: break-word;
}
:root[data-theme="light"] .prose :not(pre) > code { color: var(--accent); }

/* code blocks */
.prose pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; margin: 1.3em 0; font-size: 0.86rem; line-height: 1.6;
  box-shadow: var(--shadow);
}
.prose pre code { font-family: var(--font-mono); color: #e6ebef; background: none; border: 0; padding: 0; }
/* terminal transcripts (any block with a `$ ` command line; build.py tags them .sh) */
.prose pre.sh { background: var(--term-bg); border-color: var(--border-strong); }
.prose pre.sh code { color: #c8ccdf; }

/* tables */
.prose table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose thead th { color: var(--text); font-weight: 650; border-bottom: 2px solid var(--border-strong); background: var(--surface); }
.prose tbody tr:hover { background: var(--surface-2); }
.prose td code { white-space: nowrap; }

/* shell-session tokens */
.tok-prompt { color: var(--sh-prompt); font-weight: 700; }
.tok-cmd { color: var(--sh-cmd); font-weight: 600; }
.tok-flag { color: var(--sh-flag); }
.tok-str { color: var(--sh-str); }
.tok-comment { color: var(--sh-comment); font-style: italic; }
.tok-out { color: var(--sh-out); }
.tok-path { color: var(--sh-path); }
.tok-hash { color: var(--sh-hash); }

/* ============================================================ cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 1.4em 0 2em; }
.lede { color: var(--text-dim); font-size: 1.05rem; }
.card {
  position: relative; display: block; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform var(--t), border-color var(--t), background var(--t);
}
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent-border); background: var(--surface-2); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }
.card-go { position: absolute; top: 16px; right: 18px; color: var(--accent); opacity: 0; transition: opacity var(--t), transform var(--t); }
.card:hover .card-go { opacity: 1; transform: translateX(2px); }

/* ============================================================ footer */
.sitefooter { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 24px 20px; display: flex; flex-wrap: wrap;
  gap: 14px; justify-content: space-between; align-items: center; color: var(--text-faint); font-size: 0.9rem;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); }

/* ============================================================ search modal */
.search-modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(5, 6, 12, 0.6);
  backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.search-modal[hidden] { display: none; }
.search-box {
  width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; max-height: 70vh; display: flex; flex-direction: column;
}
.search-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text);
  font-size: 1.05rem; padding: 18px 20px; outline: none; font-family: var(--font-sans);
}
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.search-empty { padding: 22px; color: var(--text-faint); text-align: center; }
.search-result a {
  display: block; padding: 10px 14px; border-radius: 9px; color: var(--text);
}
.search-result a:hover, .search-result.active a { background: var(--accent-soft); text-decoration: none; }
.sr-sec { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); }
.sr-title { display: block; font-weight: 600; margin: 2px 0; }
.sr-text { display: block; font-size: 0.86rem; color: var(--text-dim); }
.search-results mark { background: transparent; color: var(--accent-2); font-weight: 700; }
.search-foot { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.8rem; display: flex; gap: 14px; }
kbd {
  font-family: var(--font-mono); font-size: 0.78em; background: var(--surface-3); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text-dim);
}

/* ============================================================ buttons (shared) */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.96rem;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: all var(--t); font-family: var(--font-sans);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }

/* ============================================================ responsive */
@media (max-width: 1080px) {
  .layout-sidebar { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .mainnav {
    position: fixed; top: 60px; left: 0; right: 0; flex-direction: column; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px;
    transform: translateY(-130%); transition: transform 0.25s ease; z-index: 90; margin: 0;
    box-shadow: var(--shadow);
  }
  body.nav-open .mainnav { transform: translateY(0); }
  .mainnav a { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .search-hint { display: none; }
  .search-trigger { padding: 0 10px; }
  .layout-sidebar { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    position: fixed; top: 60px; bottom: 0; left: 0; width: 280px; max-width: 84vw; z-index: 95;
    background: var(--surface); border-right: 1px solid var(--border); padding: 20px 16px;
    transform: translateX(-110%); transition: transform 0.25s ease; max-height: none;
  }
  body.side-open .sidebar { transform: translateX(0); }
  .side-toggle { display: inline-flex !important; }
}
@media (min-width: 861px) { .side-toggle { display: none; } }

@media (max-width: 600px) {
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .cta-mini { display: none; }
  .page-head { padding: 28px 0 4px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  /* On phones, wrap long code lines so a block fits the screen instead of scrolling sideways
     (indentation is preserved by pre-wrap). */
  .prose pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; }
  .prose pre code { white-space: inherit; }
  /* Action buttons can't push past a narrow block; let them wrap within it. */
  .code-actions { max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: flex-end; }
}

/* mobile sidebar toggle button (injected on doc pages) */
.side-toggle {
  display: none; align-items: center; gap: 8px; margin: 16px 0 0; padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
  color: var(--text); cursor: pointer; font-family: var(--font-sans); font-weight: 600; font-size: 0.9rem;
}

/* ============================================================ landing */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 460px at 72% -8%, var(--bg-grad-1), transparent 60%),
    radial-gradient(800px 400px at 0% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 55%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--max); margin: 0 auto; padding: 72px 20px 64px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--text);
  font-size: 0.82rem; font-weight: 500; margin-bottom: 22px;
}
.hero-pill b { color: var(--accent-2); font-weight: 700; }
.hero h1 { font-size: clamp(2.2rem, 1.3rem + 4vw, 3.5rem); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 18px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 1.18rem; color: var(--text-dim); max-width: 52ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-meta { margin-top: 22px; color: var(--text-faint); font-size: 0.86rem; display: flex; gap: 18px; flex-wrap: wrap; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }

.hero-card {
  background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.hero-card .winbar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.hero-card .winbar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.hero-card .winbar i:nth-child(1) { background: #ff5f57; }
.hero-card .winbar i:nth-child(2) { background: #febc2e; }
.hero-card .winbar i:nth-child(3) { background: #28c840; }
.hero-card .winbar span { margin-left: 8px; color: var(--text-faint); font-size: 0.78rem; font-family: var(--font-mono); }
.hero-card pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 0.82rem; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hero-copy { min-width: 0; }
.hero-vis { min-width: 0; }
.hero-card .term { border-top: 1px dashed var(--border); background: var(--term-bg); color: #c8ccdf; }
.hero-card .term .prompt { color: var(--sh-prompt); font-weight: 700; }

.section { max-width: var(--max); margin: 0 auto; padding: 64px 20px; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--accent-2); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); letter-spacing: -0.025em; margin: 8px 0 12px; }
.section-head p { color: var(--text-dim); font-size: 1.06rem; margin: 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: border-color var(--t), transform var(--t);
}
.section-alt .feature { background: var(--bg); }
.feature:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.feature .ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
}
.feature h3 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split-rev .copy { order: 2; }
.split-rev .vis { order: 1; }
.platforms { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.plat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 0.92rem; font-weight: 500; }
.plat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.plat-on::before { background: #28c840; }
.plat-soon { color: var(--text-dim); }
.plat-soon::before { background: var(--border-strong); }
.plat small { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.66rem; opacity: 0.7; }
.split .copy h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); letter-spacing: -0.02em; margin: 0 0 14px; }
.split .copy p { color: var(--text-dim); font-size: 1.04rem; }
.split .copy .eyebrow { color: var(--accent-2); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; }
.codecard { background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.codecard .winbar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.codecard .winbar i { width: 11px; height: 11px; border-radius: 50%; }
.codecard .winbar i:nth-child(1) { background: #ff5f57; } .codecard .winbar i:nth-child(2) { background: #febc2e; } .codecard .winbar i:nth-child(3) { background: #28c840; }
.codecard .winbar span { margin-left: 8px; color: var(--text-faint); font-size: 0.78rem; font-family: var(--font-mono); }
.codecard pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 0.82rem; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.split .vis, .split .copy { min-width: 0; }
.codecard .term { border-top: 1px dashed var(--border); background: var(--term-bg); color: #c8ccdf; }
.codecard .term .prompt { color: var(--sh-prompt); font-weight: 700; }

.cta-band { text-align: center; padding: 80px 20px; background: radial-gradient(900px 360px at 50% 120%, var(--bg-grad-1), transparent 70%); }
.cta-band h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.3rem); letter-spacing: -0.025em; margin: 0 0 12px; }
.cta-band p { color: var(--text-dim); font-size: 1.1rem; max-width: 50ch; margin: 0 auto 26px; }
.cta-band .hero-cta { justify-content: center; }

@media (max-width: 860px) {
  /* minmax(0, …) lets the single column shrink below the code's longest line, so a wide code card
     can't push the full-width landing page past the viewport. The card code wraps to fit; the CTA
     and meta rows wrap rather than overflow. */
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 48px 20px 44px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .split .vis { order: -1; }
  .hero-cta, .hero-meta { flex-wrap: wrap; }
  .hero-card pre, .codecard pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ============================================================ code actions */
.code-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0;
  transition: opacity var(--t);
}
.prose pre:hover .code-actions, .code-actions:focus-within { opacity: 1; }
.code-btn {
  font-family: var(--font-sans); font-size: 0.74rem; font-weight: 600; cursor: pointer;
  padding: 4px 9px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-dim); text-decoration: none; transition: all var(--t);
}
.code-btn:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.code-btn:disabled { opacity: 0.6; cursor: default; }
@media (hover: none) { .code-actions { opacity: 1; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================================ review-round fixes */
/* Visible keyboard focus everywhere (outlines were stripped on inputs/buttons). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.search-input:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.btn:focus-visible, .card:focus-visible { outline-offset: 3px; }

/* Mobile sidebar drawer backdrop. */
.drawer-backdrop { position: fixed; inset: 60px 0 0; background: rgba(5,6,12,0.5); z-index: 94; }
.drawer-backdrop[hidden] { display: none; }
@media (min-width: 861px) { .drawer-backdrop { display: none !important; } }

/* On touch screens the code-action buttons are always visible — keep them off the code. */
@media (hover: none) {
  .prose pre { padding-top: 40px; }
  .code-actions { top: 8px; }
}

/* ============================================================ landing visuals (no-CLI homepage) */
/* Mini file-tree cards: the hero "your project, versioned" visual and the you/assistant pair. */
.mini-tree {
  font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.9;
  padding: 16px 18px; margin: 0; list-style: none;
}
.mini-tree li { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.mini-tree .ind { display: inline-block; width: 1.1em; }
.mini-tree .dir { color: var(--accent-2); font-weight: 600; }
.mini-tree .size { margin-left: auto; font-size: 0.74rem; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.mini-tree .badge-new { margin-left: auto; font-size: 0.72rem; color: var(--accent); border: 1px solid var(--accent-border); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.tree-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.tree-card .tree-head { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-faint); }
.tree-card .tree-foot { padding: 10px 16px; border-top: 1px dashed var(--border); font-size: 0.84rem; color: var(--text-dim); }
.tree-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tree-pair .you .tree-head { color: var(--accent-2); }
.tree-pair .agent .tree-head { color: var(--accent); }
@media (max-width: 600px) { .tree-pair { grid-template-columns: minmax(0, 1fr); } }

/* Version timeline dots under the hero tree. */
.timeline { display: flex; align-items: center; gap: 0; padding: 14px 18px 16px; border-top: 1px dashed var(--border); }
.timeline .tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.timeline .tl-dot.tl-old { background: var(--border-strong); }
.timeline .tl-line { height: 2px; background: var(--border-strong); flex: 1 1 0; }
.timeline .tl-label { margin-left: 14px; font-size: 0.8rem; color: var(--text-faint); white-space: nowrap; }

/* Numbered three-step row. */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.section-alt .step { background: var(--bg); }
.step .n {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
  font-weight: 700; font-size: 1.1rem;
}
.step h3 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

/* FAQ accordion — native details/summary, no JS. */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
.section-alt .faq-item { background: var(--bg); }
.faq-item summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; color: var(--accent); font-weight: 700; width: 1em; flex: 0 0 auto; }
.faq-item[open] summary::before { content: "–"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-a { padding: 12px 18px 16px 42px; color: var(--text-dim); font-size: 0.96rem; }
.faq-a p { margin: 0; }

/* Compact expert strip ("Coming from Perforce or Git?"). */
.expert-strip {
  max-width: 860px; margin: 0 auto; display: flex; gap: 18px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px;
  flex-wrap: wrap;
}
.expert-strip h2 { font-size: 1.05rem; margin: 0; white-space: nowrap; }
.expert-strip p { margin: 0; color: var(--text-dim); font-size: 0.95rem; flex: 1 1 320px; }
