:root {
    color-scheme: dark;
    --bg: #0f1218;
    --panel: #181d27;
    --panel-soft: #202736;
    --line: #364152;
    --text: #f8fafc;
    --muted: #a8b3c7;
    --accent: #dc2626;
    --accent-strong: #f43f5e;
    --accent-cool: #7dd3fc;
    --danger: #f87171;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    line-height: 1.55;
    background:
        radial-gradient(circle at 18% 8%, rgba(220, 38, 38, .15), transparent 28rem),
        radial-gradient(circle at 84% 18%, rgba(125, 211, 252, .12), transparent 26rem),
        var(--bg);
}

a {
    color: var(--accent-strong);
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    min-height: 56vh;
    display: grid;
    align-content: center;
    gap: 28px;
    padding: 56px 0 40px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .36));
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links a,
.button {
    min-height: 40px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121722;
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
}

.button.primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff7f7;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kicker {
    margin: 0;
    color: var(--accent-strong);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 13px;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
}

h1 {
    max-width: 820px;
    font-size: clamp(42px, 7vw, 76px);
}

h2 {
    font-size: clamp(28px, 4vw, 42px);
}

h3 {
    font-size: 20px;
}

.lead {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
    font-size: 19px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.two-column {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 16px;
    align-items: start;
}

.panel,
.card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

.panel {
    padding: 24px;
}

.card {
    padding: 18px;
}

.card p,
.panel p,
li {
    color: var(--muted);
}

.section {
    padding: 42px 0;
}

.docs-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding: 28px 0 56px;
}

.docs-nav {
    position: sticky;
    top: 16px;
    display: grid;
    gap: 8px;
}

.docs-nav a {
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
}

.docs-nav a:hover,
.docs-nav a.active {
    background: var(--panel-soft);
    color: var(--text);
}

.tree-nav {
    position: sticky;
    top: 16px;
    display: grid;
    gap: 12px;
    align-self: start;
}

.tree-control {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(24, 29, 39, .74);
    padding: 12px;
}

.tree-group {
    position: relative;
    display: grid;
    gap: 2px;
    padding-bottom: 12px;
}

.tree-group:last-child {
    padding-bottom: 0;
}

.tree-heading {
    position: relative;
    padding: 7px 8px 7px 24px;
    color: var(--text);
    font-weight: 800;
    font-size: 14px;
}

.tree-heading::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
}

.tree-item {
    position: relative;
    display: block;
    margin-left: 12px;
    padding: 8px 8px 8px 28px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
}

.tree-item.root {
    margin-left: 0;
    padding-left: 24px;
    font-weight: 800;
}

.tree-item:hover,
.tree-item.active {
    background: var(--panel-soft);
    color: var(--text);
}

.tree-item::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--line);
}

.tree-item::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 50%;
    width: 11px;
    border-top: 1px solid var(--line);
}

.tree-item.root::before {
    left: 8px;
}

.tree-item.root::after {
    left: 8px;
    width: 9px;
}

.tree-item.nested {
    margin-left: 28px;
    padding-left: 24px;
    font-size: 14px;
}

.tree-item.nested::before {
    left: 8px;
}

.tree-item.nested::after {
    left: 8px;
    width: 10px;
}

.tree-item:hover::after,
.tree-item.active::after {
    border-color: var(--accent);
}

.doc-content {
    display: grid;
    gap: 20px;
}

.doc-content section {
    display: grid;
    gap: 10px;
    scroll-margin-top: 96px;
}

.release-list {
    display: grid;
    gap: 14px;
}

.release-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.release-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.download-card {
    display: grid;
    grid-template-rows: auto minmax(78px, auto) minmax(48px, auto) auto;
    align-content: start;
    gap: 14px;
    min-height: 100%;
}

.download-card.disabled {
    opacity: .72;
}

.download-card-header {
    display: grid;
    gap: 6px;
    min-height: 108px;
    align-content: start;
}

.download-card .button {
    align-self: end;
    width: 100%;
}

.checksum-card {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
}

.checksum-card .button {
    width: auto;
}

.linktree-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.linktree-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.linktree-logo {
    width: auto;
    height: 1em;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .34));
}

.meta {
    color: var(--muted);
    font-size: 14px;
}

.notice {
    border-left: 4px solid var(--accent);
    background: rgba(220, 38, 38, .1);
}

.release-notes {
    display: grid;
    gap: 10px;
    max-width: 760px;
}

.release-notes.compact {
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.release-notes h3,
.release-notes h4 {
    margin-top: 8px;
}

.release-notes p,
.release-notes ul {
    margin: 0;
}

.release-notes ul {
    padding-left: 22px;
}

.roadmap-panel {
    display: block;
}

.roadmap-content {
    max-width: none;
}

.roadmap-content h2 {
    margin-top: 28px;
    font-size: clamp(24px, 3vw, 32px);
}

.roadmap-content h3,
.roadmap-content h4 {
    margin-top: 22px;
}

.roadmap-content ul {
    display: grid;
    gap: 6px;
}

.screenshot {
    width: 100%;
    margin: 8px 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #020617;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .28);
}

.step-list {
    display: grid;
    gap: 14px;
    padding-left: 0;
    list-style: none;
    counter-reset: setup-step;
}

.step-list li {
    counter-increment: setup-step;
    position: relative;
    padding-left: 46px;
}

.step-list li::before {
    content: counter(setup-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #fff7f7;
    font-weight: 800;
}

.example {
    display: grid;
    gap: 10px;
}

.token-table {
    display: grid;
    grid-template-columns: minmax(180px, .36fr) minmax(0, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
}

.token-table > div {
    min-width: 0;
    padding: 14px 16px;
    background: #0f172a;
}

.token-table > div:nth-child(-n + 2) {
    background: var(--panel-soft);
    color: var(--text);
}

.token-table code {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
}

.token-table > div:nth-child(4n + 3),
.token-table > div:nth-child(4n + 4) {
    background: #111827;
}

.footer {
    padding: 36px 0;
    color: var(--muted);
}

code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #020617;
    color: #bfdbfe;
}

@media (max-width: 820px) {
    .grid,
    .two-column,
    .docs-layout,
    .download-options,
    .release-summary,
    .release-card,
    .checksum-card,
    .linktree-panel {
        grid-template-columns: 1fr;
    }

    .linktree-logo {
        height: 1em;
    }

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

    .docs-nav,
    .tree-nav {
        position: static;
    }

    .token-table {
        grid-template-columns: 1fr;
    }
}
