:root {
    --bg: #f6f7f8;
    --surface: #ececef;
    --text: #1b1d21;
    --muted: #5b6069;
    --accent: #4e7dff;
    --accent-soft: #f0ded1;
    --border: #d8dade;
    --code-bg: #1b1d21;
    --code-text: #e8e9eb;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #15171a;
        --surface: #1e2125;
        --text: #e8e9eb;
        --muted: #9a9fa6;
        --accent: #4e7dff;
        --accent-soft: #3a2a20;
        --border: #2c3036;
        --code-bg: #0e0f11;
        --code-text: #e8e9eb;
    }
}

:root[data-theme="dark"] {
    --bg: #15171a;
    --surface: #1e2125;
    --text: #e8e9eb;
    --muted: #9a9fa6;
    --accent: #4e7dff;
    --accent-soft: #3a2a20;
    --border: #2c3036;
    --code-bg: #0e0f11;
    --code-text: #e8e9eb;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body > * {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

body > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.4rem;
    column-gap: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 3rem;

    em > a {
        font-weight: 800;
        font-style: normal;
        letter-spacing: 0.04em;
        font-size: 1.5rem;
        color: var(--text);

        img {
            height: 17px;
        }
    }

    em > a:hover {
        text-decoration: none;
        color: var(--accent);
    }
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;

    a {
        display: inline-block;
        padding: 0.25rem 0;
        color: var(--muted);
        font-size: 0.9rem;
        font-weight: 600;

        svg {
            fill: var(--muted);

            height: 18px;
            width: 18px;
        }
    }

    a:hover, a[aria-current="page"] {
        color: var(--text);
        text-decoration: none;

        svg {
            fill: var(--text);
        }
    }
}

h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 1rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin-bottom: 1rem;
}

main {
    header {
        h1 {
            font-size: 2rem;
            font-weight: 800;
            letter-spacing: -0.01em;
            margin: 0 0 0.6rem;
        }

        p {
            font-size: 1.1rem;
            color: var(--muted);
        }
    }
}

main > header {
    margin-bottom: 3.75rem;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.1rem 1.25rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}
code { font-family: var(--font-mono); }
p code, li code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.05rem 0.35rem;
    font-size: 0.85em;
}

.tok-kw { color: #e2854f; }
.tok-type { color: #7fb0e0; }
.tok-str { color: #9dc98a; }
.tok-com { color: #7a8088; }

a[role="button"] {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    border-radius: 3px;
    white-space: nowrap;
}
a[role="button"]:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* Docs page */

.api-groups {
    display: flex;
    gap: 1rem;
    justify-content: stretch;

    div {
        flex-basis: 100%;
    }

    header {
        font-size: 0.85rem;
        font-weight: 700;
        margin: 0 0 0.6rem;
    }
}

menu {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);

    li {
        border-bottom: 1px solid var(--border);

        padding: .5rem;

        article {
            padding: .75rem 0;
        }

        header {
            display: flex;
            justify-content: space-between;
            flex-direction: row;

            span {
                flex-grow: 1;
                font-weight: 700;
                font-size: 1.1rem;
            }
        }

        p {
            color: var(--muted);
            font-size: 0.92rem;
            margin: 0.5rem 0 0 0;
        }
    }

    li > a, li > article > a {
        display: block;
        color: var(--text);
    }

    li > a:hover, li > article > a:hover {
        text-decoration: none;
        color: var(--accent);

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

aside {
    border: 1px dashed var(--border);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;

    p {
        margin: 0;
        color: var(--muted);
        font-size: 0.92rem;
        flex-grow: 1;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    .pillars { grid-template-columns: 1fr; gap: 1.25rem; }
    .api-groups { grid-template-columns: 1fr; gap: 1.25rem; }
    .cta { flex-direction: column; align-items: flex-start; }
    .pipeline { flex-direction: column; align-items: stretch; }
    .pipe-arrow { text-align: center; transform: rotate(90deg); }
}
