/* ============================================================
   LUCAS MECHANICAL — Design Tokens
   Palette: Charcoal / Off-white / Steel grey + warm accent
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f5f5f4;
  --color-surface: #ffffff;
  --color-surface-2: #fafafa;
  --color-surface-offset: #eeeeec;
  --color-surface-offset-2: #e5e5e3;
  --color-divider: #d8d8d6;
  --color-border: #c8c8c6;

  /* Text */
  --color-text: #111110;
  --color-text-muted: #6b6b69;
  --color-text-faint: #a8a8a6;
  --color-text-inverse: #f5f5f4;

  /* Primary — warm charcoal (acts as action colour on light bg) */
  --color-primary: #1a1a18;
  --color-primary-hover: #2e2e2c;
  --color-primary-active: #000000;
  --color-primary-highlight: #e0e0de;

  /* Accent — single muted warm tone for CTAs & highlights */
  --color-accent: #3a3a38;
  --color-accent-hover: #2a2a28;

  /* Red for urgency / emergency badge */
  --color-urgent: #c0392b;
  --color-urgent-muted: #f0e0de;

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

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.13);

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

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

  /* Content widths */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;

  /* Fonts */
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* ── DARK MODE ──────────────────────────────────────────── */
[data-theme='dark'] {
  --color-bg: #111110;
  --color-surface: #171716;
  --color-surface-2: #1c1c1b;
  --color-surface-offset: #1f1f1e;
  --color-surface-offset-2: #252524;
  --color-divider: #2a2a29;
  --color-border: #333331;
  --color-text: #e8e8e6;
  --color-text-muted: #888886;
  --color-text-faint: #555553;
  --color-text-inverse: #111110;
  --color-primary: #e8e8e6;
  --color-primary-hover: #ffffff;
  --color-primary-active: #ccccca;
  --color-primary-highlight: #252524;
  --color-accent: #d0d0ce;
  --color-accent-hover: #ffffff;
  --color-urgent: #e74c3c;
  --color-urgent-muted: #3a1f1d;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111110;
    --color-surface: #171716;
    --color-surface-2: #1c1c1b;
    --color-surface-offset: #1f1f1e;
    --color-surface-offset-2: #252524;
    --color-divider: #2a2a29;
    --color-border: #333331;
    --color-text: #e8e8e6;
    --color-text-muted: #888886;
    --color-text-faint: #555553;
    --color-text-inverse: #111110;
    --color-primary: #e8e8e6;
    --color-primary-hover: #ffffff;
    --color-primary-active: #ccccca;
    --color-primary-highlight: #252524;
    --color-accent: #d0d0ce;
    --color-accent-hover: #ffffff;
    --color-urgent: #e74c3c;
    --color-urgent-muted: #3a1f1d;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 36px rgba(0,0,0,0.5);
  }
}
