:root {
  --bg: #050505;
  --bg-alt: #0c0c0d;
  --surface: #121214;
  --surface-2: #19191c;
  --border: #242428;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #c8f560;
  --accent-ink: #0a0a0a;
  --danger: #f87171;

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); max-width: 18ch; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 16px; }

.eyebrow {
  font-size: .8125rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .14em; color: var(--accent); margin-bottom: 16px;
}
.muted { color: var(--text-dim); }
.lead { color: var(--text-muted); font-size: 1.0625rem; max-width: 46ch; margin-top: 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: .9375rem; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); background: #d6ff78; }
.btn:active { transform: scale(.97); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface); border-color: #3a3a40; }
.btn--small { min-height: 40px; padding: 0 18px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: progress; transform: none; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 5, 5, .72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-color: var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; letter-spacing: .18em; font-size: 1rem;
}
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 10px 14px; border-radius: 999px;
  font-size: .9rem; color: var(--text-muted); transition: color .2s, background-color .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface); }
.nav__toggle {
  display: none; width: 44px; height: 44px; margin-left: auto;
  background: none; border: 0; cursor: pointer; position: relative;
}
.nav__toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text);
  transition: transform .25s var(--ease);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Hero */
.hero { position: relative; padding: 140px 0 80px; overflow: hidden; }
.hero__glow {
  position: absolute; left: 50%; top: 42%; width: 1100px; height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(200, 245, 96, .12), transparent 70%);
  pointer-events: none;
}
.hero__content { position: relative; text-align: center; }
.hero__title { font-size: clamp(3rem, 9vw, 7rem); font-weight: 700; letter-spacing: -0.04em; }
.hero__lead { color: var(--text-muted); font-size: 1.125rem; max-width: 52ch; margin: 24px auto 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 36px; }

.hero__car { position: relative; max-width: 960px; margin: 48px auto 0; padding: 0 24px; }
.car { display: block; width: 100%; height: auto; }
.car-head { fill: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.car-tail { fill: #ef4444; }
.car-body { transition: color .5s var(--ease); }
.hero__road {
  height: 2px; margin-top: -4px;
  background: linear-gradient(90deg, transparent, #3a3a40 20%, #3a3a40 80%, transparent);
}
.hero__car::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -10px; height: 30px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .9), transparent);
  z-index: -1;
}

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 72px 0 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--border); gap: 1px;
}
.stat { background: var(--bg); padding: 28px 24px; }
.stat dt { color: var(--text-dim); font-size: .8125rem; }
.stat dd {
  margin: 6px 0 0; font-family: var(--font-head); font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat small { font-size: .5em; color: var(--text-muted); margin-left: 4px; font-weight: 500; }

/* Sections */
.section { padding: 120px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { margin-bottom: 56px; }

.grid--features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: border-color .25s, transform .25s var(--ease);
}
.card:hover { border-color: #3a3a40; transform: translateY(-3px); }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(200, 245, 96, .1); color: var(--accent); margin-bottom: 24px;
}
.card__icon svg { width: 22px; height: 22px; }
.card p { color: var(--text-muted); font-size: .9375rem; margin-top: 10px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }

/* Range calculator */
.calc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px;
}
.calc__result {
  font-family: var(--font-head); font-size: clamp(3rem, 7vw, 4.5rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums;
}
.calc__result small { font-size: .35em; color: var(--text-muted); margin-left: 8px; font-weight: 500; }
.calc__bar { height: 6px; background: var(--surface-2); border-radius: 99px; margin: 20px 0 32px; overflow: hidden; }
.calc__fill {
  height: 100%; width: 100%; background: var(--accent); border-radius: inherit;
  transform-origin: left; transition: transform .4s var(--ease);
}
.field + .field { margin-top: 24px; }
.field__row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .9375rem; }
.field__row output { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.field__label { display: block; font-size: .9375rem; margin-bottom: 10px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--surface-2); border-radius: 99px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--surface-2); border-radius: 99px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--border);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--border);
}

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.segmented button {
  min-height: 44px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: .875rem; font-weight: 500;
  transition: background-color .2s, color .2s;
}
.segmented button[aria-checked="true"] { background: var(--text); color: var(--bg); }

/* Configurator */
.config {
  background: radial-gradient(ellipse at 50% 70%, #1a1a1d, var(--bg-alt) 70%);
  border: 1px solid var(--border); border-radius: 24px; padding: 48px 32px 32px;
}
.config__stage { max-width: 760px; margin: 0 auto; }
.config__controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.config__name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 500; }
.swatches { display: flex; gap: 12px; }
.swatch {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--c); border: 2px solid var(--bg-alt);
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow .2s, transform .2s var(--ease);
}
.swatch:hover { transform: scale(1.06); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--text); }

/* Specs */
.specs { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--border); }
.specs div { padding: 20px 0; border-bottom: 1px solid var(--border); }
.specs div:nth-child(odd) { padding-right: 24px; }
.specs dt { color: var(--text-dim); font-size: .8125rem; }
.specs dd { margin: 4px 0 0; font-weight: 500; }

/* Reserve */
.reserve { position: relative; overflow: hidden; }
.reserve::before {
  content: ""; position: absolute; left: 50%; bottom: -320px; width: 900px; height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(200, 245, 96, .1), transparent);
  pointer-events: none;
}
.reserve__inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.reserve .lead { margin-inline: auto; }
.form { display: flex; gap: 12px; width: 100%; max-width: 480px; margin-top: 40px; align-items: flex-start; }
.form__field { flex: 1; text-align: left; }
.form label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.form input {
  width: 100%; min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit;
  transition: border-color .2s;
}
.form input::placeholder { color: var(--text-dim); }
.form input:focus { outline: none; border-color: var(--accent); }
.form input[aria-invalid="true"] { border-color: var(--danger); }
.form__error { color: var(--danger); font-size: .8125rem; margin: 8px 0 0 20px; min-height: 1em; }
.form__error:empty { display: none; }
.form__success {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 40px;
  padding: 14px 22px; border-radius: 999px; background: rgba(200, 245, 96, .1); color: var(--accent);
  font-weight: 500;
}
.form[hidden],
.form__success[hidden] { display: none; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer__note { color: var(--text-dim); font-size: .8125rem; width: 100%; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer__links a,
.footer__links button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: .875rem; transition: color .2s;
}
.footer__links a:hover,
.footer__links button:hover { color: var(--text); }

.form__legal { color: var(--text-dim); font-size: .8125rem; max-width: 480px; margin-top: 16px; }
.form__legal[hidden] { display: none; }
.form__legal a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.form__legal a:hover { color: var(--text); }

/* Legal pages */
.legal-header { border-bottom: 1px solid var(--border); }
.legal-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-muted); font-size: .9rem; }
.legal-back:hover { color: var(--text); }
.legal { max-width: 760px; margin: 0 auto; padding: 72px 24px 120px; }
.legal h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.legal__meta { color: var(--text-dim); font-size: .875rem; margin-top: 12px; }
.legal h2 { font-size: 1.5rem; max-width: none; margin: 56px 0 16px; scroll-margin-top: 24px; }
.legal h3 { font-size: 1.0625rem; margin: 28px 0 10px; }
.legal p, .legal li { color: var(--text-muted); }
.legal p + p { margin-top: 14px; }
.legal ul { padding-left: 20px; margin: 12px 0; }
.legal li + li { margin-top: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal .toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-top: 40px;
}
.legal .toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.legal .toc li { margin: 0 0 6px; break-inside: avoid; }
.legal .toc a { color: var(--text-muted); text-decoration: none; }
.legal .toc a:hover { color: var(--text); }
.legal .notice {
  border-left: 3px solid var(--accent); background: var(--surface);
  padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 32px;
}
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.legal table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 560px; }
.legal th, .legal td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { color: var(--text); font-weight: 600; background: var(--surface); }
.legal td { color: var(--text-muted); }
.legal tr:last-child td { border-bottom: 0; }

/* Cookie consent */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 720px; margin: 0 auto; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: consent-in .35s var(--ease);
}
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.125rem; max-width: none; }
.consent p { color: var(--text-muted); font-size: .875rem; margin-top: 8px; }
.consent a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.consent__actions .btn { flex: 1 1 140px; min-height: 44px; }
.consent__prefs { margin-top: 20px; border-top: 1px solid var(--border); }
.consent__prefs[hidden] { display: none; }
.pref {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.pref strong { font-size: .9375rem; font-weight: 600; }
.pref p { margin-top: 4px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; margin-top: 2px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--border); transition: background-color .2s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted); transition: transform .2s var(--ease), background-color .2s;
}
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:disabled + span { opacity: .55; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.consent__gpc { color: var(--accent) !important; }
@keyframes consent-in { from { opacity: 0; transform: translateY(16px); } }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero__car.reveal { transform: translateX(-60px); transition-duration: 1.2s; }
.hero__car.reveal.is-visible { transform: none; }

/* Responsive */
@media (max-width: 1024px) {
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .split { gap: 40px; }
}

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav nav { margin: 0; }
  .nav__cta { display: none; }
  .nav__links {
    position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 12px 16px 24px; background: rgba(5, 5, 5, .96); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s var(--ease), visibility .2s;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__links a { padding: 14px 16px; font-size: 1rem; }

  .container { padding: 0 16px; }
  .hero { padding: 120px 0 64px; }
  .hero__car { padding: 0 8px; }
  .stats { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .section { padding: 80px 0; }
  .section__head { margin-bottom: 40px; }
  .split { grid-template-columns: 1fr; }
  .calc { padding: 24px; }
  .config { padding: 32px 16px 20px; }
  .config__controls { flex-direction: column; align-items: flex-start; }
  .form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 560px) {
  .grid--features { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr; }
  .specs div:nth-child(odd) { padding-right: 0; }
  .legal { padding: 48px 16px 80px; }
  .legal .toc ol { columns: 1; }
  .consent { left: 8px; right: 8px; bottom: 8px; padding: 20px 16px; }
  .swatches { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal, .hero__car.reveal { opacity: 1; transform: none; }
}
