/* ============================================================
   JMD MOTORS - "Night Showroom" design system (v2)
   ------------------------------------------------------------
   DARK-FIRST. The whole site lives in the logo's midnight navy
   with chrome/silver as the premium metal accent; cobalt only
   for links, focus and small marks. One deliberate inversion
   per page: the chrome slab (sell section). Light theme exists
   as a manual toggle option, not the default.
   Radius rule: interactive = pill, containers/media = 12px.
   Chrome shows up three ways: gradient TEXT on key figures,
   1px gradient borders on cards/panels, hairline rules.
   Type: Archivo (display, heavy UPPERCASE) / Instrument Sans.
   No em-dashes in visible copy. WCAG AA in both themes.
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-var-latin.woff2') format('woff2');
  font-weight: 500 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-var-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-italic-var-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens (LIGHT is default; dark is the opt-in override) ---------- */
:root {
  color-scheme: light;
  --bg: #eef1f6;
  --bg-deep: #e2e7ef;
  --surface: #ffffff;
  --ink: #0d1230;
  --ink-2: #3e4763;
  --ink-3: #626b88;
  --line: #d5dbe8;

  --midnight: #10163a;         /* structural navy, same in both themes */
  --on-midnight: #edf0f8;

  --accent: #2f55d4;           /* cobalt: links, focus, small marks only */
  --on-accent: #ffffff;

  /* chrome: the metal. Text gradient, borders, rules, primary CTA */
  --chrome-text: linear-gradient(175deg, #3c466b 15%, #10163a 60%, #2b3459 95%);
  --chrome-btn: linear-gradient(150deg, #f4f7fb, #c3ccdb 55%, #e6eaf2);
  --chrome-border: linear-gradient(135deg, #b6bfd2 0%, #dfe4ee 40%, #a8b2c8 60%, #e8ecf3 100%);
  --chrome-rule: linear-gradient(90deg, transparent, #b9c2d5 30%, #dfe4ee 50%, #b9c2d5 70%, transparent);

  --r: 12px;
  --r-pill: 999px;
  --shadow-card: 0 12px 30px -14px rgba(16, 22, 58, 0.25);
  --shadow-lift: 0 20px 44px -18px rgba(16, 22, 58, 0.35);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --container: 1200px;
  --head-h: 68px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f22;
  --bg-deep: #070a18;
  --surface: #121834;
  --ink: #edf0f8;
  --ink-2: #aeb7d2;
  --ink-3: #7d87a8;
  --line: #232b4e;

  --accent: #7d97ff;
  --on-accent: #0d1230;

  --chrome-text: linear-gradient(175deg, #f8fafd 20%, #b9c3d6 55%, #8f9ab4 90%);
  --chrome-border: linear-gradient(135deg, #6a7594 0%, #2a3357 40%, #545f80 60%, #202849 100%);
  --chrome-rule: linear-gradient(90deg, transparent, #3a4470 30%, #5c6890 50%, #3a4470 70%, transparent);

  --shadow-card: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 22px 50px -18px rgba(0, 0, 0, 0.8);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); }

body {
  margin: 0;
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: 'Archivo', 'Instrument Sans', sans-serif;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1, h2 {
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.98;
}
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-weight: 700; font-size: 1.14rem; letter-spacing: -0.01em; line-height: 1.15; }

p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }

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

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute; left: 1rem; top: -100%;
  background: var(--surface); color: var(--ink);
  padding: 0.6rem 1.1rem; border-radius: var(--r-pill); z-index: 100;
}
.skip-link:focus { top: 0.75rem; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.chrome-rule { border: 0; height: 1px; background: var(--chrome-rule); margin: 1rem 0; }

/* chrome gradient text helper (Archivo figures + hero line) */
.chrome-text,
.hero__title-chrome,
.finance__figure,
.vcard__price {
  background: var(--chrome-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: 'Archivo', sans-serif; color: var(--ink);
}
.wordmark__logo { height: 40px; width: auto; display: block; }
.site-head__row .wordmark__logo { height: 42px; }
.wordmark__star { width: 13px; height: 13px; fill: var(--accent); stroke: none; align-self: center; }
.wordmark__jmd { font-weight: 900; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1; }
.wordmark__motors {
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.65rem 1.6rem;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 0.98rem;
  white-space: nowrap; cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, border-color 0.2s, background-color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--lg { min-height: 54px; padding: 0.8rem 2rem; font-size: 1.03rem; }

/* primary = chrome metal, navy text (both themes) */
.btn--chrome { background: var(--chrome-btn); color: #0d1230; }
.btn--chrome:hover { box-shadow: 0 12px 30px -12px rgba(150, 165, 200, 0.45); }

.btn--outline { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.btn--outline:hover { border-color: var(--ink); }

/* used on the chrome slab only */
.btn--night { background: #10163a; color: #edf0f8; }
.btn--night:hover { box-shadow: 0 12px 28px -12px rgba(16, 22, 58, 0.55); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-head::after { content: ""; display: block; height: 1px; background: var(--chrome-rule); }
.site-head__row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  height: var(--head-h);
}
.site-nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2rem); }
.site-nav a { color: var(--ink-2); font-weight: 500; font-size: 0.95rem; transition: color 0.15s; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.site-head__actions { display: flex; align-items: center; gap: 0.7rem; }
.site-head__call { min-height: 42px; padding: 0.4rem 1.15rem; font-size: 0.92rem; }

.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.theme-btn:hover { border-color: var(--ink-3); color: var(--ink); }
/* light default shows the moon ("switch to dark"); dark shows the sun */
.theme-btn__sun { display: none; }
html[data-theme="dark"] .theme-btn__moon { display: none; }
html[data-theme="dark"] .theme-btn__sun { display: block; }

.nav-toggle { display: none; }

/* ---------- Hero : full-bleed night showroom ---------- */
.hero {
  position: relative;
  min-height: min(88dvh, 820px);
  display: flex; align-items: flex-end;
  overflow: clip;
}
.hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: 68% center;
}
/* Photo hero stays dark-scrimmed with light text in BOTH themes (readability
   over the showroom image), so it does not use the theme --bg token. */
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, #0b0f22 4%, transparent 58%),
    linear-gradient(97deg, rgba(11,15,34,0.92) 18%, rgba(11,15,34,0.42) 44%, transparent 70%);
}
.hero__inner {
  position: relative; width: 100%;
  padding-block: 0 clamp(3rem, 7vh, 5rem);
}
.hero__title {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  margin-bottom: 0.45em;
  color: #edf0f8;
}
.hero__title span { display: block; }
.hero__title-chrome {
  background: linear-gradient(175deg, #f8fafd 20%, #b9c3d6 55%, #8f9ab4 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: 1.14rem; color: #c3cbe0; max-width: 30rem; margin-bottom: 1.7rem; }
.hero .btn--outline { color: #edf0f8; border-color: rgba(237,240,248,0.4); }
.hero .btn--outline:hover { border-color: #edf0f8; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Statement strip ---------- */
.statement { border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.statement__row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding-block: 1.15rem;
}
.statement__row span {
  font-family: 'Archivo', sans-serif; font-weight: 650;
  font-size: 0.86rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Stock : horizontal rail ---------- */
.stock { padding-block: clamp(4rem, 8vw, 6.5rem) clamp(3.4rem, 7vw, 5.5rem); }
.stock__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 2.2rem;
}
.stock__head h2 { margin: 0; }
.stock__rail-nav { display: flex; gap: 0.6rem; }
.rail-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.rail-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.rail-btn[disabled] { opacity: 0.35; cursor: default; }

.stock__rail {
  display: flex; gap: 1.3rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 0.8rem;
  scrollbar-width: none;
}
.stock__rail::-webkit-scrollbar { display: none; }

/* vehicle card: dark, 1px chrome border (the logo rim, thinned) */
.vcard {
  flex: 0 0 min(400px, 84vw); scroll-snap-align: start;
  position: relative;
  background: var(--chrome-border);
  border-radius: calc(var(--r) + 1px);
  padding: 1px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.vcard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.vcard__link {
  display: block; color: inherit;
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  height: 100%;
}
.vcard__media { margin: 0; }
.vcard__media > img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.vcard__body { padding: 1.15rem 1.3rem 1.3rem; }
.vcard__body h3 { margin-bottom: 0.5rem; }
.vcard__meta {
  list-style: none; display: flex; align-items: center; gap: 0.75rem;
  margin: 0 0 0.95rem; padding: 0;
  font-size: 0.88rem; color: var(--ink-3);
}
.vcard__meta li { display: flex; align-items: center; }
.vcard__meta li + li::before {
  content: ""; width: 1px; height: 11px; background: var(--line);
  margin-right: 0.75rem;
}
.vcard__price {
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.5rem;
  letter-spacing: -0.01em; margin: 0;
}

/* Weekly-first pricing block (cards). Weekly repayment is the headline; the
   cash price + on-road costs and the approval note sit under it. */
.vcard__pricing { margin: 0; }
.vcard__weekly {
  font-family: 'Archivo', sans-serif; font-weight: 850; font-size: 1.7rem;
  letter-spacing: -0.01em; line-height: 1; margin: 0;
}
.vcard__weekly span { font-size: 0.5em; font-weight: 700; letter-spacing: 0; -webkit-text-fill-color: var(--ink-2); }
.vcard__cash { margin: 0.35rem 0 0; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.vcard__cash .orc { color: var(--ink-3); font-weight: 500; }
.vcard__approval { margin: 0.15rem 0 0; font-size: 0.72rem; color: var(--ink-3); }
.vcard__weekly--poe {
  background: none; -webkit-text-fill-color: currentColor; color: var(--ink);
  font-size: 1.25rem;
}

/* ---------- Finance ---------- */
.finance { background: var(--bg-deep); border-block: 1px solid var(--line); padding-block: clamp(3.8rem, 7vw, 6rem); }
.finance__grid {
  display: grid; grid-template-columns: 1.08fr 0.92fr; align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.finance__copy > p { font-size: 1.1rem; color: var(--ink-2); max-width: 32rem; }
.check-list { list-style: none; margin: 1.4rem 0 1.9rem; padding: 0; display: grid; gap: 0.7rem; }
.check-list li { display: flex; align-items: center; gap: 0.7rem; font-weight: 500; }
.check-list .ic { color: var(--accent); }

.finance__panel {
  position: relative;
  background: var(--chrome-border);
  border-radius: calc(var(--r) + 1px);
  padding: 1px;
}
.finance__panel::before {
  content: ""; position: absolute; inset: 1px; border-radius: var(--r);
  background: linear-gradient(165deg, var(--surface), var(--bg) 80%);
}
.finance__panel > * { position: relative; margin-inline: 0; padding-inline: 2rem; }
.finance__panel > .finance__panel-label { padding-top: 1.9rem; }
.finance__panel > .finance__fine { padding-bottom: 1.9rem; }
.finance__panel-label {
  font-weight: 600; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.5rem;
}
.finance__figure {
  font-family: 'Archivo', sans-serif; font-weight: 850; font-size: clamp(3.4rem, 5.5vw, 4.6rem);
  letter-spacing: -0.02em; line-height: 1; margin-bottom: 0.5rem;
}
.finance__figure span { font-size: 0.34em; font-weight: 600; letter-spacing: 0; }
.finance__basis { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 1.2rem; }
.finance__fine { color: var(--ink-3); font-size: 0.8rem; line-height: 1.5; margin: 0; }
.finance__panel .chrome-rule { margin: 0 2rem 1.2rem; }

/* ---------- How ---------- */
.how { padding-block: clamp(3.8rem, 7vw, 6rem); }
.how__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.how__lead { position: sticky; top: calc(var(--head-h) + 28px); }
.how__lead p { color: var(--ink-2); font-size: 1.08rem; max-width: 26rem; }
.how__ladder { list-style: none; margin: 0; padding: 0; }
.how__ladder li { padding-block: 1.8rem; }
.how__ladder li + li { border-top: 1px solid transparent; border-image: var(--chrome-rule) 1; }
.how__ladder li:first-child { padding-top: 0.4rem; }
.how__ladder h3 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.how__ladder p { margin: 0; color: var(--ink-2); max-width: 30rem; }

/* ---------- Sell : the chrome slab (single light block on the dark page) ---------- */
.sell {
  background: linear-gradient(150deg, #e8ecf3, #bfc8d8 55%, #dde2eb);
  color: #10163a;
}
.sell__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(3.6rem, 7vw, 5.5rem);
}
.sell__copy h2 { color: #10163a; margin-bottom: 0.5rem; }
.sell__copy p { color: #2e3a5e; max-width: 30rem; margin-bottom: 1.5rem; font-size: 1.08rem; }
.sell__media {
  margin: 0;
  border-radius: var(--r); overflow: hidden;
  box-shadow: 0 24px 50px -20px rgba(16, 22, 58, 0.55);
}
.sell__media > img { aspect-ratio: 4 / 3.4; width: 100%; object-fit: cover; }

/* ---------- Reviews ---------- */
.reviews { padding-block: clamp(3.8rem, 7vw, 6rem) clamp(4rem, 7vw, 6.2rem); }
.reviews h2 { margin-bottom: 1.7rem; }
.reviews__track {
  display: flex; gap: 1.2rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 0.6rem;
  scrollbar-width: none;
}
.reviews__track::-webkit-scrollbar { display: none; }
.review {
  flex: 0 0 min(400px, 84%); scroll-snap-align: start;
  margin: 0; padding: 1.7rem 1.8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.review blockquote { margin: 0 0 1.1rem; font-size: 1.07rem; line-height: 1.55; font-weight: 500; }
.review figcaption { font-weight: 600; font-size: 0.92rem; }
.review figcaption span { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.85rem; }

/* ---------- Close : CTA + footer (always a dark band) ---------- */
.close {
  background: linear-gradient(180deg, #10163a, #0a0e22 70%);
  border-top: 0;
}
html[data-theme="dark"] .close { background: linear-gradient(180deg, var(--bg-deep), #050812 70%); border-top: 1px solid var(--line); }
.close, .close h2 { color: #edf0f8; }
.close .wordmark__jmd { color: #edf0f8; }
.close .wordmark__motors { color: #8b95b6; }
.close__cta { text-align: center; padding-block: clamp(4rem, 8vw, 6.5rem) clamp(3rem, 6vw, 4.5rem); }
.close__cta h2 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); margin-bottom: 0.4rem; }
.close__cta p { color: #aeb7d2; font-size: 1.12rem; margin-bottom: 2.1rem; }
.close__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }
.close .btn--outline { color: #edf0f8; border-color: rgba(237, 240, 248, 0.4); }
.close .btn--outline:hover { border-color: #edf0f8; }

.footer { border-top: 1px solid rgba(140, 152, 190, 0.18); }
.footer__grid {
  display: grid; grid-template-columns: 1.5fr 0.8fr 0.8fr 1.2fr; gap: clamp(1.6rem, 4vw, 3.4rem);
  padding-block: 3.2rem 2.4rem;
}
.footer__brand p { color: #8b95b6; margin: 0.9rem 0 0; max-width: 22rem; font-size: 0.95rem; }
.footer__nav { display: grid; gap: 0.55rem; align-content: start; }
.footer__nav a { color: #aeb7d2; font-size: 0.95rem; }
.footer__nav a:hover { color: #edf0f8; }
.footer__contact { font-style: normal; font-size: 0.95rem; color: #8b95b6; }
.footer__contact p { margin: 0 0 0.55rem; }
.footer__contact a { color: #dfe4f2; }
.footer__legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  padding-block: 1.4rem 1.8rem;
  border-top: 1px solid rgba(140, 152, 190, 0.18);
  font-size: 0.85rem; color: #8b95b6;
}
.footer__legal p { margin: 0; }
.footer__legal a { color: #aeb7d2; margin-left: 1rem; }
.footer__legal a:first-child { margin-left: 0; }
.footer__legal a:hover { color: #edf0f8; }

/* ---------- Reveal on scroll (JS adds .is-in; JS-off stays visible) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  html.js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .site-nav {
    position: absolute; top: calc(var(--head-h) + 1px); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 0.6rem 0 1rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.8rem clamp(1.1rem, 4vw, 2rem); font-size: 1.05rem; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 0 10px;
    background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
    cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-head__call { display: none; }

  .statement__row { justify-content: flex-start; column-gap: 2rem; }

  .finance__grid { grid-template-columns: 1fr; }
  .finance__panel { max-width: 480px; }

  .how__grid { grid-template-columns: 1fr; }
  .how__lead { position: static; }

  .sell__grid { grid-template-columns: 1fr; }
  .sell__media { order: -1; max-width: 560px; }
  .sell__media > img { aspect-ratio: 16 / 10; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 599px) {
  .hero { min-height: min(78dvh, 640px); }
  .hero__ctas .btn { flex: 1 1 auto; }

  .statement__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 1.2rem; }

  .stock__rail-nav { display: none; }

  .footer__grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer__legal { flex-direction: column; }
}

/* ============================================================
   PAGE COMPONENTS (inner pages) - appended, all-new selectors
   ============================================================ */

/* ---------- Shared footer (identical on every page; always a dark band) ---------- */
.site-foot {
  background: linear-gradient(180deg, #10163a, #0a0e22 70%);
  border-top: 0;
  color: #edf0f8;
}
html[data-theme="dark"] .site-foot { background: linear-gradient(180deg, var(--bg-deep), #050812 70%); border-top: 1px solid var(--line); }
.site-foot .wordmark__jmd { color: #edf0f8; }
.site-foot .wordmark__motors { color: #8b95b6; }

/* ---------- Reusable CTA band (inner pages) ---------- */
.cta-band {
  background: linear-gradient(150deg, var(--midnight), #0a0e24 70%);
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta-band__inner { padding-block: clamp(3.2rem, 6vw, 4.8rem); }
.cta-band h2 { color: #edf0f8; font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 0.4rem; }
.cta-band p { color: #aeb7d2; font-size: 1.08rem; margin-bottom: 1.8rem; }
.cta-band__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; }
.cta-band .btn--outline { color: #edf0f8; border-color: rgba(237, 240, 248, 0.4); }
.cta-band .btn--outline:hover { border-color: #edf0f8; }

/* ---------- Page hero (compact inner header) ---------- */
.page-hero {
  position: relative;
  padding-block: clamp(2.6rem, 6vw, 4rem) clamp(2.2rem, 5vw, 3.4rem);
  overflow: clip;
  border-bottom: 1px solid var(--line);
}
.page-hero--media { min-height: 340px; display: flex; align-items: flex-end; border-bottom: 0; }
.page-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Media hero: dark-scrimmed with light text in both themes (photo background). */
.page-hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, #0b0f22 3%, transparent 72%),
              linear-gradient(100deg, rgba(11,15,34,0.88) 20%, transparent 76%);
}
.page-hero__inner { position: relative; width: 100%; }
.page-hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin-bottom: 0.35em;
}
.page-hero__lede { font-size: 1.14rem; color: var(--ink-2); max-width: 44ch; margin: 0; }
.page-hero--media h1 { color: #edf0f8; }
.page-hero--media .page-hero__lede { color: #c3cbe0; }
.page-hero--media .breadcrumb, .page-hero--media .breadcrumb a { color: #aeb7d2; }
.page-hero--media .breadcrumb span[aria-current] { color: #edf0f8; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; font-size: 0.85rem; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span[aria-current] { color: var(--ink-2); }
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; list-style: none; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--line); }

/* ---------- Generic section + prose ---------- */
.section { padding-block: clamp(3.2rem, 6.5vw, 5.2rem); }
.section--soft { background: var(--bg-deep); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 2rem; max-width: 60ch; }
.section__head p { color: var(--ink-2); font-size: 1.08rem; margin: 0.6rem 0 0; }

.prose { max-width: 68ch; color: var(--ink-2); font-size: 1.06rem; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 1.8em 0 0.5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--ink); margin: 1.5em 0 0.4em; font-size: 1.2rem; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--ink); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* two-column content + aside */
.layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.layout__aside { position: sticky; top: calc(var(--head-h) + 24px); }

/* ---------- Feature / info card grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature { padding: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.feature__ic { width: 44px; height: 44px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 0.9rem; }
.feature__ic .ic { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 0.4rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* ---------- Numbered steps ---------- */
.steps { display: grid; gap: 1rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  position: relative; padding: 1.4rem 1.6rem 1.4rem 4.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 1.4rem; top: 1.3rem;
  width: 32px; height: 32px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 0.95rem;
  color: #0d1230; background: var(--chrome-btn);
}
.steps h3 { margin-bottom: 0.3rem; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- Forms ---------- */
.side-panel {
  background: var(--chrome-border); border-radius: calc(var(--r) + 1px); padding: 1px;
  position: relative;
}
.side-panel::before { content: ""; position: absolute; inset: 1px; border-radius: var(--r); background: linear-gradient(165deg, var(--surface), var(--bg) 90%); }
.side-panel__in { position: relative; padding: clamp(1.4rem, 3vw, 2rem); }
.side-panel h2, .side-panel h3 { margin-bottom: 0.3rem; }
.side-panel__sub { color: var(--ink-2); font-size: 0.97rem; margin-bottom: 1.3rem; }

.form { display: grid; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.field label .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 0.85rem; min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d87a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.4rem; }
.field__hint { font-size: 0.82rem; color: var(--ink-3); }
.field--full { grid-column: 1 / -1; }
.checkbox { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.92rem; color: var(--ink-2); }
.checkbox input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--accent); flex: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-status { font-size: 0.92rem; color: var(--ink-2); min-height: 1.2em; }
.form-status.is-ok { color: #46c37b; }
.form-status.is-err { color: #ff8080; }

/* wizard (multi-step) */
.wizard__steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.wizard__dot { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.wizard__dot.is-active { background: var(--chrome-btn); }
.wizard__panel { display: none; }
.wizard__panel.is-active { display: grid; gap: 1rem; }
.wizard__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; }

/* ---------- Vehicle listing (grid, not the homepage rail) ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
  padding: 1rem 1.15rem; margin-bottom: 1.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.filters .field { gap: 0; flex: 1 1 150px; min-width: 130px; }
.filters select { min-height: 44px; }
.filters__count { margin-left: auto; font-size: 0.9rem; color: var(--ink-3); white-space: nowrap; }
.vehicle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.vehicle-grid .vcard { flex: none; width: auto; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r); }
.empty-state[hidden] { display: none; }

/* price / enquire on cards */
.vcard__price--poe { font-size: 1.05rem; color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); background: none; }

/* ---------- Vehicle detail ---------- */
.vdetail { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.6rem, 4vw, 3rem); align-items: start; }
.gallery__main {
  position: relative; margin: 0; border-radius: var(--r); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
}
.gallery__main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; display: block; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.gallery__thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; background: none; cursor: pointer; aspect-ratio: 4 / 3; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(4, 6, 14, 0.85); backdrop-filter: blur(4px); }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: var(--r); }
.lightbox__close { position: absolute; top: -0; right: 0; transform: translate(0, -120%); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-pill); width: 44px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.vdetail__aside { position: sticky; top: calc(var(--head-h) + 20px); display: grid; gap: 1rem; }
.vdetail__price { font-family: 'Archivo', sans-serif; font-weight: 850; font-size: 2.4rem; line-height: 1; margin: 0.2rem 0 0.1rem; }
/* Weekly-first pricing (detail) */
.vdetail__weekly { font-family: 'Archivo', sans-serif; font-weight: 850; font-size: clamp(2.2rem, 4vw, 2.8rem); line-height: 1; margin: 0.5rem 0 0.15rem; }
.vdetail__weekly span { font-size: 0.42em; font-weight: 700; letter-spacing: 0; -webkit-text-fill-color: var(--ink-2); }
.vdetail__cash { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.vdetail__cash .orc { color: var(--ink-3); font-weight: 500; font-size: 0.92rem; }
.vdetail__approval { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--ink-3); line-height: 1.5; }
.vdetail__badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 0.3rem 0.7rem; border-radius: var(--r-pill); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.spec-grid div { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.spec-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.spec-grid dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 0.15rem; }
.spec-grid dd { margin: 0; font-weight: 600; }
.feature-list { columns: 2; column-gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; gap: 0.55rem; align-items: baseline; margin-bottom: 0.5rem; break-inside: avoid; color: var(--ink-2); }
.feature-list .ic { color: var(--accent); width: 15px; height: 15px; flex: none; align-self: center; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; max-width: 800px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; padding: 1.2rem 0.2rem; font-weight: 650; font-size: 1.06rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 12px; height: 12px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.25s var(--ease); flex: none; margin-right: 4px; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq__ans { color: var(--ink-2); padding: 0 0.2rem 1.3rem; margin: 0; max-width: 68ch; }

/* ---------- Finance calculator ---------- */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.4rem, 3vw, 2rem); }
.calc__switch { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-pill); margin-bottom: 1.6rem; }
.calc__switch button { border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; padding: 0.5rem 1.1rem; border-radius: var(--r-pill); cursor: pointer; }
.calc__switch button.is-active { background: var(--chrome-btn); color: #0d1230; }
.calc__panel { display: none; }
.calc__panel.is-active { display: block; }
.calc__row { display: grid; gap: 0.5rem; margin-bottom: 1.3rem; }
.calc__row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.calc__row label { font-weight: 600; }
.calc__num { width: 130px; text-align: right; font: inherit; font-weight: 700; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.6rem; }
.calc__range { width: 100%; accent-color: var(--accent); }
.calc__result { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.calc__figure { font-family: 'Archivo', sans-serif; font-weight: 850; font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1; }
.calc__figure-label { color: var(--ink-3); font-size: 0.95rem; }
.calc__fine { font-size: 0.8rem; color: var(--ink-3); margin: 1rem 0 0; }

/* ---------- Map ---------- */
.map-embed { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(0.25); }

/* ---------- Contact detail rows ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.contact-list li { display: flex; gap: 0.85rem; align-items: flex-start; }
.contact-list .ic { color: var(--accent); margin-top: 3px; flex: none; }
.contact-list a { color: var(--ink); }
.contact-list span { color: var(--ink-3); font-size: 0.82rem; display: block; text-transform: uppercase; letter-spacing: 0.05em; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.hours-table th, .hours-table td { text-align: left; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.hours-table th { font-weight: 500; color: var(--ink-2); }
.hours-table td { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.hours-table tr.is-today th, .hours-table tr.is-today td { color: var(--accent); font-weight: 700; }

/* ---------- Google rating badge ---------- */
.grating { display: inline-flex; align-items: center; gap: 0.6rem; }
.grating__stars { display: inline-flex; gap: 2px; color: #ffc53d; }
.grating__stars .ic { fill: #ffc53d; stroke: none; width: 17px; height: 17px; }
.grating strong { font-family: 'Archivo', sans-serif; font-size: 1.1rem; }
.grating span { color: var(--ink-3); font-size: 0.9rem; }

/* ---------- Mobile bottom CTA bar ---------- */
.mobile-cta { display: none; }

/* ---------- Responsive (page components) ---------- */
@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }
  .layout__aside { position: static; }
  .vdetail { grid-template-columns: 1fr; }
  .vdetail__aside { position: static; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .vehicle-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 719px) {
  .form__row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .vehicle-grid { grid-template-columns: 1fr; }
  .filters__count { margin-left: 0; width: 100%; }
  .gallery__thumbs { grid-template-columns: repeat(4, 1fr); }
  .feature-list { columns: 1; }
  .spec-grid { grid-template-columns: 1fr; }
  .spec-grid div:nth-child(odd) { border-right: 0; }

  /* mobile bottom CTA */
  .mobile-cta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .mobile-cta a { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.9rem; font-weight: 650; font-size: 0.95rem; color: var(--ink); }
  .mobile-cta a:first-child { border-right: 1px solid var(--line); color: var(--accent); }
  .mobile-cta .ic { width: 17px; height: 17px; }
  body.has-mobile-cta { padding-bottom: 56px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
