/* ============================================================
   Drive Studio — main.css
   Design tokens, reset, base typography, layout & utility classes.
   Mobile-first: base rules target ~360px; responsive.css layers
   min-width overrides on top of this file.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette */
  --bg: #F2F2F2;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #f9f9f9;
  --primary: #F20E4B;
  --primary-dim: #c20b3c;
  --secondary: #0497F2;
  --secondary-text: #0265A3;
  --accent: #0377BF;
  --accent-text: #025a91;
  --warning: #F5A448;

  /* Text (Dark on Light) */
  --text-high: rgba(0, 0, 0, 0.87);
  --text-mid: rgba(0, 0, 0, 0.60);
  --text-low: rgba(0, 0, 0, 0.38);
  --text-on-primary: #ffffff;

  /* Borders / glass */
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.24);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: 16px;

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-numeric: 'Space Grotesk', monospace;

  /* Type scale (mobile-first, responsive.css scales these up) */
  --fs-h1: clamp(2.25rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.75rem, 4vw, 3rem);
  --fs-h3: clamp(1.375rem, 2.5vw, 1.875rem);
  --fs-h4: 1.125rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

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

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-med: 300ms;
  --dur-slow: 600ms;
  --stagger-unit: 90ms;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-glow-primary: 0 8px 24px rgba(242, 14, 75, 0.3);
  --shadow-glow-accent: 0 8px 24px rgba(3, 119, 191, 0.25);

  /* Layout */
  --container-max: 1320px;
  --nav-height: 76px;
}

/* Reduced-motion users get near-instant transitions everywhere */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-med: 1ms;
    --dur-slow: 1ms;
    --stagger-unit: 0ms;
  }
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-high);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

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

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

/* Visible focus state everywhere (a11y) — never remove without replacement */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Base Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-high);
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

p {
  color: var(--text-mid);
}

.text-high {
  color: var(--text-high);
}

.text-mid {
  color: var(--text-mid);
}

.text-low {
  color: var(--text-low);
}

.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary-text);
}

.text-accent {
  color: var(--accent-text);
}

.text-warning {
  color: var(--warning);
}

.numeric,
.stat-number {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--space-6);
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-col {
  flex-direction: column;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }

/* Spacing utilities */
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); } .mb-6 { margin-bottom: var(--space-6); }
.mt-7 { margin-top: var(--space-7); } .mb-7 { margin-bottom: var(--space-7); }

/* Font-size & Weight utilities */
.fs-h1 { font-size: var(--fs-h1); }
.fs-h2 { font-size: var(--fs-h2); }
.fs-h3 { font-size: var(--fs-h3); }
.fs-base { font-size: var(--fs-base); }
.fs-xs { font-size: var(--fs-xs); }
.fs-sm { font-size: var(--fs-sm); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Padding utilities */
.pt-0 { padding-top: 0 !important; }
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }
.pb-0 { padding-bottom: 0 !important; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Display & Layout utilities */
.d-none { display: none; }
.d-block { display: block; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.mx-auto { margin-inline: auto; }

/* Image & Aspect Ratio */
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Width constraints */
.max-w-prose { max-width: 65ch; }
.max-w-md { max-width: 60ch; }
.max-w-sm { max-width: 48ch; }

/* Line-height utilities */
.lh-snug { line-height: 1.3; }
.lh-normal { line-height: 1.6; }

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ---------- Screen-reader only ---------- */
.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;
}

/* ---------- Range input ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* ---------- Section separator ---------- */
.section-divider {
  height: 1px;
  background: var(--border);
  margin-block: 0;
}

/* ---------- Toast colors (light-theme friendly) ---------- */
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-high);
}

/* ---------- Brand colors for configurator header chip ---------- */
.car-brand-chip {
  display: inline-block;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(242, 14, 75, 0.10);
  color: var(--primary);
  border: 1px solid rgba(242, 14, 75, 0.25);
}
