/* Design tokens — single source of truth.
   Change here, whole app updates. */

:root {
  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-hero: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 360ms;

  /* Z-layers */
  --z-nav: 100;
  --z-toast: 200;
  --z-popover: 300;
  --z-palette: 400;

  /* Brand accent — green money theme */
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-ring: rgba(16, 185, 129, 0.35);

  /* Semantic */
  --positive: #10b981;
  --negative: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --purple: #8b5cf6;
}

/* Light theme (default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafbfa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f3f5f4;
  --bg-hover: #eef1ef;
  --border: rgba(10, 20, 16, 0.08);
  --border-strong: rgba(10, 20, 16, 0.14);
  --text: #0a1410;
  --text-muted: #5b6b65;
  --text-subtle: #8b9590;
  --shadow-sm: 0 1px 2px rgba(10, 20, 16, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 20, 16, 0.06), 0 1px 3px rgba(10, 20, 16, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 20, 16, 0.08), 0 2px 6px rgba(10, 20, 16, 0.04);
  --mesh-1: rgba(16, 185, 129, 0.10);
  --mesh-2: rgba(59, 130, 246, 0.06);
  --noise-opacity: 0.015;
}

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06100c;
  --bg-elevated: #0c1815;
  --bg-sunken: #0a1411;
  --bg-hover: #112019;
  --border: rgba(232, 240, 235, 0.07);
  --border-strong: rgba(232, 240, 235, 0.14);
  --text: #e8f0eb;
  --text-muted: #8c9c95;
  --text-subtle: #5a6b65;
  --accent: #34d399;
  --accent-hover: #6ee7b7;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --accent-ring: rgba(52, 211, 153, 0.35);
  --positive: #34d399;
  --negative: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  --mesh-1: rgba(52, 211, 153, 0.10);
  --mesh-2: rgba(96, 165, 250, 0.05);
  --noise-opacity: 0.025;
}

/* System theme follows OS */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #06100c;
    --bg-elevated: #0c1815;
    --bg-sunken: #0a1411;
    --bg-hover: #112019;
    --border: rgba(232, 240, 235, 0.07);
    --border-strong: rgba(232, 240, 235, 0.14);
    --text: #e8f0eb;
    --text-muted: #8c9c95;
    --text-subtle: #5a6b65;
    --accent: #34d399;
    --accent-hover: #6ee7b7;
    --accent-soft: rgba(52, 211, 153, 0.14);
    --accent-ring: rgba(52, 211, 153, 0.35);
    --positive: #34d399;
    --negative: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
    --mesh-1: rgba(52, 211, 153, 0.10);
    --mesh-2: rgba(96, 165, 250, 0.05);
    --noise-opacity: 0.025;
  }
}
