/* Stackmill documentation — the little that Material does not already do.
   Keep this file small: every rule here is a rule someone has to maintain. */

/* Self-hosted, so no page load reaches Google. `theme.font` is off in mkdocs.yml, which is
   what stops Material requesting these from fonts.googleapis.com instead. Roboto Mono is a
   variable file: one download covers every weight. */
@font-face {
    font-family: Poppins;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/Poppins-Light.woff2') format('woff2');
}
@font-face {
    font-family: Poppins;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Poppins-Medium.woff2') format('woff2');
}
@font-face {
    font-family: Poppins;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Poppins-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto Mono';
    font-weight: 100 700;
    font-display: swap;
    src: url('../fonts/RobotoMono.woff2') format('woff2');
}

/* Material, wearing Stackmill's Dark/Teal system — the same tokens as apemill.com
   (website/src/index.css), so the documentation and the site read as one product.

   Every dark value is scoped to the slate scheme on purpose: the PDF renderer loads this
   file with no scheme attribute, so it must fall through to the light defaults. */

:root {
    --md-text-font: Poppins;
    --md-code-font: 'Roboto Mono';
    --sm-radius: 0.625rem;
}

/* Light scheme. The header stays the dark navy of the application in both schemes — a full
   width slab of bright cyan is what Material does out of the box, and it is not our product. */
[data-md-color-scheme='default'] {
    --md-primary-fg-color: oklch(0.2 0.058 262);
    --md-primary-bg-color: oklch(0.985 0.003 247.858);
    --md-accent-fg-color: oklch(0.52 0.1 215.902);
    --md-typeset-a-color: oklch(0.5 0.1 215.902);

    --sm-card: oklch(0.985 0.004 250);
    --sm-card-raised: oklch(0.96 0.006 250);
    --sm-border: oklch(0.2 0.058 262 / 14%);
    --sm-glow: oklch(0.62 0.115 215.902 / 0.22);
}

[data-md-color-scheme='default'] .md-header,
[data-md-color-scheme='default'] .md-tabs {
    border-bottom: 1px solid oklch(1 0 0 / 12%);
}

[data-md-color-scheme='slate'] {
    --md-hue: 261;

    --md-default-bg-color: oklch(0.275 0.055 261);
    --md-default-bg-color--light: oklch(0.325 0.055 259);
    --md-default-fg-color: oklch(0.985 0.003 247.858);
    --md-default-fg-color--light: oklch(0.83 0.025 256.788);
    --md-default-fg-color--lighter: oklch(1 0 0 / 42%);
    --md-default-fg-color--lightest: oklch(1 0 0 / 18%);

    --md-primary-fg-color: oklch(0.2 0.058 262);
    --md-primary-bg-color: oklch(0.985 0.003 247.858);
    --md-accent-fg-color: oklch(0.82 0.12 200);

    --md-typeset-color: oklch(0.94 0.008 250);
    --md-typeset-a-color: oklch(0.82 0.12 200);

    --md-code-bg-color: oklch(0.2 0.058 262);
    --md-code-fg-color: oklch(0.9 0.02 250);

    --md-footer-bg-color: oklch(0.2 0.058 262);
    --md-footer-bg-color--dark: oklch(0.18 0.05 262);

    --sm-card: oklch(0.325 0.055 259);
    --sm-card-raised: oklch(0.355 0.052 258);
    --sm-border: oklch(1 0 0 / 18%);
    --sm-glow: oklch(0.62 0.115 215.902 / 0.35);
}

/* A hairline under the header instead of two flat slabs. */
.md-header {
    box-shadow: none;
}
.md-tabs__link {
    opacity: 1;
    font-weight: 300;
}
.md-tabs__item--active .md-tabs__link {
    font-weight: 500;
}

.md-typeset {
    line-height: 1.7;
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
    font-weight: 700;
    letter-spacing: -0.01em;
}
[data-md-color-scheme='slate'] .md-typeset h1 {
    color: var(--md-default-fg-color);
}
.md-typeset h2 {
    margin-top: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

/* Coloured light, not just shadow: the cards lift and glow, as on the site. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    background: var(--sm-card);
    transition:
        transform 150ms,
        box-shadow 150ms,
        border-color 150ms;
}
.md-typeset .grid.cards > ul > li:hover {
    transform: translateY(-2px);
    border-color: var(--md-accent-fg-color);
    box-shadow: 0 10px 30px var(--sm-glow);
}

.md-typeset pre > code,
.md-typeset .highlight {
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
}
.md-typeset code {
    border-radius: 0.3rem;
}

.md-typeset table:not([class]) {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: var(--sm-radius);
    overflow: hidden;
}
.md-typeset table:not([class]) th {
    background: var(--sm-card-raised);
}

.md-typeset .admonition,
.md-typeset details {
    border-radius: var(--sm-radius);
    border-width: 1px 1px 1px 3px;
    box-shadow: none;
}

.md-search__form {
    border-radius: var(--sm-radius);
}
[data-md-color-scheme='slate'] .md-search__form {
    background: oklch(1 0 0 / 10%);
}

/* Version badge written as {since:1.4.2}; see docs/hooks/since.py. */
.sm-since {
    display: inline-block;
    margin-left: 0.35em;
    padding: 0 0.45em;
    border: 1px solid var(--md-accent-fg-color);
    border-radius: 0.7em;
    color: var(--md-accent-fg-color);
    font-size: 0.7em;
    font-weight: 500;
    vertical-align: middle;
    white-space: nowrap;
    cursor: help;
}

/* Screenshots carry the panel they show; a border keeps a dark screenshot off a dark page. */
.md-typeset img:not(.twemoji):not(.md-logo img) {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: var(--sm-radius);
}

/* Home hero. Markdown alone gives a title and a paragraph; a documentation front page can
   carry the product without becoming a marketing page. */
.sm-hero {
    margin: -1.2rem -0.8rem 2.4rem;
    padding: 3.2rem 2rem 2.6rem;
    border-radius: var(--sm-radius);
    background: radial-gradient(120% 140% at 12% 0%, oklch(0.62 0.115 215.902 / 0.28), transparent 60%), linear-gradient(135deg, oklch(0.2 0.058 262), oklch(0.26 0.06 258));
    border: 1px solid var(--sm-border);
}
.sm-hero h1 {
    margin: 0 0 0.5rem;
    color: #fff !important;
    font-size: 2.4rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.sm-hero p {
    max-width: 34rem;
    margin: 0 0 1.4rem;
    color: oklch(0.9 0.02 250);
    font-size: 0.86rem;
}
.sm-hero .md-button {
    margin: 0 0.4rem 0.4rem 0;
    border-radius: 0.45rem;
}
.sm-hero .md-button--primary {
    background: oklch(0.62 0.115 215.902);
    border-color: oklch(0.62 0.115 215.902);
    color: oklch(0.16 0.03 264.7);
    box-shadow: 0 8px 26px oklch(0.62 0.115 215.902 / 0.35);
}
.sm-hero .md-button:not(.md-button--primary) {
    color: #fff;
    border-color: oklch(1 0 0 / 35%);
}
@media screen and (max-width: 44.98em) {
    .sm-hero {
        padding: 2.2rem 1.2rem 1.8rem;
        text-align: center;
    }
    .sm-hero h1 {
        font-size: 1.9rem;
    }
    .sm-hero p {
        margin-inline: auto;
    }
}
