:root {
  --blush: #fbe9ec;
  --blush-2: #f6d3da;
  --rose: #d98a9b;
  --rose-deep: #a8536a;
  --butter: #fdf3d4;
  --yellow: #f7dc8c;
  --gold: #c9a14a;
  --gold-2: #e6c77a;
  --gold-deep: #9a7428;
  --ink: #4a2c35;
  --muted: #8a6a72;
  --paper: #fffaf6;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
  --sans: "Jost", system-ui, sans-serif;
  --gold-grad: linear-gradient(135deg, #9a7428 0%, #e6c77a 30%, #fff1c4 50%, #d4ad55 70%, #9a7428 100%);
  --gold-text: linear-gradient(135deg, #8a6420 0%, #c9a14a 30%, #e9cf86 50%, #b98d38 70%, #7d5a1c 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 10% -10%, #fff4d9 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, #f9d7df 0%, transparent 55%),
    linear-gradient(180deg, var(--blush) 0%, #fdf0e6 50%, var(--blush) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
}
.hidden { display: none !important; }
.serif { font-family: var(--serif); font-weight: 500; }
.script { font-family: var(--script); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: .72rem;
  font-weight: 400;
  color: var(--gold-deep);
}
.lead { font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--muted); max-width: 34rem; margin: 0 auto; }

#sparkles, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#sparkles { z-index: 0; }
#confetti { z-index: 50; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: .85rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  padding: 1.05rem 2.2rem;
  border-radius: 999px;
  transition: transform .3s ease, box-shadow .3s ease;
}
.btn.gold {
  color: #4a3510;
  background: var(--gold-grad);
  background-size: 200% 200%;
  animation: sheen 4s ease infinite;
  box-shadow: 0 10px 30px -10px rgba(154, 116, 40, .6), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn.gold:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(154, 116, 40, .7); }
.btn:disabled { opacity: .6; cursor: default; }
@keyframes sheen { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- intro ---------- */
.screen {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
  text-align: center;
}
.intro-inner { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.intro-inner h1 { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.1; }
#intro-before, #intro-after { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
#intro-before > *, #intro-after > * { animation: rise 1s ease both; }
#intro-before > :nth-child(2), #intro-after > :nth-child(2) { animation-delay: .25s; }
#intro-before > :nth-child(3), #intro-after > :nth-child(3) { animation-delay: .5s; }
#intro-after > :nth-child(4) { animation-delay: 1.2s; }

.clock {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4.5rem, 22vw, 9rem);
  line-height: 1;
  display: flex; align-items: center;
  font-variant-numeric: lining-nums tabular-nums;
  background: var(--gold-text);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: sheen 6s ease infinite;
  filter: drop-shadow(0 6px 18px rgba(201, 161, 74, .25));
}
.clock .digit { display: inline-block; width: .62em; text-align: center; }
.clock .digit.tick { animation: tick .12s ease; }
.clock .colon { width: .3em; text-align: center; animation: blink 1.2s steps(1) infinite; }
.clock.midnight { animation: sheen 3s ease infinite, glow 2.2s ease-in-out infinite; }
.clock.midnight .colon { animation: none; }
@keyframes tick { from { transform: translateY(-12%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes glow { 50% { filter: drop-shadow(0 0 28px rgba(247, 220, 140, .9)); } }

.name {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(4rem, 18vw, 8rem) !important;
  line-height: 1.25 !important;
  background: var(--gold-text);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: sheen 5s ease infinite, rise 1.2s ease both !important;
  padding: 0 .35em 0 .45em;
}
.name.smaller { font-size: clamp(2.6rem, 11vw, 4.8rem) !important; }
#hb-small { font-size: 2rem; color: var(--rose-deep); }

.scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  color: var(--gold-deep); text-decoration: none;
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  margin-top: 1rem;
}
.scroll-cue svg { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- sections ---------- */
main.locked { display: none; }
.section { position: relative; z-index: 1; padding: 6rem 1.25rem; max-width: 1080px; margin: 0 auto; }
.sec-head { text-align: center; margin-bottom: 3rem; display: flex; flex-direction: column; gap: .7rem; }
.sec-head h2 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; color: var(--ink); }

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

/* ---------- letter ---------- */
.paper {
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(168, 83, 106, .35), 0 0 0 1px rgba(201, 161, 74, .25);
  position: relative;
}
#letter .paper { max-width: 640px; margin: 0 auto; padding: 4rem clamp(1.5rem, 6vw, 4rem) 3rem; }
#letter .paper::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(201, 161, 74, .35); border-radius: 3px; pointer-events: none;
}
.seal {
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--script); font-size: 1.9rem; color: #fff6e0;
  background: radial-gradient(circle at 35% 30%, #e7a6b5, var(--rose-deep));
  box-shadow: 0 6px 14px rgba(168, 83, 106, .4), inset 0 0 0 3px rgba(255,255,255,.15);
}
#letter-body p { font-family: var(--serif); font-size: 1.28rem; line-height: 1.75; margin-bottom: 1.2rem; }
#letter-body p:first-child { font-family: var(--script); font-size: 2.1rem; color: var(--rose-deep); }
.sign { font-size: 2.2rem; color: var(--gold-deep); text-align: right; margin-top: 1rem; }

/* ---------- reasons ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.card { perspective: 900px; aspect-ratio: 3 / 4; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
  transform-style: preserve-3d;
}
.card.flipped .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 14px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; padding: 1rem; text-align: center;
}
.face.front {
  background: linear-gradient(150deg, #fff6e2, var(--blush-2));
  box-shadow: 0 12px 26px -14px rgba(168, 83, 106, .5), inset 0 0 0 1px rgba(201, 161, 74, .45);
}
.face.front::after { content: ""; position: absolute; inset: 7px; border-radius: 10px; border: 1px solid rgba(201,161,74,.4); }
.face.front .num {
  font-family: var(--serif); font-size: 3rem; font-weight: 500;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.face.back {
  transform: rotateY(180deg);
  background: var(--paper);
  box-shadow: 0 12px 26px -14px rgba(168, 83, 106, .5), inset 0 0 0 1px rgba(201, 161, 74, .35);
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.4; font-style: italic;
}
.face.back small { position: absolute; top: .7rem; left: 0; right: 0; font-style: normal; font-family: var(--sans); font-size: .65rem; letter-spacing: .25em; color: var(--gold-deep); }
#reasons-progress { margin-top: 1.6rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; position: relative; max-width: 860px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold) 8%, var(--gold) 92%, transparent);
}
.tl-item { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 4rem; position: relative; }
.tl-item::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold-grad); box-shadow: 0 0 0 5px var(--blush);
}
.tl-item:nth-child(even) .tl-photo { order: 2; }
.tl-photo {
  aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; background: #fff;
  padding: 10px 10px 34px; box-shadow: 0 20px 40px -22px rgba(74, 44, 53, .45);
  transform: rotate(-2deg);
}
.tl-item:nth-child(even) .tl-photo { transform: rotate(2deg); }
.tl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  width: 100%; height: 100%;
  background: linear-gradient(140deg, var(--butter), var(--blush-2));
  display: grid; place-items: center; color: var(--gold-deep); font-size: 2rem;
}
.tl-text h3 { font-family: var(--serif); font-size: 1.9rem; font-weight: 500; line-height: 1.15; margin: .4rem 0 .5rem; }
.tl-text p:not(.eyebrow) { font-family: var(--serif); font-size: 1.15rem; color: var(--muted); font-style: italic; }

/* ---------- envelopes ---------- */
.envelopes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.env {
  position: relative; aspect-ratio: 16 / 10; border: 0; cursor: pointer; border-radius: 6px;
  background: linear-gradient(160deg, #fff7e6, var(--butter));
  box-shadow: 0 16px 30px -18px rgba(154, 116, 40, .55), inset 0 0 0 1px rgba(201, 161, 74, .35);
  overflow: hidden; transition: transform .4s ease;
  font: inherit; color: inherit;
}
.env:hover { transform: translateY(-4px) rotate(-.5deg); }
.env::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 58%;
  background: linear-gradient(180deg, #f9e3b0, #f4d48c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .6s ease;
}
.env.opened::before { transform: rotateX(180deg); opacity: .5; }
.env .heart {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #e7a6b5, var(--rose-deep)); color: #fff4e0; font-size: .9rem;
  box-shadow: 0 4px 10px rgba(168,83,106,.4);
}
.env .label {
  position: absolute; left: 0; right: 0; bottom: .9rem; z-index: 2;
  font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); padding: 0 1rem;
}

/* ---------- coupons ---------- */
.coupons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.coupon {
  position: relative; display: flex; text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit;
  background: var(--paper); border-radius: 10px; overflow: hidden;
  box-shadow: 0 14px 28px -18px rgba(168, 83, 106, .5), inset 0 0 0 1px rgba(201, 161, 74, .35);
  transition: transform .3s ease;
}
.coupon:hover { transform: translateY(-3px); }
.coupon .stub {
  width: 64px; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--blush-2), #f2c1cc);
  border-right: 2px dashed rgba(201, 161, 74, .6);
  font-family: var(--script); font-size: 1.8rem; color: var(--rose-deep);
}
.coupon .body { padding: 1.1rem 1.2rem; }
.coupon h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.coupon p { font-size: .92rem; color: var(--muted); margin-top: .2rem; }
.coupon .stamp {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-14deg) scale(1.6);
  border: 2px solid var(--rose-deep); color: var(--rose-deep); padding: .15rem .6rem; border-radius: 4px;
  font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 500;
  opacity: 0; transition: all .35s cubic-bezier(.3, 1.6, .5, 1); background: rgba(255,250,246,.85);
}
.coupon.redeemed .stamp { opacity: 1; transform: translateY(-50%) rotate(-14deg) scale(1); }

/* ---------- cake ---------- */
.cake { position: relative; width: 260px; height: 270px; margin: 0 auto; }
.candles { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: center; gap: 22px; z-index: 3; }
.candle {
  position: relative; border: 0; background: none; cursor: pointer;
  font-family: var(--serif); font-weight: 600; font-size: 4.6rem; line-height: 1;
  color: transparent; background-image: linear-gradient(180deg, #fff3cc, var(--gold-2) 40%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text;
  padding-top: 46px; filter: drop-shadow(0 2px 2px rgba(154,116,40,.3));
}
.flame {
  position: absolute; left: 50%; top: 2px; width: 18px; height: 34px; transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 75%, #fff 0%, #fff4b0 25%, #ffc84a 55%, rgba(255,140,40,.0) 75%);
  animation: flicker .14s ease-in-out infinite alternate;
  transform-origin: bottom center;
  box-shadow: 0 0 30px 10px rgba(255, 210, 110, .45);
}
.candle.out .flame { animation: blowout .5s ease forwards; }
.smoke {
  position: absolute; left: 50%; top: 10px; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(140, 120, 120, .35); opacity: 0; pointer-events: none;
}
.candle.out .smoke { animation: smoke 1.6s ease-out .2s forwards; }
@keyframes flicker { from { transform: translateX(-50%) scale(1, 1) rotate(-2deg); } to { transform: translateX(-50%) scale(.94, 1.06) rotate(2deg); } }
@keyframes blowout { to { transform: translateX(-50%) scale(0); opacity: 0; } }
@keyframes smoke { 0% { opacity: .7; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-30%, -60px) scale(6); } }
.tier { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 10px 10px 6px 6px; }
.tier.top {
  bottom: 110px; width: 170px; height: 64px;
  background: linear-gradient(180deg, #fff6f0, var(--blush-2));
  box-shadow: inset 0 -6px 0 rgba(168,83,106,.12), inset 0 0 0 1px rgba(201,161,74,.3);
}
.tier.top::before, .tier.bottom::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px; border-radius: 10px 10px 0 0;
  background: radial-gradient(circle at 10px 0, #fff 10px, transparent 11px) 0 0 / 20px 18px repeat-x;
}
.tier.bottom {
  bottom: 30px; width: 240px; height: 84px;
  background: linear-gradient(180deg, var(--butter), var(--yellow));
  box-shadow: inset 0 -8px 0 rgba(154,116,40,.15), inset 0 0 0 1px rgba(201,161,74,.4);
}
.tier.bottom::after {
  content: ""; position: absolute; left: 0; right: 0; top: 46px; height: 3px; background: var(--gold-grad);
}
.plate { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); width: 290px; height: 18px; border-radius: 50%; background: var(--gold-grad); opacity: .85; }

.finale-msg { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; margin-top: 2rem; }
.finale-msg > * { animation: rise 1.2s ease both; }
.finale-msg > :nth-child(2) { animation-delay: .4s; }
.finale-msg > :nth-child(3) { animation-delay: 1.4s; }
.finale-msg > :nth-child(4) { animation-delay: 2s; }
.surprise {
  font-family: var(--serif); font-size: 1.35rem; color: var(--rose-deep);
  padding: .9rem 1.6rem; border-radius: 999px; background: rgba(255,250,246,.8);
  box-shadow: inset 0 0 0 1px rgba(201,161,74,.5);
}
.surprise:empty { display: none; }

/* ---------- listen ---------- */
.listen {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 auto 1.6rem;
  border: 0; cursor: pointer; border-radius: 999px; padding: .55rem 1.1rem .55rem .6rem;
  font-family: var(--sans); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep);
  background: rgba(255,250,246,.9); box-shadow: inset 0 0 0 1px rgba(201,161,74,.55), 0 6px 16px -10px rgba(154,116,40,.6);
  transition: transform .25s ease;
}
.listen:hover { transform: translateY(-1px); }
.listen .ico {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; letter-spacing: 0;
  color: #4a3510; background: var(--gold-grad); padding-left: 2px;
}
.listen.on .ico { padding-left: 0; animation: pulse 1.6s ease-in-out infinite; }
#letter .listen { display: flex; width: max-content; }
.modal-card .listen { margin: 1.6rem auto 0; }
.finale-msg .listen, #intro-after .listen { margin: 0 auto; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1.25rem; background: rgba(74, 44, 53, .35); backdrop-filter: blur(6px); animation: fade .3s ease; }
.modal-card { max-width: 480px; width: 100%; padding: 3rem 2rem 2.5rem; text-align: center; animation: rise .5s ease; }
.modal-text { font-size: 1.45rem; line-height: 1.6; margin-top: 1rem; font-style: italic; }
.close { position: absolute; top: .6rem; right: .9rem; border: 0; background: none; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
@keyframes fade { from { opacity: 0; } }

/* ---------- music ---------- */
.music {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30; width: 46px; height: 46px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 1.2rem; color: #4a3510; background: var(--gold-grad);
  box-shadow: 0 8px 20px -8px rgba(154,116,40,.6);
}
.music.sound { right: auto; left: 1rem; font-size: 1rem; background: rgba(255,250,246,.85); box-shadow: 0 6px 16px -8px rgba(154,116,40,.5), inset 0 0 0 1px rgba(201,161,74,.5); }
.music.playing { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(230,199,122,.2); } }

.foot { text-align: center; padding: 3rem 1rem 4rem; font-family: var(--serif); font-style: italic; color: var(--muted); position: relative; z-index: 1; }

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  .section { padding: 4.5rem 1.1rem; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .timeline::before { left: 12px; }
  .tl-item { grid-template-columns: 1fr; gap: 1.2rem; padding-left: 2.2rem; margin-bottom: 3.2rem; }
  .tl-item::after { left: 12px; top: 1.2rem; }
  .tl-item:nth-child(even) .tl-photo { order: 0; }
  .tl-photo { max-width: 320px; }
  .envelopes { grid-template-columns: repeat(2, 1fr); gap: .9rem; }
  .env { aspect-ratio: 4 / 3.4; }
  .env .label { font-size: 1rem; bottom: .6rem; padding: 0 .5rem; line-height: 1.2; }
  .env .heart { width: 28px; height: 28px; font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
