/* JR Motors — v2. Mobile-first.
   Layout: a dark showroom hero that scrubs its film with the scroll, then light sections on concrete grey,
   one dark parallax band of the showroom, and a dark footer. The client's own colours: showroom black and logo yellow. */

@font-face {
  font-family: "Work Sans";
  src: url("../fonts/work-sans.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f2ee;          /* the showroom's light floor */
  --surface: #e8e6e0;
  --ink: #141414;          /* the showroom walls */
  --muted: #5c5c59;
  --line: rgba(20, 20, 20, .12);
  --night: #0f0f0f;
  --night-2: #1a1a1a;
  --on-night: #f3f2ee;
  --on-night-muted: #a3a29e;
  --yellow: #f5c400;       /* the logo */
  --font: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gut: max(20px, env(safe-area-inset-left, 0px));
  --gut-r: max(20px, env(safe-area-inset-right, 0px));
  --wrap: 1200px;
  --header: 60px;
  --bar: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 40px); margin-inline: auto; padding-left: var(--gut); padding-right: var(--gut-r); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--yellow); color: var(--ink); padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.skip:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 500 16px/1 var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.97); }
.btn--yellow { background: var(--yellow); color: #111; }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn svg { width: 18px; height: 18px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn--yellow:hover { background: #ffd21f; }
  .btn--dark:hover { background: #2a2a2a; }
  .btn--ghost:hover { background: rgba(127, 127, 127, .12); }
}
.link { font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: text-decoration-color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

/* ---------- header ---------- */
.header { position: fixed; inset: 0 0 auto; z-index: 20; padding-top: env(safe-area-inset-top, 0px); color: var(--on-night);
  background: linear-gradient(rgba(15,15,15,.72), rgba(15,15,15,0)); transition: background-color 200ms ease, color 200ms ease; }
.header.is-solid { background: var(--bg); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.header__bar { display: flex; align-items: center; gap: 16px; height: var(--header); }
.logo { display: inline-flex; color: inherit; }
.logo svg { width: 132px; height: auto; }
.header__nav { display: none; gap: 28px; margin-left: auto; }
.header__nav a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 12px 0; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1px no-repeat; transition: background-size 250ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .header__nav a:hover { background-size: 100% 1px; } }
.header__cta { margin-left: auto; min-height: 40px; padding: 0 16px; font-size: 15px; }
.header__cta span.long { display: none; }

/* ---------- hero: the film follows the scroll ---------- */
.hero { position: relative; height: 230svh; background: var(--night); color: var(--on-night); }
.hero__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero__media, .hero__media video, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero__media video { opacity: 0; transition: opacity 300ms ease; }
.hero.is-ready .hero__media video { opacity: 1; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,15,15,.4) 0%, rgba(15,15,15,0) 22%, rgba(15,15,15,.15) 40%, rgba(15,15,15,.92) 78%); pointer-events: none; }
@media (min-width: 1024px) { .hero__shade { background: linear-gradient(180deg, rgba(15,15,15,.4) 0%, rgba(15,15,15,0) 25%), linear-gradient(90deg, rgba(15,15,15,.82) 0%, rgba(15,15,15,.35) 45%, rgba(15,15,15,0) 70%); } }
.hero__copy, .hero__end { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); will-change: transform, opacity; }
.hero__copy .wrap, .hero__end .wrap { display: grid; gap: 14px; }
.hero h1 { font-size: clamp(36px, 10vw, 76px); max-width: 16ch; }
.hero__lead { font-size: 18px; line-height: 1.45; color: #dcdbd6; max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hero__hint { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-night-muted); margin-top: 6px; }
.hero__hint i { width: 1px; height: 22px; background: currentColor; transform-origin: top; animation: hint 1.8s var(--ease-in-out) infinite; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.hero__end { opacity: 0; transform: translateY(24px); pointer-events: none; }
.hero__end p.big { font-size: clamp(28px, 7.5vw, 56px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; max-width: 16ch; }
.hero__end.is-on { pointer-events: auto; }
/* without the film (reduced motion, data saver, slow network, no script): one still screen */
.hero.is-static { height: 100svh; }
.hero.is-static .hero__end { display: none; }

/* ---------- sections ---------- */
.section { padding-block: 72px; }
.section__head { display: grid; gap: 10px; margin-bottom: 32px; }
.section__head h2 { font-size: clamp(30px, 7vw, 52px); }
.section__head p { color: var(--muted); max-width: 52ch; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

/* cars */
.cars { display: grid; gap: 28px; grid-template-columns: 1fr; }
.car { display: grid; gap: 14px; align-content: start; }
.car__media { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 4 / 3; background: var(--surface); }
.car__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.car__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.car__head h3 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; }
.car__price { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.car__facts { font-size: 14px; color: var(--muted); }
.car__specs { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.car__specs li { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.car .btn { justify-self: start; min-height: 44px; }
@media (hover: hover) and (pointer: fine) { .car:hover .car__media img { transform: scale(1.03); } }

/* showroom band: three depths */
.band { position: relative; overflow: hidden; background: var(--night); color: var(--on-night); padding-block: 96px; isolation: isolate; }
.band__back { position: absolute; inset: -12% 0; z-index: -2; }
.band__back img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15,15,15,.92) 0%, rgba(15,15,15,.6) 60%, rgba(15,15,15,.35) 100%); }
.band__grid { display: grid; gap: 40px; }
.band h2 { font-size: clamp(30px, 7vw, 52px); max-width: 14ch; }
.band__text { display: grid; gap: 16px; max-width: 46ch; }
.band__text p { color: #d4d3ce; }
.band__front { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.band__front img { border-radius: 12px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.band__front img:nth-child(2) { margin-top: 48px; }
[data-depth] { will-change: transform; }

/* interiors */
.interiors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interiors img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.interiors img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

/* visit */
.visit { display: grid; gap: 28px; }
.visit__info { display: grid; gap: 22px; align-content: start; }
.visit__row { display: grid; gap: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.visit__row dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.visit__row dd { margin: 0; font-size: 18px; line-height: 1.45; }
.visit__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.map { position: relative; display: block; overflow: hidden; border-radius: 14px; aspect-ratio: 16 / 10; background: var(--surface); }
.map img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.map__label svg { width: 16px; height: 16px; flex: none; }
.map__label { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 999px; }
@media (hover: hover) and (pointer: fine) { .map:hover img { transform: scale(1.03); } }
.review-note { font-size: 14px; color: var(--muted); }
.review-note a { color: var(--ink); }

/* footer */
.footer { background: var(--night); color: var(--on-night); padding-block: 64px calc(40px + var(--bar)); }
.footer__grid { display: grid; gap: 32px; }
.footer .logo svg { width: min(100%, 520px); }
.footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer h3 { font-size: 13px; font-weight: 500; color: var(--on-night-muted); letter-spacing: .02em; margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer ul a { text-decoration: none; display: inline-block; padding: 6px 0; }
@media (hover: hover) and (pointer: fine) { .footer ul a:hover { color: var(--yellow); } }
.footer__legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(243,242,238,.14); font-size: 13px; color: var(--on-night-muted); display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__legal a { color: inherit; }

/* phone action bar */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px var(--gut-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gut); background: var(--bg); box-shadow: 0 -1px 0 var(--line);
  transform: translateY(110%); transition: transform 300ms var(--ease-out); }
.actionbar.is-on { transform: none; }
.actionbar .btn { min-height: 48px; padding: 0 12px; }

/* section entrances: visible at rest without script; with script they rise once */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  :root { --gut: max(32px, env(safe-area-inset-left, 0px)); --gut-r: max(32px, env(safe-area-inset-right, 0px)); }
  .cars { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .interiors { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .interiors img:first-child { grid-column: auto; aspect-ratio: 1; }
  .header__cta span.long { display: inline; }
  .header__cta span.short { display: none; }
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
  .section { padding-block: 96px; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :root { --header: 72px; --gut: max(48px, env(safe-area-inset-left, 0px)); --gut-r: max(48px, env(safe-area-inset-right, 0px)); }
  .header__nav { display: flex; }
  .header__cta { margin-left: 8px; }
  .logo svg { width: 160px; }
  .hero { height: 280svh; }
  .hero__copy, .hero__end { padding-bottom: 64px; }
  .hero__lead { font-size: 20px; }
  .cars { grid-template-columns: repeat(3, 1fr); gap: 48px 28px; }
  .section { padding-block: 128px; }
  .band { padding-block: 140px; }
  .band__grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
  .band__front { gap: 20px; }
  .band__front img:nth-child(2) { margin-top: 96px; }
  .visit { grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
  .footer__grid { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 48px; }
}

/* phone: the bar's room at the foot */
@media (max-width: 1023px) { body.has-bar { --bar: 72px; } body.has-bar .hero__end { padding-bottom: calc(28px + 72px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 1024px) { .actionbar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__hint i { animation: none; }
  .car__media img, .map img { transition: none; }
  [data-depth] { transform: none !important; }
}
