/* =============================================================
   Adrian & Charlotte — Wedding Invitation
   Hunbei-style template: 7 swipe pages, single-card-per-screen.
   ============================================================= */

:root {
  --c-bg:        #ffffff;
  --c-ink:      #2e2418;
  --c-ink-soft: #6a594a;
  --c-gold:     #9c7b55;
  --c-gold-2:   #b69571;
  --c-frame:    #c8b28d;
  --c-brush:    rgba(170, 160, 150, 0.22);
  --c-input:    #d9cdb6;

  --f-serif:  'Cormorant Garamond', 'Times New Roman', serif;
  --f-script: 'Great Vibes', cursive;
  --f-script2:'Dancing Script', cursive;
  --f-cap:    'Cinzel', serif;
  --f-sans:   'Montserrat', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #fcfbf7;
  color: var(--c-ink);
  font-family: var(--f-serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
}

body { position: fixed; inset: 0; }

/* ═══════════════════════════════════════════════════════
   SHARED DECOR — parallax botanical backdrop
   Each layer shifts at a different rate (-pi driven by JS) so
   foreground twig + berries drift faster than background leaves,
   producing a 3D depth illusion while swiping pages.
   ═══════════════════════════════════════════════════════ */
body { --pi: 0; }                /* current page index, set in JS */

.decor {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* TRANSITION tuning for every parallax layer */
.decor-leaves, .decor-twig, .decor-berries {
  transition:
    transform 1100ms cubic-bezier(.22,1,.36,1),
    filter   1100ms ease;
  will-change: transform;
}

/* Background layer (slowest — further away) */
.decor-leaves {
  position: absolute;
  top: 0;
  width: 78%;
  height: 58%;
  filter: blur(.3px);
  transform:
    translateY(calc(var(--pi) * -12vh))
    scale(calc(1 - var(--pi) * 0.03));
}
.decor-leaves--left  {
  left: -10%;
  transform:
    translateY(calc(var(--pi) * -10vh))
    rotate(calc(var(--pi) * 1.5deg))
    scale(calc(1 - var(--pi) * 0.03));
}
.decor-leaves--right {
  right: -10%;
  transform:
    translateY(calc(var(--pi) * -14vh))
    rotate(calc(var(--pi) * -1.5deg))
    scale(calc(1 - var(--pi) * 0.03));
}

/* Midground layer — moves faster */
.decor-twig {
  position: absolute;
  left: 4%;
  bottom: 5%;
  width: 70px;
  height: 220px;
  transform:
    translateY(calc(var(--pi) * -22vh))
    translateX(calc(var(--pi) * -10px))
    scale(calc(1 + var(--pi) * .04));
}

/* Foreground layer — fastest, closest to viewer */
.decor-berries {
  position: absolute;
  right: 0;
  bottom: 2%;
  width: 120px;
  height: 220px;
  transform:
    translateY(calc(var(--pi) * -26vh))
    translateX(calc(var(--pi) * 14px))
    scale(calc(1 + var(--pi) * .06));
}

/* ─── Falling leaves ──────────────────────────────────────
   Two nested animations (no property conflict):
     outer <span.leaf> → fall (translate) + fade (opacity)
     inner <i>         → spin (rotate)
   Per-leaf tuning via CSS custom properties on inline style.
   ───────────────────────────────────────────────────────── */
.leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.leaf {
  position: absolute;
  top: 0;
  left: var(--x, 50%);
  width: var(--s, 16px);
  height: calc(var(--s, 16px) * 1.35);
  filter: blur(var(--b, 0));
  opacity: 0;
  will-change: transform, opacity;
  animation:
    leafFall var(--d, 18s) linear var(--delay, 0s) infinite,
    leafFade var(--d, 18s) ease-in-out var(--delay, 0s) infinite;
}
.leaf > i {
  display: block;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 2 C 20 6 22 18 12 30 C 2 18 4 6 12 2 Z' fill='%237a9d6a'/%3E%3Cpath d='M12 4 L 12 28' stroke='%23567a50' stroke-width='.5' fill='none'/%3E%3Cpath d='M12 10 L 16 12 M12 16 L 17 17 M12 22 L 15 23 M12 10 L 8 12 M12 16 L 7 17 M12 22 L 9 23' stroke='%23567a50' stroke-width='.4' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: leafSpin calc(var(--d, 18s) * .8) linear infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}
.leaf--alt > i {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 1 C 22 10 23 22 12 31 C 1 22 2 10 12 1 Z' fill='%238fae7a'/%3E%3Cpath d='M12 3 Q 15 15 16 28' stroke='%23567a50' stroke-width='.5' fill='none'/%3E%3Cpath d='M12 8 Q 18 10 20 15 M12 14 Q 18 16 19 21 M12 20 Q 17 22 18 26' stroke='%23567a50' stroke-width='.35' fill='none'/%3E%3C/svg%3E");
}

@keyframes leafFall {
  0%   { transform: translate3d(0,    -20vh, 0); }
  25%  { transform: translate3d(22px,  30vh, 0); }
  50%  { transform: translate3d(-26px, 55vh, 0); }
  75%  { transform: translate3d(18px,  80vh, 0); }
  100% { transform: translate3d(-10px,120vh, 0); }
}
@keyframes leafFade {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: var(--o, .8); }
}
@keyframes leafSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════
   PAGER — vertical stack with translate transitions
   ═══════════════════════════════════════════════════════ */
.pager {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateY(0);
  transition: transform 900ms cubic-bezier(.65,.05,.15,1);
  will-change: transform;
  z-index: 10;
  perspective: 1400px;
}

.page {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vh, 32px) clamp(10px, 4vw, 24px);
  isolation: isolate;
}

/* Frame entrance — the card bounces in when its page becomes active */
.frame {
  opacity: 0;
  transform: scale(.82) translateY(40px) rotateX(12deg);
  transform-origin: 50% 50%;
  transition:
    transform 900ms cubic-bezier(.22,1.35,.36,1),
    opacity 700ms ease,
    filter   900ms ease;
  filter: blur(0);
}
.page.is-active .frame {
  opacity: 1;
  transform: scale(1) translateY(0) rotateX(0);
  filter: blur(0);
}
.page:not(.is-active) .frame { transition-duration: 400ms; }

/* ─── Per-page unique entrance transitions ──────────────────
   Each page reveals its card with a distinct movement. Applied
   by boosting specificity (.page--X.is-active .frame) over the
   default rule above.
   ───────────────────────────────────────────────────────── */

/* Page 2 — SAVE THE DATE: deep zoom-in from tiny */
.page--save .frame {
  transform: scale(.25) rotate(-10deg);
}
.page--save.is-active .frame {
  transform: scale(1) rotate(0);
}

/* Page 3 — GROOM: slide in from the right with a lean */
.page--groom .frame {
  transform: translateX(110%) rotate(6deg) scale(.92);
}
.page--groom.is-active .frame {
  transform: translateX(0) rotate(0) scale(1);
}

/* Page 4 — BRIDE: slide in from the left with a lean (mirror) */
.page--bride .frame {
  transform: translateX(-110%) rotate(-6deg) scale(.92);
}
.page--bride.is-active .frame {
  transform: translateX(0) rotate(0) scale(1);
}

/* Page 5 (new) — SWEET LOVE: diagonal drop-in with gentle righting */
.page--sweet .frame {
  transform: translate(60px, -70px) rotate(-7deg) scale(.86);
  transform-origin: 50% 50%;
}
.page--sweet.is-active .frame {
  transform: translate(0, 0) rotate(0) scale(1);
}

/* Page 6 — SCHEDULE: 3D flip on the Y-axis */
.page--schedule .frame {
  transform: rotateY(95deg) scale(.95);
  transform-origin: 50% 50%;
}
.page--schedule.is-active .frame {
  transform: rotateY(0) scale(1);
}

/* Page 6 — ADDRESS: corner-pivot rotate-in */
.page--address .frame {
  transform: rotate(-18deg) scale(.6) translate(-60px, 80px);
  transform-origin: 100% 0%;
}
.page--address.is-active .frame {
  transform: rotate(0) scale(1) translate(0, 0);
}

/* Page 7 — COUNTDOWN: blur-fade with subtle zoom-out overshoot */
.page--count .frame {
  transform: scale(1.25);
  filter: blur(22px);
}
.page--count.is-active .frame {
  transform: scale(1);
  filter: blur(0);
}

/* Entrance animations for content inside an active page */
.anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s ease, transform .85s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--i, 1) * 120ms + 250ms);
}
.page.is-active .anim { opacity: 1; transform: translateY(0) translateX(0) scale(1) rotate(0); }

.anim-down    { transform: translateY(-28px); }
.anim-left    { transform: translateX(-40px); }
.anim-right   { transform: translateX(40px);  }
.anim-zoom    { transform: scale(.6); }
.anim-rotate  { transform: rotate(-8deg) scale(.8); }
.anim-flip    { transform: rotateY(60deg) scale(.9); transform-origin: 50% 50%; }

/* ═══════════════════════════════════════════════════════
   MUSIC BUTTON
   ═══════════════════════════════════════════════════════ */
.music-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(156,123,85,.3);
  color: var(--c-gold);
  z-index: 50;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.music-btn svg { width: 22px; height: 22px; }
.music-btn.is-playing svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   DOTS
   ═══════════════════════════════════════════════════════ */
.pager-dots {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 45;
}
.pager-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(156,123,85,.3);
  padding: 0;
  transition: all .3s;
}
.pager-dots button.is-on {
  background: var(--c-gold);
  transform: scale(1.4);
}

/* ═══════════════════════════════════════════════════════
   COVER PAGE — title sits directly on the decor
   ═══════════════════════════════════════════════════════ */
.page--cover { padding: 0; background: transparent; }
.page--cover .frame { display: none; } /* no frame on cover */
/* Cover has no .frame, so override the scale-entrance with body zoom */
.page--cover { transform: scale(1); opacity: 1; }

/* Leaf sway animations */
.sway { transform-origin: 50% 0%; }
.sway--a    { animation: sway 6s ease-in-out infinite; }
.sway--b    { animation: sway 7.5s ease-in-out infinite .4s; }
.sway--c    { animation: swayReverse 6.5s ease-in-out infinite; }
.sway--d    { animation: swayReverse 8s ease-in-out infinite .6s; }
.sway--slow { animation: sway 9s ease-in-out infinite; transform-origin: 50% 100%; }

@keyframes sway {
  0%, 100% { transform: rotate(-2.2deg) translateY(0); }
  50%      { transform: rotate(2.2deg) translateY(2px); }
}
@keyframes swayReverse {
  0%, 100% { transform: rotate(2.2deg) translateY(0); }
  50%      { transform: rotate(-2.2deg) translateY(2px); }
}

.berry-pulse       { animation: pulse 4s ease-in-out infinite; transform-origin: 50% 50%; }
.berry-pulse--b    { animation: pulse 5s ease-in-out infinite .8s; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}

.cover-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  transform: translateY(-50%);
  text-align: center;
  padding: 0 24px;
  z-index: 12;
}
.cover-title {
  font-family: var(--f-script);
  font-size: clamp(42px, 11.5vw, 64px);
  color: var(--c-gold);
  font-weight: 400;
  letter-spacing: .5px;
  margin: 0 0 26px;
  line-height: 1;
  /* Gold glow pulse that kicks in once letters are in */
  animation: goldGlow 5s ease-in-out 1800ms infinite;
}
@keyframes goldGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(156, 123, 85, 0); }
  50%      { text-shadow: 0 0 28px rgba(156, 123, 85, .35),
                          0 0 12px rgba(182, 149, 113, .25); }
}

.cover-names {
  font-family: var(--f-serif);
  font-size: clamp(20px, 5.2vw, 26px);
  color: var(--c-ink-soft);
  letter-spacing: 2px;
  margin: 0;
  font-weight: 500;
  /* Subtle float drift — premium, readable, not distracting */
  animation: nameFloat 6s ease-in-out 2400ms infinite;
}
.cover-names .amp {
  margin: 0 .4em;
  color: var(--c-gold);
  display: inline-block;
  animation: ampBreathe 3s ease-in-out 2600ms infinite;
}
.cover-names .name-part { display: inline-block; }

@keyframes nameFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes ampBreathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* ─── Letter-by-letter reveal ─────────────────────────────
   Each letter blur-clears in, floats up from below, and eases
   into place with a bouncy scale curve. Stagger driven by --l.
   ─────────────────────────────────────────────────────── */
.ltr {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) scale(.85);
  filter: blur(8px);
  transition:
    opacity .8s ease,
    transform .8s cubic-bezier(.22, 1.35, .36, 1),
    filter .8s ease;
  transition-delay: calc(var(--l-start, 0ms) + var(--l, 0) * 55ms);
}
.page.is-active .ltr {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
.cover-thanks {
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  font-family: var(--f-sans);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--c-ink-soft);
  margin: 0;
  text-align: center;
  z-index: 12;
  padding: 0 24px;
}

.swipe-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--c-gold);
  font-family: var(--f-sans);
  font-size: 11px;
  letter-spacing: 3px;
  text-align: center;
  z-index: 12;
}
.page.is-active .swipe-hint {
  animation: bob 2.4s ease-in-out infinite;
  animation-delay: 1.5s;
}
.swipe-hint svg { width: 16px; height: 16px; margin: 4px auto 0; display: block; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* ═══════════════════════════════════════════════════════
   FRAME — shared decorated card for pages 2–7
   ═══════════════════════════════════════════════════════ */
.frame {
  position: relative;
  width: 100%;
  max-width: min(94vw, 420px);
  height: 100%;
  max-height: min(96dvh, 780px);
  padding: clamp(18px, 2.5vh, 26px) clamp(10px, 2.8vw, 18px)
           clamp(14px, 2vh, 22px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow:
    0 24px 48px -16px rgba(90,70,50,.22),
    0 8px 20px -6px rgba(90,70,50,.12);
  border-radius: 2px;
}
.frame::before,
.frame::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid var(--c-frame);
  pointer-events: none;
}
.frame::after {
  inset: 16px;
  border-color: rgba(200,178,141,.35);
}

.frame__side {
  position: absolute;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  font-family: var(--f-cap);
  font-size: 10px;
  letter-spacing: 6px;
  color: var(--c-gold);
  white-space: nowrap;
  z-index: 2;
}
.frame__side--left  { left: 2px; }
.frame__side--right { right: 2px; }

.frame__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: clamp(6px, 1.4vh, 14px) clamp(16px, 5vw, 30px);
  display: flex;
  flex-direction: column;
  text-align: center;
  scrollbar-width: none;
  touch-action: pan-y;
  min-height: 0;
}
.frame__content::-webkit-scrollbar { display: none; }

.frame--no-pad { padding: 0; }
.frame--no-pad::before { inset: 10px; }
.frame--no-pad::after  { inset: 14px; }

/* ═══════════════════════════════════════════════════════
   Shared type
   ═══════════════════════════════════════════════════════ */
.h-eyebrow {
  font-family: var(--f-cap);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--c-gold);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.h-eyebrow--small { font-size: 10px; letter-spacing: 3px; margin-top: 14px; }

.h-title {
  font-family: var(--f-cap);
  font-size: clamp(22px, 6.2vw, 28px);
  color: var(--c-ink);
  letter-spacing: 3px;
  margin: 4px 0 14px;
  font-weight: 600;
}

.h-footer {
  font-family: var(--f-cap);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--c-gold);
  margin: auto 0 6px;
  padding-top: 18px;
}

.script-title {
  font-family: var(--f-script2);
  font-size: clamp(46px, 13vw, 68px);
  color: var(--c-ink);
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1;
}
.script-title--ontop {
  margin-top: -40px;
  color: #222;
}

.person-quote {
  font-family: var(--f-script2);
  font-size: 12px;
  color: rgba(156,123,85,.55);
  line-height: 1.55;
  margin: 12px 0 16px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   PAGE 2 — Save the date
   ═══════════════════════════════════════════════════════ */
.save-photo {
  margin: clamp(6px, 1.2vh, 14px) auto clamp(8px, 1.6vh, 14px);
  width: 82%;
  max-width: 300px;
  aspect-ratio: 3/4;
  max-height: 40vh;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(90,70,50,.12);
  flex-shrink: 0;
}
.save-photo img { width: 100%; height: 100%; object-fit: cover; }

.save-names {
  font-family: var(--f-serif);
  font-size: clamp(18px, 4.8vw, 22px);
  color: var(--c-gold);
  letter-spacing: 2px;
  margin: 0 0 14px;
  font-weight: 500;
}
.save-names .amp-sm { margin: 0 .4em; }

.save-chinese p {
  font-family: 'Songti SC', 'SimSun', 'Cormorant Garamond', serif;
  font-size: 15px;
  color: var(--c-ink);
  line-height: 2;
  margin: 0;
}
.save-date { margin: 12px 0 6px; }
.save-date p {
  font-family: 'Songti SC', 'SimSun', serif;
  font-size: 15px;
  color: var(--c-ink);
  line-height: 1.9;
  margin: 0;
}
.save-venue {
  font-family: var(--f-serif);
  font-size: 20px;
  color: var(--c-ink);
  margin: 10px 0 4px;
}

/* ═══════════════════════════════════════════════════════
   PAGE 3 & 4 — Groom / Bride
   ═══════════════════════════════════════════════════════ */
.circle-photo {
  width: min(62%, 36vh);
  max-width: 260px;
  aspect-ratio: 1/1;
  margin: clamp(8px, 1.5vh, 16px) auto 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e0d4b8;
  box-shadow: 0 6px 20px rgba(90,70,50,.15);
  position: relative;
  flex-shrink: 0;
}
.circle-photo img { width: 100%; height: 100%; object-fit: cover; }

.brush-block {
  position: relative;
  margin: 8px auto 0;
  padding: 18px 18px 14px;
}
.brush-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 50% 55%, var(--c-brush), transparent 70%);
  z-index: -1;
  transform: rotate(-1deg);
}
.person-name {
  font-family: var(--f-serif);
  font-size: 20px;
  color: var(--c-gold);
  letter-spacing: 2px;
  margin: 0 0 12px;
  font-weight: 500;
}
.person-lines p {
  font-family: 'Songti SC', 'SimSun', serif;
  font-size: 16px;
  color: var(--c-ink);
  line-height: 2;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   PAGE 5 — Sweet Love (couple photo card)
   ═══════════════════════════════════════════════════════ */
.frame__content--sweet {
  padding: 14px 14px 0;
  overflow: hidden;
  position: relative;
}
.sweet-photo {
  position: relative;
  margin: 0 0 clamp(-36px, -5vh, -24px);
  width: 100%;
  aspect-ratio: 4/5;
  max-height: 58%;
  min-height: 42%;
  overflow: hidden;
  flex-shrink: 0;
}
.sweet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sweet-body {
  padding: 0 clamp(18px, 5vw, 28px) clamp(12px, 2vh, 18px);
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sweet-subtitle {
  font-family: 'Songti SC', 'SimSun', var(--f-serif);
  font-size: clamp(13px, 3.6vw, 16px);
  color: var(--c-ink);
  letter-spacing: 2px;
  line-height: 1.8;
  margin: clamp(8px, 1.4vh, 14px) 0 clamp(10px, 1.8vh, 16px);
}

/* ═══════════════════════════════════════════════════════
   PAGE 6 — Schedule
   ═══════════════════════════════════════════════════════ */
.frame__content--schedule {
  padding: 14px 14px 0;
  overflow: hidden;
  position: relative;
}
.schedule-photo {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 58%;
  min-height: 40%;
  overflow: hidden;
  flex-shrink: 0;
}
.schedule-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Torn-paper edge at bottom of photo — white SVG wave stamped over image */
.photo-tear {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: clamp(36px, 8vh, 56px);
  display: block;
  pointer-events: none;
}
.schedule-body {
  padding: 0 clamp(18px, 5vw, 28px);
  text-align: center;
  margin-top: clamp(-42px, -6vh, -30px);
  position: relative;
  z-index: 2;
}
.schedule-sub {
  font-family: var(--f-script);
  font-size: 18px;
  color: var(--c-gold-2);
  letter-spacing: 4px;
  margin: 0 0 14px;
}
.schedule-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 8px;
}
.schedule-list li {
  font-family: 'Songti SC', 'SimSun', var(--f-serif);
  font-size: 16px;
  color: var(--c-ink);
  line-height: 2.2;
}
.schedule-list .t {
  color: var(--c-gold);
  margin-right: 6px;
  letter-spacing: 1px;
}
.schedule-grass {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  width: 100%;
  height: clamp(110px, 20vh, 160px);
  pointer-events: none;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   PAGE 6 — Address
   ═══════════════════════════════════════════════════════ */
.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  max-height: min(40vh, 320px);
  margin: clamp(8px, 1.5vh, 14px) auto clamp(6px, 1vh, 12px);
  border-radius: 2px;
  overflow: hidden;
  background: #000;
  border: 1px solid #eee;
  flex-shrink: 0;
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.map-direction {
  position: absolute;
  right: 14px; bottom: 14px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #1fb48a;
  box-shadow: 0 0 0 8px rgba(31,180,138,.2), 0 4px 12px rgba(0,0,0,.2);
  display: grid;
  place-items: center;
  color: #fff;
  z-index: 2;
}
.map-direction svg { width: 22px; height: 22px; }

.venue-name {
  font-family: var(--f-cap);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--c-gold);
  margin: 6px 0 2px;
}

.phone-row {
  display: flex;
  gap: 12px;
  margin: 10px 0 4px;
  justify-content: center;
}
.phone-btn {
  flex: 1;
  padding: 12px 0;
  border: 1px solid var(--c-ink);
  border-radius: 8px;
  font-family: var(--f-cap);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--c-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}
.phone-btn:active { background: #f4efe4; }
.phone-btn svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════════
   PAGE 7 — Countdown + RSVP
   ═══════════════════════════════════════════════════════ */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(6px, 1.8vw, 10px);
  margin: clamp(10px, 2vh, 18px) 0 clamp(14px, 2.5vh, 22px);
}
.cd-box {
  background: #1a1a1a;
  color: #fff;
  border-radius: 6px;
  padding: clamp(9px, 1.6vh, 14px) 0 clamp(7px, 1.2vh, 12px);
  text-align: center;
  line-height: 1;
}
.cd-box span {
  display: block;
  font-family: var(--f-serif);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 500;
  letter-spacing: 1px;
}
.cd-box b {
  display: block;
  font-family: 'Songti SC', serif;
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 400;
  margin-top: 6px;
  opacity: .85;
}

.rsvp { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 14px); margin-top: 4px; }

.rsvp-group {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.rsvp-group legend {
  font-family: var(--f-cap);
  font-size: 10.5px;
  letter-spacing: 2.5px;
  color: var(--c-gold);
  text-transform: uppercase;
  margin: 0 0 6px;
  padding: 0;
  text-align: left;
  display: block;
  width: 100%;
}
.rsvp-group legend .req { color: #d55; margin-right: 2px; }

.rsvp-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--c-input);
  border-radius: 6px;
  background: #fff;
  font-family: var(--f-serif);
  font-size: 16px;         /* 16px+ prevents iOS zoom-on-focus */
  color: var(--c-ink);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}
.rsvp-input:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(156,123,85,.15);
}

/* ─── Clickable option pills ──────────────────────────── */
.rsvp-pills {
  display: grid;
  gap: 6px;
}
.rsvp-pills--2 { grid-template-columns: 1fr 1fr; }
.rsvp-pills--3 { grid-template-columns: repeat(3, 1fr); }

.rsvp-pill {
  position: relative;
  display: block;
  cursor: pointer;
}
.rsvp-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.rsvp-pill span {
  display: block;
  padding: 11px 6px;
  border: 1px solid var(--c-input);
  border-radius: 6px;
  background: #fff;
  font-family: var(--f-serif);
  font-size: 13px;
  color: var(--c-ink);
  text-align: center;
  line-height: 1.2;
  transition: all .2s ease;
  user-select: none;
}
.rsvp-pill:hover span { border-color: var(--c-gold); }
.rsvp-pill input:checked + span {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  box-shadow: 0 4px 10px -4px rgba(26,26,26,.35);
}
.rsvp-pill:active span { transform: scale(.96); }
.rsvp-pill input:focus-visible + span { outline: 2px solid var(--c-gold); outline-offset: 2px; }

.rsvp-diet-input {
  margin-top: 8px;
  height: 40px;
  font-size: 14px;
}
.rsvp-diet-input[hidden] { display: none; }

.submit-btn {
  height: 48px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 6px;
  font-family: var(--f-cap);
  font-size: 18px;
  letter-spacing: 1px;
  margin-top: 6px;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.submit-btn:active { transform: scale(.98); }
.submit-btn:disabled { background: #7a7468; cursor: default; opacity: .8; }

/* ─── Success confirmation ───────────────────────────── */
.rsvp-ok {
  text-align: center;
  color: #3a8a5e;
  font-family: var(--f-serif);
  padding: 18px 12px;
  margin: 8px 0 0;
  border-radius: 10px;
  background: rgba(58, 138, 94, .08);
  border: 1px solid rgba(58, 138, 94, .25);
  animation: okPop .5s cubic-bezier(.22,1.35,.36,1) both;
}
.rsvp-ok[hidden] { display: none; }
.rsvp-ok svg {
  width: 48px; height: 48px;
  margin: 0 auto 8px;
  display: block;
  color: #3a8a5e;
}
.rsvp-ok p { margin: 2px 0; font-size: 14px; line-height: 1.5; }
.rsvp-ok p strong { font-size: 18px; font-weight: 600; color: #2c6e47; }
@keyframes okPop {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Invalid group highlight */
.rsvp-group.is-invalid legend { color: #d55; }
.rsvp-group.is-invalid .rsvp-pill span,
.rsvp-group.is-invalid .rsvp-input { border-color: #e8b2b2; }

/* ═══════════════════════════════════════════════════════
   Hidden YT player
   ═══════════════════════════════════════════════════════ */
#ytPlayer {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   Responsive breakpoints
   ═══════════════════════════════════════════════════════ */

/* Very small phones (iPhone SE, old Androids) */
@media (max-width: 360px) {
  .frame__content { padding: 6px 16px; }
  .phone-btn      { font-size: 13px; padding: 10px 0; }
  .circle-photo   { width: min(60%, 32vh); }
  .schedule-photo { max-height: 38%; }
  .save-photo     { width: 86%; max-width: 240px; }
}

/* Short screens (landscape phones, small devices) */
@media (max-height: 640px) {
  .frame { padding: 14px 10px 12px; }
  .circle-photo  { width: min(52%, 30vh); max-width: 210px; }
  .save-photo    { max-height: 34vh; }
  .schedule-photo { max-height: 38%; }
  .cd-grid       { margin: 8px 0 12px; }
  .cd-box        { padding: 8px 0 6px; }
  .h-footer      { padding-top: 8px; font-size: 10px; }
  .person-quote  { font-size: 11px; margin: 8px 0 10px; }
}

/* Tablets / larger phones — keep card focused in viewport center */
@media (min-width: 500px) {
  .frame { max-width: min(88vw, 440px); }
}

/* Desktop — centered card, showcase the decor around it */
@media (min-width: 900px) {
  .frame          { max-width: 440px; max-height: 820px; }
  .decor-leaves   { width: 50%; height: 50%; }
  .decor-leaves--left  { left: -2%; }
  .decor-leaves--right { right: -2%; }
  .decor-twig     { left: 12%; width: 80px; }
  .decor-berries  { right: 8%; width: 130px; }
  .music-btn      { top: 24px; right: 24px; }
  .pager-dots     { right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sway, .sway--a, .sway--b, .sway--c, .sway--d, .sway--slow,
  .berry-pulse, .berry-pulse--b, .swipe-hint, .music-btn.is-playing svg,
  .leaf, .leaf > i {
    animation: none !important;
  }
  .leaf { opacity: 0 !important; }
  .anim { transition-duration: .3s; }
}

/* Hide leaves on very small screens / reduce count naturally on narrow widths */
@media (max-width: 400px) {
  .leaf { /* scale down slightly */
    transform: scale(.85);
  }
}
