/* ============================================================
   Glassly Auto Glass — cinematic scroll hero + instant quote
   Black / white / yellow. Vehicle is the focus. No clutter.
   ============================================================ */

:root {
  --bg: #000;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.72);
  --ink-faint: rgba(255, 255, 255, 0.45);
  --accent: #f5c400;           /* Lamborghini-style yellow, used sparingly */
  --line: rgba(255, 255, 255, 0.16);
  --font: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ----------------------------------------------------------
   HERO — tall scroll section with a pinned full-screen stage
   ---------------------------------------------------------- */
.hero {
  position: relative;
  height: 420vh;                 /* scroll distance that drives the sequence */
  background: var(--bg);
}

.hero__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.hero__stage {
  position: absolute;
  inset: 0;
  transform: scale(1.04);        /* JS eases this toward 1.0 for a subtle camera pull */
  transform-origin: 50% 46%;
  will-change: transform;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;   /* keep the vehicle centred on any viewport */
  opacity: 0;
  will-change: opacity;
  user-select: none;
  -webkit-user-drag: none;
}
.hero__img[data-i="0"] { opacity: 1; } /* first state paints immediately */

/* Gentle vignette so white type stays legible over bright hex lights */
.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 12%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 42%),
    radial-gradient(120% 70% at 50% 100%, rgba(0,0,0,0.60) 0%, rgba(0,0,0,0) 46%);
}

/* ---- text overlays ---- */
.hero__overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;          /* never blocks native scroll */
  z-index: 2;
}

/* initial call-to-action, top of viewport, clickable */
.cta-scroll {
  position: absolute;
  top: 14%;                 /* sit the title over the floating windshield, not the ceiling lights */
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  pointer-events: auto;
  cursor: pointer;
}
.cta-scroll__text {
  max-width: min(72vw, 12em);   /* keep the block within the windshield */
  text-align: center;
  font-size: clamp(18px, 2.9vw, 38px);   /* sized to fit the windshield while staying bold */
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;                            /* white fill... */
  -webkit-text-stroke: 4px #000;          /* ...with a bold, clearly visible black outline */
  text-stroke: 4px #000;
  paint-order: stroke fill;               /* stroke behind fill so letters stay crisp */
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}
.cta-scroll__chev {
  width: 20px; height: 20px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  animation: chev 1.8s var(--ease) infinite;
  opacity: 0.9;
  /* matching bolder black outline on the arrow */
  filter:
    drop-shadow(2px 0 0 #000) drop-shadow(-2px 0 0 #000)
    drop-shadow(0 2px 0 #000) drop-shadow(0 -2px 0 #000);
}
@keyframes chev {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.55; }
  50%      { transform: rotate(45deg) translate(3px, 3px); opacity: 1; }
}

/* mid-scroll message beats */
.beat {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(92vw, 16em);
  text-align: center;
  font-size: clamp(28px, 5.4vw, 74px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

/* final brand lockup */
.brand {
  position: absolute;
  left: 50%;
  top: clamp(24px, 7vh, 76px);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  visibility: hidden;
}
.brand__main {
  display: block;
  font-size: clamp(40px, 9vw, 132px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.92;
  text-shadow: 0 2px 48px rgba(0,0,0,0.55);
}
.brand__sub {
  display: block;
  margin-top: 0.4em;
  font-size: clamp(12px, 1.8vw, 22px);
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* thin scroll progress line */
.hero__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255,255,255,0.10);
  z-index: 3;
}
.hero__progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--accent);
}

.reduced-cta { display: none; }

/* ----------------------------------------------------------
   QUOTE — appears as the hero releases
   ---------------------------------------------------------- */
.quote {
  position: relative;
  z-index: 4;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(48px, 10vh, 120px) 24px calc(48px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 100% at 50% 0%, #0b0b0b 0%, #000 60%);
  border-top: 1px solid var(--line);
}
.quote__inner { width: min(560px, 100%); text-align: center; }
.quote__title {
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.quote__sub {
  margin: 0 auto 40px;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.7vw, 18px);
  line-height: 1.5;
}
.quote__form {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 16px;
  text-align: left;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
/* Email needs the full width of the form; everything else about it is the
   existing .field treatment. On mobile the grid is already one column, so this
   rule is inert there and no responsive change is required. */
.field--email, .field--wide { grid-column: 1 / -1; }
#vin { text-transform: uppercase; }
#email { text-transform: none; letter-spacing: normal; }
.field input::placeholder { color: var(--ink-faint); text-transform: none; letter-spacing: normal; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.06);
}
.field input[aria-invalid="true"] { border-color: #ff5252; }
.field__help { color: var(--ink-faint); font-size: 12px; letter-spacing: 0.01em; }

.quote__submit {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 18px 24px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.2s var(--ease);
}
.quote__submit:hover { filter: brightness(1.06); }
.quote__submit:active { transform: translateY(1px); }
.quote__submit:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.quote__status {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.quote__status[data-state="error"] { color: #ff7676; }
.quote__status[data-state="ok"] { color: var(--accent); }
.quote__status .quote__line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  padding: 6px 0;
}
.quote__status .quote__line--total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 800;
  color: var(--accent);
}
.quote__status .quote__note { display: block; margin-top: 8px; color: var(--ink-soft); }
/* The accept link on a locked instant quote: the one thing the customer is
   meant to do next, so it reads as an action rather than a footnote. */
.quote__status .quote__book {
  display: inline-block;
  margin-top: 14px;
  padding: 14px 22px;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.quote__status .quote__book:hover { filter: brightness(1.06); }
.quote__status .quote__book:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* "WE'RE ON IT." — the manual-review answer leads with reassurance, in the
   same uppercase treatment the form's own labels already use. */
.quote__status .quote__headline {
  display: block;
  margin-bottom: 2px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* contact line shown with the quote result */
.quote__contact {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.quote__contact a { color: var(--accent); text-decoration: underline; }
.quote__contact[hidden] { display: none; }

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  /* Mobile hero = a single static Image 1 (Urus front, all glass floating).
     The desktop 4-image crossfade/scroll sequence is intentionally disabled here. */
  /* The hero's height is dictated by the image, not the screen: the frame is
     scale(2.1) x aspect(768/1360) = 118.5882vw tall, so the image meets both
     the top of the page and the divider with no black gap at either end. */
  .hero { height: 118.5882vw; }
  .hero__pin { position: relative; height: 118.5882vw; }
  .hero__stage { transform: none; }
  /* ONE proportional copy of the original frame — an art-directed portrait crop.
     Width and height scale together (height:auto), so nothing is ever stretched;
     the excess width is simply cropped by .hero__pin's overflow. --hero-scale is
     the single tuning knob: 1 = whole frame, larger = bigger car / tighter crop. */
  .hero__img {
    --hero-scale: 2.1;
    opacity: 0;
    object-fit: contain;
    object-position: center;
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: calc(var(--hero-scale) * 100%);
    height: auto;                /* proportional — never distorted */
    max-width: none;
    /* The car is centred at 0.5048 of the frame, not 0.5, so a geometrically
       centred image leaves the Urus off to the right. Nudge left by
       (0.5048 - 0.5) x scale x 100vw = 1.01vw to equalise the side gaps. */
    transform: translate(calc(-50% - 1.01vw), -50%);
  }
  .hero__img[data-i="0"] { opacity: 1; }               /* Image 1 only */
  .cta-scroll, .beat, .hero__progress { display: none; } /* no hero CTA, titles, or progress */
  /* GLASSLY / AUTO GLASS on the detached windshield. The frame is centred, so the
     windshield centre sits at 50% of the viewport minus 0.301 x the frame height
     (frame height = scale x 56.4706vw). */
  /* The frame now fills the hero exactly, so the windshield centre is simply
     0.199 x the frame height (118.5882vw) = 23.6vw from the top. Same visual
     placement on the glass as before. */
  .brand {
    top: 23.6vw;
    /* same 1.01vw nudge as the image, so the logo keeps its exact position
       relative to the frame (and to the windshield) */
    transform: translate(calc(-50% - 1.01vw), -50%);
    max-width: 96vw;
    opacity: 1;
    visibility: visible;
  }
  /* sized to the windshield at this scale, with padding on all four sides */
  .brand__main { font-size: clamp(24px, 8.7vw, 46px); }
  .brand__sub  { font-size: clamp(8px, 2.8vw, 15px); }

  /* quote section keeps its existing responsive layout (unchanged) */
  .quote__form { grid-template-columns: 1fr; }
  .field--zip input { max-width: 160px; }
}

/* ----------------------------------------------------------
   REDUCED MOTION — static progression straight into the quote
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: 100vh; height: 100svh; }
  .hero__pin { position: relative; }
  .hero__stage { transform: none; }
  .hero__img { opacity: 0 !important; }
  .hero__img[data-i="3"] { opacity: 1 !important; }  /* show completed vehicle */
  .cta-scroll, .beat, .hero__progress { display: none !important; }
  .brand { opacity: 1 !important; visibility: visible !important; }
  .reduced-cta {
    display: inline-block;
    position: absolute;
    left: 50%;
    bottom: clamp(28px, 8vh, 72px);
    transform: translateX(-50%);
    pointer-events: auto;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: clamp(13px, 1.6vw, 17px);
    text-shadow: 0 1px 24px rgba(0,0,0,0.6);
  }
}

/* ----------------------------------------------------------
   MOBILE STATIC HERO (class set by JS on mobile widths).
   Guarantees the single Image-1 hero + windshield brand even when
   prefers-reduced-motion is also on. Desktop never gets this class,
   so desktop is entirely unaffected.
   ---------------------------------------------------------- */
body.is-mobile-hero .hero__img { opacity: 0 !important; }
body.is-mobile-hero .hero__img[data-i="0"] { opacity: 1 !important; }
body.is-mobile-hero .cta-scroll,
body.is-mobile-hero .hero__progress,
body.is-mobile-hero .reduced-cta { display: none !important; }
body.is-mobile-hero .hero__img {
  --hero-scale: 2.1;
  object-fit: contain;
  object-position: center;
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  width: calc(var(--hero-scale) * 100%);
  height: auto;
  max-width: none;
  transform: translate(calc(-50% - 1.01vw), -50%);
}
/* height overrides also win over the prefers-reduced-motion block, so a
   reduced-motion phone still gets the gap-free image-height hero */
body.is-mobile-hero .hero { height: 118.5882vw; }
body.is-mobile-hero .hero__pin { position: relative; height: 118.5882vw; }
body.is-mobile-hero .brand {
  top: 23.6vw;
  transform: translate(calc(-50% - 1.01vw), -50%);
  opacity: 1 !important;
  visibility: visible !important;
}
body.is-mobile-hero .brand__main { font-size: clamp(24px, 8.7vw, 46px); }
body.is-mobile-hero .brand__sub  { font-size: clamp(8px, 2.8vw, 15px); }
