:root {
    color-scheme: light;
    --bg: #d4dceb;
    --surface: rgba(252, 253, 255, 0.92);
    --surface-2: #e9eff8;
    --surface-3: #dde6f4;
    --line: rgba(159, 176, 208, 0.42);
    --text: #18253f;
    --muted: #64728f;
    --blue: #285bda;
    --blue-deep: #173d99;
    --cyan: #6fb8f4;
    --soft: rgba(40, 91, 218, 0.1);
    --soft-strong: rgba(40, 91, 218, 0.16);
    --shadow: 0 18px 38px rgba(16, 36, 74, 0.08);
    --bg-gradient: radial-gradient(circle at top, #e5ebf6 0%, #d4dceb 48%, #c8d1e2 100%);
    --success-line: #b7dbc0;
    --danger-line: #e7c4c8;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1321;
    --surface: rgba(19, 29, 47, 0.92);
    --surface-2: #1a2640;
    --surface-3: #22314f;
    --line: rgba(109, 131, 173, 0.28);
    --text: #eef4ff;
    --muted: #9baecc;
    --blue: #7ea8ff;
    --blue-deep: #c1d4ff;
    --cyan: #65c4df;
    --soft: rgba(126, 168, 255, 0.13);
    --soft-strong: rgba(126, 168, 255, 0.2);
    --shadow: 0 22px 46px rgba(2, 6, 16, 0.42);
    --bg-gradient: radial-gradient(circle at top, #16233a 0%, #0d1524 56%, #09111c 100%);
    --success-line: #3d6549;
    --danger-line: #74414a;
}

:root[data-accent="graphite"] {
    --blue: #5f6f91;
    --blue-deep: #32415f;
    --cyan: #9cb3d3;
    --soft: rgba(95, 111, 145, 0.12);
    --soft-strong: rgba(95, 111, 145, 0.2);
}

:root[data-theme="dark"][data-accent="graphite"] {
    --blue: #a9bad9;
    --blue-deep: #dbe6fb;
    --cyan: #8aa1c2;
    --soft: rgba(169, 186, 217, 0.12);
    --soft-strong: rgba(169, 186, 217, 0.2);
}

:root[data-accent="teal"] {
    --blue: #0d8b93;
    --blue-deep: #0f5960;
    --cyan: #77d8cf;
    --soft: rgba(13, 139, 147, 0.12);
    --soft-strong: rgba(13, 139, 147, 0.18);
}

:root[data-theme="dark"][data-accent="teal"] {
    --blue: #5cc5be;
    --blue-deep: #b8f0eb;
    --cyan: #7de1d7;
    --soft: rgba(92, 197, 190, 0.12);
    --soft-strong: rgba(92, 197, 190, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-gradient);
}

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: grid;
    gap: 10px;
    max-width: 360px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.flash.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.flash--success {
    border-color: var(--success-line);
}

.flash--danger {
    border-color: var(--danger-line);
}

a {
    color: inherit;
    text-decoration: none;
}

.button,
.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 10px 15px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.button:hover,
.mini-button:hover {
    transform: translateY(-1px);
}

.button.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue) 0%, #4d7eff 100%);
    box-shadow: 0 14px 30px rgba(20, 87, 255, 0.2);
}

.button.secondary,
.button.ghost,
.mini-button {
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-color: var(--line);
}

.eyebrow {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--blue-deep);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand--dark {
    color: var(--text);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.accent-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.accent-switcher__label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.accent-switcher__swatches {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.accent-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--swatch-color, var(--blue));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.accent-swatch:hover {
    transform: scale(1.08);
}

.accent-swatch.is-active {
    border-color: var(--text);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--soft-strong) 88%, transparent);
}

.accent-swatch[data-accent-value="ocean"] {
    --swatch-color: #2d64ea;
}

.accent-swatch[data-accent-value="graphite"] {
    --swatch-color: #667897;
}

.accent-swatch[data-accent-value="teal"] {
    --swatch-color: #15989f;
}

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

@media (max-width: 1100px) {
    .button,
    .mini-button {
        width: 100%;
    }

    .theme-toolbar,
    .accent-switcher {
        width: 100%;
    }
}
