/* ==========================================================================
   SOMATIC MIRROR — DESIGN SYSTEM & TOKENS
   Pure Vanilla CSS Architecture
   ========================================================================== */

:root {
  /* Core Color Palette - Obsidian Slate & Bio-Tones */
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-elevated: rgba(30, 41, 59, 0.7);
  --bg-elevated-hover: rgba(51, 65, 85, 0.6);
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverted: #090d16;

  /* Accent & Biofeedback Status Colors */
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;
  
  /* Physiological State Colors */
  --state-relaxed: #10b981;
  --state-mild: #06b6d4;
  --state-moderate: #f59e0b;
  --state-high: #f43f5e;

  /* Borders & Dividers */
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-active: rgba(59, 130, 246, 0.4);
  --border-highlight: rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 30px -5px rgba(59, 130, 246, 0.3);
  --shadow-glow-emerald: 0 0 30px -5px rgba(16, 185, 129, 0.3);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sizing & Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Mode */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --bg-elevated-hover: rgba(241, 245, 249, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.8);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverted: #ffffff;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-active: rgba(59, 130, 246, 0.5);
  --border-highlight: rgba(0, 0, 0, 0.08);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, 0.12);
}

/* High Contrast Accessibility Mode */
[data-contrast="high"] {
  --bg-primary: #000000 !important;
  --bg-secondary: #000000 !important;
  --bg-tertiary: #121212 !important;
  --bg-elevated: #000000 !important;
  --bg-glass: #000000 !important;
  
  --text-primary: #ffffff !important;
  --text-secondary: #ffff00 !important;
  --text-muted: #00ffff !important;

  --border-subtle: #ffffff !important;
  --border-active: #ffff00 !important;
  --border-highlight: #ffffff !important;

  --state-relaxed: #00ff00 !important;
  --state-mild: #00ffff !important;
  --state-moderate: #ffff00 !important;
  --state-high: #ff0055 !important;
}

/* Large Text Mode */
[data-large-text="true"] {
  font-size: 118%;
}

/* Base Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Canvas Effect */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.03) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

body::after {
  content: '';
  position: fixed;
  bottom: -15%;
  right: 5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, rgba(6, 182, 212, 0.02) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
