/* Fonts: Inter and JetBrains Mono (SIL Open Font License 1.1, see static/fonts/OFL.txt), self-hosted, subset to Latin, Latin-ext, Greek and
   Greek-ext, weights 400 to 700 only. No third-party request; the CSP allows font-src 'self' only. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/jbmono-400.woff") format("woff"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/jbmono-700.woff") format("woff"); }

/* Design tokens: the only place with colours, type and spacing values. Every template uses them through style.css.
   The palette is the one measured from the live n2.systems bundle: near-black panels with emerald as the only accent.
   DARK (default): page #07080A, deeper #060709, panels #0D0E12 / #11131A, raised #15181E / #191C24, borders #1E222D (strong #2E3445),
   text #F8FAFC, muted #8596AD, accent emerald #10B981 (hover #34D399, soft #6EE7B7, button #10B77F), danger #BB2B2B.
   LIGHT: white and #FAFAFA surfaces, neutral grays (no blue tint), near-black text, emerald #047857 (5.5:1 on white) for text and buttons.
   No orange, square corners. Every text pair is at least WCAG AA (4.5:1); tests/test_theme.py computes them. */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07080a;
    --bg-deeper: #060709;
    --surface: #0d0e12;
    --surface-alt: #11131a;
    --surface-2: #15181e;
    --raised-2: #191c24;
    --border: #1e222d;
    --border-strong: #2e3445;
    --text: #f8fafc;
    --muted: #8596ad;
    --primary: #10b77f;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-soft: #6ee7b7;
    --on-primary: #07080a;
    --btn-hover-bg: #34d399;
    --btn-hover-fg: #07080a;
    --success: #10b981;
    --on-success: #07080a;
    --danger: #bb2b2b;
    --danger-text: #f87171;
    --on-danger: #ffffff;
    --warning: #c9d1dc;
    --focus: #34d399;
    --link: #34d399;
    --link-hover: #6ee7b7;
    --shadow: 0 0 0 1px #1e222d;
    --logo-slash: #34d399;
    --logo-back: #f1f5f9;
    --logo-glow: 0 0 12px rgba(16, 185, 129, 0.5);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-deeper: #fafafa;
    --surface: #fafafa;
    --surface-alt: #f4f4f5;
    --surface-2: #f4f4f5;
    --raised-2: #e4e4e7;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #09090b;
    --muted: #52525b;
    --primary: #047857;
    --accent: #047857;
    --accent-hover: #065f46;
    --accent-soft: #059669;
    --on-primary: #ffffff;
    --btn-hover-bg: #065f46;
    --btn-hover-fg: #ffffff;
    --success: #047857;
    --on-success: #ffffff;
    --danger: #bb2b2b;
    --danger-text: #bb2b2b;
    --on-danger: #ffffff;
    --warning: #52525b;
    --focus: #047857;
    --link: #047857;
    --link-hover: #065f46;
    --shadow: 0 0 0 1px #e4e4e7;
    --logo-slash: #047857;
    --logo-back: #09090b;
    --logo-glow: none;
}

@media (prefers-color-scheme: light) {
    :root[data-theme="system"] {
        color-scheme: light;
        --bg: #ffffff;
        --bg-deeper: #fafafa;
        --surface: #fafafa;
        --surface-alt: #f4f4f5;
        --surface-2: #f4f4f5;
        --raised-2: #e4e4e7;
        --border: #e4e4e7;
        --border-strong: #d4d4d8;
        --text: #09090b;
        --muted: #52525b;
        --primary: #047857;
        --accent: #047857;
        --accent-hover: #065f46;
        --accent-soft: #059669;
        --on-primary: #ffffff;
        --btn-hover-bg: #065f46;
        --btn-hover-fg: #ffffff;
        --success: #047857;
        --on-success: #ffffff;
        --danger: #bb2b2b;
        --danger-text: #bb2b2b;
        --on-danger: #ffffff;
        --warning: #52525b;
        --focus: #047857;
        --link: #047857;
        --link-hover: #065f46;
        --shadow: 0 0 0 1px #e4e4e7;
        --logo-slash: #047857;
        --logo-back: #09090b;
        --logo-glow: none;
    }
}

:root {
    --radius: 0px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --font-sans: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; /* Inter has Latin and Greek; the fallbacks have Greek too */
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --qr-bg: #ffffff; /* a QR code needs a white quiet zone in every theme */
    --weight-light: 400;
    --weight-bold: 700;
    --weight-black: 700;
    --heading-tracking: -0.05em;
    --label-tracking: 0.1em;
}
