/* ============================================================
   POSTERX · TOKENS
   Переменные дизайна. Единственный источник правды.
   Dark — :root. Light — html[data-theme="light"].
   ============================================================ */

:root {
    color-scheme: dark;

    /* ---------- ПОВЕРХНОСТИ ---------- */
    --bg-page: #0d1424;
    --bg-sidebar: #101a2d;
    --bg-surface: #151f33;
    --bg-surface-2: #1a2740;
    --bg-surface-hover: #202f4b;
    --bg-input: #111c30;
    --bg-overlay: rgba(3, 8, 18, 0.72);

    /* ---------- ГРАНИЦЫ ---------- */
    --border: #263650;
    --border-strong: #344967;
    --border-hover: #45597c;

    /* ---------- ТЕКСТ ---------- */
    --text: #edf3ff;
    --text-secondary: #91a0b9;
    --text-muted: #71829e;
    --text-on-accent: #ffffff;

    /* ---------- АКЦЕНТ ---------- */
    --accent: #2584ff;
    --accent-hover: #4595ff;
    --accent-soft: rgba(37, 132, 255, 0.15);
    --accent-glow: rgba(37, 132, 255, 0.28);
    --accent-gradient: linear-gradient(135deg, #6d5df6 0%, #2584ff 100%);

    /* ---------- СЕМАНТИКА ---------- */
    --success: #24c77a;
    --success-soft: rgba(36, 199, 122, 0.14);
    --danger: #ff777f;
    --danger-soft: rgba(255, 119, 127, 0.14);
    --warning: #ffb45e;
    --warning-soft: rgba(255, 180, 94, 0.14);
    --info: #6da6ff;
    --info-soft: rgba(109, 166, 255, 0.14);

    /* ---------- ТЕНИ ---------- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.32);
    --shadow-focus: 0 0 0 3px var(--accent-soft);

    /* ---------- РАДИУСЫ ---------- */
    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ---------- ОТСТУПЫ ---------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    /* ---------- ТИПОГРАФИКА ---------- */
    --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "JetBrains Mono",
        Menlo, Consolas, monospace;

    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --fs-3xl: 28px;
    --fs-4xl: 34px;

    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-loose: 1.65;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* ---------- ПЕРЕХОДЫ ---------- */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ---------- Z-INDEX ---------- */
    --z-sidebar: 5;
    --z-topbar: 10;
    --z-mobile-nav: 20;
    --z-dropdown: 100;
    --z-sticky: 80;
    --z-modal: 10000;
    --z-toast: 11000;

    /* ---------- LAYOUT ---------- */
    --sidebar-width: 252px;
    --sidebar-width-collapsed: 76px;
    --topbar-height: 72px;
    --content-max-width: 1600px;
}

/* ============================================================
   СВЕТЛАЯ ТЕМА
   ============================================================ */

html[data-theme="light"] {
    color-scheme: light;

    /* Поверхности */
    --bg-page: #f3f6fb;
    --bg-sidebar: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-2: #f5f8fd;
    --bg-surface-hover: #edf3fc;
    --bg-input: #ffffff;
    --bg-overlay: rgba(20, 30, 50, 0.48);

    /* Границы */
    --border: #e2e8f2;
    --border-strong: #d5dfec;
    --border-hover: #b9cce8;

    /* Текст */
    --text: #1c2940;
    --text-secondary: #6f7d93;
    --text-muted: #8995a8;
    --text-on-accent: #ffffff;

    /* Акцент */
    --accent: #1878ee;
    --accent-hover: #0868dc;
    --accent-soft: rgba(24, 120, 238, 0.10);
    --accent-glow: rgba(24, 120, 238, 0.22);
    --accent-gradient: linear-gradient(135deg, #6d5df6 0%, #1878ee 100%);

    /* Семантика */
    --success: #13a86b;
    --success-soft: rgba(19, 168, 107, 0.10);
    --danger: #e34b58;
    --danger-soft: rgba(227, 75, 88, 0.10);
    --warning: #d98524;
    --warning-soft: rgba(217, 133, 36, 0.10);
    --info: #2878ee;
    --info-soft: rgba(40, 120, 238, 0.10);

    /* Тени */
    --shadow-sm: 0 2px 8px rgba(30, 55, 90, 0.05);
    --shadow-md: 0 8px 24px rgba(30, 55, 90, 0.08);
    --shadow-lg: 0 20px 60px rgba(30, 55, 90, 0.15);
    --shadow-focus: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   ПРЕДПОЧТЕНИЯ ПОЛЬЗОВАТЕЛЯ
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0s;
        --transition: 0s;
        --transition-slow: 0s;
        --transition-spring: 0s;
    }
}