/* ==========================================================================
   HOME — HERO · "The Urbania arrives"
   Bright Chennai coast-road scene. The Force Urbania drives in from the
   right and settles while the hero copy reveals alongside it.
   Motion is driven by js/hero-arrival.js (plain JavaScript). Loaded on index.php only.
   ========================================================================== */
.hero.hero--arrival {
  /* hero-local palette (uses site tokens where possible) */
  --arr-sky: #f7efe4;
  --arr-ink: var(--ink);
  --arr-text: rgba(8, 9, 9, 0.68);
  --arr-line: rgba(8, 9, 9, 0.16);
  --arr-accent: var(--coral-deep);

  /* scene metrics: background is 1920×1088, road surface sits near its bottom */
  --H: clamp(600px, 86vh, 860px);
  --s: max(calc(100vw / 1920), calc(var(--H) / 1088));
  --ground: calc(var(--s) * 128);
  --van-w: min(52vw, 860px);

  position: relative; isolation: isolate; overflow: hidden;
  display: block; height: var(--H); min-height: 0; max-height: none;
  background: var(--arr-sky); color: var(--arr-ink);
}
@supports (height: 100svh) { .hero.hero--arrival { --H: clamp(600px, 86svh, 860px); } }

.arrival__scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.arrival__scene picture { position: absolute; inset: 0; }
.arrival__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 72% 100%;
  transform-origin: 70% 80%;
}
/* soft haze for text legibility on the left + under the header */
.arrival__wash {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(250, 245, 238, 0.92) 0%, rgba(250, 245, 238, 0.72) 26%, rgba(250, 245, 238, 0.18) 46%, transparent 60%),
    linear-gradient(180deg, rgba(250, 245, 238, 0.55) 0%, transparent 18%),
    linear-gradient(0deg, rgba(250, 245, 238, 0.35) 0%, transparent 14%);
}

/* minimal Chennai route graphic in the sky */
.arrival__route {
  position: absolute; right: 4vw; top: calc(var(--header-h) + 18px);
  width: min(40vw, 600px); height: auto; overflow: visible;
}
.arrival__route-base { stroke: rgba(8, 9, 9, 0.14); stroke-width: 1.2; stroke-dasharray: 3 6; }
.arrival__route-line { stroke: var(--coral); stroke-width: 1.6; stroke-linecap: round; opacity: 0.75; }
.arrival__pin circle { fill: var(--coral); stroke: rgba(255, 255, 255, 0.9); stroke-width: 2; }
.arrival__pin text {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase;
  fill: rgba(8, 9, 9, 0.55);
}

/* ---------- the Urbania ---------- */
.arrival__van {
  position: absolute; z-index: 2;
  right: max(2.5vw, calc((100vw - 1560px) / 2)); bottom: var(--ground);
  width: var(--van-w); aspect-ratio: 1200 / 504;
  will-change: transform;
}
.arrival__body, .arrival__ghost { position: absolute; inset: 0; transform-origin: 50% 96%; }
.arrival__img, .arrival__ghost img { position: absolute; inset: 0; width: 100%; height: 100%; }
.arrival__img { filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.18)); }
.arrival__ghost { opacity: 0; will-change: transform, opacity; }
.arrival__ghost img { filter: blur(1.5px); }
/* rotating rims sit exactly over the photo's wheels (coords from the 1200×504 cut-out) */
.arrival__wheel {
  position: absolute; width: 7.3333%; height: auto; aspect-ratio: 1;
  will-change: transform;
}
.arrival__wheel--front { left: 7.9167%; top: 78.373%; }
.arrival__wheel--rear { left: 71%; top: 78.571%; }

/* grounded contact shadow that travels with the vehicle */
.arrival__shadow {
  position: absolute; left: 1%; right: 2%; bottom: -5%; height: 13%;
  background:
    radial-gradient(9% 60% at 11.5% 50%, rgba(10, 10, 12, 0.55), transparent 70%),
    radial-gradient(9% 60% at 74.5% 50%, rgba(10, 10, 12, 0.55), transparent 70%),
    radial-gradient(52% 55% at 46% 50%, rgba(10, 10, 12, 0.42), transparent 72%);
}
/* speed streaks behind the van (visible only while moving fast) */
.arrival__streaks { position: absolute; left: 92%; top: 0; bottom: 0; width: 60%; opacity: 0; transform-origin: 0 50%; }
.arrival__streaks i {
  position: absolute; left: 0; top: var(--y); height: 1.5px; width: var(--w);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  border-radius: 2px;
}

/* ---------- copy ---------- */
.arrival__content {
  position: relative; z-index: 3;
  height: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 8px) var(--gutter) calc(var(--ground) + 24px);
}
.arrival__label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(8, 9, 9, 0.7);
}
.arrival__label::before { content: ""; width: 26px; height: 1px; background: var(--coral); }
.arrival__label b { color: var(--arr-accent); font-weight: 700; }
.arrival__title {
  margin-top: 14px;
  font-family: var(--ff); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.6rem, 4.1vw, 3.6rem); line-height: 0.96; letter-spacing: -0.035em;
  color: var(--arr-ink);
}
.arrival__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.arrival__title .line > span { display: inline-block; }
.arrival__title em { font-style: normal; color: var(--arr-accent); }
.arrival__text { margin-top: 18px; max-width: 36ch; font-size: 16px; line-height: 1.65; color: var(--arr-text); }
.arrival__actions { margin-top: 28px; }
.hero--arrival .btn--outline-dark { box-shadow: inset 0 0 0 1px rgba(8, 9, 9, 0.32); background: rgba(255, 255, 255, 0.35); }

.arrival__hud {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 18px;
  display: none; justify-content: space-between; align-items: center;
  padding: 0 var(--gutter); max-width: var(--maxw); margin: 0 auto;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(8, 9, 9, 0.55);
}
.arrival__hud .scroll-cue { color: rgba(8, 9, 9, 0.7); }
.arrival__hud .scroll-cue i { background: rgba(8, 9, 9, 0.2); }

/* Header links sit on a bright scene while the page is at the very top */
.page-home .site-header:not(.is-scrolled) .nav__link { color: rgba(8, 9, 9, 0.72); }
.page-home .site-header:not(.is-scrolled) .nav__link:hover,
.page-home .site-header:not(.is-scrolled) .nav__link[aria-current="page"] { color: var(--ink); }
.page-home .site-header:not(.is-scrolled) .brand { box-shadow: 0 6px 18px -10px rgba(8, 9, 9, 0.35); }

/* ---------- initial (pre-animation) state — only when JS will animate ---------- */
.js .hero--arrival .arrival__van,
.js .hero--arrival .arrival__label,
.js .hero--arrival .arrival__text,
.js .hero--arrival .arrival__actions .btn,
.js .hero--arrival .arrival__hud { opacity: 0; }
.js .hero--arrival .arrival__title .line > span { transform: translateY(110%); }
.js .hero--arrival .arrival__route-line { stroke-dasharray: 900; stroke-dashoffset: 900; }
/* failsafe: if the script never runs, show the finished composition */
.js .hero--arrival:not(.arrival-on) .arrival__van,
.js .hero--arrival:not(.arrival-on) .arrival__label,
.js .hero--arrival:not(.arrival-on) .arrival__text,
.js .hero--arrival:not(.arrival-on) .arrival__actions .btn,
.js .hero--arrival:not(.arrival-on) .arrival__hud,
.js .hero--arrival:not(.arrival-on) .arrival__title .line > span,
.js .hero--arrival:not(.arrival-on) .arrival__route-line { animation: arrivalFailsafe 0.5s ease-out 1.2s forwards; }
@keyframes arrivalFailsafe { to { opacity: 1; transform: none; stroke-dashoffset: 0; } }
.hero--arrival.arrival-static .arrival__van,
.hero--arrival.arrival-static .arrival__label,
.hero--arrival.arrival-static .arrival__text,
.hero--arrival.arrival-static .arrival__actions .btn,
.hero--arrival.arrival-static .arrival__hud { opacity: 1; }
.hero--arrival.arrival-static .arrival__title .line > span { transform: none; }
.hero--arrival.arrival-static .arrival__route-line { stroke-dashoffset: 0; }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  .arrival__hud { display: flex; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .hero.hero--arrival { --van-w: 47vw; }
  .arrival__title { font-size: 2.6rem; }
  .arrival__text { max-width: 32ch; font-size: 15px; }
}

/* ---------- tablet & mobile: compact stacked composition ---------- */
@media (max-width: 1023px) {
  .hero.hero--arrival {
    --van-w: min(94vw, 680px);
    --van-h: calc(var(--van-w) * 0.42);
    /* scene = header + breathing room + van + road (ground ≈ 0.1176 × scene height) */
    --H: calc((var(--header-h) + 26px + var(--van-h)) / 0.86);
    --s: max(calc(100vw / 1920), calc(var(--H) / 1088));
    --ground: calc(var(--s) * 128);
    height: auto;
    background: linear-gradient(180deg, var(--arr-sky) 0%, #f4ede3 100%);
  }
  @supports (height: 100svh) { .hero.hero--arrival { --H: calc((var(--header-h) + 26px + var(--van-h)) / 0.86); } }
  .arrival__scene { position: relative; inset: auto; height: var(--H); }
  .arrival__scene picture { inset: 0; }
  .arrival__bg {
    object-position: 64% 100%;
    -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 12%);
    mask-image: linear-gradient(0deg, transparent 0%, #000 12%);
  }
  .arrival__wash {
    background:
      linear-gradient(180deg, rgba(250, 245, 238, 0.6) 0%, rgba(250, 245, 238, 0.1) 30%, transparent 50%),
      linear-gradient(0deg, rgba(244, 237, 227, 1) 0%, rgba(244, 237, 227, 0) 12%);
  }
  .arrival__route { display: none; }
  .arrival__van { right: 50%; margin-right: calc(var(--van-w) / -2); }
  .arrival__content {
    height: auto; display: block;
    padding: 8px var(--gutter) 36px;
  }
  .arrival__title { font-size: clamp(2.15rem, 9.6vw, 3rem); }
  .arrival__text { margin-top: 14px; font-size: 15px; max-width: 40ch; }
  .arrival__actions { margin-top: 22px; display: grid; gap: 10px; }
  .arrival__actions .btn { width: 100%; }
}
@media (min-width: 480px) and (max-width: 1023px) {
  .arrival__actions { display: flex; flex-wrap: wrap; gap: 12px; }
  .arrival__actions .btn { width: auto; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .arrival__content { padding: 22px var(--gutter) 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero--arrival .arrival__van,
  .js .hero--arrival .arrival__label,
  .js .hero--arrival .arrival__text,
  .js .hero--arrival .arrival__actions .btn,
  .js .hero--arrival .arrival__hud { opacity: 1 !important; }
  .js .hero--arrival .arrival__title .line > span { transform: none !important; }
  .js .hero--arrival .arrival__route-line { stroke-dashoffset: 0 !important; }
}

/* keep the skewed hover fill fully hidden at rest on the light outline button */
.hero--arrival .btn--outline-dark:not(:hover):not(:focus-visible)::before { transform: translateX(-115%) skewX(-12deg); }
