/* Mountain Theory — design tokens (UI rework, Epic 0).
   Single source of truth for color, type, space, radius, elevation, motion.
   Dark is the default theme; light overrides live under :root[data-theme="light"].
   Components must reference these vars — never raw hex. See docs/ui-rework §4. */

:root {
  /* ---- Canvas & surfaces (dark, default) ---- */
  --mt-bg:            #0A0B0D;
  --mt-bg-elev-1:     #14161B;
  --mt-bg-elev-2:     #1C1F26;
  --mt-border:        rgba(255, 255, 255, 0.08);
  --mt-border-strong: rgba(255, 255, 255, 0.14);

  /* ---- Brand ---- */
  --mt-orange:     #F7931E;   /* primary / CTA / energy / Policy */
  --mt-orange-600: #E07C00;
  --mt-cyan:       #22D3EE;   /* the "Core" / tech accent / Guardian */
  --mt-blue:       #3B82F6;   /* interactive secondary */

  /* ---- Constitutional branches ---- */
  --mt-guardian:    #22D3EE;  /* Executive / real-time */
  --mt-adjudicator: #8B5CF6;  /* Judicial / reasoning */
  --mt-policy:      #F7931E;  /* Legislative / rules */

  /* ---- Decision vocabulary (sacred — identical everywhere) ---- */
  --mt-allow: #22C55E;
  --mt-hold:  #F59E0B;
  --mt-block: #EF4444;

  /* ---- Severity ---- */
  --mt-sev-critical: #EF4444;
  --mt-sev-high:     #F97316;
  --mt-sev-medium:   #EAB308;
  --mt-sev-low:      #22C55E;

  /* ---- Text ---- */
  --mt-text:       #F4F6FA;
  --mt-text-muted: #A3ABB8;
  --mt-text-dim:   #6B7280;

  /* ---- Typography ---- */
  --mt-font-ui:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mt-font-display: 'Montserrat', 'Poppins', var(--mt-font-ui);
  --mt-font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ---- Spacing (4px base) ---- */
  --mt-space-1: 4px;  --mt-space-2: 8px;  --mt-space-3: 12px; --mt-space-4: 16px;
  --mt-space-6: 24px; --mt-space-8: 32px; --mt-space-12: 48px; --mt-space-16: 64px;

  /* ---- Radius ---- */
  --mt-radius-control: 8px;
  --mt-radius-card:    14px;
  --mt-radius-pill:    999px;

  /* ---- Elevation (glow-based on dark) ---- */
  --mt-elev-rest:  0 0 0 1px var(--mt-border);
  --mt-elev-hover: 0 0 0 1px var(--mt-border-strong), 0 8px 24px rgba(34, 211, 238, 0.10);

  /* ---- Motion ---- */
  --mt-dur-fast:    120ms;
  --mt-dur-base:    200ms;
  --mt-dur-slow:    320ms;
  --mt-dur-ambient: 8s;
  --mt-ease-standard:   cubic-bezier(0.2, 0, 0, 1);
  --mt-ease-emphasized: cubic-bezier(0.2, 0, 0, 1.2);
  --mt-ease-exit:       cubic-bezier(0.4, 0, 1, 1);
}

/* ---- Light theme (both themes are first-class deliverables) ---- */
:root[data-theme="light"] {
  --mt-bg:            #F6F7FB;
  --mt-bg-elev-1:     #FFFFFF;
  --mt-bg-elev-2:     #EEF1F6;
  --mt-border:        rgba(10, 11, 13, 0.10);
  --mt-border-strong: rgba(10, 11, 13, 0.18);

  --mt-text:       #0F1622;
  --mt-text-muted: #55607A;
  --mt-text-dim:   #8A94A6;

  --mt-elev-rest:  0 1px 2px rgba(10, 11, 13, 0.06), 0 0 0 1px var(--mt-border);
  --mt-elev-hover: 0 6px 20px rgba(10, 11, 13, 0.10), 0 0 0 1px var(--mt-border-strong);
  /* Brand, decision, and severity hues are shared — they read on light too. */
}

/* Reduced motion: durations collapse; ambient loops are paused by components. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --mt-dur-fast: 0ms;
    --mt-dur-base: 0ms;
    --mt-dur-slow: 0ms;
  }
}
