:root {
    --docs-bg: #050608;
    --docs-surface: #090b0f;
    --docs-surface-2: #0d1015;

    --docs-border: rgba(255,255,255,.075);
    --docs-border-strong: rgba(255,255,255,.12);

    --docs-text: #f5f7fa;
    --docs-muted: #969daa;
    --docs-dim: #5e6571;

    --docs-purple: #a78bfa;
    --docs-green: #34d399;

    --docs-container: 1500px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--docs-bg);

    color: var(--docs-text);

    font-family:
        "DM Sans",
        sans-serif;
}


/* =====================================================
   HEADER
===================================================== */

.docs-header {
    position: sticky;

    top: 0;

    z-index: 100;

    height: 68px;

    border-bottom:
        1px solid
        var(--docs-border);

    background:
        rgba(5,6,8,.82);

    backdrop-filter:
        blur(22px);
}

.docs-header-inner {
    width:
        min(
            calc(100% - 40px),
            var(--docs-container)
        );

    height: 100%;

    margin-inline: auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;
}

.docs-brand {
    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 270px;
}

.brand-mark {
    width: 30px;
    height: 30px;

    display: grid;

    place-items: center;

    border:
        1px solid
        rgba(167,139,250,.3);

    border-radius: 8px;

    background:
        rgba(139,92,246,.12);

    color: var(--docs-purple);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-weight: 700;
}

.brand-name {
    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 15px;

    font-weight: 700;

    letter-spacing: .05em;
}

.brand-divider {
    width: 1px;
    height: 15px;

    margin-left: 4px;

    background:
        var(--docs-border-strong);
}

.brand-section {
    color: var(--docs-dim);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: .15em;
}

.docs-top-nav {
    display: flex;

    gap: 30px;
}

.docs-top-nav a {
    color: var(--docs-muted);

    font-size: 11px;

    transition: color 160ms ease;
}

.docs-top-nav a:hover,
.docs-top-nav a.active {
    color: var(--docs-text);
}

.docs-header-actions {
    min-width: 270px;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 14px;
}

.docs-status {
    display: flex;

    align-items: center;

    gap: 7px;

    color: var(--docs-muted);

    font-size: 9px;
}

.docs-status span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background:
        var(--docs-green);

    box-shadow:
        0 0 12px
        rgba(52,211,153,.45);
}

.version-select {
    padding:
        6px 9px;

    border:
        1px solid
        var(--docs-border-strong);

    border-radius: 6px;

    color: var(--docs-muted);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 9px;
}


/* =====================================================
   LAYOUT
===================================================== */

.docs-layout {
    width:
        min(
            calc(100% - 40px),
            var(--docs-container)
        );

    margin-inline: auto;

    display: grid;

    grid-template-columns:
        250px
        minmax(0, 1fr);
}


/* =====================================================
   SIDEBAR
===================================================== */

.docs-sidebar {
    position: sticky;

    top: 68px;

    height:
        calc(100vh - 68px);

    border-right:
        1px solid
        var(--docs-border);
}

.sidebar-inner {
    height: 100%;

    overflow-y: auto;

    padding:
        30px 22px 30px 0;
}

.sidebar-search {
    height: 40px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding:
        0 10px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 8px;

    background:
        rgba(255,255,255,.025);
}

.search-icon {
    color: var(--docs-dim);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 13px;
}

.sidebar-search input {
    min-width: 0;

    flex: 1;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--docs-text);

    font-size: 10px;
}

.sidebar-search input::placeholder {
    color: var(--docs-dim);
}

.sidebar-search kbd {
    color: var(--docs-dim);

    font-size: 8px;
}

.sidebar-group {
    margin-top: 32px;
}

.sidebar-heading {
    display: block;

    margin-bottom: 10px;

    color: var(--docs-dim);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: .15em;
}

.sidebar-link {
    display: block;

    padding:
        7px 10px;

    margin-left: -10px;

    border-radius: 6px;

    color: var(--docs-muted);

    font-size: 11px;
}

.sidebar-link:hover {
    color: var(--docs-text);

    background:
        rgba(255,255,255,.025);
}

.sidebar-link.active {
    color: var(--docs-text);

    background:
        rgba(139,92,246,.08);

    border-left:
        2px solid
        var(--docs-purple);
}

.sidebar-footer {
    margin-top: 45px;

    padding-top: 20px;

    border-top:
        1px solid
        var(--docs-border);
}

.sidebar-footer a {
    color: var(--docs-dim);

    font-size: 10px;
}


/* =====================================================
   MAIN
===================================================== */

.docs-main {
    min-width: 0;

    display: grid;

    grid-template-columns:
        minmax(0, 850px)
        150px;

    gap: 60px;

    padding:
        0 55px;
}

.docs-content {
    min-width: 0;
}

.docs-section {
    padding:
        100px
        0;

    border-bottom:
        1px solid
        var(--docs-border);

    scroll-margin-top: 90px;
}

.docs-section:last-child {
    border-bottom: 0;
}

.docs-eyebrow {
    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--docs-dim);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: .17em;
}

.docs-eyebrow span {
    width: 22px;
    height: 1px;

    background:
        var(--docs-purple);
}


/* =====================================================
   HERO
===================================================== */

.docs-hero {
    padding-top: 120px;
}

.docs-hero h1 {
    max-width: 800px;

    margin:
        25px
        0
        22px;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size:
        clamp(
            46px,
            5vw,
            70px
        );

    line-height: 1;

    letter-spacing:
        -.055em;
}

.docs-hero h1 span {
    background:
        linear-gradient(
            100deg,
            #fff,
            #c4b5fd,
            #8b5cf6
        );

    -webkit-background-clip: text;

    background-clip: text;

    -webkit-text-fill-color:
        transparent;
}

.docs-lead {
    max-width: 650px;

    color: var(--docs-muted);

    font-size: 15px;

    line-height: 1.8;
}

.docs-actions {
    display: flex;

    gap: 10px;

    margin-top: 32px;
}

.docs-button {
    min-height: 44px;

    display: inline-flex;

    align-items: center;

    gap: 10px;

    padding:
        0 16px;

    border-radius: 8px;

    font-size: 11px;

    font-weight: 600;
}

.docs-button-primary {
    background: #fff;

    color: #050608;
}

.docs-button-secondary {
    border:
        1px solid
        var(--docs-border-strong);

    background:
        rgba(255,255,255,.025);
}

.api-meta {
    display: grid;

    grid-template-columns:
        repeat(3,1fr);

    max-width: 650px;

    margin-top: 60px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 10px;

    overflow: hidden;
}

.api-meta div {
    padding:
        15px 18px;

    border-right:
        1px solid
        var(--docs-border);
}

.api-meta div:last-child {
    border-right: 0;
}

.api-meta span {
    display: block;

    margin-bottom: 5px;

    color: var(--docs-dim);

    font-size: 7px;

    font-weight: 700;

    letter-spacing: .13em;
}

.api-meta strong {
    color: var(--docs-muted);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 10px;
}


/* =====================================================
   SECTION HEADINGS
===================================================== */

.section-number {
    margin-bottom: 12px;

    color: var(--docs-purple);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 9px;
}

.section-copy h2 {
    margin:
        14px
        0
        15px;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 34px;

    line-height: 1.05;

    letter-spacing:
        -.04em;
}

.section-copy p {
    max-width: 650px;

    color: var(--docs-muted);

    font-size: 13px;

    line-height: 1.8;
}


/* =====================================================
   CODE
===================================================== */

.code-window {
    margin-top: 22px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 10px;

    overflow: hidden;

    background:
        #080a0e;
}

.code-header {
    min-height: 38px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        0 13px;

    border-bottom:
        1px solid
        var(--docs-border);

    color: var(--docs-dim);

    font-size: 7px;

    font-weight: 700;

    letter-spacing: .13em;
}

.code-header button {
    border: 0;

    background: transparent;

    color: var(--docs-muted);

    cursor: pointer;

    font-size: 8px;
}

.response-status {
    color: var(--docs-green);
}

.code-window pre {
    margin: 0;

    padding: 20px;

    overflow-x: auto;
}

.code-window code {
    color: #cbd5e1;

    font-family:
        "JetBrains Mono",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 11px;

    line-height: 1.7;
}


/* =====================================================
   INFO CARD
===================================================== */

.info-card {
    display: flex;

    gap: 15px;

    margin-top: 30px;

    padding: 20px;

    border:
        1px solid
        rgba(139,92,246,.15);

    border-radius: 12px;

    background:
        rgba(139,92,246,.045);
}

.info-card-icon {
    font-size: 17px;
}

.info-card strong {
    display: block;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 12px;
}

.info-card p {
    margin:
        5px
        0
        0;

    color: var(--docs-muted);

    font-size: 11px;
}


/* =====================================================
   ENDPOINTS
===================================================== */

.endpoint-group {
    margin-top: 45px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 12px;

    overflow: hidden;
}

.endpoint-group-header {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 20px;

    background:
        rgba(255,255,255,.018);

    border-bottom:
        1px solid
        var(--docs-border);
}

.endpoint-icon {
    width: 32px;
    height: 32px;

    display: grid;

    place-items: center;

    border:
        1px solid
        var(--docs-border);

    border-radius: 8px;

    color: var(--docs-purple);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 10px;

    font-weight: 700;
}

.endpoint-group-header h3 {
    margin: 0;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 13px;
}

.endpoint-group-header p {
    margin: 2px 0 0;

    color: var(--docs-dim);

    font-size: 9px;
}

.endpoint {
    min-height: 65px;

    display: grid;

    grid-template-columns:
        58px
        minmax(190px,1fr)
        1.2fr
        20px;

    align-items: center;

    gap: 12px;

    padding:
        0 20px;

    border-bottom:
        1px solid
        var(--docs-border);

    transition:
        background 160ms ease;
}

.endpoint:last-child {
    border-bottom: 0;
}

.endpoint:hover {
    background:
        rgba(255,255,255,.025);
}

.method {
    width: fit-content;

    padding:
        4px 6px;

    border-radius: 4px;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 7px;

    font-weight: 700;

    letter-spacing: .05em;
}

.method-get {
    background:
        rgba(52,211,153,.09);

    color:
        var(--docs-green);
}

.method-post {
    background:
        rgba(139,92,246,.1);

    color:
        var(--docs-purple);
}

.method-patch {
    background:
        rgba(251,191,36,.09);

    color:
        #fbbf24;
}

.endpoint code {
    color: var(--docs-text);

    font-family:
        "JetBrains Mono",
        Consolas,
        monospace;

    font-size: 9px;
}

.endpoint-description {
    color: var(--docs-dim);

    font-size: 9px;
}

.endpoint-arrow {
    color: var(--docs-dim);
}


/* =====================================================
   REALTIME
===================================================== */

.realtime-card {
    min-height: 180px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0;

    margin-top: 35px;

    padding: 25px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 12px;

    background:
        rgba(255,255,255,.018);
}

.realtime-node {
    padding:
        13px 17px;

    border:
        1px solid
        var(--docs-border-strong);

    border-radius: 8px;

    color: var(--docs-muted);

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 10px;
}

.realtime-core {
    border-color:
        rgba(139,92,246,.25);

    background:
        rgba(139,92,246,.08);

    color: var(--docs-purple);
}

.realtime-line {
    width: 70px;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            var(--docs-border-strong),
            var(--docs-purple),
            var(--docs-border-strong)
        );
}

.event-list {
    margin-top: 20px;

    border-top:
        1px solid
        var(--docs-border);
}

.event-row {
    min-height: 55px;

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    align-items: center;

    border-bottom:
        1px solid
        var(--docs-border);
}

.event-row code {
    color: var(--docs-purple);

    font-family:
        "JetBrains Mono",
        Consolas,
        monospace;

    font-size: 9px;
}

.event-row span {
    color: var(--docs-dim);

    font-size: 9px;
}


/* =====================================================
   STACK
===================================================== */

.stack-grid {
    display: grid;

    grid-template-columns:
        repeat(3,1fr);

    gap: 8px;

    margin-top: 35px;
}

.stack-item {
    min-height: 100px;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    padding: 18px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 9px;

    background:
        rgba(255,255,255,.018);
}

.stack-item strong {
    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 12px;
}

.stack-item span {
    margin-top: 3px;

    color: var(--docs-dim);

    font-size: 8px;
}


/* =====================================================
   VERSION
===================================================== */

.version-card {
    min-height: 80px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-top: 30px;

    padding:
        0 20px;

    border:
        1px solid
        var(--docs-border);

    border-radius: 10px;
}

.version-card span {
    display: block;

    color: var(--docs-dim);

    font-size: 7px;

    font-weight: 700;

    letter-spacing: .1em;
}

.version-card strong {
    display: block;

    margin-top: 3px;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 15px;
}

.version-status {
    color:
        var(--docs-green) !important;

    font-size: 9px !important;
}


/* =====================================================
   RIGHT NAV
===================================================== */

.docs-on-page {
    position: sticky;

    top: 100px;

    align-self: start;

    padding-top: 100px;
}

.docs-on-page > span {
    display: block;

    margin-bottom: 15px;

    color: var(--docs-dim);

    font-size: 7px;

    font-weight: 700;

    letter-spacing: .14em;
}

.docs-on-page a {
    display: block;

    margin-bottom: 10px;

    color: var(--docs-dim);

    font-size: 9px;
}

.docs-on-page a:hover {
    color: var(--docs-text);
}


/* =====================================================
   FOOTER
===================================================== */

.docs-footer {
    min-height: 100px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    width:
        min(
            calc(100% - 40px),
            var(--docs-container)
        );

    margin-inline: auto;

    border-top:
        1px solid
        var(--docs-border);
}

.docs-footer strong {
    display: block;

    font-family:
        "Space Grotesk",
        sans-serif;

    font-size: 10px;
}

.docs-footer div span,
.docs-footer > span {
    color: var(--docs-dim);

    font-size: 8px;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1100px) {

    .docs-main {
        grid-template-columns: 1fr;

        padding:
            0 45px;
    }

    .docs-on-page {
        display: none;
    }

}


@media (max-width: 800px) {

    .docs-header-inner {
        width:
            calc(100% - 28px);
    }

    .brand-section,
    .brand-divider {
        display: none;
    }

    .docs-top-nav {
        display: none;
    }

    .docs-header-actions {
        min-width: auto;
    }

    .docs-status {
        display: none;
    }

    .docs-layout {
        width: 100%;

        display: block;
    }

    .docs-sidebar {
        position: relative;

        top: 0;

        height: auto;

        border-right: 0;

        border-bottom:
            1px solid
            var(--docs-border);
    }

    .sidebar-inner {
        height: auto;

        padding:
            18px 18px;
    }

    .sidebar-group {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .docs-main {
        padding:
            0 22px;
    }

    .docs-section {
        padding:
            70px
            0;
    }

    .docs-hero {
        padding-top: 75px;
    }

    .docs-hero h1 {
        font-size:
            clamp(
                40px,
                12vw,
                58px
            );
    }

    .api-meta {
        grid-template-columns: 1fr;
    }

    .api-meta div {
        border-right: 0;

        border-bottom:
            1px solid
            var(--docs-border);
    }

    .api-meta div:last-child {
        border-bottom: 0;
    }

    .endpoint {
        grid-template-columns:
            55px
            1fr
            20px;

        padding:
            13px 15px;
    }

    .endpoint-description {
        display: none;
    }

    .stack-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

}


@media (max-width: 500px) {

    .docs-actions {
        flex-direction: column;
    }

    .docs-button {
        justify-content: center;
    }

    .endpoint {
        grid-template-columns:
            52px
            1fr
            15px;
    }

    .endpoint code {
        font-size: 8px;
    }

    .realtime-card {
        flex-direction: column;
    }

    .realtime-line {
        width: 1px;
        height: 35px;
    }

    .event-row {
        grid-template-columns: 1fr;
        gap: 5px;

        padding:
            12px 0;
    }

    .stack-grid {
        grid-template-columns: 1fr;
    }

    .docs-footer {
        width:
            calc(100% - 28px);

        flex-direction: column;

        align-items: flex-start;

        justify-content: center;

        gap: 10px;
    }

}