/* ═══════════════════════════════════════════════════════════════════════
   Golden Hour · Save-the-Date Flyer — Beach Tropical Wedding
   Airy pastels · soft tropics · light textures · golden-hour light

   Structure:
     1. Fonts & design tokens
     2. Base / reset
     3. App shell (single-viewport, one active panel)
     4. Panel rail (generated by main.js)
     4b. Powered by Kundangi (full-width brand strip)
     5. Panel 1 · poster scene (sun, palms, waves, grain)
     6. Panel 1 · poster content
     6b. Footer brand placeholder
     7. Countdown
     8. Photo chip
     8b. Memories gallery (polaroid wall)
     8c. Photo lightbox
     8d. The Film (optional video embed)
     8e. The Invitation (optional flyer/banner showcase)
     8f. Free page (optional "anything else" panel)
     9. RSVP + guestbook panels
    10. Guestbook injected markup
    11. RSVP injected states (thank-you / closed)
    12. Personalisation
    13. Reduced motion
    14. Print
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Fonts & tokens ──────────────────────────────────────────────── */
@font-face {
  font-family: 'Butler';
  src: url('../fonts/Butler_Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Butler';
  src: url('../fonts/Butler_Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Butler';
  src: url('../fonts/Butler_ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Astagina';
  src: url('../fonts/AstaginaSignature.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-300.woff2') format('woff2'),
       url('../fonts/montserrat-300.woff') format('woff'),
       url('../fonts/montserrat-300.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-400.woff2') format('woff2'),
       url('../fonts/montserrat-400.woff') format('woff'),
       url('../fonts/montserrat-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-500.woff2') format('woff2'),
       url('../fonts/montserrat-500.woff') format('woff'),
       url('../fonts/montserrat-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* pastel palette — golden hour by the shore */
  --sun: #F5B459;
  --sun-soft: #FBD9A3;
  --coral: #EF8F74;
  --coral-soft: #F7C6B6;
  --blush: #FBE7DF;
  --blush-deep: #F5CFC4;
  --sand: #FBF3E6;
  --seafoam: #BFE2D2;
  --aqua: #86C8BC;
  --aqua-deep: #5FA89C;
  --ink: #28534F;          /* deep sea-glass text */
  --ink-soft: #5E8580;
  --ink-faint: #93AAA6;
  --white: #FFFDF9;
  --line: rgba(40, 83, 79, 0.14);
  --shadow-soft: 0 18px 44px -20px rgba(40, 83, 79, 0.35);
  --shadow-card: 0 24px 60px -28px rgba(40, 83, 79, 0.45);

  --font-script: 'Astagina', 'Snell Roundhand', 'Brush Script MT', cursive;
  --font-serif: 'Butler', 'Didot', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 22px;
  --gutter: clamp(18px, 5vw, 44px);
}

/* ── 2. Base ────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
  background: var(--blush);
}
h1, h2, h3, p, figure, ul { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; }
a { color: var(--aqua-deep); }

/* hidden attr must always win (personalisation slot, rail before build) */
[hidden] { display: none !important; }

/* opt-out for photo features (and any panel): add data-hide to a
   .photo-chip figure, a .free-figure or a .panel section to hide it
   entirely. main.js also excludes data-hide panels from the rail, so
   the feature disappears cleanly without deleting markup. */
.panel[data-hide], .photo-chip[data-hide], .free-figure[data-hide] { display: none !important; }

::selection { background: var(--sun-soft); color: var(--ink); }

/* focus visibility everywhere (keyboard users) */
:focus-visible {
  outline: 2px solid var(--aqua-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── 3. App shell ─────────────────────────────────────────────────────
   With .js: one fixed viewport; only the active panel is visible and
   scrolls internally (the shell engages only once main.js adds
   html.app-ready — if JS never runs, panels stack and the page scrolls — content is never locked away. */
.app { min-height: 100vh; min-height: 100dvh; }

.app-ready .app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.panel-stack { flex: 1 1 auto; }

.app-ready .panel-stack {
  position: relative;
  overflow: hidden;
}

/* default (no-JS / print): panels stack, fully visible */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* JS shell: panels are stacked absolutely; the active one scrolls */
.app-ready .panel {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    visibility 0s linear 0.45s;
}
.app-ready .panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    visibility 0s linear 0s;
  z-index: 1;
}

/* safe area for notched phones on the scrollable panels */
.app-ready .panel { padding-bottom: env(safe-area-inset-bottom); }

/* the poster panel: scene fixed, content scrolls over it */
.app-ready .panel-poster { overflow: hidden; padding-bottom: 0; }
.app-ready .panel-poster .poster {
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── 4. Panel rail ──────────────────────────────────────────────────── */
.panel-nav {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px 10px;
  background: rgba(255, 253, 249, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

/* Inner scroller (built by main.js). On phones the rail stays ONE row
   with prev/next steppers flanking it, instead of wrapping into two or
   three rows that would eat the invitation's fixed viewport. */
.panel-nav-track {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

/* prev/next steppers — phones only; built by main.js */
.pn-arrow { display: none; }

.panel-nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-height: 40px;   /* comfortable touch target */
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.25s ease, background 0.25s ease;
}
.panel-nav-btn .pn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.panel-nav-btn:hover { color: var(--ink); background: rgba(40, 83, 79, 0.06); }
.panel-nav-btn.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--coral), var(--sun));
  box-shadow: 0 8px 18px -8px rgba(239, 143, 116, 0.8);
}
.panel-nav-btn.is-active .pn-dot { opacity: 1; transform: scale(1.35); }

/* ── Rail on phones ───────────────────────────────────────────────
   ONE inline row — prev/next steppers flank a swipeable tab strip.
   Edge fades hint at more tabs, scroll-snap settles a tab under the
   thumb, and main.js keeps the active tab centred and greys a stepper
   out at either end of the invitation. */
@media (max-width: 700px) {
  .panel-nav {
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
  }

  /* prev / next — one tap along the invitation */
  .pn-arrow {
    display: inline-flex;
    flex: 0 0 auto;
    appearance: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.65);
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 0.25s ease, background 0.25s ease, transform 0.15s ease;
  }
  .pn-arrow svg { width: 16px; height: 16px; display: block; }
  .pn-arrow:hover { background: rgba(40, 83, 79, 0.08); }
  .pn-arrow:active { transform: scale(0.94); }
  .pn-arrow[disabled] { opacity: 0.32; cursor: default; pointer-events: none; }

  /* the tab strip squeezes between the two steppers */
  .panel-nav-track {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;   /* swiping the rail never scrolls the panel */
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 14px;
    padding: 2px 14px;
    gap: 4px;
  }
  .panel-nav-track::-webkit-scrollbar { display: none; }

  .panel-nav-btn {
    flex: 0 0 auto;
    scroll-snap-align: center;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    padding: 8px 11px;
    min-height: 42px;
  }

  /* fade hints live on the nav so they never scroll away — tucked
     beside the steppers, not over them */
  .panel-nav::before,
  .panel-nav::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
  }
  .panel-nav::before {
    left: 62px;
    background: linear-gradient(90deg, rgba(255, 253, 249, 0.97) 25%, rgba(255, 253, 249, 0));
  }
  .panel-nav::after {
    right: 62px;
    background: linear-gradient(-90deg, rgba(255, 253, 249, 0.97) 25%, rgba(255, 253, 249, 0));
  }
  .panel-nav.is-off-left::before,
  .panel-nav.is-off-right::after { opacity: 1; }
}

/* very narrow phones — tighten the pills a touch more */
@media (max-width: 360px) {
  .panel-nav { padding-inline: 8px; }
  .panel-nav-track { padding-inline: 10px; scroll-padding-inline: 10px; }
  .panel-nav::before { left: 58px; }
  .panel-nav::after { right: 58px; }
  .panel-nav-btn { padding: 8px 9px; letter-spacing: 0.08em; }
}

/* ── 4b. Powered by Kundangi (full-width brand strip) ─────────────────
   Sits at the very bottom of the shell, below the rail, on every
   panel. The engine swaps the token inside .link-footer for the
   platform name at render; the cockpit's Free Powered By field can
   override the whole line. The safe-area inset lives here because the
   strip is the last element on screen (the rail above it needs none). */
.powered-by {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.powered-by .link-footer {
  font-family: var(--font-script);
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--coral);
}

/* ── 5. Poster scene ────────────────────────────────────────────────── */
.panel-poster {
  background:
    radial-gradient(120% 90% at 50% 108%, var(--blush) 0%, var(--blush-deep) 34%, transparent 70%),
    linear-gradient(180deg, #FDEBDC 0%, var(--blush) 34%, #F6D7CC 100%);
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* golden sun + halo */
.sun {
  position: absolute;
  left: 50%;
  top: 20%;
  width: min(56vw, 280px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, #FFF7E6 0%, #FBE3AC 52%, #F6BE72 100%);
  box-shadow:
    0 0 46px 14px rgba(246, 190, 114, 0.35),
    0 0 130px 70px rgba(251, 219, 163, 0.28);
}

.birds {
  position: absolute;
  top: 11%;
  right: 12%;
  width: 120px;
  height: 30px;
  opacity: 0.9;
}

/* palm silhouettes — soft, light texture against the sky */
.palm { position: absolute; color: rgba(40, 83, 79, 0.16); }
.palm--left {
  top: -6%;
  left: -14%;
  width: min(52vw, 300px);
  height: auto;
  color: rgba(40, 83, 79, 0.20);
}
.palm--right {
  bottom: -2%;
  right: -16%;
  width: min(46vw, 260px);
  height: auto;
  transform: scaleX(-1);
  color: rgba(40, 83, 79, 0.13);
}

/* layered shore waves */
.waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(110px, 22dvh, 200px);
  pointer-events: none;
}
.wave {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
}
.wave--back { top: 0;  color: var(--blush-deep); opacity: 0.9; }
.wave--mid  { top: 10%; color: var(--seafoam);    opacity: 0.85; }
.wave--front{ top: 22%; color: var(--aqua);       opacity: 0.95; }
.wave path { fill: currentColor; }

/* gentle drift so the sea feels alive (disabled for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .wave--back { animation: drift 26s ease-in-out infinite alternate; }
  .wave--mid  { animation: drift 22s ease-in-out infinite alternate-reverse; }
  .wave--front{ animation: drift 18s ease-in-out infinite alternate; }
}
@keyframes drift {
  from { transform: translateX(0) scaleX(1.01); }
  to   { transform: translateX(-1.4%) scaleX(1.03); }
}

/* film grain — the "light texture" (SVG turbulence, tiny & local) */
.grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.06'/></svg>");
}

/* ── 6. Poster content ──────────────────────────────────────────────── */
.poster {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(26px, 6dvh, 52px) var(--gutter) clamp(40px, 9dvh, 84px);
  max-width: 520px;
  margin: 0 auto;
  min-height: 100%;
}

.poster-head { margin-bottom: clamp(10px, 2.6dvh, 22px); }

.eyebrow {
  font-size: clamp(0.68rem, 2vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rule {
  display: block;
  width: 88px;
  height: 1px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--coral-soft), var(--sun-soft), transparent);
}

.couple-names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3.4rem, 13.5vw, 6.4rem);
  line-height: 1.08;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-shadow: 0 10px 30px rgba(40, 83, 79, 0.12);
}
.couple-names .amp {
  display: inline-block;
  font-size: 0.52em;
  color: var(--coral);
  vertical-align: 0.28em;
  margin: 0 0.04em;
  font-family: var(--font-script);
}
.name--first { display: inline-block; }
.name--second { display: inline-block; }

.tagline {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.98rem, 3.4vw, 1.32rem);
  color: var(--ink-soft);
  margin-top: 6px;
}

.poster-date { margin-top: clamp(14px, 3.6dvh, 30px); }
.date-line {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  line-height: 1.2;
  color: var(--ink);
}
.place-line {
  margin-top: 6px;
  font-size: clamp(0.72rem, 2.4vw, 0.86rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--aqua-deep);
}

/* ── 6b. Footer brand placeholder ─────────────────────────────────────
   The platform swaps the text/logo for the host's brand. Kept light:
   a thin rule, small caps, a soft sun mark. */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: clamp(20px, 4.6dvh, 34px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.footer-brand-mark {
  display: inline-flex;
  color: var(--coral);
}
.footer-brand-mark svg {
  width: 15px;
  height: 15px;
}

/* ── 7. Countdown ─────────────────────────────────────────────────────
   Hidden by default; main.js adds .is-live once the platform has filled
   the cells with a real deadline (so guests never see a flash of zeros). */
.countdown-wrap { margin-top: clamp(16px, 4dvh, 32px); display: none; }
.countdown-wrap.is-live { display: block; }
.countdown-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.countdown {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.6);
  border: 1px solid rgba(255, 253, 249, 0.9);
  box-shadow: var(--shadow-soft);
}
.count-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.4ch;
}
.count-cell > span:first-child {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.count-caption {
  margin-top: 4px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.count-sep { color: var(--coral); font-weight: 500; }

/* ── 8. Photo chip ──────────────────────────────────────────────────── */
.photo-chip {
  position: relative;
  margin: clamp(18px, 4.4dvh, 34px) auto 0;
  width: min(66vw, 230px);
  padding: 10px 10px 8px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  transform: rotate(-2deg);
}
.photo-chip-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
}
.photo-chip-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 74px;
  height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(251, 217, 163, 0.75);
  box-shadow: 0 2px 6px rgba(40, 83, 79, 0.12);
}
.photo-chip-note {
  margin-top: 8px;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.photo-chip-link { display: block; border-radius: 5px; }

/* ── 8b. Memories gallery (polaroid wall) ──────────────────────────── */
.memories-head { text-align: center; margin-bottom: 26px; }
.memories-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  color: var(--ink);
  margin-top: 10px;
}
.memories-description {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3vw, 1rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
}

.moments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: clamp(14px, 3.6vw, 24px);
  margin-top: 30px;
}

.moment {
  position: relative;
  margin: 6px 0 0;
  padding: 8px 8px 7px;
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  transform: rotate(-1.6deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.moment:nth-child(even) { transform: rotate(1.6deg); }
.moment:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 26px 50px -22px rgba(40, 83, 79, 0.5);
}
.moment-link { display: block; border-radius: 4px; }
.moment-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.moment-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 58px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(251, 217, 163, 0.8);
  box-shadow: 0 2px 6px rgba(40, 83, 79, 0.12);
  pointer-events: none;
}
.moment:nth-child(even) .moment-tape {
  transform: translateX(-50%) rotate(2deg);
}
.moment-caption {
  margin-top: 8px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 8c. Photo lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 62, 58, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}
.lightbox-stage {
  position: relative;
  max-width: min(92vw, 860px);
  max-height: 90dvh;
  margin: 0;
  padding: 14px 14px 10px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 34px 90px -24px rgba(0, 0, 0, 0.55);
  /* becomes the pan surface when the photo is zoomed */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}
/* zoomed state: the photo grows to 1.8× its fitted size and the stage
   scrolls, so the guest can pan with a finger or the scroll wheel */
.lightbox.is-zoomed .lightbox-img {
  width: 180%;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.lightbox-caption {
  margin-top: 10px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  z-index: 2;
}
.lightbox-close:hover { background: var(--blush); }

/* gentle hint bar under the photo: zoom hint + open-full-size link */
.lightbox-hint {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 253, 249, 0.9);
  text-align: center;
  pointer-events: none;
}
.lightbox-hint .lightbox-open {
  pointer-events: auto;
  color: var(--sun-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 217, 163, 0.55);
  padding-bottom: 2px;
}
.lightbox-hint .lightbox-open:hover { color: var(--white); }

/* ── 8d. The Film — optional video embed ───────────────────────────── */
.film-head { text-align: center; margin-bottom: 26px; }
.film-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  color: var(--ink);
  margin-top: 10px;
}
.film-description {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3vw, 1rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
}
.film-figure { margin: 30px auto 0; }
.film-embed {
  position: relative;
  width: 100%;
  /* cap by height so a tall phone screen never inflates the video;
     the 16/9 ratio is preserved (width caps first on phones) */
  max-width: calc(56vh * 16 / 9);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 253, 249, 0.95);
  box-shadow: var(--shadow-card);
  /* warm golden-hour fallback while the embed loads */
  background:
    radial-gradient(circle at 50% 40%, rgba(246, 190, 114, 0.28), transparent 62%),
    linear-gradient(180deg, var(--blush-deep) 0%, var(--seafoam) 100%);
}
.film-embed iframe,
.film-embed video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.film-cap {
  margin-top: 12px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.film-open {
  margin-top: 14px;
  text-align: center;
}
.film-open a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid var(--aqua-deep);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aqua-deep);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.film-open a:hover { background: var(--aqua-deep); color: var(--white); }

/* ── 8e. The Invitation — optional flyer/banner showcase ───────────── */
.invitation-head { text-align: center; margin-bottom: 26px; }
.invitation-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  color: var(--ink);
  margin-top: 10px;
}
.invitation-description {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3vw, 1rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
}
.flyer-figure {
  position: relative;
  margin: 30px auto 0;
  max-width: min(78vw, 360px);
  padding: 12px 12px 10px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  transform: rotate(1.2deg);
}
.flyer-link { display: block; border-radius: 6px; }
.flyer-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.flyer-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 74px;
  height: 24px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(251, 217, 163, 0.8);
  box-shadow: 0 2px 6px rgba(40, 83, 79, 0.12);
  pointer-events: none;
}
.flyer-cap {
  margin-top: 10px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 8f. Free page — optional "anything else" panel ─────────────────── */
.free-head { text-align: center; margin-bottom: 26px; }
.free-head-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  color: var(--ink);
  margin-top: 10px;
}
.free-head-lead {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3vw, 1rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
}

.free-blocks {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3.4vw, 24px);
  margin-top: 30px;
}

.free-block {
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(255, 253, 249, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 4.6vw, 30px);
}

.free-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 4.6vw, 1.7rem);
  color: var(--ink);
}
.free-content {
  margin-top: 10px;
  font-size: clamp(0.92rem, 3vw, 1rem);
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 52ch;
}
.free-content p + p { margin-top: 10px; }

.free-figure {
  position: relative;
  margin: 18px 0 0;
  padding: 8px 8px 7px;
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  transform: rotate(-1.2deg);
  max-width: min(70vw, 260px);
}
.free-link { display: block; border-radius: 4px; }
.free-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.free-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 58px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(251, 217, 163, 0.8);
  box-shadow: 0 2px 6px rgba(40, 83, 79, 0.12);
  pointer-events: none;
}
.free-cap {
  margin-top: 8px;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 9. RSVP + guestbook panels ─────────────────────────────────────── */
.panel-poster ~ .panel { /* non-poster panels share the soft paper ground */
  background:
    radial-gradient(140% 60% at 50% -10%, #FDEDE0 0%, rgba(253, 237, 224, 0) 62%),
    linear-gradient(180deg, var(--blush) 0%, #FBF1E7 100%);
}
.panel-scroll {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(30px, 7dvh, 60px) var(--gutter) calc(60px + env(safe-area-inset-bottom));
}

.rsvp-head, .guestbook-head { text-align: center; margin-bottom: 26px; }
.rsvp-title, .guestbook-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  color: var(--ink);
  margin-top: 10px;
}
.rsvp-description, .guestbook-description {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3vw, 1rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
}

/* personalised greeting chip */
.guest-greeting {
  margin-top: 16px;
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.75);
  border: 1px dashed var(--coral-soft);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--coral);
  font-size: 0.95rem;
}

/* ── RSVP form card ─────────────────────────────────────────────────── */
.rsvp-card {
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(255, 253, 249, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 5vw, 34px);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.label-hint {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 300;
  color: var(--ink-faint);
  font-size: 0.8em;
}

.form-control {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(40, 83, 79, 0.16);
  border-radius: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control::placeholder { color: var(--ink-faint); }
.form-control:focus {
  outline: none;
  border-color: var(--aqua-deep);
  box-shadow: 0 0 0 3px rgba(134, 200, 188, 0.35);
}
textarea.form-control { resize: vertical; min-height: 64px; }

/* inline validation messages (filled by the platform's rsvp_user.js) */
.error {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #C2573F;
  font-weight: 400;
  min-height: 1em;
}

.rsvp-submit-row { margin-top: 6px; text-align: center; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 15px 34px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn--primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--coral), var(--sun));
  box-shadow: 0 14px 28px -12px rgba(239, 143, 116, 0.85);
}
.btn--primary:hover { transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* the platform's inline .loading node inside #rsvp-form */
#rsvp-form .loading,
.loading-guestbook {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 14px 0 2px;
  letter-spacing: 0.06em;
}

/* ── 10. Guestbook injected markup ──────────────────────────────────── */
.guestbook-body { margin-top: 4px; }

/* injected form (#guestbookForm) — style by id so we never touch the
   template's own RSVP form styles */
#guestbookForm {
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(255, 253, 249, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 5vw, 34px);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#guestbookForm .form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
#guestbookForm .form-control { /* inherited .form-control above */ }
#guestbookForm button[type="submit"] {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: block;
  margin: 18px auto 0;
  color: var(--white);
  background: linear-gradient(135deg, var(--aqua-deep), var(--seafoam));
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 14px 30px;
  border-radius: 999px;
  box-shadow: 0 14px 28px -14px rgba(95, 168, 156, 0.9);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#guestbookForm button[type="submit"]:hover { transform: translateY(-1px); }
#guestbookForm button[type="submit"]:disabled { opacity: 0.55; }

/* reCAPTCHA mount inside the injected form */
.guestbook-chapta { margin-top: 14px; min-height: 8px; }

/* message list (inline max-height from the platform is softened) */
#comments-container.guestbook-wrap {
  margin-top: 26px !important;
  max-height: none !important;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.guestbook-entry {
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 3px;
}
.guestbook-entry p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 4px; }
.guestbook-entry small { font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.04em; }

.more-guestbook-wrap { text-align: center; margin-top: 18px; }
#load-more {
  appearance: none;
  border: 1px solid var(--aqua-deep);
  background: transparent;
  color: var(--aqua-deep);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
#load-more:hover { background: rgba(95, 168, 156, 0.12); }

/* ── 11. RSVP injected states (thank-you / closed) ──────────────────── */
.thank-you-message {
  text-align: center;
  padding: 30px 10px;
  font-family: var(--font-sans);
}
.thank-you-message h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.thank-you-message p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 4px auto;
  max-width: 40ch;
}
.thank-you-message small {
  display: block;
  margin-top: 20px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* countdown cells that appear near the form are styled by §7 (same
   classes); here we only make sure a 0-padded grid reads clean */

/* ── 12. Personalisation ────────────────────────────────────────────── */
.live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 13. Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .app-ready .panel,
  .app-ready .panel.is-active {
    transition: none !important;
    transform: none !important;
  }
}

/* ── 14. Print ──────────────────────────────────────────────────────── */
@media print {
  .app-ready .app {
    display: block;
    height: auto;
    overflow: visible;
  }
  .app-ready .panel-stack { overflow: visible; }
  .app-ready .panel,
  .panel {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    page-break-after: always;
    break-after: page;
  }
  .panel:last-child { page-break-after: auto; break-after: auto; }
  .app-ready .panel-poster { overflow: visible; }
  .app-ready .panel-poster .poster {
    height: auto;
    overflow: visible;
  }
  .scene, .grain { display: none !important; }
  .lightbox { display: none !important; }
  .panel-nav, .powered-by, .live-region, .photo-chip-tape, .moment-tape { display: none !important; }
  body { background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
