/* ═══════════════════════════════════════════════════════════════════════════
   BASE.CSS — Reset, CSS Variables, Typography, Utilities
   EV Range Guide Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  /* Colours */
  --bg:          #0a0c0e;
  --bg-1:        #111418;
  --bg-2:        #181c22;
  --bg-3:        #1c2330;
  --border:      #1e2530;
  --border-mid:  #2a3a4a;
  --faint:       #2a3040;

  --text:           #e8edf2;
  --text-secondary: #8a95a3;
  --text-muted:     #5a6474;

  --accent:      #00e5a0;
  --accent2:     #00aaff;
  --warn:        #f5a623;
  --error:       #ff4757;

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-body:    'Barlow', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Radius — deliberately angular */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* Transitions */
  --transition: 160ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.6 var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 54px; /* fixed nav height */
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

select {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ── Typography Scale ──────────────────────────────────────────────────── */
.ev-display-xl {
  font: 800 clamp(52px, 8vw, 94px)/0.92 var(--font-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.ev-display-lg {
  font: 700 clamp(28px, 4vw, 48px)/1.1 var(--font-display);
}

.ev-display-md {
  font: 600 clamp(20px, 3vw, 32px)/1.2 var(--font-display);
}

.ev-mono {
  font: 500 14px/1 var(--font-mono);
}

.ev-mono-lg {
  font: 600 18px/1 var(--font-mono);
}

.ev-body {
  font: 400 15px/1.6 var(--font-body);
  color: var(--text-secondary);
}

.ev-body-sm {
  font: 400 13px/1.5 var(--font-body);
  color: var(--text-muted);
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.ev-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.ev-section {
  padding: 72px 0;
}

.ev-section--surface {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ev-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.ev-section__title {
  font: 700 26px/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ev-section__title em {
  color: var(--accent);
  font-style: normal;
}

.ev-section__link {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
}

.ev-section__link:hover {
  color: var(--accent);
}

/* ── Accessibility ─────────────────────────────────────────────────────── */
.ev-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
  background: var(--accent);
  color: var(--bg);
  padding: 12px 24px;
  font: 600 14px/1 var(--font-display);
}

.ev-skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  z-index: 10000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Focus styles for keyboard navigation ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Selection ─────────────────────────────────────────────────────────── */
::selection {
  background: rgba(0, 229, 160, 0.25);
  color: var(--text);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ev-container {
    padding: 0 20px;
  }

  .ev-section {
    padding: 48px 0;
  }

  .ev-section__header {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 479px) {
  .ev-container {
    padding: 0 16px;
  }

  .ev-section {
    padding: 36px 0;
  }
}
