/* GxMarket «Neon Vault»: токены.
   Общий слой канона Active: --accent*, --g, --r-*, --ease*, --glow-* (одинаковые имена во всех проектах).
   Акценты генерируются: /design/accents.css (shared/design/tokens.json). Уникальность, в компонентах, не в токенах. */

:root {
  color-scheme: dark;

  /* слои: чернильный фон и три уровня «стекла» */
  --bg: #04050b;
  --ink-1: #0a0c18;
  --ink-2: #10132a;
  --ink-3: #181c3a;
  --plate: rgb(148 158 255 / 0.055);
  --plate-2: rgb(160 170 255 / 0.095);
  --plate-3: rgb(172 182 255 / 0.15);
  --well: rgb(0 0 14 / 0.4);
  --text: #f5f6fb;
  --muted: #aab0c8;
  --faint: #7b829f;
  --line: rgb(255 255 255 / 0.085);
  --line-2: rgb(255 255 255 / 0.17);
  --spec: inset 0 1px 0 rgb(255 255 255 / 0.14);

  /* семантика */
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --info: #38bdf8;

  /* акцент: один на продукт, два спутника для градиентов */
  --accent: var(--neon-mag, #22d3ee);
  --accent-2: var(--neon-purple, #b794ff);
  --accent-3: var(--neon-cyan, #00ffd0);
  --accent-ink: color-mix(in oklab, var(--accent) 70%, #fff);
  --on-accent: #031018;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --a-12: color-mix(in oklab, var(--accent) 12%, transparent);
  --a-24: color-mix(in oklab, var(--accent) 24%, transparent);
  --a-40: color-mix(in oklab, var(--accent) 40%, transparent);
  --a-60: color-mix(in oklab, var(--accent) 60%, transparent);

  /* геометрия */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-pill: 999px;
  --ctl: 44px;
  --ctl-sm: 34px;

  /* свечение: множитель --g (решение владельца: фиксированный 1.6, настройки нет) */
  --g: 1.6;
  --glow-1: 0 0 0 1px color-mix(in oklab, var(--accent) calc(20% * var(--g)), transparent), 0 6px 22px -8px color-mix(in oklab, var(--accent) calc(48% * var(--g)), transparent);
  --glow-2: 0 0 0 1px color-mix(in oklab, var(--accent) calc(28% * var(--g)), transparent), 0 10px 36px -8px color-mix(in oklab, var(--accent) calc(58% * var(--g)), transparent);
  --glow-3: 0 0 0 1px color-mix(in oklab, var(--accent) calc(36% * var(--g)), transparent), 0 16px 56px -8px color-mix(in oklab, var(--accent) calc(70% * var(--g)), transparent);
  --shadow-1: 0 8px 24px -12px rgb(0 0 0 / 0.7);
  --shadow-2: 0 18px 48px -20px rgb(0 0 0 / 0.8);
  --shadow-3: 0 30px 80px -28px rgb(0 0 0 / 0.9);

  /* типографика */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  /* движение: spring для положения, expo-out для появления */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.14s;
  --t: 0.26s;
  --t-slow: 0.5s;
  --blur: saturate(180%) blur(22px);

  /* раскладка */
  --top-h: 56px;
  --dock-h: 64px;
  --gutter: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --halo-c: var(--accent);
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f1f3fa;
  --ink-1: #ffffff;
  --ink-2: #eef0f9;
  --ink-3: #e3e7f5;
  --plate: rgb(255 255 255 / 0.72);
  --plate-2: rgb(255 255 255 / 0.9);
  --plate-3: rgb(255 255 255 / 1);
  --well: rgb(20 26 70 / 0.06);
  --text: #14151c;
  --muted: #535a72;
  --faint: #7a8098;
  --line: rgb(20 24 60 / 0.1);
  --line-2: rgb(20 24 60 / 0.18);
  --spec: inset 0 1px 0 rgb(255 255 255 / 0.95);
  --accent-ink: color-mix(in oklab, var(--accent) 60%, #10142e);
  --on-accent: #04101c;
  --shadow-1: 0 8px 24px -14px rgb(30 40 90 / 0.28);
  --shadow-2: 0 18px 48px -24px rgb(30 40 90 / 0.32);
  --shadow-3: 0 30px 80px -30px rgb(30 40 90 / 0.38);
  --good: #12a46f;
  --bad: #e1405a;
  --warn: #c98a07;
}

@media (prefers-color-scheme: light) {
  html[data-theme='system'] {
    color-scheme: light;
    --bg: #f1f3fa;
    --ink-1: #ffffff;
    --ink-2: #eef0f9;
    --ink-3: #e3e7f5;
    --plate: rgb(255 255 255 / 0.72);
    --plate-2: rgb(255 255 255 / 0.9);
    --plate-3: rgb(255 255 255 / 1);
    --well: rgb(20 26 70 / 0.06);
    --text: #14151c;
    --muted: #535a72;
    --faint: #7a8098;
    --line: rgb(20 24 60 / 0.1);
    --line-2: rgb(20 24 60 / 0.18);
    --spec: inset 0 1px 0 rgb(255 255 255 / 0.95);
    --accent-ink: color-mix(in oklab, var(--accent) 60%, #10142e);
    --on-accent: #04101c;
    --shadow-1: 0 8px 24px -14px rgb(30 40 90 / 0.28);
    --shadow-2: 0 18px 48px -24px rgb(30 40 90 / 0.32);
    --shadow-3: 0 30px 80px -30px rgb(30 40 90 / 0.38);
    --good: #12a46f;
    --bad: #e1405a;
    --warn: #c98a07;
  }
}

/* Светлая тема: ореолы мягче, иначе неон на молочном фоне «грязнит» */
html[data-theme='light'] { --g: 0.9; }
@media (prefers-color-scheme: light) { html[data-theme='system'] { --g: 0.9; } }

@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }
