:root {
    color-scheme: light dark;
    scrollbar-gutter: stable;

    --plane: #fbfbfa;
    --surface: #ffffff;
    --sunk: #f2f2ef;
    --ink: #16181d;
    --ink-2: #4a5160;
    --ink-muted: #767d8c;
    --rule: #e3e3dd;
    --accent: #2a5db0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --plane: #101216;
        --surface: #171a20;
        --sunk: #1d2027;
        --ink: #f1f2f5;
        --ink-2: #b8bfcc;
        --ink-muted: #8b93a3;
        --rule: #2a2e37;
        --accent: #7fa9ec;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--plane);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.7;
}

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

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

p, li, h1, h2, td, th {
    overflow-wrap: anywhere;
}

.doc-content > h2:first-child {
    margin-top: 1.5rem;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--sunk);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    overflow-wrap: anywhere;
}

pre,
pre[class*="language-"] {
    overflow-x: auto;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 5px;
    font-size: 0.875rem;
}

pre code {
    background: none;
    padding: 0;
    overflow-wrap: normal;
}

@media (max-width: 52rem) {

    pre,
    pre[class*="language-"] {
        font-size: 0.8125rem;
    }
}

@media (prefers-color-scheme: dark) {
    pre[class*="language-"] {
        background: var(--surface);
    }
}

blockquote {
    margin: 1.5rem 0;
    padding: 0.1rem 1.1rem;
    border-left: 3px solid var(--rule);
    color: var(--ink-2);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th {
    color: var(--ink-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

img {
    max-width: 100%;
    height: auto;
}

h1 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    line-height: 1.25;
    text-wrap: balance;
}

h2 {
    margin-top: 2.5rem;
    line-height: 1.35;
    text-wrap: balance;
}
