:root {
  --white: #fffafb;
  --blush: #fdeef1;
  --pink: #f5c6d2;
  --rose: #e39bb0;
  --deep: #b2607a;
  --ink: #6e4757;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  background: var(--white);
  color: var(--ink);
  line-height: 1.7;
  text-align: center;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }

.script { font-family: 'Great Vibes', cursive; font-weight: 400; color: var(--deep); }
.small {
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--rose);
}

/* ============ COVER + AMPLOP ============ */
#cover {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 34px; padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, var(--pink) 0, transparent 40%),
    radial-gradient(circle at 90% 95%, var(--pink) 0, transparent 42%),
    var(--blush);
  transition: opacity 1.1s ease, visibility 1.1s;
}
#cover.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.top-text { letter-spacing: .4em; }
.hint {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.05rem; color: var(--deep);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.envelope {
  position: relative;
  width: min(86vw, 340px); aspect-ratio: 5 / 4;
  filter: drop-shadow(0 18px 24px rgba(178, 96, 122, .25));
  margin-top: 60px;
}
.env-back { position: absolute; inset: 0; background: var(--rose); border-radius: 6px; }

.letter {
  position: absolute; left: 7%; right: 7%; top: 7%; bottom: 3%;
  background: var(--white); border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 2; transition: transform 1s ease .6s;
}
.letter-name { font-size: 2.6rem; line-height: 1.1; }
.letter-age {
  font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: var(--rose);
}

.env-front {
  position: absolute; inset: 0; z-index: 3; border-radius: 6px;
  background: var(--pink);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.to { position: absolute; left: 0; right: 0; bottom: 7%; padding: 0 16px; }
.to h2 {
  font-family: 'Cormorant Garamond', serif; font-weight: 500;
  font-size: 1.7rem; color: var(--deep); word-break: break-word; line-height: 1.2;
}

.flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%;
  background: #eeb0c1; z-index: 4;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .8s ease, z-index 0s .4s;
}

.seal {
  position: absolute; left: 50%; top: 56%; z-index: 5;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #d9798f, var(--deep));
  color: #fff; font-size: 1.6rem; line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
  animation: beat 1.4s ease-in-out infinite;
  transition: opacity .4s;
}
@keyframes beat { 50% { transform: scale(1.12); } }

.envelope.open .flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .letter { transform: translateY(-62%); }
.envelope.open .seal { opacity: 0; pointer-events: none; animation: none; }

/* ============ KONTEN ============ */
main section { padding: 70px 24px; max-width: 520px; margin: 0 auto; position: relative; z-index: 1; }

.hero .big { font-size: 5rem; line-height: 1.1; margin: 4px 0 26px; }
.arch {
  width: 240px; height: 310px; margin: 0 auto 30px;
  border-radius: 120px 120px 14px 14px; overflow: hidden;
  border: 7px solid #fff;
  box-shadow: 0 0 0 2px var(--pink), 0 16px 34px rgba(178, 96, 122, .22);
}
.arch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead {
  font-family: 'Cormorant Garamond', serif; font-size: 1.3rem;
  max-width: 360px; margin: 0 auto;
}
.guest-inline { font-weight: 500; color: var(--deep); }

.event { background: var(--blush); max-width: none !important; }
.event > * { max-width: 440px; margin-left: auto; margin-right: auto; }
.section-title { font-size: 2.8rem; margin-bottom: 20px; }
.card {
  background: var(--white); border-radius: 22px; padding: 30px 22px;
  box-shadow: 0 10px 28px rgba(178, 96, 122, .14);
  border: 1px solid var(--pink);
}
.label { font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--rose); margin-top: 16px; }
.card .label:first-child { margin-top: 0; }
.value { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--ink); line-height: 1.3; }

.btn {
  display: inline-block; margin-top: 26px; text-decoration: none;
  background: var(--deep); color: #fff; padding: 12px 30px; border-radius: 999px;
  font-size: .85rem; letter-spacing: .12em; transition: background .2s, transform .2s;
}
.btn:hover { background: var(--rose); transform: translateY(-2px); }

.countdown { display: flex; gap: 10px; margin-top: 28px; }
.countdown div { flex: 1; background: var(--white); border-radius: 16px; padding: 12px 4px; border: 1px solid var(--pink); }
.countdown span { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; color: var(--deep); line-height: 1.2; }
.countdown small { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rose); }

.polaroid {
  background: #fff; padding: 12px 12px 44px; width: 280px; margin: 0 auto;
  transform: rotate(-3deg); border-radius: 4px;
  box-shadow: 0 14px 30px rgba(178, 96, 122, .22);
}
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.caption { font-size: 1.8rem; line-height: 1.3; margin-top: 34px; }

footer { padding: 30px 24px 100px; position: relative; z-index: 1; }
.sign { font-size: 2.6rem; margin-top: 10px; }

/* ============ MUSIK + KELOPAK ============ */
#music-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--deep); color: #fff; font-size: 1.3rem;
  box-shadow: 0 4px 14px rgba(178, 96, 122, .4);
}
#music-btn.playing { animation: spin 4s linear infinite; }
#music-btn.muted { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

#petals { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -30px; width: 12px; height: 16px;
  background: var(--pink); border-radius: 80% 0 80% 0; opacity: .75;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translate3d(var(--drift), 108vh, 0) rotate(540deg); }
}

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .petal, .seal, .hint { animation: none; }
}
