/* WhipWashPro — scroll-scrubbed cinematic hero
   Namespaced wwp-hero- throughout so this never collides with theme/Elementor CSS.
   All text/color rules are scoped under .wwp-hero-root per the readability fix. */

:root {
  --wwp-navy: #04081a;
  --wwp-blue: #1c7bff;
  --wwp-orange: #ff7a1f;
  --wwp-white: #ffffff;
  --wwp-desc: rgba(255, 255, 255, 0.88);
  --wwp-support: rgba(255, 255, 255, 0.76);
  --wwp-track-vh: 500vh;
  --wwp-hold: 8vh; /* extra scroll room that holds the final frame before release */
}

#wwp-hero, #wwp-hero * { box-sizing: border-box; }

#wwp-hero {
  position: relative;
  background: var(--wwp-navy);
  color: var(--wwp-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── mandatory readability fix — every primary hero text node is forced
   white, scoped strictly to .wwp-hero-root so nothing outside the hero
   is touched and no global h1/p rule is ever written. !important is
   required here because the current live bug is a same-specificity (or
   stronger) Elementor/theme rule painting these elements navy directly,
   which plain inheritance from an ancestor color cannot beat. ────────── */
.wwp-hero-root,
.wwp-hero-root h1,
.wwp-hero-root h2,
.wwp-hero-root h3,
.wwp-hero-root p,
.wwp-hero-root li,
.wwp-hero-root .wwp-hero-description,
.wwp-hero-root .wwp-hero-availability {
  color: #ffffff !important;
}

/* refined hierarchy — same specificity as the block above, declared after
   it, so these win for the specific elements they target */
.wwp-hero-root h1 { color: #ffffff !important; }
.wwp-hero-root h2 { color: #ffffff !important; }
.wwp-hero-root .wwp-hero-description { color: var(--wwp-desc) !important; }
.wwp-hero-root .wwp-small-text,
.wwp-hero-root .wwp-hero-availability { color: var(--wwp-support) !important; }
.wwp-hero-root .wwp-eyebrow,
.wwp-hero-root .wwp-chapter-label { color: var(--wwp-orange) !important; }
.wwp-hero-root .wwp-points li { color: var(--wwp-white) !important; }
.wwp-hero-root .wwp-trust li { color: var(--wwp-white) !important; }
.wwp-hero-root a { color: var(--wwp-white); }
.wwp-hero-root .wwp-call-line a,
.wwp-hero-root .wwp-hero-availability a { color: var(--wwp-blue) !important; text-decoration: underline; }
.wwp-hero-root .wwp-call-line a:hover,
.wwp-hero-root .wwp-hero-availability a:hover { color: var(--wwp-orange) !important; }
.wwp-hero-root .wwp-btn { color: inherit; }

/* mobile-only compact copy variants — the full/desktop text stays in the
   DOM for SEO (no second H1, nothing removed, just visually swapped);
   desktop shows the wwp-h1-extra/wwp-desc-full/wwp-cta-desktop-only
   content exactly as before and never sees wwp-desc-short */
.wwp-desc-short { display: none; }

/* ── scroll track / sticky stage ───────────────────────── */

#wwp-hero-track {
  position: relative;
  height: calc(var(--wwp-track-vh) + var(--wwp-hold));
}

#wwp-hero-stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: var(--wwp-navy);
}

#wwp-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* text-contrast shade — a responsive left-side gradient only, calibrated
   to keep the car and technician clearly visible rather than dimming the
   whole frame */
#wwp-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(3, 10, 24, 0.90) 0%,
    rgba(3, 10, 24, 0.68) 36%,
    rgba(3, 10, 24, 0.18) 68%,
    rgba(3, 10, 24, 0.05) 100%
  );
}

@media (max-width: 900px) {
  /* content moves to the lower half on mobile — bias the gradient to
     protect that zone instead of the left edge, while keeping the top
     of the frame (where the car/technician read best at a glance) clear */
  #wwp-hero-shade {
    background:
      linear-gradient(180deg, rgba(3, 10, 24, 0.04) 0%, rgba(3, 10, 24, 0.35) 46%, rgba(3, 10, 24, 0.86) 100%),
      linear-gradient(90deg, rgba(3, 10, 24, 0.55) 0%, rgba(3, 10, 24, 0.22) 55%, rgba(3, 10, 24, 0.05) 100%);
  }
}

/* ── loading chrome ────────────────────────────────────── */

#wwp-hero-loader {
  position: absolute;
  inset: 0;
  z-index: 5; /* below #wwp-hero-copy (z 10): hero text is never covered */
  background: var(--wwp-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: opacity 0.6s ease;
}
#wwp-hero-loader.wwp-done { opacity: 0; pointer-events: none; }
#wwp-hero-loader .wwp-mark {
  font-size: 13px;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--wwp-blue);
  text-transform: uppercase;
  font-weight: 600;
}
#wwp-hero-loader .wwp-bar {
  width: 160px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}
#wwp-hero-loader .wwp-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wwp-blue), var(--wwp-orange));
  transition: width 0.15s ease;
}

/* ── copy overlay / chapter system (real semantic HTML, always in DOM) ── */

#wwp-hero-copy {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* Every chapter shares one anchor point so the system reads as consistent;
   each is absolutely positioned (never in normal flow) so an invisible
   chapter never pushes or squeezes the active one. */
.wwp-chapter {
  position: absolute;
  top: 50%;
  left: clamp(20px, 6vw, 88px);
  width: min(620px, 88vw);
  transform: translateY(-50%);
  pointer-events: none;
}

.wwp-chapter-inner {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
}
/* Chapter 1 is the real above-the-fold content: visible and sharp on the
   very first painted frame, with no dependence on JavaScript. JS only
   scrubs it out as the user scrolls. */
.wwp-chapter-1 .wwp-chapter-inner {
  opacity: 1;
  transform: none;
}

.wwp-eyebrow {
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.wwp-chapter-label {
  font-size: clamp(12px, 1.15vw, 14px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 12px;
  padding-left: 16px;
  position: relative;
}
.wwp-chapter-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 9px;
  height: 2px;
  background: var(--wwp-orange);
}

#wwp-hero-copy h1 {
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  max-width: 16ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

#wwp-hero-copy h2 {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 18ch;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.wwp-hero-description {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
  max-width: 46ch;
  margin: 0 0 18px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.wwp-points,
.wwp-trust {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.wwp-points {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 42ch;
}
.wwp-points li {
  font-size: clamp(13.5px, 1.1vw, 15.5px);
  font-weight: 600;
  padding-left: 24px;
  position: relative;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.wwp-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--wwp-orange);
  border-bottom: 2px solid var(--wwp-orange);
  transform: rotate(-45deg);
}
.wwp-points-4 { column-gap: 22px; }
@media (min-width: 560px) {
  .wwp-points-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; max-width: 46ch; }
}

.wwp-emphasis {
  font-size: clamp(14px, 1.2vw, 16.5px);
  font-style: italic;
  font-weight: 600;
  color: var(--wwp-desc) !important;
  margin: 0 0 4px;
}

.wwp-small-text {
  font-size: clamp(12.5px, 1.05vw, 14px);
  line-height: 1.5;
  margin: 0 0 6px;
}

.wwp-scroll-hint { margin-top: 2px; }
.wwp-call-line a { pointer-events: auto; }

.wwp-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0 0 24px;
  max-width: 48ch;
}
.wwp-trust li {
  font-size: clamp(12.5px, 1.1vw, 14.5px);
  font-weight: 600;
  background: rgba(4, 10, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 100px;
  padding: 7px 14px;
  white-space: nowrap;
}

.wwp-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 16px;
}

.wwp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  pointer-events: auto;
}
.wwp-btn-primary {
  background: var(--wwp-blue);
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(28, 123, 255, 0.4);
}
.wwp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(28, 123, 255, 0.55); background: #3d8aff; }
.wwp-btn-secondary {
  background: rgba(4, 10, 26, 0.6);
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}
.wwp-btn-secondary:hover { background: rgba(255, 255, 255, 0.14); border-color: #ffffff; }

/* visible keyboard focus everywhere in the hero */
#wwp-hero a:focus-visible,
#wwp-hero button:focus-visible {
  outline: 2px solid var(--wwp-orange);
  outline-offset: 3px;
  border-radius: 8px;
}

#wwp-hero-cue {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--wwp-support);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
#wwp-hero-cue::after {
  content: "";
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--wwp-blue), transparent);
  animation: wwp-cue 1.8s ease-in-out infinite;
}
@keyframes wwp-cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.35; }
}

/* ── reduced motion / no-JS / no-canvas fallback ──────────
   .wwp-static (added by JS, or already true via <noscript>) turns the
   hero into a single calm view: Chapter 1 in full, plus only the
   essential final CTA/trust info from Chapter 5 — no scroll required. */

#wwp-hero.wwp-static #wwp-hero-track { height: auto; }
#wwp-hero.wwp-static #wwp-hero-stage {
  position: relative;
  height: 100svh;
  height: 100dvh;
  min-height: 560px;
}
/* static layout grows with its content and clears the overlay header, so
   stacked copy can never be clipped by the stage or slide under the logo/nav */
#wwp-hero.wwp-static #wwp-hero-stage { height: auto; min-height: 100svh; min-height: 100dvh; }
#wwp-hero.wwp-static #wwp-hero-copy { position: relative; inset: auto; min-height: inherit; }
#wwp-hero.wwp-static #wwp-hero-canvas { display: none; }
#wwp-hero.wwp-static #wwp-hero-poster { display: block; }
#wwp-hero.wwp-static #wwp-hero-cue { display: none; }
#wwp-hero.wwp-static #wwp-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 150px 6vw 8vh; /* top padding clears the overlay header */
}
#wwp-hero.wwp-static .wwp-chapter {
  position: static !important;
  left: auto; top: auto; width: auto;
  max-width: 640px;
  transform: none !important;
}
#wwp-hero.wwp-static .wwp-chapter-inner {
  opacity: 1 !important;
  transform: none !important;
}
#wwp-hero.wwp-static .wwp-chapter-2,
#wwp-hero.wwp-static .wwp-chapter-3,
#wwp-hero.wwp-static .wwp-chapter-4 { display: none; }
/* Chapter 5 in static mode: keep only the trust pills + CTAs + call/availability */
#wwp-hero.wwp-static .wwp-chapter-5 .wwp-chapter-label,
#wwp-hero.wwp-static .wwp-chapter-5 h2,
#wwp-hero.wwp-static .wwp-chapter-5 .wwp-hero-description { display: none; }

#wwp-hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  display: none; /* shown only in the static/no-JS fallback */
}

/* no-JS: the <noscript> block renders its own copy of the hero markup
   using this same class, so it must work with zero script involvement */
.wwp-noscript #wwp-hero-loader { display: none; }

@media (prefers-reduced-motion: reduce) {
  #wwp-hero-cue { display: none; }
}

/* ── responsive ────────────────────────────────────────── */

@media (max-width: 900px) {
  .wwp-chapter { width: min(560px, 90vw); }
  #wwp-hero-copy h1 { max-width: 20ch; }
}

/* ── mobile & small-tablet (≤767px) — isolated override block ─────────
   Nothing in here is read by any desktop rule above; desktop's canvas
   math, chapter timings and layout are untouched. See hero.js
   isWwpHeroMobile() — the same 767px number gates the canvas cover/focal
   crop so CSS and JS agree on where "mobile" starts. */
@media (max-width: 767px) {
  #wwp-hero-stage {
    top: var(--wwp-header-offset, 0px);
    height: calc(100svh - var(--wwp-header-offset, 0px));
    /* floor is intentionally below every required test height (320×568 is
       the shortest) — a floor above the real viewport height would make
       this sticky box taller than what's on screen, and every bottom-
       anchored chapter below is positioned relative to ITS height, not
       the viewport, which pushes the CTAs off the bottom edge */
    min-height: 480px;
  }

  /* reserve room for the site's fixed mobile "Click to Call / Book Online"
     bar and the chat launcher — measured at runtime by hero.js
     (measureBottomBarHeight()), never guessed */
  .wwp-chapter {
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(var(--wwp-mobile-bottom-bar-height, 0px) + max(20px, env(safe-area-inset-bottom)) + 14px);
    width: 100%;
    transform: none;
    padding: 0 clamp(20px, 5vw, 28px);
  }
  .wwp-chapter-inner { transform: translateY(18px); }

  /* opening chapter only shows the compact core wording; the full SEO
     copy stays in the DOM (desktop reads it unchanged) but is visually
     swapped for a one-line summary and a single primary CTA on mobile */
  .wwp-h1-extra,
  .wwp-desc-full,
  .wwp-cta-desktop-only { display: none; }
  .wwp-desc-short { display: block; }

  .wwp-eyebrow {
    font-size: clamp(11px, 2.9vw, 13px);
    line-height: 1.3;
    letter-spacing: 0.11em;
    margin: 0 0 10px;
  }
  .wwp-chapter-label { margin-bottom: 10px; }

  #wwp-hero-copy h1 {
    max-width: 100%;
    font-size: clamp(32px, 8.5vw, 43px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    margin: 0 0 10px;
    text-wrap: balance;
  }
  #wwp-hero-copy h2 {
    max-width: 100%;
    font-size: clamp(29px, 7.8vw, 40px);
    line-height: 1;
    letter-spacing: -0.035em;
    margin: 0 0 10px;
  }
  .wwp-hero-description {
    max-width: 38rem;
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.42;
    margin: 0 0 12px;
  }

  /* at most two compact service points per chapter on mobile — the rest
     stay in the DOM for SEO, just not shown in the opening glance */
  .wwp-points { gap: 6px; margin-bottom: 10px; }
  .wwp-points li:nth-child(n + 3) { display: none; }
  .wwp-points-4 { display: flex; flex-direction: column; }

  .wwp-ctas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0 0 12px;
  }
  .wwp-btn {
    width: 100%;
    min-height: 50px;
    padding: 13px 18px;
    font-size: 16px;
    line-height: 1.2;
  }

  .wwp-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .wwp-trust li { font-size: 12px; padding: 6px 11px; white-space: normal; text-align: center; }

  /* safety net: if a viewer's font/zoom settings make Chapter 5 (the
     tallest — heading + description + 6 pills + 2 CTAs + call + hours)
     taller than the pinned viewport, let that one block scroll internally
     instead of clipping the final CTA */
  .wwp-chapter-5 .wwp-chapter-inner {
    max-height: calc(100svh - var(--wwp-header-offset, 0px) - var(--wwp-mobile-bottom-bar-height, 0px) - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* moved off the CTAs entirely — right edge, vertical, out of the way */
  #wwp-hero-cue {
    bottom: calc(var(--wwp-mobile-bottom-bar-height, 0px) + max(16px, env(safe-area-inset-bottom)));
    left: auto;
    right: 14px;
    transform: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    gap: 0;
  }
  #wwp-hero-cue::after { display: none; }
}

@media (max-width: 767px) and (max-height: 699px) {
  /* genuinely short screens: hide the cue entirely (Chapter 2 already
     carries its own "scroll to explore" hint) and trim to the highest-
     priority content per chapter — headline, value line, primary CTAs */
  #wwp-hero-cue { display: none; }
  #wwp-hero-copy h1 { font-size: clamp(26px, 8vw, 38px); }
  #wwp-hero-copy h2 { font-size: clamp(24px, 7.2vw, 34px); }
  .wwp-eyebrow { display: none; }
  .wwp-hero-description { font-size: 14px; margin-bottom: 10px; }
  .wwp-emphasis, .wwp-scroll-hint { display: none; }
  .wwp-btn { min-height: 44px; padding: 10px 16px; }

  /* belt-and-suspenders: on ANY chapter, if the trimmed content still
     exceeds the viewport (small font-zoom settings, extra-short device),
     make that one chapter scroll internally rather than clip the CTA */
  .wwp-chapter-inner {
    max-height: calc(100svh - var(--wwp-header-offset, 0px) - var(--wwp-mobile-bottom-bar-height, 0px) - 44px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

@media (max-width: 380px) {
  :root { --wwp-track-vh: 460vh; }
}

/* ── no-JS / reduced-motion first-frame fallback (pure CSS) ──────────── */
@media (scripting: none) {
  #wwp-hero-loader { display: none; }
  #wwp-hero-canvas { display: none; }
  #wwp-hero-poster { display: block; }
  #wwp-hero-cue { display: none; }
  /* stacked static copy grows with its content and clears the overlay header */
  #wwp-hero-stage { height: auto; min-height: 100dvh; }
  #wwp-hero-copy { position: relative; inset: auto; padding: 150px 0 8vh; }
}
@media (prefers-reduced-motion: reduce) {
  #wwp-hero-loader { display: none; }
  .wwp-chapter-inner { transition: none !important; }
}
