/* ============================================================
   docs.css — documentation page
   ============================================================ */

body.docs-page {
  display: block;
  height: auto;
  overflow: auto;
  padding: 0;
  scroll-behavior: smooth;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(30, 232, 31, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 40%);
}

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 22px 90px;
}
.docs-content {
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* ---------- table of contents ---------- */
.docs-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  background: rgba(16, 22, 40, 0.88);
  border: 1px solid rgba(190, 200, 226, 0.22);
  border-radius: 14px;
}
.toc-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bec8e2;
  font-weight: 800;
  margin-bottom: 8px;
}
.docs-toc a {
  color: #e8ecf6;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}
.docs-toc a:hover,
.docs-toc a:focus-visible {
  color: #1ee81f;
  background: rgba(30, 232, 31, 0.10);
}

/* ---------- content typography ---------- */
.docs-content h1 {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.docs-lede {
  color: #bec8e2;
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 8px;
}
.docs-content h2 {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 52px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(190, 200, 226, 0.22);
  scroll-margin-top: 24px;
}
.docs-content h3 {
  font-size: 1.02rem;
  margin: 26px 0 8px;
  color: var(--text);
}
.docs-content p,
.docs-content li,
.docs-content dd {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #d8ddea;
}
.docs-content p { margin-bottom: 12px; }
.docs-content ul { margin: 0 0 14px 20px; }
.docs-content li { margin-bottom: 7px; }
.docs-content a {
  color: #e8ecf6;
  font-weight: 700;
  text-decoration-color: #3cb53c;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}
.docs-content a:hover,
.docs-content a:focus-visible { color: #1ee81f; }
.docs-content .compact-footer a {
  color: #8b94ad;
  text-decoration: none;
}
.docs-content .compact-footer a:hover,
.docs-content .compact-footer a:focus-visible { color: var(--text); }
.docs-content b { color: var(--text); }

/* ---------- equation blocks ---------- */
.eq {
  border: 1px solid rgba(190, 200, 226, 0.35);
  background: rgba(190, 200, 226, 0.06);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0 16px;
}
.eq code {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84rem;
  color: #e8ecf6;
  line-height: 1.8;
  white-space: pre-wrap;
}
code.inline {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84em;
  color: #e8ecf6;
  background: rgba(190, 200, 226, 0.14);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------- tables ---------- */
.docs-table {
  border-collapse: collapse;
  margin: 6px 0 18px;
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.docs-table th,
.docs-table td {
  text-align: left;
  padding: 8px 18px 8px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(190, 200, 226, 0.16);
  overflow-wrap: anywhere;
}
.docs-table th {
  color: #bec8e2;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.docs-table td b { color: var(--green); }
.docs-content #tpl-table td:first-child b { color: #e8ecf6; font-weight: 800; }

/* ---------- node reference cards ---------- */
.node-doc {
  border: 1px solid rgba(190, 200, 226, 0.18);
  border-radius: 14px;
  background: var(--card);
  padding: 18px 20px;
  margin-bottom: 16px;
  scroll-margin-top: 24px;
}
.node-doc-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
}
.node-doc-head .palette-icon { width: 30px; height: 30px; border-radius: 9px; padding: 4px; }
.node-doc-head h3 { margin: 0; font-size: 1.05rem; }
.node-doc-head .node-group-tag {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
  color: #bec8e2;
  border: 1px solid rgba(190, 200, 226, 0.22);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: auto;
}
.node-doc {
  min-width: 0;
}
.node-doc .params-table {
  width: 100%;
  table-layout: fixed;
}
.node-doc .params-table th:nth-child(1),
.node-doc .params-table td:nth-child(1) { width: 18%; }
.node-doc .params-table th:nth-child(2),
.node-doc .params-table td:nth-child(2) { width: 30%; }
.node-doc .params-table td:nth-child(2),
.node-doc .params-table td:nth-child(3) {
  color: #bec8e2;
  overflow-wrap: anywhere;
  word-break: normal;
}
.node-doc .eq { margin: 12px 0; }
.node-doc .eq-label {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #e8ecf6;
  font-weight: 800;
  margin-bottom: 5px;
}
.node-note {
  font-size: 0.85rem;
  color: #bec8e2;
  line-height: 1.65;
  border-left: 3px solid #3cb53c;
  background: rgba(60, 181, 60, 0.08);
  padding-left: 12px;
  margin-top: 12px;
}
.docs-group-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #bec8e2;
  font-weight: 800;
  margin: 26px 0 12px;
}

/* ---------- caveats & glossary ---------- */
.caveat-list li { margin-bottom: 11px; }
.ref-list { margin: 6px 0 0; padding-left: 20px; }
.ref-list li { margin-bottom: 9px; font-size: 0.9rem; line-height: 1.6; }
.glossary dt {
  font-weight: 800;
  color: var(--text);
  margin-top: 14px;
  font-size: 0.92rem;
}
.glossary dd { margin-left: 0; }

.docs-content .site-footer { margin-top: 60px; }

.crypto-reference h3 { scroll-margin-top: 24px; }

@media (max-width: 800px) {
  .docs { grid-template-columns: 1fr; }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .toc-title { width: 100%; }
}
