:root {
  --bg-cream: #fdf8f4;
  --bg-blush: #f9ece8;
  --bg-card: #fffdfb;
  --burgundy: #5b2233;
  --burgundy-soft: #7b3b4e;
  --rose: #d98296;
  --rose-light: #f2cfd7;
  --gold: #c69a55;
  --gold-light: #e7cfa0;
  --gold-deep: #9f7432;
  --text-main: #3e282e;
  --text-muted: #7c6269;
  --shadow-soft: 0 18px 45px rgba(91, 34, 51, 0.09);
  --shadow-card: 0 12px 30px rgba(91, 34, 51, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 15%, rgba(242, 207, 215, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(231, 207, 160, 0.4) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(242, 207, 215, 0.45) 0%, transparent 50%),
    var(--bg-cream);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

#bg-canvas,
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#bg-canvas {
  z-index: 0;
}

#confetti-canvas {
  z-index: 60;
}

/* Music Toggle Button */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(198, 154, 85, 0.45);
  background: rgba(255, 253, 251, 0.88);
  backdrop-filter: blur(10px);
  color: var(--burgundy);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(91, 34, 51, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.music-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(91, 34, 51, 0.16);
}

.music-btn.playing .music-icon {
  animation: musicPulse 1.3s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); color: var(--gold-deep); }
}

/* Envelope Opening Screen */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(242, 207, 215, 0.65), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(231, 207, 160, 0.55), transparent 50%),
    #fbf3ee;
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.envelope-screen.fade-out {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 470px;
}

.envelope-glow {
  position: absolute;
  inset: -18px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(217, 130, 150, 0.35), rgba(198, 154, 85, 0.35));
  filter: blur(26px);
  z-index: 0;
}

.envelope-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #fffdfb 0%, #fcf4ef 100%);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(91, 34, 51, 0.16);
  border: 1px solid rgba(198, 154, 85, 0.35);
}

.envelope-border {
  border: 1.5px solid rgba(198, 154, 85, 0.5);
  border-radius: 18px;
  padding: 42px 28px;
  text-align: center;
  position: relative;
}

.envelope-tag {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 14px;
}

.envelope-to {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-muted);
}

.envelope-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.1;
  margin: 4px 0 14px;
}

.envelope-date-pill {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d7b272, #b88940);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  margin-bottom: 22px;
  box-shadow: 0 6px 16px rgba(184, 137, 64, 0.32);
}

.envelope-hint {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.wax-seal-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #8c2d48 0%, #5b2233 100%);
  color: #fff9f4;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(91, 34, 51, 0.32);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wax-seal-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 34px rgba(91, 34, 51, 0.42);
}

.seal-ring {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1.5px solid rgba(198, 154, 85, 0.65);
  animation: ringPulse 2.2s ease-out infinite;
}

@keyframes ringPulse {
  0% { transform: scale(0.98); opacity: 0.85; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* Main Content Layout */
.main-card {
  position: relative;
  z-index: 1;
  max-width: 1020px;
  margin: 0 auto;
  padding: 64px 20px 80px;
}

.section {
  margin-bottom: 84px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 28px 16px 12px;
}

.ornament-top {
  color: var(--gold);
  letter-spacing: 0.35em;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.hero-script {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.8rem, 7.5vw, 4.8rem);
  color: var(--gold-deep);
  line-height: 1.15;
  text-shadow: 0 2px 14px rgba(198, 154, 85, 0.22);
}

.hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.3rem, 9vw, 5.4rem);
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.05;
  margin: 6px 0 20px;
  letter-spacing: 0.02em;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d7b272, #b4853b);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(180, 133, 59, 0.28);
  margin-bottom: 24px;
}

.date-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
}

.hero-subtitle {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 8px;
}

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--burgundy);
  font-weight: 700;
}

/* Polaroid Gallery */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: center;
}

.polaroid {
  background: #fffdfb;
  padding: 14px 14px 20px;
  border-radius: 16px;
  border: 1.5px solid rgba(198, 154, 85, 0.42);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.polaroid-1 { transform: rotate(-2.5deg); }
.polaroid-2 { transform: translateY(-10px) rotate(1.5deg); }
.polaroid-3 { transform: rotate(2.2deg); }

.polaroid:hover,
.polaroid:focus-visible {
  transform: translateY(-12px) rotate(0deg) scale(1.03);
  box-shadow: 0 22px 44px rgba(91, 34, 51, 0.18);
  outline: none;
}

.polaroid-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-blush);
}

.polaroid-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.polaroid:hover .polaroid-frame img {
  transform: scale(1.05);
}

.polaroid figcaption {
  margin-top: 14px;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--burgundy-soft);
  font-weight: 600;
}

.gallery-hint {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 22px;
}

/* Letter Card */
.letter-card {
  position: relative;
  max-width: 740px;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffdfb 0%, #fdf6f1 100%);
  border: 1px solid rgba(198, 154, 85, 0.45);
  border-radius: 24px;
  padding: 48px 44px;
  box-shadow: var(--shadow-soft);
}

.letter-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--gold);
  border-style: solid;
}

.letter-corner.tl { top: 14px; left: 14px; border-width: 2px 0 0 2px; border-radius: 6px 0 0 0; }
.letter-corner.tr { top: 14px; right: 14px; border-width: 2px 2px 0 0; border-radius: 0 6px 0 0; }
.letter-corner.bl { bottom: 14px; left: 14px; border-width: 0 0 2px 2px; border-radius: 0 0 0 6px; }
.letter-corner.br { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; border-radius: 0 0 6px 0; }

.letter-salutation {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 18px;
}

.letter-body p {
  font-size: 1.03rem;
  color: var(--text-main);
  margin-bottom: 16px;
}

.letter-body strong {
  color: var(--burgundy);
}

.letter-signature {
  margin-top: 26px;
  text-align: right;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--burgundy);
}

.signature-heart {
  color: #c94c68;
  margin-left: 4px;
}

/* Interactive Cake */
.cake-stage {
  background: rgba(255, 253, 251, 0.84);
  border: 1px solid rgba(198, 154, 85, 0.35);
  border-radius: 26px;
  padding: 46px 24px 38px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.cake {
  position: relative;
  width: 240px;
  margin: 24px auto 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candles {
  display: flex;
  gap: 18px;
  z-index: 3;
  margin-bottom: -6px;
}

.candle {
  position: relative;
  width: 14px;
  height: 48px;
  border: none;
  border-radius: 5px 5px 2px 2px;
  background: repeating-linear-gradient(
    -45deg,
    #fff7f0,
    #fff7f0 6px,
    #e598a9 6px,
    #e598a9 12px
  );
  cursor: pointer;
  box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.candle:hover {
  transform: translateY(-2px);
}

.flame {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 22px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 70%, #fffbe0 10%, #ffca3a 55%, #ff6b35 100%);
  box-shadow: 0 0 14px rgba(255, 190, 50, 0.85), 0 0 28px rgba(255, 130, 50, 0.45);
  animation: flicker 0.9s ease-in-out infinite alternate;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.candle.blown .flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.2);
}

.smoke {
  position: absolute;
  top: -26px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(160, 150, 155, 0.45);
  opacity: 0;
  pointer-events: none;
}

.candle.blown .smoke {
  animation: smokeRise 1.2s ease-out forwards;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
  50% { transform: translateX(-50%) scale(1.06, 0.95) rotate(2deg); }
  100% { transform: translateX(-50%) scale(0.96, 1.07) rotate(-1deg); }
}

@keyframes smokeRise {
  0% { opacity: 0.7; transform: translate(-50%, 0) scale(0.7); }
  100% { opacity: 0; transform: translate(-35%, -34px) scale(2.4); }
}

.cake-top-icing {
  width: 174px;
  height: 18px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #fff8f3, #f8dde4);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(91, 34, 51, 0.08);
}

.tier-top {
  width: 168px;
  height: 58px;
  background: linear-gradient(180deg, #f3bbc8, #e69eb0);
  border-radius: 0 0 10px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid rgba(198, 154, 85, 0.45);
}

.cake-label {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.9);
  color: var(--burgundy);
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}

.tier-bottom {
  width: 216px;
  height: 70px;
  background: linear-gradient(180deg, #f9d8df, #edb8c5);
  border-radius: 12px 12px 14px 14px;
  margin-top: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -6px 12px rgba(91, 34, 51, 0.08);
}

.cake-dots {
  display: flex;
  gap: 16px;
}

.cake-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 1px 3px rgba(159, 116, 50, 0.35);
}

.cake-plate {
  width: 244px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d7b272, #f1dec0, #c69a55);
  margin-top: 2px;
  box-shadow: 0 10px 22px rgba(91, 34, 51, 0.14);
}

.cake-status {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.cake-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 13px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, #8c2d48, #5b2233);
  color: #fffaf6;
  box-shadow: 0 10px 24px rgba(91, 34, 51, 0.26);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(91, 34, 51, 0.34);
}

.btn-secondary {
  border: 1.5px solid var(--gold);
  background: #fffdfb;
  color: var(--burgundy);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: #fcf4ea;
}

.wish-reveal {
  margin-top: 24px;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(242, 207, 215, 0.35), rgba(231, 207, 160, 0.35));
  border: 1px solid rgba(198, 154, 85, 0.45);
  animation: fadeSlideUp 0.6s ease;
}

.wish-reveal-title {
  font-weight: 600;
  color: var(--burgundy);
  margin-bottom: 4px;
}

.wish-reveal-text {
  color: var(--text-main);
  font-size: 0.95rem;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Wishes Wall */
.wish-form {
  max-width: 620px;
  margin: 0 auto 32px;
  background: rgba(255, 253, 251, 0.9);
  border: 1px solid rgba(198, 154, 85, 0.35);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.form-row {
  margin-bottom: 14px;
}

.wish-form input,
.wish-form textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(198, 154, 85, 0.45);
  background: #fffdfb;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wish-form input:focus,
.wish-form textarea:focus {
  border-color: var(--burgundy-soft);
  box-shadow: 0 0 0 3px rgba(123, 59, 78, 0.12);
}

.wishes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.wish-item {
  background: #fffdfb;
  border: 1px solid rgba(198, 154, 85, 0.35);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 10px 24px rgba(91, 34, 51, 0.06);
  animation: fadeSlideUp 0.45s ease;
}

.wish-item-text {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 12px;
}

.wish-item-author {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold-deep);
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-ornament {
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 10px;
}

.link-btn {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--burgundy);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(34, 15, 22, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-content {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 16px;
  border: 2px solid rgba(231, 207, 160, 0.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-content p {
  margin-top: 14px;
  color: #f9ece8;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.35rem;
}

/* Responsive */
@media (max-width: 780px) {
  .polaroid-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
    gap: 24px;
  }

  .polaroid-1,
  .polaroid-2,
  .polaroid-3 {
    transform: none;
  }

  .letter-card {
    padding: 34px 24px;
  }

  .main-card {
    padding: 52px 16px 64px;
  }
}
