:root {
    color-scheme: dark;
    --bg: #0b0d12;
    --bg-2: #0e1116;
    --surface: #161b22;
    --surface-2: #1f2630;
    --surface-3: #262d38;
    --text: #e6edf3;
    --text-dim: #c9d1d9;
    --muted: #9aa3af;
    --muted-dim: #8b94a3;
    --accent: #e10600;
    --accent-bright: #ff2d20;
    --accent-dim: #8a0500;
    /* Red that still clears 4.5:1 as small text on the raised surfaces
       (--surface-2), where --accent-bright only reaches 4.1:1 in dark mode. */
    --accent-link: #ff6b60;
    --gold: #f4c430;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --border: #2a313c;
    --border-strong: #3a4250;
    --stripe: rgba(255, 255, 255, 0.012);
    --radius: 10px;
    --radius-sm: 6px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        sans-serif;
}

/* Light theme — applied when <html data-theme="light"> (set by theme.js). */
[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7f9;
    --bg-2: #eceef2;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e4e7ec;
    --text: #1a1d23;
    --text-dim: #2f343d;
    --muted: #545b66;
    --muted-dim: #5c6470;
    --accent: #e10600;
    --accent-bright: #c40500;
    --accent-dim: #f6c9c6;
    --accent-link: #c40500;
    --gold: #b8860b;
    --silver: #8a8a8a;
    --bronze: #a0612a;
    --border: #dde1e6;
    --border-strong: #c4cad2;
    --stripe: rgba(0, 0, 0, 0.022);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* nav / sticky site header bar */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-2);
}

/* thin red accent line along the bottom of the bar */
.nav::after {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%, var(--accent) 18%, var(--accent-bright) 50%, var(--accent) 82%, transparent 100%);
    opacity: 0.85;
}

.nav-inner {
    display: flex;
    align-items: stretch;
    gap: 20px;
    min-height: 54px;
}

/* brand: podium mark + wordmark, links home */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-mark {
    width: 26px;
    height: 26px;
    display: block;
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
    white-space: nowrap;
}

.brand-name .accent {
    color: var(--accent);
    margin-right: 3px;
}

/* nav links: uppercase tabs with a red active underline */
.nav-links {
    display: flex;
    align-items: stretch;
    gap: 2px;
    margin-left: 8px;
}

.nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 13px;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* theme toggle */
.theme-toggle {
    margin-left: auto;
    align-self: center;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.theme-toggle::before {
    content: "\2600";
    /* sun: shown in dark mode (click for light) */
}

[data-theme="light"] .theme-toggle::before {
    content: "\263D";
    /* moon: shown in light mode (click for dark) */
}

/* mobile nav drawer: pure-CSS checkbox core (works with no JS), burger label
   toggles it, scrim label closes it. Everything is display:none on desktop
   and switched on inside the 720px breakpoint below. */
.nav-drawer-toggle {
    display: none;
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 34px;
    padding: 0 8px;
    align-self: center;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-burger span {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-drawer-toggle:checked ~ .nav-burger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-drawer-toggle:checked ~ .nav-burger span:nth-child(2) {
    opacity: 0;
}

.nav-drawer-toggle:checked ~ .nav-burger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(78vw, 300px);
    padding: 0 0 20px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.nav-drawer-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.nav-drawer a {
    display: block;
    padding: 13px 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s;
}

.nav-drawer a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-drawer a.active {
    color: var(--text);
    border-left-color: var(--accent);
    background: var(--surface-2);
}

.nav-drawer-toggle:checked ~ .nav-scrim {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer-toggle:checked ~ .nav-drawer {
    transform: translateX(0);
}

/* JS enhancement: lock page scroll while the drawer is open */
html.drawer-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .nav-drawer,
    .nav-scrim,
    .nav-burger span {
        transition: none;
    }
}

/* page-title strip (slim, integrated with the bar above) */
header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 24px 0 20px;
}

header h1 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header h1 .accent {
    color: var(--accent);
    font-weight: 800;
    /* a real space now sits between "F1" and the title (for SEO/readability);
       a small extra nudge keeps the wordmark balanced */
    margin-right: 2px;
}

header .tagline {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 15px;
    max-width: 760px;
}

header .tagline a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-strong);
    transition: color 0.15s, border-color 0.15s;
}

header .tagline a:hover {
    color: var(--accent-bright);
    border-color: var(--accent);
}

header .tagline strong {
    color: var(--text-dim);
    font-weight: 600;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 880px;
}

.stat {
    background: var(--surface-2);
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0.85;
}

.stat .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.stat .num small {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    margin-left: 6px;
}

.stat .label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 4px;
}

/* footer */
footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--muted);
    font-size: 13px;
    padding: 22px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    border-bottom: none;
    transition: color 0.15s;
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-meta {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    max-width: 720px;
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-strong);
}

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

@media (max-width: 720px) {
    .container {
        padding: 0 14px;
    }

    /* single row: burger + brand on the left, theme toggle on the right;
       the inline links hide behind the left slide-out drawer */
    .nav-inner {
        align-items: center;
        min-height: 0;
        padding: 8px 0;
        gap: 12px;
    }

    .nav-burger {
        display: inline-flex;
    }

    .nav-links {
        display: none;
    }

    .nav-scrim,
    .nav-drawer {
        display: block;
    }

    .theme-toggle {
        margin-left: auto;
    }

    header {
        padding: 28px 0 24px;
    }

    header h1 {
        font-size: 24px;
        letter-spacing: -0.4px;
    }

    header h1 .accent {
        margin-right: 0;
    }

    header .tagline {
        font-size: 14px;
        margin-bottom: 18px;
    }


    .stats {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: none;
    }

    .stat {
        padding: 12px 14px;
    }

    .stat .num {
        font-size: 20px;
    }
}