.envelope {
  position: relative;
  width: 280px;
  height: 180px;
  perspective: 800px;
}

.envelope-back,
.envelope-front,
.envelope-flap {
  position: absolute;
  inset: 0;
}

.envelope-back {
  background: var(--bg-cream-deep);
  border-radius: 4px;
  box-shadow: 0 12px 32px var(--shadow-warm), inset 0 0 0 1px rgba(139, 90, 79, 0.1);
}

.envelope-front {
  background: linear-gradient(180deg, var(--bg-cream-deep) 0%, #ecc9b8 100%);
  clip-path: polygon(0 30%, 50% 70%, 100% 30%, 100% 100%, 0 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 18px;
}

.envelope-seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-blush);
  color: var(--paper-white);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(197, 134, 138, 0.4);
}

.envelope-flap {
  background: linear-gradient(180deg, #ecc9b8 0%, var(--bg-cream-deep) 100%);
  clip-path: polygon(0 0, 100% 0, 50% 70%);
  transform-origin: top center;
  transform: rotateX(0deg);
  z-index: 2;
  box-shadow: 0 1px 3px rgba(139, 90, 79, 0.15);
}

@media (min-width: 480px) {
  .envelope { width: 360px; height: 230px; }
  .envelope-seal { width: 44px; height: 44px; font-size: 26px; }
}

.open-button {
  background: var(--ink-primary);
  color: var(--bg-cream);
  border: none;
  padding: 16px 40px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow-warm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.open-button:hover,
.open-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-warm);
  outline: none;
}

.open-button:active {
  transform: translateY(0);
}

.envelope-flap.is-open {
  animation: flap-open 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .envelope-flap.is-open {
    animation: flap-open 200ms ease forwards;
  }

  @keyframes flap-open {
    to { transform: rotateX(180deg); }
  }
}
