/* ============================================
   Pinnacle Auto — Base Design Tokens
   Steel Horizon Theme — Dark Only
   ============================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  line-height: 1.6;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Design Tokens --- */
:root {
  /* Colors — Steel Horizon Palette (Lighter) */
  --bg: #141c2b;
  --surface: #1a2438;
  --surface-2: #212d42;
  --border: #334155;
  --border-light: rgba(51, 65, 85, 0.5);

  --text: #eef2f7;
  --text-muted: #a0b1c5;
  --text-faint: #6b7f96;

  --primary: #7ab4d4;
  --primary-hover: #92c8e5;
  --primary-dim: rgba(122, 180, 212, 0.15);

  --cta: #3b82f6;
  --cta-hover: #60a5fa;
  --cta-dim: rgba(59, 130, 246, 0.15);

  --error: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  /* Typography Scale — fluid clamp */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);       /* 11-12px */
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);     /* 13-14px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);         /* 15-16px */
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);         /* 17-18px */
  --text-xl: clamp(1.1875rem, 1.1rem + 0.4vw, 1.3125rem);      /* 19-21px */
  --text-2xl: clamp(1.5rem, 1.35rem + 0.65vw, 1.75rem);        /* 24-28px */
  --text-3xl: clamp(1.875rem, 1.65rem + 1vw, 2.25rem);         /* 30-36px */
  --text-4xl: clamp(2.25rem, 1.9rem + 1.5vw, 3rem);            /* 36-48px */
  --text-hero: clamp(2.75rem, 2.2rem + 2.5vw, 4.5rem);         /* 44-72px */

  /* Font Families */
  --font-display: 'Cabinet Grotesk', 'General Sans', sans-serif;
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Font Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Spacing — 4px base */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 30px rgba(122, 180, 212, 0.2);
  --shadow-cta-glow: 0 0 30px rgba(59, 130, 246, 0.3);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* Layout */
  --container-max: 1320px;
  --container-wide: 1440px;
  --container-narrow: 720px;
  --nav-height: 72px;

  /* Z-index layers */
  --z-base: 1;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* --- Base Body --- */
body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

/* --- Typography Base --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: 1.7;
  color: var(--text-muted);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* --- Selection --- */
::selection {
  background: var(--primary-dim);
  color: var(--text);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
