/* ═══════════════════════════════════════════════════════════════
   Stratum Books V2 — Design Tokens
   Industrial Core: "Tactile Engineering"
   Accent: Safety Orange #fc9430
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Tier 1: Primitives (never used directly in components) ──── */
:root {
  /* Industrial Neutrals */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-850: #1a1a1a;
  --neutral-900: #131313;
  --neutral-950: #0e0e0e;

  /* Safety Orange (Primary Accent) */
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fc9430;
  --orange-500: #e67e22;
  --orange-600: #d97706;
  --orange-700: #b45309;
  --orange-800: #92400e;

  /* System Status Colors */
  --green-400: #66bb6a;
  --green-500: #4CAF50;
  --green-600: #388e3c;
  --red-400: #ef5350;
  --red-500: #F44336;
  --red-600: #d32f2f;
  --amber-400: #ffca28;
  --amber-500: #FFC107;
  --amber-600: #ffb300;

  /* Copper (suite-wide accent) */
  --copper-400: #c27040;
  --copper-500: #b85c2f;
  --color-accent-copper: var(--copper-400);

  /* Steel Blue (secondary instrument highlights) */
  --steel-400: #78909c;
  --steel-500: #607d8b;
  --steel-600: #546e7a;
}

/* ── Tier 2: Semantic Tokens — Light Theme (Technical Daylight) ── */
:root {
  /* Primary = Safety Orange */
  --color-primary: #fc9430;
  --color-primary-hover: #ffb066;
  --color-primary-light: rgba(252, 148, 48, 0.12);

  /* Accent (steel blue for secondary actions) */
  --color-accent: #90a4ae;

  /* Highlight (Safety Orange) */
  --color-highlight: #fc9430;
  --color-highlight-hover: #ffb066;
  --color-highlight-light: rgba(252, 148, 48, 0.12);

  /* Status — Instrument-Grade */
  --color-success: #4CAF50;
  --color-success-light: rgba(76, 175, 80, 0.15);
  --color-danger: #F44336;
  --color-danger-light: rgba(244, 67, 54, 0.15);
  --color-warning: #FFC107;
  --color-warning-light: rgba(255, 193, 7, 0.15);
  --color-info: #90a4ae;

  /* Text — Cool White on Dark */
  --color-text: #f2f2f2;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #666666;
  --color-text-inverse: #0e0e0e;

  /* Surfaces — Deep Obsidian / Machine Grey */
  --color-surface: #131313;
  --color-surface-alt: #1a1a1a;
  --color-surface-elevated: #1a1a1a;
  --color-background: #0e0e0e;

  /* Borders — Dark Hairline */
  --color-border: #2a2a2a;
  --color-border-light: #1e1e1e;

  /* Interactive states */
  --color-hover: rgba(255, 255, 255, 0.04);
  --color-active: rgba(255, 255, 255, 0.08);
  --color-focus-ring: rgba(252, 148, 48, 0.4);

  /* Typography — Space Grotesk: geometric, engineered */
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.375rem;
  --text-3xl: 1.75rem;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing (4px base grid — tighter than before for density) */
  --space-0: 0;
  --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;

  /* Border radius — precision cut, no rounding. Hard edges. */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-pill: 9999px;
  --radius-full: 50%;

  /* Shadows — industrial, heavy, directional (dark default) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.7);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Transitions — instant, mechanical. No easing. */
  --duration-fast: 0ms;
  --duration-normal: 80ms;
  --duration-slow: 150ms;
  --ease-default: linear;
  --ease-in: linear;
  --ease-out: linear;

  /* Focus */
  --focus-ring: 0 0 0 2px var(--color-focus-ring);

  /* Component */
  --modal-backdrop: rgba(0, 0, 0, 0.75);

  /* Layout */
  --sidebar-width: 56px;
  --sidebar-width-expanded: 240px;
  --topbar-height: 48px;

  /* Industrial-specific tokens */
  --telemetry-border: 2px solid var(--color-border);
  --command-rail-bg: var(--color-surface);

  /* Cross-product source colors */
  --source-color-pipeline: #0f766e;
  --source-color-assets: #9a3412;
  --source-color-inventory: #ea580c;
  --source-color-vendors: #475569;
  --source-color-permits: #dc2626;
  --source-color-warranties: #831843;
  --source-color-workforce: #4d7c0f;
  --source-color-books: #4a7c59;
}

/* ── Tier 2: Semantic Tokens — Light Theme (Technical Daylight) ───── */
[data-theme="daylight"] {
  --color-primary: var(--orange-500);
  --color-primary-hover: var(--orange-600);
  --color-primary-light: rgba(230, 126, 34, 0.08);
  --color-accent: var(--steel-500);
  --color-highlight: var(--orange-500);
  --color-highlight-hover: var(--orange-600);
  --color-highlight-light: rgba(230, 126, 34, 0.08);
  --color-success: #4CAF50;
  --color-success-light: rgba(76, 175, 80, 0.08);
  --color-danger: #F44336;
  --color-danger-light: rgba(244, 67, 54, 0.08);
  --color-warning: #FFC107;
  --color-warning-light: rgba(255, 193, 7, 0.08);
  --color-info: var(--steel-500);
  --color-text: var(--neutral-850);
  --color-text-secondary: var(--neutral-600);
  --color-text-muted: var(--neutral-400);
  --color-text-inverse: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: var(--neutral-100);
  --color-surface-elevated: #ffffff;
  --color-background: #f7f7f7;
  --color-border: #e0e0e0;
  --color-border-light: #eeeeee;
  --color-hover: rgba(0, 0, 0, 0.04);
  --color-active: rgba(0, 0, 0, 0.08);
  --color-focus-ring: rgba(252, 148, 48, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.2);
  --modal-backdrop: rgba(0, 0, 0, 0.4);
  --focus-ring: 0 0 0 2px var(--color-focus-ring);
  --command-rail-bg: #ffffff;
}
