/* ============================================================
   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);
}
#vin { text-transform: uppercase; }
.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); }

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  .hero { height: 460vh; }
  .hero__img { object-position: center 44%; }
  .beat { font-size: clamp(26px, 8.5vw, 44px); width: min(90vw, 12em); }
  .cta-scroll__text { font-size: clamp(16px, 5vw, 30px); max-width: min(78vw, 11em); }
  .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);
  }
}
