/* ============ Tokens ============ */
:root {
  --black: #000;
  --ink: #0b0b0c;
  --ink-2: #141416;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f4f4;
  --muted: #a2a3a6;
  --dark-text: #171a20;
  --dark-muted: #5c5e62;
  --light: #f4f4f4;
  --light-2: #ffffff;
  --gas: #a8a46a;
  --gas-soft: rgba(168, 164, 106, 0.35);
  --radius: 4px;
  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

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

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; }
p { margin: 0; }
q { quotes: "\201C" "\201D"; }

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

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  height: 44px;
  padding: 0 28px;
  border-radius: var(--radius);
  border: 0;
  font: 500 14px/1 var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.33s var(--ease), color 0.33s var(--ease), transform 0.2s var(--ease), box-shadow 0.33s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--gas); outline-offset: 3px; }

.btn-primary { background: var(--light); color: var(--dark-text); }
.btn-primary:hover { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.16); }

.btn-dark { background: var(--dark-text); color: #fff; }
.btn-dark:hover { background: #000; }

.btn-nav {
  min-width: 0;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.btn-nav:hover { background: var(--light); color: var(--dark-text); }

/* ============ Nav ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.42em;
}
.brand img {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background-color 0.33s var(--ease);
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.1); }

.nav-right { display: flex; align-items: center; gap: 8px; }

.menu-btn {
  display: none;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font: 500 13px/1 var(--font);
  cursor: pointer;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + clamp(28px, 7vh, 72px)) 16px clamp(28px, 5vh, 48px);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.car-wrap {
  position: absolute;
  top: 52%;
  left: 50%;
  height: 112%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
}
.car-wrap.shake { animation: shake 0.6s var(--ease); }

.car {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 22%, #000 80%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 70%, transparent 96%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(90deg, transparent 0%, #000 22%, #000 80%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 70%, transparent 96%);
          mask-composite: intersect;
  animation: carIn 2.2s var(--ease) both;
}

@keyframes carIn {
  from { opacity: 0; transform: scale(1.04); filter: brightness(0.6); }
  to   { opacity: 1; transform: scale(1); filter: brightness(1); }
}

@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%); }
  15% { transform: translate(calc(-50% - 3px), calc(-50% + 1px)); }
  30% { transform: translate(calc(-50% + 3px), calc(-50% - 1px)); }
  45% { transform: translate(calc(-50% - 2px), -50%); }
  60% { transform: translate(calc(-50% + 2px), calc(-50% + 1px)); }
  80% { transform: translate(calc(-50% - 1px), -50%); }
}

/* drifting smoke that continues the cloud past the photo's edge */
.cloud-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cloud-ambient span {
  position: absolute;
  left: 74%;
  top: 44%;
  width: 30%;
  aspect-ratio: 1.3;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(140, 136, 84, 0.26) 0%, rgba(120, 116, 70, 0.1) 45%, transparent 70%);
  filter: blur(34px);
  opacity: 0;
  animation: drift 14s linear infinite;
}
.cloud-ambient span:nth-child(2) { animation-delay: -3.5s; top: 40%; width: 40%; }
.cloud-ambient span:nth-child(3) { animation-delay: -7s; top: 50%; width: 30%; }
.cloud-ambient span:nth-child(4) { animation-delay: -10.5s; top: 36%; width: 44%; }

@keyframes drift {
  0%   { transform: translate(-20%, 0) scale(0.6); opacity: 0; }
  15%  { opacity: 0.85; }
  100% { transform: translate(90%, -45%) scale(1.6); opacity: 0; }
}

/* test-drive puffs */
.puffs { position: absolute; inset: 0; pointer-events: none; }
.puff {
  position: absolute;
  left: 73%;
  top: 56%;
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(146, 138, 88, 0.6) 0%, rgba(118, 110, 70, 0.28) 45%, transparent 70%);
  filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.3);
  animation: puff var(--dur, 2.4s) var(--ease) forwards;
}
@keyframes puff {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--s, 3)); }
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 26%),
    linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 34%);
  pointer-events: none;
}

.hero-copy h1 {
  font-size: clamp(36px, 5.6vw, 64px);
  font-weight: 500;
}
.hero-sub {
  margin-top: 12px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: #d0d1d2;
}

.hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 100%;
}

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(28px, 6vw, 72px);
}
.hero-stats li { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.1;
}
.hero-stats small { font-size: 0.6em; margin-left: 2px; font-weight: 400; }
.hero-stats span { font-size: 13px; color: var(--muted); margin-top: 4px; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.emission-count {
  min-height: 1.4em;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gas);
  margin-top: -6px;
}

/* ============ Sections ============ */
section { position: relative; }

.section-head {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 0 16px;
}
.section-head.left { text-align: left; margin: 0; padding: 0; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 48px); }
.lede {
  margin-top: 16px;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--muted);
}

.light { background: var(--light); color: var(--dark-text); }
.light .eyebrow,
.light .lede { color: var(--dark-muted); }

/* ============ Story ============ */
.story {
  background: linear-gradient(180deg, #000 0%, var(--ink) 100%);
  padding: clamp(96px, 14vh, 160px) 0 clamp(40px, 8vh, 80px);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  max-width: 1280px;
  margin: clamp(48px, 8vh, 96px) auto 0;
  padding: 0 clamp(16px, 4vw, 48px);
}

.story-visual {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  height: calc(100vh - var(--nav-h) - 48px);
  display: flex;
  align-items: center;
}
.story-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #050505;
  box-shadow: 0 0 0 1px var(--line), 0 40px 120px rgba(0, 0, 0, 0.6);
}
.story-img {
  position: absolute;
  inset: 0;
  background-image: url("assets/roadster.jpg");
  background-repeat: no-repeat;
  background-size: 230%;
  background-position: 12% 58%;
  transition: background-size 1.4s var(--ease), background-position 1.4s var(--ease);
}
.story-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, transparent 30%);
  pointer-events: none;
}
.story-caption {
  position: absolute;
  left: 20px;
  bottom: 16px;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #cfd0d1;
}
.story-caption span:first-child { color: var(--gas); margin-right: 8px; letter-spacing: 0.18em; text-transform: uppercase; }

.chapters { display: flex; flex-direction: column; }

.chapter {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
  opacity: 0.28;
  transition: opacity 0.7s var(--ease);
}
.chapter.active { opacity: 1; }

.chapter-media { display: none; }

.chapter-no {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--gas);
  margin-bottom: 18px;
}
.chapter-no::after {
  content: "";
  display: inline-block;
  width: 48px;
  height: 1px;
  margin-left: 14px;
  vertical-align: middle;
  background: var(--gas-soft);
}
.chapter h3 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }
.chapter p { font-size: 17px; line-height: 1.75; color: #c4c5c7; max-width: 520px; }
.chapter p em, .chapter p strong { color: var(--text); font-style: normal; font-weight: 500; }

/* ============ Features ============ */
.features { padding: clamp(96px, 14vh, 160px) clamp(16px, 4vw, 48px); }

.feature-grid {
  max-width: 1200px;
  margin: clamp(48px, 7vh, 80px) auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature {
  background: var(--light-2);
  border-radius: var(--radius);
  padding: 36px 32px 40px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(23, 26, 32, 0.08); }
.feature-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7d7a45;
  margin-bottom: 22px;
}
.feature h3 { font-size: 22px; margin-bottom: 12px; }
.feature p { color: var(--dark-muted); font-size: 15px; line-height: 1.65; }

/* ============ Specs ============ */
.specs {
  background: #000;
  padding: clamp(96px, 14vh, 160px) clamp(16px, 4vw, 48px);
}
.specs-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.specs-media img {
  width: 100%;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 50%, transparent 100%);
}

.spec-table { margin: 36px 0 40px; }
.spec-table div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.spec-table div:first-child { border-top: 1px solid var(--line); }
.spec-table dt { color: var(--muted); font-size: 14px; }
.spec-table dd { margin: 0; font-size: 15px; font-weight: 500; text-align: right; }

/* ============ How to buy ============ */
.howto { padding: clamp(96px, 14vh, 160px) clamp(16px, 4vw, 48px); }

.steps {
  list-style: none;
  padding: 0;
  max-width: 1200px;
  margin: clamp(48px, 7vh, 80px) auto 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.step {
  background: var(--light-2);
  border-radius: var(--radius);
  padding: 32px 28px 36px;
}
.step-no {
  display: block;
  font-size: 40px;
  font-weight: 300;
  color: #b7b48a;
  line-height: 1;
  margin-bottom: 28px;
}
.step h3 { font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--dark-muted); font-size: 15px; line-height: 1.65; }

.center { text-align: center; }

/* ============ Finale ============ */
.finale {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding: clamp(96px, 14vh, 140px) 16px 120px;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}
.finale-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.finale-bg img {
  position: absolute;
  left: 50%;
  top: 60%;
  height: 100%;
  width: auto;
  max-width: none;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%) scale(1.08);
  transition: transform 6s var(--ease);
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 22%, #000 80%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 70%, transparent 96%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(90deg, transparent 0%, #000 22%, #000 80%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 70%, transparent 96%);
          mask-composite: intersect;
}
.finale.in-view .finale-bg img { transform: translate(-50%, -50%) scale(1); }
.finale h2 { font-size: clamp(32px, 5vw, 60px); }
.finale .hero-cta { margin-top: 36px; }

/* ============ Footer ============ */
.footer {
  background: #000;
  border-top: 1px solid var(--line);
  padding: 48px clamp(16px, 4vw, 48px) 40px;
  font-size: 13px;
  color: var(--muted);
}
.footer-top {
  max-width: 1200px;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-top .brand { color: var(--text); font-size: 13px; }
.footer-top nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-top nav a:hover { color: var(--text); }
.disclaimer, .copy { max-width: 1200px; margin: 0 auto; line-height: 1.7; }
.disclaimer { margin-bottom: 16px; color: #75767a; }
.copy { color: #5a5b5e; }

/* ============ Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.feature-grid .reveal:nth-child(3n+2), .steps .reveal:nth-child(4n+2) { transition-delay: 0.08s; }
.feature-grid .reveal:nth-child(3n+3), .steps .reveal:nth-child(4n+3) { transition-delay: 0.16s; }
.steps .reveal:nth-child(4n+4) { transition-delay: 0.24s; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    transform: none;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 20px;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a { padding: 14px 8px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .menu-btn { display: inline-block; }

  .story-grid { grid-template-columns: 1fr; }
  .story-visual { display: none; }
  .chapter { min-height: 0; opacity: 1; padding: 0 0 64px; }
  .chapter-media {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    margin-bottom: 28px;
    background: url("assets/roadster.jpg") no-repeat;
    background-size: var(--size);
    background-position: var(--pos);
    box-shadow: 0 0 0 1px var(--line);
  }

  .specs-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .car-wrap { height: auto; width: 125vw; top: 52%; left: 58%; }
  .btn-nav { display: none; }
  .finale-bg img { height: auto; width: 125vw; left: 58%; top: 68%; }
  .btn { min-width: 0; width: 100%; }
  .hero-cta { flex-direction: column; width: 100%; max-width: 360px; gap: 12px; }
  .hero-stats span { font-size: 12px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .feature, .step { padding: 28px 24px 30px; }
  .brand { letter-spacing: 0.3em; }
  .center .btn { max-width: 360px; }
}

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