/* ---------- Reset + tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --brand:        #0ea5e9;   /* icy sky blue */
  --brand-2:      #38bdf8;   /* lighter cyan */
  --brand-3:      #0369a1;   /* deeper steel blue */
  --bg:           #f3f7fb;
  --bg-elev:      #ffffff;
  --bg-alt:       #e9eff6;
  --text:         #0b1424;
  --text-2:       #475569;
  --text-3:       #94a3b8;
  --border:       rgba(15, 23, 42, 0.08);
  --shadow:       0 18px 60px -20px rgba(14, 116, 165, 0.28);
  --radius-lg:    18px;
  --radius-md:    12px;
  --radius-sm:    8px;
  --maxw:         1140px;
  --pad:          clamp(20px, 5vw, 56px);
  --font:         -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:         ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --term-bg:        #0b1424;
  --term-bg-2:      #0f1b30;
  --term-text:      #e2e8f0;
  --term-dim:       #64748b;
  --term-ok:        #34d399;
  --term-hl:        #38bdf8;
  --term-prompt:    #facc15;
}

:root[data-theme="dark"],
:root[data-theme="auto"] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg:        #06101e;
    --bg-elev:   #0d1a2d;
    --bg-alt:    #0a1424;
    --text:      #eef4fb;
    --text-2:    #b8c4d4;
    --text-3:    #6b7a8e;
    --border:    rgba(255,255,255,0.07);
    --shadow:    0 24px 80px -20px rgba(0,0,0,0.7);
  }
}
:root[data-theme="dark"] {
  --bg:        #06101e;
  --bg-elev:   #0d1a2d;
  --bg-alt:    #0a1424;
  --text:      #eef4fb;
  --text-2:    #b8c4d4;
  --text-3:    #6b7a8e;
  --border:    rgba(255,255,255,0.07);
  --shadow:    0 24px 80px -20px rgba(0,0,0,0.7);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:hover { color: var(--brand); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

img { max-width: 100%; display: block; }

code, pre { font-family: var(--mono); font-size: 0.92em; }
code {
  background: var(--bg-alt);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.88em;
}
/* inside a code block the surrounding <pre> already provides the frame —
   strip the inline-code background/border so lines don't render boxed. */
pre code {
  background: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; gap: 10px; align-items: center;
  text-decoration: none; color: var(--text);
}
.brand strong { font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  overflow: hidden;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 60%, transparent);
}
.brand-mark img { width: 22px; height: 22px; object-fit: contain; }

.nav-right {
  display: flex; align-items: center; gap: 18px;
}
.nav-right a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.nav-right a:hover { color: var(--text); }
.nav-github { color: var(--brand) !important; font-weight: 600 !important; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all .15s;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .sun { display: none; }
  :root[data-theme="auto"] .theme-toggle .moon { display: inline; }
}

@media (max-width: 740px) {
  .nav-right a { display: none; }
  .nav-right .nav-github { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(60px, 9vw, 110px) 0 clamp(70px, 10vw, 130px);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px circle at 80% -10%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(700px circle at 10% 110%, rgba(14, 165, 233, 0.18), transparent 60%),
    radial-gradient(500px circle at 50% 50%, rgba(125, 211, 252, 0.08), transparent 70%);
  z-index: 0;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
}

.hero h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 16px 0 18px;
}
.grad {
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 55%, var(--brand-3));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 36em;
}
.lede strong { color: var(--text); font-weight: 700; }
.lede em { color: var(--text); font-style: normal; font-weight: 600; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s, background .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: white;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--brand) 55%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero-bullets {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.hero-bullets li {
  font-size: 14px;
  color: var(--text-2);
  padding-left: 22px;
  position: relative;
}
.hero-bullets li::before {
  content: "❄";
  position: absolute; left: 0; top: 0;
  color: var(--brand);
  font-size: 13px;
}

/* ---------- Hero visual: terminal ---------- */
.hero-visual {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
}
.terminal {
  width: 100%;
  background: linear-gradient(165deg, var(--term-bg), var(--term-bg-2));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 30px 80px -25px rgba(2, 12, 28, 0.45),
    0 4px 14px -4px rgba(14, 116, 165, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  color: var(--term-text);
}
.term-chrome {
  display: flex; align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.term-chrome .dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.term-chrome .dot.red    { background: #ff5f57; }
.term-chrome .dot.yellow { background: #febc2e; }
.term-chrome .dot.green  { background: #28c840; }
.term-chrome .term-title {
  flex: 1; text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}
.term-body {
  padding: 18px 20px 20px;
}
.term-body pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--term-text);
  white-space: pre;
  overflow-x: auto;
}
.term-body .p      { color: var(--term-prompt); font-weight: 700; }
.term-body .cmd    { color: var(--term-text); font-weight: 600; }
.term-body .ok     { color: var(--term-ok); font-weight: 700; }
.term-body .dim    { color: var(--term-dim); }
.term-body .hl     { color: var(--term-hl); font-weight: 600; }
.term-body .caret  {
  color: var(--term-hl);
  animation: blink 1.1s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 520px) {
  .term-body pre { font-size: 11.5px; }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(70px, 10vw, 120px) 0;
  position: relative;
}
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.kicker {
  text-transform: uppercase;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--brand);
  margin: 0 0 14px;
}
.section h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 22ch;
  line-height: 1.1;
}
.section-lede {
  font-size: 17px;
  color: var(--text-2);
  max-width: 62ch;
  margin: 0 0 56px;
}
.section-lede strong { color: var(--text); font-weight: 700; }
.section-lede em { color: var(--text); font-style: normal; font-weight: 600; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--brand) 35%, transparent);
}
.card-num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  font-feature-settings: "tnum" 1;
}
.card h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.card-ico {
  display: block;
  width: 30px; height: 30px;
  margin-bottom: 12px;
  color: var(--brand);
}

/* ---------- Demo ---------- */
.demo-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 30px 80px -30px rgba(14, 116, 165, 0.25);
}
.demo-link {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
  transition: transform .15s;
}
.demo-link:hover { transform: translateY(-2px); color: inherit; }
.demo-link img {
  max-width: 100%;
  border-radius: 10px;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.18));
}
.demo-play {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Architecture ---------- */
.arch {
  margin: 0 0 36px;
  padding: 28px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.arch img {
  max-width: min(100%, 920px);
  height: auto;
  border-radius: 6px;
}
.arch figcaption {
  font-size: 14.5px;
  color: var(--text-2);
  text-align: center;
  max-width: 70ch;
}

/* ---------- UI section ---------- */
.ui-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 700px) { .ui-grid { grid-template-columns: 1fr; } }
.ui-feat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex; gap: 12px; align-items: flex-start;
}
.ui-feat .check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
}
.ui-feat p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.ui-feat strong { color: var(--text); }

.ui-shot {
  margin: 0 0 28px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.ui-shot img {
  max-width: min(100%, 1000px);
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.ui-shot figcaption {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  max-width: 60ch;
}

.ui-subhead {
  margin: 8px 0 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 700;
}

.ui-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 22px;
}
@media (max-width: 800px) { .ui-gallery { grid-template-columns: 1fr; } }
.ui-shot-sm {
  margin: 0;
  padding: 10px 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 10px;
}
.ui-shot-sm img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.ui-shot-sm figcaption {
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
  margin: 0 4px;
}
.ui-shot-sm strong { color: var(--text); }

/* clickable screenshot lightbox */
.ui-shot img, .ui-shot-sm img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 10, 20, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 96vw; max-height: 92vh;
  width: auto; height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.7);
}

/* ---------- Install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 900px) { .install-grid { grid-template-columns: 1fr; } }
.install-cmd {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
}
.install-cmd pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.install-cmd .prompt { color: var(--brand); margin-right: 8px; }
.copy-btn {
  position: absolute; top: 16px; right: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-2);
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.copy-btn:hover { color: var(--text); border-color: var(--brand); }
.copy-btn.copied { background: var(--brand); color: white; border-color: var(--brand); }

.install-notes {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
}
.install-notes p { margin: 0 0 8px; font-size: 15px; }
.install-notes ul { padding-left: 18px; margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.install-notes ul li { margin: 4px 0; }

.quickstart {
  margin-top: 32px;
}
.quickstart h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--text-2);
  font-weight: 600;
}
.quickstart-pre {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-x: auto;
  color: var(--text);
}
.quickstart-pre .prompt { color: var(--brand); margin-right: 8px; }
.quickstart-pre .dim    { color: var(--text-3); }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-list details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: border-color .12s;
}
.faq-list details[open] {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--brand) 35%, transparent);
}
.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-weight: 400;
  color: var(--text-3);
  font-size: 22px;
  transition: transform .15s;
}
.faq-list details[open] summary::after { content: "−"; color: var(--brand); }
.faq-list details p {
  margin: 12px 0 4px;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Footer ---------- */
.footer { padding: 56px 0 32px; background: var(--bg-alt); border-top: 1px solid var(--border); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 40px;
  margin-bottom: 32px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.footer ul a { color: inherit; text-decoration: none; }
.footer ul a:hover { color: var(--brand); }
.footer-tag { font-size: 14px; color: var(--text-2); margin: 14px 0 0; line-height: 1.55; }
.copy {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.copy a { color: var(--text-2); }

/* ---------- Docs ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px var(--pad) 96px;
  align-items: start;
}
@media (max-width: 880px) {
  .docs-shell { grid-template-columns: 1fr; padding-top: 20px; }
}

.docs-sidebar {
  position: sticky; top: 76px;
  align-self: start;
  font-size: 14px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}
@media (max-width: 880px) {
  .docs-sidebar {
    position: static; max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    background: var(--bg-elev);
  }
  .docs-sidebar > .docs-nav-inner { display: none; }
  .docs-sidebar[open] > .docs-nav-inner,
  .docs-sidebar.is-static > .docs-nav-inner { display: block; }
}
.docs-sidebar summary {
  display: none;
  cursor: pointer; font-weight: 600; padding: 6px 0;
  list-style: none;
}
.docs-sidebar summary::-webkit-details-marker { display: none; }
@media (max-width: 880px) { .docs-sidebar summary { display: block; } }

.nav-search { position: relative; flex: 1 1 240px; max-width: 360px; min-width: 0; margin: 0 20px; }
.nav-search input {
  width: 100%;
  min-width: 0;
  padding: 7px 36px 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.nav-search input:focus { outline: none; border-color: var(--brand); }
.nav-search input::placeholder { color: var(--text-3); }
.nav-search-kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-alt);
  color: var(--text-3);
  font-size: 11px;
  font-family: inherit;
  pointer-events: none;
}
.nav-search input:focus ~ .nav-search-kbd { display: none; }
@media (max-width: 740px) {
  .nav-search { margin: 0 10px; flex-basis: 120px; }
  .nav-search-kbd { display: none; }
}
.docs-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 60;
  list-style: none;
  margin: 0; padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 60vh;
  overflow-y: auto;
}
.docs-search-results li { margin: 0; }
.docs-search-results a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.docs-search-results a.active,
.docs-search-results a:hover,
.docs-search-results a:focus { background: var(--bg-alt); }
.docs-search-results .r-title { display: block; font-size: 13.5px; font-weight: 600; }
.docs-search-results .r-path { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.docs-nav-group { margin: 0 0 22px; }
.docs-nav-group h5 {
  margin: 0 0 8px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); font-weight: 700;
}
.docs-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.docs-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.docs-nav a:hover { color: var(--text); background: var(--bg-alt); }
.docs-nav a.active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-left-color: var(--brand);
  font-weight: 600;
}

.docs-main { min-width: 0; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin: 0 0 12px; }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Docs prose ---------- */
.docs-prose { max-width: 760px; }
.docs-prose h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  letter-spacing: -0.025em; line-height: 1.08;
  margin: 4px 0 14px; font-weight: 800;
}
.docs-prose .lead {
  font-size: 18px; color: var(--text-2);
  margin: 0 0 36px; line-height: 1.6;
}
.docs-prose h2 {
  font-size: 25px; letter-spacing: -0.015em;
  margin: 52px 0 16px; padding-top: 22px;
  border-top: 1px solid var(--border);
}
.docs-prose h3 { font-size: 18px; margin: 32px 0 10px; letter-spacing: -0.01em; }
.docs-prose p { color: var(--text-2); margin: 0 0 16px; }
.docs-prose strong { color: var(--text); }
.docs-prose ul, .docs-prose ol { color: var(--text-2); margin: 0 0 16px; padding-left: 22px; }
.docs-prose li { margin: 6px 0; }
.docs-prose li::marker { color: var(--text-3); }
.docs-prose a:not(.btn) { color: var(--brand); text-decoration: none; font-weight: 500; }
.docs-prose a:not(.btn):hover { text-decoration: underline; }
.docs-prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* code blocks */
.docs-prose pre {
  margin: 0 0 18px;
  background: linear-gradient(165deg, var(--term-bg), var(--term-bg-2));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  color: var(--term-text);
  box-shadow: 0 18px 50px -28px rgba(2,12,28,0.5);
}
.docs-prose pre .p,
.docs-prose pre .prompt { color: var(--term-prompt); }
.docs-prose pre .c,
.docs-prose pre .dim { color: var(--term-dim); }
.docs-prose pre .ok { color: var(--term-ok); }
.docs-prose pre .hl { color: var(--term-hl); }
.docs-prose pre .k { color: #c4b5fd; }   /* yaml key / keyword */
.docs-prose pre .s { color: #7dd3fc; }   /* string / value */
.docs-prose :not(pre) > code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.42em;
  font-size: 0.86em;
}

/* callouts */
.callout {
  display: flex; gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  font-size: 14.5px;
}
.callout .ico { flex-shrink: 0; font-size: 16px; line-height: 1.5; }
.callout p { margin: 0; color: var(--text-2); }
.callout strong { color: var(--text); }
.callout.note { border-left-color: var(--brand); }
.callout.tip  { border-left-color: var(--term-ok); }
.callout.warn { border-left-color: #f59e0b; }

/* tables */
.docs-table {
  width: 100%; border-collapse: collapse;
  margin: 0 0 22px; font-size: 14px;
  display: block; overflow-x: auto;
}
.docs-table th, .docs-table td {
  text-align: left; padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.docs-table thead th {
  background: var(--bg-alt);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-2); white-space: nowrap;
}
.docs-table td code { white-space: nowrap; }
.docs-table tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.docs-table .yes { color: var(--term-ok); font-weight: 600; }
.docs-table .no  { color: var(--text-3); }

/* diagrams */
.diagram {
  margin: 8px 0 24px;
  padding: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption {
  margin-top: 14px; font-size: 13.5px; color: var(--text-3); text-align: center;
}
.diagram .d-box { fill: var(--bg-alt); stroke: var(--border); }
.diagram .d-box-brand { fill: color-mix(in srgb, var(--brand) 14%, var(--bg-elev)); stroke: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.diagram .d-label { fill: var(--text); font: 600 14px var(--font); }
.diagram .d-sub   { fill: var(--text-2); font: 400 12px var(--mono); }
.diagram .d-tag   { fill: var(--brand); font: 700 11px var(--font); letter-spacing: 0.06em; }
.diagram .d-line  { stroke: var(--text-3); stroke-width: 1.5; fill: none; }
.diagram .d-arrow { fill: var(--text-3); }
/* nested container zones + accents used by the HLD/LLD diagrams */
.diagram .d-zone   { fill: color-mix(in srgb, var(--text) 3%, transparent); stroke: var(--border); }
.diagram .d-zone-2 { fill: color-mix(in srgb, var(--brand) 6%, transparent); stroke: color-mix(in srgb, var(--brand) 26%, var(--border)); }
.diagram .d-line-dash { stroke: var(--text-3); stroke-width: 1.5; fill: none; stroke-dasharray: 5 4; }
.diagram .d-dashbox   { fill: none; stroke: var(--border); stroke-dasharray: 5 4; }
.diagram .d-pill     { fill: color-mix(in srgb, var(--brand) 12%, var(--bg-elev)); stroke: color-mix(in srgb, var(--brand) 34%, var(--border)); }
.diagram .d-pill-tx  { fill: var(--brand); font: 600 11px var(--mono); }
.diagram .d-cap      { fill: var(--text-3); font: 600 10.5px var(--font); letter-spacing: 0.04em; }
.diagram .d-mode     { fill: var(--text); font: 700 13px var(--font); }
.diagram .d-strike   { stroke: var(--text-3); stroke-width: 1.6; }
/* main-page architecture figure can host an inline SVG too */
.arch svg { width: 100%; max-width: min(100%, 960px); height: auto; display: block; }

/* on-page pager */
.doc-pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--border);
}
.doc-pager a {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.doc-pager a:hover { border-color: var(--brand); transform: translateY(-1px); }
.doc-pager .dir { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.doc-pager .ttl { font-weight: 600; color: var(--brand); }
.doc-pager .next { text-align: right; }

/* docs index cards */
.docs-card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 8px 0 24px;
}
@media (max-width: 620px) { .docs-card-grid { grid-template-columns: 1fr; } }
.docs-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 22px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.docs-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -24px color-mix(in srgb, var(--brand) 35%, transparent);
}
.docs-card h3 { margin: 0 0 6px; font-size: 16px; }
.docs-card p { margin: 0; font-size: 14px; color: var(--text-2); }
.docs-card .tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); font-weight: 700; }

/* on-page table of contents (docs) */
.docs-toc {
  margin: 0 0 30px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  font-size: 14px;
}
.docs-toc-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.docs-toc ul { margin: 0; padding: 0; list-style: none; }
.docs-toc > ul { columns: 2; column-gap: 40px; }
.docs-toc > ul > li {
  margin: 0 0 6px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  counter-increment: toc;
}
.docs-toc > ul > li > a { font-weight: 600; }
.docs-toc ul ul { margin: 3px 0 2px 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.docs-toc ul ul li { margin: 2px 0; }
.docs-toc ul ul a { color: var(--text-2); font-size: 13px; }
.docs-toc a { color: var(--brand); text-decoration: none; }
.docs-toc a:hover { text-decoration: underline; }
@media (max-width: 720px) { .docs-toc > ul { columns: 1; } }

/* heading anchor links (docs) — reveal on hover, click to copy */
.docs-prose h2, .docs-prose h3 { scroll-margin-top: 84px; }
.anchor-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
  vertical-align: middle;
}
.docs-prose h2:hover > .anchor-link,
.docs-prose h3:hover > .anchor-link { opacity: .7; }
.anchor-link:hover { opacity: 1 !important; color: var(--brand); }
.anchor-link:focus-visible { opacity: 1; outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.anchor-link svg { display: block; }
.anchor-link.copied::after {
  content: "Link copied";
  position: absolute;
  left: 50%; top: -30px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Misc ---------- */
::selection { background: var(--brand); color: white; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
