/* ── Catalyst Designs — Scan Hero ───────────────────────────────────────
 * Scroll-triggered vehicle scan animation.
 * Two layers: base photo (always visible) + wireframe overlay (screen blend,
 * revealed top→bottom by beam). Wireframe images are pre-aligned to the
 * base photo — no transform hacks needed.
 * Full-width breakout: JS sets width:100vw + corrects margin-left on wrap.
 * Visual pinning: CSS position:sticky — no GSAP pin conflict.
 * ──────────────────────────────────────────────────────────────────── */

.cd-scan-hero-wrap {
  position: relative;
  height: 250vh;
  width: 100%;
}

.cd-scan-hero {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

/* Base vehicle photo — always fully visible */
.cd-scan-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  z-index: 1;
}

/* Wireframe overlay: black/transparent bg + teal lines.
 * mix-blend-mode:screen → black transparent, teal floats over photo.
 * Beam mask reveals top→bottom as --scan-y increases 0%→100%.      */
.cd-scan-hero__wireframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(var(--scan-y, 0%) - 6px),
    rgba(0, 0, 0, 0.15) var(--scan-y, 0%),
    transparent calc(var(--scan-y, 0%) + 6px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(var(--scan-y, 0%) - 6px),
    rgba(0, 0, 0, 0.15) var(--scan-y, 0%),
    transparent calc(var(--scan-y, 0%) + 6px),
    transparent 100%
  );
}

/* Glowing teal laser beam */
.cd-scan-hero__beam {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--scan-y, 0%);
  height: 3px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 3;
  opacity: var(--beam-opacity, 0);
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(13, 215, 194, 0.35) 6%,
    #0dd7c2 38%,
    #a0fff7 50%,
    #0dd7c2 62%,
    rgba(13, 215, 194, 0.35) 94%,
    transparent 100%
  );
  box-shadow:
    0 0  5px 1px rgba(13, 215, 194, 1.0),
    0 0 16px 4px rgba(13, 215, 194, 0.6),
    0 0 36px 8px rgba(13, 215, 194, 0.25);
}

/* Semi-transparent dark overlay — WCAG AA text contrast on any photo.
 * White text on this overlay: effective contrast > 7:1.               */
.cd-scan-hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    150deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(35, 45, 49, 0.52) 45%,
    rgba(46, 56, 61, 0.72) 100%
  );
}

/* ── Hero text ───────────────────────────────────────────────────────── */
.cd-scan-hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 5;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(2rem, 6vw, 6rem);
  padding-top: calc(clamp(2rem, 6vw, 6rem) + var(--cd-header-h, 90px));
  max-width: 900px;
}

.cd-scan-hero__eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0dd7c2;
  margin: 0 0 1rem;
}

.cd-scan-hero__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #ffffff;
  margin: 0 0 1.25rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
}

.cd-scan-hero__subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
  margin: 0 0 2.25rem;
}

.cd-scan-hero__buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Primary CTA — teal bg, dark text.
 * WCAG: #2e383d on #0dd7c2 = 6.85:1 (PASS AA+)
 * WARNING: white on #0dd7c2 = 2:1 (FAIL) — never use white on teal bg */
.cd-scan-hero__btn--primary {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.25rem;
  background: #0dd7c2;
  color: #2e383d;
  border: none;
  transition: background 0.2s, color 0.2s;
}
.cd-scan-hero__btn--primary:hover,
.cd-scan-hero__btn--primary:focus-visible {
  background: #1e817b;
  color: #ffffff;
}

/* Size modifier for the primary booking CTA */
.cd-scan-hero__btn--lg {
  font-size: 0.95rem;
  padding: 1.1rem 2.75rem;
  letter-spacing: 0.12em;
}

/* Supporting line below the CTA buttons */
.cd-scan-hero__cta-note {
  margin: 1rem 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.52);
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.cd-scan-hero__btn--secondary {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.25rem;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.40);
  transition: border-color 0.2s, color 0.2s;
}
.cd-scan-hero__btn--secondary:hover,
.cd-scan-hero__btn--secondary:focus-visible {
  border-color: #0dd7c2;
  color: #0dd7c2;
}

/* Scroll hint */
.cd-scan-hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.40);
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: cd-scroll-bounce 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cd-scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0);   }
  55%       { transform: translateX(-50%) translateY(8px); }
}

/* Placeholder — shown until images are generated */
.cd-scan-hero--no-images {
  background: #232d31;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cd-scan-hero--no-images .cd-scan-hero__placeholder-msg {
  text-align: center;
  color: #7a8589;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 480px;
  padding: 2rem;
}
.cd-scan-hero--no-images .cd-scan-hero__placeholder-msg strong {
  display: block;
  font-size: 1.1rem;
  color: #0dd7c2;
  margin-bottom: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cd-scan-hero__content {
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    padding-top: calc(2rem + var(--cd-header-h, 70px));
    max-width: 100%;
  }
  .cd-scan-hero__subtitle {
    max-width: 100%;
    /* tightened so cta-note doesn't push the button below fold */
    margin-bottom: 1.5rem;
  }
  .cd-scan-hero__buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .cd-scan-hero__btn--primary,
  .cd-scan-hero__btn--secondary {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  .cd-scan-hero__btn--lg {
    font-size: 1rem;
    padding: 1.1rem 2rem;
  }
  .cd-scan-hero__cta-note {
    font-size: 0.75rem;
    text-align: center;
  }
}

/* ── WCAG summary ────────────────────────────────────────────────────────
 * White (#fff) on dark overlay      → > 7:1  PASS AA+
 * Teal (#0dd7c2) on dark overlay    → ~ 7:1  PASS AA+
 * #2e383d (text) on #0dd7c2 (btn)   → 6.85:1 PASS AA+
 * White on #1e817b (btn hover)      → 4.7:1  PASS AA
 * White on teal (#0dd7c2)           → ~ 2:1  FAIL  — never do this
 * ──────────────────────────────────────────────────────────────────── */

.cd-scan-hero-wrap {
  max-width: none !important;
  box-sizing: border-box;
}
