:root {
    color-scheme: dark;
    --bg: #0c0912;
    --bg-soft: #15101e;
    --panel: rgba(28, 21, 39, .78);
    --panel-strong: #1d1629;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 179, 71, .28);
    --text: #f6f0ff;
    --muted: #aaa0b8;
    --orange: #ff9d37;
    --orange-soft: #ffc277;
    --violet: #a782ff;
    --green: #54d69c;
    --code: #100c18;
    --radius: 18px;
    --shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 76% -10%, rgba(125, 77, 207, .2), transparent 28rem),
        radial-gradient(circle at 15% 12%, rgba(255, 139, 52, .09), transparent 24rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

button,
code,
pre {
    font: inherit;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: .75rem;
    left: .75rem;
    padding: .65rem 1rem;
    border-radius: 9px;
    color: #1a1022;
    background: var(--orange-soft);
    font-weight: 800;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.docs-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    padding: .65rem clamp(1rem, 3vw, 2.75rem);
    border-bottom: 1px solid var(--line);
    background: rgba(12, 9, 18, .88);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    backdrop-filter: blur(18px);
}

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    font-size: .98rem;
    font-weight: 850;
    letter-spacing: -.02em;
}

.docs-brand img {
    width: 64px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 7px 12px rgba(0, 0, 0, .35));
}

.docs-header-meta {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}

.docs-header-meta strong {
    padding: .17rem .45rem;
    border: 1px solid rgba(167, 130, 255, .28);
    border-radius: 6px;
    color: #d4c4ff;
    background: rgba(167, 130, 255, .1);
    font-size: .7rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(84, 214, 156, .11), 0 0 14px rgba(84, 214, 156, .48);
}

.docs-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    width: min(1480px, 100%);
    margin: 0 auto;
}

.docs-sidebar {
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    padding: 2rem 1.4rem 4rem;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.sidebar-label {
    margin: 1.45rem .65rem .35rem;
    color: #ded4e9;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sidebar-label:first-child {
    margin-top: 0;
}

.docs-sidebar nav {
    display: grid;
    gap: .12rem;
}

.docs-sidebar a {
    position: relative;
    display: block;
    padding: .43rem .65rem;
    border-radius: 8px;
    color: var(--muted);
    font-size: .79rem;
    text-decoration: none;
    transition: color .15s ease, background .15s ease, transform .15s ease;
}

.docs-sidebar a:hover,
.docs-sidebar a.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, .045);
    transform: translateX(2px);
}

.docs-sidebar a.is-active::before {
    position: absolute;
    top: .55rem;
    bottom: .55rem;
    left: -1px;
    width: 2px;
    border-radius: 2px;
    background: var(--orange);
    content: "";
}

.docs-main {
    width: min(1040px, calc(100% - 3rem));
    min-width: 0;
    margin: 0 auto;
    padding: 5.5rem 0 3rem;
}

.docs-hero {
    position: relative;
    padding-bottom: 5.5rem;
}

.docs-hero::after {
    position: absolute;
    right: 4%;
    bottom: 18%;
    width: 15rem;
    height: 15rem;
    border: 1px solid rgba(255, 255, 255, .035);
    border-radius: 40% 60% 63% 37%;
    background: radial-gradient(circle, rgba(167, 130, 255, .09), transparent 64%);
    content: "";
    pointer-events: none;
}

.eyebrow,
.section-kicker {
    color: var(--orange-soft);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.eyebrow span {
    width: 24px;
    height: 1px;
    background: var(--orange);
}

.docs-hero h1 {
    max-width: 830px;
    margin: 1.15rem 0 1.4rem;
    font-size: clamp(2.65rem, 7vw, 5.2rem);
    line-height: .99;
    letter-spacing: -.063em;
}

.hero-copy {
    max-width: 730px;
    margin: 0;
    color: #c0b6cc;
    font-size: clamp(1.02rem, 2vw, 1.25rem);
    line-height: 1.7;
}

.base-url-card {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 760px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.2rem;
    padding: .85rem .9rem .85rem 1.15rem;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(255, 157, 55, .08), rgba(167, 130, 255, .055));
    box-shadow: var(--shadow);
}

.base-url-card > div {
    display: grid;
    min-width: 0;
    gap: .12rem;
}

.base-url-card span {
    color: var(--muted);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.base-url-card code {
    overflow: hidden;
    color: #fff4e7;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-button {
    flex: 0 0 auto;
    min-width: 64px;
    padding: .48rem .72rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #d8cede;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    font-size: .69rem;
    font-weight: 800;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.copy-button:hover,
.copy-button:focus-visible {
    border-color: rgba(255, 157, 55, .45);
    color: #fff;
    background: rgba(255, 157, 55, .1);
}

.copy-button.is-copied {
    border-color: rgba(84, 214, 156, .35);
    color: var(--green);
    background: rgba(84, 214, 156, .08);
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.15rem;
}

.hero-pills span {
    padding: .28rem .58rem;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: .66rem;
    font-weight: 750;
}

.docs-section,
.endpoint-group {
    padding: 5rem 0;
    border-top: 1px solid var(--line);
}

.section-heading,
.group-heading {
    max-width: 760px;
    margin-bottom: 2rem;
}

.section-kicker {
    margin: 0 0 .6rem;
}

.section-heading h2,
.group-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -.045em;
}

.section-heading > p:last-child {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: .98rem;
}

code {
    color: #e5d9ff;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

p code,
.parameter-name code {
    padding: .1rem .3rem;
    border: 1px solid rgba(167, 130, 255, .14);
    border-radius: 5px;
    background: rgba(167, 130, 255, .07);
    font-size: .86em;
}

.example-grid,
.endpoint-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.code-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--code);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
}

.code-card > header {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .6rem .5rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.code-card header small {
    font-size: .62rem;
    font-weight: 650;
}

.code-card pre {
    min-height: 150px;
    margin: 0;
    padding: 1.15rem;
    overflow: auto;
    color: #e8e0f1;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .74rem;
    line-height: 1.75;
    tab-size: 2;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.principles-grid article {
    position: relative;
    min-height: 190px;
    padding: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.principle-number {
    display: inline-block;
    margin-bottom: 1.2rem;
    color: var(--orange);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .72rem;
    font-weight: 900;
}

.principles-grid h3 {
    margin: 0;
    font-size: 1.02rem;
}

.principles-grid p {
    margin: .55rem 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.notice {
    margin-top: 1.4rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(167, 130, 255, .19);
    border-left: 3px solid var(--violet);
    border-radius: 11px;
    background: rgba(167, 130, 255, .055);
}

.notice-info {
    border-color: rgba(255, 157, 55, .19);
    border-left-color: var(--orange);
    background: rgba(255, 157, 55, .045);
}

.notice strong {
    font-size: .82rem;
}

.notice p {
    margin: .28rem 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.status-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
}

.status-table > div {
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 52px;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--line);
}

.status-table > div:last-child {
    border-bottom: 0;
}

.status-table code {
    color: var(--orange-soft);
    font-weight: 900;
}

.status-table code.status-ok {
    color: var(--green);
}

.status-table span {
    color: var(--muted);
    font-size: .83rem;
}

.endpoint-group {
    padding-bottom: 1rem;
}

.endpoint-card {
    margin-bottom: 1.5rem;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(31, 23, 43, .88), rgba(20, 15, 29, .82));
    box-shadow: var(--shadow);
}

.endpoint-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.method-badge {
    flex: 0 0 auto;
    margin-top: .15rem;
    padding: .28rem .48rem;
    border: 1px solid rgba(84, 214, 156, .25);
    border-radius: 6px;
    color: var(--green);
    background: rgba(84, 214, 156, .075);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .05em;
}

.endpoint-heading h3 {
    margin: 0;
    font-size: 1.22rem;
    letter-spacing: -.025em;
}

.endpoint-heading p {
    margin: .3rem 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.endpoint-url {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.35rem;
    padding: .62rem .65rem .62rem .9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--code);
}

.endpoint-url code {
    overflow: auto;
    color: #ddd3e8;
    font-size: .72rem;
    white-space: nowrap;
}

.parameters {
    margin-top: 1.5rem;
}

.parameters h4 {
    margin: 0 0 .55rem;
    font-size: .78rem;
    letter-spacing: .02em;
}

.parameter-row {
    display: grid;
    grid-template-columns: minmax(190px, .7fr) 1.3fr;
    gap: 1rem;
    padding: .78rem 0;
    border-bottom: 1px solid var(--line);
}

.parameter-row:last-child {
    border-bottom: 0;
}

.parameter-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .42rem;
}

.parameter-name code {
    color: #f3ebff;
    font-size: .73rem;
    font-weight: 800;
}

.parameter-name span,
.parameter-name strong {
    color: var(--muted);
    font-size: .63rem;
    font-weight: 700;
}

.parameter-name strong {
    color: var(--orange-soft);
    text-transform: uppercase;
}

.parameter-row p {
    margin: 0;
    color: var(--muted);
    font-size: .77rem;
}

.endpoint-examples {
    margin-top: 1.4rem;
}

.endpoint-examples .code-card pre {
    min-height: 175px;
    max-height: 340px;
}

.polling-note {
    margin: 1.1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .72rem;
}

.polling-note strong {
    color: #ded5e8;
}

.docs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .73rem;
}

.docs-footer a {
    color: var(--orange-soft);
    font-weight: 750;
    text-decoration: none;
}

@media (max-width: 980px) {
    .docs-shell {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        display: none;
    }

    .docs-main {
        width: min(760px, calc(100% - 2rem));
        padding-top: 4rem;
    }
}

@media (max-width: 720px) {
    .docs-header {
        min-height: 60px;
    }

    .docs-header-meta > span:not(.status-dot) {
        display: none;
    }

    .docs-brand img {
        width: 56px;
        height: 42px;
    }

    .docs-hero {
        padding-bottom: 4rem;
    }

    .docs-hero h1 {
        font-size: clamp(2.35rem, 13vw, 3.8rem);
    }

    .base-url-card {
        align-items: stretch;
        flex-direction: column;
    }

    .base-url-card .copy-button {
        align-self: flex-start;
    }

    .example-grid,
    .endpoint-examples,
    .principles-grid {
        grid-template-columns: 1fr;
    }

    .docs-section,
    .endpoint-group {
        padding: 4rem 0;
    }

    .parameter-row {
        grid-template-columns: 1fr;
        gap: .45rem;
    }

    .docs-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .docs-main {
        width: min(100% - 1.2rem, 760px);
    }

    .endpoint-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .endpoint-heading {
        gap: .7rem;
    }

    .endpoint-url {
        align-items: stretch;
        flex-direction: column;
    }

    .endpoint-url .copy-button {
        align-self: flex-start;
    }

    .code-card pre {
        font-size: .68rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
