:root {
  --bg: #f8f2e9;
  --accent: #c9a56a;
  --accent-2: #7da18f;
  --text: #2d2a2b;
  --muted: #8b8681;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #fdf8f1 0, #f8f2e9 35%, #f4ecdf 100%);
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  color: var(--text);
  display: grid;
  place-items: center;
}

.page {
  width: min(420px, 94vw);
  min-height: 100vh;
  padding: 40px 22px 32px;
  position: relative;
  overflow: hidden;
}

.balloons {
  position: absolute;
  top: 40px;
  left: 16px;
  pointer-events: none;
}

.balloon {
  position: absolute;
  width: 62px;
  height: 74px;
  border-radius: 50% 50% 48% 52%;
  background: #e8dfd4;
  opacity: 0.7;
  animation: float 6s ease-in-out infinite;
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -28px;
  left: 50%;
  width: 2px;
  height: 32px;
  background: #cbb89d;
}

.b1 { background: #e7decf; animation-delay: 0s; }
.b2 { background: #d7c7a6; left: 38px; top: 8px; animation-delay: 1s; }
.b3 { background: #c9ad81; left: 72px; top: -6px; animation-delay: 2s; }
.b4 { background: #dfe7e0; left: 18px; top: -14px; animation-delay: 2.8s; }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.hero {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 28px;
}

.overline {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.hero h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 34px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.name {
  margin: 4px 0 10px;
  font-family: 'Great Vibes', cursive;
  font-size: 30px;
  color: var(--text);
}

.message {
  margin: 0 auto;
  max-width: 290px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.invite {
  display: grid;
  place-items: center;
  gap: 14px;
  margin-top: 12px;
}

.envelope {
  position: relative;
  width: 260px;
  height: 170px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  transform: translateZ(0);
}

.envelope__back,
.envelope__front,
.envelope__paper {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.envelope__back {
  background: linear-gradient(135deg, #d6c4a7 0%, #c8b087 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.envelope__front {
  background: linear-gradient(145deg, #ede2d2 0%, #e1d3bd 50%, #d3b98f 100%);
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  transform-origin: 50% 20%;
  z-index: 3;
}

.envelope__seal {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  background: radial-gradient(circle at 30% 30%, #ffeac5, #dcb271 70%);
  border-radius: 50%;
  border: 2px solid #b7894e;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
  font-size: 22px;
  z-index: 4;
  transition: transform 0.6s ease;
}

.envelope__paper {
  background: #fdfbf7;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
  transform: translateY(12px);
  z-index: 1;
  display: grid;
  place-items: center;
}

.paper__title {
  margin: 36px 0 6px;
  font-family: 'Playfair Display', serif;
  color: var(--accent-2);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.paper__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.cta {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer {
  text-align: center;
  margin-top: 24px;
}

.footnote {
  font-size: 12px;
  color: #b1a79b;
  margin: 0;
}

.envelope:hover .envelope__seal {
  transform: translateX(-50%) scale(1.04);
}

.envelope:active .envelope__seal {
  transform: translateX(-50%) scale(0.98);
}

.envelope.open .envelope__front {
  transform: rotateX(160deg);
  opacity: 0.1;
}

.envelope.open .envelope__paper {
  transform: translateY(-130px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.envelope.open .envelope__seal {
  transform: translateX(-50%) translateY(12px) scale(0.92);
  opacity: 0.85;
}

@media (max-width: 420px) {
  .page { padding-top: 32px; }
  .envelope { width: 240px; height: 158px; }
}
