/* ============================================================================
   tokens.css — the compiled default theme (Studio Flat).
   This file IS the §2 role registry of Style-Conventions-and-Themes-v1 and the
   THEME-R06 compiled snapshot: /error and cold-start render from these values
   with no settings read. Values project the product's DTCG set (Lucid Violet —
   LucidSession-Product-Intel-v1 §4); an active SiteTheme overrides roles via a
   <style> block after this file, never by editing it.
   Census + contrast floors are enforced by TokenCensusTests — a role added or
   renamed here must be added there in the same change (and vice versa).
   ========================================================================== */

:root {
    color-scheme: dark;

    /* --- Surfaces (elevation ramp: each level lighter than the one below) --- */
    --surface-deep: #0E0A13;
    --surface-page: #141019;
    --surface-raised: #1E1726;
    --surface-hover: #2A2138;
    --surface-header: #241C30;

    /* --- Text --- */
    --text-primary: #E8E2F0;
    --text-primary-on-raised: #F0EAF6;
    --text-secondary: #A79FB8;

    /* --- Accent (+ state family: hover fill, on-fill text, tint surface) --- */
    --accent: #A78BFA;
    --accent-hover: #B79DFB;
    --accent-contrast-text: #141019;
    --accent-surface: rgba(167, 139, 250, 0.12);
    --accent-secondary: #D4AF37;

    /* --- Status triplets. Derivation rule (recorded): -text = the seed used as
       colored text on page/raised; -surface = seed at 12% over the surface (tint);
       -border = seed at 40%. danger-deep inverts: it is a FILL (destructive
       emphasis), so its -text is the on-fill light text. --- */
    --status-success-text: #46D6A0;
    --status-success-surface: rgba(70, 214, 160, 0.12);
    --status-success-border: rgba(70, 214, 160, 0.4);
    --status-warning-text: #F2B84B;
    --status-warning-surface: rgba(242, 184, 75, 0.12);
    --status-warning-border: rgba(242, 184, 75, 0.4);
    --status-danger-text: #FF6B6B;
    --status-danger-surface: rgba(255, 107, 107, 0.12);
    --status-danger-border: rgba(255, 107, 107, 0.4);
    --status-danger-deep-text: #F0EAF6;
    --status-danger-deep-surface: #A31D1D;
    --status-danger-deep-border: #A31D1D;
    --status-info-text: #79C0FF;
    --status-info-surface: rgba(121, 192, 255, 0.12);
    --status-info-border: rgba(121, 192, 255, 0.4);

    /* --- Focus (outer ring radius derives: control radius + offset — SC-R03) --- */
    --focus-ring: #C4B0FC;
    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;

    /* --- Selection --- */
    --selection-bg: #D4AF37;
    --selection-text: #141019;

    /* --- Disabled (boundary must hold >=3:1 against its surface; never blanket opacity) --- */
    --disabled-text: #7A7090;
    --disabled-fill: #1B1522;
    --disabled-border: #75628F;

    /* --- Border / divider (divider carries structure at >=3:1; hairline is decorative) --- */
    --border-hairline: rgba(117, 98, 143, 0.5);
    --border-emphasis: #A78BFA;
    --divider: #75628F;

    /* --- Glow (backdrop recipe only) --- */
    --glow: #EDE7FF;

    /* --- Icon --- */
    --icon: var(--text-secondary);
    --icon-active: var(--text-primary);

    /* --- Data-viz (plots stay dark in every theme; series >=3:1 vs plot-bg,
       CVD-spread; series 5-8 derived here — 1-4 are the product's curve colors) --- */
    --viz-plot-bg: #262626;
    --viz-grid: #757575;
    --viz-series-1: #F2B84B;
    --viz-series-2: #A78BFA;
    --viz-series-3: #46D6A0;
    --viz-series-4: #4296FA;
    --viz-series-5: #FF6B6B;
    --viz-series-6: #5BD7DC;
    --viz-series-7: #E88BD0;
    --viz-series-8: #C7CF6B;
    --viz-heatmap-1: #050514;
    --viz-heatmap-2: #1A1A8C;
    --viz-heatmap-3: #0DA6A6;
    --viz-heatmap-4: #E6D91A;
    --viz-heatmap-5: #F2330D;
    --viz-threshold: #FF6B6B;

    /* --- Scrim --- */
    --scrim: rgba(5, 3, 8, 0.55);

    /* --- Radius roles (one role per component — SC-R03) --- */
    --radius-control: 4px;
    --radius-container: 8px;
    --radius-chip: 999px;
    --radius-overlay: 12px;

    /* --- Spacing scale (base-4 — SC-R04) --- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* --- Rhythm (section-y steps down per breakpoint below) --- */
    --section-y: 96px;
    --section-gap: 24px;
    --container-pad: 24px;
    --container-pad-dense: 12px;
    --field-gap: 16px;
    --label-gap: 6px;
    --hint-gap: 6px;

    /* --- Measure --- */
    --measure-prose: 65ch;
    --measure-prose-max: 75ch;

    /* --- Z-index scale (components bind the scale, never literals) --- */
    --z-content: 0;
    --z-sticky: 10;
    --z-header: 20;
    --z-drawer: 30;
    --z-overlay: 40;
    --z-toast: 50;

    /* --- Motion (SC §2.9; motion-highlight is theme-invariant) --- */
    --motion-fast: 120ms;
    --motion-standard: 160ms;
    --motion-highlight: 1200ms;
    --motion-toast-dwell: 4000ms;
    --motion-ease: ease-out;

    /* --- Type (1.2 modular scale x theme multiplier 1.0; weight-led headings) --- */
    --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: var(--font-body);
    --font-numeric: "Roboto Mono", Consolas, "Courier New", monospace;
    --font-size--1: 0.83rem;
    --font-size-0: 1rem;
    --font-size-1: 1.2rem;
    --font-size-2: 1.44rem;
    --font-size-3: 1.73rem;
    --line-height-body: 1.6;
    --font-weight-heading: 650;
}

/* Tablet rhythm step (F-R03 breakpoints). */
@media (max-width: 1023px) {
    :root {
        --section-y: 72px;
    }
}

/* Mobile rhythm step. */
@media (max-width: 767px) {
    :root {
        --section-y: 56px;
        --container-pad: 16px;
    }
}
