/* ============================================================
   Hero video background + gradient overlay
   ============================================================ */

/* Warm off-white base so the hero matches even before video loads */
.hero {
  background: #fafaf7;
}

/* Hero contains the video; fade happens inside the hero bottom */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* No solid bg here — let the hero's own bg show through the fade */
  background: transparent;
  /* Generous soft fade INSIDE the hero — starts early, fully gone at hero bottom */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 55%,
    rgba(0, 0, 0, 0.7) 75%,
    rgba(0, 0, 0, 0.25) 92%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 55%,
    rgba(0, 0, 0, 0.7) 75%,
    rgba(0, 0, 0, 0.25) 92%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: right center;
  /* Lift contrast/saturation a touch so the compressed H.264/VP9 doesn't look flat */
  filter: contrast(1.06) saturate(1.12);
  pointer-events: none;
}

/* Gradient overlay: dense left, nearly clear right — so text sits on solid, video breathes crisp */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(250, 250, 247, 0.98) 0%,
    rgba(250, 250, 247, 0.94) 32%,
    rgba(250, 250, 247, 0.45) 58%,
    rgba(250, 250, 247, 0.1) 88%,
    rgba(250, 250, 247, 0) 100%
  );
}

/* Lift the hero grid above the video layers */
.hero .hero-grid {
  position: relative;
  z-index: 3;
  /* No demo column anymore — keep copy to the left half so video breathes */
  grid-template-columns: minmax(0, 1fr);
}
.hero .hero-copy {
  max-width: 620px;
}
/* Give the hero more vertical presence for the video */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
}
.hero > .hero-grid {
  width: 100%;
}

/* Let the demo breathe — subtle translucency so the video peeks through a bit */
.hero .hero-demo {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-color: rgba(231, 233, 239, 0.8);
}

/* Mobile: stack text-on-top, video-at-bottom via vertical gradient */
@media (max-width: 768px) {
  /* Split layout: H1 pinned to top, lede + CTAs pinned to bottom */
  .hero {
    align-items: stretch;
    padding-top: 120px;
    padding-bottom: 280px;
  }
  .hero-grid {
    display: flex;
    flex-direction: column;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }
  .hero-copy .display {
    margin-bottom: 24px;
  }
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(250, 250, 247, 0.97) 0%,
      rgba(250, 250, 247, 0.88) 40%,
      rgba(250, 250, 247, 0.45) 70%,
      rgba(250, 250, 247, 0.2) 100%
    );
  }
}

/* Accessibility: honour reduce-motion — swap video for still poster */
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
  .hero-bg {
    background: #fafaf7 url("assets/hero-poster.jpg") center/cover no-repeat;
  }
}

/* No hard divider line between the hero and the next section —
   the video fade carries the visual transition itself */
.hero + .section {
  border-top: 0;
}
