/* ============================================================================
   Stein Ecosystem - Design Tokens
   Spec: docs/superpowers/specs/2026-04-19-ecosystem-visual-system-design.md
   ============================================================================ */

:root {
  /* Base palette (dark default) */
  --bg-deep: #0A0A0F;
  --bg-surface: #0D1020;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-elevated-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hard: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.4);
  --text-dim: rgba(255, 255, 255, 0.3);

  /* Status */
  --status-live: #22c55e;
  --status-error: #ef4444;

  /* Asset semantic */
  --asset-metals: #F5C842;
  --asset-indices: #4A9EFF;
  --asset-crypto: #A78BFA;
  --asset-forex: #10b981;

  /* Platform signature defaults (Stein Sapphire) */
  --sig-deep: #2C72C7;
  --sig-bright: #60a5fa;
  --sig-ultra: #93c5fd;
  --sig-gradient: linear-gradient(135deg, #2563eb, #60a5fa);
  --sig-gradient-text: linear-gradient(90deg, #2C72C7, #60a5fa);
  --sig-glow-strong: rgba(44, 114, 199, 0.18);
  --sig-glow-soft: rgba(44, 114, 199, 0.1);
  --sig-tint-wash: rgba(44, 114, 199, 0.08);
  --sig-tint-card: rgba(44, 114, 199, 0.04);
  --sig-border-soft: rgba(44, 114, 199, 0.2);
  --sig-shadow: 0 4px 18px rgba(44, 114, 199, 0.3);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-size-display: 56px;
  --font-size-h1: 44px;
  --font-size-h2: 30px;
  --font-size-h3: 20px;
  --font-size-body: 15px;
  --font-size-small: 14px;
  --font-size-label: 12px;
  --font-size-tiny: 10px;

  --tracking-display: -0.03em;
  --tracking-heading: -0.025em;
  --tracking-subheading: -0.02em;
  --tracking-body: -0.005em;
  --tracking-label: 0.14em;

  --line-display: 1.05;
  --line-heading: 1.15;
  --line-subheading: 1.2;
  --line-body: 1.6;
  --line-tight: 1.4;

  /* Spacing (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: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 600ms;
  --duration-hero: 700ms;

  /* Depth shadows (none in dark, active in light) */
  --shadow-card: none;
  --shadow-card-hover: none;

  /* Layout */
  --max-width: 1200px;
}

/* Per-platform signature overrides - REVDEN Emerald */
[data-platform="revden"] {
  --sig-deep: #10b981;
  --sig-bright: #34d399;
  --sig-ultra: #6ee7b7;
  --sig-gradient: linear-gradient(135deg, #059669, #10b981);
  --sig-gradient-text: linear-gradient(90deg, #10b981, #34d399);
  --sig-glow-strong: rgba(16, 185, 129, 0.18);
  --sig-glow-soft: rgba(16, 185, 129, 0.1);
  --sig-tint-wash: rgba(16, 185, 129, 0.08);
  --sig-tint-card: rgba(16, 185, 129, 0.04);
  --sig-border-soft: rgba(16, 185, 129, 0.2);
  --sig-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
}

/* Per-platform signature overrides - AlgoCheck Amber */
[data-platform="algocheck"] {
  --sig-deep: #f59e0b;
  --sig-bright: #fbbf24;
  --sig-ultra: #fcd34d;
  --sig-gradient: linear-gradient(135deg, #d97706, #f59e0b);
  --sig-gradient-text: linear-gradient(90deg, #f59e0b, #fbbf24);
  --sig-glow-strong: rgba(245, 158, 11, 0.18);
  --sig-glow-soft: rgba(245, 158, 11, 0.1);
  --sig-tint-wash: rgba(245, 158, 11, 0.08);
  --sig-tint-card: rgba(245, 158, 11, 0.04);
  --sig-border-soft: rgba(245, 158, 11, 0.2);
  --sig-shadow: 0 4px 18px rgba(245, 158, 11, 0.3);
}

/* ============================================================================
   LIGHT-MODE OVERRIDES - ORDER-SENSITIVE
   The light-mode Sapphire block below must come BEFORE the
   [data-theme="light"][data-platform="..."] blocks; those later blocks rely on
   higher specificity to re-assert REVDEN / AlgoCheck signature tokens when the
   Sapphire defaults would otherwise win via source order. Do not reorder.
   ============================================================================ */

/* Light-mode base overrides */
[data-theme="light"] {
  --bg-deep: #F4F1EA;                    /* warm linen paper, not pure white */
  --bg-surface: #FFFFFF;
  --bg-elevated: rgba(10, 10, 15, 0.04);
  --bg-elevated-hover: rgba(10, 10, 15, 0.06);
  --border-subtle: rgba(10, 10, 15, 0.08);
  --border-hard: rgba(10, 10, 15, 0.14);
  --border-strong: rgba(10, 10, 15, 0.22);

  --text-primary: #0A0A0F;
  --text-secondary: rgba(10, 10, 15, 0.7);
  --text-muted: rgba(10, 10, 15, 0.55);
  --text-dim: rgba(10, 10, 15, 0.4);

  /* Depth shadows (only active in light, empty in dark) */
  --shadow-card: 0 1px 2px rgba(10, 10, 15, 0.04), 0 6px 18px rgba(10, 10, 15, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(10, 10, 15, 0.06), 0 12px 30px rgba(10, 10, 15, 0.08);
}

/* Light-mode Sapphire signature adjustments */
[data-theme="light"] {
  --sig-ultra: #1d4ed8;                             /* deep blue for label legibility */
  --sig-bright: #2563eb;
  --sig-glow-strong: rgba(44, 114, 199, 0.12);
  --sig-glow-soft: rgba(44, 114, 199, 0.06);
  --sig-tint-wash: rgba(44, 114, 199, 0.1);         /* up from 0.06 */
  --sig-tint-card: rgba(44, 114, 199, 0.05);        /* up from 0.03 */
  --sig-shadow: 0 4px 14px rgba(44, 114, 199, 0.22);
  --sig-gradient-text: linear-gradient(90deg, #1d4ed8, #2C72C7);
}
[data-theme="light"][data-platform="revden"],
[data-theme="light"] [data-platform="revden"] {
  --sig-ultra: #047857;                             /* deep emerald for label legibility */
  --sig-bright: #059669;
  --sig-glow-strong: rgba(16, 185, 129, 0.12);
  --sig-glow-soft: rgba(16, 185, 129, 0.06);
  --sig-tint-wash: rgba(16, 185, 129, 0.1);
  --sig-tint-card: rgba(16, 185, 129, 0.05);
  --sig-shadow: 0 4px 14px rgba(16, 185, 129, 0.22);
  --sig-gradient-text: linear-gradient(90deg, #047857, #10b981);
}
[data-theme="light"][data-platform="algocheck"],
[data-theme="light"] [data-platform="algocheck"] {
  --sig-ultra: #b45309;                             /* deep amber for label legibility */
  --sig-bright: #c2410c;
  --sig-glow-strong: rgba(245, 158, 11, 0.12);
  --sig-glow-soft: rgba(245, 158, 11, 0.06);
  --sig-tint-wash: rgba(245, 158, 11, 0.1);
  --sig-tint-card: rgba(245, 158, 11, 0.05);
  --sig-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
  --sig-gradient-text: linear-gradient(90deg, #b45309, #d97706);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
