/* /bspk. Shares the home page's look (Archivo, the accent wash, parallelogram
   buttons) but not its stylesheet: home.css styles bare `header`/`footer`
   elements for a page with a fixed, JS-revealed header, and none of that
   applies to a static article. The tokens below mirror home.css. */

@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/Archivo.woff2') format('woff2');
}

:root {
    --bg: #f9f7f4;
    --text: #1a1814;
    --muted: #6e675f;
    --border: #e6e0d6;
    --accent: #7a8a3a;
    --accent-subtle: oklch(from var(--accent) l c h / 0.12);
    --radius: 6px;
    --skewX: skewX(-6deg);
    --measure: 40rem;
    --gutter: clamp(1.25rem, 5vw, 3rem);

    &[data-theme='dark'] {
        --bg: #111009;
        --text: #f5f3ef;
        --muted: #9e9890;
        --border: #2a2720;
        --accent-subtle: oklch(from var(--accent) l c h / 0.2);
    }
}

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

ul,
ol {
    list-style: none;
}

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

html {
    font-family:
        'Archivo',
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 18px;
    line-height: 1.65;
    color: var(--text);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent) 9%, var(--bg)) 0%,
        var(--bg) 55%
    );
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

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

a {
    color: inherit;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    transition: color 0.15s;

    &:not(.btn):hover {
        color: var(--accent);
    }
}

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

/* ---------- Header ---------- */
.site-head {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 4rem;
    padding-inline: var(--gutter);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-decoration: none;
}

.site-brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.site-brand-role {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Buttons: a skewed ::before carries the fill so text stays upright ---------- */
.btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    --para-bg: var(--accent-subtle);
    transition: color 0.15s;

    &::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--para-bg);
        transform: var(--skewX);
        transition: background 0.15s;
    }

    &:hover {
        --para-bg: var(--accent);
        color: #fff;
    }

    &:focus-visible {
        outline: none;

        &::before {
            outline: 2px solid var(--accent);
            outline-offset: 3px;
        }
    }
}

.btn-primary {
    --para-bg: var(--accent);
    color: #fff;

    &:hover {
        opacity: 0.85;
    }
}

/* ---------- Page column ---------- */
main {
    max-width: 76rem;
    margin-inline: auto;
    padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 8vw, 6rem);
}

.eyebrow {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Intro ---------- */
.intro {
    max-width: 52rem;
}

.crumb {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
}

.title {
    font-size: clamp(2.25rem, 6.5vw, 4.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    text-wrap: balance;
}

.standfirst {
    margin-top: 1.5rem;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    line-height: 1.5;
    color: var(--muted);
    text-wrap: pretty;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* ---------- Screenshot ---------- */
.shot {
    margin-top: clamp(2rem, 5vw, 3.5rem);

    img {
        width: 100%;
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }
}

/* ---------- Facts ---------- */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 1.5rem;
    margin-top: clamp(2rem, 5vw, 3.5rem);

    li {
        display: flex;
        flex-direction: column;
        padding-left: 1rem;
        border-left: 3px solid var(--accent);
        line-height: 1.25;
    }

    strong {
        font-size: clamp(1.75rem, 3.5vw, 2.5rem);
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    span {
        margin-top: 0.25rem;
        font-size: 0.9rem;
        color: var(--muted);
    }
}

/* ---------- Table of contents + prose ---------- */
.layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, var(--measure));
    gap: clamp(2rem, 6vw, 5rem);
    margin-top: clamp(3rem, 8vw, 5.5rem);
}

.toc {
    align-self: start;
    position: sticky;
    top: 6rem;

    .eyebrow {
        margin-bottom: 0.75rem;
    }

    li + li {
        margin-top: 0.5rem;
    }

    a {
        display: block;
        padding-left: 0.75rem;
        border-left: 2px solid var(--border);
        font-size: 0.9rem;
        line-height: 1.35;
        text-decoration: none;
        color: var(--muted);

        &:hover {
            border-left-color: var(--accent);
        }
    }
}

.prose {
    section + section {
        margin-top: clamp(2.5rem, 6vw, 3.5rem);
    }

    h2 {
        display: flex;
        align-items: baseline;
        gap: 0.6rem;
        margin-bottom: 1rem;
        font-size: clamp(1.5rem, 3.2vw, 2rem);
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.15;
        text-wrap: balance;

        /* The site's accent parallelogram, as a section marker. */
        &::before {
            content: '';
            flex: none;
            width: 0.4em;
            height: 0.4em;
            background: var(--accent);
            transform: var(--skewX);
        }
    }

    p + p {
        margin-top: 1.1rem;
    }

    p {
        font-size: 1.05rem;
        overflow-wrap: break-word;
    }

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

    code {
        padding: 0.1em 0.35em;
        border-radius: 3px;
        background: var(--accent-subtle);
        font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
        font-size: 0.88em;
    }

    figure {
        margin: 2rem 0;

        img {
            width: 100%;
            border-radius: var(--radius);
            border: 1px solid var(--border);
        }
    }

    figcaption {
        margin-top: 0.6rem;
        font-size: 0.85rem;
        line-height: 1.4;
        color: var(--muted);
    }

    /* Pull quotes: the line the section is built around, set large with the
       accent rule the site uses for emphasis elsewhere. */
    blockquote {
        margin: 1.75rem 0;
        padding-left: 1.25rem;
        border-left: 3px solid var(--accent);

        p {
            margin: 0;
            font-size: clamp(1.15rem, 2.4vw, 1.4rem);
            font-weight: 700;
            letter-spacing: -0.01em;
            line-height: 1.3;
            text-wrap: balance;
        }
    }
}

/* ---------- Footer ---------- */
footer {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 76rem;
    margin-inline: auto;
    padding: 2.5rem var(--gutter) 4rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.footer-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text);
}

.footer-role {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    gap: 1.5rem;

    a {
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-decoration: none;
        color: var(--muted);

        &:hover {
            color: var(--accent);
        }
    }
}

/* ---------- Appearance controls ---------- */
/* appearance.css (linked by the shell) styles them; the header only needs a
   slot for the pair beside the CTA. */
.site-head-end {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    /* A sticky rail has no room beside the text here, and eleven links stacked
       above it would push the article a screen down. */
    .toc {
        display: none;
    }
}

@media (max-width: 720px) {
    .site-brand-role {
        display: none;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
