/* =========================================================
   TODA & iUnity Unified Design System Tokens & Base Styles
   Shared across Root Portal, Download Page, and Sub-Apps
   ========================================================= */

:root {
  /* Surface / Obsidian Charcoal Palette */
  --background: #131313;
  --on-background: #e5e2e1;
  --surface: #131313;
  --surface-dim: #131313;
  --surface-bright: #393939;

  --surface-container-lowest: #0e0e0e;
  --surface-container-low: #1c1b1b;
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  --surface-container-highest: #353534;

  --on-surface: #e5e2e1;
  --on-surface-variant: #d8c3ad;

  --outline: #a08e7a;
  --outline-variant: #534434;

  /* Primary Unity Amber Accent */
  --primary: #ffc174;
  --primary-container: #f59e0b;
  --on-primary: #472a00;
  --on-primary-container: #613b00;
  --primary-fixed: #ffddb8;
  --primary-fixed-dim: #ffb95f;
  --primary-glow: rgba(245, 158, 11, 0.3);

  /* Secondary Neutral-Cool Accent */
  --secondary: #bdc7db;
  --secondary-container: #404a5a;
  --on-secondary: #273140;
  --on-secondary-container: #afb9cc;

  /* Tertiary Electric Cyan Accent */
  --tertiary: #8fd5ff;
  --tertiary-container: #1abdff;
  --on-tertiary: #00344a;
  --cyan-glow: rgba(26, 189, 255, 0.28);

  /* Status Colors */
  --error: #ffb4ab;
  --error-container: #93000a;

  /* Border Radii */
  --radius-sm: 0.25rem;
  --radius-default: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: clamp(1rem, 2vw, 1.5rem);
  --radius-full: 9999px;

  /* Animation Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Base Body Defaults */
html {
  scroll-behavior: smooth;
  background-color: var(--background);
  color: var(--on-surface);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Blobs */
.ambient-blob {
  position: fixed;
  border-radius: var(--radius-full);
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  transition: transform 0.15s ease-out;
}

/* Highway Radar Grid Texture */
.grid-pattern {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(83, 68, 52, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 68, 52, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* Reusable Glass Card Component */
.glass-card {
  background: rgba(31, 41, 55, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(83, 68, 52, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  transition: transform var(--transition-normal), border-color var(--transition-normal), background-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* Technical Label Caps (JetBrains Mono) */
.font-label-caps {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.625rem, 0.3vw + 0.5rem, 0.75rem);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.font-label-caps .brand-lower {
  text-transform: lowercase;
}

/* Pulse Animation for Live Signal */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Spinner Animation for Loaders */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
