/*
 * The public docs site (KB-5), dark as the website is: Ink ground, Paper text and Teal, the brand's one accent. Every
 * colour is the brand book's. The site loads no fonts: it uses the brand's typefaces where the reader has them, and
 * the system's otherwise.
 */

:root {
    --ink: #0f1312;
    --paper: #f5f7f6;
    --teal-300: #6ce4da;
    --teal-400: #36c6be;
    --neutral-400: #9ca3a1;
    --neutral-500: #777d7c;
    --neutral-800: #2f3433;
    --neutral-900: #1d2220;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --docs-header-height: 4rem;

    /* Scalar's sticky sidebar and headings sit below the site's header. */
    --scalar-custom-header-height: var(--docs-header-height);
    --scalar-font: var(--font-sans);
    --scalar-font-code: var(--font-mono);

    color-scheme: dark;
}

html,
body {
    background: var(--ink);
}

body {
    margin: 0;
    color: var(--paper);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--teal-400);
    text-decoration: none;
}

a:hover {
    color: var(--teal-300);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--teal-400);
    outline-offset: 2px;
}

/* The header: the logo, with half its height clear around it, and on a reference the document's downloads. */

.docs-header {
    position: sticky;
    top: 0;
    z-index: 20;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--docs-header-height);
    padding: 0 1rem;
    border-bottom: 1px solid var(--neutral-800);
    background: var(--ink);
}

.docs-brand img {
    display: block;
    width: auto;
    height: 2rem;
}

.docs-downloads {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.docs-label {
    color: var(--neutral-400);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (max-width: 22.5rem) {
    .docs-downloads .docs-label {
        display: none;
    }
}

/* The index of references and the page for an address the site doesn't have. */

.docs-page {
    box-sizing: border-box;
    max-width: 48rem;
    margin: 0 auto;
    padding: 3rem 1rem 4rem;
}

.docs-page h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.docs-lead {
    margin: 1rem 0 0;
    color: var(--neutral-400);
    font-size: 1.125rem;
    line-height: 1.6;
}

.docs-references {
    display: grid;
    gap: 1rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.docs-card {
    padding: 1.5rem;
    border: 1px solid var(--neutral-800);
    background: var(--neutral-900);
}

.docs-card h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.docs-card h2 a {
    color: var(--paper);
}

.docs-card h2 a:hover {
    color: var(--teal-300);
}

.docs-card p {
    margin: 0.5rem 0 0;
    color: var(--neutral-400);
    line-height: 1.6;
}

.docs-card .docs-downloads {
    margin-top: 1rem;
}

.docs-note {
    margin: 2rem 0 0;
    color: var(--neutral-400);
    font-size: 0.875rem;
    line-height: 1.6;
}

.docs-noscript {
    box-sizing: border-box;
    max-width: 48rem;
    margin: 3rem auto;
    padding: 0 1rem;
    color: var(--neutral-400);
}

/*
 * Scalar in the brand's colours. Scalar keeps its own theme in a cascade layer, so these plain rules win over it
 * whatever the order the styles load in.
 */

.dark-mode {
    --scalar-background-1: var(--ink);
    --scalar-background-2: var(--neutral-900);
    --scalar-background-3: var(--neutral-800);
    --scalar-background-accent: rgb(54 198 190 / 12%);
    --scalar-color-1: var(--paper);
    --scalar-color-2: var(--neutral-400);
    --scalar-color-3: var(--neutral-500);
    --scalar-color-accent: var(--teal-400);
    --scalar-border-color: var(--neutral-800);
    --scalar-button-1: var(--teal-400);
    --scalar-button-1-hover: var(--teal-300);
    --scalar-button-1-color: var(--ink);
    --scalar-sidebar-background-1: var(--ink);
}
