/* ============================================================
   Aeroflow Dynamics — Rivian-inspired premium automotive system
   ============================================================ */
:root {
  --ink: #0B0F14;
  --carbon: #171C24;
  --carbon-2: #232936;
  --alloy: #8A95A3;
  --alloy-2: #B7BFCA;
  --bone: #F4F1EC;
  --pure: #FFFFFF;
  --volt: #D9FF3B;
  --ember: #FF5C2A;
  --edge: rgba(255,255,255,.08);
  --edge-strong: rgba(255,255,255,.18);

  --r: 0px;
  --r-sm: 2px;
  --shadow: 0 30px 80px -20px rgba(0,0,0,.55);

  --pad: clamp(20px, 4vw, 80px);
  --maxw: 1440px;

  --t-1: clamp(11px, .8vw, 12px);
  --t-2: clamp(13px, .9vw, 14px);
  --t-3: clamp(15px, 1vw, 16px);
  --t-4: clamp(18px, 1.3vw, 20px);
  --t-5: clamp(22px, 1.8vw, 28px);
  --t-6: clamp(32px, 3.4vw, 56px);
  --t-7: clamp(48px, 6.5vw, 104px);
  --t-8: clamp(64px, 9vw, 152px);

  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: var(--ink);
  color: var(--bone);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }
ul { list-style: none; }
section { padding: clamp(60px, 9vw, 140px) var(--pad); }

/* ============= TYPOGRAPHY PRIMITIVES ============= */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: var(--t-6); }
h3 { font-size: var(--t-5); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-1); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--alloy);
  padding-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--alloy); display: inline-block;
}
.eyebrow--light { color: var(--alloy-2); }
.eyebrow--light::before { background: var(--alloy-2); }
.eyebrow--accent { color: var(--volt); }
.eyebrow--accent::before { background: var(--volt); }
.link { color: var(--alloy-2); font-size: var(--t-3); transition: color .25s var(--ease); }
.link:hover { color: var(--pure); }

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: var(--t-3); font-weight: 500; letter-spacing: -0.01em;
  padding: 16px 28px; border-radius: var(--r);
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--volt); color: var(--ink); }
.btn--primary:hover { background: var(--pure); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--bone); border: 1px solid var(--edge-strong); }
.btn--ghost:hover { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn--mini { padding: 10px 16px; font-size: var(--t-2); background: var(--ink); color: var(--bone); border: 1px solid var(--edge-strong); }
.btn--mini:hover { background: var(--volt); color: var(--ink); border-color: var(--volt); }
.btn--full { width: 100%; }

.iconbtn {
  position: relative; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--bone);
  transition: background .25s var(--ease);
}
.iconbtn:hover { background: var(--carbon-2); }
.iconbtn--cart .cart-count {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--volt); color: var(--ink);
  border-radius: 8px; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ============= UTILITY BAR ============= */
.utility {
  background: var(--volt); color: var(--ink);
  text-align: center; padding: 10px 20px;
  font-size: var(--t-2); font-weight: 500;
  position: relative; overflow: hidden;
}
.utility span { display: none; animation: fadein .6s var(--ease); }
.utility span:first-child { display: inline; }

/* ============= NAV ============= */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 40px;
  padding: 18px var(--pad);
  background: rgba(11,15,20,.78);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--edge);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: var(--t-3); letter-spacing: 0.14em;
}
.nav__brand em { font-style: normal; color: var(--alloy-2); font-weight: 500; }
.nav__links { display: flex; gap: 32px; margin-left: 24px; }
.nav__links a {
  font-size: var(--t-2); color: var(--alloy-2);
  transition: color .25s var(--ease);
  font-weight: 500;
}
.nav__links a:hover { color: var(--pure); }
.nav__cta { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ============= HERO ============= */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  padding: clamp(80px, 14vw, 200px) var(--pad) clamp(60px, 10vw, 120px);
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(217,255,59,0.10), transparent 60%), var(--ink);
}
.hero__media { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--edge) 1px, transparent 1px),
    linear-gradient(90deg, var(--edge) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 60%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 60%, #000 30%, transparent 80%);
  opacity: .6;
}
.hero__glow {
  position: absolute; left: 50%; bottom: -20%;
  width: 80vw; height: 60vw; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(217,255,59,0.18), transparent 60%);
  filter: blur(40px);
}
.hero__content { position: relative; z-index: 2; max-width: 1100px; }
.hero__title {
  font-size: var(--t-8);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance;
}
.hero__title--accent { color: var(--alloy-2); font-weight: 300; }
.hero__sub {
  max-width: 640px; margin-top: 28px;
  font-size: var(--t-4); color: var(--alloy-2); line-height: 1.45;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 80px; gap: 24px;
  border-top: 1px solid var(--edge);
  padding-top: 32px;
}
.hero__stats > div { display: flex; flex-direction: column; gap: 4px; }
.hero__stats strong { font-size: var(--t-5); font-weight: 600; letter-spacing: -0.02em; }
.hero__stats span { font-size: var(--t-2); color: var(--alloy); font-family: 'JetBrains Mono', monospace; }
.hero__scroll {
  position: absolute; right: var(--pad); bottom: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-1); color: var(--alloy);
  letter-spacing: 0.2em; text-transform: uppercase;
}

/* ============= FINDER ============= */
.finder {
  background: var(--bone); color: var(--ink);
  padding: clamp(60px, 8vw, 100px) var(--pad);
}
.finder__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px; align-items: center;
}
.finder__copy h2 { color: var(--ink); }
.finder__copy p { margin-top: 16px; color: #4a5564; max-width: 480px; font-size: var(--t-4); }
.finder__copy .eyebrow { color: #4a5564; }
.finder__copy .eyebrow::before { background: #4a5564; }
.finder__form {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px;
  align-items: end;
}
.finder__form label { display: flex; flex-direction: column; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: var(--t-1); text-transform: uppercase; letter-spacing: 0.18em; color: #4a5564; }
.finder__form select {
  font-family: inherit; font-size: var(--t-3); padding: 16px 18px;
  border: 1px solid #c9cdd2; background: var(--pure); color: var(--ink);
  appearance: none; border-radius: var(--r);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B0F14' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
  padding-right: 44px;
  transition: border-color .25s var(--ease);
}
.finder__form select:focus { outline: none; border-color: var(--ink); }
.finder__form .btn--primary { background: var(--ink); color: var(--bone); padding: 16px 28px; }
.finder__form .btn--primary:hover { background: var(--volt); color: var(--ink); }

/* ============= SECTION HEAD ============= */
.section__head {
  display: flex; justify-content: space-between; align-items: end; gap: 30px;
  margin-bottom: 60px; flex-wrap: wrap;
}

/* ============= COLLECTIONS ============= */
.collections__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 360px);
  gap: 12px;
}
.collection {
  position: relative; overflow: hidden;
  background-image: var(--img);
  background-size: cover; background-position: center;
  border: 1px solid var(--edge);
  transition: transform .6s var(--ease);
  isolation: isolate;
}
.collection::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,15,20,.15) 0%, rgba(11,15,20,.85) 100%);
  transition: background .4s var(--ease); z-index: 1;
}
.collection:hover::after { background: linear-gradient(180deg, rgba(11,15,20,.05) 0%, rgba(11,15,20,.7) 100%); }
.collection:hover { transform: scale(1.005); }
.collection__meta {
  position: absolute; left: 32px; right: 32px; bottom: 32px; z-index: 2;
}
.collection__meta h3 { font-size: var(--t-5); margin-top: 6px; }
.collection__meta p { color: var(--alloy-2); margin-top: 10px; max-width: 32ch; font-size: var(--t-3); }
.collection__cta {
  display: inline-block; margin-top: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-1); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bone); border-bottom: 1px solid var(--edge-strong);
  padding-bottom: 6px; transition: border-color .25s var(--ease), color .25s var(--ease);
}
.collection:hover .collection__cta { color: var(--volt); border-color: var(--volt); }
.collection--lg { grid-column: span 2; grid-row: span 2; }
.collection--sale { grid-column: span 2; }

/* ============= BEST SELLERS GRID ============= */
.bestsellers { background: var(--ink); }
.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(4, 1fr);
}
.card {
  background: var(--carbon);
  border: 1px solid var(--edge);
  transition: transform .4s var(--ease), border-color .3s var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--edge-strong); }
.card__media {
  aspect-ratio: 4/3; position: relative;
  background-color: #1c2230;
  background-size: cover; background-position: center;
  border-bottom: 1px solid var(--edge);
}
.badge {
  position: absolute; top: 14px; left: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 6px 10px;
  background: var(--bone); color: var(--ink);
}
.badge--bestseller { background: var(--volt); }
.badge--new { background: var(--pure); }
.badge--sale { background: var(--ember); color: var(--pure); }
.badge--flag { background: var(--ink); color: var(--volt); border: 1px solid var(--volt); }
.card__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__fit {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-1); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--alloy);
}
.card__title { font-size: var(--t-4); line-height: 1.25; }
.card__row {
  margin-top: auto; padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--edge);
}
.card__price { font-weight: 600; font-size: var(--t-4); }
.card__price s { color: var(--alloy); font-weight: 400; font-size: var(--t-2); margin-left: 8px; }

/* ============= STORY ============= */
.story {
  background: var(--ink); position: relative; overflow: hidden;
}
.story::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(217,255,59,0.08), transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(255,255,255,0.04), transparent 60%);
  pointer-events: none;
}
.story__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; }
.story__title { max-width: 18ch; }
.story__title span { color: var(--alloy-2); font-weight: 300; }
.story__grid-content {
  margin-top: 80px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px;
  padding-top: 40px; border-top: 1px solid var(--edge);
}
.story__pillar { display: flex; flex-direction: column; gap: 12px; }
.story__num { font-family: 'JetBrains Mono', monospace; color: var(--volt); font-size: var(--t-2); letter-spacing: 0.18em; }
.story__pillar h3 { font-size: var(--t-4); }
.story__pillar p { color: var(--alloy-2); font-size: var(--t-3); }

/* ============= DIY ============= */
.diy { background: var(--carbon); }
.diy__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.diy__card {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background-size: cover; background-position: center;
  border: 1px solid var(--edge);
  transition: transform .5s var(--ease);
}
.diy__card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,15,20,.0) 35%, rgba(11,15,20,.9) 100%);
}
.diy__card:hover { transform: scale(1.01); }
.diy__card .play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.95); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; padding-left: 4px;
  z-index: 2; transition: transform .3s var(--ease), background .3s var(--ease);
}
.diy__card:hover .play { transform: translate(-50%,-50%) scale(1.08); background: var(--volt); }
.diy__meta { position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 2; }
.diy__meta h3 { font-size: var(--t-4); }

/* ============= REVIEWS ============= */
.reviews { background: var(--ink); }
.reviews__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.review {
  background: var(--carbon);
  border: 1px solid var(--edge);
  padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.stars { color: var(--volt); font-size: var(--t-4); letter-spacing: 2px; }
.review blockquote { font-size: var(--t-4); line-height: 1.4; }
.review figcaption { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.review figcaption strong { font-weight: 600; }
.review figcaption span { font-family: 'JetBrains Mono', monospace; font-size: var(--t-1); color: var(--alloy); letter-spacing: 0.18em; text-transform: uppercase; }

/* ============= NEWSLETTER ============= */
.newsletter {
  background: linear-gradient(135deg, var(--volt), #BCE52A);
  color: var(--ink);
  padding: clamp(80px, 10vw, 140px) var(--pad);
}
.newsletter__inner { max-width: 800px; margin: 0 auto; text-align: center; }
.newsletter__inner h2 { color: var(--ink); text-wrap: balance; }
.newsletter__inner p { margin-top: 16px; font-size: var(--t-4); color: rgba(11,15,20,0.7); }
.newsletter__form {
  margin-top: 36px; display: flex; gap: 10px;
  max-width: 520px; margin-left: auto; margin-right: auto;
}
.newsletter__form input {
  flex: 1; padding: 18px 22px; font: inherit; font-size: var(--t-3);
  background: var(--pure); border: 1px solid var(--ink);
  color: var(--ink);
}
.newsletter__form input:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.newsletter__form .btn--primary { background: var(--ink); color: var(--bone); }
.newsletter__form .btn--primary:hover { background: var(--pure); color: var(--ink); }

/* ============= FOOTER ============= */
.footer { background: #06090C; color: var(--alloy-2); padding: clamp(60px, 8vw, 120px) var(--pad) 36px; }
.footer__top { display: grid; grid-template-columns: 1.2fr 2fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid var(--edge); }
.footer__brand .nav__brand { font-size: var(--t-4); }
.footer__brand p { margin-top: 20px; font-size: var(--t-3); max-width: 38ch; }
.footer__since { color: var(--alloy); font-size: var(--t-2) !important; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em; margin-top: 18px !important; }
.footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.footer__cols h4 { font-size: var(--t-2); text-transform: uppercase; letter-spacing: 0.18em; color: var(--bone); margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.footer__cols a { font-size: var(--t-3); line-height: 2; transition: color .25s var(--ease); }
.footer__cols a:hover { color: var(--pure); }
.footer__bottom { padding-top: 32px; display: flex; justify-content: space-between; font-size: var(--t-2); color: var(--alloy); flex-wrap: wrap; gap: 12px; }

/* ============= CART DRAWER ============= */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  background: var(--carbon); color: var(--bone);
  border-left: 1px solid var(--edge);
  transform: translateX(105%);
  transition: transform .45s var(--ease);
  z-index: 100;
  display: flex; flex-direction: column;
}
.drawer[data-open] { transform: translateX(0); }
.drawer__head { padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--edge); }
.drawer__body { flex: 1; overflow: auto; padding: 24px; }
.drawer__empty { color: var(--alloy); font-size: var(--t-3); text-align: center; padding: 60px 0; }
.drawer__foot { padding: 24px; border-top: 1px solid var(--edge); display: flex; flex-direction: column; gap: 14px; }
.drawer__total { display: flex; justify-content: space-between; font-size: var(--t-4); }
.drawer__foot small { color: var(--alloy); font-size: var(--t-1); text-align: center; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em; }
.drawer__scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s;
  z-index: 99;
}
.drawer__scrim[data-open] { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.cart-line { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--edge); align-items: center; }
.cart-line__img { width: 60px; height: 60px; background: var(--ink); background-size: cover; background-position: center; }
.cart-line__name { font-size: var(--t-3); }
.cart-line__price { font-weight: 600; }

/* ============= ANIMATIONS ============= */
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============= RESPONSIVE ============= */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .collections__grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 300px); }
  .collection--lg { grid-column: span 2; grid-row: span 2; }
  .collection--sale { grid-column: span 2; }
  .grid, .diy__grid, .reviews__grid { grid-template-columns: repeat(2, 1fr); }
  .story__grid-content { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .finder__inner { grid-template-columns: 1fr; gap: 32px; }
  .finder__form { grid-template-columns: 1fr 1fr; }
  .finder__form .btn--primary { grid-column: span 2; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid, .diy__grid, .reviews__grid, .collections__grid { grid-template-columns: 1fr; }
  .collection--lg, .collection--sale { grid-column: span 1; }
  .collections__grid { grid-template-rows: repeat(5, 280px); }
  .story__grid-content { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .finder__form { grid-template-columns: 1fr; }
  .finder__form .btn--primary { grid-column: 1; }
  .nav__cta .iconbtn:not(.iconbtn--cart) { display: none; }
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .newsletter__form { flex-direction: column; }
}
