.hero {
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  background: var(--color-accent);
  --hero-card-height: clamp(320px, 60vh, 640px);
  --hero-panel-extra: 160px;
  content-visibility: auto;
  contain-intrinsic-size: 1000px 1000px;
}

.hero__inner {
  display: grid;
  place-items: center;
  padding-top: calc(var(--section-pad) + 1rem);
  padding-bottom: var(--section-pad);
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__stack {
  position: relative;
  width: min(980px, 100%);
  height: var(--hero-card-height);
  overflow: visible;
}

.hero__panel {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 97%;
  transform: scale(1.04);
  transform-origin: center;
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  pointer-events: none;
  z-index: 0;
}

.hero__card {
  position: absolute;
  inset: 0;
  border: 0px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: none;
  z-index: 1;
}

.hero__card.is-animating {
  transition: transform 0.7s ease;
}

.hero__card.is-entering {
  transform: translateY(26px) scale(0.98);
}

.hero__card.is-active {
  z-index: 3;
}

.hero__card.is-next {
  z-index: 2;
  transform: translateY(26px) scale(0.98);
  filter: blur(1px);
}

.hero__card.is-next-2 {
  z-index: 1;
  transform: translateY(52px) scale(0.96);
  filter: blur(1px);
}

.hero__card.is-exiting {
  z-index: 4;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.6s ease;
}

.hero__card-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.hero__mobile-image,
.hero__cta {
  display: none;
}

@media (max-width: 1023px) {
  .hero__inner {
    padding-top: calc(var(--section-pad) + 0.5rem);
  }

  .hero__stack {
    height: 360px;
  }
}

@media (max-width: 600px) {
  .hero__inner {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 100svh;
    display: grid;
    grid-template-rows: 1fr auto;
    align-content: center;
  }

  .hero__panel {
    height: 100%;
  }

  .hero__stack {
    align-self: center;
  }

  .hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 2.2rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(8, 26, 40, 0.2);
    justify-self: center;
    z-index: 1;
  }

  .hero__card.is-next,
  .hero__card.is-next-2 {
    display: none;
  }
}
