/* ============================================================
   Тетива — site styles. v1.0.
   Plain CSS. No build step. No theme toggle in v1
   (brief is strict: cookie banner + copy button only).
   Dark prefers-color-scheme block is kept as a courtesy.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Mona+Sans:wght@400;500;600;700;800&family=Newsreader:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Warm-cream page, dark-terminal panels, single burgundy accent. */
  --bg:           #F5F1E8;
  --bg-elev:      #FBF8F1;
  --bg-sunken:    #EFEADD;
  --fg:           #1F1A14;
  --fg-2:         #44382C;
  --fg-muted:     #6B6359;
  --fg-subtle:    #9A9085;
  --border:       #E0D8C8;
  --border-strong:#C9C0AD;
  --accent:       #6B1F2B;
  --accent-hover: #561822;
  --accent-fg:    #FBF8F1;
  --accent-soft:  rgba(107, 31, 43, 0.07);
  --accent-line:  rgba(107, 31, 43, 0.22);
  --good:         #2D5A3D;

  /* Terminal panel palette. */
  --code-bg:      #1A1814;
  --code-fg:      #ECE6D9;
  --code-dim:     #8A8378;
  --code-accent:  #D88B9B;
  --code-green:   #87B299;
  --code-blue:    #8FAAC4;
  --code-yellow:  #D9B569;
  --code-red:     #C77383;
  --code-border:  #2D2820;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  --container:        1180px;
  --container-narrow: 880px;

  --font-sans: 'Mona Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #16130E;
    --bg-elev:      #1D1913;
    --bg-sunken:    #100E0A;
    --fg:           #ECE6D9;
    --fg-2:         #C9C0AD;
    --fg-muted:     #9A9085;
    --fg-subtle:    #6B6359;
    --border:       #2D2820;
    --border-strong:#3F3829;
    --accent:       #C77383;
    --accent-hover: #D6889A;
    --accent-fg:    #16130E;
    --accent-soft:  rgba(199, 115, 131, 0.10);
    --accent-line:  rgba(199, 115, 131, 0.28);
    --good:         #87B299;
    --code-bg:      #0E0C09;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  /* Prevent stray horizontal overflow from long pre-formatted lines,
     wide SVGs, or grid children that resolve to their min-content size. */
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-fg); }

a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
.nostyle, .nostyle:hover { text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.028em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -0.025em; }
h3 { font-size: 1.15rem; line-height: 1.3; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; text-wrap: pretty; }
.lede { font-family: var(--font-serif); font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.5; color: var(--fg-2); font-weight: 400; }
.serif { font-family: var(--font-serif); font-weight: 400; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--fg-muted); }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--fg);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============================================================
   Layout
   ============================================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--container-narrow); }

.section { padding: 5rem 0; border-top: 1px solid var(--border); }
.section.first { border-top: none; }
.section-hero { padding: 5rem 0 3.5rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .split-2 { grid-template-columns: 1fr; gap: 28px; } }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; height: 62px; gap: 32px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); text-decoration: none;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -0.025em;
}
.brand svg { display: block; height: 22px; width: auto; }
.brand:hover { text-decoration: none; }

.nav { display: flex; gap: 26px; align-items: center; flex: 1; }
.nav a {
  font-size: 0.94rem;
  color: var(--fg-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--fg); border-bottom-color: var(--accent); }
.nav a.active { color: var(--fg); border-bottom-color: var(--accent); }

.header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); text-decoration: none; }
.icon-btn svg { width: 16px; height: 16px; }

.menu-toggle { display: none; }
@media (max-width: 880px) {
  .site-header .container { gap: 12px; }
  .nav {
    position: fixed; inset: 62px 0 0 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg);
    padding: 24px;
    border-top: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.22s ease;
  }
  .nav a { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .menu-toggle { display: inline-flex; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-elev); border-color: var(--fg-muted); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--fg-2); border: none; padding: 9px 4px; }
.btn-ghost:hover { color: var(--fg); text-decoration: none; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1.5rem 0; }
.btn-arrow::after { content: "→"; font-weight: 400; }

/* ============================================================
   Code blocks & diff
   ============================================================ */
.code-block {
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--code-border);
  overflow-x: auto;
  position: relative;
}
.code-block .prompt { color: var(--code-dim); user-select: none; }
.code-block .cmd { color: var(--code-fg); }
.code-block .out { color: var(--code-dim); }
.code-block .green { color: var(--code-green); }
.code-block .red { color: var(--code-red); }
.code-block .blue { color: var(--code-blue); }
.code-block .yellow { color: var(--code-yellow); }
.code-block .accent { color: var(--code-accent); }
.code-block.compact { padding: 12px 16px; font-size: 0.84rem; }

/* Install block: code + copy button laid side-by-side. */
.install-block { position: relative; }
.install-block .copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(236, 230, 217, 0.08);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.install-block .copy-btn:hover { background: rgba(236, 230, 217, 0.16); }
.install-block .copy-btn.copied { color: var(--code-green); border-color: var(--code-green); }

/* Diff highlighting */
.diff-line { display: block; white-space: pre; padding: 0 4px; }
.diff-line.add { background: rgba(135, 178, 153, 0.13); color: var(--code-green); }
.diff-line.del { background: rgba(199, 115, 131, 0.13); color: var(--code-red); }
.diff-line.add::before { content: "+ "; color: var(--code-green); }
.diff-line.del::before { content: "- "; color: var(--code-red); }
.diff-line.ctx { color: var(--code-dim); }
.diff-line.ctx::before { content: "  "; }

/* CI checklist */
.ci-check {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.95;
  color: var(--fg-2);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.ci-check h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ci-check .ok { color: var(--good); margin-right: 6px; }
.ci-check .dim { color: var(--fg-subtle); font-size: 0.78rem; }
.ci-check .row { display: flex; align-items: baseline; gap: 4px; }
.ci-check .row .label { flex: 1; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 30px;
}
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .cards-2 { grid-template-columns: 1fr; } }
.card h3 { margin-top: 0; font-size: 1.18rem; }
.card .card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
   Hero
   ============================================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 1000px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero-grid h1 { margin-bottom: 0.5em; }
.hero-grid .lede { margin-bottom: 1.4em; }

/* Hero stage — static PR-view composition. */
.hero-stage {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(31, 26, 20, 0.18);
}
.hero-stage .hs-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-border);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--code-dim);
}
.hero-stage .hs-bar .dots { display: flex; gap: 6px; }
.hero-stage .hs-bar .dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--code-border);
}
.hero-stage .hs-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--code-fg);
  min-height: 360px;
}
.hero-stage .hs-pane { padding: 18px 20px; }
.hero-stage .hs-pane + .hs-pane { border-left: 1px solid var(--code-border); }
.hero-stage .hs-label {
  font-size: 0.7rem;
  color: var(--code-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--code-border);
}
.hero-stage .hs-pr-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.hero-stage .hs-pr-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--code-green);
  box-shadow: 0 0 0 3px rgba(135, 178, 153, 0.18);
}
.hero-stage .hs-pr-title { color: var(--code-fg); font-weight: 500; font-size: 0.86rem; }
.hero-stage .hs-pr-num { color: var(--code-dim); margin-left: auto; }
.hero-stage .hs-blink::after {
  content: "▌"; color: var(--code-accent);
  animation: blink 1.05s infinite step-end;
}
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 700px) {
  .hero-stage .hs-body { grid-template-columns: 1fr; min-height: 0; }
  .hero-stage .hs-pane + .hs-pane { border-left: none; border-top: 1px solid var(--code-border); }
}

/* ============================================================
   Diagrams
   ============================================================ */
.diagram {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  padding: 28px;
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; height: auto; min-width: 760px; max-width: 1080px; margin: 0 auto; }
.diagram .node { fill: var(--bg); stroke: var(--fg-2); stroke-width: 1; }
.diagram .node.accent { stroke: var(--accent); }
.diagram .node-text { font-family: var(--font-mono); font-size: 12px; fill: var(--fg); }
.diagram .node-sub  { font-family: var(--font-mono); font-size: 10px; fill: var(--fg-muted); }
.diagram .arrow { stroke: var(--fg-2); stroke-width: 1; fill: none; }
.diagram .arrow.accent { stroke: var(--accent); stroke-width: 1.4; }
.diagram .group-label { font-family: var(--font-mono); font-size: 10.5px; fill: var(--fg-muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.data th, table.data td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data thead th {
  background: var(--bg-sunken);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   Pricing grid (3 tiers)
   ============================================================ */
.pricing {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev);
  margin: 2rem 0;
  font-size: 0.93rem;
}
.pricing > div {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.pricing > div:nth-child(4n) { border-right: none; }
.pricing .row-label { color: var(--fg-muted); font-weight: 500; }
.pricing .tier-head { padding: 22px 18px 18px; }
.pricing .tier-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.015em; }
.pricing .tier-sub { color: var(--fg-muted); font-size: 0.86rem; margin-top: 4px; }
.pricing .tier-price {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--fg);
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pricing .tier-price .per { font-size: 0.85rem; color: var(--fg-muted); }
.pricing .check { color: var(--good); }
.pricing .x { color: var(--fg-subtle); }
.pricing .tier-cta { padding: 18px; border-top: 0; }
.pricing .tier-cta .btn { width: 100%; justify-content: center; }
.pricing .col-team {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 var(--accent-line), inset -1px 0 0 var(--accent-line);
  position: relative;
}
.pricing .team-flag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
  padding: 2px 7px;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
}
@media (max-width: 900px) {
  .pricing { grid-template-columns: 1fr; }
  .pricing > div { border-right: none; }
  .pricing .tier-head { border-top: 2px solid var(--accent-line); padding-top: 22px; }
  .pricing .row-label { background: var(--bg-sunken); }
}

/* ============================================================
   Persona / scenario blocks
   ============================================================ */
.persona-block { padding: 26px 0; border-bottom: 1px solid var(--border); }
.persona-block:last-child { border-bottom: none; }
.persona-block .p-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.persona-block p { font-family: var(--font-serif); font-size: 1.08rem; color: var(--fg); margin: 0; }

/* ============================================================
   Trust signals
   ============================================================ */
.trust-table { font-size: 0.95rem; width: 100%; border-collapse: collapse; }
.trust-table td { padding: 14px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.trust-table td:first-child { color: var(--fg-muted); width: 36%; padding-right: 24px; font-weight: 500; }
.trust-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Final CTA
   ============================================================ */
.final-cta { padding: 5.5rem 0; border-top: 1px solid var(--border); background: var(--bg-sunken); }
.final-cta h2 { margin-bottom: 1rem; }

/* ============================================================
   Page hero (non-home pages)
   ============================================================ */
.page-hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--border); }
.page-hero h1 { max-width: 22ch; }
.page-hero .lede { max-width: 56ch; }

/* ============================================================
   Doc list / link list
   ============================================================ */
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px solid var(--border); }
.linklist li:last-child { border-bottom: none; }
.linklist a {
  display: flex; align-items: baseline; gap: 16px;
  padding: 20px 0;
  text-decoration: none; color: var(--fg);
}
.linklist a:hover { color: var(--accent); }
.linklist .l-title { font-weight: 500; font-size: 1.05rem; }
.linklist .l-sub { color: var(--fg-muted); font-size: 0.9rem; flex: 1; }
.linklist .l-arrow { color: var(--fg-subtle); }
.linklist a:hover .l-arrow { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 3rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid .footer-brand .muted { font-size: 0.92rem; max-width: 30ch; margin-top: 12px; }
.footer-grid h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { font-size: 0.93rem; color: var(--fg-2); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* ============================================================
   Cookie banner
   ============================================================ */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: 0 12px 36px -12px rgba(31, 26, 20, 0.18);
  z-index: 100;
}
.cookie-banner h4 { margin: 0 0 6px; font-size: 0.95rem; }
.cookie-banner p { font-size: 0.86rem; color: var(--fg-2); margin: 0 0 14px; }
.cookie-banner .btn-row { margin: 0; gap: 8px; }
.cookie-banner .btn { padding: 7px 14px; font-size: 0.85rem; }
.cookie-banner .more {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  margin-top: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.cookie-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: none; }
.cookie-banner.expanded .cookie-detail { display: block; }
.cookie-cat {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.84rem;
}
.cookie-cat .desc { color: var(--fg-muted); font-size: 0.78rem; }
.cookie-cat input { margin-top: 4px; }

/* ============================================================
   Tiny helpers
   ============================================================ */
.text-center { text-align: center; }
.max-prose { max-width: 64ch; }
.max-prose-serif { max-width: 60ch; font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.65; color: var(--fg-2); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================================
   Legal document pages
   ============================================================ */
.legal-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 72px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 24px 5rem;
}
@media (max-width: 960px) {
  .legal-shell { grid-template-columns: 1fr; gap: 0; padding-top: 2rem; }
}
.legal-doc { max-width: 68ch; min-width: 0; }
.legal-doc .crumb {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 1.75rem;
  display: inline-block;
}
.legal-doc .crumb a { color: var(--fg-muted); text-decoration: none; }
.legal-doc .crumb a:hover { color: var(--accent); }
.legal-doc h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.legal-doc .doc-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0 0 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-doc h2 {
  font-size: 1.32rem;
  margin: 3rem 0 1rem;
  letter-spacing: -0.018em;
  scroll-margin-top: 84px;
}
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc h3 {
  font-size: 1.02rem;
  margin: 1.8rem 0 0.6rem;
  font-weight: 600;
  scroll-margin-top: 84px;
  color: var(--fg);
}
.legal-doc p {
  font-size: 0.97rem;
  line-height: 1.68;
  color: var(--fg);
  margin: 0 0 0.9em;
}
.legal-doc p .n,
.legal-doc h3 .n {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.88em;
  margin-right: 0.55em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.legal-doc ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.2em;
}
.legal-doc ul li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.5em;
  font-size: 0.97rem;
  line-height: 1.62;
}
.legal-doc ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--fg-subtle);
}
.legal-doc a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}
.legal-doc a:hover { text-decoration-color: var(--accent); }
.legal-doc code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 3px;
}
.legal-doc hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Lead block (consent preamble) */
.legal-doc .lead-block {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0 0 2.5rem;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--border);
}
.legal-doc .lead-block p { font-size: inherit; font-family: inherit; color: inherit; line-height: inherit; }

/* Requisites card */
.legal-doc .requisites {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 22px 26px;
  margin: 1.5rem 0 2rem;
}
.legal-doc .requisites .req-name {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.legal-doc .requisites ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-doc .requisites ul li {
  padding-left: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.55em;
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 16px;
}
.legal-doc .requisites ul li::before { display: none; }
.legal-doc .requisites ul li .k {
  color: var(--fg-muted);
}
.legal-doc .requisites ul li .v { color: var(--fg); }
.legal-doc .requisites ul li .v.mono,
.legal-doc .requisites ul li .v code {
  font-family: var(--font-mono);
  background: transparent;
  padding: 0;
}
.legal-doc .requisites .note {
  margin: 1.1rem 0 0;
  font-size: 0.86rem;
  color: var(--fg-muted);
  font-style: italic;
}
@media (max-width: 640px) {
  .legal-doc .requisites ul li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .legal-doc .requisites ul li .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
}

/* Related documents at end */
.legal-doc .related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.legal-doc .related h2 { margin-top: 0; }
.legal-doc .related ul li { font-size: 0.96rem; }

/* TOC desktop */
.legal-toc {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 4px;
}
.legal-toc h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  font-weight: 600;
  margin: 0 0 0.85rem;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}
.legal-toc li { margin: 0; padding: 0; }
.legal-toc a {
  display: block;
  padding: 5px 14px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.83rem;
  line-height: 1.45;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.legal-toc a:hover { color: var(--fg); }
.legal-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.legal-toc a .num {
  display: inline-block;
  width: 1.8em;
  font-family: var(--font-mono);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.legal-toc a.active .num { color: var(--accent); }

/* TOC mobile (collapsible) */
.legal-toc-mobile { display: none; }
@media (max-width: 960px) {
  .legal-toc { display: none; }
  .legal-toc-mobile {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-elev);
    margin: 0 0 2.5rem;
  }
  .legal-toc-mobile summary {
    list-style: none;
    cursor: pointer;
    padding: 13px 18px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--fg-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .legal-toc-mobile summary::-webkit-details-marker { display: none; }
  .legal-toc-mobile summary::after { content: "+"; color: var(--fg-muted); font-size: 1.1rem; }
  .legal-toc-mobile[open] summary::after { content: "−"; }
  .legal-toc-mobile ol {
    list-style: none;
    margin: 0;
    padding: 8px 18px 16px;
    border-top: 1px solid var(--border);
  }
  .legal-toc-mobile li { margin: 0; }
  .legal-toc-mobile a {
    color: var(--fg-2);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 6px 0;
  }
  .legal-toc-mobile a .num {
    font-family: var(--font-mono);
    color: var(--fg-subtle);
    margin-right: 0.6em;
    font-size: 0.85em;
  }
}

/* ============================================================
   Pricing Block 5 — Overage callout + three-zone gauge
   Lifted out of the trust-table because this is the only concrete
   promise on the page about how customer money behaves under load.
   Visual language: brand-identity §4.6.3 — thin lines, monochrome
   with single accent, JetBrains Mono labels. No SaaS-infographic
   gradients, drop-shadows, or rounded zone tiles.
   ============================================================ */
.overage-card {
  margin: 2.25rem 0 0;
  padding: 26px 28px 22px;
  max-width: 920px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--r-md);
}
.overage-card .overage-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.overage-card .overage-text {
  margin: 0;
  max-width: 70ch;
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--fg);
}
.overage-figure {
  margin: 22px 0 4px;
  padding: 18px 4px 2px;
  border-top: 1px solid var(--border);
}
.overage-gauge {
  display: block;
  width: 100%;
  height: auto;
  max-width: 760px;
  margin: 0 auto;
}
.overage-gauge .zone-incl {
  fill: none;
  stroke: var(--fg-2);
  stroke-width: 1;
}
.overage-gauge .zone-soft {
  fill: var(--accent-soft);
  stroke: var(--fg-2);
  stroke-width: 1;
}
.overage-gauge .ceiling {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: square;
}
.overage-gauge .tick {
  stroke: var(--fg-muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.overage-gauge .warn-dot { fill: var(--accent); }
.overage-gauge .label-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  fill: var(--accent);
  letter-spacing: 0;
}
.overage-gauge .label-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--fg-muted);
  letter-spacing: 0.03em;
}
.overage-gauge .label-zone {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--fg-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.overage-gauge .warn-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-anchor: middle;
}

@media (max-width: 640px) {
  .overage-card { padding: 22px 20px 18px; }
  .overage-figure { padding: 14px 0 2px; }
  /* SVG remains legible — it has internal labels, viewBox scales. */
}

/* ============================================================
   Pricing FAQ accordion-style (simple)
   ============================================================ */
.faq-item { padding: 22px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin: 0 0 8px; font-size: 1.06rem; }
.faq-item p { font-family: var(--font-serif); color: var(--fg-2); margin: 0; }
.faq-item p + p { margin-top: 0.6em; }

/* ============================================================
   Mobile adaptation fixes
   Added after the rest of the stylesheet so they cleanly override.
   Goal: no horizontal scroll on any phone, header fits at 360px,
   hero terminal pane scrolls inside itself instead of pushing the body.
   ============================================================ */

/* Let grid/flex children shrink below their content size so long
   pre-formatted strings (terminal output, diff lines) don't make
   the column resolve to min-content and overflow the viewport. */
.hero-grid,
.hero-grid > *,
.split-2,
.split-2 > *,
.cards-2,
.cards-2 > *,
.footer-grid,
.footer-grid > * { min-width: 0; }

main { max-width: 100%; overflow-x: clip; }

/* Hero terminal: shrink-to-fit and scroll long lines inside the pane,
   not on the page body. Each pane keeps its own scroll. */
.hero-stage,
.hero-stage .hs-body,
.hero-stage .hs-pane { min-width: 0; }
.hero-stage .hs-pane { overflow-x: auto; }
.hero-stage .hs-bar {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.hero-stage .hs-bar > span:last-child {
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.hero-stage .hs-pr-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

/* Code blocks must respect their parent width. */
.code-block { max-width: 100%; min-width: 0; }
.install-block .copy-btn { z-index: 1; }

/* Image / SVG safety net. */
img, svg { max-width: 100%; }

@media (max-width: 760px) {
  /* On phones, allow diff lines to wrap so the diff card doesn't
     need a sideways scrollbar to read a pull request preview. */
  .diff-line,
  .hero-stage .diff-line,
  .code-block .diff-line {
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Slightly tighter terminal font on small screens. */
  .hero-stage .hs-body { font-size: 0.74rem; }
  .hero-stage .hs-pane { padding: 16px 14px; }
}

/* ---------- Header — small phones ---------- */
@media (max-width: 880px) {
  .site-header .container { padding: 0 16px; }
  /* Mobile menu panel: must be a fully opaque overlay so page content
     does not bleed through.

     IMPORTANT — the .site-header uses backdrop-filter, which in Chrome /
     Safari creates a CONTAINING BLOCK for fixed-positioned descendants.
     That meant `inset: 62px 0 0 0` positioned the drawer relative to the
     62px-tall header (not the viewport), collapsing its painted area to
     a 0px strip and letting the menu links render outside the background.

     Fix: set top/left/right explicitly, force bottom: auto, and use a
     fixed height computed against the viewport (dvh handles mobile URL
     bar collapse correctly). */
  .nav {
    background-color: #f6f4ef; /* solid fallback (matches --bg light) */
    background-color: var(--bg);
    z-index: 60;
    padding: 18px 20px 24px;
    box-shadow: -8px 0 24px -16px rgba(0, 0, 0, 0.25);
    top: 62px;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 100vh;        /* fallback for older browsers */
    height: calc(100dvh - 62px);
    overflow-y: auto;
  }
  /* Dim the page behind the open drawer so the layering reads. */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 62px 0 0 0;
    background: rgba(20, 12, 4, 0.32);
    z-index: 55;
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  /* At very narrow widths, hide the standalone GitHub icon so the
     primary CTA + hamburger always fit cleanly. GitHub is still
     reachable from the mobile nav drawer and the footer. */
  .site-header .icon-btn:not(.menu-toggle) { display: none; }
  .header-actions { gap: 6px; }
  .site-header .btn-primary { padding: 8px 14px; font-size: 0.9rem; }
  .site-header .container { gap: 8px; }
  .brand svg { height: 20px; }
}

/* ---------- Hero / sections — phone spacing ---------- */
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .section { padding: 3.5rem 0; }
  .section-hero { padding: 2.5rem 0 2rem; }
  .page-hero { padding: 2.5rem 0 2rem; }
  .final-cta { padding: 4rem 0; }

  h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .lede { font-size: 1.05rem; }

  .btn-lg { padding: 12px 18px; font-size: 0.95rem; }
  .btn-row { gap: 10px; }

  .card { padding: 22px; }
}

/* ---------- Diagram — fall back to a stacked text alt on phones ---------- */
@media (max-width: 760px) {
  .diagram { padding: 18px; }
  .diagram svg { min-width: 0; }
}

/* ---------- Pricing — phone version ----------
   IMPORTANT: stay a comparison table on mobile.
   Stacking each tier vertically destroys the whole point of a pricing
   matrix — the user must be able to see Free / Solo / Team side-by-side
   for every row. So on phones we keep three tier columns (compact) and
   turn the desktop "row label" column into a full-width section band
   that sits above each feature row. */
@media (max-width: 900px) {
  .pricing {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    font-size: 0.88rem;
  }

  /* Row label = full-width band above the three values. */
  .pricing .row-label {
    grid-column: 1 / -1;
    background: var(--bg-sunken);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    font-weight: 600;
    border-right: none;
  }

  /* The two empty row-label cells we use to align the header & CTA rows
     on desktop have nothing to do on phones — drop them. */
  .pricing .row-label.tier-head,
  .pricing .row-label.tier-cta { display: none; }

  /* Value cells: compact, centered, no right border on the last column. */
  .pricing > div {
    padding: 12px 8px;
    text-align: center;
    word-break: break-word;
  }
  .pricing > div:nth-child(4n) { border-right: none; }
  /* With row-label spanning the full row, the next three children fill
     columns 1-2-3. So column 3 = no right border. We can target it by
     the position right before each row-label or .tier-cta wrap.        */
  .pricing .col-team { border-right: none; }

  /* Tier header cells — tighter, kept readable. Stays at top of grid. */
  .pricing .tier-head {
    padding: 16px 10px 14px;
    text-align: left;
  }
  .pricing .tier-name { font-size: 1rem; }
  .pricing .tier-sub { font-size: 0.75rem; line-height: 1.3; }
  .pricing .tier-price { font-size: 1.05rem; margin-top: 6px; }
  .pricing .tier-price .per { font-size: 0.7rem; }
  .pricing .team-flag {
    font-size: 0.6rem;
    padding: 2px 6px;
    margin-top: 8px;
  }

  /* CTA buttons — keep one per tier column. */
  .pricing .tier-cta { padding: 14px 8px 18px; border-top: none; text-align: center; }
  .pricing .tier-cta .btn {
    width: 100%;
    padding: 9px 10px;
    font-size: 0.82rem;
    justify-content: center;
  }

  /* Team accent: vertical column highlight that runs through every row. */
  .pricing .col-team {
    background: var(--accent-soft);
    box-shadow: inset 1px 0 0 var(--accent-line), inset -1px 0 0 var(--accent-line);
  }

  /* Pin the tier-name row to the top of the viewport while the user
     scrolls down through features — otherwise they lose track of which
     column is which. Sits below the sticky site header (62px). */
  .pricing .tier-head {
    position: sticky;
    top: 62px;
    z-index: 1;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .pricing .tier-head.col-team { background: var(--accent-soft); }
}

@media (max-width: 480px) {
  /* Very narrow phones — push compactness one notch further. */
  .pricing { font-size: 0.82rem; }
  .pricing > div { padding: 10px 6px; }
  .pricing .tier-head { padding: 14px 8px 12px; }
  .pricing .tier-name { font-size: 0.95rem; }
  .pricing .tier-sub { font-size: 0.7rem; }
  .pricing .tier-price { font-size: 0.95rem; }
  .pricing .row-label { padding: 8px 12px; font-size: 0.68rem; }
  .pricing .tier-cta .btn { padding: 8px 6px; font-size: 0.76rem; }
}

/* ---------- Trust table & data tables — keep cells from squishing ---------- */
@media (max-width: 560px) {
  .trust-table td:first-child {
    width: auto;
    padding-right: 12px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .trust-table td { display: block; padding: 8px 0; }
  .trust-table td:first-child { padding-top: 14px; padding-bottom: 2px; border-bottom: none; }
  .trust-table tr:last-child td:last-child { padding-bottom: 14px; }

  table.data th, table.data td { padding: 10px 12px; font-size: 0.9rem; }
}

/* ---------- Cookie banner ---------- */
@media (max-width: 480px) {
  .cookie-banner { bottom: 10px; left: 10px; right: 10px; padding: 14px 16px; }
  .cookie-banner .btn-row { flex-wrap: wrap; }
  .cookie-banner .btn { flex: 1 0 auto; }
}

/* Make sure long URLs / monos in body copy wrap on phones */
@media (max-width: 600px) {
  p code, p a { word-break: break-word; overflow-wrap: anywhere; }
}
