:root {
  --ink: #110f0d;
  --ink-2: #1b1815;
  --cream: #efe6d8;
  --muted: rgba(239, 230, 216, .7);
  --faint: rgba(239, 230, 216, .45);
  --line: rgba(239, 230, 216, .18);
  --gold: #cbb08a;
  --col: 480px;
  --left: 0px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Pinyon Script", cursive;
  --sans: "Jost", system-ui, sans-serif;
  --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;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Layout: phone column (+ side panel on desktop) ---------- */
.phone { position: relative; width: 100%; max-width: var(--col); margin: 0 auto; min-height: 100svh; }
.side { display: none; }

@media (min-width: 900px) {
  :root { --left: calc(100% - var(--col)); }
  .phone { margin: 0 0 0 var(--left); box-shadow: -30px 0 60px rgba(0, 0, 0, .45); }
  .side {
    display: block; position: fixed; inset: 0 auto 0 0; width: var(--left); overflow: hidden;
  }
  .side__photo {
    position: absolute; inset: 0;
    background: url("/img/cover.jpg") center 35% / cover no-repeat;
    transform: scale(1.04); animation: slowzoom 30s var(--ease) infinite alternate;
  }
  .side::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(17, 15, 13, .15) 0%, rgba(17, 15, 13, .2) 45%, rgba(17, 15, 13, .85) 100%);
  }
  .side__text { position: absolute; left: 64px; bottom: 64px; z-index: 1; }
  .side__names { font-size: clamp(48px, 5vw, 80px); font-weight: 300; line-height: 1.05; margin: 8px 0 12px; letter-spacing: .02em; text-transform: uppercase; }
  .side__date { font-family: var(--sans); letter-spacing: .4em; font-size: 14px; margin: 0; color: var(--muted); }
  .side__tag { font-family: var(--sans); letter-spacing: .2em; font-size: 12px; color: var(--gold); margin: 18px 0 0; }
}
@keyframes slowzoom { to { transform: scale(1.12); } }

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .34em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 10px;
}
.amp { font-family: var(--serif); font-style: italic; text-transform: none; color: var(--gold); font-weight: 300; letter-spacing: 0; }
.title {
  font-family: var(--script); font-weight: 400; font-size: 50px; line-height: 1.1;
  margin: 0 0 28px; color: var(--cream);
}
.lead { color: var(--muted); font-size: 17px; margin: 0 auto 28px; max-width: 360px; }
.rule { width: 48px; height: 1px; background: var(--gold); opacity: .6; margin: 22px auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent; text-decoration: none;
  transition: background .3s, color .3s, border-color .3s, transform .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn--light { background: rgba(239, 230, 216, .12); border-color: rgba(239, 230, 216, .4); color: var(--cream); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--light:hover { background: rgba(239, 230, 216, .22); }
.btn--solid { background: var(--cream); color: var(--ink); width: 100%; }
.btn--solid:hover { background: #fff; }
.btn--solid[disabled] { opacity: .6; cursor: wait; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--cream); padding: 11px 20px; font-size: 11px; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.link { background: none; border: 0; color: var(--gold); font-family: var(--sans); font-size: 13px; letter-spacing: .08em; text-decoration: underline; text-underline-offset: 4px; padding: 6px; }

/* ---------- Background (video) layer ---------- */
.bgv {
  position: fixed; top: 0; bottom: 0; left: var(--left); width: 100%; max-width: var(--col);
  z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, #2a241e 0%, transparent 60%),
    radial-gradient(100% 50% at 50% 100%, #221d18 0%, transparent 70%),
    var(--ink);
}
@media (max-width: 899px) { .bgv { left: 50%; transform: translateX(-50%); } }
.bgv__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.bgv__video.ready { opacity: 1; }
.bgv__shade { position: absolute; inset: 0; background: rgba(17, 15, 13, .62); }

main { position: relative; z-index: 1; }

/* ---------- PAGE 1 · Cover ---------- */
.cover {
  position: fixed; top: 0; bottom: 0; left: var(--left); width: 100%; max-width: var(--col);
  z-index: 50; overflow: hidden; background: var(--ink);
  transition: transform 1.1s var(--ease), opacity 1.1s var(--ease);
}
@media (max-width: 899px) { .cover { left: 50%; transform: translateX(-50%); } .cover.gone { transform: translate(-50%, -100%); } }
@media (min-width: 900px) { .cover.gone { transform: translateY(-100%); } }
.cover.gone { opacity: .4; pointer-events: none; }
.cover__photo {
  position: absolute; inset: 0;
  background: url("/img/cover.jpg") 38% 40% / cover no-repeat;
  animation: slowzoom 24s var(--ease) infinite alternate;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(17, 15, 13, .78) 0%, rgba(17, 15, 13, .25) 34%, rgba(17, 15, 13, .2) 55%, rgba(17, 15, 13, .9) 100%);
}
.cover__inner {
  position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: max(44px, env(safe-area-inset-top)) 28px max(40px, env(safe-area-inset-bottom));
}
.cover__mono { width: 58px; height: auto; margin-bottom: 18px; opacity: .95; }
.cover__names { margin: 0; font-weight: 300; font-size: clamp(28px, 9.4vw, 42px); line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.cover__names .amp { margin: 0 .12em; }
.cover__date { font-family: var(--sans); font-size: 13px; letter-spacing: .42em; margin: 16px 0 0; color: var(--cream); }
.cover__guest { margin-top: auto; margin-bottom: 22px; }
.cover__to { font-family: var(--sans); font-size: 12px; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.cover__name { font-size: 26px; font-weight: 500; margin: 0; line-height: 1.25; }

.cover__inner > * { opacity: 0; transform: translateY(14px); animation: rise 1s var(--ease) forwards; }
.cover__inner > :nth-child(2) { animation-delay: .15s; }
.cover__inner > :nth-child(3) { animation-delay: .3s; }
.cover__inner > :nth-child(4) { animation-delay: .45s; }
.cover__inner > :nth-child(5) { animation-delay: .7s; }
.cover__inner > :nth-child(6) { animation-delay: .85s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- PAGE 2 · Intro ---------- */
.intro { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--ink); }
.intro__photo { position: absolute; inset: 0; background: url("/img/intro.jpg") center 30% / cover no-repeat; }
.intro::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17, 15, 13, 0) 30%, rgba(17, 15, 13, .55) 62%, var(--ink) 100%); }
.intro__inner { position: relative; z-index: 1; width: 100%; text-align: center; padding: 0 30px 72px; }
.intro__names { font-weight: 300; font-size: clamp(26px, 8.6vw, 38px); line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; margin: 0 0 22px; }
.intro__names .amp { margin: 0 .1em; }
.intro__quote { margin: 0 auto 18px; max-width: 330px; font-style: italic; font-size: 20px; line-height: 1.5; color: var(--cream); }
.intro__tag { font-family: var(--sans); font-size: 12px; letter-spacing: .3em; color: var(--gold); margin: 0; }

/* ---------- Generic section ---------- */
.sec { padding: 96px 28px; text-align: center; }
.sec + .sec { border-top: 1px solid rgba(239, 230, 216, .06); }

/* Groom / Bride */
.arch { position: relative; width: 74%; max-width: 300px; margin: 8px auto 30px; }
.arch::before {
  content: ""; position: absolute; inset: -10px; border: 1px solid var(--line);
  border-radius: 999px 999px 6px 6px; pointer-events: none;
}
.arch__img { width: 100%; height: auto; aspect-ratio: 3 / 4.2; object-fit: cover; object-position: center 55%; border-radius: 999px 999px 4px 4px; }
.arch__img--empty { display: grid; place-items: center; background: linear-gradient(180deg, #2a241e, var(--ink-2)); }
.arch__placeholder { width: 34%; opacity: .35; }
.person__name { font-family: var(--script); font-weight: 400; font-size: 44px; line-height: 1.15; margin: 0 0 12px; }
.person__parents { font-style: italic; font-size: 18px; color: var(--muted); margin: 0; line-height: 1.55; }

/* Save the date */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 0 auto 36px; }
.countdown div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 4px 10px; background: rgba(239, 230, 216, .04); }
.countdown span { display: block; font-size: 34px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { display: block; margin-top: 8px; font-family: var(--sans); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.countdown__done { font-style: italic; font-size: 22px; margin: -10px 0 30px; color: var(--gold); }
.event__names { font-size: 30px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.event__names .amp { font-size: 30px; }
.event__day { font-size: 22px; margin: 0; }
.event__time { font-family: var(--sans); font-size: 13px; letter-spacing: .2em; color: var(--muted); margin: 4px 0 0; }
.event__venue { font-size: 22px; font-weight: 500; margin: 0; line-height: 1.3; }
.event__addr { color: var(--muted); font-size: 17px; margin: 4px 0 26px; }

/* Cards + forms */
.card {
  text-align: left; background: rgba(239, 230, 216, .05); border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 22px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-family: var(--sans); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); padding: 0; margin-bottom: 8px; }
.field input[type=text], .field textarea {
  width: 100%; font: 400 18px/1.4 var(--serif); color: var(--cream);
  background: rgba(17, 15, 13, .35); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .25s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices--stack { grid-template-columns: 1fr; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 17px; transition: border-color .25s, background .25s;
}
.choice span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--faint); flex: none; transition: background .25s, border-color .25s, box-shadow .25s; }
.choice input:checked + span { border-color: var(--gold); background: rgba(203, 176, 138, .1); }
.choice input:checked + span::before { background: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 3px var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.form__note { margin: -4px 0 0; font-style: italic; font-size: 15px; line-height: 1.5; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__msg { margin: -6px 0 -6px; min-height: 0; font-family: var(--sans); font-size: 13px; color: #f0b9a8; }
.form__msg:empty { display: none; }
.thanks { text-align: center; }
.thanks__title { font-family: var(--script); font-size: 40px; margin: 0; line-height: 1.2; }
.thanks__text { color: var(--muted); margin: 6px 0 10px; }

/* Gallery */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid button { padding: 0; border: 0; background: var(--ink-2); border-radius: 6px; overflow: hidden; aspect-ratio: 1; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.grid button:hover img { transform: scale(1.05); }
.yt { margin-top: 20px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.yt iframe { width: 100%; height: 100%; border: 0; }

/* Gift */
.bank {
  position: relative; max-width: 340px; margin: 0 auto 16px; padding: 26px 24px 24px; border-radius: 18px; text-align: left;
  background: linear-gradient(135deg, rgba(239, 230, 216, .14), rgba(239, 230, 216, .03));
  border: 1px solid var(--line); overflow: hidden;
}
.bank::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(203, 176, 138, .25); }
.bank__name { font-family: var(--sans); font-weight: 500; letter-spacing: .3em; font-size: 13px; color: var(--gold); margin: 0 0 18px; }
.bank__no { font-size: 28px; letter-spacing: .08em; margin: 0; font-variant-numeric: tabular-nums; }
.bank__holder { color: var(--muted); margin: 2px 0 18px; }

/* Wishes */
.wishes__count { font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 36px 0 14px; }
.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: 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.wishes li { border-left: 1px solid var(--gold); padding: 4px 0 4px 16px; }
.wishes .w__name { font-weight: 500; font-size: 19px; margin: 0; }
.wishes .w__time { font-family: var(--sans); font-size: 11px; color: var(--faint); letter-spacing: .06em; margin: 0 0 4px; }
.wishes .w__msg { margin: 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.wishes li.fresh { animation: rise .8s var(--ease) both; }

/* ---------- PAGE 10 · Closing ---------- */
.closing { position: relative; background: var(--ink); overflow: hidden; }
.closing__photo {
  height: 78svh; min-height: 460px; background: url("/img/closing.jpg") center 35% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 62%, transparent 100%);
}
.closing__inner { position: relative; z-index: 1; text-align: center; padding: 0 30px 72px; margin-top: -60px; }
.closing__text { font-size: 17px; color: var(--muted); max-width: 360px; margin: 0 auto 26px; }
.closing__see { font-family: var(--script); font-size: 34px; text-wrap: balance; margin: 0; line-height: 1.2; }
.closing__names { font-weight: 300; font-size: 30px; letter-spacing: .1em; text-transform: uppercase; margin: 6px 0 22px; }
.closing__mono { width: 52px; height: auto; margin: 0 auto; opacity: .9; }
.foot { position: relative; z-index: 1; text-align: center; padding: 22px 0 max(26px, env(safe-area-inset-bottom)); background: var(--ink); font-family: var(--sans); font-size: 11px; letter-spacing: .25em; color: var(--faint); }

/* ---------- Music button ---------- */
.music {
  position: fixed; z-index: 40; bottom: max(18px, env(safe-area-inset-bottom)); left: calc(var(--left) + 18px);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(17, 15, 13, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 0; margin: 0; -webkit-appearance: none; appearance: none; transform-origin: 50% 50%;
}
@media (max-width: 899px) { .music { left: max(18px, calc(50% - var(--col) / 2 + 18px)); } }
.music svg { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: block; fill: none; stroke: var(--cream); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music .music__off { display: none; }
.music.paused .music__on { display: none; }
.music.paused .music__off { display: block; }
.music:not(.paused) { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8, 7, 6, .96); display: grid; place-items: center; }
.lb__img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 4px; 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-family: var(--sans); font-size: 12px; 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(--ink); font-family: var(--sans); font-size: 13px; padding: 10px 18px; border-radius: 999px;
  transition: opacity .3s, transform .3s var(--ease); white-space: nowrap;
}
@media (min-width: 900px) { .toast { left: calc(var(--left) + var(--col) / 2); } }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .cover__inner > * { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
