/* Custom HSE — Design Tokens
   Enterprise light aesthetic, maritime/industrial grounding.
   Cool slate surfaces + deep teal primary + industrial amber warn. */

:root,
[data-theme='light'] {
  /* Surfaces — cool near-white slate */
  --color-bg: #f6f8fa;
  --color-surface: #ffffff;
  --color-surface-2: #fbfcfd;
  --color-surface-offset: #eef2f6;
  --color-surface-offset-2: #e3e9ef;
  --color-surface-dynamic: #d9e0e8;
  --color-divider: #e1e6eb;
  --color-border: #cfd6dd;

  /* Text — neutral cool gray */
  --color-text: #0f1b26;
  --color-text-muted: #556170;
  --color-text-faint: #8b95a1;
  --color-text-inverse: #f8fafc;

  /* Primary — deep maritime teal */
  --color-primary: #0f5b6b;
  --color-primary-hover: #0a4854;
  --color-primary-active: #083741;
  --color-primary-highlight: #d2e5e8;

  /* Warning — industrial amber (safety-signal) */
  --color-warning: #b45309;
  --color-warning-hover: #92400e;
  --color-warning-active: #78350f;
  --color-warning-highlight: #fde8c4;

  /* Error — hazard red */
  --color-error: #b91c1c;
  --color-error-hover: #991b1b;
  --color-error-active: #7f1d1d;
  --color-error-highlight: #fcd1d1;

  /* Success — go green */
  --color-success: #15803d;
  --color-success-hover: #166534;
  --color-success-active: #14532d;
  --color-success-highlight: #c8e6d3;

  /* Info — report blue */
  --color-blue: #1d4ed8;
  --color-blue-hover: #1e40af;
  --color-blue-highlight: #d1ddf7;

  /* Neutral highlight for "AI" content */
  --color-ai: #4338ca;
  --color-ai-hover: #3730a3;
  --color-ai-highlight: #e0e0fb;

  /* 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-hero: clamp(2.75rem, 1.5rem + 4vw, 5rem);

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

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* Shadows — cool-tinted */
  --shadow-sm: 0 1px 2px oklch(0.3 0.02 240 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.3 0.02 240 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.3 0.02 240 / 0.14);
  --shadow-inset: inset 0 0 0 1px var(--color-border);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1280px;
  --content-app: 1440px;

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme='dark'] {
  --color-bg: #0a1018;
  --color-surface: #0f1621;
  --color-surface-2: #131b28;
  --color-surface-offset: #182231;
  --color-surface-offset-2: #1f2a3b;
  --color-surface-dynamic: #263244;
  --color-divider: #1e2734;
  --color-border: #2c3749;

  --color-text: #e3e8ef;
  --color-text-muted: #8b95a3;
  --color-text-faint: #5b6472;
  --color-text-inverse: #0f1b26;

  --color-primary: #4dc4d4;
  --color-primary-hover: #6cd4e2;
  --color-primary-active: #33a9b8;
  --color-primary-highlight: #1b3a42;

  --color-warning: #f59e0b;
  --color-warning-hover: #fbbf24;
  --color-warning-active: #d97706;
  --color-warning-highlight: #4a2f0a;

  --color-error: #f87171;
  --color-error-hover: #fca5a5;
  --color-error-highlight: #4a1e1e;

  --color-success: #4ade80;
  --color-success-hover: #86efac;
  --color-success-highlight: #1a3827;

  --color-blue: #60a5fa;
  --color-blue-hover: #93c5fd;
  --color-blue-highlight: #1c2a48;

  --color-ai: #a5b4fc;
  --color-ai-hover: #c7d2fe;
  --color-ai-highlight: #252148;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  --shadow-inset: inset 0 0 0 1px var(--color-border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1018;
    --color-surface: #0f1621;
    --color-surface-2: #131b28;
    --color-surface-offset: #182231;
    --color-surface-offset-2: #1f2a3b;
    --color-surface-dynamic: #263244;
    --color-divider: #1e2734;
    --color-border: #2c3749;
    --color-text: #e3e8ef;
    --color-text-muted: #8b95a3;
    --color-text-faint: #5b6472;
    --color-text-inverse: #0f1b26;
    --color-primary: #4dc4d4;
    --color-primary-hover: #6cd4e2;
    --color-primary-active: #33a9b8;
    --color-primary-highlight: #1b3a42;
    --color-warning: #f59e0b;
    --color-warning-hover: #fbbf24;
    --color-warning-active: #d97706;
    --color-warning-highlight: #4a2f0a;
    --color-error: #f87171;
    --color-error-hover: #fca5a5;
    --color-error-highlight: #4a1e1e;
    --color-success: #4ade80;
    --color-success-hover: #86efac;
    --color-success-highlight: #1a3827;
    --color-blue: #60a5fa;
    --color-blue-hover: #93c5fd;
    --color-blue-highlight: #1c2a48;
    --color-ai: #a5b4fc;
    --color-ai-hover: #c7d2fe;
    --color-ai-highlight: #252148;
  }
}
