:root {
    --crust: #05090b;
    --mantle: #080f12;
    --base: #0d1619;
    --surface0: #131d21;
    --surface1: #1a272c;
    --surface2: #223237;
    --overlay0: #2c3d43;
    --overlay1: #3a4f56;
    --overlay2: #49636b;
    --subtext0: #7f9ca4;
    --subtext1: #b4c8ce;
    --text: #e4eef0;
    --lavender: #b4c4dc;
    --blue: #88b4cc;
    --sapphire: #74a8c4;
    --sky: #9cc4d8;
    --teal: #7ec8be;
    --green: #98d0b8;
    --yellow: #f2e6bc;
    --peach: #e8d0a0;
    --maroon: #d09098;
    --red: #e8b4b4;
    --mauve: #c4b4dc;
    --pink: #dcb8c8;
    --flamingo: #e0c4bc;
    --rosewater: #ead8d4;

    --bg: var(--base);
    --ink: var(--text);
    --muted: var(--subtext0);
    --rule: var(--surface2);
    --accent: var(--yellow);
    --code-bg: var(--crust);
    --code-fg: var(--text);
    --code-dim: var(--overlay2);
    --code-key: var(--peach);
    --code-val: var(--green);
    --code-lvl: var(--teal);
    --code-cmt: var(--overlay2);
    --code-ref: var(--sky);
    --focus: var(--yellow);
    --top-h: 3.25rem;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--top-h) + 1rem);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

code,
pre,
.products,
.num,
.nav,
.gh,
.cmds-row > code,
.kicker {
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}

code {
    font-size: 0.875em;
    background: var(--surface1);
    padding: 0.08em 0.32em;
    border-radius: 3px;
}

a {
    color: var(--accent);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--peach);
}

::selection {
    background: var(--overlay1);
    color: var(--yellow);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.skip {
    position: absolute;
    left: 0.75rem;
    top: -3rem;
    z-index: 20;
    padding: 0.4rem 0.7rem;
    background: var(--yellow);
    color: var(--crust);
    text-decoration: none;
}

.skip:focus {
    top: 0.75rem;
}

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--top-h);
    background: color-mix(in srgb, var(--mantle) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.top-inner {
    max-width: 44rem;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.products {
    display: flex;
    gap: 0.85rem;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.products a {
    color: var(--muted);
    text-decoration: none;
}

.products a:hover {
    color: var(--accent);
}

.products a.is-current {
    color: var(--ink);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.85rem;
    flex: 1;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover,
.nav a.active {
    color: var(--ink);
}

.nav a.active {
    text-decoration: underline;
    text-underline-offset: 0.28em;
}

.gh {
    font-size: 0.75rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--rule);
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
}

.gh:hover {
    border-color: var(--accent);
    color: var(--accent);
}

main,
.foot {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.hero {
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid var(--rule);
}

.kicker {
    margin: 0 0 0.85rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.lede {
    margin: 0 0 1.5rem;
    color: var(--muted);
    max-width: 36rem;
}

section {
    padding: 2.75rem 0;
    border-bottom: 1px solid var(--rule);
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.num {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.06em;
}

.sec-head h2,
.subs h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
}

section p {
    margin: 0 0 1rem;
}

section p:last-child {
    margin-bottom: 0;
}

pre {
    position: relative;
    margin: 1.15rem 0 0;
    padding: 1rem 2.1rem 1.1rem 1.1rem;
    background: var(--code-bg);
    color: var(--code-fg);
    overflow-x: auto;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    border-radius: 0;
}

.copy {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    appearance: none;
    border: 0;
    background: none;
    color: var(--subtext0);
    padding: 0.15rem;
    line-height: 0;
    cursor: pointer;
}

.copy svg {
    display: block;
    width: 15px;
    height: 15px;
}

.copy:hover,
.copy:focus-visible {
    color: var(--yellow);
}

.copy.is-done {
    color: var(--green);
}

.tok-cmt { color: var(--code-cmt); }
.tok-lvl { color: var(--code-lvl); }
.tok-key { color: var(--code-key); }
.tok-val { color: var(--code-val); }
.tok-p { color: var(--code-dim); }
.tok-var { color: var(--code-ref); }
.tok-kw { color: var(--code-key); }

.cmds {
    display: grid;
    gap: 0;
    margin: 1.25rem 0;
    border-top: 1px solid var(--rule);
}

.cmds-row {
    display: grid;
    grid-template-columns: minmax(10rem, max-content) minmax(8rem, auto) 1fr;
    gap: 0.85rem 1.1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}

.cmds-2 .cmds-row {
    grid-template-columns: minmax(10rem, max-content) 1fr;
}

.cmds-row > code {
    background: none;
    padding: 0;
    white-space: nowrap;
}

.cmds-row.head {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 0.45rem;
}

.cmds-row .muted {
    color: var(--muted);
}

.rules {
    margin: 1rem 0 1.25rem;
    padding-left: 1.2rem;
}

.rules li {
    margin: 0 0 0.75rem;
}

.rules li:last-child {
    margin-bottom: 0;
}

.subs {
    margin: 1.4rem 0 1rem;
}

.subs h3 {
    margin-bottom: 0.75rem;
}

.subs dl {
    margin: 0;
    display: grid;
    gap: 0.85rem;
}

.subs dl > div {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.85rem;
    align-items: baseline;
}

.subs dt {
    margin: 0;
}

.subs dd {
    margin: 0;
    color: var(--muted);
}

.foot {
    padding: 2rem 1.25rem 3.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.foot p {
    margin: 0;
}

.foot a {
    color: inherit;
}

.foot a:hover {
    color: var(--accent);
}

body.home {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
}

.chooser {
    display: flex;
    gap: 4rem;
}

.chooser a {
    text-decoration: none;
    color: inherit;
}

.chooser h1 {
    margin: 0 0 0.4rem;
    font: 650 2.25rem/1.1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: -0.03em;
}

.chooser p {
    margin: 0;
    color: var(--muted);
}

.chooser a:hover h1 {
    color: var(--accent);
}

@media (max-width: 720px) {
    .top {
        height: auto;
    }

    .top-inner {
        flex-wrap: wrap;
        gap: 0.45rem 0.75rem;
        padding: 0.65rem 1.25rem 0.75rem;
    }

    .nav {
        flex-basis: 100%;
        order: 3;
    }

    .gh {
        margin-left: auto;
    }

    .chooser {
        flex-direction: column;
        gap: 2.25rem;
    }

    .hero {
        padding-top: 2.25rem;
    }

    .cmds-row,
    .subs dl > div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .cmds-row > code {
        white-space: normal;
    }

    .cmds-row.head {
        display: none;
    }
}

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