/* Audio Mission: shared site style.
   Every section (home, AX-2 build, Celestion SL, design tools) loads this first,
   then adds its own page styles. It holds the fonts, colour tokens, the site
   header with its theme switch, and the footer, so all sections look like one site.
   Cool grey neutrals, one petrol accent, wide Archivo headings, mono for measurements. */

@font-face {
    font-family: "Archivo";
    src: url("fonts/archivo-latin-variable.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("fonts/public-sans-latin-variable.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("fonts/public-sans-latin-variable-italic.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #eef0f3;
    --band: #e6e9ee;
    --surface: #ffffff;
    --sunken: #e4e8ed;
    --ink: #151a21;
    --muted: #5a6473;
    --line: #d3d9e1;
    --accent: #0b6a87;
    --accent-strong: #08546b;
    --accent-ink: #ffffff;
    --accent-soft: #dcecf1;
    --hex: #c9d1db;
    --ok: #1d7a46;
    --warn: #a1580b;
    --error: #b23a2a;
    --focus: #0b6a87;

    --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
    --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --step--1: .84rem;
    --step-0: 1rem;
    --step-1: 1.2rem;
    --step-2: 1.6rem;
    --step-3: clamp(2.1rem, 4.2vw + 1rem, 3.4rem);
    --radius: 10px;
    --gutter-l: max(16px, env(safe-area-inset-left, 0px));
    --gutter-r: max(16px, env(safe-area-inset-right, 0px));
    color-scheme: light;
}

/* Dark: follows the device unless the switch picks light (first block),
   or is forced by the switch (second block). Keep both in step. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1015;
        --band: #11151b;
        --surface: #151a21;
        --sunken: #1b212a;
        --ink: #e5e9ef;
        --muted: #99a3b1;
        --line: #29313c;
        --accent: #5cc1de;
        --accent-strong: #8ad4ea;
        --accent-ink: #06222b;
        --accent-soft: #14323d;
        --hex: #1f2630;
        --ok: #5fd08f;
        --warn: #f0b05a;
        --error: #f08a78;
        --focus: #5cc1de;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0d1015;
    --band: #11151b;
    --surface: #151a21;
    --sunken: #1b212a;
    --ink: #e5e9ef;
    --muted: #99a3b1;
    --line: #29313c;
    --accent: #5cc1de;
    --accent-strong: #8ad4ea;
    --accent-ink: #06222b;
    --accent-soft: #14323d;
    --hex: #1f2630;
    --ok: #5fd08f;
    --warn: #f0b05a;
    --error: #f08a78;
    --focus: #5cc1de;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: 7rem }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto }
    *, *::before, *::after { transition: none !important }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 var(--step-0)/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: .18em }
a:hover { text-decoration-thickness: 2px }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r) }

.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Anything given the hidden attribute stays hidden, even when its own class
   sets a display value (e.g. the Celestion model panel is display: grid). */
[hidden] { display: none !important }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* Site header: brand, the three sections and the theme switch on the top row;
   an optional row below for the current section's own pages or anchors. */
.bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-body);
    line-height: 1.6;
}

.bar-top { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding-block: .55rem }
.bar-top:has(+ .subnav) { padding-bottom: .35rem }

.brand {
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: .01em;
    color: var(--ink);
    text-decoration: none;
    margin-right: auto;
}

.brand span { color: var(--accent) }

.sections { display: flex; flex-wrap: wrap; gap: .15rem }

.sections a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    padding: .3rem .6rem;
    border-radius: 6px;
}

.sections a:hover { color: var(--ink); background: var(--sunken) }
.sections a[aria-current="page"] { color: var(--accent); background: var(--accent-soft) }

.theme {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px;
    background: var(--surface);
}

.theme button {
    font: 500 .82rem var(--font-body);
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 6px;
    padding: .28rem .55rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: 0;
    min-height: 0;
}

.theme button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round }
.theme button:hover { color: var(--ink); background: none }
.theme button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }

.subnav {
    display: flex;
    gap: .15rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: .45rem;
    margin-left: -.55rem;
}

.subnav::-webkit-scrollbar { display: none }

.subnav a {
    flex: none;
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    padding: .28rem .55rem;
    border-radius: 6px;
}

.subnav a:hover { color: var(--ink); background: var(--sunken) }
.subnav a[aria-current] { color: var(--ink); background: var(--sunken) }

@media (max-width: 640px) {
    .theme .lbl { display: none }
    .theme button { padding: .35rem .45rem }
    .sections { order: 3; width: 100%; margin-left: -.6rem }
}

/* Site footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1.5rem; padding-block: 1.6rem }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem }
.site-footer a { color: var(--muted) }
.site-footer a:hover { color: var(--ink) }
