/* ===========================================================
   B & R — Wedding Invitation
   Aesthetic: old money / ivory + platinum / restrained serif
   =========================================================== */

:root {
  /* paper & background */
  --paper-ivory: #f3ecd9;
  --paper-cream: #f8f2e1;
  --paper-warm:  #ede4cb;
  --paper-deep:  #d8cbac;
  --paper-shadow: #8a7e60;

  /* envelope */
  --env-front:  #e9dcc0;
  --env-front-hi: #f0e4ca;
  --env-front-lo: #d3c39d;
  --env-flap:   #e2d3b3;
  --env-flap-dk: #c4b288;
  --env-interior: #b9a786;
  --env-edge: rgba(60, 48, 24, 0.18);

  /* wax */
  --wax-core: #2a2925;
  --wax-deep: #14130f;
  --wax-rim:  rgba(0, 0, 0, 0.45);

  /* ink & accents */
  --ink:       #1c1a14;
  --ink-soft:  #4a4234;
  --ink-mute:  #7a6e58;
  --platinum:  #b6a988;
  --platinum-hi: #d5c9a6;
  --gold-thread: #a48a55;
  --line:      rgba(28, 26, 20, 0.18);
  --line-soft: rgba(28, 26, 20, 0.08);

  /* type */
  --f-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --f-numeral: 'Italiana', 'Cormorant Garamond', Georgia, serif;
  --f-util:    'Tenor Sans', 'Optima', system-ui, sans-serif;

  --ease-curtain: cubic-bezier(0.7, 0.0, 0.2, 1);
  --ease-paper:   cubic-bezier(0.55, 0.0, 0.35, 1.0);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--f-display);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 10%, var(--paper-cream) 0%, var(--paper-ivory) 40%, var(--paper-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- atmosphere ----- */
.grain {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  opacity: 0.22;
  mix-blend-mode: multiply;
}

.vignette {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(60,48,24,0.18) 100%);
}

/* ----- topbar ----- */
.topbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 48px 24px;
  font-family: var(--f-util);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-left  { justify-self: start; }
.topbar-center{ justify-self: center; }
.topbar-right { justify-self: end; }

.topbar-monogram {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: none;
  color: var(--ink);
}
.topbar-monogram .amp {
  color: var(--gold-thread);
  font-size: 14px;
  vertical-align: 2px;
  margin: 0 2px;
}

.topbar-eyebrow {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.16em;
  font-family: var(--f-display);
  font-size: 13px;
  color: var(--ink-mute);
}

.topbar-date {
  font-family: var(--f-numeral);
  font-size: 16px;
  letter-spacing: 0.32em;
  color: var(--ink);
}

/* ----- stage ----- */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 60px 24px 80px;
  min-height: calc(100vh - 200px);
}

/* =========================================================
   ENVELOPE
   ========================================================= */

.envelope-section {
  position: relative;
  transition: opacity 700ms var(--ease-curtain),
              transform 700ms var(--ease-curtain),
              visibility 0s linear 700ms;
}

.envelope-section.is-hidden {
  opacity: 0;
  transform: scale(0.92) translateY(-20px);
  visibility: hidden;
  pointer-events: none;
}

.envelope-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 38px;
}

.envelope {
  --w: 540px;
  --h: 340px;
  --flap-h: 170px;   /* exactly half of --h — flaps meet at exact center */
  position: relative;
  width: var(--w);
  height: var(--h);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 30px 40px rgba(40, 30, 10, 0.18))
          drop-shadow(0 4px 8px rgba(40, 30, 10, 0.10));
  transition: transform 600ms var(--ease-curtain),
              filter 600ms var(--ease-curtain);
}

.envelope:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 40px 50px rgba(40, 30, 10, 0.22))
          drop-shadow(0 6px 12px rgba(40, 30, 10, 0.14));
}

.envelope:focus-visible {
  outline: none;
}
.envelope:focus-visible::after {
  content: '';
  position: absolute;
  inset: -16px;
  border: 1px solid var(--gold-thread);
  border-radius: 4px;
  pointer-events: none;
}

/* drop shadow under the envelope (more atmospheric than filter alone) */
.env-shadow {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -36px;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(40,30,10,0.32) 0%, rgba(40,30,10,0) 70%);
  filter: blur(6px);
  z-index: 0;
}

/* env-back — the dark interior of the envelope, revealed when top flap opens */
.env-back {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 50% 40%, #8a7855 0%, #6e5f42 60%, #4a3f2c 100%);
  border: 1px solid var(--env-edge);
  border-radius: 2px;
  z-index: 1;
  box-shadow:
    inset 0 0 60px rgba(20, 14, 4, 0.45),
    inset 0 -2px 0 rgba(20, 14, 4, 0.30);
}

/* invite peek — the cream invite paper resting inside the envelope */
.env-invite-slot {
  position: absolute;
  left: 6%; right: 6%;
  top: 14%; bottom: 14%;
  z-index: 2;
}

.invite-peek {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #faf3df 0%, #f1e8cd 100%);
  border: 1px solid rgba(40, 30, 10, 0.10);
  box-shadow:
    0 6px 14px rgba(20, 14, 4, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* All four flaps tile the envelope rectangle, apexes meeting at exact center. */
.env-flap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* LEFT side flap — left-pointing triangle, apex at center */
.env-flap--left {
  clip-path: polygon(0% 0%, 50% 50%, 0% 100%);
  background:
    linear-gradient(95deg, var(--env-front-lo) 0%, var(--env-front) 65%, var(--env-front-hi) 100%);
  z-index: 3;
}

/* RIGHT side flap — right-pointing triangle, apex at center */
.env-flap--right {
  clip-path: polygon(100% 0%, 50% 50%, 100% 100%);
  background:
    linear-gradient(-95deg, var(--env-front-lo) 0%, var(--env-front) 65%, var(--env-front-hi) 100%);
  z-index: 3;
}

/* hairline crease shadow along each side flap's diagonal seam */
.env-flap--left::after,
.env-flap--right::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(40, 30, 10, 0.16) 0%, transparent 50%, rgba(40, 30, 10, 0.16) 100%);
  mix-blend-mode: multiply;
  opacity: 0.6;
}
.env-flap--left::after  { clip-path: polygon(0% 0%, 50% 50%, 0% 100%); }
.env-flap--right::after { clip-path: polygon(100% 0%, 50% 50%, 100% 100%); }

/* BOTTOM flap — triangle from bottom edge, apex at exact center */
.env-flap--bottom {
  clip-path: polygon(0% 100%, 100% 100%, 50% 50%);
  background:
    linear-gradient(175deg, var(--env-front-hi) 0%, var(--env-front) 55%, var(--env-front-lo) 100%);
  z-index: 4;
}

/* subtle diagonal shading along the bottom flap's V seam */
.env-flap--bottom::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(0% 100%, 100% 100%, 50% 50%);
  background:
    linear-gradient(180deg, rgba(40, 30, 10, 0.20) 0%, transparent 32%);
  mix-blend-mode: multiply;
  opacity: 0.8;
}

/* top flap — perspective is isolated to this wrapper for a clean 3D fold */
.env-flap-top-wrap {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  perspective: 1400px;
  perspective-origin: 50% 0%;
}

.env-flap--top {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0%;
  transition: transform 1500ms var(--ease-paper);
  will-change: transform;
}

.env-flap--top-inner {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% var(--flap-h));
  background:
    linear-gradient(168deg, var(--env-front-hi) 0%, var(--env-front) 55%, var(--env-front-lo) 100%);
  box-shadow:
    inset 0 -10px 20px rgba(40, 30, 10, 0.10),
    inset 0 1px 0 rgba(255, 245, 220, 0.35);
}

/* wax seal — sits exactly where the two flaps meet at envelope center */
.seal-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: none;
  width: 118px;
  height: 118px;
  transition: opacity 600ms ease, transform 600ms ease;
}

.seal {
  position: relative;
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 4px 6px rgba(0,0,0,0.55))
    drop-shadow(0 1px 2px rgba(0,0,0,0.4));
  animation: seal-breathe 5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes seal-breathe {
  0%, 100% { transform: scale(1.0) rotate(-2deg); }
  50%      { transform: scale(1.02) rotate(-2deg); }
}

.seal-svg {
  width: 100%; height: 100%;
  display: block;
  transform: rotate(-4deg);
}

/* seal crack overlay — split disc */
.seal::before,
.seal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
  transform-origin: center;
  transition: transform 800ms var(--ease-curtain), opacity 700ms ease;
  opacity: 0;
}

/* hint */
.hint {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 16px;
  text-transform: lowercase;
  animation: hint-pulse 2.6s ease-in-out infinite;
}

.hint-line {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--ink-mute);
  opacity: 0.45;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1.0; }
}

/* =========================================================
   OPENING ANIMATION STATES
   ========================================================= */

/* rattle — sustained nudges (1500ms) while glitter cascades */
.envelope.is-rattling {
  animation: rattle 1500ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes rattle {
  0%   { transform: translate(0, 0)      rotate(0); }
  6%   { transform: translate(-3px, 1px) rotate(-1.4deg); }
  12%  { transform: translate(3px, -1px) rotate(1.6deg); }
  18%  { transform: translate(-2px, 2px) rotate(-1.2deg); }
  24%  { transform: translate(2px, -2px) rotate(1.1deg); }
  30%  { transform: translate(-3px, 1px) rotate(-1.0deg); }
  38%  { transform: translate(2px, -1px) rotate(0.9deg); }
  46%  { transform: translate(-2px, 2px) rotate(-0.8deg); }
  54%  { transform: translate(2px, -1px) rotate(0.7deg); }
  62%  { transform: translate(-1px, 1px) rotate(-0.6deg); }
  70%  { transform: translate(1px, -1px) rotate(0.5deg); }
  78%  { transform: translate(-1px, 0)   rotate(-0.4deg); }
  86%  { transform: translate(1px, 0)    rotate(0.3deg); }
  94%  { transform: translate(0, 0)      rotate(-0.1deg); }
  100% { transform: translate(0, 0)      rotate(0); }
}

/* glitter field — gold sparkles puffing out around the envelope */
.glitter-field {
  position: absolute;
  inset: -40px;          /* spill out past the envelope edges */
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.envelope.is-rattling .glitter-field { opacity: 1; }

.glitter-field i {
  position: absolute;
  left: var(--gx);
  top:  var(--gy);
  width: 8px;
  height: 8px;
  transform-origin: center;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, #fff4c8 0%, #d4b876 35%, rgba(212, 184, 118, 0) 70%);
  border-radius: 50%;
  filter: blur(0.4px);
}
.envelope.is-rattling .glitter-field i {
  animation: sparkle 1500ms ease-out forwards;
  animation-delay: var(--gd);
}
.glitter-field i::before,
.glitter-field i::after {
  content: '';
  position: absolute;
  inset: -2px -50%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 244, 200, 0.9) 50%, transparent 100%);
  height: 1px;
  top: 50%;
  transform: translateY(-50%);
}
.glitter-field i::after { transform: translateY(-50%) rotate(90deg); }

@keyframes sparkle {
  0%   { opacity: 0; transform: scale(0)    rotate(0); }
  12%  { opacity: 1; transform: scale(1.5)  rotate(80deg); }
  35%  { opacity: 1; transform: scale(1.1)  rotate(180deg); }
  70%  { opacity: 0.7; transform: scale(0.9) rotate(260deg) translateY(-8px); }
  100% { opacity: 0; transform: scale(0.3)  rotate(360deg) translateY(-20px); }
}

.envelope.is-opening .seal-wrap {
  animation: seal-pop 700ms var(--ease-curtain) forwards;
}
@keyframes seal-pop {
  0%   { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  30%  { transform: translate(-50%, -52%) scale(1.08) rotate(2deg); opacity: 1; }
  60%  { transform: translate(-50%, -48%) scale(0.96) rotate(8deg); opacity: 1; }
  100% { transform: translate(-50%, -30%) scale(0.78) rotate(16deg); opacity: 0; }
}

.envelope.is-opening .env-flap--top {
  transform: rotateX(-176deg);
  transition: transform 1600ms var(--ease-paper);
  transition-delay: 320ms;
}

.envelope.is-opening {
  cursor: default;
}

/* =========================================================
   INVITE CARD
   ========================================================= */

.invite-card {
  --card-w: min(620px, 92vw);
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  max-height: calc(100vh - 64px);  /* leave 32px of breathing room top & bottom */
  transform: translate(-50%, -50%) scale(0.18) rotate(-2deg);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: transform 1100ms var(--ease-curtain),
              opacity 700ms ease;
  filter: drop-shadow(0 40px 60px rgba(40, 30, 10, 0.25))
          drop-shadow(0 8px 16px rgba(40, 30, 10, 0.14));
}

.invite-card.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0);
  pointer-events: auto;
}

.invite-card-inner {
  position: relative;
  background-color: #f8f1de;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, #faf3de 0%, #f1e7c8 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.30'/%3E%3C/svg%3E");
  background-blend-mode: normal, normal, multiply;
  border: 1px solid rgba(80, 60, 20, 0.22);
  padding: 22px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 0 60px rgba(120, 90, 40, 0.04);
}

/* the frame is a flow-aware wrapper that grows with content so the
   inner gold border + corners always wrap the full invite, no matter
   how tall the schedule gets */
.invite-frame {
  position: relative;
  border: 1px solid rgba(120, 100, 60, 0.30);
  padding: 36px 36px 30px;
  overflow: hidden;  /* keeps watermark from spilling outside the frame */
}

/* faint baroque watermark behind the content — set to very low opacity */
.invite-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88%;
  height: 78%;
  transform: translate(-50%, -50%);
  background-image: url('/assets/watermark.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}
.invite-content {
  position: relative;
  z-index: 1;  /* sits above the watermark */
}

/* invite-backdrop dims the page when the card is open */
.invite-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%,
      rgba(252, 246, 228, 0.88) 0%,
      rgba(240, 226, 192, 0.92) 55%,
      rgba(214, 195, 158, 0.94) 100%);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
}

/* vellum overlay — warm paper-fibre noise so the backdrop reads as parchment */
.invite-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.66  0 0 0 0 0.45  0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.45;
  pointer-events: none;
}
body.invite-open .invite-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* fade chrome out of the way when invite is open */
body.invite-open .topbar,
body.invite-open .bottombar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease, transform 500ms ease;
}
body.invite-open .topbar    { transform: translateY(-12px); }
body.invite-open .bottombar { transform: translateY(12px); }

.topbar, .bottombar {
  transition: opacity 500ms ease, transform 500ms ease;
}

/* baroque corner ornaments — Gemini-generated PNG mirrored to all four corners */
.corner {
  position: absolute;
  width: 110px;
  height: 110px;
  background-image: url("/assets/corner-ornament.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top left;
  pointer-events: none;
  opacity: 0.92;
}

.corner--tl { top: -10px; left: -10px; }
.corner--tr { top: -10px; right: -10px; transform: scaleX(-1); }
.corner--bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.corner--br { bottom: -10px; right: -10px; transform: scale(-1, -1); }

@media (max-width: 720px) {
  .corner { width: 72px; height: 72px; }
}

/* invite content */
.invite-content {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* engagement photo — framed to echo the invite's gold-hairline aesthetic */
.invite-photo {
  position: relative;
  width: 100%;
  /* +12px on top matches the fleuron divider's 12px margin below,
     so the whitespace above and below the photo is equal (~30px) */
  margin: 12px 0 0;
}
.invite-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(120, 100, 60, 0.28);
  box-shadow: 0 8px 24px rgba(40, 30, 10, 0.14);
}
.invite-photo::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 245, 220, 0.3);
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease-out, transform 700ms var(--ease-out-soft);
}
.invite-card.is-open .reveal {
  opacity: 1;
  transform: translateY(0);
}
.invite-card.is-open .reveal[data-delay="0"]    { transition-delay: 100ms; }
.invite-card.is-open .reveal[data-delay="120"]  { transition-delay: 220ms; }
.invite-card.is-open .reveal[data-delay="240"]  { transition-delay: 340ms; }
.invite-card.is-open .reveal[data-delay="360"]  { transition-delay: 460ms; }
.invite-card.is-open .reveal[data-delay="480"]  { transition-delay: 580ms; }
.invite-card.is-open .reveal[data-delay="600"]  { transition-delay: 700ms; }
.invite-card.is-open .reveal[data-delay="720"]  { transition-delay: 820ms; }
.invite-card.is-open .reveal[data-delay="840"]  { transition-delay: 940ms; }
.invite-card.is-open .reveal[data-delay="960"]  { transition-delay: 1060ms; }
.invite-card.is-open .reveal[data-delay="1080"] { transition-delay: 1180ms; }
.invite-card.is-open .reveal[data-delay="1200"] { transition-delay: 1300ms; }
.invite-card.is-open .reveal[data-delay="1320"] { transition-delay: 1420ms; }
.invite-card.is-open .reveal[data-delay="1440"] { transition-delay: 1540ms; }
.invite-card.is-open .reveal[data-delay="1560"] { transition-delay: 1660ms; }

.invite-eyebrow {
  font-family: var(--f-display);
  color: var(--gold-thread);
  font-size: 22px;
  line-height: 1;
}
.ornament {
  display: inline-block;
  transform: rotate(0deg);
}

.invite-line {
  font-family: var(--f-display);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  line-height: 1.6;
}
.invite-line--italic {
  font-style: italic;
  color: var(--ink-soft);
}

.invite-names {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--ink);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 14px;
  /* no extra margin: let the .invite-content flex gap (18px) set equal
     spacing above (guest name) and below (request line) the names */
  margin: 0;
}
.invite-names .given {
  display: block;
  font-style: italic;
  font-weight: 500;
}
.amp-display {
  display: block;
  font-family: var(--f-display);
  font-size: 0.45em;
  color: var(--gold-thread);
  font-style: italic;
  line-height: 1;
  margin: 0;
}
.amp-display em {
  font-weight: 400;
}

/* fleuron section dividers — Gemini-generated baroque floral on a hairline */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 6px auto;
  width: 100%;
}
.rule::before, .rule::after {
  content: '';
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-thread) 50%, transparent 100%);
  flex: 1;
  max-width: 120px;
  opacity: 0.55;
}
.rule-mark {
  display: inline-block;
  color: var(--gold-thread);
  font-size: 9px;
  letter-spacing: 0.4em;
}

.rule--fleuron {
  gap: 0;
  margin: 12px auto 10px;
  height: 36px;
  background-image: url('/assets/fleuron-divider.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: auto 100%;
  max-width: 320px;
}
.rule--fleuron::before, .rule--fleuron::after { display: none; }

/* date */
.invite-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}
.date-day {
  font-family: var(--f-util);
  font-size: 11px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.date-grand {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--f-numeral);
  font-size: clamp(36px, 5vw, 52px);
  color: var(--ink);
  letter-spacing: 0.04em;
  position: relative;
}
.date-grand::before,
.date-grand::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold-thread);
  opacity: 0.6;
}
.date-num { letter-spacing: 0.04em; }
.date-month { font-style: italic; font-family: var(--f-display); font-weight: 400; font-size: 0.78em; color: var(--ink-soft); }
.date-year {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
}

.invite-time {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

/* two-venue layout — ceremony · car · reception */
.invite-venues {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}

.venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.venue-label {
  font-family: var(--f-util);
  font-size: 10px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
}

.venue-name {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.venue-address {
  font-family: var(--f-util);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.7;
  text-align: center;
}

/* journey segment between venues — the wedding car illustration */
.venue-journey {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
  width: 100%;
}
.journey-line {
  display: block;
  width: 1px;
  height: 14px;
  background: linear-gradient(180deg, transparent, var(--gold-thread));
  opacity: 0.55;
}
.venue-journey .journey-line:last-child {
  background: linear-gradient(180deg, var(--gold-thread), transparent);
}
.journey-car {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.car-svg {
  width: 110px;
  height: auto;
  display: block;
}
@media (max-width: 720px) {
  .car-svg { width: 90px; }
}
.journey-note {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-align: center;
}

/* schedule */
.schedule {
  margin: 6px auto;
  max-width: 380px;
  text-align: left;
}
/* boxed section titles — nested double frame (echoes the language cards
   and the Google Calendar "selected" look: two squares inside each other) */
.schedule-title,
.dress-label,
.notes-label {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  position: relative;
  font-family: var(--f-util);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 12px 18px 12px 24px;
  border: 1px solid var(--gold-thread);
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.65) 0%, rgba(248, 240, 220, 0.45) 100%);
  box-shadow: 0 1px 3px rgba(40, 30, 10, 0.05);
}
.schedule-title::before,
.dress-label::before,
.notes-label::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 154, 104, 0.45);
  pointer-events: none;
}
.schedule-list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
/* match the Kleding-title → Heren gap (16px margin + the dress flex gap of 12px) */
.schedule-title { margin-bottom: 28px; }
.schedule-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px dotted rgba(120, 100, 60, 0.25);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-row dt {
  font-family: var(--f-numeral);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-align: right;
}
.schedule-row dd {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 18px;          /* entry title — biggest text in the timeline */
  line-height: 1.25;
  color: var(--ink-soft);
}

/* venues woven into the timeline — ceremony under the 12:15 row,
   reception under the 15:00 row, both rendered identically (same size) */
.schedule-venue {
  display: block;
  margin-top: 6px;
  text-align: start;
}
.schedule-venue-name {
  display: block;
  font-family: var(--f-display);
  font-style: normal;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.schedule-venue-address {
  display: block;
  font-family: var(--f-util);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.7;
}

/* travel time between ceremony and reception — text only, no car icon */
.schedule-journey {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-align: center;
  margin: 10px 0;
}

/* dress — split by gender */
.dress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}
.dress-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.dress-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.dress-role {
  font-family: var(--f-util);
  font-size: 9px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.dress-text {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.02em;
  max-width: 380px;
  line-height: 1.35;
}

/* notes — practical notes about the day, gift preferences etc. */
.notes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 12px auto 4px;
  text-align: center;
}
.notes-item {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  letter-spacing: 0.02em;
}

/* actions */
.invite-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 16px 0 6px;
}
.actions-label {
  font-family: var(--f-util);
  font-size: 10px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.actions-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-family: var(--f-util);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: transparent;
  transition: all 320ms var(--ease-out-soft);
  position: relative;
}
.action::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid transparent;
  transition: border-color 320ms var(--ease-out-soft);
}
.action:hover::after {
  border-color: rgba(28, 26, 20, 0.4);
}
.action--primary {
  background: var(--ink);
  color: var(--paper-cream);
  border-color: var(--ink);
}
.action--primary:hover {
  background: #2a261e;
  letter-spacing: 0.48em;
}
.action--primary::after {
  inset: 4px;
  border-color: rgba(255, 245, 220, 0.2);
}
.action--ghost:hover {
  background: rgba(28, 26, 20, 0.04);
  letter-spacing: 0.48em;
}

.invite-footer {
  margin-top: 4px;
}
.rsvp-meta {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

.invite-ornament {
  margin-top: 6px;
  font-size: 18px;
  color: var(--gold-thread);
  line-height: 1;
}

/* =========================================================
   BOTTOM BAR — countdown
   ========================================================= */
.bottombar {
  position: relative;
  z-index: 3;
  padding: 28px 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
}

.countdown {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.countdown-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.countdown-segment b {
  font-family: var(--f-numeral);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.countdown-segment i {
  font-family: var(--f-util);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.countdown-divider {
  font-family: var(--f-display);
  color: var(--gold-thread);
  font-size: 20px;
  align-self: center;
  transform: translateY(-8px);
}

.bottombar-line {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-mute);
  text-transform: lowercase;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
  .envelope {
    --w: min(92vw, 460px);
    --h: calc(min(92vw, 460px) * 0.62);
    --flap-h: calc(min(92vw, 460px) * 0.31);
  }
  .topbar { padding: 18px 20px 14px; grid-template-columns: 1fr; gap: 4px; text-align: center; }
  .topbar-left, .topbar-right { display: none; }
  .invite-card-inner { padding: 40px 28px 36px; }
  .seal-wrap { width: 92px; height: 92px; }
  .bottombar { padding: 20px 16px 28px; }
  .countdown { gap: 10px; }
  .countdown-segment b { font-size: 20px; }
  .schedule-row { grid-template-columns: 70px 1fr; gap: 12px; }
}

@media (max-width: 420px) {
  .countdown-divider { display: none; }
  .countdown { gap: 14px; flex-wrap: wrap; justify-content: center; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .seal { animation: none; }
  .hint { animation: none; }
  .envelope.is-opening .env-flap--top {
    transition-duration: 300ms;
  }
  .invite-card {
    transition-duration: 300ms;
  }
}

/* =========================================================
   LANGUAGE PICKER — entry screen, four flags
   ========================================================= */

/* hide the main scene until a language is chosen */
body.is-lang-select .topbar,
body.is-lang-select .bottombar,
body.is-lang-select .stage {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.lang-picker {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(120% 90% at 50% 10%, var(--paper-cream) 0%, var(--paper-ivory) 45%, var(--paper-deep) 100%);
  transition: opacity 700ms var(--ease-curtain),
              transform 700ms var(--ease-curtain),
              visibility 0s linear 700ms;
}

.lang-picker.is-leaving {
  opacity: 0;
  transform: scale(0.96) translateY(-12px);
  visibility: hidden;
  pointer-events: none;
}

.lang-picker-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* B&R monogram crest — Gemini-generated laurel + cipher */
.lang-crest {
  display: block;
  width: 220px;
  height: auto;
  margin: 0 auto 4px;
  animation: lang-fade-in 1100ms var(--ease-out-soft) both;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4));
}
@media (max-width: 720px) {
  .lang-crest { width: 160px; }
}

.lang-eyebrow {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  animation: lang-fade-in 900ms 100ms var(--ease-out-soft) both;
}

.lang-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  animation: lang-fade-in 900ms 200ms var(--ease-out-soft) both;
}
.lang-title-line {
  font-family: var(--f-display);
  font-size: clamp(28px, 4.4vw, 44px);
  letter-spacing: 0.02em;
  color: var(--ink);
  font-style: italic;
  font-weight: 400;
}
.lang-title-sub {
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.lang-title-sub em {
  font-style: italic;
  font-weight: 400;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 980px;
  margin-top: 16px;
  animation: lang-fade-in 900ms 320ms var(--ease-out-soft) both;
}

.lang-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 18px 24px;
  background:
    linear-gradient(180deg, rgba(255, 252, 240, 0.65) 0%, rgba(248, 240, 220, 0.45) 100%);
  border: 1px solid rgba(120, 100, 60, 0.18);
  cursor: pointer;
  font-family: var(--f-display);
  color: var(--ink);
  transition: transform 380ms var(--ease-out-soft),
              border-color 280ms ease,
              background 280ms ease,
              box-shadow 380ms var(--ease-out-soft);
  box-shadow: 0 1px 3px rgba(40, 30, 10, 0.05);
}
.lang-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 280ms ease;
}
.lang-card:hover,
.lang-card:focus-visible {
  outline: none;
  transform: translateY(-4px);
  border-color: var(--gold-thread);
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.85) 0%, rgba(248, 238, 215, 0.75) 100%);
  box-shadow:
    0 14px 26px rgba(40, 30, 10, 0.12),
    0 4px 8px rgba(40, 30, 10, 0.06);
}
.lang-card:hover::before,
.lang-card:focus-visible::before {
  border-color: rgba(184, 154, 104, 0.45);
}
.lang-card:active { transform: translateY(-2px); }

.lang-flag {
  display: block;
  width: 76px;
  height: 50px;
  border: 1px solid rgba(40, 30, 10, 0.28);
  box-shadow:
    0 2px 6px rgba(40, 30, 10, 0.18),
    inset 0 0 0 1px rgba(255, 245, 220, 0.06);
  overflow: hidden;
  position: relative;
}
.lang-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* paper-aged overlay so flags don't feel garish vs. the cream theme */
.lang-flag::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 245, 215, 0.10) 0%, rgba(40, 30, 10, 0.10) 100%);
  pointer-events: none;
}

.lang-name {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.lang-name--am {
  font-family: 'Noto Serif Armenian', 'Cormorant Garamond', serif;
  font-size: 22px;
  font-style: normal;
  font-weight: 500;
}
.lang-name--ar {
  font-family: 'Amiri', 'Cormorant Garamond', serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 500;
  direction: rtl;
}
.lang-sub {
  font-family: var(--f-util);
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.lang-ornament {
  margin-top: 12px;
  font-size: 18px;
  color: var(--gold-thread);
  animation: lang-fade-in 900ms 480ms var(--ease-out-soft) both;
}

@keyframes lang-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* small "change language" link in the bottom bar */
.lang-switch {
  position: absolute;
  right: 28px;
  bottom: 24px;
  background: transparent;
  border: none;
  font-family: var(--f-util);
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 240ms ease, border-color 240ms ease;
}
.lang-switch:hover {
  color: var(--ink);
  border-bottom-color: var(--gold-thread);
}

.bottombar { position: relative; }

/* Armenian — apply native serif globally inside the doc when lang=am */
body[data-lang="am"] {
  font-family: 'Noto Serif Armenian', 'Cormorant Garamond', serif;
}
body[data-lang="am"] .invite-names .given,
body[data-lang="am"] .invite-line--italic,
body[data-lang="am"] .invite-time,
body[data-lang="am"] .rsvp-meta,
body[data-lang="am"] .dress-value,
body[data-lang="am"] .journey-note {
  font-style: normal;
}

/* Arabic — RTL document, native serif */
body[data-lang="ar"] {
  direction: rtl;
  font-family: 'Amiri', 'Cormorant Garamond', serif;
}
body[data-lang="ar"] .invite-content,
body[data-lang="ar"] .topbar,
body[data-lang="ar"] .bottombar {
  direction: rtl;
  text-align: center;
}
body[data-lang="ar"] .invite-names .given,
body[data-lang="ar"] .invite-line--italic,
body[data-lang="ar"] .invite-time,
body[data-lang="ar"] .rsvp-meta,
body[data-lang="ar"] .dress-value,
body[data-lang="ar"] .journey-note,
body[data-lang="ar"] .date-month,
body[data-lang="ar"] .topbar-eyebrow {
  font-style: normal;
}
body[data-lang="ar"] .date-grand {
  direction: ltr;
}
body[data-lang="ar"] .schedule-row {
  direction: rtl;
  grid-template-columns: 1fr 78px;
}
body[data-lang="ar"] .schedule-row dt {
  text-align: left;
  direction: ltr;
}
body[data-lang="ar"] .schedule-row dd {
  text-align: right;
}
body[data-lang="ar"] .invite-names {
  direction: ltr;  /* keep "Ben & Rita" in original script */
}

@media (max-width: 980px) {
  /* 5 cards → 3 over 2 (pyramid). Flex-wrap + center keeps the
     shorter bottom row centered instead of left-aligned like grid. */
  .lang-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    max-width: 600px;
  }
  .lang-card {
    flex: 0 1 calc((100% - 28px) / 3); /* 3 per row, two 14px gaps */
    min-width: 0;
  }
}
@media (max-width: 720px) {
  /* keep the 3-over-2 pyramid; just tighten cards so 3 fit per row */
  .lang-grid {
    gap: 10px;
    max-width: 420px;
  }
  .lang-card {
    flex: 0 1 calc((100% - 20px) / 3); /* 3 per row, two 10px gaps */
    padding: 16px 6px 14px;
    gap: 8px;
  }
  .lang-flag { width: 54px; height: 36px; }
  .lang-name { font-size: 15px; }
  .lang-name--am { font-size: 15px; }
  .lang-name--ar { font-size: 16px; }
  .lang-sub { font-size: 8px; letter-spacing: 0.28em; }
  .lang-mono { font-size: 24px; }
  .lang-title-line { font-size: 24px; }
  .lang-title-sub { font-size: 11px; letter-spacing: 0.14em; }
  .lang-switch { position: static; margin-top: 10px; }
  .car-svg { width: 180px; }
}

/* =========================================================
   CURTAINS — theatrical reveal after language pick
   ========================================================= */
.curtains {
  position: fixed;
  inset: 0;
  z-index: 180;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 350ms ease, visibility 0s linear 350ms;
}
.curtains.is-visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 300ms ease, visibility 0s linear 0s;
}

/* each curtain is wider than half the screen so they overlap heavily —
   needed because the swagged inner edge dips inward at the tieback */
.curtain {
  position: absolute;
  top: 0;
  width: 62%;
  height: 100%;
  background-image:
    /* soft repeating vertical folds */
    repeating-linear-gradient(90deg,
      rgba(120, 90, 40, 0.0) 0px,
      rgba(120, 90, 40, 0.10) 26px,
      rgba(120, 90, 40, 0.0) 52px),
    /* highlight ridges along each fold */
    repeating-linear-gradient(90deg,
      rgba(255, 250, 230, 0.18) 0px,
      rgba(255, 250, 230, 0.0) 13px,
      rgba(255, 250, 230, 0.18) 26px),
    /* darker fabric where the curtain is gathered at the tieback */
    radial-gradient(ellipse 60% 30% at var(--gather-x, 95%) 50%,
      rgba(70, 50, 16, 0.30) 0%,
      rgba(70, 50, 16, 0) 70%),
    /* base warm-white drape */
    linear-gradient(180deg, #faf6e9 0%, #f1e9d2 60%, #d8ccae 100%);
  transition: transform 1600ms cubic-bezier(0.7, 0.0, 0.2, 1);
  will-change: transform;
}

.curtain--left  {
  left: 0;
  transform-origin: left center;
  --gather-x: 92%;
  /* inner (right) edge pinched at mid-height — theatre tieback shape */
  clip-path: polygon(
    0% 0%,
    100% 0%,
    98% 10%, 95% 22%, 91% 34%, 88% 44%,
    86% 50%,
    88% 56%, 91% 66%, 95% 78%, 98% 90%,
    100% 100%,
    0% 100%
  );
}
.curtain--right {
  right: 0;
  transform-origin: right center;
  --gather-x: 8%;
  /* inner (left) edge mirrored */
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    2% 90%, 5% 78%, 9% 66%, 12% 56%,
    14% 50%,
    12% 44%, 9% 34%, 5% 22%, 2% 10%
  );
}

/* shadow along the swagged inner edge — strongest at the tieback pinch */
.curtain::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  pointer-events: none;
}
.curtain--left::after {
  right: 0;
  background: linear-gradient(to right,
    rgba(40, 30, 10, 0) 0%,
    rgba(40, 30, 10, 0.10) 50%,
    rgba(40, 30, 10, 0.32) 100%);
  clip-path: inherit;
}
.curtain--right::after {
  left: 0;
  background: linear-gradient(to left,
    rgba(40, 30, 10, 0) 0%,
    rgba(40, 30, 10, 0.10) 50%,
    rgba(40, 30, 10, 0.32) 100%);
  clip-path: inherit;
}

/* gold rope tieback — sits at the pinch point */
.curtain::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 56px;
  height: 14px;
  margin-top: -7px;
  border-radius: 8px;
  background:
    linear-gradient(180deg,
      #e8c987 0%,
      #b89248 35%,
      #8a6c30 65%,
      #6e521f 100%);
  box-shadow:
    0 2px 4px rgba(40, 28, 10, 0.45),
    inset 0 1px 0 rgba(255, 245, 220, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.curtain--left::before  { right: 80px; }
.curtain--right::before { left:  80px; }

.curtains.is-opening .curtain--left  { transform: translateX(-115%); }
.curtains.is-opening .curtain--right { transform: translateX(115%); }

/* subtle gold curtain rod across the top */
.curtain-rod {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    linear-gradient(180deg, #c9a86d 0%, #8a6c30 50%, #a8884e 100%);
  box-shadow: 0 3px 8px rgba(40, 30, 10, 0.35);
  z-index: 1;
}

/* =========================================================
   PETAL MOUSE TRAIL — gold flowers + petals
   ========================================================= */
.petal {
  position: fixed;
  width: var(--size, 14px);
  height: var(--size, 14px);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--rot, 0));
  animation: petal-trail 850ms cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
  will-change: transform, opacity;
}
.petal svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(120, 90, 40, 0.25));
}

@keyframes petal-trail {
  0%   { opacity: 0;
         transform: translate(-50%, -50%) rotate(var(--rot)) scale(0.3); }
  18%  { opacity: 0.95;
         transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); }
  100% { opacity: 0;
         transform: translate(calc(-50% + var(--drift, 0)),
                              calc(-50% + var(--fall, 10px)))
                    rotate(calc(var(--rot, 0) + 100deg))
                    scale(0.45); }
}

