/* ==========================================================================
   Material 3 Expressive Design Tokens (Dark Scheme from Teal Seed)
   Single source of truth for Color, Shape, Typography, Spacing, and Motion
   ========================================================================== */

:root {
    /* Color Tokens */
    --surface: #0E1513;
    --surface-container-low: #161D1B;
    --surface-container: #1A211F;
    --surface-container-high: #242B2A;
    --surface-container-highest: #2F3634;

    --primary: #53DBC9;
    --on-primary: #003731;
    --primary-container: #005048;
    --on-primary-container: #71F8E5;

    --secondary-container: #324B47;
    --on-secondary-container: #CCE8E3;
    --tertiary: #ADCAE6;
    --tertiary-container: #2B4861;

    --on-surface: #DDE4E1;
    --on-surface-variant: #BEC9C5;
    --outline: #899390;
    --outline-variant: #3F4947;

    --inverse-surface: #DDE4E1;
    --inverse-on-surface: #2B3230;
    --inverse-primary: #006A5E;

    /* State Layer Opacities */
    --state-hover: 0.08;
    --state-focus: 0.10;
    --state-pressed: 0.10;

    /* Shape Scale */
    --shape-xs: 4px;
    --shape-chip: 8px;
    --shape-sm: 12px;
    --shape-md: 16px;
    --shape-lg: 28px;
    --shape-xl: 48px;
    --shape-full: 9999px;

    /* Typography */
    --font-sans: 'Google Sans Flex', 'Roboto Flex', system-ui, -apple-system, sans-serif;

    /* Spacing (8px grid) */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-9: 72px;
    --space-15: 120px;

    --container-max: 1200px;
    --app-bar-height: 72px;

    /* Material 3 Expressive Springs */
    /* Spatial spring: stiffness 380, damping ratio 0.8 (position, shape, size) */
    --spring-spatial: linear(
        0.0000, 0.0419, 0.1412, 0.2675, 0.4005, 0.5271, 0.6402, 0.7363,
        0.8147, 0.8764, 0.9233, 0.9575, 0.9814, 0.9974, 1.0072, 1.0126,
        1.0148, 1.0151, 1.0140, 1.0123, 1.0104, 1.0084, 1.0065, 1.0049,
        1.0035, 1.0024, 1.0016
    );
    --spring-spatial-duration: 420ms;

    /* Effects spring: stiffness 1600, damping ratio 1 (color, opacity, no bounce) */
    --spring-effects: linear(
        0.0000, 0.0754, 0.2275, 0.3908, 0.5372, 0.6575, 0.7513, 0.8222,
        0.8743, 0.9120, 0.9389, 0.9579, 0.9711, 0.9803, 0.9866, 0.9909, 0.9939
    );
    --spring-effects-duration: 180ms;
}

/* Light-Theme Variant (M3 light scheme on warm light surface from teal seed) */
:root[data-theme="light"] {
    --surface: #FAF9F5;
    --surface-container-low: #F3F2EE;
    --surface-container: #ECEBE7;
    --surface-container-high: #E5E5E0;
    --surface-container-highest: #DFDFDA;

    --primary: #006A5E;
    --on-primary: #FFFFFF;
    --primary-container: #9EF2E3;
    --on-primary-container: #00201C;

    --secondary-container: #CCE8E3;
    --on-secondary-container: #05201C;
    --tertiary: #426278;
    --tertiary-container: #CBE6FF;

    --on-surface: #171D1B;
    --on-surface-variant: #3F4947;
    --outline: #6F7976;
    --outline-variant: #BEC9C5;

    --inverse-surface: #2B3230;
    --inverse-on-surface: #EFF5F2;
    --inverse-primary: #53DBC9;
}

/* Reduced Motion: swap all spring timings to instant state changes */
@media (prefers-reduced-motion: reduce) {
    :root {
        --spring-spatial: linear;
        --spring-spatial-duration: 0ms;
        --spring-effects: linear;
        --spring-effects-duration: 0ms;
    }

    html {
        scroll-behavior: auto !important;
    }
}
