/*
 * Factsogy base: design tokens (dark default, light via prefers-color-scheme),
 * reset, type, shared utilities. Loaded on every page first.
 */

:root {
    --bg: #0a0b0d;
    --surface: #121418;
    --surface-2: #1a1d23;
    --line: #262a31;
    --text: #f3f1ec;
    --muted: #a3a6ad;
    --accent: #ff3b2f;
    --accent-ink: #ffffff;
    --focus: #ffb020;

    --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --font-body: 'Public Sans', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    --gutter: clamp(16px, 4vw, 48px);
    --max: 1180px;
    --radius: 4px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f3ee;
        --surface: #ffffff;
        --surface-2: #ebe8e1;
        --line: #d9d5cc;
        --text: #111214;
        --muted: #55585e;
        --accent: #d4241a;
        --focus: #b36b00;
        color-scheme: light;
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Film grain over the whole page for broadcast texture */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

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

code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.1em 0.4em;
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    margin: 0 0 0.4em;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 200;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 8px 14px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 18px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 3px;
    background: var(--accent);
}


@media (max-width: 640px) {
    body {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
