html:has(body.intro-active) {
  overflow: hidden;
  scroll-behavior: auto;
  scroll-snap-type: none;
}

body.intro-active .page {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.intro-active.intro-ready .page {
  opacity: 1;
  visibility: visible;
}

.invitation-intro {
  --envelope-width: min(100vw, calc(100svh * .5776), 30rem);
  display: flex;
  justify-content: center;
  padding: 0;
  background: #f7f3e9;
  transition: none;
}

body.intro-ready .invitation-intro { background: transparent; }

.invitation-intro::before,
.invitation-intro::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  display: block;
  width: auto;
  height: auto;
  background: var(--olive-deep);
  color: transparent;
  font-size: 0;
  line-height: 0;
  transform: none;
}

.invitation-intro::before {
  left: 0;
  right: calc(50% + var(--envelope-width) / 2);
}

.invitation-intro::after {
  left: calc(50% + var(--envelope-width) / 2);
  right: 0;
}

.light-envelope {
  position: relative;
  z-index: 1;
  width: var(--envelope-width);
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  transition: opacity 120ms ease-out;
}

body.intro-ready .light-envelope { opacity: 1; }

.light-envelope__piece {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
  transition: transform 2400ms cubic-bezier(.45, 0, .35, 1);
}

.light-envelope__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.light-envelope__piece--top { z-index: 4; }
.light-envelope__piece--bottom {
  z-index: 2;
  transition-delay: 450ms;
}
.light-envelope__image--sides { z-index: 1; }
.light-envelope__image--front { z-index: 2; }

.light-envelope__seal-art {
  position: absolute;
  top: 60.5%;
  left: 50%;
  z-index: 3;
  width: 31.2%;
  height: auto;
  transform: translate(-50%, -50%);
  user-select: none;
  -webkit-user-drag: none;
}

.light-envelope__hint {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 6.7%;
  z-index: 5;
  margin: 0;
  color: #20211d;
  font: 500 clamp(.94rem, 3.9vw, 1.08rem)/1.25 "Cormorant Garamond", Georgia, serif;
  text-align: center;
  animation: envelopeHintPulse 2s ease-in-out infinite;
}

@keyframes envelopeHintPulse {
  0%, 100% { opacity: .72; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.light-envelope__seal {
  position: absolute;
  z-index: 6;
  top: 60.5%;
  left: 50%;
  width: clamp(90px, 31%, 136px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
}

.light-envelope__seal:focus-visible {
  outline: 2px solid rgba(89, 96, 68, .82);
  outline-offset: 5px;
}

.invitation-intro.is-opening .light-envelope__piece--top { transform: translateY(-108svh); }
.invitation-intro.is-opening .light-envelope__piece--bottom { transform: translateY(108svh); }
.invitation-intro.is-opening .light-envelope__seal { pointer-events: none; }

.hero {
  min-height: 100svh;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--olive-deep);
  color: var(--ivory);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(20, 26, 17, .70) 0%, rgba(45, 49, 35, .31) 50%, rgba(18, 24, 16, .62) 100%);
  pointer-events: none;
}

.hero::after { display: none; }

.hero__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% center;
  filter: sepia(.09) saturate(.78) contrast(.95);
  user-select: none;
  -webkit-user-drag: none;
}

.hero__content {
  position: absolute;
  top: 14%;
  left: 50%;
  z-index: 3;
  width: min(100% - 38px, 760px);
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 18px rgba(15, 20, 13, .58);
  transform: translateX(-50%);
}

.hero .eyebrow {
  margin: 0 0 24px;
  color: var(--ivory);
  font-size: clamp(.68rem, 2.6vw, .82rem);
  letter-spacing: .34em;
}

.hero h1 {
  margin: 0;
  color: var(--ivory);
  font: 500 clamp(4rem, 14vw, 7.8rem)/.78 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.045em;
}

.hero h1 > span { display: block; }
.hero h1 .amp { color: #bec2a3; font-style: italic; }

.hero .hero__date {
  margin: 34px 0 0;
  color: var(--ivory);
  font-size: clamp(.66rem, 2.5vw, .82rem);
  letter-spacing: .21em;
}

.hero .personalized {
  position: absolute;
  left: 50%;
  bottom: 80px;
  z-index: 4;
  width: max-content;
  max-width: min(100%, 560px);
  margin: 0;
  padding: 8px 13px;
  border: 1px solid rgba(247, 243, 233, .48);
  border-radius: 999px;
  background: rgba(31, 37, 25, .55);
  color: var(--ivory);
  font-size: clamp(.62rem, 2.6vw, .78rem);
  line-height: 1.35;
  text-align: center;
  backdrop-filter: blur(7px);
  transform: translateX(-50%);
}

.botanical-anchor--hero-top {
  top: -58px;
  right: -48px;
  z-index: 2;
  width: clamp(190px, 31vw, 330px);
  opacity: .58;
  transform: scaleX(-1) rotate(8deg);
  transform-origin: 50% 50%;
  --wind-duration: 5.6s;
  --wind-delay: -1.7s;
}

.botanical-anchor--hero-bottom {
  left: -52px;
  bottom: -46px;
  z-index: 2;
  width: clamp(210px, 34vw, 360px);
  opacity: .58;
  transform: rotate(7deg);
  transform-origin: 0 100%;
  --wind-duration: 5.2s;
  --wind-delay: -3.2s;
}

.botanical-anchor--hero-top img,
.botanical-anchor--hero-bottom img {
  -webkit-mask-image: none;
  mask-image: none;
  filter: sepia(.10) brightness(1.08) saturate(.78);
}

.hero .nav-arrow {
  z-index: 5;
}

@media (min-width: 900px) {
  .hero__photo {
    right: auto;
    left: 50%;
    width: min(100vw, calc(100svh * .5625));
    max-width: none;
    object-position: center;
    transform: translateX(-50%);
  }
}

@media (max-width: 650px) {
  .light-envelope {
    width: 100vw;
    max-width: none;
  }

  .hero__content {
    top: 13.5%;
  }

  .hero h1 {
    font-size: clamp(4rem, 20vw, 5.7rem);
  }

  .hero .personalized {
    width: max-content;
    max-width: calc(100% - 40px);
  }

  .botanical-anchor--hero-top { top: -34px; right: -38px; width: 190px; }
  .botanical-anchor--hero-bottom { left: -40px; bottom: -30px; width: 215px; }
}

@media (prefers-reduced-motion: reduce) {
  .light-envelope__piece { transition-duration: 1ms; }
  .light-envelope__hint { animation: none; }
}
