/* Art direction: Bloomberg Terminal meets Cannabis Finance → Premium dark financial publication
   Palette: Cool/dark near-black surfaces, sophisticated emerald green accent
   Typography: Clash Display (commanding financial display) + Satoshi (clean modern body) + JetBrains Mono (data/tickers)
   Density: Balanced — editorial spacing for articles, dense for data sections */

/* ===== TYPE SCALE ===== */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* ===== SPACING (4px base) ===== */
  --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;
  --space-32: 8rem;

  /* ===== FONTS ===== */
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* ===== 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-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ===== DARK MODE (DEFAULT) ===== */
:root, [data-theme="dark"] {
  --color-bg:             #0a0a0a;
  --color-surface:        #111111;
  --color-surface-2:      #1a1a1a;
  --color-surface-offset: #0d0d0d;
  --color-divider:        #222222;
  --color-border:         #2a2a2a;

  --color-text:           #e0e0e0;
  --color-text-muted:     #888888;
  --color-text-faint:     #555555;
  --color-text-inverse:   #0a0a0a;

  --color-primary:        #2d8a4e;
  --color-primary-hover:  #3da864;
  --color-primary-active: #1f6b3a;
  --color-primary-highlight: #1a2e22;

  --color-error:          #c0392b;
  --color-error-hover:    #e74c3c;
  --color-error-active:   #a93226;

  --color-success:        #27ae60;
  --color-success-hover:  #2ecc71;
  --color-success-active: #1e8449;

  --color-warning:        #d4a017;
  --color-warning-hover:  #f1c40f;
  --color-warning-active: #b7950b;

  --color-up:             #2d8a4e;
  --color-down:           #c0392b;

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

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --color-bg:             #f5f5f5;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafafa;
  --color-surface-offset: #eeeeee;
  --color-divider:        #e0e0e0;
  --color-border:         #d4d4d4;

  --color-text:           #1a1a1a;
  --color-text-muted:     #666666;
  --color-text-faint:     #999999;
  --color-text-inverse:   #f5f5f5;

  --color-primary:        #2d8a4e;
  --color-primary-hover:  #247a42;
  --color-primary-active: #1f6b3a;
  --color-primary-highlight: #e8f5e9;

  --color-error:          #c0392b;
  --color-error-hover:    #e74c3c;
  --color-error-active:   #a93226;

  --color-success:        #27ae60;
  --color-success-hover:  #2ecc71;
  --color-success-active: #1e8449;

  --color-warning:        #d4a017;
  --color-warning-hover:  #f1c40f;
  --color-warning-active: #b7950b;

  --color-up:             #2d8a4e;
  --color-down:           #c0392b;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* System preference fallback */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f5f5;
    --color-surface:        #ffffff;
    --color-surface-2:      #fafafa;
    --color-surface-offset: #eeeeee;
    --color-divider:        #e0e0e0;
    --color-border:         #d4d4d4;
    --color-text:           #1a1a1a;
    --color-text-muted:     #666666;
    --color-text-faint:     #999999;
    --color-text-inverse:   #f5f5f5;
    --color-primary:        #2d8a4e;
    --color-primary-hover:  #247a42;
    --color-primary-active: #1f6b3a;
    --color-primary-highlight: #e8f5e9;
    --color-error:          #c0392b;
    --color-success:        #27ae60;
    --color-warning:        #d4a017;
    --color-up:             #2d8a4e;
    --color-down:           #c0392b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  }
}
