/* Docs pages — same terminal look as the policy pages.
   Tokens (--cn-*), the dark body and the monospace come from site.css, which
   every docs page links before this file. Header/footer inject their own CSS. */

.docs-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2.5rem;
}
@media (max-width: 860px) {
    .docs-wrap {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.docs-side {
    padding-top: clamp(36px, 7vh, 72px);
}
.docs-side nav {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.docs-side .ds-h {
    color: var(--cn-text-3);
    font-size: 0.66rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 0.6rem;
}
.docs-side a {
    color: var(--cn-text-2);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    border-left: 1px solid var(--cn-border);
    transition:
        color 0.15s,
        border-color 0.15s;
}
.docs-side a:hover {
    color: var(--cn-blue);
    border-left-color: var(--cn-blue);
}
.docs-side a[aria-current="page"] {
    color: var(--cn-blue);
    border-left-color: var(--cn-blue);
    text-shadow: 0 0 4px var(--cn-blue-dim);
}
@media (max-width: 860px) {
    .docs-side {
        padding-top: 1.5rem;
    }
    .docs-side nav {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .docs-side .ds-h {
        width: 100%;
        margin-bottom: 0.2rem;
    }
    .docs-side a {
        border: 1px solid var(--cn-border);
    }
}

/* ── Page header ──────────────────────────────────────────────────── */
.docs-head {
    padding: clamp(36px, 7vh, 72px) 0 1.5rem;
    border-bottom: 1px solid var(--cn-border);
    margin-bottom: 2rem;
}
.docs-head .cn-lead {
    margin: 0;
}

/* ── Prose ────────────────────────────────────────────────────────── */
.docs-prose {
    color: var(--cn-text-2);
    font-size: 0.86rem;
    line-height: 1.75;
    padding-bottom: 5rem;
    min-width: 0;
}
.docs-prose h2 {
    font-size: 1.02rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--cn-text);
    margin: 2.75rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cn-border);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}
.docs-prose > section:first-child h2 {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
.docs-prose h3 {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cn-blue);
    margin: 1.75rem 0 0.6rem;
}
.docs-prose p {
    margin: 0 0 1rem;
}
.docs-prose ul,
.docs-prose ol {
    margin: 0 0 1rem;
    padding-left: 1.4rem;
}
.docs-prose li {
    margin: 0 0 0.45rem;
}
.docs-prose a {
    color: var(--cn-blue);
    text-decoration: none;
}
.docs-prose a:hover {
    text-shadow: 0 0 4px var(--cn-blue);
}
.docs-prose strong {
    color: var(--cn-text);
}
.docs-prose code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--cn-border);
    border-radius: 2px;
    padding: 0.05rem 0.35rem;
    font-size: 0.8rem;
    color: var(--cn-text);
    word-break: break-word;
}
.docs-prose pre {
    background: rgba(10, 10, 10, 0.92);
    border: 1px solid var(--cn-border);
    border-left: 2px solid var(--cn-blue);
    border-radius: 2px;
    padding: 0.9rem 1rem;
    margin: 0 0 1.25rem;
    overflow-x: auto;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--cn-text);
}
.docs-prose pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    word-break: normal;
}
.docs-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: 0.8rem;
}
.docs-prose th,
.docs-prose td {
    border: 1px solid var(--cn-border);
    padding: 0.5rem 0.7rem;
    text-align: left;
    vertical-align: top;
}
.docs-prose th {
    color: var(--cn-text);
    font-weight: 600;
}
.docs-prose td code {
    white-space: nowrap;
}
.docs-note {
    border: 1px solid var(--cn-blue-dim);
    background: rgba(110, 207, 255, 0.05);
    padding: 0.8rem 1rem;
    margin: 0 0 1.25rem;
    border-radius: 2px;
}
.docs-note p:last-child {
    margin-bottom: 0;
}

/* ── Hub cards (/docs/) ───────────────────────────────────────────── */
.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    padding-bottom: 4rem;
}
.docs-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--cn-border);
    background: var(--cn-card-gradient), rgba(5, 5, 5, 0.85);
    border-radius: 2px;
    padding: 1.5rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}
.docs-card:hover {
    border-color: var(--cn-blue);
    box-shadow: var(--cn-glow-blue);
    transform: translateY(-3px);
}
.docs-card .dc-tag {
    color: var(--cn-text-3);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.docs-card .dc-tag::before {
    content: "> ";
    color: var(--cn-blue);
}
.docs-card h2 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--cn-text);
    margin: 0.6rem 0 0.5rem;
}
.docs-card p {
    color: var(--cn-text-2);
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Narrow screens: nothing may push the page wider than the viewport ── */
.docs-main {
  min-width: 0;
}
@media (max-width: 860px) {
  .docs-prose table {
    display: block;
    overflow-x: auto;
  }
  .docs-prose td code {
    white-space: normal;
  }
}

/* ── CRT on the titles and the top text only (2026-09-29) ─────────────────
   Static glow + a slight colour split, no page-wide glass. No animation and
   no scanline pattern: both flashed while scrolling. */
.docs-head { padding: 6px 0 26px; }
.docs-head h1 {
    text-shadow: -1px 0 rgba(255, 60, 90, 0.5), 1px 0 rgba(60, 200, 255, 0.5),
        0 0 2px #fff, 0 0 14px rgba(255, 255, 255, 0.3), 0 0 30px rgba(110, 207, 255, 0.25);
}
.docs-head p,
.docs-head .cn-prompt-line {
    text-shadow: 0 0 8px rgba(110, 207, 255, 0.22);
}
.docs-prose h2,
.docs-prose h3 {
    text-shadow: -0.6px 0 rgba(255, 60, 90, 0.4), 0.6px 0 rgba(60, 200, 255, 0.4), 0 0 10px rgba(110, 207, 255, 0.25);
}

/* Long lines wrap instead of scrolling sideways. */
.docs-prose pre { overflow-x: visible; white-space: pre-wrap; overflow-wrap: anywhere; }
.docs-prose pre code { white-space: inherit; }
.docs-prose code, .docs-prose td code { white-space: normal; overflow-wrap: anywhere; }
.docs-prose table, .docs-card table { display: table; overflow: visible; table-layout: fixed; }
@media (max-width: 860px) {
    .docs-prose table { display: table; overflow: visible; }
}

/* ── Docs look (2026-09-29): slate background, sans reading text, card tables and
   code windows, round step numbers, fading section dividers. Chosen from the
   docs-styles mockups (slate → option 2 → cards → dividers). ─────────────── */
body.cn-page { background: var(--page-bg, var(--cn-bg)) !important; color: var(--cn-text-2); }
.docs-prose, .docs-prose p, .docs-prose li, .docs-prose td { color: var(--body-text, var(--cn-text-2)); }
.docs-prose b, .docs-prose strong { color: var(--strong, var(--cn-text)); }
.docs-prose pre { background: var(--code-bg, rgba(10,10,10,.92)) !important; border-color: var(--line, var(--cn-border)) !important; color: var(--code-text, var(--cn-text)); }
.docs-prose :not(pre) > code { background: var(--inline-bg, rgba(255,255,255,.06)); color: var(--code-text, var(--cn-text)); border-color: var(--line, var(--cn-border)); }
.docs-prose th, .docs-prose td { border-color: var(--line, var(--cn-border)) !important; }
.docs-prose th { background: var(--th-bg, transparent); color: var(--strong, var(--cn-text)); }
.docs-prose h2 { border-top-color: var(--line, var(--cn-border)) !important; }
.docs-note { background: var(--note-bg, rgba(110,207,255,.05)) !important; border-color: var(--note-line, var(--cn-blue-dim)) !important; }
.docs-side a { color: var(--nav-text, var(--cn-text-3)); border-left-color: var(--line, var(--cn-border)); }

:root { --page-bg:#0d1117; --cn-bg:#0d1117; --cn-text:#f0f3f6; --body-text:#c9d1d9; --strong:#f0f3f6; --line:#30363d; --cn-border:#30363d; --code-bg:#161b22; --inline-bg:#1c2230; --th-bg:#161b22; --nav-text:#9aa4b1; --note-bg:#0f2130; }
.docs-prose, .docs-prose p, .docs-prose li, .docs-prose td, .docs-prose th, .docs-head p { text-shadow: none !important; }

.docs-prose p, .docs-prose li, .docs-prose td, .docs-head p { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1.02rem; line-height: 1.75; letter-spacing: 0; color: #e6edf3; }
.docs-prose h2 { text-transform: none; letter-spacing: .01em; font-size: 1.35rem; }
.docs-prose h3 { text-transform: none; letter-spacing: .01em; font-size: 1.05rem; }
.docs-prose p, .docs-prose > ul, .docs-prose > ol { max-width: 70ch; }
.docs-side a { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: .9rem; letter-spacing: 0; color: #aab4c0; }
.docs-prose h2 { margin-top: 3.4rem; }
.docs-prose table { border-collapse: separate; border-spacing: 0; border: 1px solid #30363d; border-radius: 12px; overflow: hidden; background: #111720; }
.docs-prose th, .docs-prose td { border: 0 !important; border-bottom: 1px solid #262c35 !important; }
.docs-prose tr:last-child td { border-bottom: 0 !important; }
.docs-prose th { background: #1a212b; }
.docs-prose pre { position: relative; border: 1px solid #30363d !important; border-radius: 12px; background: #0b0f14 !important; padding: 2.6rem 1.2rem 1rem; }
.docs-prose pre::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 30px; border-bottom: 1px solid #262c35; background: radial-gradient(circle at 16px 15px, #ff5f57 4px, transparent 4.5px), radial-gradient(circle at 30px 15px, #febc2e 4px, transparent 4.5px), radial-gradient(circle at 44px 15px, #28c840 4px, transparent 4.5px), #121820; border-radius: 12px 12px 0 0; }
.docs-note { border-radius: 12px; border: 1px solid #1e4058 !important; background: #0e1e2b !important; padding: 1rem 1.2rem; }
.docs-prose ol { list-style: none; counter-reset: s; padding-left: 0; }
.docs-prose ol > li { counter-increment: s; position: relative; padding-left: 2.4rem; margin: .8rem 0; }
.docs-prose ol > li::before { content: counter(s); position: absolute; left: 0; top: .15rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font: 600 .78rem var(--cn-mono); color: #0d1117; background: #6ecfff; }
.docs-prose h2 { border-top: 0 !important; padding-top: 2.6rem !important; position: relative; }
.docs-prose h2::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, #30363d 20%, #30363d 80%, transparent); }
.docs-prose ol > li::before { background: #1a2633 !important; color: #6ecfff !important; }
.docs-head { border-bottom: 0 !important; }
.docs-prose > section:first-child h2 { margin-top: 1.4rem !important; }
/* Room between the site header and the docs, and a clean overview card grid. */
.docs-wrap { padding-top: 3.5rem; }
.docs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 1rem; }
.docs-card {
    display: flex; flex-direction: column; gap: .55rem;
    padding: 1.3rem 1.3rem 1.4rem !important;
    background: #111720 !important;
    border: 1px solid #30363d !important;
    border-radius: 12px !important;
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}
.docs-card:hover { border-color: #6ecfff !important; background: #141c27 !important; transform: translateY(-2px); }
.docs-card .dc-tag { margin: 0; font-size: .66rem; letter-spacing: .14em; color: #6ecfff; }
.docs-card h2 {
    margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
    font-size: 1.12rem !important; line-height: 1.3; text-transform: none; letter-spacing: .01em;
}
.docs-card h2::before, .docs-card h2::after { display: none !important; }
.docs-card p { margin: 0; font-size: .92rem; line-height: 1.6; color: #aab4c0; max-width: none; }
.docs-card:hover h2 { color: #6ecfff; }
@media (max-width: 960px) { .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .docs-cards { grid-template-columns: 1fr; } }
