/* ==========================================================================
   Theme tokens (palette taken from the reference design)
   ========================================================================== */
:root {
  --dark: #333333;
  --text: #333333;
  --muted: #6c6c6c;
  --white: #ffffff;
  --cream: #f6f3ef;
  --beige: #dfd9ce;
  --line: #333333;
  --error: #b3261e;
  --success: #2e6b3a;

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-name: "Playfair Display", Georgia, serif;

  --column: 430px;   /* width of the invitation column on desktop */
  --gutter: 28px;
  --topbar-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.3px;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100vh; height: 100dvh; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

/* ==========================================================================
   Desktop split layout: fixed slideshow left, invitation column right
   ========================================================================== */
.side-panel { display: none; }

.column {
  position: relative;
  width: 100%;
  max-width: var(--column);
  margin-left: auto;
  margin-right: auto;
  background: var(--white);
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .column { margin-right: 0; box-shadow: -4px 0 18px rgba(0, 0, 0, 0.25); }
  .side-panel {
    display: block;
    position: fixed;
    inset: 0 var(--column) 0 0;
    overflow: hidden;
    background: #222;
  }
  .side-panel img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.6s ease, transform 8s linear;
  }
  .side-panel img.is-active { opacity: 1; transform: scale(1); }
  .side-panel::after {
    content: ""; position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.35);
  }
}

/* ==========================================================================
   Cover
   ========================================================================== */
.cover {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  text-align: center;
  overflow: hidden;
  transition: transform 1.1s cubic-bezier(.7, 0, .2, 1), opacity 1.1s ease;
}
.cover.is-open { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.cover__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  animation: kenburns 18s ease-in-out infinite alternate;
}
.cover__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.cover__content { position: relative; padding: 0 var(--gutter); animation: fadeUp 1.2s ease both .2s; }
.eyebrow {
  margin: 0;
  font-size: 12px; font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.cover__names {
  margin: 10px 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.cover__guest { margin-top: 26px; }
.cover__guest-label { margin: 0; font-size: 12px; letter-spacing: 1px; opacity: .85; }
.cover__guest-name {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .5px;
  word-break: break-word;
}
.cover__btn { margin-top: 28px; }

/* ==========================================================================
   Top bar + hero
   ========================================================================== */
.topbar {
  position: fixed; top: 0; z-index: 20;
  width: 100%; max-width: var(--column);
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: center;
  background: var(--dark);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.topbar span { margin-right: .4em; }

.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.hero__img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 20s ease-in-out infinite alternate; }
.hero__down {
  position: absolute; left: 50%; bottom: 72px;
  width: 44px; height: 44px; margin-left: -22px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  color: var(--white);
  animation: bounce 2s ease-in-out infinite;
}

/* ==========================================================================
   Sections + typography
   ========================================================================== */
.sec { padding: 80px var(--gutter); scroll-margin-top: var(--topbar-h); }
.sec--white { background: var(--white); }
.sec--cream { background: var(--cream); }
.sec--beige { background: var(--beige); }

.title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}
.title--center { text-align: center; }
.lead { margin: 0 0 40px; text-align: center; font-size: 13.5px; }

.photo { width: 100%; object-fit: cover; background: var(--beige); }
.photo--4x5 { aspect-ratio: 4 / 5; }
.photo--2x3 { aspect-ratio: 2 / 3; margin-bottom: 24px; }
.banner { width: 100%; aspect-ratio: 1.9 / 1; object-fit: cover; }

/* Couple */
.person { text-align: center; margin-bottom: 56px; }
.person:last-child { margin-bottom: 0; }
.person__photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; margin-bottom: 22px; }
.person__name {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: .5px;
}
.person__parents { margin: 0 0 22px; white-space: pre-line; font-size: 13.5px; }

/* Story */
.story { margin-top: 26px; }
.story p { margin: 0 0 14px; }

/* Countdown */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 20px 0 50px; }
.countdown__box {
  border: 1px solid var(--muted);
  padding: 10px 0 8px;
  text-align: center;
  line-height: 1.15;
}
.countdown__num { display: block; font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; }
.countdown__label { font-size: 11.5px; font-weight: 400; }
.quote__source {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
}
.quote__text { margin: 0 0 34px; }

/* Events */
.event { margin-bottom: 64px; }
.event:last-child { margin-bottom: 0; }
.event__title { margin-bottom: 4px; }
.event__subtitle { margin: 0 0 14px; font-family: var(--font-display); font-size: 16px; font-style: italic; }
.event__date, .event__time { margin: 14px 0 0; font-weight: 400; letter-spacing: .6px; }
.event__time { margin-bottom: 28px; }
.event__venue { margin: 0; font-weight: 400; white-space: pre-line; }
.event__address { margin: 0 0 22px; color: var(--muted); }
.event__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Gallery */
.gallery { display: grid; gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--beige); }

/* Cards (gift / live stream) */
.card { padding: 46px 22px; text-align: center; }
.card--cream { background: var(--cream); }
.card--white { background: var(--white); }
.card__title { margin: 0 0 18px; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.card__text { margin: 0 0 24px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px;
  padding: 8px 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px; font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .25s ease, opacity .25s ease;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(.98); }
.btn--sm { min-height: 36px; padding: 6px 18px; font-size: 13px; }
.btn--light { background: var(--white); border-color: var(--white); color: var(--dark); }
.btn--dark { background: var(--dark); border-color: var(--dark); color: var(--white); min-width: 86px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: progress; transform: none; }
.icon { width: 15px; height: 15px; flex: none; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form { position: relative; display: grid; gap: 14px; }
/* Honeypot: off-screen (not display:none, which some bots skip) */
.hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.field { display: grid; gap: 4px; }
.field__label { font-size: 13.5px; font-weight: 400; }
.field__error { min-height: 0; color: var(--error); font-size: 12px; }
.field__error:empty { display: none; }
.field__counter { justify-self: end; font-size: 11.5px; color: var(--muted); }
.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--white);
  font-size: 16px; /* >=16px stops iOS zoom-on-focus */
  outline: none;
  transition: border-color .2s;
}
.input:focus { border-color: var(--line); }
.input.is-invalid { border-color: var(--error); }
.input--area { resize: vertical; min-height: 74px; }

#rsvp-groups { display: grid; gap: 16px; }
.choice-group { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.choice-group legend { padding: 0; margin-bottom: 6px; font-size: 13.5px; font-weight: 400; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: block;
  padding: 9px 8px;
  background: var(--white);
  border: 1px solid transparent;
  text-align: center;
  font-size: 13px;
  transition: background .2s, color .2s;
}
.choice input:checked + span { background: var(--dark); color: var(--white); }
.choice input:focus-visible + span { border-color: var(--line); }
.choice-group.is-invalid .choice span { border-color: var(--error); }

.stepper { display: grid; grid-template-columns: 44px 1fr 44px; background: var(--white); }
.stepper__btn { border: 0; background: none; cursor: pointer; font-size: 12px; min-height: 40px; }
.stepper__input {
  border: 0; background: none; text-align: center; font-size: 16px; min-width: 0;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus { outline: 1px solid var(--line); }
.is-disabled { opacity: .45; pointer-events: none; }

.form__status { margin: 0; font-size: 13px; text-align: center; }
.form__status:empty { display: none; }
.form__status.is-success { color: var(--success); }
.form__status.is-error { color: var(--error); }

/* ==========================================================================
   Comments
   ========================================================================== */
.comments { display: grid; gap: 10px; margin-top: 34px; }
.comment { background: var(--white); padding: 12px 12px 14px; animation: fadeUp .5s ease both; }
.comment__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comment__name { margin: 0; font-family: var(--font-name); font-weight: 500; font-size: 17px; letter-spacing: .4px; word-break: break-word; }
.comment__time { flex: none; font-size: 11px; color: var(--muted); }
.comment__msg { margin: 4px 0 0; white-space: pre-line; word-break: break-word; }
.comments__empty, .comments__loading { text-align: center; color: var(--muted); font-size: 13px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; font-size: 13.5px; }
.pager__btn { border: 0; background: none; cursor: pointer; padding: 6px 2px; }
.pager__btn[disabled] { opacity: .35; cursor: default; }
.pager__page { text-decoration: underline; }

/* Closing + footer */
.sign__label { margin: 0; text-align: center; font-weight: 600; font-size: 14px; }
.sign__names {
  margin: 6px 0 0; text-align: center;
  font-family: var(--font-display); font-size: 26px; letter-spacing: 1px; text-transform: uppercase;
}
.footer { padding: 34px var(--gutter) 90px; background: var(--dark); color: var(--white); text-align: center; font-size: 13px; }
.footer p { margin: 0; }

/* ==========================================================================
   Music button, modal, toast
   ========================================================================== */
.music-btn {
  position: fixed; right: 16px; bottom: 90px; z-index: 40;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--white);
  color: var(--dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  cursor: pointer;
}
.music-btn svg { width: 18px; height: 18px; fill: currentColor; }
.music-btn__play { display: none; }
.music-btn.is-paused .music-btn__play { display: block; }
.music-btn.is-paused .music-btn__pause { display: none; }

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fadeIn .3s ease both; }
.modal__panel {
  position: relative;
  width: 100%; max-width: var(--column);
  max-height: 88vh; overflow-y: auto;
  padding: 44px var(--gutter) 40px;
  background: var(--cream);
  animation: slideUp .4s cubic-bezier(.2, .8, .2, 1) both;
}
@media (min-width: 768px) {
  .modal { justify-content: flex-end; }
}
.modal__close {
  position: absolute; top: 10px; right: 14px;
  width: 36px; height: 36px;
  border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer;
}
.bank-list { display: grid; gap: 18px; }
.bank-card {
  position: relative;
  aspect-ratio: 1.586 / 1; /* ATM card ratio */
  padding: 18px 20px;
  display: flex; flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #ece7df 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.bank-card__bank { align-self: flex-end; font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: 1px; }
.bank-card__chip {
  width: 42px; height: 32px; margin-top: 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e9d18b, #c9a94e);
}
.bank-card__number { margin-top: auto; font-size: 19px; font-weight: 500; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.bank-card__holder { margin: 2px 0 10px; font-size: 13px; }
.bank-card .btn { align-self: flex-start; background: var(--white); }

.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 70;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  background: var(--dark); color: var(--white);
  font-size: 13px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) {
  .toast { left: auto; right: calc(var(--column) / 2); transform: translate(50%, 20px); }
  .toast.is-visible { transform: translate(50%, 0); }
}

/* ==========================================================================
   Animations
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

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

/* Gift confirmation form inside the gift modal */
.gift-confirm { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--beige); text-align: left; }
.gift-confirm__title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 400; text-align: center; }
.gift-confirm__text { margin: 0; font-size: 13.5px; text-align: center; color: var(--muted); }
.choices--stack { grid-template-columns: 1fr; }
