/* ==========================================================================
   Design tokens — change the look of the whole app from here.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #ffffff;
    --bg-soft: #f8f8f7;
    --bg-sunken: #f2f2f0;
    --bg-hover: rgba(40, 40, 35, 0.055);
    --bg-active: rgba(40, 40, 35, 0.09);
    --bg-elevated: #ffffff;
    --overlay: rgba(20, 20, 18, 0.32);

    /* Text */
    --text: #1d1d1b;
    --text-2: #63635f;
    --text-3: #9b9b96;
    --text-inverse: #ffffff;

    /* Lines */
    --border: #ebebe8;
    --border-strong: #dcdcd8;

    /* Brand / accent (an optimistic indigo) */
    --accent: #5b5bd6;
    --accent-hover: #4d4dc7;
    --accent-soft: rgba(91, 91, 214, 0.1);
    --accent-text: #4a4ac2;

    /* States */
    --success: #2f9e6b;
    --success-soft: rgba(47, 158, 107, 0.12);
    --warning: #d08a1d;
    --warning-soft: rgba(208, 138, 29, 0.13);
    --danger: #d6455d;
    --danger-soft: rgba(214, 69, 93, 0.1);

    /* Shape */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
    --shadow: 0 1px 2px rgba(15, 15, 15, 0.04), 0 4px 12px rgba(15, 15, 15, 0.05);
    --shadow-lg: 0 0 0 1px rgba(15, 15, 15, 0.05), 0 8px 24px rgba(15, 15, 15, 0.1), 0 24px 48px rgba(15, 15, 15, 0.08);

    /* Typography */
    --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --fs-xs: 11.5px;
    --fs-sm: 13px;
    --fs: 14px;
    --fs-md: 15px;
    --fs-lg: 18px;
    --fs-xl: 24px;
    --fs-2xl: 32px;

    /* Spacing scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;

    /* Layout */
    --sidebar-w: 248px;
    --content-w: 920px;
    --topbar-h: 48px;

    /* Motion — short, purposeful, never blocking */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --dur-1: 110ms;
    --dur-2: 170ms;
    --dur-3: 240ms;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #191919;
    --bg-soft: #202020;
    --bg-sunken: #161616;
    --bg-hover: rgba(255, 255, 255, 0.055);
    --bg-active: rgba(255, 255, 255, 0.09);
    --bg-elevated: #252525;
    --overlay: rgba(0, 0, 0, 0.55);

    --text: #ebebea;
    --text-2: #a3a39f;
    --text-3: #6f6f6b;
    --text-inverse: #191919;

    --border: #2c2c2b;
    --border-strong: #3a3a38;

    --accent: #7b7bf0;
    --accent-hover: #8d8df5;
    --accent-soft: rgba(123, 123, 240, 0.16);
    --accent-text: #a5a5fa;

    --success: #4cc38a;
    --success-soft: rgba(76, 195, 138, 0.15);
    --warning: #e9a23b;
    --warning-soft: rgba(233, 162, 59, 0.15);
    --danger: #f06a80;
    --danger-soft: rgba(240, 106, 128, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* Follow the OS when the user hasn't picked a theme explicitly. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --bg: #191919;
        --bg-soft: #202020;
        --bg-sunken: #161616;
        --bg-hover: rgba(255, 255, 255, 0.055);
        --bg-active: rgba(255, 255, 255, 0.09);
        --bg-elevated: #252525;
        --overlay: rgba(0, 0, 0, 0.55);
        --text: #ebebea;
        --text-2: #a3a39f;
        --text-3: #6f6f6b;
        --text-inverse: #191919;
        --border: #2c2c2b;
        --border-strong: #3a3a38;
        --accent: #7b7bf0;
        --accent-hover: #8d8df5;
        --accent-soft: rgba(123, 123, 240, 0.16);
        --accent-text: #a5a5fa;
        --success: #4cc38a;
        --success-soft: rgba(76, 195, 138, 0.15);
        --warning: #e9a23b;
        --warning-soft: rgba(233, 162, 59, 0.15);
        --danger: #f06a80;
        --danger-soft: rgba(240, 106, 128, 0.14);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
        --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --dur-1: 0ms;
        --dur-2: 0ms;
        --dur-3: 0ms;
    }
}
