:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #dfe3e8;
    --text: #15191e;
    --text-muted: #5b6573;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-contrast: #ffffff;
    --danger: #b42318;
    --success: #067647;
    --checker-a: #ffffff;
    --checker-b: #e6e9ee;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

/* Dark tokens are defined twice on purpose: once for the system preference
   (unless the user forced light) and once for a forced dark choice. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111418;
        --surface: #1a1f26;
        --surface-2: #232a33;
        --border: #313a46;
        --text: #eef1f5;
        --text-muted: #9aa5b4;
        --accent: #818cf8;
        --accent-hover: #a5b4fc;
        --accent-contrast: #0f1028;
        --danger: #f97066;
        --success: #47cd89;
        --checker-a: #2a313b;
        --checker-b: #20262e;
        --shadow: none;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #111418;
    --surface: #1a1f26;
    --surface-2: #232a33;
    --border: #313a46;
    --text: #eef1f5;
    --text-muted: #9aa5b4;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-contrast: #0f1028;
    --danger: #f97066;
    --success: #47cd89;
    --checker-a: #2a313b;
    --checker-b: #20262e;
    --shadow: none;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
p,
ol,
ul {
    margin: 0;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 650;
}

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

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

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

[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
