/* Docs-specific styles. Inherits the palette + base from styles.css. */

body.doc { line-height: 1.7; }

.doc-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 36px 60px;
  position: relative;
}

/* ── sidebar TOC ─── */
.toc {
  font-size: 13.5px;
}
.toc-head { margin-bottom: 18px; }
.toc-meta { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.05em; margin-top: 4px; }
.toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc nav a {
  display: block;
  padding: 7px 12px;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.15s ease;
}
.toc nav a:hover {
  color: var(--text);
  background: rgba(164,88,255,0.05);
  border-left-color: var(--line-2);
}
.toc nav a.active {
  color: var(--purple-2);
  background: rgba(164,88,255,0.10);
  border-left-color: var(--purple);
  font-weight: 600;
}

/* ── DESKTOP: pin sidebar to viewport with position:fixed so it CANNOT
   scroll with the content. Pushed the body content right to clear it. */
@media (min-width: 901px) {
  .doc-shell { padding-left: calc(240px + 36px + 48px); }
  .toc {
    position: fixed;
    top: 88px;                     /* below the top nav */
    left: max(28px, calc(50vw - 1180px / 2 + 36px));
    width: 240px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    /* subtle scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .toc::-webkit-scrollbar { width: 6px; }
  .toc::-webkit-scrollbar-track { background: transparent; }
  .toc::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
}

/* ── body ─── */
.doc-body { min-width: 0; }
.doc-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
  margin-bottom: 40px;
}
.doc-hero h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 8px 0 14px;
}
.doc-hero .lede { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0; }

.doc-body section { padding: 36px 0; border-bottom: 1px solid var(--line); }
.doc-body section:last-of-type { border-bottom: none; }
.doc-body h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  scroll-margin-top: 80px;
}
.doc-body h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 26px 0 8px;
}
.doc-body p { margin: 0 0 14px; color: var(--text); font-size: 15px; }
.doc-body ul { padding-left: 22px; margin: 0 0 14px; }
.doc-body ul li { margin-bottom: 8px; font-size: 15px; }

/* ── callout ─── */
.callout {
  background: linear-gradient(135deg, rgba(164,88,255,0.08) 0%, rgba(106,58,204,0.04) 100%);
  border: 1px solid rgba(164,88,255,0.25);
  border-left: 3px solid var(--purple);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}
.callout b { color: var(--purple-2); }

/* ── code blocks ─── */
.code {
  display: block;
  background: #0f0822;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: auto;
  margin: 16px 0;
  white-space: pre;
}
.code .kw { color: #c688ff; font-weight: 600; }
.code .vt { color: #4ade80; }
.code .cm { color: #6c5e93; font-style: italic; }
.code .hl { background: rgba(164,88,255,0.12); display: inline-block; }

.formula-block {
  display: block;
  background: #0f0822;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  padding: 14px 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--purple-2);
  margin: 16px 0;
  white-space: pre;
  overflow-x: auto;
}

/* ── tables ─── */
.sig-table, .rate-table, .deploy-table {
  background: rgba(23,10,42,0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}
.sig-table table, .rate-table table, .deploy-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.sig-table th, .rate-table th {
  background: rgba(164,88,255,0.06);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.sig-table td, .rate-table td, .deploy-table td { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.sig-table tr:last-child td, .rate-table tr:last-child td, .deploy-table tr:last-child td { border-bottom: none; }
.sig-table tr:hover td, .rate-table tr:hover td { background: rgba(164,88,255,0.04); }
.deploy-table td:first-child { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; width: 30%; }
.deploy-table td:last-child { color: var(--text); }

/* ── split cards ─── */
.split-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.split-card {
  background: rgba(23,10,42,0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.split-pct { font-size: 36px; font-weight: 700; line-height: 1; margin-bottom: 12px; letter-spacing: -0.02em; }
.split-card h4 { margin: 0 0 6px; font-size: 15px; }
.split-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.addr { font-size: 11px; word-break: break-all; }

/* ── burn chart ─── */
.burn-chart {
  background: rgba(23,10,42,0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0 10px;
}
.burn-chart svg { width: 100%; height: auto; }

/* ── faq (docs reuse) ─── */
.doc-body details {
  background: rgba(23,10,42,0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
}
.doc-body details summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  list-style: none;
}
.doc-body details summary::-webkit-details-marker { display: none; }
.doc-body details summary::after {
  content: "+";
  color: var(--purple-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  transition: transform 0.2s ease;
}
.doc-body details[open] summary::after { transform: rotate(45deg); }
.doc-body details p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ── footer CTA on docs ─── */
.doc-cta {
  margin-top: 48px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(164,88,255,0.08) 0%, rgba(106,58,204,0.04) 100%);
  border: 1px solid rgba(164,88,255,0.25);
  border-radius: 14px;
  text-align: center;
}
.doc-cta h3 { font-size: 19px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.doc-cta p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── responsive — mobile drops the fixed sidebar back to inline ─ */
@media (max-width: 900px) {
  .doc-shell {
    padding: 16px 20px 48px;
  }
  .toc {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(23,10,42,0.5);
    margin-bottom: 24px;
  }
  .toc nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc nav a { padding: 6px 10px; border-left: none; border-bottom: 2px solid transparent; }
  .toc nav a.active { border-bottom-color: var(--purple); border-left-color: transparent; }
  .split-grid { grid-template-columns: 1fr; }
}
