/* PsychFLOW Design Tokens
   Palette: Deep Navy (authority) + Sage Green (wellbeing) + Warm Cream (warmth)
   Clinical precision meets psychological warmth — out-classes generic PMS tools
*/

:root,
[data-theme='light'] {
  /* Surfaces — warm cream, not cold white */
  --color-bg: #f8f6f1;
  --color-surface: #faf9f5;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f2ede4;
  --color-surface-offset-2: #ebe5da;
  --color-surface-dynamic: #e0d9cc;
  --color-divider: #d6cfc2;
  --color-border: #ccc5b8;

  /* Text — warm charcoal */
  --color-text: #1a1916;
  --color-text-muted: #6b6760;
  --color-text-faint: #b0aa9e;
  --color-text-inverse: #f8f6f1;

  /* Primary — Deep Navy (authority, trust) */
  --color-primary: #1b3a5c;
  --color-primary-hover: #142c46;
  --color-primary-active: #0d1f32;
  --color-primary-highlight: #d0dae6;

  /* Accent — Sage Green (wellbeing, growth) */
  --color-accent: #4a7c6f;
  --color-accent-hover: #3b6459;
  --color-accent-active: #2d4d45;
  --color-accent-highlight: #d4e6e2;

  /* CTA — Warm Amber (energy, action — used sparingly) */
  --color-cta: #c4622d;
  --color-cta-hover: #a84f24;
  --color-cta-active: #8c3d1b;
  --color-cta-highlight: #f0ddd2;

  /* Semantic */
  --color-success: #3d7a4f;
  --color-success-highlight: #d0e8d8;
  --color-warning: #9b6e1a;
  --color-warning-highlight: #f0e4cc;
  --color-error: #9b2c2c;
  --color-error-highlight: #f0d0d0;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows — warm-toned */
  --shadow-sm: 0 1px 3px oklch(0.2 0.02 60 / 0.07);
  --shadow-md: 0 4px 16px oklch(0.2 0.02 60 / 0.10);
  --shadow-lg: 0 16px 48px oklch(0.2 0.02 60 / 0.14);
  --shadow-card: 0 2px 8px oklch(0.2 0.02 60 / 0.08), 0 1px 2px oklch(0.2 0.02 60 / 0.05);

  /* Type scale */
  --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, 7rem);

  /* Spacing */
  --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;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

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

[data-theme='dark'] {
  --color-bg: #0f1419;
  --color-surface: #141a22;
  --color-surface-2: #192029;
  --color-surface-offset: #1b2330;
  --color-surface-offset-2: #1e2838;
  --color-surface-dynamic: #243040;
  --color-divider: #2a3545;
  --color-border: #334055;
  --color-text: #e2ddd5;
  --color-text-muted: #8c8880;
  --color-text-faint: #5a5650;
  --color-text-inverse: #0f1419;
  --color-primary: #6b9ed4;
  --color-primary-hover: #8bb4df;
  --color-primary-active: #a8c8e8;
  --color-primary-highlight: #1e3050;
  --color-accent: #7ab8a8;
  --color-accent-hover: #90c8b6;
  --color-accent-active: #a6d6c6;
  --color-accent-highlight: #1e3832;
  --color-cta: #e07a4a;
  --color-cta-hover: #e88f63;
  --color-cta-active: #f0a47c;
  --color-cta-highlight: #40261a;
  --color-success: #6ab87e;
  --color-success-highlight: #1e3828;
  --color-warning: #c8963a;
  --color-warning-highlight: #3a2e14;
  --color-error: #d46060;
  --color-error-highlight: #3a1e1e;
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 48px oklch(0 0 0 / 0.5);
  --shadow-card: 0 2px 8px oklch(0 0 0 / 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1419;
    --color-surface: #141a22;
    --color-surface-2: #192029;
    --color-surface-offset: #1b2330;
    --color-surface-offset-2: #1e2838;
    --color-surface-dynamic: #243040;
    --color-divider: #2a3545;
    --color-border: #334055;
    --color-text: #e2ddd5;
    --color-text-muted: #8c8880;
    --color-text-faint: #5a5650;
    --color-text-inverse: #0f1419;
    --color-primary: #6b9ed4;
    --color-primary-hover: #8bb4df;
    --color-primary-active: #a8c8e8;
    --color-primary-highlight: #1e3050;
    --color-accent: #7ab8a8;
    --color-accent-hover: #90c8b6;
    --color-accent-active: #a6d6c6;
    --color-accent-highlight: #1e3832;
    --color-cta: #e07a4a;
    --color-cta-hover: #e88f63;
    --color-cta-active: #f0a47c;
    --color-cta-highlight: #40261a;
    --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 48px oklch(0 0 0 / 0.5);
    --shadow-card: 0 2px 8px oklch(0 0 0 / 0.3);
  }
}
