/* Voiplix Wiki — layout & components. Vanilla CSS, no framework. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/*
 * Glass gloss — same recipe as the product's `.dark[data-theme="glass"]
 * .bg-card` rule (globals.css ~660): a 1px light edge at the top, then a
 * 160deg diagonal into --secondary. Only `background-image`, never
 * `box-shadow` (an element's own shadow utility must still win) and never
 * `backdrop-filter` or motion — light mode is untouched (`.glass-surface`
 * is a no-op there, since --secondary reads as a near-white gradient into
 * white and would just look like a stray line).
 */
:root[data-theme="dark"] .glass-surface,
:root[data-theme="dark"] .wiki-topbar,
:root[data-theme="dark"] .wiki-sidebar,
:root[data-theme="dark"] .info-card,
:root[data-theme="dark"] .start-card,
:root[data-theme="dark"] .wiki-shot,
:root[data-theme="dark"] .wiki-search-results,
:root[data-theme="dark"] .wiki-placeholder {
  background-image:
    linear-gradient(to bottom, hsl(0 0% 100% / 0.07) 0, hsl(0 0% 100% / 0) 1px),
    linear-gradient(160deg, hsl(0 0% 100% / 0) 0%, hsl(var(--secondary) / 0.7) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .glass-surface,
  :root:not([data-theme="light"]) .wiki-topbar,
  :root:not([data-theme="light"]) .wiki-sidebar,
  :root:not([data-theme="light"]) .info-card,
  :root:not([data-theme="light"]) .start-card,
  :root:not([data-theme="light"]) .wiki-shot,
  :root:not([data-theme="light"]) .wiki-search-results,
  :root:not([data-theme="light"]) .wiki-placeholder {
    background-image:
      linear-gradient(to bottom, hsl(0 0% 100% / 0.07) 0, hsl(0 0% 100% / 0) 1px),
      linear-gradient(160deg, hsl(0 0% 100% / 0) 0%, hsl(var(--secondary) / 0.7) 100%);
  }
}

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, canvas, svg { max-width: 100%; display: block; }
button { font: inherit; }

::selection { background: hsl(var(--primary) / 0.25); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  padding: 0.5rem 0.9rem; border-radius: calc(var(--radius) - 2px);
  z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* ================= Topbar ================= */
.wiki-topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--wiki-topbar-h);
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 0.9rem;
  background: hsl(var(--card) / 0.92);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid hsl(var(--border));
  z-index: 100;
}

.wiki-menu-btn {
  display: none;
  width: 36px; height: 36px; align-items: center; justify-content: center;
  border: 1px solid hsl(var(--border)); background: hsl(var(--secondary));
  border-radius: calc(var(--radius) - 2px); cursor: pointer; color: hsl(var(--foreground));
  flex-shrink: 0;
}
.wiki-menu-btn svg { width: 18px; height: 18px; }

.wiki-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: hsl(var(--foreground)); flex-shrink: 0;
}
.wiki-brand-mark {
  width: 30px; height: 30px; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; flex-shrink: 0;
}
.wiki-brand-word { font-weight: 600; letter-spacing: -0.01em; font-size: 1rem; }
.wiki-brand-tag {
  font-size: 0.7rem; font-weight: 600; color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 999px;
  padding: 0.05rem 0.5rem; margin-left: 0.1rem;
}

.wiki-topbar-spacer { flex: 1 1 auto; }

/* Search */
.wiki-search { position: relative; width: 100%; max-width: 360px; flex: 1 1 260px; }
.wiki-search input {
  width: 100%; height: 36px; border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border)); background: hsl(var(--secondary));
  color: hsl(var(--foreground)); padding: 0 0.6rem 0 2.1rem; font-size: 0.875rem;
}
.wiki-search input:focus {
  outline: none; border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25);
  background: hsl(var(--background));
}
.wiki-search svg {
  position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: hsl(var(--muted-foreground)); pointer-events: none;
}
.wiki-search kbd {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  font-size: 0.7rem; color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 4px; padding: 0.05rem 0.35rem;
  background: hsl(var(--background) / 0.6);
}
@media (max-width: 640px) { .wiki-search kbd { display: none; } }

.wiki-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); box-shadow: var(--wiki-shadow-lg);
  max-height: 60vh; overflow: auto; display: none; z-index: 120; padding: 0.35rem;
}
.wiki-search-results.open { display: block; }
.wiki-search-results a {
  display: block; text-decoration: none; padding: 0.5rem 0.6rem; border-radius: calc(var(--radius) - 4px);
  color: hsl(var(--foreground));
}
.wiki-search-results a:hover, .wiki-search-results a.active { background: hsl(var(--accent)); }
.wiki-search-results .r-title { font-size: 0.875rem; font-weight: 600; }
.wiki-search-results .r-crumb { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.wiki-search-empty { padding: 0.75rem; font-size: 0.85rem; color: hsl(var(--muted-foreground)); }

.wiki-topbar-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.wiki-icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid hsl(var(--border)); background: hsl(var(--secondary));
  border-radius: calc(var(--radius) - 2px); cursor: pointer; color: hsl(var(--foreground));
}
.wiki-icon-btn svg { width: 17px; height: 17px; }
.wiki-icon-btn:hover { background: hsl(var(--accent)); }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }

.wiki-cta {
  display: inline-flex; align-items: center; gap: 0.35rem;
  height: 36px; padding: 0 0.85rem; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.wiki-cta:hover { opacity: 0.92; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 40px; padding: 0 1.15rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  border-radius: calc(var(--radius) - 2px); font-weight: 600; text-decoration: none; font-size: 0.88rem;
}
.btn-primary:hover { opacity: 0.9; }
@media (max-width: 780px) { .wiki-cta span { display: none; } .wiki-cta { padding: 0 0.6rem; } }

/* ================= Shell / Sidebar ================= */
.wiki-shell { display: flex; padding-top: var(--wiki-topbar-h); min-height: 100vh; }

.wiki-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); z-index: 89;
}
.wiki-sidebar-backdrop.open { display: block; }

.wiki-sidebar {
  position: fixed; top: var(--wiki-topbar-h); bottom: 0; left: 0;
  width: var(--wiki-sidebar-w); overflow-y: auto;
  background: hsl(var(--card)); border-right: 1px solid hsl(var(--border));
  padding: 1.1rem 0.9rem 2rem; z-index: 90;
}

.wiki-nav-group { margin-bottom: 1.35rem; }
.wiki-nav-heading {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground)); padding: 0 0.6rem; margin-bottom: 0.4rem;
}
.wiki-nav-list { list-style: none; margin: 0; padding: 0; }
.wiki-nav-link {
  display: flex; align-items: center; gap: 0.5rem; text-decoration: none;
  color: hsl(var(--foreground)); font-size: 0.875rem; padding: 0.42rem 0.6rem;
  border-radius: calc(var(--radius) - 2px); line-height: 1.3;
}
.wiki-nav-link:hover { background: hsl(var(--accent)); }
.wiki-nav-link.active {
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  font-weight: 600;
}
:root[data-theme="dark"] .wiki-nav-link.active { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.wiki-nav-list.sub { margin: 0.15rem 0 0.3rem 0.55rem; border-left: 1px solid hsl(var(--border)); padding-left: 0.55rem; }
.wiki-nav-list.sub .wiki-nav-link { font-size: 0.83rem; padding: 0.32rem 0.5rem; }
.wiki-nav-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; font-size: 0.65rem; font-weight: 700;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground)); flex-shrink: 0;
}
.wiki-nav-link.active .wiki-nav-num { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

.wiki-nav-soon {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem;
  padding: 0.42rem 0.6rem; color: hsl(var(--muted-foreground)); border-radius: calc(var(--radius) - 2px);
  cursor: default;
}
.wiki-soon-badge {
  margin-left: auto; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 999px; padding: 0.05rem 0.4rem;
  white-space: nowrap;
}

/* ================= Main / content ================= */
.wiki-main { flex: 1 1 auto; min-width: 0; margin-left: var(--wiki-sidebar-w); }

.wiki-container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* Doc page layout: content + right-hand "on this page" TOC */
.doc-layout {
  display: grid; grid-template-columns: minmax(0, var(--wiki-content-max)) var(--wiki-toc-w);
  gap: 3rem; align-items: start; padding: 1.75rem 0 4rem;
}
.doc-content { min-width: 0; }

.doc-toc {
  position: sticky; top: calc(var(--wiki-topbar-h) + 1.5rem);
  font-size: 0.82rem; border-left: 1px solid hsl(var(--border)); padding-left: 1rem;
}
.doc-toc-title { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin-bottom: 0.6rem; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.doc-toc a { text-decoration: none; color: hsl(var(--muted-foreground)); display: block; }
.doc-toc a:hover { color: hsl(var(--foreground)); }
.doc-toc a.active { color: hsl(var(--primary)); font-weight: 600; }
:root[data-theme="dark"] .doc-toc a.active { color: hsl(var(--foreground)); }
.doc-toc .lvl-3 { padding-left: 0.85rem; }

/* Breadcrumbs */
.wiki-breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.9rem;
}
.wiki-breadcrumbs a { text-decoration: none; color: hsl(var(--muted-foreground)); }
.wiki-breadcrumbs a:hover { color: hsl(var(--foreground)); text-decoration: underline; }
.wiki-breadcrumbs .sep { opacity: 0.6; }
.wiki-breadcrumbs .current { color: hsl(var(--foreground)); font-weight: 500; }

/* Step badge */
.wiki-step {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: hsl(var(--primary)); background: hsl(var(--primary) / 0.1);
  border-radius: 999px; padding: 0.25rem 0.75rem 0.25rem 0.4rem; margin-bottom: 0.85rem;
}
:root[data-theme="dark"] .wiki-step { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.wiki-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 0.68rem;
}

.doc-content h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.6rem; line-height: 1.2; }
.doc-lede { font-size: 1.02rem; color: hsl(var(--muted-foreground)); margin: 0 0 1.75rem; max-width: 60ch; }
.doc-content h2 { font-size: 1.28rem; font-weight: 700; margin: 2.25rem 0 0.85rem; scroll-margin-top: calc(var(--wiki-topbar-h) + 1rem); letter-spacing: -0.01em; }
.doc-content h3 { font-size: 1.05rem; font-weight: 650; margin: 1.6rem 0 0.6rem; scroll-margin-top: calc(var(--wiki-topbar-h) + 1rem); }
.doc-content p { margin: 0 0 1rem; }
.doc-content ul, .doc-content ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.doc-content li { margin-bottom: 0.35rem; }
.doc-content a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .doc-content a { color: hsl(213 94% 74%); }
.doc-content strong { font-weight: 650; }
.doc-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; background: hsl(var(--secondary)); border: 1px solid hsl(var(--border)); border-radius: 4px; padding: 0.05em 0.4em; }
.doc-content hr { border: none; border-top: 1px solid hsl(var(--border)); margin: 2.25rem 0; }

/* Placeholder marker for empty shell sections */
.wiki-placeholder {
  border: 1px dashed hsl(var(--border)); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; color: hsl(var(--muted-foreground)); font-size: 0.9rem;
  background: hsl(var(--secondary) / 0.5); margin: 1rem 0 1.75rem;
}
.wiki-placeholder strong { color: hsl(var(--foreground)); }

/* Callouts */
.callout {
  display: flex; gap: 0.7rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border)); border-left-width: 3px;
  padding: 0.85rem 1rem; margin: 0 0 1.25rem; font-size: 0.9rem;
}
.callout-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.1rem; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: 0.15rem; }
.callout-tip { background: hsl(var(--wiki-tip-bg)); border-left-color: hsl(var(--wiki-tip)); }
.callout-tip .callout-icon, .callout-tip .callout-title { color: hsl(var(--wiki-tip)); }
.callout-note { background: hsl(var(--wiki-note-bg)); border-left-color: hsl(var(--wiki-note)); }
.callout-note .callout-icon, .callout-note .callout-title { color: hsl(var(--wiki-note)); }
.callout-warning { background: hsl(var(--wiki-warn-bg)); border-left-color: hsl(var(--wiki-warn)); }
.callout-warning .callout-icon, .callout-warning .callout-title { color: hsl(var(--wiki-warn)); }

/* Screenshot component */
.wiki-shot {
  margin: 1.25rem 0 1.75rem; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); overflow: hidden; background: hsl(var(--secondary));
  box-shadow: var(--wiki-shadow-md);
}
.wiki-shot button {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in;
}
.wiki-shot img { width: 100%; height: auto; display: block; }
.wiki-shot figcaption {
  font-size: 0.8rem; color: hsl(var(--muted-foreground)); padding: 0.55rem 0.9rem;
  border-top: 1px solid hsl(var(--border)); background: hsl(var(--card));
}

.wiki-lightbox {
  position: fixed; inset: 0; background: rgb(0 0 0 / 0.82); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 2rem;
}
.wiki-lightbox.open { display: flex; }
.wiki-lightbox img { max-width: min(92vw, 1200px); max-height: 86vh; border-radius: calc(var(--radius) - 2px); box-shadow: var(--wiki-shadow-2xl); }
.wiki-lightbox-close {
  position: absolute; top: 1.1rem; right: 1.2rem; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.25); background: rgb(255 255 255 / 0.08);
  color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.wiki-lightbox-cap { position: absolute; bottom: 1.4rem; left: 0; right: 0; text-align: center; color: #eee; font-size: 0.85rem; }

/* Code blocks */
.wiki-code { position: relative; margin: 0 0 1.25rem; }
.wiki-code pre {
  margin: 0; background: hsl(222.2 47.4% 11.2%); color: hsl(210 40% 96%);
  border-radius: var(--radius); padding: 1rem 1.1rem; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.83rem; line-height: 1.55;
}
:root[data-theme="dark"] .wiki-code pre { background: hsl(0 0% 10%); border: 1px solid hsl(var(--border)); }
.wiki-copy-btn {
  position: absolute; top: 0.55rem; right: 0.55rem;
  display: flex; align-items: center; gap: 0.3rem;
  background: rgb(255 255 255 / 0.08); color: #e5e7eb; border: 1px solid rgb(255 255 255 / 0.15);
  border-radius: 6px; padding: 0.28rem 0.55rem; font-size: 0.72rem; cursor: pointer;
}
.wiki-copy-btn:hover { background: rgb(255 255 255 / 0.16); }
.wiki-copy-btn svg { width: 13px; height: 13px; }

/* Tables inside docs */
.doc-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: 0.87rem; }
.doc-content th, .doc-content td { border: 1px solid hsl(var(--border)); padding: 0.5rem 0.7rem; text-align: left; }
.doc-content th { background: hsl(var(--secondary)); font-weight: 650; }

/* Prev/Next */
.wiki-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.pn-link {
  display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 0.9rem 1.05rem;
  color: hsl(var(--foreground));
}
.pn-link:hover { border-color: hsl(var(--ring)); background: hsl(var(--accent) / 0.5); }
.pn-link.next { text-align: right; align-items: flex-end; grid-column: 2; }
.pn-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); }
.pn-title { font-weight: 650; font-size: 0.95rem; }
@media (max-width: 560px) { .wiki-prevnext { grid-template-columns: 1fr; } .pn-link.next { grid-column: 1; } }

/* ================= Home / hero =================
 * Always dark, regardless of the site theme toggle — same idea as the
 * product's login page (main.bg-black/[0.96]): the hero is the one stage
 * the robot lives on, so it does not follow the light/dark switch. Tinted
 * to the "glass" slate (215°) rather than neutral black, with one static
 * radial glow in the "glass" accent (200°, --primary) for depth — no
 * animation, matching the product's gloss (globals.css v2.0.10 note: the
 * glaze is static and does not need a prefers-reduced-motion branch).
 */
.wiki-hero {
  position: relative; overflow: hidden; color: #fafafa;
  background: radial-gradient(ellipse 900px 480px at 82% 8%, hsl(200 85% 45% / 0.22), transparent 60%),
    hsl(220 32% 6%);
  margin: -1.75rem calc(-1 * 1.5rem) 0; padding: 3.5rem 1.5rem 4.5rem;
  border-radius: 0 0 1.25rem 1.25rem;
}
@media (min-width: 900px) { .wiki-hero { padding: 5rem 3rem 6rem; } }
.wiki-hero-inner { position: relative; z-index: 2; max-width: 640px; }
.wiki-hero-kicker {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase; color: #d4d4d8;
  border: 1px solid rgb(255 255 255 / 0.16); border-radius: 999px; padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  margin-bottom: 1.1rem; background: rgb(255 255 255 / 0.04);
}
.wiki-hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%; background: hsl(200 85% 62%);
  box-shadow: 0 0 6px 1px hsl(200 85% 62% / 0.7);
}
.wiki-hero h1 {
  font-size: 2.3rem; line-height: 1.12; font-weight: 750; letter-spacing: -0.02em; margin: 0 0 1rem;
  background: linear-gradient(to bottom, #fafafa, #a3a3a3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (min-width: 700px) { .wiki-hero h1 { font-size: 3rem; } }
.wiki-hero p.lede { font-size: 1.05rem; color: #d4d4d8; max-width: 46ch; margin: 0 0 1.9rem; }
.wiki-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-btn-primary {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 44px; padding: 0 1.25rem;
  background: #fafafa; color: #0a0a0a; border-radius: calc(var(--radius) - 2px); font-weight: 650;
  text-decoration: none; font-size: 0.92rem;
  box-shadow: 0 0 0 1px hsl(200 85% 62% / 0.35), 0 8px 24px -8px hsl(200 85% 55% / 0.55);
}
.hero-btn-primary:hover { background: #e5e5e5; }
.hero-btn-secondary {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 44px; padding: 0 1.25rem;
  border: 1px solid rgb(255 255 255 / 0.22); color: #fafafa; border-radius: calc(var(--radius) - 2px);
  font-weight: 600; text-decoration: none; font-size: 0.92rem; background: rgb(255 255 255 / 0.03);
}
.hero-btn-secondary:hover { background: rgb(255 255 255 / 0.08); }

.wiki-robot-stage {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.wiki-robot-stage canvas { width: 100%; height: 100%; display: block; }
.wiki-robot-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: 78% 30%; opacity: 0.85;
}
@media (max-width: 899px) { .wiki-robot-poster { object-position: 85% 20%; opacity: 0.45; } }
.wiki-robot-fade {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, hsl(220 32% 6%) 28%, hsl(220 32% 6% / 0.55) 55%, hsl(220 32% 6% / 0.05) 78%);
}
@media (max-width: 899px) {
  .wiki-robot-fade { background: linear-gradient(180deg, hsl(220 32% 6% / 0.35) 0%, hsl(220 32% 6%) 72%); }
}

/* Home content sections */
.home-section { padding: 2.75rem 0; }
.home-section h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.home-section .section-sub { color: hsl(var(--muted-foreground)); margin: 0 0 1.5rem; max-width: 62ch; }

.start-card {
  display: grid; gap: 1.5rem; grid-template-columns: 1.15fr 1fr; align-items: start;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 6px);
  padding: 1.75rem; background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--secondary)));
  box-shadow: var(--wiki-shadow-md);
}
/* The steps list (right column) usually runs taller than the intro text
   (left column) — top-aligning both (instead of centering) keeps the text
   flush with the card's top edge instead of floating in empty space. */
.start-card > div:first-child { padding-top: 0.2rem; }
@media (max-width: 780px) { .start-card { grid-template-columns: 1fr; } }
.start-card h3 { font-size: 1.35rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.start-card p { color: hsl(var(--muted-foreground)); margin: 0 0 1.1rem; }
.start-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.start-steps li {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.7rem;
}
.start-steps .n {
  width: 20px; height: 20px; border-radius: 50%; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
}

.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.info-card {
  border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.1rem 1.2rem;
  background: hsl(var(--card));
}
.info-card .ic-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.info-card .ic-icon {
  width: 34px; height: 34px; border-radius: calc(var(--radius) - 2px); background: hsl(var(--secondary));
  display: flex; align-items: center; justify-content: center; color: hsl(var(--foreground));
}
.info-card .ic-icon svg { width: 18px; height: 18px; }
.info-card h3 { font-size: 0.95rem; margin: 0 0 0.3rem; }
.info-card p { font-size: 0.82rem; color: hsl(var(--muted-foreground)); margin: 0; }

.pitch-block { max-width: 70ch; }
.pitch-block p { color: hsl(var(--muted-foreground)); margin: 0 0 1rem; }
.pitch-block p:first-child { color: hsl(var(--foreground)); font-size: 1.02rem; }

/* Footer */
.wiki-footer {
  border-top: 1px solid hsl(var(--border)); margin-top: 2rem; padding: 2rem 1.5rem;
  color: hsl(var(--muted-foreground)); font-size: 0.82rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between;
}
.wiki-footer a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.wiki-footer a:hover { color: hsl(var(--foreground)); text-decoration: underline; }
.wiki-footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* 404 */
.wiki-404 { text-align: center; padding: 5rem 1.5rem; }
.wiki-404 .code { font-size: 4rem; font-weight: 800; letter-spacing: -0.03em; color: hsl(var(--primary)); }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
}

@media (max-width: 900px) {
  .wiki-menu-btn { display: flex; }
  .wiki-sidebar {
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--wiki-shadow-2xl);
  }
  .wiki-sidebar.open { transform: translateX(0); }
  .wiki-main { margin-left: 0; }
  .wiki-brand-tag { display: none; }
  .start-card { padding: 1.35rem; }
}

@media (max-width: 640px) {
  .wiki-container { padding: 0 1rem; }
  .wiki-hero { margin: -1rem -1rem 0; padding: 2.5rem 1rem 3rem; border-radius: 0; }
  .wiki-hero h1 { font-size: 1.9rem; }
  .doc-content h1 { font-size: 1.5rem; }
}

@media (max-width: 380px) {
  .wiki-search { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Collapsible sidebar groups (lead, 2026-09-24): only the group of the current page is open */
.wiki-nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); padding: 0.25rem 0.6rem; }
.wiki-nav-toggle:hover { color: hsl(var(--foreground)); }
.wiki-nav-chev { width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 0.3rem; transition: transform 0.15s ease; opacity: 0.7; flex: none; }
.wiki-nav-group.collapsed .wiki-nav-chev { transform: rotate(-45deg); }
.wiki-nav-group.collapsed > .wiki-nav-list { display: none; }
.wiki-nav-group { margin-bottom: 0.7rem; }
@media (prefers-reduced-motion: reduce) { .wiki-nav-chev { transition: none; } }
