/* ==========================================================================
   QUANTSULTANT.DEV — CANONICAL DOCUMENTATION & SEMANTIC FOOTPRINT SURFACE
   Obsidian, Gold & Platinum Read-Mode Design System (Craft-Floor Verified)
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #000000;
  --void: #050507;
  --raise: #0b0c10;
  --card: #101117;
  --paper: #ffffff;
  --platinum: #eef0f4;
  --silver: #c8ccd4;
  --mute: #9ca3af;
  --gold: #f0c75e;
  --gold-glow: #fff1bd;
  --gold-dim: #b8873a;
  --emerald: #34d399;
  --hair: rgba(255, 255, 255, 0.08);
  --hair-strong: rgba(255, 255, 255, 0.14);
  --hair-gold: rgba(240, 199, 94, 0.28);
  --hair-emerald: rgba(52, 211, 153, 0.28);
  --sans: "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--ink);
  color: var(--platinum);
  scroll-padding-top: 84px;
  scrollbar-color: rgba(240, 199, 94, 0.38) #060608;
}

::-webkit-scrollbar {
  width: 10px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #060608;
}
::-webkit-scrollbar-thumb {
  background: rgba(240, 199, 94, 0.32);
  border-radius: 8px;
  border: 2px solid #060608;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 199, 94, 0.55);
}

::selection {
  background: rgba(240, 199, 94, 0.32);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

input, textarea, select {
  caret-color: var(--gold);
}

body {
  margin: 0;
  background: radial-gradient(ellipse 90% 45% at 50% 0%, rgba(240, 199, 94, 0.08) 0%, rgba(238, 240, 244, 0.03) 32%, #040406 68%, #000000 100%);
  background-attachment: fixed;
  color: var(--platinum);
  font: 400 16px/1.68 var(--sans);
  font-variant-numeric: tabular-nums;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--gold-glow);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.16s var(--ease-out);
}
a:hover {
  color: var(--gold);
}

code, kbd, samp {
  font: 400 14px/1.45 var(--mono);
  color: var(--gold-glow);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 2px 6px;
}

pre {
  margin: 16px 0;
  padding: 18px 20px;
  background: #07080c;
  border: 1px solid var(--hair);
  border-radius: 12px;
  overflow-x: auto;
  font: 400 14px/1.6 var(--mono);
  color: var(--platinum);
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 14px;
}

/* Sticky Top Navigation Bar */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--hair-gold);
}

.docs-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.docs-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.docs-brand {
  font: 700 15px/1.2 var(--sans);
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.docs-brand:hover {
  color: var(--gold-glow);
}
.docs-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}
.docs-brand-sub {
  color: var(--silver);
  font-weight: 500;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px/1.3 var(--sans);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.03);
  color: var(--silver);
}
.docs-badge.gold {
  color: var(--gold-glow);
  border-color: var(--hair-gold);
  background: rgba(240, 199, 94, 0.1);
}
.docs-badge.emerald {
  color: var(--paper);
  border-color: var(--hair-emerald);
  background: rgba(52, 211, 153, 0.1);
}

.docs-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 14px/1.2 var(--sans);
  color: var(--platinum);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hair-strong);
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.docs-btn:hover {
  border-color: var(--gold);
  color: var(--gold-glow);
  background: rgba(240, 199, 94, 0.08);
}
.docs-btn.primary {
  background: var(--gold);
  color: #120c02;
  border-color: var(--gold);
}
.docs-btn.primary:hover {
  background: var(--gold-glow);
  border-color: var(--gold-glow);
  color: #000000;
}

.docs-menu-toggle {
  display: none;
}

/* 3-Column Documentation Shell */
.docs-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 236px;
  gap: 36px;
  align-items: start;
}

/* Left Sidebar Navigation */
.docs-sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 8px;
}

.docs-search-wrap {
  margin-bottom: 18px;
}

.docs-search-input {
  width: 100%;
  padding: 9px 12px;
  font: 400 14px/1.4 var(--sans);
  color: var(--paper);
  background: #08090d;
  border: 1px solid var(--hair-strong);
  border-radius: 8px;
}
.docs-search-input::placeholder {
  color: var(--mute);
}

.docs-nav-group {
  margin-bottom: 22px;
}

.docs-nav-heading {
  margin: 0 0 8px;
  padding: 0 10px;
  font: 600 13px/1.35 var(--sans);
  color: var(--gold);
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font: 400 14px/1.35 var(--sans);
  color: var(--silver);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.docs-nav-link:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}
.docs-nav-link.active {
  color: var(--paper);
  font-weight: 600;
  background: rgba(240, 199, 94, 0.12);
  border-color: var(--hair-gold);
}
.docs-nav-route {
  font: 400 13px/1.2 var(--mono);
  color: var(--mute);
}
.docs-nav-link.active .docs-nav-route {
  color: var(--gold-glow);
}

/* Main Article Column */
.docs-main {
  min-width: 0;
  max-width: 76ch;
}

.docs-hero-panel {
  padding: 28px 30px;
  margin-bottom: 36px;
  background: rgba(13, 14, 19, 0.82);
  border: 1px solid var(--hair-gold);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  align-items: center;
}

.docs-hero-panel h1 {
  margin: 0 0 12px;
  font: 700 36px/1.16 var(--sans);
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
}

.docs-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.docs-route-pill {
  font: 500 13px/1.3 var(--mono);
  color: var(--gold-glow);
  background: rgba(240, 199, 94, 0.1);
  border: 1px solid var(--hair-gold);
  border-radius: 6px;
  padding: 4px 10px;
}

.docs-human-line {
  margin: 0;
  font: 400 16px/1.62 var(--sans);
  color: var(--silver);
}
.docs-human-line strong {
  color: var(--paper);
  font-weight: 600;
}

.docs-hero-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.docs-hero-cv {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #050508;
}

/* Typography & Sections */
.docs-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--hair);
}
.docs-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.docs-main h2 {
  margin: 0 0 12px;
  font: 600 26px/1.26 var(--sans);
  letter-spacing: -0.015em;
  color: var(--paper);
  text-wrap: balance;
  scroll-margin-top: 90px;
}

.docs-main h3 {
  margin: 28px 0 10px;
  font: 600 20px/1.32 var(--sans);
  letter-spacing: -0.005em;
  color: var(--paper);
  text-wrap: balance;
}

.docs-main p {
  margin: 0 0 16px;
  color: var(--silver);
  font-size: 16px;
  line-height: 1.68;
}
.docs-main p strong {
  color: var(--paper);
  font-weight: 600;
}

.docs-main ul, .docs-main ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--silver);
}
.docs-main li {
  margin-bottom: 8px;
  line-height: 1.62;
}
.docs-main li strong {
  color: var(--paper);
}

/* Un-nested Stat Strip */
.docs-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 16px 0;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.docs-stat-item {
  padding: 14px 20px;
  border-left: 1px solid var(--hair);
}
.docs-stat-item:first-child {
  padding-left: 16px;
  border-left: 0;
}
.docs-stat-val {
  font: 600 28px/1.14 var(--sans);
  letter-spacing: -0.02em;
  color: var(--gold-glow);
  margin-bottom: 6px;
}
.docs-stat-lbl {
  font: 500 14px/1.4 var(--sans);
  color: var(--paper);
  margin-bottom: 4px;
}
.docs-stat-sub {
  font: 400 13px/1.45 var(--sans);
  color: var(--mute);
}

/* Content Grid & Cards (Single Elevation Layer, Never Nested) */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.docs-card {
  padding: 22px 24px;
  background: rgba(14, 15, 21, 0.78);
  border: 1px solid var(--hair);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.16s var(--ease-out);
}
.docs-card:hover {
  border-color: var(--hair-gold);
}
.docs-card.gold-surface {
  border-color: var(--hair-gold);
}
.docs-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.docs-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}
.docs-card-foot {
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font: 500 13px/1.3 var(--mono);
  color: var(--gold);
}

/* Callout Notice (1px Full Hairline Border, No Side-Tab) */
.docs-callout {
  margin: 22px 0;
  padding: 20px 24px;
  background: rgba(240, 199, 94, 0.05);
  border: 1px solid var(--hair-gold);
  border-radius: 12px;
}
.docs-callout h3 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--gold-glow);
}
.docs-callout p {
  margin: 0;
  font-size: 16px;
  line-height: 1.62;
  color: var(--platinum);
}

/* Tables */
.docs-table-wrap {
  margin: 20px 0;
  padding: 12px 16px;
  overflow-x: auto;
  background: rgba(10, 11, 16, 0.75);
  border: 1px solid var(--hair);
  border-radius: 12px;
}

.docs-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}
.docs-table th, .docs-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--hair);
}
.docs-table thead th {
  border-top: 0;
  font: 600 13px/1.35 var(--sans);
  color: var(--gold-glow);
  background: rgba(240, 199, 94, 0.06);
}
.docs-table tbody th {
  font-weight: 600;
  color: var(--paper);
}
.docs-table td {
  color: var(--silver);
}

/* Interactive Code Tabs & Live Edge Tester */
.docs-code-panel {
  margin: 22px 0;
  background: #07080c;
  border: 1px solid var(--hair-strong);
  border-radius: 12px;
  overflow: hidden;
}

.docs-code-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--hair);
}

.docs-code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.docs-code-tab {
  font: 500 13px/1.2 var(--mono);
  color: var(--silver);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.docs-code-tab:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}
.docs-code-tab.active {
  color: var(--gold-glow);
  background: rgba(240, 199, 94, 0.12);
  border-color: var(--hair-gold);
}

.docs-code-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-code-pane {
  display: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.docs-code-pane.active {
  display: block;
}

.docs-live-output {
  display: none;
  padding: 16px 20px;
  background: #040508;
  border-top: 1px solid var(--hair-gold);
  font: 400 13px/1.55 var(--mono);
  color: var(--platinum);
  white-space: pre-wrap;
}
.docs-live-output.open {
  display: block;
}

/* FAQ Accordion Items */
.docs-faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}
.docs-faq-item {
  background: rgba(14, 15, 21, 0.78);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 18px 22px;
}
.docs-faq-item summary {
  font: 600 17px/1.38 var(--sans);
  color: var(--paper);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.docs-faq-item summary::-webkit-details-marker {
  display: none;
}
.docs-faq-item[open] {
  border-color: var(--hair-gold);
}
.docs-faq-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}
.docs-faq-body p:last-child {
  margin-bottom: 0;
}

/* Bottom Page Stepper & Dual CTA Conversion Bar */
.docs-pager {
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.docs-cta-band {
  margin-top: 36px;
  padding: 26px 28px;
  background: rgba(14, 15, 21, 0.88);
  border: 1px solid var(--hair-gold);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.docs-cta-band h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.docs-cta-band p {
  margin: 0;
  font-size: 14px;
  max-width: 58ch;
}

/* Right TOC & Provenance Rail */
.docs-toc {
  position: sticky;
  top: 76px;
  padding-left: 18px;
  border-left: 1px solid var(--hair);
}

.docs-toc-title {
  margin: 0 0 10px;
  font: 600 13px/1.35 var(--sans);
  color: var(--paper);
}

.docs-toc-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs-toc-list a {
  font: 400 13px/1.4 var(--sans);
  color: var(--silver);
  text-decoration: none;
}
.docs-toc-list a:hover {
  color: var(--gold-glow);
}

.docs-rail-meta {
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  line-height: 1.55;
  color: var(--mute);
}
.docs-rail-meta strong {
  color: var(--platinum);
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs-menu-toggle {
    display: inline-flex;
  }
  .docs-shell {
    grid-template-columns: 1fr;
    padding: 20px 16px 64px;
  }
  .docs-sidebar {
    display: none;
    position: static;
    max-height: none;
    padding: 16px;
    margin-bottom: 20px;
    background: #0a0b10;
    border: 1px solid var(--hair-gold);
    border-radius: 12px;
  }
  .docs-sidebar.open {
    display: block;
  }
  .docs-hero-panel {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .docs-stat-item {
    border-left: 0;
    border-top: 1px solid var(--hair);
    padding: 12px 0 4px;
  }
  .docs-stat-item:first-child {
    border-top: 0;
    padding-top: 0;
  }
}
