/* tokens.css — Cloud Cover design system
   Concept: industrial steel-plate / gearworks MSP brand.
   Derived from the Cloud Cover LLC mark: gunmetal grays, riveted steel,
   and a muted steel-blue accent (#5b7f99 family). */

:root {
  /* 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.25rem, 1rem + 3.6vw, 4.5rem);
  --text-hero: clamp(2.75rem, 0.8rem + 6vw, 6.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 — small, plate-like, never fully soft */
  --radius-sm: 0.25rem;
  --radius-md: 0.4rem;
  --radius-lg: 0.6rem;
  --radius-xl: 0.85rem;
  --radius-full: 9999px;

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

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1240px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'General Sans', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'General Sans', 'Segoe UI', sans-serif;
}

/* ---------------- LIGHT MODE ---------------- */
:root,
[data-theme='light'] {
  --color-bg: #f2f3f5;
  --color-surface: #ffffff;
  --color-surface-2: #f8f9fa;
  --color-surface-offset: #e9ebee;
  --color-surface-offset-2: #dde0e4;
  --color-surface-dynamic: #d3d7dc;
  --color-divider: #dde0e4;
  --color-border: #ccd0d6;

  --color-text: #171b1f;
  --color-text-muted: #565e66;
  --color-text-faint: #8b929a;
  --color-text-inverse: #f5f6f7;

  /* Primary — steel blue, darkened for AA contrast on light surfaces */
  --color-primary: #2f5a75;
  --color-primary-hover: #24485f;
  --color-primary-active: #1c384a;
  --color-primary-highlight: #d7e3ea;

  /* Secondary steel-gray accent (badges, secondary icons) */
  --color-steel: #5b6673;
  --color-steel-highlight: #e2e5e9;

  --color-warning: #96551e;
  --color-warning-hover: #79430f;
  --color-warning-highlight: #e8dccb;

  --color-error: #a3293b;
  --color-error-hover: #7f1e2c;
  --color-error-highlight: #ecd4d8;

  --color-success: #2f6f45;
  --color-success-hover: #23572f;
  --color-success-highlight: #d3e4d6;

  --shadow-sm: 0 1px 2px oklch(0.15 0.01 240 / 0.08);
  --shadow-md: 0 6px 16px oklch(0.15 0.01 240 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.15 0.01 240 / 0.16);
}

/* ---------------- DARK MODE ---------------- */
[data-theme='dark'] {
  --color-bg: #0d1013;
  --color-surface: #14181d;
  --color-surface-2: #191e24;
  --color-surface-offset: #10141810;
  --color-surface-offset-2: #1d2329;
  --color-surface-dynamic: #232a31;
  --color-divider: #1e242a;
  --color-border: #2a3138;

  --color-text: #e9edf1;
  --color-text-muted: #9aa5b1;
  --color-text-faint: #5c6670;
  --color-text-inverse: #10141810;

  --color-primary: #7fb2d1;
  --color-primary-hover: #64a0c3;
  --color-primary-active: #4d8bb0;
  --color-primary-highlight: #1c2d38;

  --color-steel: #9aa3ac;
  --color-steel-highlight: #23282e;

  --color-warning: #d99a5f;
  --color-warning-hover: #e3ac78;
  --color-warning-highlight: #382d22;

  --color-error: #de7986;
  --color-error-hover: #e79aa4;
  --color-error-highlight: #3a2429;

  --color-success: #7fbf93;
  --color-success-hover: #98cca8;
  --color-success-highlight: #1f2f24;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d1013;
    --color-surface: #14181d;
    --color-surface-2: #191e24;
    --color-surface-offset: #10141810;
    --color-surface-offset-2: #1d2329;
    --color-surface-dynamic: #232a31;
    --color-divider: #1e242a;
    --color-border: #2a3138;

    --color-text: #e9edf1;
    --color-text-muted: #9aa5b1;
    --color-text-faint: #5c6670;
    --color-text-inverse: #10141810;

    --color-primary: #7fb2d1;
    --color-primary-hover: #64a0c3;
    --color-primary-active: #4d8bb0;
    --color-primary-highlight: #1c2d38;

    --color-steel: #9aa3ac;
    --color-steel-highlight: #23282e;

    --color-warning: #d99a5f;
    --color-success: #7fbf93;
    --color-error: #de7986;

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 8px 20px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
  }
}
