*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0d;
  --bg-s: #111113;
  --bg-ss: #161618;
  --border: rgba(255,255,255,0.07);
  --border-s: rgba(255,255,255,0.12);
  --text: #e8e8e8;
  --muted: #666;
  --hint: #3a3a3c;
  --accent: #f5c518;
  --accent-dim: rgba(245,197,24,0.10);
  --accent-border: rgba(245,197,24,0.22);
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sans: 'Geist', system-ui, sans-serif;
  --nav-h: 56px;
  --r: 8px;
  --r-lg: 14px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
  background: var(--bg-ss);
  padding: 2px 6px;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

/* ── NAV ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,13,13,0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-links .nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12px;
}

.nav-links .nav-github:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r);
}

.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger:hover span { background: var(--text); }

.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(13,13,13,0.97);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem 1.5rem;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(12px);
  z-index: 99;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: var(--muted);
  font-size: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.nav-mobile a:hover { color: var(--text); }
.nav-mobile a:last-child { border-bottom: none; }

/* ── PAGE CONTENT ── */
.page-content {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── HERO ── */
.hero {
  padding: 6rem 2rem 5rem;
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 0.5px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}

.hero-eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-family: var(--sans);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #f4f4f5;
  margin-bottom: 1rem;
}

.hero-title .zig { color: var(--accent); }

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 380px;
}

.hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #09090b;
  padding: 10px 22px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.15s;
  display: inline-block;
}

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  border: 0.5px solid var(--border-s);
  color: var(--muted);
  padding: 10px 22px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}

/* ── CODE WINDOW ── */
.code-win {
  background: var(--bg-s);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-ss);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.code-win pre {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-x: auto;
  color: #c9d1d9;
}

.k  { color: #ff7b72; }
.f  { color: #d2a8ff; }
.s  { color: #a5d6ff; }
.n  { color: #f8c555; }
.cm { color: #555; }

/* ── BANNER ── */
.banner {
  padding: 0 2rem 1rem;
  max-width: 1060px;
  margin: 0 auto;
}

.banner-inner {
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem 2rem;
  background: var(--bg-s);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.banner-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.banner-new-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.banner-title {
  font-size: 17px;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: 0.35rem;
}

.banner-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-size: 11px;
  font-family: var(--mono);
  background: var(--bg-ss);
  border: 0.5px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--muted);
}

.banner-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 148px;
}

.btn-cta {
  display: block;
  text-align: center;
  padding: 10px 18px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn-cta-yellow {
  background: var(--accent);
  color: #09090b;
}

.btn-cta-yellow:hover { opacity: 0.88; }

.btn-cta-ghost {
  border: 0.5px solid var(--border-s);
  color: var(--muted);
  font-weight: 500;
}

.btn-cta-ghost:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}

/* ── FEATURES ── */
.features {
  padding: 3rem 2rem 1rem;
  max-width: 1060px;
  margin: 0 auto;
}

.features-title {
  font-size: 22px;
  font-weight: 700;
  color: #f4f4f5;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.features-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.feat {
  background: var(--bg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: background 0.12s;
}

.feat:hover { background: var(--bg-s); }
.feat.active { background: var(--bg-s); }

.feat-name {
  font-size: 13px;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: 4px;
}

.feat-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.feat-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--accent);
}

#feature-detail {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-s);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  min-height: 3rem;
}

#feature-detail:empty { display: none; }

/* ── FOOTER ── */
.footer {
  padding: 2.5rem 2rem;
  margin-top: 3rem;
  border-top: 0.5px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hint);
}

.zig { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem 2rem;
  }

  .banner-inner {
    grid-template-columns: 1fr;
  }

  .banner-cta {
    flex-direction: row;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── DOCS LAYOUT ── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr 200px;
  min-height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── SIDEBAR ── */
.docs-sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 2rem 0 2rem 1.5rem;
  border-right: 0.5px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--hint) transparent;
}

.sidebar-group {
  margin-bottom: 1.75rem;
}

.sidebar-group-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hint);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.sidebar-link {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 5px 0.75rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  margin-bottom: 1px;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  font-weight: 500;
}

/* ── DOC CONTENT ── */
.docs-content {
  padding: 2.5rem 3rem;
  min-width: 0;
}

#doc-content {
  max-width: 680px;
}

#doc-content h1 {
  font-size: 26px;
  font-weight: 700;
  color: #f4f4f5;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

#doc-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f4f4f5;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--border);
}

#doc-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: #d4d4d8;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

#doc-content p {
  font-size: 14px;
  color: #a1a1aa;
  line-height: 1.75;
  margin-bottom: 1rem;
}

#doc-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#doc-content code {
  font-family: var(--mono);
  font-size: 12px;
  color: #e4e4e7;
  background: var(--bg-ss);
  padding: 2px 6px;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

#doc-content pre {
  background: var(--bg-s);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

#doc-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #c9d1d9;
}

#doc-content ul, #doc-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

#doc-content li {
  font-size: 14px;
  color: #a1a1aa;
  line-height: 1.75;
  margin-bottom: 4px;
}

/* ── ON THIS PAGE ── */
.on-this-page {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 2rem 1.5rem;
  border-left: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.on-this-page-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 0.6rem;
}

.on-this-page a {
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
  transition: color 0.12s;
  line-height: 1.5;
}

.on-this-page a:hover { color: var(--text); }
.on-this-page a.active { color: var(--accent); }

/* ── SKELETON ── */
.skeleton {
  background: var(--bg-s);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── DOCS RESPONSIVE ── */
@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 200px 1fr;
  }
  .on-this-page { display: none; }
}

@media (max-width: 700px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar { display: none; }
  .docs-content { padding: 1.5rem 1.25rem; }
}

/* ── CODE BLOCK (docs) ── */
.code-block {
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 1.25rem 0;
}

.code-block-bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-ss);
  border-bottom: 0.5px solid var(--border);
}

.code-block-lang {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.code-block pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  background: var(--bg-s);
  overflow-x: auto;
}

.code-block pre code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  background: none;
  border: none;
  padding: 0;
  color: #c9d1d9;
}

/* ── CALLOUT ── */
.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: rgba(245,197,24,0.06);
  border: 0.5px solid var(--accent-border);
  border-radius: var(--r-lg);
  font-size: 13.5px;
  color: #a1a1aa;
  line-height: 1.65;
  margin: 1.25rem 0;
}

.callout strong {
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.callout code {
  font-size: 12px;
  background: rgba(245,197,24,0.08);
  border-color: var(--accent-border);
  color: var(--accent);
}
