:root {
  --black: #0e0c0b;
  --ink-2: #171412;
  --cream: #f4eee6;
  --muted: rgba(244, 238, 230, .72);
  --faint: rgba(244, 238, 230, .45);
  --line: rgba(244, 238, 230, .22);
  --warm: #e8d9c2;
  --col: 480px;
  --display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Mrs Saint Delafield", cursive;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100svh; background: var(--black); color: var(--cream);
  font-family: var(--serif); font-size: 18px; line-height: 1.6; font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
body.locked main { visibility: hidden; }
img { display: block; max-width: 100%; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Fixed background ---------- */
.bg {
  position: fixed; top: 0; bottom: 0; left: 50%; width: 100%; max-width: var(--col); transform: translateX(-50%);
  z-index: 0; overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(232, 217, 194, .16), transparent 70%),
    radial-gradient(80% 50% at 50% 100%, rgba(120, 30, 24, .18), transparent 70%),
    var(--black);
}
.bg__video, .bg__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.bg__video.ready, .bg__img.ready { opacity: 1; }
.bg__shade { position: absolute; inset: 0; background: rgba(8, 7, 6, .55); }
main { position: relative; z-index: 1; width: 100%; max-width: var(--col); margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .02em;
  padding: 10px 22px; border: 1px solid var(--cream); border-radius: 2px; background: transparent; color: var(--cream);
  text-decoration: none; transition: background .25s, color .25s, transform .2s;
}
.btn:hover { background: var(--cream); color: var(--black); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn--sm { font-size: 15px; padding: 8px 18px; }
.link { background: none; border: 0; color: var(--warm); font-size: 16px; text-decoration: underline; text-underline-offset: 4px; padding: 6px; }

/* ---------- Type ---------- */
.kicker { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 0 0 4px; color: var(--cream); }
.display { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 11vw, 50px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -.01em; }
.title { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 30px; }
.title em { font-family: var(--script); font-style: normal; text-transform: none; font-size: 1.75em; letter-spacing: 0; margin-right: .08em; vertical-align: -.08em; }
.lead { font-size: 18px; color: var(--muted); max-width: 360px; margin: 0 auto 26px; }
.hand { font-family: var(--script); font-size: 34px; line-height: 1.35; margin: 0; transform: rotate(-4deg); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.mono { width: 92px; height: auto; margin: 0 auto; }
.mono--sm { width: 72px; }

/* ---------- PAGE 1 · Cover (spotlight) ---------- */
.cover {
  position: fixed; top: 0; bottom: 0; left: 50%; width: 100%; max-width: var(--col); transform: translateX(-50%);
  z-index: 50; overflow: hidden; background: #050404;
  transition: transform 1.1s var(--ease), opacity 1.1s var(--ease);
}
.cover.gone { transform: translate(-50%, -100%); opacity: .3; pointer-events: none; }
.cover__photo { position: absolute; inset: 0; background-position: center 40%; background-size: cover; opacity: .9; }
.spot { position: absolute; inset: 0; pointer-events: none; }
.spot::before {
  content: ""; position: absolute; left: 50%; top: 21%; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 228, .95), rgba(255, 232, 196, .35) 45%, transparent 70%);
  filter: blur(2px); z-index: 2;
}
.spot__beam {
  position: absolute; left: 50%; top: 22%; width: 120%; height: 78%; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 240, 214, .42) 0%, rgba(255, 236, 205, .16) 45%, rgba(255, 236, 205, .03) 80%, transparent 100%);
  clip-path: polygon(48.6% 0, 51.4% 0, 78% 100%, 22% 100%);
  filter: blur(10px); animation: flicker 7s ease-in-out infinite;
}
.spot::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 80%; height: 22%; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 60%, rgba(255, 236, 205, .14), transparent 70%);
}
@keyframes flicker { 0%, 100% { opacity: 1; } 46% { opacity: .9; } 50% { opacity: .97; } 53% { opacity: .86; } }
.cover__inner {
  position: relative; z-index: 3; height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(56px, env(safe-area-inset-top)) 28px max(64px, env(safe-area-inset-bottom));
}
.cover__inner .mono { width: 96px; filter: drop-shadow(0 0 18px rgba(255, 240, 214, .25)); }
.cover__bottom { margin-top: auto; }
.cover__names { font-family: var(--display); font-size: 34px; line-height: 1.15; margin: 0 0 16px; }
.cover__names span { font-size: .8em; margin: 0 .2em; }
.cover__to { font-size: 16px; margin: 0; color: var(--muted); }
.cover__guest { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 24px; line-height: 1.3; }
.cover__bottom .btn { margin-top: 6px; }
.cover__inner > *, .cover__bottom > * { opacity: 0; transform: translateY(12px); animation: rise 1s var(--ease) forwards; }
.cover__bottom > :nth-child(1) { animation-delay: .5s; }
.cover__bottom > :nth-child(2) { animation-delay: .7s; }
.cover__bottom > :nth-child(3) { animation-delay: .9s; }
.cover__bottom { opacity: 1; transform: none; animation: none; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; text-align: center; padding: 40px 26px 90px; }
.hero__date { font-size: 19px; font-weight: 500; margin: 0; }
.hero .hand { max-width: 360px; margin: 0 auto; }

/* ---------- Generic sections ---------- */
.sec { position: relative; padding: 80px 26px; text-align: center; }
.panel { margin: 0 14px; background: rgba(23, 20, 18, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.panel + .sec, .sec + .panel { margin-top: 0; }

/* Journey */
.story { text-align: left; margin: 0 0 52px; padding-left: 4px; }
.story:last-child { margin-bottom: 0; }
.story h3 { font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.story p { margin: 0; color: var(--muted); }

/* Photo frames (placeholders until real photos arrive) */
.photo {
  position: relative; margin: 0 auto 34px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, #2a2421, #120f0e) center / cover no-repeat;
  border: 1px solid var(--line);
}
.photo span { font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
.photo.has-img { border: 0; }
.photo.has-img span { display: none; }
.photo--wide { width: 100%; aspect-ratio: 4 / 3; }
.photo--tall { width: 100%; aspect-ratio: 3 / 4; }
.intro .lead { margin-bottom: 40px; }

/* Groom / bride */
.person { padding-top: 40px; }
.person .photo { margin-bottom: 0; }
.person__the { font-family: var(--script); font-size: 76px; line-height: 1; margin: -46px 0 0 6px; text-align: left; position: relative; text-shadow: 0 4px 20px rgba(0, 0, 0, .7); }
.person .kicker { font-family: var(--display); font-size: 30px; letter-spacing: .1em; text-transform: uppercase; margin: -6px 0 18px; }
.person__name { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.25; margin: 0 0 10px; }
.person__of { font-size: 16px; color: var(--muted); margin: 0; }
.person__parents { font-size: 18px; font-weight: 500; margin: 0; }

/* Countdown */
.countdown-sec { padding: 90px 26px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 360px; margin: 0 auto; }
.countdown div { padding: 6px 0; }
.countdown div + div { border-left: 1px solid var(--line); }
.countdown span { display: block; font-family: var(--display); font-size: 40px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.countdown small { display: block; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.countdown__done { font-family: var(--script); font-size: 44px; margin: 0; }

/* Event */
.event__day { font-family: var(--display); font-size: 22px; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.event__date { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0; }
.event__date b { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: 1; }
.event__rule { width: 1px; height: 64px; background: var(--cream); opacity: .7; }
.event__month { font-family: var(--display); font-size: 20px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 18px; }
.event__time { font-size: 19px; font-weight: 500; margin: 0 0 22px; }
.event__at { font-size: 16px; color: var(--muted); margin: 0; }
.event__venue { font-family: var(--display); font-size: 22px; margin: 0; line-height: 1.3; }
.event__addr { color: var(--muted); margin: 4px 0 22px; }

/* Dress code */
.swatches { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.swatches span { width: 46px; height: 46px; border-radius: 50%; background: var(--c); border: 1px solid var(--line); }
.swatches__names { font-size: 16px; color: var(--muted); margin: 0; }

/* Gift */
.bank { max-width: 320px; margin: 0 auto; padding: 26px 22px; border: 1px solid var(--line); background: rgba(14, 12, 11, .5); }
.bank__name { font-family: var(--display); letter-spacing: .2em; font-size: 16px; margin: 0 0 10px; }
.bank__no { font-family: var(--display); font-size: 28px; letter-spacing: .06em; margin: 0; }
.bank__holder { color: var(--muted); margin: 2px 0 18px; }

/* RSVP form */
.form { display: grid; gap: 18px; text-align: left; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span { font-weight: 600; font-size: 17px; }
.field i { color: #e0645a; font-style: normal; }
.field input[type=text], .field textarea, .field select {
  width: 100%; font: 500 18px/1.4 var(--serif); color: var(--cream);
  background: rgba(14, 12, 11, .45); border: 1px solid rgba(244, 238, 230, .7); border-radius: 6px; padding: 11px 14px;
  transition: border-color .25s; resize: vertical;
}
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cream) 50%), linear-gradient(135deg, var(--cream) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { color: #111; }
.field ::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--warm); }
.stepper { display: inline-flex; align-items: center; border: 1px solid rgba(244, 238, 230, .7); border-radius: 6px; width: max-content; }
.stepper button { width: 44px; height: 44px; background: none; border: 0; font-size: 22px; }
.stepper output { min-width: 44px; text-align: center; font-size: 20px; font-weight: 600; }
.form .btn { justify-self: center; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__msg { margin: -4px 0; font-size: 15px; font-weight: 500; color: #f0a99c; }
.form__msg:empty { display: none; }
.thanks { padding: 24px 18px; border: 1px solid var(--line); }
.thanks__title { font-family: var(--script); font-size: 54px; line-height: 1.1; margin: 0; }
.thanks__text { color: var(--muted); margin: 6px 0 10px; }

/* Wishes */
.wishes__count { font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 40px 0 12px; }
.wishes__count:empty { display: none; }
.wishes { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 520px; overflow-y: auto; text-align: left; display: grid; gap: 10px; scrollbar-width: thin; }
.wishes li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 8px; background: rgba(244, 238, 230, .1); border: 1px solid rgba(244, 238, 230, .08); }
.w__av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--black); font-family: var(--display); font-size: 14px; }
.w__name { font-weight: 600; font-size: 18px; margin: 0; color: var(--warm); }
.w__time { font-size: 13px; color: var(--faint); margin: 0 0 2px; }
.w__msg { margin: 0; font-style: italic; color: var(--cream); white-space: pre-line; overflow-wrap: anywhere; }
.wishes li.fresh { animation: rise .8s var(--ease) both; }

/* Gallery */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid > * { padding: 0; border: 0; overflow: hidden; aspect-ratio: 3 / 4; background: linear-gradient(160deg, #2a2421, #120f0e); }
.grid > :nth-child(3n + 1) { grid-column: span 2; aspect-ratio: 16 / 10; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.grid button:hover img { transform: scale(1.04); }
.grid .ph { display: grid; place-items: center; color: var(--faint); font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; border: 1px solid var(--line); }

/* Closing */
.closing { padding-bottom: max(110px, calc(env(safe-area-inset-bottom) + 90px)); }
.closing .mono { margin-top: 10px; }
.closing__names { font-family: var(--display); font-size: 26px; margin: 14px 0 0; }

/* ---------- Music ---------- */
.music {
  position: fixed; z-index: 40; bottom: max(18px, env(safe-area-inset-bottom)); left: max(18px, calc(50% - var(--col) / 2 + 18px));
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); padding: 0;
  background: rgba(14, 12, 11, .7); -webkit-appearance: none; appearance: none;
}
.music svg { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.music .music__off { display: none; }
.music.paused .music__on { display: none; }
.music.paused .music__off { display: block; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(5, 4, 4, .96); display: grid; place-items: center; }
.lb__img { max-width: 94vw; max-height: 84vh; object-fit: contain; user-select: none; }
.lb__close, .lb__nav { position: absolute; background: none; border: 0; color: var(--cream); line-height: 1; padding: 12px; }
.lb__close { top: max(10px, env(safe-area-inset-top)); right: 12px; font-size: 38px; }
.lb__nav { top: 50%; transform: translateY(-50%); font-size: 52px; opacity: .8; }
.lb__prev { left: 4px; }
.lb__next { right: 4px; }
.lb__count { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; font-size: 13px; letter-spacing: .2em; color: var(--faint); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--cream); color: var(--black); font-size: 15px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
  transition: opacity .3s, transform .3s var(--ease); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hand.reveal { transform: translateY(22px) rotate(-4deg); }
.js .hand.reveal.in { transform: rotate(-4deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .cover__inner > *, .cover__bottom > * { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
