/* ==========================================================================
   Homepage hero: "Wall of Listings" video background
   Loaded by index.html only, after styles.css. The hero rules are scoped to
   .hero--wall / .hero-wall__*, so the shared .hero used elsewhere is untouched.
   The last block swaps the 2 MB hero-community.png behind two homepage bands
   for a WebP copy of the same photo (this file is homepage-only).
   The darkening is this CSS shade, not baked into the video, so it can be
   tuned without re-rendering.
   ========================================================================== */

.hero--wall {
  --hw-ink: #1A0628;
  /* replaces the hero-community.png background + 30s drift (no PNG request) */
  background: var(--hw-ink);
  animation: none;
  isolation: isolate;
  min-height: 640px;
  padding: calc(var(--space-20) + 28px) var(--space-5) var(--space-16);
}

/* the gold blob fought the moving wall; the noise grain stays (subtle, above the video) */
.hero--wall::after { content: none; }
.hero--wall::before { z-index: 0; opacity: 0.25; }

.hero-wall__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--hw-ink);
}
.hero-wall__poster,
.hero-wall__poster img,
.hero-wall__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.hero-wall__video {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.hero-wall__video.is-playing { opacity: 1; }

/* Shade: light at the edges so the wall reads, deep behind the centred text
   column, plus a top band for the transparent header and a bottom fade. */
.hero-wall__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(26, 6, 40, 0.9) 0%, rgba(26, 6, 40, 0.62) 9%, rgba(26, 6, 40, 0.42) 16%, rgba(26, 6, 40, 0.42) 82%, rgba(26, 6, 40, 0.72) 100%);
}

.hero--wall .hero__content { z-index: 1; }
/* the stronger shade lives behind the text column only */
.hero--wall .hero__content::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: calc(100% + 120px);
  height: calc(100% + 110px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(26, 6, 40, 0.84) 0%, rgba(26, 6, 40, 0.78) 64%, rgba(26, 6, 40, 0.46) 86%, rgba(26, 6, 40, 0) 100%);
  pointer-events: none;
}
.hero--wall .hero__content h1 { text-shadow: 0 2px 18px rgba(10, 2, 18, 0.65); }
.hero--wall .hero__content p {
  opacity: 1;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 12px rgba(10, 2, 18, 0.75);
}
.hero--wall .hero__search { box-shadow: 0 18px 50px rgba(10, 2, 18, 0.55); }

/* Phones: the search box stacks (column flex), and styles.css centres its
   children, so the input shrank to its default ~20-character width and cut the
   placeholder off ("Search by city, zip, or comn"). Stretch it to the box. */
@media (max-width: 767px) {
  .hero--wall .hero__search input {
    align-self: stretch;
    width: 100%;
    min-width: 0;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    text-align: center;
  }
}
@media (max-width: 359px) {
  .hero--wall .hero__search input { font-size: 0.9375rem; }
}

/* pills sit on the moving wall: give the inactive ones a frosted plum base */
.hero--wall .pill:not(.pill--active):not(:hover) {
  background: rgba(26, 6, 40, 0.55);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@media (min-width: 768px) {
  .hero--wall {
    min-height: clamp(620px, 78vh, 760px);
    padding: calc(var(--space-24) + 12px) var(--space-6) var(--space-16);
  }
  .hero-wall__shade {
    background:
      linear-gradient(180deg, rgba(26, 6, 40, 0.9) 0%, rgba(26, 6, 40, 0.7) 9%, rgba(26, 6, 40, 0.2) 22%, rgba(26, 6, 40, 0.2) 80%, rgba(26, 6, 40, 0.62) 100%);
  }
  .hero--wall .hero__content::before {
    width: calc(100% + 300px);
    height: calc(100% + 210px);
  }
}

@media (min-width: 1025px) {
  .hero--wall { min-height: clamp(640px, 80vh, 800px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-wall__video { display: none; }
}

/* Homepage only: the faint community photo behind "How It Works", the comparison
   table and the mortgage calculator was hero-community.png (2,035,337 bytes).
   Same photo, same overlays, as WebP (other pages keep the PNG). */
.section--textured {
  background:
    linear-gradient(rgba(249, 250, 251, 0.95), rgba(249, 250, 251, 0.95)),
    url('../images/hero-community.webp') center/cover no-repeat;
}
.section--dark-photo {
  background:
    linear-gradient(135deg, rgba(45, 14, 66, 0.92), rgba(74, 26, 107, 0.88)),
    url('../images/hero-community.webp') center/cover no-repeat;
}
