/* ==========================================================================
   Docs — GitBook-style 3-column layout
   ========================================================================== */

body.docs {
    background: #0a0a0a;
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
}

/* ---- Top bar ---- */
.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}

.docs-logo img {
    height: 26px;
    display: block;
}

.docs-crumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 0;
}

.docs-crumb .sep {
    color: rgba(255, 255, 255, 0.25);
}

.docs-crumb #crumb-section {
    color: var(--fg);
}

.docs-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.docs-topbar-link {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    transition: color .15s;
}

.docs-topbar-link:hover {
    color: var(--mint);
}

.docs-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg);
    transition: all .15s;
}

.docs-cta:hover {
    border-color: var(--mint);
    color: var(--mint);
}

.docs-cta .ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint);
    animation: pulse 1.4s ease-in-out infinite;
}

.docs-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
}

.docs-menu-btn span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 1.5px;
    background: var(--fg);
    transition: transform .2s;
}

.docs-menu-btn span:nth-child(1) {
    top: 13px;
}

.docs-menu-btn span:nth-child(2) {
    top: 18px;
}

.docs-menu-btn span:nth-child(3) {
    top: 23px;
}

/* ---- Shell ---- */
.docs-shell {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 240px;
    gap: 48px;
    padding: 0 24px;
    align-items: start;
}

/* ---- Sidebar ---- */
.docs-sidebar {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 32px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-sidebar-inner {
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
}

.docs-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    transition: border-color .15s;
}

.docs-search:focus-within {
    border-color: rgba(112, 255, 186, 0.4);
}

.docs-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 13px;
    min-width: 0;
}

.docs-search kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.docs-nav .group {
    margin-top: 20px;
}

.docs-nav .group:first-child {
    margin-top: 0;
}

.docs-nav .group-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 6px 10px;
    margin-bottom: 4px;
}

.docs-nav a {
    display: block;
    padding: 7px 10px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    line-height: 1.4;
    border-left: 2px solid transparent;
    margin-left: 0;
    transition: background .12s, color .12s, border-color .12s;
    position: relative;
}

.docs-nav a:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.03);
}

.docs-nav a.active {
    color: var(--mint);
    background: rgba(112, 255, 186, 0.06);
    border-left-color: var(--mint);
    padding-left: 12px;
}

.docs-nav a.sub {
    font-size: 12.5px;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.55);
}

.docs-nav a.sub.active {
    padding-left: 22px;
}

.docs-sidebar-foot {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

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

.docs-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 8px var(--mint);
}

.docs-sidebar-foot a {
    color: rgba(255, 255, 255, 0.55);
}

.docs-sidebar-foot a:hover {
    color: var(--mint);
}

/* ---- Main article ---- */
.docs-main {
    padding: 56px 0 80px;
    min-width: 0;
}

.docs-article {
    max-width: 780px;
}

.docs-article h1 {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 8px;
    color: var(--fg);
}

.docs-article > h1:first-child {
    margin-top: 0;
}

.docs-article h1 + p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 12px;
    margin-bottom: 40px;
    line-height: 1.55;
}

.docs-article h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 56px 0 20px;
    padding-top: 12px;
    color: var(--fg);
    scroll-margin-top: 80px;
}

.docs-article h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 40px 0 14px;
    color: var(--fg);
    scroll-margin-top: 80px;
}

.docs-article h4 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--fg);
}

.docs-article p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.78);
}

.docs-article a {
    color: var(--mint);
    border-bottom: 1px solid rgba(112, 255, 186, 0.25);
    transition: border-color .15s;
}

.docs-article a:hover {
    border-bottom-color: var(--mint);
}

.docs-article strong {
    color: var(--fg);
    font-weight: 600;
}

.docs-article em {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.docs-article ul, .docs-article ol {
    margin: 0 0 24px;
    padding-left: 22px;
}

.docs-article li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
}

.docs-article li::marker {
    color: var(--mint);
}

.docs-article ul li::marker {
    content: "▸ ";
    font-size: 0.85em;
}

.docs-article hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 48px 0;
}

.docs-article blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background: rgba(112, 255, 186, 0.04);
    border-left: 2px solid var(--mint);
    border-radius: 4px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.85);
}

.docs-article blockquote p {
    margin: 0 0 10px;
}

.docs-article blockquote p:last-child {
    margin: 0;
}

.docs-article blockquote strong {
    color: var(--mint);
}

/* inline code */
.docs-article code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--mint);
}

/* code blocks */
.docs-article pre {
    margin: 20px 0 28px;
    padding: 20px 22px;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.6;
    position: relative;
}

.docs-article pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
}

.docs-article pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 8px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

/* tables */
.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 28px;
    font-size: 13.5px;
}

.docs-article thead th {
    text-align: left;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.docs-article tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    vertical-align: top;
}

.docs-article tbody tr:last-child td {
    border-bottom: none;
}

.docs-article td code {
    font-size: 12px;
}

/* pager */
.docs-pager {
    max-width: 780px;
    margin-top: 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.docs-pager a {
    display: block;
    padding: 18px 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: all .15s;
}

.docs-pager a:hover {
    border-color: var(--mint);
    background: rgba(112, 255, 186, 0.04);
}

.docs-pager a.pager-prev {
    text-align: left;
}

.docs-pager a.pager-next {
    text-align: right;
    grid-column: 2;
}

.docs-pager .dir {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
}

.docs-pager .title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.docs-pager a:hover .title {
    color: var(--mint);
}

/* footer */
.docs-footer {
    max-width: 780px;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 40px;
    font-size: 13px;
}

.docs-footer .double-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, auto));
    gap: 40px;
}

.docs-footer .h {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
}

.docs-footer p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.55;
    margin: 0;
    max-width: 32ch;
}

.docs-footer .col a {
    display: block;
    padding: 4px 0;
    color: rgba(255, 255, 255, 0.72);
}

.docs-footer .col a:hover {
    color: var(--mint);
}

/* ---- TOC ---- */
.docs-toc {
    position: sticky;
    top: 80px;
    padding: 56px 0 40px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    font-size: 12.5px;
}

.docs-toc .toc-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
}

.docs-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-toc li a {
    display: block;
    padding: 5px 12px;
    color: rgba(255, 255, 255, 0.55);
    border-left: 1px solid transparent;
    margin-left: -1px;
    line-height: 1.4;
    transition: color .12s, border-color .12s;
}

.docs-toc li a:hover {
    color: var(--fg);
}

.docs-toc li a.active {
    color: var(--mint);
    border-left-color: var(--mint);
}

.docs-toc li.h3 a {
    padding-left: 24px;
    font-size: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .docs-shell {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 40px;
    }

    .docs-toc {
        display: none;
    }
}

@media (max-width: 900px) {
    .docs-topbar-actions .docs-topbar-link {
        display: none;
    }

    .docs-crumb {
        display: none;
    }

    .docs-menu-btn {
        display: block;
    }

    .docs-shell {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .docs-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        height: auto;
        background: #0a0a0a;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 20px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 40;
        overflow-y: auto;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-sidebar-inner {
        padding-right: 0;
    }

    .docs-main {
        padding: 32px 0 60px;
    }

    .docs-article h1 {
        font-size: 34px;
    }

    .docs-article h2 {
        font-size: 24px;
        margin-top: 40px;
    }

    .docs-article h3 {
        font-size: 18px;
    }

    .docs-footer {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .double-col {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

    .docs-pager {
        grid-template-columns: 1fr;
    }

    .docs-pager a.pager-next {
        grid-column: 1;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .docs-cta span:not(.ticker-dot) {
        display: none;
    }

    .docs-cta {
        padding: 8px 10px;
    }
}
