/* EXCAR Hero V4 — "Living World".
   One coastal night scene built from independent layers, back to front:
   sky (faint glows + seeded stars) → environment photo (its sky made transparent, so the stars sit behind the
   mountains) → a distant unlit car on the far bend → text shade → the live Trips map card and two score cards →
   headline and actions. No light trails, no scanning effects: the scene stays natural and still, and the only
   motion is the sky's very slow drift and gentle twinkle, plus a few pixels of pointer depth on desktop. */

.hero-v4 {
  --hx: 0;
  --hy: 0;
  /* EXCAR Mobile's Nocturne palette for the interface surfaces. */
  --v4-surface: rgba(20, 21, 25, .74);
  --v4-surface-strong: rgba(26, 25, 24, .9);
  --v4-line: rgba(233, 228, 220, .1);
  --v4-text: #e9e4dc;
  --v4-quiet: #9a958d;
  --v4-brand: #1e91ff;
  --v4-green: #45d69a;
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  color: #f4f8ff;
  background: linear-gradient(180deg, #02091a 0%, #020c1f 22%, #041228 36%, #071a32 48%, #05080e 100%);
}

/* ── World: a size container so every layer can be sized against the hero itself ── */
.hero-v4__world {
  position: absolute;
  inset: 0;
  z-index: 0;
  container-type: size;
  pointer-events: none;
}

/* ── Sky ── */
.hero-v4__sky {
  --sky-depth: 50%;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  transform: translate3d(calc(var(--hx) * -2px), calc(var(--hy) * -1.5px), 0);
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
  /* No-JS fallback: a faint band and one nebula, so the sky is never flat black. */
  background:
    radial-gradient(60% 14% at 62% 24%, rgba(58, 78, 156, .08), transparent 70%),
    radial-gradient(30% 20% at 86% 10%, rgba(47, 111, 214, .09), transparent 70%);
}
.hero-v4__sky.is-live { background: none; }
.hero-v4__glows { position: absolute; inset: 0; animation: hero-v4-breathe 60s ease-in-out infinite alternate; }
.hero-v4__glow {
  position: absolute;
  left: calc(var(--cx) * 100%);
  top: calc(var(--cy) * 100%);
  width: calc(var(--rx) * 200cqw);
  height: calc(var(--ry) * 200cqw);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--rot));
  background: radial-gradient(closest-side, rgb(var(--rgb) / var(--a)), rgb(var(--rgb) / calc(var(--a) * .45)) 45%, rgb(var(--rgb) / 0) 100%);
}
.hero-v4__glow-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) * 100%);
  height: calc(var(--s) * 140%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgb(255 244 226 / var(--ca)), rgb(255 244 226 / 0));
}
.hero-v4__stars { position: absolute; inset: 0; animation: hero-v4-fade 1.8s ease .1s both; }
.hero-v4__layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  animation: hero-v4-drift var(--period) linear infinite;
  will-change: transform;
}
.hero-v4__twinkle { position: absolute; inset: 0; animation: hero-v4-twinkle var(--half) ease-in-out var(--delay) infinite alternate; }
.hero-v4__star {
  position: absolute;
  left: calc(var(--x) * 50% + var(--o, 0%));
  top: calc(var(--y) * var(--sky-depth));
  width: calc(var(--r) * 2px);
  height: calc(var(--r) * 2px);
  margin: calc(var(--r) * -1px) 0 0 calc(var(--r) * -1px);
  border-radius: 50%;
  background: var(--c);
  opacity: var(--a);
}
.hero-v4__star.is-halo { box-shadow: 0 0 calc(var(--r) * 2px) calc(var(--r) * .6px) rgb(207 224 255 / .14); }

/* ── Scene: the environment image's cover box, art-directed by --fx / --fy ── */
.hero-v4__scene {
  --sw: max(100cqw, 177.7778cqh);
  --fx: .72;
  --fy: .5;
  position: absolute;
  z-index: 3;
  left: calc((100cqw - var(--sw)) * var(--fx));
  top: calc((100cqh - var(--sw) * .5625) * var(--fy));
  width: var(--sw);
  aspect-ratio: 16 / 9;
  transform: translate3d(calc(var(--hx) * -5px), calc(var(--hy) * -3px), 0) scale(1.008);
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.hero-v4__env { position: absolute; inset: 0; z-index: 1; }
.hero-v4__env img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; }

/* The car: a distant, unlit silhouette (EXCAR Mobile's brandless car) coming out from behind the cliff on the far
   bend. Only its roofline, a headlight and a faint tail light read; its rear is still hidden by the rock. */
.hero-v4__car {
  position: absolute;
  z-index: 3;
  left: 86.2%;
  top: 62.5%;
  width: 5.6%;
  aspect-ratio: 1200 / 570;
  animation: hero-v4-fade 1.6s ease .2s both;
}
.hero-v4__car-body {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, rgba(0, 0, 0, .55) 22%, #000 40%);
  mask-image: linear-gradient(90deg, transparent 4%, rgba(0, 0, 0, .55) 22%, #000 40%);
}
.hero-v4__car-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: brightness(.5) contrast(1.15) drop-shadow(0 -1px 0 rgba(150, 215, 255, .38));
}
.hero-v4__car-tint {
  position: absolute;
  inset: 0;
  -webkit-mask: url("../hero-v4/car-silhouette.webp") center / 100% 100% no-repeat;
  mask: url("../hero-v4/car-silhouette.webp") center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  background: linear-gradient(180deg, #8e9bff 0%, #4e64cf 30%, rgba(20, 30, 70, 0) 70%);
  opacity: .14;
}
.hero-v4__car-light { position: absolute; border-radius: 50%; mix-blend-mode: screen; transform: translate(-50%, -50%); }
.hero-v4__car-light--head {
  left: 89.5%;
  top: 52%;
  width: 13%;
  height: 13%;
  background: radial-gradient(closest-side, #ffffff, rgba(190, 230, 255, .7) 35%, rgba(90, 170, 255, 0));
  box-shadow: 0 0 8px 2px rgba(150, 210, 255, .42);
}
.hero-v4__car-light--head::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 600%;
  height: 18%;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(170, 220, 255, .28) 50%, transparent);
}
.hero-v4__car-light--tail {
  left: 13%;
  top: 46%;
  width: 6%;
  height: 6%;
  background: radial-gradient(closest-side, rgba(255, 70, 60, .75), rgba(255, 40, 40, 0));
  opacity: .6;
}

/* Text protection inside the scene, under the interface. */
.hero-v4__shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    radial-gradient(42% 44% at 22% 36%, rgba(1, 6, 15, .66) 0%, rgba(1, 6, 15, .3) 58%, transparent 100%),
    linear-gradient(90deg, rgba(1, 5, 12, .42) 0%, transparent 38%);
}

/* Hero-level fades: nav legibility at the top, hand-off to the page at the bottom. */
.hero-v4__scrim {
  position: absolute;
  inset: 0;
  z-index: 6;
  background:
    linear-gradient(180deg, rgba(1, 5, 13, .55) 0%, rgba(1, 5, 13, 0) 15%),
    linear-gradient(180deg, transparent 76%, rgba(4, 7, 12, .7) 91%, #05080e 100%);
}

/* ── Headline and actions ── */
.hero-v4__content {
  position: absolute;
  z-index: 10;
  left: max(24px, calc((100% - 1240px) / 2 + 24px));
  top: clamp(112px, 20%, 220px);
  width: min(800px, 46%);
}
.hero-v4__title {
  max-width: 11.5em;
  margin: 0;
  color: #f5f8ff;
  font: 700 clamp(44px, 4.6vw, 70px)/.98 var(--font-display);
  letter-spacing: -.048em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #e6edff 55%, #b5c6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 34px rgba(0, 0, 0, .5));
}
.hero-v4__lead {
  max-width: 34ch;
  margin: 24px 0 0;
  color: #d3deec;
  font: 400 clamp(15px, 1.2vw, 18px)/1.55 var(--font-body);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
.hero-v4__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 30px; }
.hero-v4__actions .home-v3-button { min-height: 50px; padding: 0 24px; font-size: 14px; }
.hero-v4__actions .home-v3-text-link { font-size: 14px; text-shadow: 0 2px 14px rgba(0, 0, 0, .7); }
.hero-v4__fine { margin: 20px 0 0; color: #9ab0c5; font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; text-shadow: 0 1px 10px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .8); }
.hero-v4__note {
  position: absolute;
  z-index: 10;
  right: 24px;
  bottom: 16px;
  margin: 0;
  color: rgba(165, 185, 205, .5);
  font: 500 10px/1 var(--font-mono);
  letter-spacing: .06em;
}
.hero-v4__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── The interface: the live Trips map is the centrepiece, the two score cards sit under it ── */
.hero-v4__stage {
  position: absolute;
  z-index: 9;
  right: max(14.5vw, calc((100% - 1240px) / 2 + 24px));
  top: calc(clamp(104px, 18%, 210px) - 26px);
  width: clamp(380px, 32vw, 540px);
  font-size: clamp(11px, min(.92vw, 1.55vh), 14.5px);
}
.hero-v4__stack { position: relative; }
.hero-v4__trip {
  position: relative;
  padding: 1.15em 1.15em 1em;
  border: 1px solid var(--v4-line);
  border-radius: 1.35em;
  color: var(--v4-text);
  background: linear-gradient(180deg, rgba(30, 30, 32, .78), var(--v4-surface));
  box-shadow:
    0 40px 90px rgba(0, 0, 0, .5),
    0 12px 28px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  animation: hero-v4-rise 1s cubic-bezier(.2, .7, .2, 1) .35s both;
}
.hero-v4__trip-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.hero-v4__trip-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  color: var(--v4-quiet);
  font: 600 .7em/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-v4__trip-kicker svg { width: 1.35em; height: 1.35em; fill: none; stroke: var(--v4-brand); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero-v4__trip-badge {
  padding: .38em .7em;
  border: 1px solid var(--v4-line);
  border-radius: 99px;
  color: var(--v4-quiet);
  font: 500 .66em/1 var(--font-body);
  letter-spacing: .02em;
}
.hero-v4__trip-head { margin-top: .9em; }
.hero-v4__trip-title { margin: 0; color: var(--v4-text); font: 600 1.3em/1.2 var(--font-body); letter-spacing: -.01em; }
.hero-v4__trip-path { margin: .3em 0 0; color: var(--v4-quiet); font: 400 .86em/1.3 var(--font-body); }
.hero-v4__trip-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; margin: .95em 0 0; }
.hero-v4__trip-stats div { min-width: 0; }
.hero-v4__trip-stats dt { display: flex; align-items: center; gap: .35em; color: var(--v4-quiet); font: 400 .74em/1.2 var(--font-body); }
.hero-v4__trip-stats dt svg { width: 1.15em; height: 1.15em; fill: none; stroke: var(--v4-brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-v4__trip-stats dd { margin: .22em 0 0; color: var(--v4-text); font: 600 1.08em/1.2 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-v4__trip-map {
  position: relative;
  margin-top: .95em;
  overflow: hidden;
  border: 1px solid rgba(233, 228, 220, .08);
  border-radius: .95em;
  aspect-ratio: 16 / 11;
  background: radial-gradient(90% 80% at 60% 40%, #26324a, #1b2436);
  isolation: isolate;
}
.hero-v4__map-canvas { position: absolute; inset: 0; }
/* Google's own controls are off; keep its required logo and terms readable on the dark map. */
.hero-v4__map-canvas .gm-style-cc, .hero-v4__map-canvas a[href^="https://maps.google.com"] { opacity: .85; }
.hero-v4__map-status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: 80%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: var(--v4-quiet);
  font: 500 .8em/1.4 var(--font-body);
  text-align: center;
  pointer-events: none;
}
.hero-v4__trip-map[data-state="ready"] .hero-v4__map-status { display: none; }
.hero-v4__map-load { display: none; }
.hero-v4__trip-map[data-save-data="true"][data-state="idle"] .hero-v4__map-load {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  min-height: 2.8em;
  align-items: center;
  padding: 0 1.2em;
  transform: translate(-50%, -50%);
  border: 1px solid var(--v4-line);
  border-radius: 99px;
  color: var(--v4-text);
  background: var(--v4-surface-strong);
  font: 600 .85em/1 var(--font-body);
  cursor: pointer;
}
.hero-v4__map-controls {
  position: absolute;
  top: .7em;
  right: .7em;
  z-index: 3;
  display: grid;
  gap: .5em;
}
.hero-v4__trip-map:not([data-state="ready"]) .hero-v4__map-controls { display: none; }
.hero-v4__map-btn {
  display: grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  padding: 0;
  border: 1px solid rgba(233, 228, 220, .14);
  border-radius: 50%;
  color: var(--v4-text);
  background: rgba(26, 25, 24, .9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.hero-v4__map-btn svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero-v4__map-btn[aria-pressed="false"] { color: var(--v4-quiet); background: rgba(26, 25, 24, .7); }
.hero-v4__map-btn:hover { border-color: rgba(233, 228, 220, .32); }
/* Live traffic, as EXCAR Mobile's Trips map button (TrafficCone): off by default, blue fill while on. */
.hero-v4__map-btn--traffic[aria-pressed="false"] { color: var(--v4-text); background: var(--v4-surface-strong); }
.hero-v4__map-btn--traffic[aria-pressed="true"] { border-color: #3996ef; color: #fff; background: #3996ef; }
.hero-v4__map-btn:focus-visible, .hero-v4__map-load:focus-visible { outline: 2px solid #8fd5ff; outline-offset: 2px; }

/* Markers, as in EXCAR Mobile's trip map and photo pins. AdvancedMarker anchors at the bottom centre. */
.hero-v4__map-dot { display: block; border-radius: 50%; transform: translateY(50%); }
.hero-v4__map-dot--start { width: 15px; height: 15px; border: 3.5px solid var(--v4-green); background: #1a1918; box-sizing: border-box; }
.hero-v4__map-dot--end { width: 13px; height: 13px; border: 2.5px solid #1a1918; background: var(--v4-text); box-sizing: border-box; }
.hero-v4__map-person { display: block; width: 46px; height: 46px; filter: drop-shadow(0 2.5px 3px rgba(0, 0, 0, .34)); }
.hero-v4__map-person svg { display: block; width: 100%; height: 100%; }

.hero-v4__map-person { cursor: pointer; transition: transform .2s ease, filter .2s ease; transform-origin: 50% 100%; }
.hero-v4__map-person:hover { transform: scale(1.08); }
.hero-v4__map-person.is-selected { transform: scale(1.18); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)) drop-shadow(0 0 10px rgba(148, 102, 236, .55)); }
/* The person card: EXCAR Mobile's compact place panel (overlay #1A1918, hairline #2B2927, radius 20, 13/18 lines),
   floating over the bottom of the map like the app's. */
.hero-v4__person {
  position: absolute;
  z-index: 4;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: grid;
  gap: 5px;
  padding: 8px 10px 9px;
  border: 1px solid #2b2927;
  border-radius: 18px;
  color: var(--v4-text);
  background: rgba(26, 25, 24, .96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  font-family: var(--font-body);
  animation: v4-person-in .28s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-v4__person[hidden] { display: none; }
@keyframes v4-person-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero-v4__person p { margin: 0; }
.hero-v4__person-head { display: flex; align-items: center; gap: 10px; }
.hero-v4__person-photo { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px #fff, 0 0 0 3.5px #9466ec; margin: 3px 2px 3px 3px; }
.hero-v4__person-who { flex: 1; min-width: 0; }
.hero-v4__person-name { font: 600 15px/20px var(--font-body); letter-spacing: -.01em; }
.hero-v4__person-kind { color: #bdb7ae; font: 400 12.5px/17px var(--font-body); }
.hero-v4__person-close { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; align-self: flex-start; padding: 0; border: 1px solid #2b2927; border-radius: 50%; color: var(--v4-text); background: #292827; cursor: pointer; }
.hero-v4__person-close:focus-visible { outline: 2px solid var(--v4-brand); outline-offset: 2px; }
.hero-v4__person-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.hero-v4__person-row { display: flex; align-items: center; gap: 7px; min-width: 0; color: #bdb7ae; font: 400 12.5px/17px var(--font-body); }
.hero-v4__person-row svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: #928d85; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-v4__person-row > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-v4__person-label { color: var(--v4-text); font-weight: 600; }
.hero-v4__person-place > .hero-v4__person-rel { flex: 0 0 auto; margin-left: auto; padding: 2px 9px; border: 1px solid rgba(148, 102, 236, .45); border-radius: 99px; color: #c9b3f7; background: rgba(148, 102, 236, .12); font: 600 12px/16px var(--font-body); }
.hero-v4__person-ask { color: #928d85; }
.hero-v4__person-ask > span:last-child { white-space: normal; }
.hero-v4__person-ask svg { stroke: var(--v4-brand); }
.hero-v4__trip-legend { display: flex; flex-wrap: wrap; gap: .4em 1.1em; margin: .8em 0 0; padding: 0; list-style: none; color: var(--v4-quiet); font: 400 .72em/1.2 var(--font-body); }
.hero-v4__trip-legend li { display: inline-flex; align-items: center; gap: .45em; }
.hero-v4__trip-legend li::before { content: ''; flex: 0 0 auto; width: .8em; height: .8em; border-radius: 50%; }
.hero-v4__trip-legend .is-start::before { border: 2px solid var(--v4-green); }
.hero-v4__trip-legend .is-end::before { background: var(--v4-text); }
.hero-v4__trip-legend .is-route::before { width: 1.2em; height: .3em; border-radius: 99px; background: var(--v4-brand); }

/* Score cards: the web port of EXCAR Mobile's compact ScoreGaugeCard and Gauge (gaugeMath.ts), same geometry and
   colours. The values are examples; the hero's note says so. */
.hero-v4__scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.v4-score {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 12px 12px 8px;
  overflow: hidden;
  border: 1px solid rgba(233, 228, 220, .15);
  border-radius: 20px;
  background: rgba(26, 25, 24, .86);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: hero-v4-rise 1s cubic-bezier(.2, .7, .2, 1) .55s both;
}
.v4-score + .v4-score { animation-delay: .65s; }
.v4-score::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(233, 228, 220, .07), rgba(233, 228, 220, 0) 55%);
  pointer-events: none;
}
.v4-score__head { position: relative; display: flex; align-items: center; gap: 8px; min-height: 28px; }
.v4-score__title { flex: 1; min-width: 0; overflow: hidden; color: var(--v4-text); font: 700 16px/21px var(--font-body); letter-spacing: -.2px; white-space: nowrap; text-overflow: ellipsis; }
.v4-score__chevron { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--v4-text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.v4-score__gauge { position: relative; display: flex; justify-content: center; margin: -14px -12px -6px; }
.v4-gauge { display: block; width: 100%; max-width: 168px; height: auto; overflow: visible; }
.v4-gauge__value { fill: #e9e4dc; font-family: var(--font-body); font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.v4-gauge__suffix { fill: #bdb7ae; font-family: var(--font-body); font-weight: 500; font-variant-numeric: tabular-nums; }
/* One sweep in, as the app does on first draw; nothing repeats. */
.v4-gauge__sweep { animation: v4-gauge-sweep .9s cubic-bezier(.33, 1, .68, 1) .7s both; }
.v4-gauge__tip { animation: hero-v4-fade .3s ease 1.45s both; }
@keyframes v4-gauge-sweep { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: var(--off); } }

/* The score cards are buttons: each opens its detail sheet. */
button.v4-score { width: 100%; margin: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .2s ease, transform .2s ease, background-color .2s ease; }
button.v4-score > span { display: flex; }
button.v4-score { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (hover: hover) {
  button.v4-score:hover { border-color: rgba(233, 228, 220, .28); background-color: rgba(32, 31, 30, .9); }
  button.v4-score:hover .v4-score__chevron { transform: translateX(2px); }
}
button.v4-score:active { background-color: rgba(36, 35, 33, .92); }
button.v4-score:focus { outline: none; }
button.v4-score:focus-visible { outline: 2px solid var(--v4-brand); outline-offset: 3px; }
button.v4-score.is-quiet-focus:focus-visible { outline: none; }
.v4-sheet__title:focus, .v4-sheet__panel:focus { outline: none; }
.v4-score__chevron { transition: transform .2s ease; }

/* Detail sheets (Driver Score, Vehicle Health): EXCAR Mobile's sheet language (surface #1A1918, radius 28 at the top,
   section cards at 20, 13/18 body) as a centred panel on wide screens and a bottom sheet on phones. */
.v4-sheet {
  --sheet-w: 560px;
  --v4-text: #e9e4dc;
  --v4-brand: #1e91ff;
  width: min(var(--sheet-w), calc(100vw - 32px));
  max-width: none;
  max-height: min(860px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(233, 228, 220, .14);
  border-radius: 28px;
  color: var(--v4-text);
  background: #151413;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .3);
  font-family: var(--font-body);
}
.v4-sheet::backdrop { background: rgba(6, 8, 12, .62); -webkit-backdrop-filter: blur(10px) saturate(.9); backdrop-filter: blur(10px) saturate(.9); }
.v4-sheet[open] { animation: v4-sheet-in .42s cubic-bezier(.2, .8, .2, 1) both; }
.v4-sheet[open]::backdrop { animation: hero-v4-fade .3s ease both; }
@keyframes v4-sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.v4-sheet__panel {
  position: relative;
  max-height: min(860px, calc(100dvh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 24px;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--sheet-glow, rgba(255, 184, 71, .12)), transparent 60%),
    linear-gradient(180deg, #1a1918, #131211 70%);
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 228, 220, .2) transparent;
}
.v4-sheet--health { --sheet-glow: rgba(41, 242, 159, .1); }
.v4-sheet__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v4-sheet__eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: #bdb7ae; font: 600 12px/16px var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.v4-sheet__tag { padding: 3px 8px; border: 1px solid rgba(233, 228, 220, .16); border-radius: 99px; color: #928d85; font-size: 10.5px; letter-spacing: .06em; }
.v4-sheet__close { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 1px solid #2b2927; border-radius: 50%; color: var(--v4-text); background: #292827; cursor: pointer; transition: background-color .2s ease; }
.v4-sheet__close:hover { background: #34322f; }
.v4-sheet__close:focus-visible { outline: 2px solid var(--v4-brand); outline-offset: 2px; }
.v4-sheet__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.v4-sheet__title { margin: 10px 0 0; font: 700 clamp(26px, 4vw, 32px)/1.1 var(--font-display, var(--font-body)); letter-spacing: -.02em; }
.v4-sheet__hero { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 18px; padding: 16px 18px; border: 1px solid rgba(57, 150, 239, .2); border-radius: 22px; background: rgba(26, 25, 24, .8); }
.v4-sheet__gauge { display: flex; justify-content: center; }
.v4-gauge--sheet { max-width: 148px; }
.v4-sheet[open] .v4-gauge__sweep { animation: v4-gauge-sweep .9s cubic-bezier(.33, 1, .68, 1) .18s both; }
.v4-sheet[open] .v4-gauge__tip { animation: hero-v4-fade .3s ease .95s both; }
.v4-sheet__state { margin: 0; font: 700 20px/26px var(--font-body); letter-spacing: -.01em; }
.v4-sheet__state.is-amber { color: #ffc56a; }
.v4-sheet__state.is-green { color: #45d69a; }
.v4-sheet__basis { margin: 6px 0 0; color: #bdb7ae; font: 400 13px/18px var(--font-body); }
.v4-sheet__section { margin-top: 12px; padding: 16px 18px; border: 1px solid #2b2927; border-radius: 20px; background: rgba(26, 25, 24, .72); }
.v4-sheet__h { margin: 0; font: 600 16px/22px var(--font-body); letter-spacing: -.01em; }
.v4-sheet__lead { margin: 4px 0 0; color: #bdb7ae; font: 400 13px/18px var(--font-body); }
.v4-sheet__fine { margin: 10px 0 0; color: #928d85; font: 400 12.5px/17px var(--font-body); }
.v4-sheet__foot { margin: 16px 4px 0; color: #928d85; font: 400 12px/17px var(--font-body); }

/* Driver Score: the two behaviours, the worked rule and the curve. */
.v4-factors { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.v4-factor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 12px 14px; border-radius: 14px; background: #1f1e1d; }
.v4-factor__name { display: grid; gap: 2px; font: 600 14px/19px var(--font-body); }
.v4-factor__name small { color: #928d85; font: 400 12px/16px var(--font-body); }
.v4-factor__nums { grid-row: 1; grid-column: 2; color: #bdb7ae; font: 400 13px/18px var(--font-body); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.v4-factor__nums b { color: var(--v4-text); font-weight: 700; }
.v4-factor__bar { position: relative; grid-column: 1; height: 6px; border-radius: 99px; background: #2e2c2a; }
.v4-factor__bar > span { position: absolute; inset: 0 auto 0 0; width: var(--you); border-radius: inherit; background: linear-gradient(90deg, #3b8f6b, #45d69a); }
.v4-factor.is-high .v4-factor__bar > span { background: linear-gradient(90deg, #a87a33, #ffc56a); }
.v4-factor__bar::after { content: ''; position: absolute; top: -4px; bottom: -4px; left: var(--usual); width: 2px; border-radius: 2px; background: rgba(233, 228, 220, .7); }
.v4-factor__ratio { grid-column: 2; color: #45d69a; font: 700 14px/18px var(--font-body); font-variant-numeric: tabular-nums; text-align: right; }
.v4-factor.is-high .v4-factor__ratio { color: #ffc56a; }
.v4-steps { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: v4step; }
.v4-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #262422; counter-increment: v4step; }
.v4-steps li:first-child { border-top: 0; }
.v4-steps li::before { content: counter(v4step); grid-row: 1 / span 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #bdb7ae; background: #292827; font: 600 12px/1 var(--font-body); }
.v4-steps li > span:first-of-type { font: 500 14px/19px var(--font-body); }
.v4-steps li > span:nth-of-type(2) { grid-row: 2; grid-column: 2; color: #928d85; font: 400 12.5px/17px var(--font-mono, ui-monospace, monospace); }
.v4-steps li > b { grid-row: 1 / span 2; grid-column: 3; font: 700 15px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.v4-steps li.is-result > b { color: #ffc56a; font-size: 22px; }
.v4-steps sup { font-size: .75em; }
.v4-sheet__figure { margin: 8px 0 0; }
.v4-sheet__figure figcaption { margin-top: 4px; color: #928d85; font: 400 12.5px/17px var(--font-body); }
.v4-curve { display: block; width: 100%; height: auto; overflow: visible; }
.v4-curve__grid { stroke: #2b2927; stroke-width: 1; }
.v4-curve__y { fill: #6f6b65; font: 500 10px/1 var(--font-body); text-anchor: end; dominant-baseline: central; }
.v4-curve__x { fill: #928d85; font: 500 10px/1 var(--font-body); text-anchor: middle; }
.v4-curve__x.is-start { text-anchor: start; }
.v4-curve__x.is-end { text-anchor: end; }
.v4-curve__x.is-you { fill: #ffc56a; text-anchor: start; }
.v4-curve__line { fill: none; stroke: #ffb847; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.v4-curve__drop { stroke: rgba(233, 228, 220, .3); stroke-width: 1; stroke-dasharray: 3 3; }
.v4-curve__drop.is-you { stroke: rgba(255, 197, 106, .55); }
.v4-curve__base { fill: #151413; stroke: #e9e4dc; stroke-width: 1.6; }
.v4-curve__halo { fill: rgba(255, 184, 71, .22); }
.v4-curve__you { fill: #fff2de; stroke: #ffb847; stroke-width: 2; }
.v4-curve__label { fill: #ffc56a; font: 700 13px/1 var(--font-body); }
.v4-progress { display: grid; gap: 6px; margin-top: 12px; }
.v4-progress p { display: flex; justify-content: space-between; margin: 4px 0 0; color: #bdb7ae; font: 400 13px/18px var(--font-body); }
.v4-progress p b { color: var(--v4-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.v4-progress__bar { display: block; height: 6px; border-radius: 99px; background: #2e2c2a; overflow: hidden; }
.v4-progress__bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2a6fb3, #3996ef); }

/* Vehicle Health: the sum, the one deduction, what was checked and what is not covered. */
.v4-equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 8px; margin: 12px 0 0; }
.v4-equation__term { display: grid; align-content: center; gap: 4px; padding: 12px 10px; border: 1px solid #2b2927; border-radius: 14px; background: #1f1e1d; font: 700 24px/1 var(--font-body); font-variant-numeric: tabular-nums; text-align: center; }
.v4-equation__term small { color: #928d85; font: 500 11.5px/14px var(--font-body); }
.v4-equation__term.is-deduct { color: #ffc56a; }
.v4-equation__term.is-result { border-color: rgba(69, 214, 154, .35); color: #45d69a; background: rgba(69, 214, 154, .07); }
.v4-equation__op { align-self: center; color: #928d85; font: 500 20px/1 var(--font-body); }
.v4-reason { margin-top: 12px; padding: 12px 14px; border-left: 4px solid #ffc56a; border-radius: 14px; background: #1f1e1d; }
.v4-reason p { margin: 0; }
.v4-reason .v4-sheet__fine { margin-top: 8px; }
.v4-reason__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.v4-reason__name { font: 600 15px/20px var(--font-body); }
.v4-reason__pts { color: #ffc56a; font: 700 14px/18px var(--font-body); font-variant-numeric: tabular-nums; }
.v4-reason__what { margin-top: 2px !important; color: #bdb7ae; font: 400 13px/18px var(--font-body); }
.v4-reason__code { margin-top: 10px !important; color: var(--v4-text); font: 400 13px/18px var(--font-body); }
.v4-chip { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid #2b2927; border-radius: 99px; color: #bdb7ae; background: #1f1e1d; font: 500 12px/16px var(--font-body); }
.v4-reason__code .v4-chip { margin-right: 6px; color: #ffc56a; border-color: rgba(255, 197, 106, .3); font-family: var(--font-mono, ui-monospace, monospace); }
.v4-systems { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.v4-systems li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid #262422; }
.v4-systems li:first-child { border-top: 0; }
.v4-systems span { font: 500 14px/19px var(--font-body); }
.v4-systems small { color: #928d85; font: 400 12.5px/17px var(--font-body); }
.v4-systems b { min-width: 30px; font: 700 14px/1 var(--font-body); font-variant-numeric: tabular-nums; text-align: right; }
.v4-dot { width: 8px; height: 8px; border-radius: 50%; background: #a39e96; }
.v4-dot.is-green { background: #45d69a; box-shadow: 0 0 0 3px rgba(69, 214, 154, .14); }
.v4-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }

@media (max-width: 640px) {
  /* Phones: a plain bottom sheet. No blur behind it and no moving transform: some Android GPUs tear the sheet
     when a blurred backdrop and a transformed dialog are composited over the hero's layers. */
  .v4-sheet { width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
  .v4-sheet .v4-sheet__panel { max-height: 92dvh; }
  .v4-sheet::backdrop { background: rgba(4, 6, 10, .86); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .v4-sheet[open] { animation: hero-v4-fade .22s ease both; }
  .v4-sheet[open] .v4-gauge__sweep, .v4-sheet[open] .v4-gauge__tip { animation: none; }
  /* While a sheet is open, the stage behind it (map, glass cards) leaves the compositor. */
  html.v4-sheet-open .hero-v4__stage { visibility: hidden; }
  .v4-sheet__panel { padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
  .v4-sheet__hero { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; }
  .v4-factor { grid-template-columns: 1fr; }
  .v4-factor__nums, .v4-factor__ratio { grid-column: 1; grid-row: auto; text-align: left; }
  .v4-equation { grid-template-columns: 1fr auto 1fr auto 1fr; gap: 5px; }
  .v4-equation__term { padding: 10px 4px; font-size: 20px; }
  .v4-systems li { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .v4-systems small { display: none; }
}
/* Page scroll locked while a sheet is open, keeping the scrollbar's gutter so nothing shifts sideways. */
html.v4-sheet-open { overflow: hidden; scrollbar-gutter: stable; }

/* Homepage nav: transparent over the scene until the page scrolls (homepage only, this file loads only there). */
body:has(.hero-v4) nav:not(.scrolled) { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* The phone menu always gets a solid backdrop, even at the top of the page. */
body:has(.hero-v4) nav:has(.nav-mobile.open) { background: rgba(5, 8, 14, .97); border-bottom-color: rgba(233, 228, 220, .08); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.hero-v4__actions .home-v3-text-link { display: inline-flex; align-items: center; min-height: 44px; }

/* Fallback: the environment image failed, so show the previous opening scene and its grille scanner. */
.hero-v4__legacy { position: absolute; inset: 0; z-index: 3; }
.hero-v4--fallback .hero-v4__scene,
.hero-v4--fallback .hero-v4__note { display: none; }

/* ── Narrower desktops: keep the road bend and the car in frame ── */
@media (min-width: 900px) and (max-width: 1279px) and (min-aspect-ratio: 4/5) {
  .hero-v4__scene { --fx: .9; }
  .hero-v4__content { width: min(560px, 50%); }
}

/* Fallback scene on wide screens: the old car sits on the left, so the copy returns to the right as in V3 and the
   interface stays out of its way. */
@media (min-width: 900px) and (min-aspect-ratio: 4/5) {
  .hero-v4--fallback .hero-v4__content { left: auto; right: 7.5vw; top: 50%; width: min(34vw, 470px); transform: translateY(-50%); }
  .hero-v4--fallback .hero-v4__title { font-size: clamp(34px, 3.4vw, 54px); }
  .hero-v4--fallback .hero-v4__stage { display: none; }
}

/* ── Phones and portrait tablets: an independent composition ──
   Copy flows at the top over the open sky, the Trips panel follows, and the scene is anchored to the bottom. */
@media (max-width: 899px), (max-aspect-ratio: 4/5) {
  .hero-v4 {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
    background: linear-gradient(180deg, #02091a 0%, #020b1d 40%, #041228 62%, #05080e 100%);
  }
  .hero-v4__sky { --sky-depth: 64%; }
  .hero-v4__scene {
    --sw: max(100cqw, min(230cqw, 64cqh * 1.7778));
    --fx: .97;
    top: auto;
    bottom: 0;
    transform: none;
  }
  .hero-v4__shade { background: linear-gradient(180deg, transparent 50%, rgba(1, 5, 12, .25) 100%); }
  .hero-v4__car { left: 85.4%; top: 61.8%; width: 7%; }
  .hero-v4__scrim { background: linear-gradient(180deg, rgba(1, 5, 13, .5) 0%, rgba(1, 5, 13, 0) 12%), linear-gradient(180deg, transparent 84%, rgba(4, 7, 12, .6) 94%, #05080e 100%); }
  .hero-v4__content {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    padding: calc(64px + clamp(26px, 6svh, 60px)) 22px 0;
  }
  .hero-v4__title { max-width: 11em; font-size: clamp(36px, 10.4vw, 58px); line-height: 1; }
  .hero-v4__lead { max-width: 31ch; margin-top: 16px; font-size: 15px; }
  .hero-v4__actions { gap: 12px 20px; margin-top: 22px; }
  .hero-v4__actions .home-v3-button { min-height: 46px; padding: 0 20px; font-size: 13px; }
  .hero-v4__actions .home-v3-text-link { font-size: 13px; }
  .hero-v4__fine { margin-top: 14px; font-size: 10px; }
  .hero-v4__stage {
    position: relative;
    right: auto;
    top: auto;
    width: auto;
    flex: 1 0 auto;
    min-height: 0;
    /* Room under the cards for the road, the bay lights and the distant car. */
    padding: clamp(30px, 6svh, 48px) 22px clamp(170px, 46vw, 320px);
    font-size: clamp(11.5px, 3.2vw, 15px);
  }
  .hero-v4__stack { width: min(34em, 100%); margin-inline: auto; }
  .hero-v4__trip-map { aspect-ratio: 4 / 3; }
  .hero-v4__note { right: 16px; bottom: 12px; font-size: 9px; }
  .hero-v4--fallback .hero-v4__content { padding-top: calc(64px + clamp(26px, 6svh, 60px)); }
}

/* Portrait screens use the cropped environment (see the <picture> source): it holds the right 72 % of the art. */
@media (max-aspect-ratio: 1/1) {
  .hero-v4__env img { left: 27.97%; width: 72.03%; }
}

/* Landscape phones and heavy zoom: a shorter headline so the actions stay in the first view. */
@media (max-width: 899px) and (max-height: 520px) and (orientation: landscape) {
  .hero-v4__content { padding-top: 84px; max-width: 640px; }
  .hero-v4__title { font-size: clamp(30px, 8.6vh, 40px); max-width: 15em; }
  .hero-v4__lead { margin-top: 12px; font-size: 14px; max-width: 46ch; }
  .hero-v4__actions { margin-top: 16px; }
  .hero-v4__stage { min-height: 0; padding-bottom: 60px; }
  .hero-v4__stack { width: min(27em, 62%); }
}

/* Very short landscape viewports: let the hero grow instead of clipping the copy or the panel. */
@media (max-height: 640px) and (min-width: 900px) {
  .hero-v4 { height: auto; min-height: 640px; }
}

/* ── Motion: one gentle entrance, then only the sky's slow drift and twinkle ── */
@keyframes hero-v4-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-v4-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes hero-v4-breathe { from { opacity: .9; } to { opacity: 1; } }
@keyframes hero-v4-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes hero-v4-twinkle { from { opacity: var(--tw-min); } to { opacity: var(--tw-max); } }

.hero-v4.is-paused :is(.hero-v4__layer, .hero-v4__twinkle, .hero-v4__glows) { animation-play-state: paused; }
html.v4-sheet-open .hero-v4 :is(.hero-v4__layer, .hero-v4__twinkle, .hero-v4__glows) { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hero-v4 *,
  .hero-v4 *::before,
  .hero-v4 *::after { animation: none !important; transition: none !important; }
  .hero-v4__sky, .hero-v4__scene { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .v4-sheet[open], .v4-sheet[open]::backdrop, .v4-sheet .v4-gauge__sweep, .v4-sheet .v4-gauge__tip { animation: none !important; } }
/* Google refused the key: hide its error tile, keep our quiet notice. */
.hero-v4__trip-map[data-state="unavailable"] .hero-v4__map-canvas { visibility: hidden; }
