/* ═════════════════════════════════════════════════════════════════════════
   OPEN ME · Greeting-Card Card (sealed envelope → opened two-page card)
   Mood: mail, handed over. A kraft envelope with wax seal, postmark and
   stamp on a warm linen desk; "Open it" folds the flap back and the cream
   two-page card rises out. Warm ink, terracotta seal, sage + mustard tape.
   Deck: 100dvh shell, one active panel scrolls.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── 1 · Design tokens ─────────────────────────────────────────────────── */
:root {
  /* the desk (warm ivory linen) */
  --desk:         #efe6d6;
  --desk-deep:    #e4d8c4;
  --desk-darker:  #d8c9b0;

  /* kraft envelope */
  --kraft:        #c89b6e;
  --kraft-2:      #bb8c5e;
  --kraft-deep:   #a3764c;
  --kraft-darker: #8a613d;

  /* card paper & ink */
  --paper:        #fdf9ee;
  --paper-2:      #f6efdd;
  --paper-3:      #e9ddc3;
  --ink:          #332e27;
  --ink-soft:     rgba(51, 46, 39, .78);
  --ink-muted:    rgba(51, 46, 39, .56);
  --ink-faint:    rgba(51, 46, 39, .32);
  --line:         rgba(51, 46, 39, .3);
  --line-soft:    rgba(51, 46, 39, .15);

  /* stationery accents */
  --terra:        #c4643f;
  --terra-deep:   #a34e2d;
  --terra-soft:   #d9865f;
  --mustard:      #d9a441;
  --mustard-deep: #ad7d1f;
  --sage:         #8aa58a;
  --sage-deep:    #6d8a70;
  --rose:         #c4788a;

  /* tape shades */
  --tape-sage:    rgba(138, 165, 138, .5);
  --tape-mustard: rgba(217, 164, 65, .45);
  --tape-rose:    rgba(196, 120, 138, .42);

  --danger:       #b03a2e;
  --ok:           #5f7f63;

  --font-hand:   "Caveat", "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
  --font-script: "Great Vibes", "Segoe Script", "Brush Script MT", cursive;
  --font-serif:  "Lora", Georgia, "Times New Roman", serif;
  --font-mono:   "Courier Prime", "Courier New", monospace;

  --radius: 12px;
  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --shadow-envelope: 0 30px 70px rgba(74, 56, 30, .35), 0 4px 12px rgba(74, 56, 30, .18);
  --shadow-card: 0 34px 80px rgba(74, 56, 30, .3), 0 3px 10px rgba(74, 56, 30, .14);
  --shadow-sheet: 0 18px 50px rgba(74, 56, 30, .26), 0 2px 8px rgba(74, 56, 30, .12);
}

/* ── 2 · Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }

button { font-family: inherit; }

::selection { background: rgba(196, 100, 63, .26); color: var(--ink); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── 3 · Deck shell — 100dvh, only the active panel scrolls ───────────── */
.site {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--desk);
}

.deck { position: absolute; inset: 0; }

.panel {
  position: absolute;
  inset: 0;
  overflow: hidden;                    /* inactive panels do not scroll */
  opacity: 0;
  visibility: hidden;
  transform: scale(.99) translateY(12px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility 0s linear .5s;
  pointer-events: none;
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
  pointer-events: auto;
  overflow-y: auto;                    /* ← only the active panel scrolls */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--kraft-darker) transparent;
}

.panel.is-active::-webkit-scrollbar { width: 8px; }
.panel.is-active::-webkit-scrollbar-thumb { background: var(--kraft-darker); border-radius: 8px; }
.panel.is-active::-webkit-scrollbar-track { background: transparent; }

.panel-scroll {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 88px) clamp(18px, 5vw, 36px) clamp(72px, 12vh, 110px);
}

/* ── 4 · Section rail (wax-seal dots + visible text labels) ───────────── */
.deck-nav {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 12px;
  background: var(--tape-sage);
  box-shadow: 0 4px 14px rgba(74, 56, 30, .22);
  border: 1px solid rgba(255, 255, 255, .35);
}

/* each item: seal dot on the right, TEXT label always visible on the left
   (no hover-only pills — the navigation is legible at a glance). */
.deck-nav button {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 9px;
  padding: 4px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background .2s;
}

.deck-nav button::before {              /* the seal dot */
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--kraft-deep);
  background: radial-gradient(circle at 35% 30%, #fff, var(--paper) 55%, var(--paper-3));
  transition: transform .25s var(--ease-out), background .25s, border-color .25s;
}

.deck-nav-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color .2s;
}

.deck-nav button:hover { background: rgba(255, 255, 255, .35); }
.deck-nav button:hover .deck-nav-label { color: var(--ink); }

.deck-nav button:focus-visible {
  outline: 3px solid rgba(196, 100, 63, .5);
  outline-offset: 2px;
}

.deck-nav button[aria-current="true"] .deck-nav-label {
  color: var(--terra-deep);
  font-weight: 700;
}

.deck-nav button[aria-current="true"]::before {
  background: radial-gradient(circle at 35% 30%, #ffb28a, var(--terra) 45%, var(--terra-deep) 90%);
  border-color: var(--terra-deep);
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(196, 100, 63, .22);
}

/* ── 5 · Cover — the desk and the sealed envelope ─────────────────────── */
.desk {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 9vh, 90px) clamp(14px, 4vw, 40px);
  background:
    radial-gradient(110% 90% at 50% 0%, rgba(255, 255, 255, .28), transparent 55%),
    repeating-linear-gradient(0deg, rgba(51, 46, 39, .03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(51, 46, 39, .025) 0 1px, transparent 1px 4px),
    var(--desk);
  overflow: hidden;
}

.desk-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(74, 56, 30, .22);
}

.mail-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 4.5vh, 38px);
  width: 100%;
}

.mail-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
}

/* ── 6 · The envelope ─────────────────────────────────────────────────── */
.envelope {
  position: relative;
  width: min(560px, 94vw);
  height: clamp(300px, 54vh, 430px);
  perspective: 1400px;
  filter: drop-shadow(0 18px 30px rgba(74, 56, 30, .3));
}

/* the letter waiting inside — rises out when the flap opens */
.envelope-card {
  position: absolute;
  top: 4%;
  left: 6%;
  right: 6%;
  bottom: 16%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: clamp(18px, 3.4vw, 32px);
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(51, 46, 39, .026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  box-shadow: 0 8px 22px rgba(74, 56, 30, .28);
  transform: translateY(34%) scale(.985);
  opacity: 0;
  transition: transform .6s var(--ease-out), opacity .45s var(--ease-out);
}

.envelope.is-open .envelope-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.peek-letterhead {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
}

.peek-letterhead span { color: var(--terra); }

.peek-greeting {
  font-family: var(--font-script);
  font-size: clamp(26px, 4.4vw, 34px);
  color: var(--terra);
  text-align: center;
  line-height: 1.15;
}

.peek-headline {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 44px);
  line-height: 1.05;
  color: var(--ink);
  text-align: center;
}

/* the pocket: kraft face with address, postmark, stamp, tape.
   NOTE: no z-index here on purpose. The flap (z-index 4) must sit on top
   of the kraft face, but the stamp and postmark are front-face mail marks
   that have to stay visible over the flap — so they need z-index 5 (see
   below). Giving the pocket a z-index would create a stacking context and
   trap them under the flap; leaving it at auto lets them reach above it. */
.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 6px 6px 10px 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(180deg, var(--kraft) 0%, var(--kraft-2) 100%);
  box-shadow: inset 0 0 0 1px rgba(51, 46, 39, .14);
  overflow: hidden;
}

/* address block */
.envelope-to {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  transform: translateY(-50%);
  text-align: center;
  padding: 0 18%;
}

.envelope-to-label {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(20px, 3.6vw, 26px);
  color: rgba(255, 250, 240, .72);
  margin-bottom: 2px;
}

.envelope-to-line {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(15px, 2.6vw, 20px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff8ec;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.envelope-to-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.9vw, 13.5px);
  color: rgba(255, 250, 240, .72);
  margin-top: 4px;
  line-height: 1.4;
}

/* postmark, top left. z-index 5 sits it above the flap (4) so the mail mark
   reads on the sealed envelope; it fades out when the card rises so it never
   floats on top of the letter. */
.postmark {
  position: absolute;
  top: 12%;
  left: 7%;
  z-index: 5;
  width: clamp(78px, 15vw, 108px);
  height: clamp(78px, 15vw, 108px);
  border: 2.5px dashed rgba(51, 46, 39, .4);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transform: rotate(-8deg);
  color: rgba(51, 46, 39, .62);
  transition: opacity .35s var(--ease-out);
}

.postmark-town {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.6vw, 11px);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
}

.postmark-date {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.6vw, 11px);
  letter-spacing: .1em;
  text-align: center;
}

/* postage stamp, top right. z-index 5 — see .postmark note. */
.stamp {
  position: absolute;
  top: 9%;
  right: 7%;
  z-index: 5;
  width: clamp(64px, 12vw, 88px);
  height: clamp(74px, 14vw, 102px);
  background: #fffdf4;
  box-shadow: 0 3px 8px rgba(74, 56, 30, .3);
  padding: 6px;
  transform: rotate(5deg);
  transition: opacity .35s var(--ease-out);
}

.stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  border: 1.5px dashed var(--terra);
}

.stamp-mark {
  font-size: clamp(18px, 3.6vw, 28px);
  color: var(--terra);
  line-height: 1;
}

.stamp-word {
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 1.4vw, 10px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* washi tape across the lower edge */
.envelope-tape {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 9%;
  height: 26px;
  border-radius: 2px;
  background: var(--tape-mustard);
  box-shadow: 0 2px 6px rgba(74, 56, 30, .2);
  transform: rotate(-1.2deg);
}

/* the flap, folded down — opens on "Open it" */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  z-index: 4;
  transform-origin: top center;
  transform: rotateX(0);
  backface-visibility: hidden;
  transition: transform .6s var(--ease-out);
}

/* the triangular kraft face. The clip-path lives on its own box (not on
   .envelope-flap itself) so the wax seal — a sibling of this face, not a
   descendant — is not clipped away by the polygon and can overhang the
   flap tip, sitting on top of the envelope as it should. */
.envelope-flap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, .14), transparent 55%),
    linear-gradient(180deg, var(--kraft-2) 0%, var(--kraft-deep) 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.envelope.is-open .envelope-flap {
  transform: rotateX(180deg);
}

/* once the card rises out, the stamp & postmark would sit on top of the
   letter — fade them so the opened card reads cleanly. */
.envelope.is-open .postmark,
.envelope.is-open .stamp {
  opacity: 0;
}

/* wax seal on the flap tip */
.seal {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  width: clamp(56px, 10vw, 76px);
  height: clamp(56px, 10vw, 76px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #ffb28a, var(--terra) 40%, var(--terra-deep) 78%, #8a3f22 100%);
  box-shadow: 0 4px 10px rgba(74, 56, 30, .45), inset 0 -3px 6px rgba(0, 0, 0, .22);
  display: grid;
  place-items: center;
}

.seal::after {                          /* embossed ring */
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 250, 240, .5);
  box-shadow: inset 0 2px 3px rgba(255, 250, 240, .3), inset 0 -2px 3px rgba(0, 0, 0, .2);
}

.seal-monogram {
  position: relative;
  z-index: 1;
  font-family: var(--font-script);
  font-size: clamp(20px, 3.8vw, 28px);
  color: rgba(255, 250, 240, .92);
  text-shadow: 0 1px 2px rgba(74, 56, 30, .5);
}

/* CTA row under the envelope */
.mail-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* coffee ring, desk detail */
.coffee-ring {
  position: absolute;
  left: clamp(20px, 7vw, 90px);
  bottom: clamp(24px, 7vh, 70px);
  width: clamp(90px, 12vw, 130px);
  height: clamp(90px, 12vw, 130px);
  border: 6px solid rgba(74, 56, 30, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 56, 30, .05);
  transform: rotate(-12deg);
  pointer-events: none;
}

/* ── 7 · Buttons (handwritten paper tags) ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 10px 24px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s var(--ease-out), box-shadow .18s, background .18s, color .18s;
}

.btn:hover { transform: translateY(-2px) rotate(-.5deg); }
.btn:active { transform: translateY(0) rotate(0); }

.btn:focus-visible {
  outline: 3px solid rgba(196, 100, 63, .5);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--terra);
  color: #fff8ec;
  box-shadow: 0 6px 16px rgba(196, 100, 63, .45);
}

.btn--primary:hover { background: var(--terra-deep); box-shadow: 0 8px 20px rgba(196, 100, 63, .55); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn-arrow { font-size: .9em; }

/* ── 8 · The opened greeting card (two pages) ─────────────────────────── */
.greeting-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(740px, 96vw);
  margin: 0 auto;
  background:
    repeating-linear-gradient(0deg, rgba(51, 46, 39, .026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  overflow: hidden;
}

/* the fold line between the two pages */
.card-crease {
  position: absolute;
  top: 3%;
  bottom: 3%;
  left: 50%;
  width: 2px;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(51, 46, 39, .22) 10%, rgba(51, 46, 39, .22) 90%, transparent);
}

.card-crease::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 14px;
  background: linear-gradient(90deg, rgba(51, 46, 39, .07), transparent);
}

.card-page {
  position: relative;
  padding: clamp(26px, 4.6vh, 52px) clamp(20px, 3.6vw, 42px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-page--details {
  background: rgba(255, 255, 255, .38);
  border-left: 1px solid var(--line-soft);
}

/* message page */
.card-letterhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(51, 46, 39, .14);
}

.letterhead {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.letterhead-mark { color: var(--terra); font-size: 13px; }

.card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.card-greeting {
  font-family: var(--font-script);
  font-size: clamp(28px, 4.6vw, 38px);
  line-height: 1.15;
  color: var(--terra);
}

.greeting-name { white-space: nowrap; overflow-wrap: anywhere; }

.card-headline {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1.02;
  color: var(--ink);
}

.card-headline-line { display: block; }
.card-headline-line:nth-child(even) { color: var(--terra); }

.card-message p {
  font-size: clamp(15.5px, 1.9vw, 17.5px);
  line-height: 1.68;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.card-message p:last-child { margin-bottom: 0; }

.card-sign {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.sign-love {
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--terra);
}

.sign-names {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.honoree-amp {
  font-family: var(--font-script);
  color: var(--terra);
  font-size: .85em;
  padding: 0 2px;
}

/* details page */
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--terra-deep);
}

.page-title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 6px;
}

.particulars {
  border: 1.5px dashed rgba(51, 46, 39, .32);
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
  overflow: hidden;
}

.particular-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(51, 46, 39, .12);
}

.particular-row:last-child { border-bottom: 0; }

.particular-row dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra-deep);
  padding-top: 3px;
}

.particular-row dd {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.particular-row dd small {
  display: inline;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.particular-place-wrap { display: block; }
.particular-line { display: block; }

.map-link {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terra-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.map-link:hover { color: var(--ink); }
.map-link[hidden] { display: none; }

.house-note {
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-soft);
  padding: 12px 15px;
  border-radius: 8px;
  background: rgba(138, 165, 138, .2);
  border: 1px solid rgba(138, 165, 138, .4);
}

.house-note strong { color: var(--sage-deep); font-style: normal; font-weight: 600; }

.page-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* foot under the card */
.panel-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(24px, 4.4vh, 40px);
}

/* ── 8.5 · Photos — optional keepsake polaroid + banner flyer + gallery ─
     All three are plain markup: delete <figure class="card-keepsake">,
     <figure class="banner-flyer"> or the whole <section data-panel=
     "memories"> to hide them. Every photo slot carries [data-lightbox]:
     the full-screen viewer with zoom is built by main.js whenever any
     slot exists. */
[data-lightbox] { cursor: zoom-in; }

[data-lightbox]:focus-visible {
  outline: 3px solid rgba(196, 100, 63, .5);
  outline-offset: 3px;
}

.card-keepsake {
  position: relative;
  width: min(232px, 74%);
  margin: 14px auto 2px;
  padding: 9px 9px 36px;              /* polaroid frame + caption strip */
  background: #fffdf4;
  border: 1px solid rgba(51, 46, 39, .12);
  box-shadow: 0 12px 28px rgba(74, 56, 30, .22);
  transform: rotate(-1.6deg);
}

.card-keepsake::before {              /* washi tape */
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 74px;
  height: 20px;
  border-radius: 2px;
  background: var(--tape-sage);
  box-shadow: 0 2px 6px rgba(74, 56, 30, .18);
}

.card-keepsake img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-2);
}

.card-keepsake-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink-muted);
}

/* official flyer / banner (optional) — wide framed slot so hosts with a
   designed flyer or poster can show it and guests confirm the right place */
.banner-flyer {
  position: relative;
  margin: 4px 0 clamp(20px, 3.4vh, 30px);
}

.banner-flyer::before {               /* washi tape */
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 96px;
  height: 18px;
  border-radius: 2px;
  background: var(--tape-rose);
  box-shadow: 0 2px 5px rgba(74, 56, 30, .18);
  z-index: 1;
}

.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  padding: 6px;
  background: #fffdf4;
  border: 1px solid rgba(51, 46, 39, .14);
  border-radius: 6px;
  box-shadow: 0 12px 26px rgba(74, 56, 30, .18);
}

.banner-flyer figcaption {
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink-muted);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 3vw, 26px) clamp(14px, 2.6vw, 24px);
  justify-items: center;
}

@media (max-width: 560px) { .photo-gallery { grid-template-columns: 1fr; } }

/* the polaroid frame lives on the <figure>; the photo fills it */
.gallery-item {
  position: relative;
  width: 100%;
  max-width: 270px;
  aspect-ratio: 4 / 5;
  padding: 10px 10px 44px;            /* polaroid frame + caption strip */
  margin: 0;
  background: #fffdf4;
  border: 1px solid rgba(51, 46, 39, .12);
  box-shadow: 0 12px 28px rgba(74, 56, 30, .2);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}

.gallery-item:nth-child(odd) { transform: rotate(-1.7deg); }
.gallery-item:nth-child(even) { transform: rotate(1.5deg); }
.gallery-item:nth-child(3n) { transform: rotate(-.9deg); }

.gallery-item:hover,
.gallery-item:focus-within {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 18px 38px rgba(74, 56, 30, .28);
}

.gallery-item::before {               /* washi tape */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 66px;
  height: 18px;
  border-radius: 2px;
  background: var(--tape-mustard);
  box-shadow: 0 2px 5px rgba(74, 56, 30, .18);
  z-index: 1;
}

.gallery-item:nth-child(even)::before { background: var(--tape-rose); }
.gallery-item:nth-child(3n)::before { background: var(--tape-sage); }

.gallery-item img {
  position: absolute;
  inset: 10px 10px 44px;
  width: calc(100% - 20px);
  height: calc(100% - 54px);
  object-fit: cover;
}

.gallery-item__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11px;
  margin: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink-muted);
  pointer-events: none;
}

/* photo viewer (built by main.js whenever any [data-lightbox] photo exists) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(51, 46, 39, .86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lightbox-fade .22s var(--ease-out) both;
}

.lightbox[hidden] { display: none; }

@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(860px, 92vw);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: var(--paper);
  border: 10px solid #fffdf4;          /* polaroid frame on the full view */
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  cursor: zoom-in;
  transition: transform .35s var(--ease-out);
}

/* zoomed state: the photo scales up (--zoom, set by main.js) and the
   viewer scrolls so you can pan around it. margin:auto keeps the photo
   centered when it still fits, and lets both edges be reached when it
   overflows. */
.lightbox.is-zoomed {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox.is-zoomed figure { margin: auto; }

.lightbox.is-zoomed img {
  max-width: none;
  max-height: none;
  transform: scale(var(--zoom, 1.75));
  cursor: zoom-out;
}

.lightbox__caption {
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 22px;
  color: var(--paper);
  text-align: center;
}

.lightbox__counter {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(20px + env(safe-area-inset-top));
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: rgba(253, 249, 238, .6);
}

/* zoom + open-original toolbar */
.lightbox__tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lightbox__tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(253, 249, 238, .4);
  border-radius: 999px;
  background: rgba(253, 249, 238, .12);
  color: var(--paper);
  padding: 7px 13px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}

.lightbox__tool:hover { background: rgba(253, 249, 238, .24); }

.lightbox__close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(253, 249, 238, .4);
  background: rgba(253, 249, 238, .1);
  color: var(--paper);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}

.lightbox__close:hover { background: rgba(253, 249, 238, .22); }

/* ── 8.6 · Optional film feature (video URL embed) ───────────────────────
     A poster + play button that lazy-loads an <iframe> from the URL in
     data-video-url on .film-card (YouTube / Vimeo / any embeddable URL).
     Nothing loads until the guest taps play — fast, and consent-friendly.
     Delete the whole .film-card block to hide the feature. */
.film-card {
  margin: 0 auto;
  max-width: 580px;
  text-align: center;
}

.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--paper-2);          /* mat behind the poster / while loading */
  border: 8px solid #fffdf4;           /* keepsake frame */
  box-shadow: 0 14px 30px rgba(74, 56, 30, .22);
  transform: rotate(-.6deg);
}

.film-frame::before {                 /* washi tape */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 84px;
  height: 18px;
  border-radius: 2px;
  background: var(--tape-mustard);
  box-shadow: 0 2px 5px rgba(74, 56, 30, .18);
  z-index: 1;
}

.film-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 12vmin, 72px);
  height: clamp(56px, 12vmin, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff8ec;
  background: radial-gradient(circle at 32% 28%, #ffb28a, var(--terra) 45%, var(--terra-deep) 80%);
  border: 3px solid rgba(255, 250, 240, .85);
  box-shadow: 0 10px 26px rgba(74, 56, 30, .5);
  transition: transform .25s var(--ease-out);
  animation: film-pulse 2.6s ease-in-out infinite;
}

.film-play svg { width: 26px; height: 26px; margin-left: 3px; }

.film-open:hover .film-play,
.film-open:focus-visible .film-play { transform: translate(-50%, -50%) scale(1.08); }

.film-open:focus-visible { outline: 3px solid rgba(196, 100, 63, .5); outline-offset: 3px; }

.film-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(51, 46, 39, .62);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--ink-muted);
  font-size: 14px;
  font-style: italic;
  text-align: center;
  background: var(--paper-2);
}

.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}

.film-external:hover { color: var(--ink); border-color: var(--ink); }
.film-external[hidden] { display: none; }

@keyframes film-pulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(74, 56, 30, .5), 0 0 0 0 rgba(196, 100, 63, .35); }
  50% { box-shadow: 0 10px 26px rgba(74, 56, 30, .5), 0 0 0 14px rgba(196, 100, 63, 0); }
}

/* ── 8.7 · Optional free page (In Our Words) ────────────────────────────
     Repeatable free blocks: a title, free text and an OPTIONAL photo.
     The platform clones .free-block per block the host adds; when no
     blocks exist (or the host toggles the Free Page section off) the
     engine removes the whole .panel-free — and with it the rail/tab
     built from the panels that exist (no orphan navigation). The photo
     is optional: leave it empty in the editor and the block still reads
     as a clean title + text block. Clicking the photo opens the same
     full-screen zoomable viewer as every other photo slot. */
.free-blocks {
  display: grid;
  gap: clamp(28px, 4.6vh, 46px);
  margin-top: 4px;
}

.free-block { margin: 0; text-align: center; }

.free-title {
  margin: 0 0 clamp(12px, 2.4vh, 18px);
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(27px, 4.2vw, 35px);
  line-height: 1.12;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.free-content {
  margin: 0 auto clamp(16px, 2.8vh, 22px);
  max-width: 30em;
  text-align: left;
  font-size: clamp(15px, 1.9vw, 16.5px);
  line-height: 1.68;
  color: var(--ink-soft);
  white-space: pre-line;               /* multi-paragraph textarea value */
  overflow-wrap: anywhere;
}

/* the photo is a polaroid frame with washi tape, like the other slots */
.free-media {
  position: relative;
  margin: 0 auto;
  max-width: 560px;
  padding: 8px 8px 30px;
  background: #fffdf4;
  border: 1px solid rgba(51, 46, 39, .12);
  box-shadow: 0 12px 28px rgba(74, 56, 30, .22);
  transform: rotate(-.8deg);
}

.free-media::before {                 /* washi tape */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 78px;
  height: 19px;
  border-radius: 2px;
  background: var(--tape-sage);
  box-shadow: 0 2px 6px rgba(74, 56, 30, .18);
  z-index: 1;
}

.free-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}

/* Empty-state guard: when the render engine removes a photo-less repeatance
   <img> (Gallery Image / Free Image are hidden_if_empty), the polaroid
   <figure> would otherwise render as an empty taped frame. Hide the whole
   frame instead, so a photo-less block degrades to clean title + text. */
.gallery-item:not(:has(img)),
.free-media:not(:has(img)) { display: none; }

/* ── 9 · Sheet panels (rsvp / wishes) ─────────────────────────────────── */
.sheet {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(51, 46, 39, .026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-radius: 6px;
  box-shadow: var(--shadow-sheet);
  padding: clamp(30px, 5vh, 52px) clamp(22px, 4.6vw, 46px) clamp(40px, 6vh, 60px);
  color: var(--ink);
}

.sheet::after {                         /* folded corner */
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(225deg, transparent 50%, rgba(51, 46, 39, .12) 50%, rgba(51, 46, 39, .1) 100%);
  border-bottom-right-radius: 6px;
}

.sheet-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--terra-deep);
  margin-bottom: 8px;
}

.sheet-title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 46px);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 8px;
}

.sheet-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: clamp(22px, 3.6vh, 34px);
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(24px, 4.4vh, 40px);
}

/* ── 10 · RSVP form (a reply card on the sheet) ───────────────────────── */
.rsvp-form {
  background: #fffdf7;
  border: 1px solid var(--paper-3);
  border-radius: 8px;
  padding: clamp(20px, 3.4vw, 34px);
  box-shadow: 0 10px 30px rgba(74, 56, 30, .14);
  position: relative;
}

.rsvp-form::before {                     /* washi strip across the top */
  content: "";
  position: absolute;
  top: -11px;
  left: 20%;
  right: 20%;
  height: 22px;
  border-radius: 2px;
  background: var(--tape-sage);
  box-shadow: 0 2px 6px rgba(74, 56, 30, .18);
  transform: rotate(-1deg);
}

.rsvp-form-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--half { grid-column: span 1; }

.form-group label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra-deep);
}

.form-control {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 400;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  border: 1.5px solid var(--ink-faint);
  border-radius: 5px;
  padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.form-control::placeholder { color: var(--ink-faint); }

.form-control:focus {
  outline: none;
  border-color: var(--terra);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 100, 63, .16);
}

textarea.form-control { resize: vertical; min-height: 62px; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--terra-deep) 50%),
    linear-gradient(135deg, var(--terra-deep) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.error {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--danger);
  min-height: 0;
}

.field-hint {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.attend-extras {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.attend-extras .form-group:first-child { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.loading {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

#rsvp-form.is-declining .attend-extras { display: none; }

/* platform "thank you" / "closed" states */
#rsvp-form .thank-you-message h3 {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 34px;
  color: var(--terra);
}

#rsvp-form .thank-you-message p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

#rsvp-form .thank-you-message small { color: var(--ink-muted); line-height: 1.5; display: block; }

/* RSVP deadline countdown (populated by the platform only when the host sets a deadline) */
.rsvp-countdown {
  display: none;
  text-align: center;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border: 1.5px dashed rgba(51, 46, 39, .32);
  border-radius: 8px;
  background: rgba(217, 164, 65, .1);
}
.rsvp-countdown:has(.count-day:not(:empty)) { display: block; }
.rsvp-countdown-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--mustard-deep);
  margin-bottom: 10px;
}
.rsvp-countdown-units {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.rsvp-unit { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.rsvp-unit:has(.count-day:empty),
.rsvp-unit:has(.count-hour:empty),
.rsvp-unit:has(.count-minute:empty),
.rsvp-unit:has(.count-second:empty) { display: none; }
.rsvp-unit .count-day,
.rsvp-unit .count-hour,
.rsvp-unit .count-minute,
.rsvp-unit .count-second {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: var(--terra);
}
.rsvp-unit em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ── 11 · Guestbook (platform-injected, Style A) ──────────────────────── */
.guestbook-body #guestbookForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  background: #fffdf7;
  color: var(--ink);
  border-radius: 8px;
  padding: clamp(20px, 3.4vw, 34px);
  box-shadow: 0 10px 30px rgba(74, 56, 30, .14);
  border: 1px solid var(--paper-3);
}

.guestbook-body #guestbookForm .form-group { display: flex; flex-direction: column; gap: 6px; }
.guestbook-body #guestbookForm .form-group:has(textarea) { grid-column: 1 / -1; }

.guestbook-body #guestbookForm label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra-deep);
}

.guestbook-body #guestbookForm .form-control {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 400;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  border: 1.5px solid var(--ink-faint);
  border-radius: 5px;
  padding: 11px 13px;
}

.guestbook-body #guestbookForm .form-control:focus {
  outline: none;
  border-color: var(--terra);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 100, 63, .16);
}

.guestbook-body #guestbookForm .error { font-size: 12.5px; color: var(--danger); }

.guestbook-body #guestbookForm .d-flex,
.guestbook-body #guestbookForm .guestbook-chapta { grid-column: 1 / -1; justify-content: center; }

.guestbook-body #guestbookForm button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  background: var(--terra);
  color: #fff8ec;
  border: 0;
  border-radius: 6px;
  padding: 11px 28px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(196, 100, 63, .4);
}

.guestbook-body #guestbookForm button[type="submit"]:hover { background: var(--terra-deep); }

.guestbook-body #guestbookForm .loading-guestbook {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-muted);
}

.guestbook-wrap {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.guestbook-entry {
  position: relative;
  border: 1px solid rgba(51, 46, 39, .26);
  border-radius: 6px;
  background: rgba(255, 255, 255, .5);
  padding: 13px 16px;
}

.guestbook-entry::before {              /* little washi strip */
  content: "";
  position: absolute;
  top: -6px;
  left: 16px;
  width: 46px;
  height: 12px;
  border-radius: 2px;
  background: var(--tape-mustard);
  transform: rotate(-3deg);
}

.guestbook-entry h5 {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 21px;
  color: var(--ink);
  margin: 0 0 3px;
}

.guestbook-entry p {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.guestbook-entry small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.more-guestbook-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

#load-more {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 9px 22px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}

#load-more:hover { background: var(--ink); color: var(--paper); }

/* ── 11.5 · Brand footer (placeholder) ───────────────────────────────────
   Written after </main> and hidden there; main.js tucks it into the last
   panel that actually exists, so it reads as the card's closing line —
   even when RSVP / Guestbook are stripped by the platform. */
.app-footer { display: none; }

.panel-scroll > .app-footer {
  display: block;
  margin-top: clamp(30px, 5vh, 48px);
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.footer-brand-name {
  font-family: var(--font-script);
  font-size: 1.35em;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--terra-deep);
}

/* ── 11.6 · Full-width powered-by brand strip ───────────────────────────
     A slim full-width credit line pinned to the bottom of the deck
     (above the mobile tab bar). The engine swaps the literal brand token
     inside .link-footer for the platform name at render; the Free
     Powered By field in the editor can override the whole line. */
.powered-by {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;                        /* below the rail/tab bar (60), above the deck */
  width: 100%;
  text-align: center;
  padding: 7px 14px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(51, 46, 39, .16);
  background: rgba(239, 230, 214, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.powered-by .link-footer { color: var(--terra-deep); }

/* ── 12 · Responsive ──────────────────────────────────────────────────── */
/* below 1100px the labeled rail becomes a bottom tab bar: one item per
   screen with a small seal dot + short text label, thumb-friendly and
   scrollable when there are many screens. */
@media (max-width: 1100px) {
  .deck-nav {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    flex-direction: row;
    gap: 2px;
    padding: 8px max(6px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    border-radius: 14px 14px 0 0;
    border: 0;
    border-top: 1px solid rgba(51, 46, 39, .2);
    background: rgba(239, 230, 214, .92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 -6px 24px rgba(74, 56, 30, .16);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .deck-nav::-webkit-scrollbar { display: none; }

  .deck-nav button {
    flex: 1 0 auto;
    flex-direction: column;
    gap: 5px;
    min-width: 56px;
    padding: 7px 10px 5px;
  }

  .deck-nav button::before { width: 10px; height: 10px; }
  .deck-nav-label { font-size: 9.5px; letter-spacing: .06em; }

  /* keep content clear of the fixed bottom bar */
  .panel-scroll { padding-bottom: clamp(96px, 15vh, 132px); }
  .desk { padding-bottom: clamp(92px, 15vh, 124px); }

  /* the powered-by strip rides just above the bottom tab bar */
  .powered-by { bottom: calc(56px + env(safe-area-inset-bottom)); }
}

@media (max-width: 760px) {
  .greeting-card { grid-template-columns: 1fr; }
  .card-crease {
    top: auto;
    bottom: auto;
    left: 4%;
    right: 4%;
    top: 50%;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(51, 46, 39, .22) 10%, rgba(51, 46, 39, .22) 90%, transparent);
  }
  .card-crease::after {
    top: 4px;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 14px;
    background: linear-gradient(180deg, rgba(51, 46, 39, .07), transparent);
  }
  .card-page--details {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .card-sign { margin-top: 0; }
  .coffee-ring { display: none; }
}

@media (max-width: 620px) {
  .rsvp-form-display { grid-template-columns: 1fr; }
  .attend-extras { grid-template-columns: 1fr; }
  .guestbook-body #guestbookForm { grid-template-columns: 1fr; }
  .postmark { display: none; }
  .envelope-to { padding: 0 12%; }
  .mail-eyebrow { letter-spacing: .22em; }
}

/* ── 13 · Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .panel { transform: none; }
  .envelope-card, .envelope-flap { transition: none; }
  .film-play { animation: none; }
}

/* ── 14 · Print — each panel becomes its own page ─────────────────────── */
@media print {
  html, body { height: auto; background: #fff; }
  .site { position: static; height: auto; overflow: visible; background: var(--desk); }
  .deck { position: static; }
  .panel {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 0;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    overflow: visible !important;
    break-after: page;
    page-break-after: always;
  }
  .panel.is-active { overflow: visible !important; }
  .deck-nav, .panel-foot, .mail-cta, .coffee-ring, .desk-vignette, .powered-by { display: none !important; }
  .panel-scroll { max-width: none; padding: 24px 10mm; }
  .desk { min-height: 96vh; }
  .envelope {
    width: 70mm;
    height: 44mm;
    filter: none;
  }
  .envelope-card { display: none; }      /* print the sealed envelope, not the peek */
  .envelope-flap { transform: none !important; }
  .envelope, .greeting-card, .sheet, .particulars, .rsvp-form {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .greeting-card { grid-template-columns: 1fr; break-after: auto; }
  .card-crease {
    top: auto; bottom: auto;
    left: 4%; right: 4%; top: 50%;
    width: auto; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(51, 46, 39, .22) 10%, rgba(51, 46, 39, .22) 90%, transparent);
  }
  .card-page--details { border-left: 0; border-top: 1px solid var(--line-soft); }
  .guestbook-wrap { max-height: none; overflow: visible; }
  .gallery-item, .banner-flyer, .film-frame { break-inside: avoid; }
  .film-frame iframe { display: none; }   /* a playing video can't print — the poster prints instead */
  .lightbox { display: none !important; }
}
