/* ==========================================================================
   PLUS CHRONOMETER — DESIGN TOKENS & CYBER-INDUSTRIAL DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color System — Dark Cyber-Industrial Base (Default) */
  --bg-primary: #030712;
  --bg-surface: #070d1d;
  --bg-surface-elevated: #0b152d;
  --bg-card: rgba(11, 21, 45, 0.7);
  --bg-card-hover: rgba(16, 31, 65, 0.85);
  --bg-glass: rgba(7, 13, 29, 0.65);

  /* Primary Brand & Industrial Laser Colors */
  --color-brand-blue: #0834ac;
  --color-brand-blue-light: #2563eb;
  --color-laser-cyan: #00f0ff;
  --color-laser-cyan-dim: rgba(0, 240, 255, 0.15);
  --color-laser-cyan-glow: rgba(0, 240, 255, 0.4);
  
  /* Status & Telemetry Indicators */
  --color-status-active: #00ff9d;
  --color-status-active-glow: rgba(0, 255, 157, 0.35);
  --color-status-warning: #f59e0b;
  --color-status-warning-glow: rgba(245, 158, 11, 0.35);
  --color-status-danger: #ef4444;
  --color-status-danger-glow: rgba(239, 68, 68, 0.35);
  --color-status-idle: #64748b;
  
  /* Text & Typography Hierarchy */
  --text-white: #ffffff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;
  --text-cyan: #38bdf8;

  /* Borders & Grid Overlays */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 240, 255, 0.3);
  --border-active: rgba(0, 255, 157, 0.4);
  --grid-line: rgba(0, 240, 255, 0.04);
  --grid-line-bright: rgba(0, 240, 255, 0.12);

  /* Typography Scales */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Elevation, Shadows & Neon Radiance */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);
  --shadow-glow-cyan: 0 0 25px rgba(0, 240, 255, 0.35);
  --shadow-glow-blue: 0 0 30px rgba(8, 52, 172, 0.5);
  --shadow-glow-emerald: 0 0 25px rgba(0, 255, 157, 0.35);

  /* Glassmorphism & Backdrop */
  --glass-blur: blur(16px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-border-cyan: 1px solid rgba(0, 240, 255, 0.3);

  /* Spacing & Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Motion & Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   LIGHT THEME DESIGN SYSTEM (SURGICAL HIGH-TECH WHITE & ROYAL BLUE)
   ========================================================================== */
[data-theme="light"] {
  /* Pristine Engineering Base */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.85);

  /* Primary Brand & Industrial Laser Colors */
  --color-brand-blue: #0834ac;
  --color-brand-blue-light: #1d4ed8;
  --color-laser-cyan: #0284c7;
  --color-laser-cyan-dim: rgba(2, 132, 199, 0.08);
  --color-laser-cyan-glow: rgba(2, 132, 199, 0.25);

  /* Status Indicators */
  --color-status-active: #059669;
  --color-status-active-glow: rgba(5, 150, 105, 0.2);
  --color-status-warning: #d97706;
  --color-status-warning-glow: rgba(217, 119, 6, 0.2);
  --color-status-danger: #dc2626;
  --color-status-danger-glow: rgba(220, 38, 38, 0.2);
  --color-status-idle: #64748b;

  /* High-Contrast Crisp Typography */
  --text-white: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-cyan: #0284c7;

  /* Crisp Borders & Light Grid */
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-cyan: rgba(8, 52, 172, 0.28);
  --border-active: rgba(5, 150, 105, 0.4);
  --grid-line: rgba(8, 52, 172, 0.04);
  --grid-line-bright: rgba(8, 52, 172, 0.08);

  /* Clean Shadows for Layered Architecture */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
  --shadow-glow-cyan: 0 6px 25px rgba(2, 132, 199, 0.15);
  --shadow-glow-blue: 0 6px 25px rgba(8, 52, 172, 0.12);
  --shadow-glow-emerald: 0 6px 25px rgba(5, 150, 105, 0.15);

  --glass-border: 1px solid rgba(15, 23, 42, 0.08);
  --glass-border-cyan: 1px solid rgba(8, 52, 172, 0.25);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ==========================================================================
   GENERALIZED INDUSTRIAL TYPOGRAPHY SYSTEM (SPACE GROTESK & JETBRAINS MONO)
   ========================================================================== */

/* Headings — Space Grotesk with subtle modern tracking */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-white);
  line-height: 1.2;
}

/* Navigation Links — Geometric & Crisp Space Grotesk */
.nav-link,
.nav-menu a {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Interactive Action Buttons & Tabs — Space Grotesk */
.btn,
.filter-tab,
.twin-control-btn,
.modal-content button[type="submit"] {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Large Numbers & Telemetry Counters — Space Grotesk */
.hero-stat-num,
.nesting-yield-val,
.gauge-value,
.stat-counter-num,
.roi-payback-val {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* High-Tech Industrial Micro-Typography — JetBrains Mono */
.hero-badge-live,
.top-hud-bar,
.hud-btn,
.section-tag,
.status-pill,
.hud-tag,
.brand-subtitle,
.gauge-header,
.gauge-unit,
.scroll-explore-indicator,
.inspector-item-label,
.inspector-item-val,
.mqtt-log-line {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* Background Grid */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient Radial Glows */
body::after {
  content: "";
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 600px;
  background: radial-gradient(circle, rgba(8, 52, 172, 0.25) 0%, rgba(0, 240, 255, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::after {
  background: radial-gradient(circle, rgba(8, 52, 172, 0.08) 0%, rgba(2, 132, 199, 0.03) 40%, transparent 70%);
}

/* Selection */
::selection {
  background-color: var(--color-laser-cyan);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-laser-cyan);
}
