/* ═══════════════════════════════════════════════════════════
   ROYAL WEDDING INVITE — STYLES
   Mobile-first · 60fps · gold-on-maroon royal theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --maroon: #B23766;
  --maroon-deep: #812447;
  --gold: #C85183;
  --gold-soft: #F3B3CA;
  --ivory: #FFFAFC;
  --ink: #432D37;
  --vh: 1vh; /* corrected by JS to avoid URL-bar jumps */
  --serif-display: "Comic Neue", "Chalkboard SE", "Comic Sans MS", "Segoe Print", cursive;
  --serif-body: "Comic Neue", "Chalkboard SE", "Comic Sans MS", "Segoe Print", cursive;
  --serif-dev: "Noto Serif Devanagari", serif;
  --glass-fill: linear-gradient(145deg, rgba(255,255,255,.76), rgba(255,235,243,.54));
  --glass-stroke: rgba(255,255,255,.78);
  --glass-shadow: 0 14px 38px rgba(129,36,71,.14), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(200,81,131,.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: var(--serif-body);
  background: var(--ivory);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.is-loading { overflow: hidden; }
.hidden { display: none !important; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}

/* Keep the paper colour without a fixed full-screen noise/filter layer. */

/* ── Gold foil text ───────────────────────────────────────── */
.gold-foil {
  background: linear-gradient(105deg,
    #9d315d 0%, var(--gold) 22%, #f5c3d7 40%, var(--gold-soft) 50%,
    #fff5f9 60%, var(--gold) 78%, #9d315d 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-position: 50% 0;
}
@keyframes foil-sheen {
  0%, 100% { background-position: 0% 0; }
  50%      { background-position: 100% 0; }
}
.sec-head.shown .gold-foil { animation: foil-sheen 1.15s ease-out .15s both; }

.eyebrow {
  font-family: var(--serif-display);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .95;
}

/* ═══════════════ LOADER — THE SEAL ═══════════════ */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  color: var(--gold);
  touch-action: none;
  overscroll-behavior: none;
}
.door {
  position: absolute; top: 0; bottom: 0; width: 51%;
  background:
    radial-gradient(120% 90% at 100% 50%, rgba(200,81,131,.14), transparent 55%),
    linear-gradient(160deg, #5a1429 0%, var(--maroon-deep) 55%, #350917 100%);
  transition: transform 1.5s cubic-bezier(.7, 0, .2, 1);
  will-change: transform;
}
.door-l { left: 0;  border-right: 1px solid rgba(200,81,131,.5);
  background-position: right center; }
.door-r { right: 0; border-left: 1px solid rgba(200,81,131,.5);
  transform: scaleX(-1); }
#loader.open .door-l { transform: translateX(-101%); }
#loader.open .door-r { transform: scaleX(-1) translateX(-101%); }
#loader.open .loader-center { opacity: 0; transform: scale(1.35); }
#loader.gone { display: none; }

.loader-center {
  position: relative; z-index: 2;
  display: grid; place-items: center;
  transition: opacity .8s ease, transform .9s ease;
}
#mandala {
  width: min(72vw, 320px); height: min(72vw, 320px);
  overflow: visible;
}
#mandala-spin { animation: spin 60s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
#progress-ring { stroke-dasharray: 414.7; stroke-dashoffset: 414.7; transition: stroke-dashoffset .35s ease; }

#seal-btn {
  position: absolute;
  width: min(34vw, 148px); height: min(34vw, 148px);
  border-radius: 50%;
  border: none;
  background:
    radial-gradient(circle at 34% 30%, #8c2b47 0%, var(--maroon) 45%, var(--maroon-deep) 100%);
  box-shadow:
    0 10px 40px rgba(0,0,0,.55),
    inset 0 2px 10px rgba(255,220,160,.25),
    inset 0 -6px 16px rgba(0,0,0,.45);
  display: grid; place-items: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
#seal-btn:disabled { opacity: .82; }
#seal-btn:not(:disabled) { animation: seal-pulse 2.2s ease-in-out infinite; }
@keyframes seal-pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.05); box-shadow: 0 14px 52px rgba(200,81,131,.35), inset 0 2px 10px rgba(255,220,160,.3), inset 0 -6px 16px rgba(0,0,0,.45); }
}
.seal-monogram {
  font-family: var(--serif-display);
  font-size: clamp(20px, 7vw, 32px);
  font-weight: 700;
  color: var(--gold-soft);
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 18px rgba(243,179,202,.4);
  letter-spacing: .08em;
}
.seal-rim {
  position: absolute; inset: 7%;
  border-radius: 50%;
  border: 1.5px dashed rgba(243,179,202,.55);
  pointer-events: none;
}
#loader-status, #loader-tap {
  position: absolute; bottom: -64px; width: 100vw; text-align: center;
  font-family: var(--serif-display);
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-soft);
}
#loader-tap { animation: fade-blink 1.8s ease-in-out infinite; }
#loader-retry {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 3;
  min-height: 44px;
  padding: 0 20px;
  transform: translateX(-50%);
  border: 1px solid rgba(243,179,202,.72);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(53,9,23,.82);
  font: 600 11px/1 var(--serif-display);
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  touch-action: manipulation;
}
#loader-retry:active { background: rgba(178,55,102,.96); }
@keyframes fade-blink { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ═══════════════ PETALS ═══════════════ */
#petals {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
}

/* ═══════════════ HERO ═══════════════ */
#hero { position: relative; background: var(--ivory); }
.hero-stage {
  position: relative;
  height: max(680px, calc(var(--vh) * 100));
  overflow: hidden;
  contain: paint;
  isolation: isolate;
}
#scrub {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: var(--ivory);
}
/* A static wash of golden light keeps the scene luminous without repainting
   a full-screen blended layer throughout the scroll. */
.hero-stage::after {
  content: "";
  position: absolute; inset: -30%;
  pointer-events: none;
  background: radial-gradient(ellipse 34% 26% at 50% 50%, rgba(255,210,229,.5), transparent 70%);
  mix-blend-mode: soft-light;
}
.vignette {
  position: absolute; inset: -2px; pointer-events: none;
  /* feathers the floating world into the page ivory — no hard frame edges */
  background:
    radial-gradient(ellipse 78% 54% at 50% 42%, transparent 56%, var(--ivory) 92%),
    linear-gradient(to bottom, var(--ivory) 0%, transparent 12%, transparent 80%, var(--ivory) 97%);
}

/* Editorial side notes occupy only genuinely empty wide-screen margins. */
.hero-side { display: none; }
@media (min-width: 1180px) and (min-aspect-ratio: 4 / 3) {
  .hero-side {
    --side-outer: clamp(36px, 6vw, 120px);
    --side-enter: -14px;
    position: absolute;
    top: 46%;
    z-index: 2;
    width: min(320px, calc(50vw - 36.5vh - var(--side-outer) - 28px));
    display: grid;
    justify-items: center;
    gap: 10px;
    color: var(--maroon);
    text-align: center;
    pointer-events: none;
    user-select: none;
    contain: layout paint;
    opacity: 0;
    transform: translate3d(var(--side-enter), -50%, 0);
    transition: opacity 1.15s ease .65s, transform 1.3s cubic-bezier(.2,.75,.25,1) .55s;
  }
  .hero-side-left { left: var(--side-outer); }
  .hero-side-right {
    --side-enter: 14px;
    top: 54%;
    right: var(--side-outer);
  }
  #hero.entered .hero-side {
    opacity: .82;
    transform: translate3d(0, -50%, 0);
  }
  .hero-side > * { position: relative; }
  .hero-side-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--serif-display);
    font-size: 9px;
    letter-spacing: .3em;
    text-indent: .3em;
    text-transform: uppercase;
    color: rgba(178,55,102,.72);
  }
  .hero-side-kicker b {
    font-family: var(--serif-dev);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .08em;
    text-indent: 0;
    color: var(--gold);
  }
  .hero-side-kicker i {
    width: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
  }
  .hero-side-name {
    font-family: var(--serif-display);
    font-size: clamp(56px, 4.8vw, 92px);
    font-weight: 400;
    letter-spacing: .01em;
    line-height: .92;
    color: rgba(178,55,102,.72);
  }
  .hero-side-rule {
    width: min(126px, 72%);
    height: 1px;
    margin: 2px 0;
    background: linear-gradient(90deg, transparent, rgba(200,81,131,.9), transparent);
  }
  .hero-side-rule::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    border: 1px solid var(--gold);
    background: var(--ivory);
    transform: translate(-50%, -50%) rotate(45deg);
  }
  .hero-side em {
    font-family: var(--serif-body);
    font-size: clamp(16px, 1.35vw, 20px);
    font-weight: 500;
    line-height: 1.25;
    color: rgba(67,45,55,.78);
  }
  .hero-side small {
    margin-top: 2px;
    font-family: var(--serif-display);
    font-size: 8.5px;
    letter-spacing: .24em;
    text-indent: .24em;
    text-transform: uppercase;
    color: rgba(178,55,102,.6);
  }
}

/* Crown — a quiet signature above the world */
#hero-crown {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 0; right: 0;
  display: grid; justify-items: center; gap: 7px;
  pointer-events: none;
  z-index: 3;
}
.crown-mono {
  font-family: var(--serif-display);
  font-size: 13px; font-weight: 700;
  letter-spacing: .18em;
  color: var(--maroon);
  border: 1px solid rgba(200,81,131,.75);
  border-radius: 999px;
  padding: 7px 14px 6px;
  background: rgba(255,250,252,.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 14px rgba(129,36,71,.12);
}
.crown-rule {
  width: 46px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.crown-chapter {
  font-family: var(--serif-display);
  font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--maroon);
  opacity: .85;
}

.beat {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  text-align: center;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.beat > * { position: relative; }
.beat-static {
  opacity: 1;
  visibility: visible;
  transform: none;
  will-change: auto;
}

.hero-copy-glass {
  width: min(100%, 560px);
  padding: 17px 18px 15px;
  border: 1px solid var(--glass-stroke);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.78), rgba(255,235,243,.58) 54%, rgba(255,250,252,.72));
  box-shadow: var(--glass-shadow), 0 18px 44px rgba(46,8,22,.16);
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.985);
  transition: opacity .75s ease .16s, transform .8s cubic-bezier(.2,.75,.25,1) .16s;
}
#hero.entered .hero-copy-glass {
  opacity: 1;
  transform: none;
}

.names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 18px);
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(29px, 8.4vw, 60px);
  line-height: 1.08;
  margin: 8px 0 5px;
  color: var(--maroon-deep);
  letter-spacing: -.02em;
  white-space: nowrap;
  text-wrap: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.72);
}
.name-word {
  display: grid;
  justify-items: center;
  line-height: .82;
}
.name-word small {
  margin-top: .42em;
  font-size: .42em;
  font-weight: 700;
  letter-spacing: .03em;
}
/* Cinematic letter-cascade entrance for the names */
.names .ltr {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px) rotate(4deg);
  filter: blur(5px);
}
#hero.entered .names .ltr {
  animation: ltr-in .9s cubic-bezier(.2,.75,.25,1) forwards;
  animation-delay: calc(var(--li) * 65ms + .25s);
}
@keyframes ltr-in {
  to { opacity: 1; transform: none; filter: blur(0); }
}
.amp { font-size: .6em; vertical-align: .18em; color: var(--gold); }
.beat .eyebrow {
  color: var(--maroon);
  text-shadow: none;
}
.hero-vow {
  margin: 2px 0 13px;
  font-size: clamp(14px, 3.9vw, 19px);
  line-height: 1.4;
  letter-spacing: .03em;
  color: rgba(67,45,55,.86);
  text-shadow: none;
}

/* Dedicated countdown card */
#countdown-section {
  padding: clamp(52px, 8vw, 84px) 18px clamp(60px, 9vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(200,81,131,.20), transparent 54%),
    linear-gradient(180deg, #FFFAFC 0%, #fff1f6 100%);
}
.countdown-card {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: clamp(34px, 7vw, 54px) clamp(15px, 5vw, 48px) clamp(30px, 6vw, 46px);
  text-align: center;
  border: 1px solid rgba(200,81,131,.72);
  border-radius: 28px;
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
.countdown-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(200,81,131,.28);
  border-radius: 21px;
  pointer-events: none;
}
.countdown-card::after {
  content: "✦";
  position: absolute;
  left: 50%; bottom: -11px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  transform: translateX(-50%) rotate(45deg);
  color: var(--gold);
  font-size: 10px;
  border: 1px solid rgba(200,81,131,.7);
  background: var(--ivory);
}
.countdown-sigil {
  display: block;
  margin: 0 auto 14px;
  font: 700 11px/1 var(--serif-display);
  letter-spacing: .28em;
  text-indent: .28em;
  color: var(--maroon);
}
#countdown-title {
  margin: 9px 0 7px;
  color: var(--maroon);
  font: 600 clamp(28px, 7vw, 44px)/1.15 var(--serif-display);
  letter-spacing: .02em;
}
.countdown-date,
.countdown-detail {
  color: rgba(67,45,55,.78);
  font-size: clamp(15px, 3.8vw, 19px);
  letter-spacing: .08em;
}
.countdown-detail {
  font-size: clamp(13px, 3.2vw, 16px);
  color: rgba(178,55,102,.72);
}
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 440px;
  margin: 25px auto 21px;
}
.cd-cell {
  min-width: 0;
  padding: 13px 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(200,81,131,.52);
  background: rgba(255,253,247,.78);
  box-shadow: 0 5px 18px rgba(129,36,71,.07);
  display: grid; justify-items: center; gap: 1px;
}
.cd-num {
  font-family: var(--serif-display);
  font-size: clamp(20px, 5.5vw, 29px); font-weight: 700;
  color: var(--maroon);
  font-variant-numeric: tabular-nums;
}
.cd-lbl {
  font-size: clamp(8px, 2.3vw, 10px); letter-spacing: .18em; text-transform: uppercase;
  color: rgba(67,45,55,.75);
}
.countdown-complete {
  grid-column: 1 / -1;
  color: var(--maroon);
  font-size: clamp(20px, 5vw, 28px);
}

.scroll-hint {
  margin-top: 4px;
  display: grid; justify-items: center; gap: 6px;
  font-family: var(--serif-display);
  font-size: 10.5px; letter-spacing: .13em; text-transform: none;
  color: var(--maroon);
  text-shadow: none;
}
.chev {
  width: 10px; height: 10px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  animation: chev-drop 1.6s ease-in-out infinite;
}
@keyframes chev-drop {
  0%,100% { transform: translateY(0) rotate(45deg); opacity: .5; }
  50%     { transform: translateY(7px) rotate(45deg); opacity: 1; }
}

/* ═══════════════ SHARED SECTION CHROME ═══════════════ */
section { position: relative; z-index: 5; }
#events, #blessings, #venue {
  padding: 72px 22px 64px;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(200,81,131,.10), transparent 55%),
    var(--ivory);
  overflow: hidden;                 /* decor bleeds are clipped, no sideways scroll */
}
#sanctum {
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(200,81,131,.10), transparent 55%),
    var(--ivory);
  /* NO overflow:hidden here — it would break the sticky stage */
}

/* ═══════════════ DECOR CUTOUTS ═══════════════════════════ */
.decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.decor.shown { opacity: 1; }
.decor-toran {
  top: -6px; left: -4%;
  width: 108%;
  transform-origin: 50% 0;
  animation: toran-sway 7s ease-in-out infinite;
}
.decor-toran-2 { animation-delay: 3.5s; }
@keyframes toran-sway {
  0%, 100% { transform: rotate(.5deg); }
  50%      { transform: rotate(-.5deg); }
}
.decor-elephant {
  left: -34px; bottom: 30px;
  width: clamp(150px, 42vw, 280px);
}
.decor-umbrella {
  right: -26px; top: 90px;
  width: clamp(90px, 26vw, 170px);
  rotate: 9deg;
  opacity: 0;
}
.decor-umbrella.shown { opacity: .92; }
.decor-lotus {
  right: -30px; bottom: -24px;
  width: clamp(150px, 44vw, 280px);
}
#events .sec-head, #venue .sec-head { margin-top: 34px; }
#event-cards, .venue-card, #scratch-wrap, .rsvp-block, footer { position: relative; z-index: 2; }

/* ═══════════════ EVENT CARDS ═══════════════ */
#event-cards {
  display: grid; gap: 20px;
  max-width: 480px; margin: 0 auto;
}
.event-card {
  --accent: var(--maroon);
  position: relative;
  border-radius: 18px;
  padding: 24px 22px 22px 88px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow);
  opacity: 0; transform: translateY(46px) scale(.96);
  transition: opacity .8s cubic-bezier(.2,.7,.3,1), transform .8s cubic-bezier(.2,.7,.3,1);
  overflow: hidden;
}
/* A fixed gold sheen keeps the cards luminous without pointer-driven repaints. */
.event-card::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 26%,
    rgba(253,218,232,.28) 50%,
    transparent 74%);
}
.event-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}
.event-card.shown {
  opacity: 1; transform: none;
}
.event-ico {
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.event-ico svg { width: 26px; height: 26px; }
.event-card.shown .event-ico { animation: ico-glow .72s cubic-bezier(.2,.85,.25,1) .18s both; }
@keyframes ico-glow {
  0% { transform: translateY(-50%) scale(.82); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  58% { transform: translateY(-50%) scale(1.08); box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 14%, transparent); }
  100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 12%, transparent); }
}
.event-name {
  font-family: var(--serif-display);
  font-size: 21px; font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
}
.event-line { font-style: italic; font-size: 15.5px; opacity: .85; margin: 3px 0 8px; }
.event-meta { font-size: 15px; line-height: 1.5; }
.event-meta b { font-weight: 600; }

/* ═══════════════ VENUE ═══════════════ */
.venue-card {
  max-width: 480px; margin: 0 auto;
  border-radius: 20px; overflow: hidden;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow);
}
.venue-art {
  height: 190px;
  background-size: cover;
  background-position: center 28%;
}
.venue-info { padding: 22px; text-align: center; }
.venue-info h3 {
  font-family: var(--serif-display);
  font-size: 21px; color: var(--maroon);
}
.venue-info p { margin: 6px 0 16px; font-size: 15.5px; opacity: .85; }

.btn-gold, .btn-maroon {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--serif-display);
  font-size: 14px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none;
  border: none;
  transition: transform .22s ease, box-shadow .22s ease;
}
.btn-gold {
  color: var(--maroon-deep);
  background: linear-gradient(120deg, var(--gold) 0%, #fbd4e3 50%, var(--gold) 100%);
  box-shadow: 0 6px 20px rgba(200,81,131,.45);
}
.btn-maroon {
  color: var(--gold-soft);
  background: linear-gradient(160deg, #5a1429, var(--maroon-deep));
  box-shadow: 0 8px 26px rgba(129,36,71,.4);
}
.btn-gold:active, .btn-maroon:active { transform: scale(.97); }

.rsvp-block {
  width: min(100%, 480px);
  margin: 44px auto 0;
  padding: 22px 18px;
  text-align: center;
  border: 1px solid var(--glass-stroke);
  border-radius: 20px;
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow);
}
.rsvp-deadline { font-style: italic; margin-bottom: 12px; opacity: .8; }

footer { text-align: center; margin-top: 64px; }
.foot-monogram { font-family: var(--serif-display); font-size: 30px; font-weight: 700; }
.foot-line { margin-top: 6px; font-size: 16px; font-style: italic; }
.foot-credit { margin-top: 18px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; opacity: .5; }

/* Native royal RSVP form (used until a real Google Form URL is configured) */
#rsvp-form { display: grid; gap: 16px; padding: 4px 4px 2px; }
.rf-label {
  display: grid; gap: 7px;
  font-family: var(--serif-display);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--maroon);
}
.rf-opt { text-transform: none; letter-spacing: 0; opacity: .6; font-family: var(--serif-body); }
.rf-input {
  font-family: var(--serif-body);
  font-size: 17px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(178,55,102,.28);
  background: #fffafd;
  color: var(--ink);
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.rf-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,81,131,.22);
}
textarea.rf-input { resize: none; }
.rf-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rf-chip { position: relative; }
.rf-chip input { position: absolute; opacity: 0; }
.rf-chip span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(178,55,102,.28);
  font-family: var(--serif-body);
  font-size: 15.5px;
  text-transform: none; letter-spacing: 0;
  color: var(--ink);
  background: #fffafd;
  transition: all .25s ease;
}
.rf-chip input:checked + span {
  background: linear-gradient(160deg, #5a1429, var(--maroon-deep));
  color: var(--gold-soft);
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(129,36,71,.3);
}
.rf-chip input:focus-visible + span {
  outline: 3px solid var(--gold-soft);
  outline-offset: 2px;
}
.rf-submit { justify-self: center; margin-top: 2px; }
#rsvp-done { text-align: center; padding: 26px 10px 18px; display: grid; gap: 10px; }
#rsvp-done.hidden { display: none; }
.rf-done-mark { font-size: 44px; animation: veil-breathe 2.8s ease-in-out infinite; }
#rsvp-done h4 { font-family: var(--serif-display); font-size: 22px; }
.rf-done-text { font-size: 16.5px; line-height: 1.5; opacity: .85; }

/* ═══════════════ GOLDEN SCROLL THREAD ════════════════════ */
#thread {
  position: fixed;
  top: 0; right: calc(env(safe-area-inset-right, 0px) + 5px);
  width: 2px; height: calc(var(--vh) * 100);
  z-index: 75;
  pointer-events: none;
  background: linear-gradient(rgba(200,81,131,.16), rgba(200,81,131,.16));
  opacity: 0;
  transition: opacity .8s ease;
}
#thread.on { opacity: 1; }
#thread::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(var(--gold-soft), var(--gold));
  transform-origin: top;
  transform: scaleY(var(--sp, 0));
}
#thread-lotus {
  position: absolute;
  right: -7px;
  top: -8px;
  transform: translateY(calc(var(--sp, 0) * var(--vh) * 100));
  font-size: 15px;
  font-style: normal;

}

/* ═══════════════ SOUND TOGGLE ═══════════════ */
#sound-toggle {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 80;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(243,179,202,.6);
  background: rgba(46,8,22,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 17px;
  display: grid; place-items: center;
  transition: opacity .3s ease;
}
#sound-toggle.muted { opacity: .55; filter: grayscale(1); }

/* ═══════════════ DESKTOP POLISH ═══════════════ */
@media (min-width: 760px) {
  .beat { padding-bottom: 11vh; }
  #event-cards { max-width: 560px; }
}

/* One-shot, compositor-only entrances keep the page lively without tying
   animation work to scroll position. */
.soft-reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(.985);
  transition: opacity .72s ease, transform .82s cubic-bezier(.2,.75,.25,1);
}
.soft-reveal.revealed {
  opacity: 1;
  transform: none;
}

/* True refraction is reserved for fine-pointer hardware. On phones the same
   glass hierarchy is painted as gradients, so the scrolling canvases stay fast. */
@media (pointer: fine) {
  .hero-copy-glass,
  .countdown-card,
  .event-card,
  .venue-card,
  .rsvp-block,
  .modal-sheet,
  .film-caption,
  .world-portal-action {
    -webkit-backdrop-filter: blur(12px) saturate(1.12);
    backdrop-filter: blur(12px) saturate(1.12);
  }
}

/* Coarse-pointer devices get the same visual hierarchy with fewer blended,
   repainted layers competing with scrolling. */
@media (pointer: coarse) {
  body::after { display: none; }
  .hero-stage::after {
    animation: none;
    mix-blend-mode: normal;
    opacity: .28;
    transform: none;
  }
  .crown-mono,
  .cd-cell,
  #rsvp-modal,
  #sound-toggle {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .event-card::after { display: none; }
  #finale::before { animation: none; }
  .gold-foil { animation: none; background-position: 50% 0; }
  .names { filter: none; }
  #hero.entered .names .ltr {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .chev,
  .decor-toran { animation: none; }
  .beat,
  .decor { will-change: auto; }
  .hero-copy-glass { box-shadow: 0 10px 28px rgba(129,36,71,.13), inset 0 1px 0 rgba(255,255,255,.86); }
}

/* ═══════════════ REDUCED MOTION ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  #hero .hero-side { opacity: .82; transform: translate3d(0, -50%, 0); }
  #sanctum { height: auto; }
  #sanctum-stage { position: relative; min-height: auto; padding: 80px 0; }
  .event-card { opacity: 1; transform: none; }
  .soft-reveal { opacity: 1; transform: none; }
  .names .ltr { opacity: 1 !important; transform: none !important; filter: none !important; }
  .sec-head .eyebrow { opacity: .95; letter-spacing: .34em; }
  .flourish path, .flourish circle { stroke-dashoffset: 0 !important; }
  .flourish .gem { opacity: 1 !important; transform: scale(1) rotate(45deg) !important; }
  #finale > * { opacity: 1; transform: none; }
  #portal-transition,
  body.portal-opening #portal-transition { clip-path: none; }
}

/* ═══════════════ FILM BANDS — cinematic loops ════════════ */
.film-band {
  position: relative;
  width: min(calc(100% - 40px), 640px);
  margin: 34px auto;
  border-radius: 18px;
  padding: 2px;                              /* the animated border thickness */
  background: linear-gradient(110deg,
    #9d315d, var(--gold) 20%, #f5c3d7 38%, var(--gold-soft) 50%,
    #fff5f9 62%, var(--gold) 80%, #9d315d);
  background-size: 100% 100%;
  box-shadow: 0 12px 36px rgba(129,36,71,.22);
}
.film-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 2162 / 1080;                 /* the film's native widescreen ratio */
  background: var(--maroon-deep);
}
.film-inner video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.film-inner::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(46,8,22,.58), transparent 48%);
}
.film-caption {
  position: absolute; left: 18px; bottom: 13px; z-index: 2;
  display: grid; gap: 3px;
  max-width: calc(100% - 36px);
  padding: 9px 13px 8px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(129,36,71,.64), rgba(24,5,13,.42));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 20px rgba(12,2,7,.18);
}
.film-eyebrow {
  font-family: var(--serif-display);
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-soft);
}
.film-line {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ivory);
  text-shadow: 0 1px 8px rgba(46,8,22,.8);
}

/* ═══════════════ FINALE FOOTER — the last impression ═════ */
#finale {
  position: relative;
  margin: 96px -22px -64px;
  padding: 15vh 26px calc(env(safe-area-inset-bottom, 0px) + 14vh);
  min-height: calc(var(--vh) * 94);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  overflow: hidden;
  /* the page sinks into night under a soft golden dome */
  border-radius: 100% 100% 0 0 / 64px 64px 0 0;
  border-top: 1px solid rgba(243,179,202,.7);
  background:
    radial-gradient(150% 110% at 50% 10%, #7A1F3D 0%, var(--maroon-deep) 50%, #22050F 100%);
}
#finale::before {
  content: "";
  position: absolute; inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 30% 35%, rgba(243,179,202,.16), transparent 70%),
    radial-gradient(30% 26% at 72% 60%, rgba(200,81,131,.13), transparent 70%),
    radial-gradient(26% 22% at 50% 85%, rgba(140,43,71,.35), transparent 70%);
  animation: finale-aurora 13s ease-in-out infinite alternate;
}
@keyframes finale-aurora {
  from { transform: translate(-3%, -2%) scale(1); }
  to   { transform: translate(3%, 3%) scale(1.12); }
}
#finale::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
#finale > * { position: relative; }
#finale > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.3,1);
}
#finale.shown > * { opacity: 1; transform: none; }
#finale.shown > :nth-child(1) { transition-delay: .1s; }
#finale.shown > :nth-child(2) { transition-delay: .35s; }
#finale.shown > :nth-child(3) { transition-delay: .75s; }
#finale.shown > :nth-child(4) { transition-delay: .95s; }
#finale.shown > :nth-child(5) { transition-delay: 1.15s; }
#finale.shown > :nth-child(6) { transition-delay: 1.35s; }
.finale-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--serif-display);
  font-size: 12.5px;
  letter-spacing: .46em;
  text-indent: .46em;
  text-transform: uppercase;
  color: rgba(255,250,252,.9);
}
.fe-rule {
  width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243,179,202,.8));
}
.fe-rule:last-child { transform: scaleX(-1); }
.finale-script {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(42px, 13vw, 82px);
  line-height: 1.25;
  padding: 0 10px 12px;
  margin: 10px 0 0;
  background: linear-gradient(175deg, #F6E7B6 8%, var(--gold-soft) 38%, var(--gold) 72%, #9a7a2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 22px rgba(243,179,202,.28));
}
.finale-heart {
  font-size: 26px;
  color: #E0454F;
  margin: 2px 0 18px;
  animation: heart-beat 1.9s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(224,69,79,.55));
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  24% { transform: scale(1); }
  36% { transform: scale(1.14); }
  48% { transform: scale(1); }
}
.finale-date {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(19px, 5.4vw, 25px);
  color: rgba(255,250,252,.95);
  margin-bottom: 16px;
}
.finale-tag {
  font-family: var(--serif-display);
  font-size: 12.5px;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: .92;
}
