:root {
  --navy: #0a1730;
  --navy-2: #13294f;
  --ink: #1a2f58;
  --gold: #d9bc7e;
  --gold-deep: #a8874a;
  --ivory: #f7f3ea;
  --muted: #5d6a82;
  --script: 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* velvet: vertical folds over a dark navy body, lit from above */
  --velvet:
    radial-gradient(130% 55% at 50% -5%, rgba(150, 185, 245, .28), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .55) 0, rgba(0, 0, 0, .12) 2.6%, rgba(150, 185, 245, .2) 4.4%, rgba(0, 0, 0, .12) 6.4%, rgba(0, 0, 0, .55) 9.5%),
    linear-gradient(#18325f, #0a1834 80%);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--navy);
  color: var(--ink);
  font: 400 1.15rem/1.6 var(--serif);
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }

/* ===== Cover ===== */
.gate { position: fixed; inset: 0; z-index: 50; overflow: hidden; }
.curtain {
  position: absolute; top: 0; bottom: 0; width: 51%;
  background: var(--velvet);
  transition: transform 2.4s cubic-bezier(.7, 0, .25, 1);
}
.curtain-l { left: 0; box-shadow: inset -30px 0 40px rgba(0, 0, 0, .55); }
.curtain-r { right: 0; box-shadow: inset 30px 0 40px rgba(0, 0, 0, .55); }
.open .curtain-l { transform: translateX(-102%); }
.open .curtain-r { transform: translateX(102%); }

.valance {
  position: absolute; inset: 0 0 auto; height: 58px; z-index: 3;
  background: linear-gradient(#1d3a6c, #0c1d3e);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  transition: transform 1.6s var(--ease) .5s;
}
.open .valance { transform: translateY(-110%); }

.glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(60% 38% at 50% 0%, rgba(255, 224, 160, .32), transparent 70%);
  transition: opacity 1.2s;
}
.open .glow { opacity: 0; }

.cover {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 24px 40px; text-align: center; color: var(--ivory);
  transition: opacity .7s, transform .9s var(--ease);
}
.open .cover { opacity: 0; transform: scale(.94); pointer-events: none; }

.monogram {
  width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-items: center; grid-auto-flow: column; gap: 2px;
  border: 1px solid var(--gold);
  outline: 1px solid rgba(217, 188, 126, .45); outline-offset: 6px;
  background: radial-gradient(circle, rgba(255, 230, 180, .12), rgba(10, 23, 48, .35) 70%);
  font: 3.6rem/1 var(--script); color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 215, 150, .35);
}
.monogram i { font-style: normal; font-size: .55em; color: var(--ivory); padding: 0 2px; }
.cover-names { font: 2.6rem/1.1 var(--script); margin-top: 18px; }
.cover-date { letter-spacing: .32em; font-size: .95rem; color: var(--gold); }
.cover-to { max-width: 300px; font-style: italic; opacity: .9; }
.cover-to strong { display: block; font-style: normal; font-weight: 600; font-size: 1.35rem; }

.btn {
  display: inline-block; margin-top: 10px; padding: 13px 30px;
  border: 1px solid var(--gold); border-radius: 999px;
  background: rgba(10, 23, 48, .45); backdrop-filter: blur(4px);
  color: var(--ivory); font: 500 1rem var(--serif); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 0 24px rgba(217, 188, 126, .25);
  animation: breathe 2.8s ease-in-out infinite;
}
.btn.dark { background: var(--ink); animation: none; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@keyframes breathe { 50% { box-shadow: 0 0 36px rgba(217, 188, 126, .5); } }

/* ===== Hanging snowflakes ===== */
.hangers { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hang {
  position: absolute; top: 0; width: var(--size); height: var(--len);
  margin-left: calc(var(--size) / -2);
  transform-origin: 50% 0;
  animation: sway 6s ease-in-out infinite alternate;
}
.hang::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: calc(var(--size) - 4px); width: 1px;
  background: linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .5));
}
.hang svg {
  position: absolute; left: 0; bottom: 0; width: var(--size); height: var(--size);
  color: #f4f8ff; filter: drop-shadow(0 0 6px rgba(200, 225, 255, .8));
}
.hero .hang { height: calc(var(--len) * .55); }
@keyframes sway { from { rotate: -4deg; } to { rotate: 4deg; } }

/* ===== Falling snow ===== */
.snow { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.snow span {
  position: absolute; top: -5vh; color: #fff; line-height: 1;
  text-shadow: 0 0 6px rgba(200, 225, 255, .9);
  animation: fall linear infinite;
}
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(200deg); } }

/* ===== Hero ===== */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--navy); }
.hero-img {
  position: absolute; inset: 0 0 auto; width: 100%; height: 74%;
  object-fit: cover; object-position: 50% 40%; transform-origin: 50% 30%;
  transform: scale(1.12); transition: transform 3.2s var(--ease);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(rgba(10, 23, 48, .5), transparent 20%, transparent 50%, rgba(10, 23, 48, .8) 64%, var(--navy) 74%);
}
.revealing .hero-img, body:not(.locked) .hero-img { transform: none; }
.hero-text {
  position: absolute; inset: auto 0 7svh; z-index: 3; text-align: center; color: var(--ivory);
  opacity: 0; transform: translateY(24px); transition: opacity 1.4s 1.2s, transform 1.6s var(--ease) 1.2s;
}
.revealing .hero-text, body:not(.locked) .hero-text { opacity: 1; transform: none; }
.kicker { letter-spacing: .34em; text-transform: uppercase; font-size: .8rem; color: var(--gold); }
.names { font: 400 clamp(3.4rem, 16vw, 6rem)/.95 var(--script); text-shadow: 0 2px 20px rgba(0, 0, 0, .45); }
.names span { display: block; }
.names .amp { font-size: .5em; color: var(--gold); line-height: 1.2; }
.hero-date { margin-top: 10px; font-style: italic; font-size: 1.15rem; }
.scroll-line {
  position: absolute; left: 50%; bottom: 0; z-index: 3; width: 1px; height: 6svh;
  background: linear-gradient(transparent, var(--gold));
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ===== Paper (ivory card with a velvet edge) ===== */
.paper {
  background:
    linear-gradient(90deg, #0d1f42 0 10px, rgba(0, 0, 0, .12) 10px, transparent 22px),
    radial-gradient(120% 50% at 50% 0, #fffdf8, transparent 70%),
    var(--ivory);
  padding: 8px 20px 40px 30px;
}
.paper > section, .paper > figure { max-width: 520px; margin-inline: auto; }
section { text-align: center; }
.greeting, .date, .venue { padding: 64px 0; }
.title { font: 400 2.8rem/1.1 var(--script); color: var(--ink); margin-bottom: 26px; }

.flake-mark { width: 38px; height: 38px; color: var(--gold-deep); margin: 0 auto 18px; display: block; }
.verse { font-size: 1.4rem; font-style: italic; line-height: 1.55; max-width: 440px; margin: 0 auto; }
.verse .w { opacity: .15; transition: opacity .6s calc(var(--i) * 70ms); }
.in .verse .w, .verse.in { opacity: 1; }

/* Framed photo with photo corners */
.frame {
  position: relative; max-width: 340px !important; padding: 14px 14px 52px;
  background:
    linear-gradient(135deg, #e7e1d2 0 50%, transparent 50%) 0 0 / 30px 30px no-repeat,
    linear-gradient(225deg, #e7e1d2 0 50%, transparent 50%) 100% 0 / 30px 30px no-repeat,
    linear-gradient(315deg, #e7e1d2 0 50%, transparent 50%) 100% 100% / 30px 30px no-repeat,
    linear-gradient(45deg, #e7e1d2 0 50%, transparent 50%) 0 100% / 30px 30px no-repeat,
    #fff;
  box-shadow: 0 18px 40px rgba(16, 32, 66, .22), 0 2px 6px rgba(16, 32, 66, .12);
  opacity: 0; transform: translateY(30px) rotate(var(--r)); transition: opacity 1s, transform 1.2s var(--ease);
}
.tilt-l { --r: -2deg; }
.tilt-r { --r: 2deg; }
.frame.in { opacity: 1; transform: rotate(var(--r)); }
.frame img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.frame figcaption {
  position: absolute; inset: auto 0 12px; text-align: center;
  font: 1.6rem var(--script); color: var(--ink);
}

/* Calendar */
.cal { max-width: 320px; margin: 0 auto 36px; }
.cal-head { text-transform: capitalize; letter-spacing: .24em; font-weight: 600; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 0; font-size: 1.1rem; }
.cal-grid .wd { font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
.the-day { position: relative; font-weight: 700; color: var(--ink); }
.the-day svg { position: absolute; inset: -7px -4px; width: calc(100% + 8px); height: calc(100% + 14px); overflow: visible; }
.the-day path { fill: none; stroke: var(--gold-deep); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.date.in .the-day path { stroke-dashoffset: 0; }

.timer { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 360px; margin: 0 auto; }
.timer div { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.timer div + div { border-left: 1px solid rgba(168, 135, 74, .35); }
.timer b { font-size: 2.3rem; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.timer span { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* Venue */
.v-day { font-style: italic; font-size: 1.25rem; margin-bottom: 18px; }
.event {
  border: 1px solid rgba(168, 135, 74, .5); outline: 1px solid rgba(168, 135, 74, .25); outline-offset: 4px;
  padding: 26px 18px; margin: 0 6px 28px; background: rgba(255, 255, 255, .6);
}
.e-title { font: 2rem/1.2 var(--script); }
.e-time { font-size: 2rem; font-weight: 600; letter-spacing: .06em; color: var(--gold-deep); }
.e-place { font-size: 1.3rem; font-weight: 600; }
.e-addr { font-style: italic; color: var(--muted); }
.map { border-radius: 4px; overflow: hidden; box-shadow: 0 8px 24px rgba(16, 32, 66, .15); margin-bottom: 24px; }
.map iframe { display: block; width: 100%; height: 260px; border: 0; filter: saturate(.75); }

.date, .venue, .greeting { opacity: 0; transform: translateY(24px); transition: opacity 1s, transform 1.2s var(--ease); }
.date.in, .venue.in, .greeting.in { opacity: 1; transform: none; }

/* ===== Closing ===== */
.closing {
  position: relative; min-height: 80svh; padding: 34svh 24px 80px; color: var(--ivory);
  background: radial-gradient(70% 45% at 50% 0, rgba(255, 224, 160, .16), transparent 70%), var(--velvet);
}
.closing > p { position: relative; z-index: 3; }
.thanks { font: 4rem/1 var(--script); color: var(--gold); text-shadow: 0 0 22px rgba(255, 215, 150, .35); }
.sig { font: 2.4rem/1.3 var(--script); margin-top: 6px; }
.closing-note { max-width: 420px; margin: 22px auto 0; font-style: italic; font-size: 1.25rem; opacity: .92; }
footer { background: #071025; color: rgba(217, 188, 126, .75); text-align: center; padding: 22px; letter-spacing: .24em; font-size: .85rem; }

/* ===== Music ===== */
.music {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold); background: rgba(10, 23, 48, .72); backdrop-filter: blur(6px); cursor: pointer;
}
.music[hidden] { display: none; }
.music svg { width: 22px; height: 22px; fill: none; stroke: var(--ivory); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music.playing { animation: breathe 2.8s ease-in-out infinite; }
.music:not(.playing) svg { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .snow { display: none; }
}
