*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100dvh; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Cover Lock */
.cover-lock {
  position: fixed; inset: 0; z-index: 90;
  height: 100dvh; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  background-color: #161412;
  background-size: cover; background-position: center;
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.cover-lock::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,14,12,0.22) 0%, rgba(16,14,12,0.78) 100%);
}
.cover-lock.opened { opacity: 0; transform: translateY(-24px); pointer-events: none; }
.cover-inner {
  position: relative; z-index: 2; width: 100%; max-width: 460px;
  padding: 40px 28px 54px; text-align: center; color: #FAF8F5;
}
.cover-monogram { font-family: var(--font-serif); font-size: 15px; letter-spacing: 0.28em; text-transform: uppercase; opacity: 0.9; margin-bottom: 14px; }
.cover-names { font-family: var(--font-serif); font-size: clamp(40px, 10vw, 56px); font-weight: 400; line-height: 1.05; margin-bottom: 18px; }
.cover-guest-box { border-top: 1px solid rgba(250,248,245,0.28); border-bottom: 1px solid rgba(250,248,245,0.28); padding: 14px 12px; margin: 0 auto 26px; max-width: 320px; }
.cover-guest-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.78; margin-bottom: 4px; }
.cover-guest-name { font-family: var(--font-serif); font-size: 24px; font-weight: 500; }
.btn-open {
  display: inline-flex; align-items: center; gap: 10px;
  background: #FAF8F5; color: #1C1B19; border: 0; cursor: pointer;
  padding: 14px 30px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-open:hover { background: var(--accent); color: #FFFFFF; transform: translateY(-1px); }

/* Layout Shell (Mobile 480px + Desktop Split-Screen) */
.app-shell { display: block; min-height: 100dvh; }
.desktop-stage { display: none; }
.invite-canvas { width: 100%; max-width: 480px; margin: 0 auto; background: var(--bg); min-height: 100dvh; position: relative; padding-bottom: 92px; }

@media (min-width: 1024px) {
  .app-shell.split-on { display: grid; grid-template-columns: 1fr 480px; }
  .app-shell.split-on .desktop-stage {
    display: flex; flex-direction: column; justify-content: flex-end;
    position: sticky; top: 0; height: 100dvh;
    background-size: cover; background-position: center;
    padding: 56px; color: #FAF8F5; overflow: hidden;
  }
  .app-shell.split-on .desktop-stage::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(16,14,12,0.12) 0%, rgba(16,14,12,0.72) 100%);
  }
  .desktop-stage-content { position: relative; z-index: 2; max-width: 520px; }
  .desktop-stage-names { font-family: var(--font-serif); font-size: 64px; font-weight: 400; line-height: 1.02; margin: 12px 0; }
  .desktop-stage-date { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; }
  .app-shell.split-on .invite-canvas { margin: 0; border-left: 1px solid var(--border); }
}

/* Top Utility Bar */
.top-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: rgba(250, 248, 245, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-monogram { font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.16em; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 5px 11px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.pill-btn:hover { border-color: var(--ink); }

/* Sections & GPU-Only Reveal */
.sec { padding: 56px 24px; border-bottom: 1px solid var(--border); }
.sec-hero { padding: 0 0 48px; text-align: center; }
.hero-photo-wrap { width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface); margin-bottom: 28px; }
.hero-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.h-display { font-family: var(--font-serif); font-size: 40px; font-weight: 400; line-height: 1.08; margin-bottom: 12px; }
.h-sec { font-family: var(--font-serif); font-size: 32px; font-weight: 400; line-height: 1.15; margin-bottom: 16px; text-align: center; }
.lead { font-size: 14px; color: var(--muted); text-align: center; max-width: 380px; margin: 0 auto; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: translateY(0); will-change: auto; }

/* Couple */
.couple-grid { display: grid; gap: 32px; margin-top: 28px; }
.person-card { text-align: center; }
.person-photo { width: 210px; aspect-ratio: 3 / 4; margin: 0 auto 18px; overflow: hidden; border-radius: 110px 110px 0 0; border: 1px solid var(--border); background: var(--surface); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-family: var(--font-serif); font-size: 28px; font-weight: 500; margin-bottom: 6px; }
.person-parents { font-size: 13px; color: var(--muted); max-width: 300px; margin: 0 auto; }
.person-ig { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--accent); text-decoration: none; letter-spacing: 0.06em; }

/* Countdown */
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 24px 0 22px; }
.cd-box { background: var(--surface); border: 1px solid var(--border); padding: 14px 6px; text-align: center; }
.cd-num { font-family: var(--font-serif); font-size: 30px; line-height: 1; display: block; margin-bottom: 4px; }
.cd-lbl { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Events */
.event-stack { display: grid; gap: 18px; margin-top: 22px; }
.event-card { background: var(--surface); border: 1px solid var(--border); padding: 26px 22px; text-align: center; }
.event-title { font-family: var(--font-serif); font-size: 26px; font-weight: 500; margin-bottom: 8px; }
.event-time { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 12px; }
.event-venue { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.event-addr { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn-outline, .btn-solid {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: opacity 0.2s, background 0.2s;
}
.btn-solid { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-solid:hover, .btn-outline:hover { opacity: 0.82; }

/* Dresscode Swatches */
.swatch-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.swatch-item { text-align: center; }
.swatch-dot { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.14); margin: 0 auto 6px; }
.swatch-name { font-size: 11px; color: var(--muted); }

/* Gallery & Lightbox */
.gal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }
.gal-item { aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); border: 0; padding: 0; cursor: zoom-in; }
.gal-item:first-child { grid-column: span 2; aspect-ratio: 16 / 10; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.gal-item:hover img { transform: scale(1.03); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(16,14,12,0.94); display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 82dvh; max-width: 92vw; object-fit: contain; }
.lb-btn { position: absolute; background: rgba(255,255,255,0.14); color: #FFF; border: 0; width: 42px; height: 42px; font-size: 20px; cursor: pointer; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Travel & FAQ */
.faq-list { display: grid; gap: 10px; margin-top: 18px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.faq-item summary { font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq-item p { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* Gifts */
.gift-stack { display: grid; gap: 14px; margin-top: 22px; }
.gift-card { background: var(--surface); border: 1px solid var(--border); padding: 20px; text-align: center; }
.gift-provider { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.gift-num { font-family: var(--font-serif); font-size: 26px; letter-spacing: 0.06em; margin-bottom: 4px; }
.gift-holder { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* RSVP & Wishes */
.form-card { background: var(--surface); border: 1px solid var(--border); padding: 22px 18px; margin-top: 20px; }
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; background: var(--bg); border: 1px solid var(--border); font-size: 14px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.hh-guest-row { border: 1px solid var(--border); background: var(--bg); padding: 14px; margin-bottom: 12px; }
.hh-guest-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.form-msg { margin-top: 12px; font-size: 13px; color: var(--accent); text-align: center; min-height: 20px; }

.wishes-box { margin-top: 24px; max-height: 360px; overflow-y: auto; display: grid; gap: 12px; padding-right: 4px; }
.wish-item { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.wish-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.wish-author { font-weight: 600; font-size: 14px; }
.wish-badge { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; background: var(--bg); border: 1px solid var(--border); color: var(--accent); }
.wish-text { font-size: 13px; color: var(--muted); white-space: pre-wrap; }

/* Floating Bottom Nav & Audio */
.bottom-nav {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 45;
  width: calc(100% - 28px); max-width: 440px;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 8px; background: rgba(28, 27, 25, 0.9); color: #FAF8F5;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@media (min-width: 1024px) {
  .app-shell.split-on .bottom-nav { left: auto; right: 20px; transform: none; max-width: 440px; }
}
.bottom-nav a { color: #FAF8F5; text-decoration: none; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; padding: 4px 6px; }
.bottom-nav a:hover { opacity: 1; color: #D8C3A5; }

.audio-fab {
  position: fixed; right: 16px; bottom: 72px; z-index: 46;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--bg); border: 1px solid var(--border);
  cursor: pointer; display: grid; place-items: center; font-size: 14px;
}
.audio-fab.playing { animation: spin 7s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-10px); z-index: 95;
  background: var(--ink); color: var(--bg); padding: 10px 18px; font-size: 12px; letter-spacing: 0.08em;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.footer-sec { padding: 40px 24px 28px; text-align: center; font-size: 12px; color: var(--muted); }
