:root {
  --bg: #FFF4E4;
  --ink: #2B2350;
  --ink-2: #6B6589;
  --line: #EFE4F2;
  --coral: #FF6B57;
  --sun: #FFB81F;
  --mint: #3CC6A6;
  --sky: #4B9DFF;
  --font: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 184, 31, .18) 0 120px, transparent 121px),
    radial-gradient(circle at 92% 30%, rgba(60, 198, 166, .14) 0 140px, transparent 141px),
    radial-gradient(circle at 6% 70%, rgba(75, 157, 255, .12) 0 130px, transparent 131px),
    var(--bg);
  color: var(--ink); font: 600 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
[hidden] { display: none !important; }

/* ---------- Cover with a gift ---------- */
#cover {
  position: fixed; inset: 0; z-index: 50; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  background: linear-gradient(180deg, #8FD3FF 0%, #BDE6FF 55%, #FFF4E4 100%);
  cursor: pointer; outline: none; transition: opacity .6s ease, visibility 0s .6s;
}
.opened #cover { opacity: 0; visibility: hidden; }
.cover-to { font: 900 34px/1.15 var(--font); text-align: center; padding: 0 24px; color: var(--ink); transition: opacity .3s; position: relative; z-index: 2; }
.cover-hint { font: 800 15px/1 var(--font); color: var(--ink); background: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: 0 6px 0 rgba(43, 35, 80, .12); position: relative; z-index: 2; transition: opacity .3s; }
.opening .cover-to, .opening .cover-hint { opacity: 0; }

.gift { position: relative; width: 210px; height: 210px; z-index: 2; animation: wiggle 2.6s ease-in-out infinite; }
.opening .gift { animation: none; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(2deg); } }
.box {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 132px; border-radius: 14px;
  background: linear-gradient(90deg, transparent 43%, var(--sun) 43% 57%, transparent 57%), var(--coral);
  box-shadow: inset -18px 0 0 rgba(0, 0, 0, .07), 0 14px 0 -4px rgba(43, 35, 80, .12);
}
.lid {
  position: absolute; left: 0; right: 0; top: 50px; height: 44px; border-radius: 12px; z-index: 2;
  background: linear-gradient(90deg, transparent 43%, #FFC64D 43% 57%, transparent 57%), #FF806E;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .06);
  transition: transform .9s cubic-bezier(.3, 1.4, .5, 1), opacity .4s .55s;
}
.opening .lid { transform: translate(40px, -260px) rotate(28deg); opacity: 0; }
.bow-l, .bow-r { position: absolute; top: -36px; width: 52px; height: 40px; border: 10px solid var(--sun); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.bow-l { left: 50%; margin-left: -54px; transform: rotate(-24deg); }
.bow-r { left: 50%; margin-left: 2px; transform: rotate(24deg); }
.knot { position: absolute; left: 50%; top: -14px; width: 22px; height: 18px; margin-left: -11px; border-radius: 7px; background: #F0A500; }

#cover .sky .b, .hero .b {
  position: absolute; width: 64px; height: 78px; border-radius: 50% 50% 47% 47% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55) 0 7px, transparent 8px), var(--c);
  animation: float 5s ease-in-out infinite;
}
#cover .sky .b::after, .hero .b::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 70px; background: rgba(43, 35, 80, .25); }
#cover .b1 { --c: var(--sun); left: 8%; top: 12%; }
#cover .b2 { --c: var(--mint); right: 9%; top: 18%; animation-delay: -1.6s; width: 54px; height: 66px; }
#cover .b3 { --c: #B07CFF; right: 24%; bottom: 10%; animation-delay: -3s; width: 48px; height: 58px; }
@keyframes float { 50% { transform: translateY(-14px) rotate(3deg); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- Page ---------- */
main { max-width: 520px; margin: 0 auto; padding: 0 18px; }
.reveal { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .6s ease, transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.reveal.in { opacity: 1; transform: none; }
h2 { font: 900 28px/1.15 var(--font); margin-bottom: 10px; }
.t1 { font-weight: 800; font-size: 19px; }
.t2 { color: var(--ink-2); font-weight: 600; }

.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0 60px; }
.hero .balloons { position: absolute; inset: 0; pointer-events: none; }
.hero .b1 { --c: var(--coral); left: 2%; top: 9%; }
.hero .b2 { --c: var(--sky); right: 4%; top: 6%; animation-delay: -2s; }
.hero .b3 { --c: var(--sun); left: 6%; bottom: 14%; width: 52px; height: 64px; animation-delay: -1s; }
.hero .b4 { --c: var(--mint); right: 8%; bottom: 18%; width: 56px; height: 68px; animation-delay: -3.2s; }
.opened .hero > :not(.balloons) { animation: pop .8s cubic-bezier(.3, 1.5, .5, 1) both; }
.opened .hero > :nth-child(3) { animation-delay: .12s; }
.opened .hero > :nth-child(4) { animation-delay: .24s; }
.opened .hero > :nth-child(5) { animation-delay: .34s; }
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(20px); } }
.hey { font: 900 30px/1.2 var(--font); margin-bottom: 22px; }
.hero h1 { display: flex; flex-direction: column; align-items: center; margin: 10px 0 0; }
.h-small { font: 900 34px/1 var(--font); color: var(--ink); }
.big {
  font: 900 220px/.9 var(--font); color: var(--coral);
  text-shadow: 0 10px 0 #E2503D, 0 22px 30px rgba(226, 80, 61, .25);
  font-variant-numeric: lining-nums;
}
.lead { font: 800 22px/1.3 var(--font); max-width: 300px; margin-top: 18px; }
.from { font: 900 20px/1 var(--font); color: var(--coral); margin-top: 18px; transform: rotate(-3deg); }

.card { background: #fff; border-radius: 28px; padding: 28px 24px; margin-bottom: 16px; box-shadow: 0 8px 0 rgba(43, 35, 80, .05), 0 18px 40px -20px rgba(43, 35, 80, .2); }
.when-row { display: flex; align-items: center; gap: 18px; }
.cal { width: 84px; height: 88px; border-radius: 20px; background: var(--coral); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; box-shadow: 0 6px 0 #E2503D; }
.cal b { font: 900 40px/1 var(--font); }
.cal span { font-weight: 800; font-size: 13px; }
.cd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.cd div { background: var(--bg); border-radius: 18px; padding: 12px 0; text-align: center; }
.cd b { display: block; font: 900 30px/1 var(--font); font-variant-numeric: tabular-nums; }
.cd span { font-size: 13px; color: var(--ink-2); }

.place .t2 { margin-bottom: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--bg); color: var(--ink); border: 0; font: 800 16px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn-solid { width: 100%; margin-top: 22px; background: var(--coral); color: #fff; box-shadow: 0 6px 0 #E2503D; }

.program ol { list-style: none; margin-top: 8px; }
.program li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: start; padding: 12px 0; }
.program time { display: inline-flex; justify-content: center; padding: 6px 0; border-radius: 12px; background: var(--c); color: #fff; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; }
.program b { display: block; font-weight: 800; }
.program span { color: var(--ink-2); font-size: 15px; }

.dress p { color: var(--ink-2); }
.take { margin-top: 18px; padding: 16px 18px; background: var(--bg); border-radius: 18px; }
.take ul { list-style: none; margin-top: 6px; }
.take li { padding-left: 22px; position: relative; color: var(--ink-2); }
.take li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); }
.parents p { color: var(--ink-2); }

.rsvp .t2 { margin-bottom: 18px; }
fieldset { border: 0; }
.choice { display: grid; gap: 10px; }
.choice label { cursor: pointer; }
.choice input, .chips input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; justify-content: center; height: 58px; border-radius: 18px; background: var(--bg); font-weight: 800; border: 3px solid transparent; transition: all .15s; }
.choice input:checked + span { border-color: var(--mint); background: #E8FAF5; }
.choice input[value="no"]:checked + span { border-color: var(--ink-2); background: #F1EFF6; }
.choice.need span { border-color: var(--coral); }
#rsvp.is-no .when-yes { display: none; }
.q { font-weight: 800; margin: 20px 0 10px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips span { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--bg); font-size: 15px; border: 2px solid transparent; }
.chips input:checked + span { border-color: var(--sky); background: #EAF3FF; }
.field { display: block; margin-top: 20px; }
.field > span { display: block; font-weight: 800; margin-bottom: 8px; }
.field input { width: 100%; height: 54px; border-radius: 16px; border: 2px solid var(--line); padding: 0 16px; font: 600 16px var(--font); color: var(--ink); outline: none; background: #fff; }
.field input:focus { border-color: var(--sky); }
.done { text-align: center; padding: 6px 0; }
.done-big { font: 900 54px/1 var(--font); color: var(--coral); margin-bottom: 10px; }
.done p + p { margin-top: 8px; }
.link { margin-top: 18px; background: none; border: 0; color: var(--ink-2); font: 700 14px var(--font); text-decoration: underline; cursor: pointer; }

footer { text-align: center; padding: 26px 0 calc(56px + env(safe-area-inset-bottom)); }
footer .btn { background: #fff; box-shadow: 0 6px 0 rgba(43, 35, 80, .08); }
.foot { margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.foot a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
