/* ==========================================================================
   Film Motor Group — Mercury design system
   Flat, borderless, no shadows. Elevation comes from value contrast alone:
   the graphite card sits one step lighter than the onyx canvas.
   ========================================================================== */

:root {
  /* Palette */
  --cobalt:   #5266eb;
  --cobalt-hi:#6478f0;
  --onyx:     #171721;
  --graphite: #1e1e2a;
  --obsidian: #272735;
  --slate:    #70707d;
  --mist:     #e2e3ed;
  --ash:      #c3c3cc;
  --ivory:    #ededf3;
  --white:    #ffffff;

  /* Spacing scale, 4px base */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s7: 32px;  --s8: 40px;
  --s9: 56px;  --s10: 72px; --s11: 112px; --s12: 128px;

  /* Radius */
  --r-default: 4px;
  --r-card:    12px;
  --r-control: 32px;
  --r-nav:     40px;

  --page: 1200px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Archivo', 'Inter', sans-serif;
}

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

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

body {
  background: var(--onyx);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--cobalt); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: var(--r-default);
}

/* --------------------------------------------------------------- Typography
   Major second (1.125) from a 20px base. Intermediate weights only —
   never bold, never thin, always measured. */

.t-caption   { font-size: 12px; font-weight: 400; line-height: 1;    letter-spacing: 0.01em; }
.t-body-sm   { font-size: 14px; font-weight: 400; line-height: 1;    letter-spacing: 0.005em; }
.t-body      { font-size: 16px; font-weight: 400; line-height: 1.5; }
.t-body-lg   { font-size: 18px; font-weight: 500; line-height: 1.35; }
.t-subheading{ font-size: 21px; font-weight: 350; line-height: 1.35; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; }

.t-h-sm { font-size: 28px; line-height: 1.2;  letter-spacing: 0.015em; }
.t-h    { font-size: 32px; line-height: 1.15; letter-spacing: 0.015em; }
.t-h-lg { font-size: 42px; line-height: 1.15; letter-spacing: 0.01em; }
.t-display {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 65px);
  font-weight: 500;
  line-height: 1.1;
  font-stretch: 112%;
}

.muted { color: var(--ash); }
.dim   { color: var(--slate); }

/* Small all-caps label used for spec keys and section eyebrows */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ------------------------------------------------------------------ Layout */

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--s6);
  padding-right: var(--s6);
}

.section { padding-block: var(--s10); }
.stack-4 > * + * { margin-top: var(--s4); }
.stack-6 > * + * { margin-top: var(--s6); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s6);
  margin-bottom: var(--s8);
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 23, 33, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
  height: 72px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-stretch: 112%;
}
.brand__mark { color: var(--cobalt); }

.nav { display: flex; align-items: center; gap: var(--s1); }

.nav a {
  padding: 10px var(--s4);
  border-radius: var(--r-nav);
  font-size: 14px;
  color: var(--ash);
  transition: color .18s ease, background-color .18s ease;
}
.nav a:hover { color: var(--ivory); background: var(--obsidian); }
.nav a[aria-current="page"] { color: var(--ivory); background: var(--obsidian); }

.nav-toggle {
  display: none;
  background: var(--obsidian);
  border: 0;
  border-radius: var(--r-nav);
  padding: 10px var(--s4);
  font-size: 14px;
  cursor: pointer;
}

/* ----------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 13px var(--s6);
  font-size: 16px;
  font-weight: 400;
  border: 0;
  border-radius: var(--r-control);
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn--primary { background: var(--cobalt); color: var(--white); }
.btn--primary:hover { background: var(--cobalt-hi); }

.btn--ghost {
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--ivory);
  border-radius: var(--r-nav);
}
.btn--ghost:hover { background: var(--ivory); color: var(--onyx); }

.btn--quiet { background: var(--obsidian); color: var(--ivory); }
.btn--quiet:hover { background: #30303f; }

.btn--sm { padding: 9px var(--s5); font-size: 14px; }

/* ------------------------------------------------------------------- Cards */

.card {
  background: var(--graphite);
  border-radius: var(--r-card);
  padding: var(--s7);
}

/* ------------------------------------------------------------------- Tags */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px var(--s3);
  border-radius: var(--r-nav);
  background: var(--obsidian);
  color: var(--ash);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tag--accent { background: rgba(82, 102, 235, 0.16); color: #a3b0f5; }
.tag--free   { background: rgba(82, 102, 235, 0.16); color: #a3b0f5; }
.tag--hold   { background: var(--obsidian); color: var(--slate); }

/* ------------------------------------------------------------------- Hero */

/* Scroll-zoom stage.
   The image is pinned for the height of the stage and scaled by --zoom, which
   app.js drives from scroll position. Sitting in its own stacking context with
   the copy above it means the zoom never reflows text. */
.hero-stage {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: clip;
}

.hero-stage__media {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.hero-stage__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--zoom, 1));
  transform-origin: 50% 55%;
  will-change: transform;
}

/* Legibility for the copy that sits over the photo, plus a hand-off into the
   page background so the image doesn't end on a hard edge. */
.hero-stage__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(23,23,33,.72) 0%,
      rgba(23,23,33,.40) 38%,
      rgba(23,23,33,.75) 78%,
      var(--onyx) 100%);
}

/* Slate is too dark to sit over photography */
.hero--over .eyebrow { color: rgba(237, 237, 243, .8); }
.hero--over .hero__lede { color: rgba(237, 237, 243, .92); }

/* Pull the hero copy up over the pinned image */
.hero--over {
  position: relative;
  z-index: 1;
  margin-top: -100svh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero { padding-block: var(--s11) var(--s10); }
.hero__inner { max-width: 860px; }
.hero__lede {
  margin-top: var(--s6);
  max-width: 620px;
  font-size: 21px;
  font-weight: 350;
  line-height: 1.35;
  color: var(--ash);
}
.hero__actions { margin-top: var(--s8); display: flex; gap: var(--s3); flex-wrap: wrap; }

.stat-row {
  margin-top: var(--s10);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s6);
}
.stat__value {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.stat__label { margin-top: var(--s2); }

/* ------------------------------------------------------------- Vehicle grid */

.grid-vehicles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s6);
}

.v-card {
  background: var(--graphite);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color .2s ease, transform .2s ease;
}
.v-card:hover { background: #23232f; transform: translateY(-2px); }

.v-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--obsidian);
  overflow: hidden;
}
.v-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.v-card:hover .v-card__media img { transform: scale(1.04); }

/* Placeholder shown until a real photo exists for a vehicle */
.v-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(
      135deg,
      #22222e 0 12px,
      #262633 12px 24px
    );
  color: var(--slate);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.v-card__badge {
  position: absolute;
  top: var(--s3);
  left: var(--s3);
  padding: 6px var(--s3);
  border-radius: var(--r-nav);
  background: rgba(23, 23, 33, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1;
  color: var(--ivory);
}

.v-card__count {
  position: absolute;
  bottom: var(--s3);
  right: var(--s3);
  padding: 5px 10px;
  border-radius: var(--r-nav);
  background: rgba(23, 23, 33, 0.78);
  font-size: 12px;
  line-height: 1;
  color: var(--ash);
}

.v-card__body { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); flex: 1; }
.v-card__title { font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.25; }
.v-card__sub { font-size: 14px; color: var(--ash); }
.v-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--s2); }

/* ----------------------------------------------------------------- Filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  margin-bottom: var(--s7);
}

.field {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* The class sets display, so [hidden] needs to win explicitly — app.js hides
   filters whose field has no values in the data yet. */
.field[hidden] { display: none; }

.select, .search {
  appearance: none;
  background: var(--obsidian);
  border: 0;
  border-radius: var(--r-control);
  padding: 12px var(--s5);
  font-size: 14px;
  color: var(--ivory);
  cursor: pointer;
  min-width: 150px;
}
.select { padding-right: var(--s8); }
.search { cursor: text; min-width: 240px; }
.search::placeholder { color: var(--slate); }

.field::after {
  content: '';
  position: absolute;
  right: var(--s5);
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ash);
  border-bottom: 1.5px solid var(--ash);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.field--search::after { display: none; }

.select option { background: var(--graphite); color: var(--ivory); }

.result-count { margin-left: auto; font-size: 14px; color: var(--slate); }

.empty {
  grid-column: 1 / -1;
  padding: var(--s11) var(--s6);
  text-align: center;
  background: var(--graphite);
  border-radius: var(--r-card);
}

/* ------------------------------------------------------- Vehicle detail page */

.detail { padding-block: var(--s8) var(--s10); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 14px;
  color: var(--ash);
  padding: 9px var(--s4);
  margin-left: calc(var(--s4) * -1);
  border-radius: var(--r-nav);
}
.back-link:hover { color: var(--ivory); background: var(--obsidian); }

.detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--s8);
  align-items: start;
  margin-top: var(--s6);
}

.gallery__main {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--obsidian);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.gallery__thumbs {
  margin-top: var(--s3);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--s2);
}
.thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-default);
  overflow: hidden;
  background: var(--obsidian);
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: .55;
  transition: opacity .18s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .85; }
.thumb[aria-selected="true"] { opacity: 1; outline: 2px solid var(--cobalt); outline-offset: -2px; }

.spec-list { display: grid; gap: 0; }
.spec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding-block: var(--s3);
}
.spec + .spec { border-top: 1px solid rgba(112, 112, 125, 0.22); }
.spec__key { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); }
.spec__val { font-size: 15px; text-align: right; }

.notes { white-space: pre-line; color: var(--ash); }

/* --------------------------------------------------------------- Process */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s6); }
.step__num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--cobalt);
  letter-spacing: 0.015em;
}
.step__title { margin-top: var(--s3); font-size: 18px; font-weight: 500; }
.step__copy { margin-top: var(--s2); font-size: 15px; color: var(--ash); line-height: 1.5; }

/* -------------------------------------------------------------------- CTA */

.cta { background: var(--graphite); border-radius: var(--r-card); padding: var(--s10) var(--s7); text-align: center; }
.cta__actions { margin-top: var(--s7); display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- Footer */

.site-footer { padding-block: var(--s9); margin-top: var(--s10); border-top: 1px solid rgba(112,112,125,.22); }
.site-footer__inner { display: flex; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--ash); font-size: 14px; }
.site-footer a:hover { color: var(--ivory); }
.footer-links { display: flex; gap: var(--s6); flex-wrap: wrap; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 900px) {
  .detail__layout { grid-template-columns: 1fr; gap: var(--s7); }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 72px; left: var(--s6); right: var(--s6);
    flex-direction: column;
    align-items: stretch;
    background: var(--graphite);
    border-radius: var(--r-card);
    padding: var(--s3);
    gap: var(--s1);
  }
  .nav-toggle { display: inline-flex; }
  .hero { padding-block: var(--s9) var(--s8); }
  .section { padding-block: var(--s9); }
  .wrap { padding-left: var(--s5); padding-right: var(--s5); }
  .card, .cta { padding: var(--s6); }
  .result-count { margin-left: 0; width: 100%; }
  .search, .select { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .v-card:hover { transform: none; }
  .v-card:hover .v-card__media img { transform: none; }
}
