/* style.css — Market Pulse design tokens */

/* =============================================
   CUSTOM PALETTE: Financial Dashboard
   Deep navy-charcoal dark mode default.
   Blue accent for data visualization.
   ============================================= */

/* Type scale — fluid */
:root {
  --text-xs:   clamp(0.65rem,  0.6rem  + 0.2vw, 0.75rem);
  --text-sm:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.82rem + 0.3vw,  1rem);
  --text-lg:   clamp(1rem,     0.9rem  + 0.5vw,  1.25rem);
  --text-xl:   clamp(1.25rem,  1rem    + 0.8vw,  1.75rem);
  --text-2xl:  clamp(1.5rem,   1.1rem  + 1.2vw,  2.25rem);
  --text-3xl:  clamp(2rem,     1.2rem  + 2vw,    3.5rem);

  /* 4px spacing system */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-default: 960px;
  --content-wide: 1400px;
  --content-full: 100%;

  /* Dashboard layout */
  --header-height: 56px;

  /* Font */
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --font-display: 'Inter', 'Helvetica Neue', system-ui, sans-serif;

  /* Data accent colors — stable across themes */
  --chart-blue:   #3b82f6;
  --chart-blue-2: #60a5fa;
  --chart-green:  #22c55e;
  --chart-red:    #ef4444;
  --chart-amber:  #f59e0b;
  --chart-purple: #a78bfa;
  --chart-teal:   #14b8a6;
}

/* ---- LIGHT MODE ---- */
:root, [data-theme="light"] {
  --color-bg:              #f4f3f0;
  --color-surface:         #fafaf8;
  --color-surface-2:       #ffffff;
  --color-surface-offset:  #eeedea;
  --color-surface-offset-2:#e6e5e1;
  --color-surface-dynamic: #dddcd8;
  --color-divider:         #d8d6d2;
  --color-border:          #cbc9c4;

  --color-text:            #1a1917;
  --color-text-muted:      #6b6a67;
  --color-text-faint:      #b0afac;
  --color-text-inverse:    #f8f8f6;

  --color-primary:         #2563eb;
  --color-primary-hover:   #1d4ed8;
  --color-primary-active:  #1e40af;
  --color-primary-highlight: #dbeafe;

  --color-success:         #16a34a;
  --color-success-hover:   #15803d;
  --color-success-highlight: #dcfce7;

  --color-warning:         #d97706;
  --color-warning-hover:   #b45309;
  --color-warning-highlight: #fef3c7;

  --color-error:           #dc2626;
  --color-error-hover:     #b91c1c;
  --color-error-highlight: #fee2e2;

  --shadow-sm: 0 1px 2px oklch(0.15 0.01 250 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.15 0.01 250 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.15 0.01 250 / 0.12);
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --color-bg:              #0f1117;
  --color-surface:         #161b27;
  --color-surface-2:       #1c2333;
  --color-surface-offset:  #1a1f2e;
  --color-surface-offset-2:#21283a;
  --color-surface-dynamic: #2a3347;
  --color-divider:         #252d3f;
  --color-border:          #2f3a50;

  --color-text:            #e2e4eb;
  --color-text-muted:      #8892a4;
  --color-text-faint:      #4f5a6e;
  --color-text-inverse:    #0f1117;

  --color-primary:         #3b82f6;
  --color-primary-hover:   #60a5fa;
  --color-primary-active:  #93c5fd;
  --color-primary-highlight: #1e3a5f;

  --color-success:         #22c55e;
  --color-success-hover:   #4ade80;
  --color-success-highlight: #14532d;

  --color-warning:         #f59e0b;
  --color-warning-hover:   #fbbf24;
  --color-warning-highlight: #451a03;

  --color-error:           #ef4444;
  --color-error-hover:     #f87171;
  --color-error-highlight: #450a0a;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* System preference default — dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:              #0f1117;
    --color-surface:         #161b27;
    --color-surface-2:       #1c2333;
    --color-surface-offset:  #1a1f2e;
    --color-surface-offset-2:#21283a;
    --color-surface-dynamic: #2a3347;
    --color-divider:         #252d3f;
    --color-border:          #2f3a50;
    --color-text:            #e2e4eb;
    --color-text-muted:      #8892a4;
    --color-text-faint:      #4f5a6e;
    --color-text-inverse:    #0f1117;
    --color-primary:         #3b82f6;
    --color-primary-hover:   #60a5fa;
    --color-primary-active:  #93c5fd;
    --color-primary-highlight: #1e3a5f;
    --color-success:         #22c55e;
    --color-success-hover:   #4ade80;
    --color-success-highlight: #14532d;
    --color-warning:         #f59e0b;
    --color-warning-hover:   #fbbf24;
    --color-warning-highlight: #451a03;
    --color-error:           #ef4444;
    --color-error-hover:     #f87171;
    --color-error-highlight: #450a0a;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  }
}
