.hero {
  position: relative;
  min-height: clamp(580px, 44vw, 780px);
  overflow: hidden;
  isolation: isolate;
  background: #090909;
}

/* The left edge softly dissolves into the copy; the film's right edge stays untouched. */
.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(5, 5, 5, .96) 0%,
      rgba(5, 5, 5, .90) 22%,
      rgba(5, 5, 5, .68) 38%,
      rgba(5, 5, 5, .22) 55%,
      transparent 70%),
    linear-gradient(0deg, rgba(5, 5, 5, .25), transparent 28%, transparent 78%, rgba(5, 5, 5, .14));
}

.hero > .hero-film {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 0;
  left: auto;
  display: block;
  width: min(74vw, 1280px);
  aspect-ratio: 16 / 9;
  height: auto;
  transform: translateY(-50%);
  object-fit: contain;
  object-position: right center;
  background: #090909 url("/assets/chx-hero-film-poster.webp") center / contain no-repeat;
}

.hero .hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: clamp(580px, 44vw, 780px);
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.hero .hero-copy {
  width: min(47%, 650px);
  max-width: 650px;
}

.hero h1 {
  font-weight: 500;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}

.hero .hero-promise {
  max-width: 590px;
  font-weight: 500;
  text-shadow: 0 1px 15px rgba(0, 0, 0, .78);
}

.hero .button-primary {
  min-height: 58px;
  padding: 17px 24px;
  background: #f5f3ed;
  color: #111;
  font-weight: 600;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .25);
}

.hero .button-primary:hover {
  background: #fff;
}

.hero-film-toggle {
  position: absolute;
  z-index: 3;
  right: max(5%, calc((100% - 1440px) / 2 + 5%));
  bottom: 24px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 3px;
  background: rgba(8, 8, 8, .78);
  color: #f7f6f2;
  font: 500 .75rem/1.2 var(--body);
  cursor: pointer;
  transition: background .18s, border-color .18s;
  backdrop-filter: blur(8px);
}

.hero-film-toggle:hover {
  background: rgba(8, 8, 8, .94);
  border-color: #fff;
}

.hero-film-toggle-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 13px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.hero-film-toggle[data-paused="true"] .hero-film-toggle-icon {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  border-right: 0;
}

.hero-film-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* At tablet and phone widths, let the copy lead and give the complete film its own row. */
@media (max-width: 900px) {
  .hero::before {
    display: none;
  }

  .hero {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .hero > .hero-film {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    order: 2;
    width: min(calc(100% - 48px), 960px);
    max-height: none;
    margin: 0 auto;
    transform: none;
    object-fit: contain;
    object-position: center;
    background-position: center;
  }

  .hero .hero-inner {
    order: 1;
    min-height: 0;
    padding-top: clamp(42px, 8vw, 78px);
    padding-bottom: 28px;
  }

  .hero .hero-copy {
    width: min(100%, 670px);
    max-width: 670px;
  }

  .hero-film-toggle {
    position: relative;
    right: auto;
    bottom: auto;
    order: 3;
    align-self: flex-end;
    margin: 10px 24px 14px;
  }
}

@media (max-width: 600px) {
  .hero > .hero-film {
    width: calc(100% - 32px);
  }

  .hero .hero-inner {
    padding-top: 36px;
    padding-bottom: 22px;
  }

  .hero .hero-copy {
    width: 100%;
    max-width: 540px;
  }

  .hero .eyebrow {
    margin-bottom: 17px;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 12vw, 4.3rem);
    line-height: 1.02;
    font-weight: 500;
  }

  .hero .hero-promise {
    max-width: 470px;
    margin-top: 19px;
    font-size: clamp(1.06rem, 4.35vw, 1.25rem);
    line-height: 1.48;
    font-weight: 500;
  }

  .hero .hero-actions {
    margin-top: 23px;
  }

  .hero .button-primary {
    min-height: 54px;
    padding: 15px 20px;
  }

  .hero-film-toggle {
    margin: 9px 16px 12px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: .6875rem;
  }
}

.trust-stat:last-child .trust-label {
  max-width: none;
  white-space: nowrap;
  font-size: clamp(.6875rem, 1.15vw, 1.1rem);
}

@media (max-width: 900px) {
  .trust-stat:last-child .trust-label {
    font-size: clamp(.6875rem, 3.25vw, 1.2rem);
  }
}

/*
 * Short desktop viewports: let the uncropped film establish the hero height,
 * then use the reclaimed vertical space to show the complete trust bar.
 * This only engages below a 16:9 viewport, so taller desktop typography stays
 * untouched and the embedded clock remains clear of the hero copy.
 */
@media (min-width: 901px) and (max-aspect-ratio: 16 / 9) {
  .hero {
    min-height: 0;
    height: min(41.625vw, 720px);
  }

  .hero > .hero-film {
    top: 0;
    height: 100%;
    width: auto;
    transform: none;
  }

  .hero .hero-inner {
    min-height: 0;
    height: 100%;
    padding-top: 32px;
    padding-bottom: 32px;
  }

  /* Balance leftover first-screen space, but never stretch the trust bar
     excessively on tall windows. The header is 84px plus its divider. */
  .trust-section {
    min-height: min(320px, max(0px, calc(100svh - 85px - min(41.625vw, 720px))));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .trust-inner {
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
  }

  .trust-stats {
    margin-top: 10px;
  }

  .trust-stat {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .trust-value {
    line-height: 1;
  }

  .trust-label {
    margin-top: 7px;
    font-size: clamp(.75rem, 1.15vw, 1.1rem);
    line-height: 1.35;
  }

}

@media (min-width: 901px) and (max-aspect-ratio: 16 / 9) and (max-height: 1000px) {
  .trust-inner {
    padding-top: 0;
  }

  .trust-inner .eyebrow {
    font-size: clamp(.625rem, 1.05vh, .75rem);
    line-height: 1.3;
  }

  .trust-stats {
    margin-top: clamp(3px, .65vh, 7px);
  }

  .trust-value {
    font-size: clamp(2rem, 6vh, 4.5rem);
  }

  .trust-label {
    margin-top: clamp(3px, .55vh, 6px);
    font-size: clamp(.6875rem, 1.55vh, .875rem);
    line-height: 1.25;
  }
}

@media (min-width: 901px) and (max-aspect-ratio: 16 / 9) and (max-height: 900px) {
  .hero .hero-inner {
    padding-top: clamp(22px, 3.2vh, 30px);
    padding-bottom: clamp(22px, 3.2vh, 30px);
  }

  .hero .hero-copy {
    width: min(44%, 610px);
  }

  .hero .eyebrow {
    margin-bottom: clamp(12px, 1.4vh, 18px);
  }

  .hero h1 {
    font-size: clamp(3.1rem, 5.1vw, 5rem);
    line-height: 1.02;
  }

  .hero .hero-promise {
    max-width: 550px;
    margin-top: clamp(12px, 1.5vh, 18px);
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.35;
  }

  .hero .hero-actions {
    margin-top: clamp(14px, 2vh, 22px);
  }

  .hero .button-primary {
    min-height: 50px;
    padding: 13px 21px;
  }

  .hero-film-toggle {
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    scroll-behavior: auto;
  }
}
