/* Nimbo help pages. The tokens, header and buttons are copied from index.html
   (which keeps its CSS inline) so the help reads as the same site; the
   three-column reading layout is adapted from the Budget site's docs.css. */

:root {
  --sky-0: #0b0a1c;
  --sky-1: #14122f;
  --sky-2: #201a4d;
  --panel: #181634;
  --panel-2: #1e1b40;
  --ink: #f3f1fb;
  --mist: #a7a4c8;
  --mist-2: #6f6c90;
  --indigo: #6c63ff;
  --indigo-bright: #9d96ff;
  --gold: #ffd35e;
  --gold-deep: #f0a73a;
  --warn: #ff8a65;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1180px;
  --doc-nav: 240px;
  --doc-toc: 210px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--sky-1);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 680px at 78% -8%, rgba(108,99,255,0.30), transparent 60%),
    radial-gradient(900px 500px at 12% 4%, rgba(255,211,94,0.07), transparent 55%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-0) 60%);
}
main, footer { position: relative; z-index: 1; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  display: inline-flex; align-items: center; gap: 11px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- header (as index.html) ---------- */
header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(11,10,28,0.55);
  border-bottom: 1px solid var(--line);
}
header nav { max-width: var(--maxw); margin: 0 auto; padding: 15px 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; }
.brand svg { width: 38px; height: auto; filter: drop-shadow(0 2px 14px rgba(255,211,94,0.4)); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a.lnk { font-family: var(--mono); font-size: 12.5px; color: var(--mist); letter-spacing: 0.03em; transition: color 0.18s; }
.nav-links a.lnk:hover, .nav-links a.lnk.active { color: var(--ink); }

.btn {
  font-family: var(--body); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 20px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.2s, background 0.18s, border-color 0.18s;
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2a1c05; border-color: rgba(255,211,94,0.6);
  box-shadow: 0 10px 34px -12px rgba(255,179,64,0.7), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -12px rgba(255,179,64,0.85), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255,255,255,0.08); border-color: var(--mist-2); }

/* ---------- hub ---------- */
.doc-hero { padding: 70px 0 20px; text-align: center; }
.doc-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; margin: 18px auto 0; }
.doc-hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--mist); max-width: 56ch; margin: 16px auto 0; }
.doc-hero-search { max-width: 520px; margin: 30px auto 0; }
.doc-hero-search input, .doc-search input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
}
.doc-hero-search input {
  font-size: 1.02rem; padding: 14px 18px 14px 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7a4c8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px 50%; background-size: 18px;
}
.doc-hero-search input::placeholder, .doc-search input::placeholder { color: var(--mist-2); }
.doc-hero-search input:focus, .doc-search input:focus { outline: 2px solid var(--indigo-bright); outline-offset: 1px; border-color: transparent; }
.spec { margin: 20px 0 0; color: var(--mist); font-family: var(--mono); font-size: 12.5px; }
.spec b { color: var(--ink); font-weight: 500; }

.doc-hub { padding: 40px 0 20px; }
.doc-hub-empty { text-align: center; color: var(--mist); padding: 30px 0 10px; }
.doc-hub-empty a { color: var(--indigo-bright); }
.doc-section + .doc-section { margin-top: 52px; }
.doc-section-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.doc-section-ico {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: rgba(108,99,255,0.18); border: 1px solid var(--line-2);
  display: grid; place-items: center; font-size: 20px;
}
.doc-section-head h2 { font-size: 1.4rem; margin: 0 0 2px; }
.doc-section-head p { margin: 0; color: var(--mist); font-size: .97rem; }
.doc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.doc-card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; transition: transform .16s, border-color .16s, background .16s;
}
.doc-card:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--panel-2); }
.doc-card h3 { font-size: 1.05rem; margin: 0 0 6px; }
.doc-card p { margin: 0; font-size: .93rem; color: var(--mist); line-height: 1.55; }

.section-alt { padding: 50px 0 80px; }
.cta-band {
  text-align: center; border-radius: 22px; padding: 50px 28px;
  background: linear-gradient(135deg, rgba(108,99,255,0.28), rgba(32,26,77,0.9));
  border: 1px solid var(--line-2);
}
.cta-band h2 { font-size: 1.8rem; margin-bottom: 10px; }
.cta-band p { color: var(--mist); max-width: 56ch; margin: 0 auto 24px; }
.cta-band b { color: var(--ink); }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- page layout ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: var(--doc-nav) minmax(0, 1fr) var(--doc-toc);
  gap: 40px; padding-top: 34px; padding-bottom: 70px;
  /* stretch, so the sticky nav/TOC can travel the article's full height */
  align-items: stretch;
}

.doc-nav-toggle { display: none; }
.doc-nav-inner { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 4px; }
.doc-search input { font-size: .93rem; padding: 9px 12px; margin-bottom: 18px; border-radius: 9px; }
.doc-nav-group + .doc-nav-group { margin-top: 20px; }
.doc-nav-group h4, .doc-toc h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mist-2); margin: 0 0 8px; font-weight: 500;
}
.doc-nav-group ul, .doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-nav-group li a {
  display: block; padding: 6px 10px; border-radius: 7px; color: var(--mist);
  font-size: .94rem; border-left: 2px solid transparent;
}
.doc-nav-group li a:hover { background: rgba(255,255,255,0.04); color: var(--ink); }
.doc-nav-group li a.active { background: rgba(108,99,255,0.16); color: var(--ink); font-weight: 600; border-left-color: var(--gold); }
.doc-nav-empty { color: var(--mist); font-size: .9rem; padding: 6px 10px; }

.doc-toc-inner { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.doc-toc ul { margin: 0 0 18px; border-left: 1px solid var(--line-2); }
.doc-toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px; color: var(--mist);
  font-size: .88rem; line-height: 1.4; border-left: 2px solid transparent;
}
.doc-toc li a:hover { color: var(--ink); }
.doc-toc li a.active { color: var(--ink); border-left-color: var(--gold); font-weight: 600; }
.doc-toc li.lvl-3 a { padding-left: 26px; font-size: .84rem; }

/* ---------- article ---------- */
.doc-body { min-width: 0; }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--mist-2); margin-bottom: 14px; }
.crumbs a { color: var(--mist); }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin: 0 5px; }
.doc-body h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 12px; }
.doc-lead { font-size: 1.12rem; color: var(--mist); line-height: 1.6; margin-bottom: 28px; }

.prose-doc { font-size: 1.02rem; line-height: 1.7; color: #dcd9ee; }
.prose-doc h2 { font-size: 1.55rem; margin: 2.1em 0 .6em; padding-top: .8em; border-top: 1px solid var(--line); color: var(--ink); }
.prose-doc h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose-doc h3 { font-size: 1.18rem; margin: 1.7em 0 .5em; color: var(--ink); }
.prose-doc h4 { font-size: 1.02rem; margin: 1.5em 0 .4em; color: var(--ink); }
.prose-doc p { margin: 0 0 1.05em; }
.prose-doc ul, .prose-doc ol { padding-left: 24px; margin: 0 0 1.1em; }
.prose-doc li { margin: 7px 0; }
.prose-doc li > ul, .prose-doc li > ol { margin: 7px 0 0; }
.prose-doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose-doc strong { color: var(--ink); }
.prose-doc a { color: var(--indigo-bright); text-decoration: underline; text-decoration-color: rgba(157,150,255,0.35); text-underline-offset: 3px; }
.prose-doc a:hover { text-decoration-color: var(--indigo-bright); }
.prose-doc img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line-2); margin: 1em 0; }

.prose-doc .anchor { margin-left: 9px; color: var(--mist-2); font-weight: 400; opacity: 0; transition: .12s; text-decoration: none; }
.prose-doc h2:hover .anchor, .prose-doc h3:hover .anchor { opacity: 1; }
.prose-doc .anchor:hover { color: var(--gold); }
.prose-doc :is(h2, h3) { scroll-margin-top: 84px; }

.prose-doc code {
  background: var(--panel); color: var(--gold); padding: .15em .42em; border-radius: 5px;
  font-size: .86em; font-family: var(--mono); border: 1px solid var(--line-2);
  overflow-wrap: anywhere;
}
.prose-doc pre {
  background: var(--sky-0); color: #dcd9ee; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--line-2); overflow-x: auto; margin: 0 0 1.2em; font-size: .86rem; line-height: 1.55;
}
.prose-doc pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line-2); border-radius: 12px; }
.prose-doc table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.prose-doc th, .prose-doc td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose-doc thead th { background: var(--panel); color: var(--ink); font-weight: 600; white-space: nowrap; }
.prose-doc tbody tr:last-child td { border-bottom: 0; }

.callout {
  margin: 0 0 1.3em; padding: 14px 18px; border-radius: 12px;
  border-left: 3px solid var(--indigo-bright); background: rgba(108,99,255,0.12); color: var(--ink);
}
.callout > :last-child { margin-bottom: 0; }
.callout-tip { border-left-color: var(--gold); background: rgba(255,211,94,0.08); }
.callout-warn { border-left-color: var(--warn); background: rgba(255,138,101,0.1); }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
.doc-pager a { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: .15s; }
.doc-pager a:hover { border-color: var(--line-2); background: var(--panel-2); }
.doc-pager span { font-family: var(--mono); font-size: 11.5px; color: var(--mist-2); }
.doc-pager b { color: var(--ink); font-size: .98rem; }
.doc-pager .next { text-align: right; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.foot-min { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; color: var(--mist); font-size: 13px; }
.foot-min a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .doc-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
  .doc-toc { display: none; }
  .doc-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 940px) {
  .nav-links a.lnk:not(.active) { display: none; }
}
@media (max-width: 820px) {
  .doc-grid { grid-template-columns: 1fr; gap: 8px; }
  .doc-nav-inner { position: static; max-height: none; overflow: visible; }
  .doc-nav { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); margin-bottom: 24px; }
  .doc-nav-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 14px 18px; cursor: pointer; font: inherit; font-weight: 600;
    font-size: .97rem; color: var(--ink); background: none; border: 0;
    border-bottom: 1px solid var(--line); text-align: left;
  }
  .doc-nav-toggle::after {
    content: ""; width: 10px; height: 10px; border-right: 2px solid var(--mist);
    border-bottom: 2px solid var(--mist); transform: rotate(-135deg) translate(-2px, -2px);
    transition: transform .18s;
  }
  .doc-nav[data-collapsed="true"] .doc-nav-toggle { border-bottom: 0; }
  .doc-nav[data-collapsed="true"] .doc-nav-toggle::after { transform: rotate(45deg) translate(-2px, -2px); }
  .doc-nav[data-collapsed="true"] .doc-nav-inner { display: none; }
  .doc-nav .doc-nav-inner { padding: 16px 18px; }
  .doc-nav nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0; }
  .doc-nav-group + .doc-nav-group { margin-top: 0; }
  .doc-cards { grid-template-columns: 1fr; }
  .doc-pager { grid-template-columns: 1fr; }
  .doc-pager .next { text-align: left; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  header nav { padding: 13px 16px; }
  .nav-links { gap: 16px; }
  .nav-links .btn { padding: 9px 14px; font-size: 14px; }
  .doc-nav nav { grid-template-columns: 1fr; }
  .doc-hero { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .doc-card { transition: none; }
}
