.hero {
  position: relative;
  isolation: isolate;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  background: var(--ep-cream, #f4f1eb);
  color: #fff;
  touch-action: pan-y;
}

/* Soft top shade for the overlaid header (template option 3). */
.hero::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(130px, 18svh, 200px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .28), rgba(0, 0, 0, .08) 45%, transparent);
  pointer-events: none;
}

/* ---------- Slides ---------- */

.hero__slides,
.hero__slide,
.hero__media,
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__slide {
  opacity: 0;
  visibility: hidden;
}

.hero__slide.is-current {
  opacity: 1;
  visibility: visible;
}

.hero__slide.is-incoming {
  z-index: 1;
  visibility: visible;
}

.hero__slide.is-fading {
  opacity: 1;
  transition: opacity 1200ms cubic-bezier(.4, 0, .2, 1);
}

.hero__image {
  display: block;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
}

/* The poster stays underneath until the video has a frame to show. */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

.hero__video.is-ready {
  opacity: 1;
}

/* ---------- Copy ---------- */

.hero__copy {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 var(--ep-gutter, 20px) 92px;
}

/* Local radial shade behind the headline (template option 3). */
.hero__copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(320px, 56svh, 640px);
  background:
    radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, .24) 30%, rgba(0, 0, 0, .07) 58%, transparent 80%),
    linear-gradient(to top, rgba(0, 0, 0, .1), transparent 30%);
  pointer-events: none;
}

.hero__title {
  max-width: 14em;
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  text-wrap: balance;
}

.hero__subtitle {
  max-width: 34em;
  margin: 14px 0 0;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.5;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
}

.hero__button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  margin-top: 24px;
  padding: 13px 22px;
  border: 1px solid rgba(255, 255, 255, .8);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 250ms ease;
}

.hero__button:hover {
  background: rgba(255, 255, 255, .14);
}

.hero__button:focus-visible,
.hero__arrow:focus-visible,
.hero__dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* ---------- Intro (option 3 wipe) ---------- */

.hero:not(.is-revealed) .hero__controls,
.hero:not(.is-revealed) .hero__media-controls {
  opacity: 0;
  pointer-events: none;
}

.hero.is-intro .hero__slide.is-current .hero__media,
.hero.is-intro .hero__slide.is-current > .hero__video {
  will-change: clip-path, transform;
}

/* ---------- Media controls (top-right, video slides) ---------- */

.hero__media-controls {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: var(--ep-gutter, 20px);
  display: flex;
  gap: 8px;
}

.hero__media-controls[hidden] {
  display: none;
}

/* ---------- Bottom controls ---------- */

.hero__controls {
  position: absolute;
  z-index: 4;
  right: var(--ep-gutter, 20px);
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero__pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero__dot {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: width 400ms ease;
}

.hero__dot::before,
.hero__dot::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: calc(50% - 1.5px);
  height: 3px;
}

.hero__dot::before {
  background: rgba(255, 255, 255, .35);
  transition: background-color 400ms ease;
}

.hero__dot::after {
  background: #fff;
  opacity: 0;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  box-shadow: 0 0 8px rgba(255, 255, 255, .65);
}

.hero__dot[aria-current="true"] {
  width: 72px;
}

.hero__dot[aria-current="true"]::before {
  background: rgba(255, 255, 255, .7);
}

.hero__dot[aria-current="true"]::after {
  opacity: 1;
}

.hero__counter {
  margin-left: 4px;
  font-size: 16px;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
}

.hero__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 250ms ease;
}

.hero__arrow:hover {
  background: rgba(255, 255, 255, .14);
}

.hero__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__icon-play {
  fill: currentColor !important;
  stroke: none !important;
}

.hero__toggle .hero__icon-play,
.hero__toggle .hero__icon-sound,
.hero__toggle.is-paused .hero__icon-pause,
.hero__toggle.is-sound-on .hero__icon-muted {
  display: none;
}

.hero__toggle.is-paused .hero__icon-play,
.hero__toggle.is-sound-on .hero__icon-sound {
  display: block;
}

.hero__controls--many .hero__pagination {
  display: none;
}

@media (min-width: 768px) {
  .hero {
    min-height: 560px;
  }

  .hero__controls--many .hero__pagination {
    display: flex;
  }

  .hero__controls--many .hero__dot {
    width: 32px;
  }

  .hero__controls--many .hero__dot[aria-current="true"] {
    width: 64px;
  }

  .hero__copy {
    padding: 0 64px 114px;
  }

  .hero__title {
    font-size: clamp(2.15rem, 4.2vw, 3.7rem);
  }

  .hero__media-controls {
    top: 24px;
    right: 64px;
    gap: 12px;
  }

  .hero__controls {
    right: 64px;
    bottom: 40px;
    gap: 12px;
  }

  .hero__pagination {
    gap: 12px;
  }

  .hero__dot {
    width: 64px;
  }

  .hero__dot::before,
  .hero__dot::after {
    left: 0;
    right: 0;
  }

  .hero__dot[aria-current="true"] {
    width: 120px;
  }

  .hero__counter {
    margin-left: 12px;
    font-size: 24px;
  }
}

@media (max-width: 767.98px) {
  .hero {
    min-height: 70svh;
  }

  .hero__copy::before {
    height: clamp(300px, 52svh, 480px);
    background:
      radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, .42), rgba(0, 0, 0, .19) 40%, transparent 85%),
      linear-gradient(to top, rgba(0, 0, 0, .1), transparent 30%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__dot,
  .hero__dot::before {
    transition: none;
  }

  .hero:not(.is-revealed) .hero__controls,
  .hero:not(.is-revealed) .hero__media-controls {
    opacity: 1;
    pointer-events: auto;
  }
}
