/* Nightjar Browser — shared visual identity for the app's own pages.
 *
 * A token file: colours, type, radii, shadows. No element styles, no layout.
 * Every page in ui/ links it; the toolbar, the panels and the new tab page
 * build on these names.
 *
 * The look (2026-10-24, from the Lovable concept): dusk paper and night ink,
 * with moth amber as the one bright colour. Light surfaces are warm paper,
 * text and primary buttons are a near-black ink with a violet bias, and amber
 * marks the thing that matters -- the Ask button's spark, a pinned chat.
 * The dark palette keeps the same hues: night-ink surfaces, paper text.
 *
 * Semantic colours (good/warn/bad) stay apart from the accent on purpose: a
 * page that used the accent for "this model fits" would have no colour left
 * to say "this one does not".
 *
 * FONTS are bundled in ui/fonts (OFL; THIRD-PARTY-NOTICES.md), never fetched:
 * every page here opens from disk with zero outbound requests, and that
 * promise is the product (default_start_url() in shell/window.py). Latin and
 * Latin Extended only; other scripts fall through to the system faces.
 *
 * Colours are oklch, as the concept gives them; WebView2 and WebKit both read
 * it. shell/theme.py keeps hex copies of the surface and line colours for
 * the Tk frame around the pages -- change them together.
 *
 * THEMING. Three states, not two. An explicit choice stamps data-theme on
 * <html>; the default "system" setting stamps nothing and is resolved by
 * prefers-color-scheme alone. So: bare :root carries the complete light
 * palette, the media query redefines tokens for a dark OS unless light was
 * explicitly chosen, and [data-theme="dark"] redefines them again so an
 * explicit choice wins over a light OS. Never give a colour its only
 * definition inside one of those blocks.
 */

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Geist";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Geist";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/geist-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* The new tab's pixel letters and Night Flight (ui/start/). Loaded only
   where something is drawn in it. */
@font-face {
    font-family: "Silkscreen";
    font-style: normal;
    font-display: block;
    font-weight: 400;
    src: url("fonts/silkscreen-latin-400-normal.woff2") format("woff2");
}

:root {
    --nightjar-ground: oklch(0.985 0.006 85);
    --nightjar-card: oklch(1 0 0);
    --nightjar-surface: oklch(0.94 0.014 85);
    --nightjar-surface-hi: oklch(0.9 0.018 85);
    --nightjar-muted: oklch(0.955 0.01 85);
    --nightjar-ink: oklch(0.2 0.03 280);
    --nightjar-ink-soft: oklch(0.5 0.025 280);
    --nightjar-ink-faint: oklch(0.62 0.02 280);
    --nightjar-line: oklch(0.9 0.012 85);
    --nightjar-line-strong: oklch(0.82 0.02 85);
    --nightjar-accent: oklch(0.24 0.06 285);
    --nightjar-accent-soft: oklch(0.95 0.06 85);
    --nightjar-on-accent: oklch(0.98 0.01 85);
    --nightjar-moth: oklch(0.82 0.16 78);
    --nightjar-moth-soft: oklch(0.95 0.06 85);
    --nightjar-good: oklch(0.55 0.13 160);
    --nightjar-good-soft: oklch(0.94 0.04 160);
    --nightjar-good-line: oklch(0.82 0.07 160);
    --nightjar-warn: oklch(0.55 0.12 70);
    --nightjar-warn-soft: oklch(0.95 0.04 80);
    --nightjar-bad: oklch(0.55 0.19 27);
    --nightjar-bad-soft: oklch(0.95 0.03 27);
    --nightjar-gradient-dusk: radial-gradient(120% 80% at 50% 0%, oklch(0.95 0.05 80) 0%, oklch(0.985 0.006 85) 55%);
    --nightjar-gradient-night: linear-gradient(160deg, oklch(0.22 0.06 285), oklch(0.16 0.04 270));
    --nightjar-shadow-soft: 0 1px 2px oklch(0.24 0.06 285 / 0.08), 0 6px 18px -8px oklch(0.24 0.06 285 / 0.18);
    --nightjar-shadow-float: 0 1px 0 oklch(1 0 0 / 0.8) inset, 0 20px 50px -20px oklch(0.24 0.06 285 / 0.35), 0 2px 6px -2px oklch(0.24 0.06 285 / 0.12);
    --nightjar-shadow-glow: 0 0 0 4px oklch(0.82 0.16 78 / 0.25), 0 10px 30px -10px oklch(0.82 0.16 78 / 0.6);

    /* Tiles and letters: three colours that never mean good or bad. */
    --nightjar-space-1: oklch(0.82 0.16 78);
    --nightjar-space-2: oklch(0.7 0.12 200);
    --nightjar-space-3: oklch(0.68 0.16 20);

    --nightjar-radius:    12px;   /* buttons, inputs, small cards */
    --nightjar-radius-lg: 16px;   /* cards, the composer */

    --nightjar-display: "Bricolage Grotesque", -apple-system, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    --nightjar-body:    "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    --nightjar-mono:    "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
}

/* Dark OS, unless the viewer explicitly asked for light. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nightjar-ground: oklch(0.205 0.022 285);
        --nightjar-card: oklch(0.23 0.025 285);
        --nightjar-surface: oklch(0.18 0.02 285);
        --nightjar-surface-hi: oklch(0.27 0.025 285);
        --nightjar-muted: oklch(0.26 0.025 285);
        --nightjar-ink: oklch(0.95 0.01 85);
        --nightjar-ink-soft: oklch(0.73 0.02 280);
        --nightjar-ink-faint: oklch(0.6 0.02 280);
        --nightjar-line: oklch(0.31 0.025 285);
        --nightjar-line-strong: oklch(0.4 0.03 285);
        --nightjar-accent: oklch(0.92 0.02 85);
        --nightjar-accent-soft: oklch(0.33 0.06 78);
        --nightjar-on-accent: oklch(0.2 0.05 285);
        --nightjar-moth: oklch(0.82 0.16 78);
        --nightjar-moth-soft: oklch(0.33 0.06 78);
        --nightjar-good: oklch(0.76 0.13 160);
        --nightjar-good-soft: oklch(0.3 0.05 160);
        --nightjar-good-line: oklch(0.42 0.07 160);
        --nightjar-warn: oklch(0.8 0.13 75);
        --nightjar-warn-soft: oklch(0.31 0.05 75);
        --nightjar-bad: oklch(0.72 0.16 30);
        --nightjar-bad-soft: oklch(0.31 0.06 30);
        --nightjar-gradient-dusk: radial-gradient(120% 80% at 50% 0%, oklch(0.26 0.035 70) 0%, oklch(0.205 0.022 285) 60%);
        --nightjar-gradient-night: linear-gradient(160deg, oklch(0.3 0.06 285), oklch(0.24 0.04 270));
        --nightjar-shadow-soft: 0 1px 2px oklch(0 0 0 / 0.3), 0 6px 18px -8px oklch(0 0 0 / 0.5);
        --nightjar-shadow-float: 0 1px 0 oklch(1 0 0 / 0.05) inset, 0 20px 50px -20px oklch(0 0 0 / 0.7), 0 2px 6px -2px oklch(0 0 0 / 0.4);
        --nightjar-shadow-glow: 0 0 0 4px oklch(0.82 0.16 78 / 0.2), 0 10px 30px -10px oklch(0.82 0.16 78 / 0.4);
    }
}

/* An explicit dark choice, which must also beat a light OS. */
:root[data-theme="dark"] {
    --nightjar-ground: oklch(0.205 0.022 285);
    --nightjar-card: oklch(0.23 0.025 285);
    --nightjar-surface: oklch(0.18 0.02 285);
    --nightjar-surface-hi: oklch(0.27 0.025 285);
    --nightjar-muted: oklch(0.26 0.025 285);
    --nightjar-ink: oklch(0.95 0.01 85);
    --nightjar-ink-soft: oklch(0.73 0.02 280);
    --nightjar-ink-faint: oklch(0.6 0.02 280);
    --nightjar-line: oklch(0.31 0.025 285);
    --nightjar-line-strong: oklch(0.4 0.03 285);
    --nightjar-accent: oklch(0.92 0.02 85);
    --nightjar-accent-soft: oklch(0.33 0.06 78);
    --nightjar-on-accent: oklch(0.2 0.05 285);
    --nightjar-moth: oklch(0.82 0.16 78);
    --nightjar-moth-soft: oklch(0.33 0.06 78);
    --nightjar-good: oklch(0.76 0.13 160);
    --nightjar-good-soft: oklch(0.3 0.05 160);
    --nightjar-good-line: oklch(0.42 0.07 160);
    --nightjar-warn: oklch(0.8 0.13 75);
    --nightjar-warn-soft: oklch(0.31 0.05 75);
    --nightjar-bad: oklch(0.72 0.16 30);
    --nightjar-bad-soft: oklch(0.31 0.06 30);
    --nightjar-gradient-dusk: radial-gradient(120% 80% at 50% 0%, oklch(0.26 0.035 70) 0%, oklch(0.205 0.022 285) 60%);
    --nightjar-gradient-night: linear-gradient(160deg, oklch(0.3 0.06 285), oklch(0.24 0.04 270));
    --nightjar-shadow-soft: 0 1px 2px oklch(0 0 0 / 0.3), 0 6px 18px -8px oklch(0 0 0 / 0.5);
    --nightjar-shadow-float: 0 1px 0 oklch(1 0 0 / 0.05) inset, 0 20px 50px -20px oklch(0 0 0 / 0.7), 0 2px 6px -2px oklch(0 0 0 / 0.4);
    --nightjar-shadow-glow: 0 0 0 4px oklch(0.82 0.16 78 / 0.2), 0 10px 30px -10px oklch(0.82 0.16 78 / 0.4);
}


/* The ✕ in a page window's own header. On the Mac these windows have no
   title bar (shell/window.py _open_page_window), so this is the visible way
   to close one, beside Esc. */
.win-close {
    flex: none; width: 28px; height: 28px; padding: 0; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: var(--nightjar-ink-soft); font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
}
.win-close:hover { background: var(--nightjar-muted); color: var(--nightjar-ink); }
