.vip-mailer {
  display: block;
  padding: clamp(95px, 10vw, 160px) max(24px, 7vw) clamp(85px, 9vw, 140px);
  background:
    radial-gradient(circle at 78% 24%, rgba(175, 190, 145, .18), transparent 34%),
    #f4f0e8;
  overflow: hidden;
  text-align: center;
}

.vip-mailer .vip-invitation-copy {
  position: relative;
  z-index: 10;
  max-width: 760px;
  margin: 0 auto 58px;
}

.vip-mailer .vip-invitation-copy .kicker {
  justify-content: center;
}

.vip-mailer .vip-invitation-copy h2 {
  margin: 22px 0;
  font-size: clamp(52px, 6.5vw, 92px);
  line-height: .92;
}

.vip-mailer .vip-invitation-copy h2 em {
  color: var(--terra);
}

.vip-mailer .vip-invitation-copy > p:last-child {
  max-width: 570px;
  margin: auto;
  color: #625e57;
  line-height: 1.8;
}

.vip-envelope-v2 {
  position: relative;
  width: min(100%, 760px);
  min-height: 500px;
  margin: 0 auto;
  transition: min-height .8s cubic-bezier(.2, .75, .25, 1);
}

.vip-envelope-v2[open] {
  min-height: 1180px;
}

.vip-envelope-v2 summary {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: min(100%, 720px);
  transform: translateX(-50%);
  list-style: none;
  cursor: pointer;
  outline: none;
}

.vip-envelope-v2 summary::-webkit-details-marker {
  display: none;
}

.mail-envelope {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.55 / 1;
  filter: drop-shadow(0 28px 38px rgba(28, 20, 18, .3));
  perspective: 1200px;
}

.mail-envelope-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid #5b443d;
  border-radius: 5px 5px 18px 18px;
  background: linear-gradient(145deg, #49362f, #2b211e);
}

.mail-envelope-flap {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: 60%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(150deg, #543d35, #30231f);
  border-top: 1px solid #6c5148;
  transform-origin: top center;
  transition: transform .75s cubic-bezier(.2, .75, .25, 1), z-index .1s .35s;
}

.mail-envelope-pocket {
  position: absolute;
  inset: 0;
  z-index: 5;
  clip-path: polygon(0 25%, 50% 72%, 100% 25%, 100% 100%, 0 100%);
  background:
    linear-gradient(145deg, rgba(255,255,255,.11), transparent 42%),
    linear-gradient(135deg, #46342e, #281e1b);
  border: 1px solid #5c453d;
  border-radius: 0 0 18px 18px;
}

.mail-envelope-seal {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 51%;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #d3ad69;
  background: radial-gradient(circle at 35% 30%, #a75a42, #7e3425 68%);
  box-shadow: 0 12px 28px rgba(38, 28, 21, .28), inset 0 0 0 6px #8b3e2c, inset 0 0 0 7px #d6af69;
  color: #f6e3bc;
  font: 600 20px/1 var(--font-display), Georgia, serif;
  letter-spacing: .13em;
  transition: opacity .25s ease, transform .25s ease;
}

.mail-envelope-seal small {
  margin-top: 5px;
  font: 700 10px/1 var(--font-sans), Arial, sans-serif;
  letter-spacing: .18em;
}

.vip-envelope-v2 summary:hover .mail-envelope-seal {
  transform: translate(-50%, -50%) scale(1.05);
}

.mail-envelope-hint {
  display: block;
  margin-top: 22px;
  color: #5c443c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.vip-mail-card {
  display: none;
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  bottom: auto;
  width: min(88%, 610px);
  transform: translateX(-50%);
  padding: 28px 32px 42px;
  border: 1px solid #c6ad7d;
  background: #fffdf8;
  box-shadow: 0 26px 70px rgba(42, 34, 27, .2);
  text-align: center;
}

.vip-mail-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(151, 121, 74, .3);
  pointer-events: none;
}

.vip-envelope-v2[open] summary {
  pointer-events: none;
}

.vip-envelope-v2[open] .mail-envelope-flap {
  z-index: 1;
  transform: rotateX(178deg);
}

.vip-envelope-v2[open] .mail-envelope-seal {
  opacity: 0;
}

.vip-envelope-v2[open] .vip-mail-card {
  display: block;
  animation: vipCardOut 1s cubic-bezier(.16, .84, .26, 1) both;
}

.vip-card-mark {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: #302b27;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .19em;
}

.vip-card-mark small {
  display: block;
  margin-top: 4px;
  font-size: 7px;
}

.vip-mail-card .vip-card-photo {
  position: relative;
  z-index: 1;
  height: 330px;
  margin-bottom: 24px;
  overflow: hidden;
}

.vip-mail-card .vip-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.vip-mail-card .kicker {
  position: relative;
  z-index: 1;
  justify-content: center;
}

.vip-mail-card h3 {
  position: relative;
  z-index: 1;
  margin: 15px 0;
  color: #29231f;
  font: 500 clamp(42px, 5vw, 60px)/.9 var(--font-display), Georgia, serif;
  letter-spacing: -.035em;
}

.vip-mail-card h3 em {
  color: var(--terra);
}

.vip-mail-card > p:not(.kicker):not(.vip-card-mark) {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto 24px;
  color: #665f58;
  font-size: 13px;
  line-height: 1.7;
}

.vip-mail-card form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  text-align: left;
}

.vip-mail-card form label span {
  display: block;
  margin-bottom: 7px;
  color: #5b5148;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vip-mail-card form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #c8beb0;
  background: #fff;
  color: #29231f;
  font: 500 13px var(--font-sans), Arial, sans-serif;
}

.vip-mail-card form button {
  grid-column: 1 / -1;
  height: 52px;
  border: 0;
  background: #879d68;
  color: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.vip-mail-card form button:disabled {
  cursor: wait;
  opacity: .7;
}

.vip-mail-card form > small {
  grid-column: 1 / -1;
  color: #827a72;
  font-size: 8px;
  text-align: center;
}

.vip-envelope-v2.is-closing[open] .vip-mail-card {
  animation: vipCardIn 1s cubic-bezier(.55, .05, .45, .95) both;
}

.vip-envelope-v2.is-closing[open] .mail-envelope-flap {
  z-index: 6;
  transform: rotateX(0deg);
  transition-delay: .48s, .48s;
}

.vip-envelope-v2.is-closing[open] .mail-envelope-seal {
  opacity: 1;
  transition-delay: .82s;
}

.vip-envelope-success {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -36px;
  margin: 0;
  color: #536044;
  font: italic 18px var(--font-display), Georgia, serif;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}

.vip-envelope-v2.is-sent .vip-envelope-success {
  opacity: 1;
  transform: translateY(0);
}

@keyframes vipCardOut {
  from { opacity: 0; transform: translate(-50%, 250px) scale(.97); }
  30% { opacity: 1; }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes vipCardIn {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  70% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, 240px) scale(.97); }
}

@media (max-width: 680px) {
  .vip-mailer {
    padding: 80px 14px 95px;
  }

  .vip-mailer .vip-invitation-copy {
    padding: 0 12px;
    margin-bottom: 38px;
  }

  .vip-envelope-v2 {
    min-height: 350px;
  }

  .vip-envelope-v2[open] {
    min-height: 1100px;
  }

  .mail-envelope {
    aspect-ratio: 1.2 / 1;
  }

  .mail-envelope-seal {
    width: 92px;
    height: 92px;
    font-size: 17px;
  }

  .vip-mail-card {
    bottom: 105px;
    width: 95%;
    padding: 20px 18px 30px;
  }

  .vip-mail-card .vip-card-photo {
    height: 285px;
  }

  .vip-mail-card form {
    grid-template-columns: 1fr;
  }

  .vip-mail-card form button,
  .vip-mail-card form > small {
    grid-column: 1;
  }

  @keyframes vipCardOut {
    from { opacity: 0; transform: translate(-50%, 180px) scale(.97); }
    30% { opacity: 1; }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }

  @keyframes vipCardIn {
    from { opacity: 1; transform: translate(-50%, 0) scale(1); }
    70% { opacity: 1; }
    to { opacity: 0; transform: translate(-50%, 175px) scale(.97); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .vip-mail-card,
  .mail-envelope-flap,
  .mail-envelope-seal {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
