/* ============================================================
   Azores Invites — liquid-glass UI
   Derived from the Liquid Glass Kit: frosted panels over rich
   gradient (or user photo/video) backgrounds.
   ============================================================ */
:root {
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --ink: #ffffff;
  --accent: #f0c24b;    /* gold */
  --accent2: #ffe27a;   /* yellow */

  --bg1: #1d1030; --bg2: #45276e; --bg3: #2a1547;   /* violet depths */

  /* low-opacity liquid glass: the veil is faint, the blur does the work */
  --glass-dark: linear-gradient(150deg, var(--glass-c1, rgba(38,20,66,0.28)), var(--glass-c2, rgba(38,20,66,0.12)));
  --glass-border: rgba(255,255,255,0.55);
  --glass-blur: blur(30px) saturate(200%);
  --glass-blur-heavy: blur(36px) saturate(200%);

  --radius: 26px;
  --radius-pill: 999px;
  --shadow-float: 0 18px 50px rgba(0,0,0,0.30);
  --speck: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 9%, rgba(255,255,255,0) 24%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body-font, var(--font));
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--head-font, var(--font-head)); line-height: 1.15; text-shadow: 0 2px 20px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.35); }
p, label, li, td, th { text-shadow: 0 1px 10px rgba(0,0,0,0.45); }
a { color: var(--ink); }
code { background: rgba(0,0,0,0.3); padding: 1px 7px; border-radius: 7px; font-size: 0.92em; }

/* ---------- background scene ---------- */
.bg-scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
}
.bg-scene::after { content: ""; position: absolute; inset: 0; }
body.pattern-dots .bg-scene::after {
  background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}
body.pattern-waves .bg-scene::after {
  background: repeating-linear-gradient(115deg, transparent 0 34px, rgba(255,255,255,0.05) 34px 68px);
}
body.pattern-rays .bg-scene::after {
  background: conic-gradient(from 200deg at 80% -10%,
    transparent 0deg, rgba(255,255,255,0.08) 12deg, transparent 24deg,
    rgba(255,255,255,0.06) 40deg, transparent 55deg, rgba(255,255,255,0.08) 70deg, transparent 85deg);
}
.bg-scene img, .bg-scene video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.45;
}
.bg-scene .veil {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--bg1) 0%, transparent 40%, transparent 65%, var(--bg3) 100%);
  opacity: 0.75;
}

/* rotating site background slideshow (marketing/app chrome pages) */
.bg-scene .bg-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease;
}
.bg-scene .bg-slide.active { opacity: 0.5; }
.bg-scene .site-veil {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(29,16,48,0.82) 0%, rgba(42,21,71,0.55) 45%, rgba(29,16,48,0.85) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .bg-scene .bg-slide { transition: none; }
}

/* ---------- glass primitives ---------- */
.glass {
  position: relative;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 1px rgba(255,255,255,0.10);
  padding: clamp(20px, 3.5vw, 36px);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--speck); pointer-events: none;
}
.glass > * { position: relative; }

.glass-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-pill);
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255,255,255,0.5);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.6);
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink);
  background: transparent; cursor: pointer; font-family: inherit;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
  isolation: isolate;
}
/* moving violet–blue–white sheen that sweeps across on hover/touch */
.btn::after {
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(139,92,246,0.55) 38%,
    rgba(96,165,250,0.6) 50%, rgba(255,255,255,0.85) 58%, rgba(139,92,246,0.55) 70%, transparent 84%);
  background-size: 260% 100%; background-position: 130% 0;
  opacity: 0; transition: opacity 0.25s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn:hover::after, .btn:focus-visible::after { opacity: 1; animation: sheen 1.1s linear infinite; }
.btn:active { animation: pop 0.32s ease; }
.btn.is-leaving { animation: deflate 0.34s ease forwards; }
@keyframes sheen { to { background-position: -130% 0; } }
@keyframes pop {
  0% { transform: translateY(-2px) scale(1); }
  45% { transform: translateY(-4px) scale(1.08); }
  100% { transform: translateY(-2px) scale(1); }
}
@keyframes deflate {
  0% { transform: scale(1.08); }
  60% { transform: scale(0.9); opacity: 0.85; }
  100% { transform: scale(0.82); opacity: 0.35; }
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #2a1547; border-color: transparent;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.5);
  text-shadow: none;
}
.btn-glass {
  background: rgba(255,255,255,0.14);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.btn-danger { border-color: rgba(255,120,120,0.8); color: #ffc9c9; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 14px; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 0 clamp(14px, 3vw, 28px); flex-wrap: wrap;
}
.topbar .links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* currency + language pickers */
.switcher { display: inline-flex; gap: 6px; }
.switch-form { display: inline; }
.switcher select {
  width: auto; padding: 8px 10px; font-size: 13px; border-radius: var(--radius-pill);
  background: var(--glass-dark); color: var(--ink);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); cursor: pointer; max-width: 140px;
}
.switcher select option { color: #14231a; background: #fff; }
.invite-switcher { position: fixed; top: 14px; right: 14px; z-index: 45; }
.brand { font-family: var(--font-head); font-size: 17px; letter-spacing: 0.4px; }
.brand .dot { color: var(--accent); }

.wrap { position: relative; z-index: 10; padding: clamp(18px, 4vw, 44px); max-width: 1080px; margin: 0 auto; }
.wrap-narrow { max-width: 560px; }
.wrap-wide { max-width: 1240px; }
.stack { display: grid; gap: 18px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { opacity: 0.78; font-size: 0.95em; }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 12px 15px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.32); border-radius: 14px;
  outline: none; transition: background 0.2s ease, border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.12); }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.55); }
select option { color: #14231a; background: #fff; }
textarea { min-height: 96px; resize: vertical; }
.checkbox { display: flex; gap: 9px; align-items: center; font-weight: 400; }
.checkbox input { width: auto; }

.alert { padding: 13px 18px; border-radius: 16px; font-size: 14.5px; margin-bottom: 14px; border: 1px solid; }
.alert-error { background: rgba(120,20,20,0.45); border-color: rgba(255,120,120,0.6); }
.alert-ok { background: rgba(20,90,45,0.45); border-color: rgba(120,255,170,0.5); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.16); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.7px; opacity: 0.75; }
tr:last-child td { border-bottom: none; }

.tag { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.3); }
.tag-ok { background: rgba(30,120,60,0.5); }
.tag-warn { background: rgba(150,110,20,0.5); }
.tag-bad { background: rgba(140,30,30,0.5); }

/* ---------- pricing ---------- */
.price-card { display: flex; flex-direction: column; gap: 10px; }
.price-card .amount { font-size: 42px; font-weight: 700; font-family: var(--font-head); }
.price-card ul { list-style: none; display: grid; gap: 7px; font-size: 14.5px; }
.price-card li::before { content: "✦ "; color: var(--accent); }
.price-card .btn { margin-top: auto; }
.badge-pop { position: absolute; top: -12px; right: 18px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #2a1547; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 999px; text-shadow: none; }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.steps span { font-size: 12.5px; padding: 5px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.3); opacity: 0.6; }
.steps .on { opacity: 1; background: rgba(255,255,255,0.16); font-weight: 600; }
.steps .done { opacity: 0.85; border-color: var(--accent); }

/* ---------- theme picker ---------- */
.theme-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.theme-card { border-radius: 18px; overflow: hidden; border: 2px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25); text-decoration: none; display: block; position: relative; }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
.theme-swatch { height: 86px; position: relative; }
.theme-swatch .mini-glass { position: absolute; inset: 26% 18% 20% 18%; border-radius: 10px;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.theme-meta { padding: 9px 12px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.theme-locked { opacity: 0.55; }
.theme-locked::after { content: "🔒"; position: absolute; top: 8px; right: 10px; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { padding: 18px; border-radius: 18px; background: rgba(255,255,255,0.07);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.tile .n { font-size: 34px; font-weight: 700; font-family: var(--font-head); line-height: 1; }
.tile .l { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.75; margin-top: 6px; }

/* ---------- invitation page ---------- */
.invite-wrap { position: relative; z-index: 10; max-width: 780px; margin: 0 auto; padding: clamp(16px, 4vw, 40px); display: grid; gap: 26px; }

/* gate: vertically + horizontally centred on every screen, incl. mobile */
.gate-wrap { min-height: 100dvh; align-content: center; justify-items: center; }
.gate-head { text-align: center; }
.gate-title { font-size: clamp(30px, 5.5vw, 46px); }
.gate-card { width: min(460px, 100%); }
.invite-head { text-align: center; padding-top: 4vh; }
.invite-head .kicker { font-size: clamp(17px, 2.6vw, 22px); letter-spacing: 1px; opacity: 0.9; font-family: var(--head-font, var(--font-head)); }
.invite-head .honouree { font-size: clamp(38px, 7vw, 64px); font-family: var(--head-font, var(--font-head)); color: var(--accent); margin-top: 6px; }

.photo-circle {
  width: clamp(150px, 30vw, 220px); height: clamp(150px, 30vw, 220px);
  border-radius: 50%; overflow: hidden; margin: 0 auto -70px; position: relative; z-index: 12;
  border: 4px solid rgba(255,255,255,0.75); box-shadow: var(--shadow-float);
  background: rgba(255,255,255,0.12);
}
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.photo-circle .placeholder { display: grid; place-items: center; height: 100%; font-size: 54px; }

.invite-card { padding-top: 84px; text-align: center; }
.invite-card.no-photo { padding-top: clamp(20px, 3.5vw, 36px); }
.invite-card .type { font-size: 13px; text-transform: uppercase; letter-spacing: 2.5px; opacity: 0.85; }
.invite-card .of { font-size: clamp(22px, 4vw, 32px); font-family: var(--head-font, var(--font-head)); margin: 8px 0 2px; }
.invite-card .details { display: grid; gap: 6px; margin-top: 14px; font-size: 15.5px; }
.invite-card .msg { margin-top: 16px; font-style: italic; opacity: 0.92; white-space: pre-line; }

/* header stays centred on every layout, including mobile */
.invite-head { text-align: center; }
.invite-layout-2 .photo-circle { margin: 0 auto -70px; }
.invite-layout-2 .invite-card { text-align: left; }
.invite-layout-3 .honouree { text-transform: uppercase; letter-spacing: 3px; }
.invite-layout-3 .invite-card { border-radius: 12px; }

.gallery { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gallery img { width: 150px; height: 150px; object-fit: cover; border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.5); box-shadow: var(--shadow-float); }

.media-tile { position: relative; }
.media-tile img { height: 150px; }
.media-tile.is-bg img, .media-tile.is-bg video { outline: 3px solid var(--accent); outline-offset: 2px; }
.media-tile .bg-badge { position: absolute; top: 8px; left: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #2a1547; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.media-tile .media-actions { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; gap: 6px; justify-content: space-between; }

.rsvp-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.rsvp-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .rsvp-grid { grid-template-columns: 1fr; } }

.map-frame { width: 100%; height: 300px; border: 0; border-radius: 18px; display: block; }

/* ---------- premium reveal cover ---------- */
.reveal-cover {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  text-align: center; padding: 24px;
}
.reveal-cover .cover-panel {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
.reveal-cover.split .cover-panel { width: 50%; }
.reveal-cover.split .cover-panel.left { left: 0; }
.reveal-cover.split .cover-panel.right { left: 50%; }
.reveal-cover .cover-inner { position: relative; z-index: 2; display: grid; gap: 18px; max-width: 560px; }
.reveal-cover .cover-kicker { font-size: clamp(15px,2.4vw,20px); letter-spacing: 1px; opacity: 0.9; font-family: var(--head-font, var(--font-head)); }
.reveal-cover .cover-title { font-size: clamp(34px,7vw,62px); font-family: var(--head-font, var(--font-head)); color: var(--accent); }

body.revealing { overflow: hidden; }
/* fade */
.reveal-cover.leaving.fade { animation: cover-fade 1s ease forwards; }
@keyframes cover-fade { to { opacity: 0; visibility: hidden; } }
/* blast */
.reveal-cover.leaving.blast .cover-inner { animation: blast-zoom 0.9s ease forwards; }
.reveal-cover.leaving.blast { animation: cover-fade 0.9s ease 0.1s forwards; }
@keyframes blast-zoom { 60% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
/* doors (single panel splits open) */
.reveal-cover.leaving.doors .cover-panel { transform-origin: left center; animation: door-open 1s ease forwards; }
@keyframes door-open { to { transform: perspective(1200px) rotateY(-105deg); opacity: 0.2; } }
.reveal-cover.leaving.doors .cover-inner { animation: cover-fade 0.5s ease forwards; }
/* split (two halves slide apart) */
.reveal-cover.leaving.split .cover-panel.left { animation: slide-left 1s ease forwards; }
.reveal-cover.leaving.split .cover-panel.right { animation: slide-right 1s ease forwards; }
.reveal-cover.leaving.split .cover-inner { animation: cover-fade 0.5s ease forwards; }
@keyframes slide-left { to { transform: translateX(-100%); } }
@keyframes slide-right { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .reveal-cover.leaving, .reveal-cover.leaving * { animation: none !important; }
  .reveal-cover.leaving { display: none; }
}

.motif { position: fixed; z-index: 1; opacity: 0.35; pointer-events: none; }
.motif svg { width: 100%; height: 100%; }
.motif-tl { top: -30px; left: -30px; width: 200px; height: 200px; transform: rotate(-15deg); }
.motif-br { bottom: -40px; right: -30px; width: 260px; height: 260px; transform: rotate(10deg); }

footer.site { position: relative; z-index: 10; text-align: center; padding: 26px; font-size: 13px; opacity: 0.7; }

/* ---------- hero (landing) ---------- */
.hero { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); max-width: 760px; }
.hero p { max-width: 560px; margin: 14px auto 22px; font-size: 17px; opacity: 0.92; }

/* ============================================================
   Premium: wave-like moving gradient. Floats above any background
   photo/video at very thin opacity and never stops animating.
   ============================================================ */
.gradient-wave {
  position: fixed; inset: -20%; z-index: 2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 30%, var(--accent) 0%, transparent 60%),
    radial-gradient(50% 60% at 80% 20%, var(--accent2) 0%, transparent 55%),
    radial-gradient(55% 55% at 60% 80%, var(--bg2) 0%, transparent 60%),
    radial-gradient(45% 45% at 30% 70%, var(--accent) 0%, transparent 55%);
  opacity: 0.10;
  filter: blur(40px) saturate(160%);
  animation: waveflow 16s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes waveflow {
  0%   { transform: translate3d(-4%, -3%, 0) scale(1) rotate(0deg); }
  25%  { transform: translate3d(3%, -6%, 0) scale(1.08) rotate(2deg); }
  50%  { transform: translate3d(6%, 4%, 0) scale(1.02) rotate(-2deg); }
  75%  { transform: translate3d(-5%, 6%, 0) scale(1.1) rotate(1.5deg); }
  100% { transform: translate3d(4%, -4%, 0) scale(1.04) rotate(-1deg); }
}

/* ============================================================
   Reveal: WINDOW DOORS — arch top, two shutters, sliding bottom
   ============================================================ */
.window-frame {
  position: relative; width: min(320px, 78vw); aspect-ratio: 3 / 4;
  margin: 0 auto 16px; border-radius: 150px 150px 18px 18px; overflow: hidden;
  border: 3px solid rgba(255,255,255,0.65); box-shadow: var(--shadow-float);
  perspective: 900px;
}
.win-photo, .win-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.win-photo-ph { display: grid; place-items: center; height: 100%; font-size: 60px; background: rgba(255,255,255,0.1); }
.win-panel {
  position: absolute; z-index: 2;
  background: linear-gradient(150deg, var(--bg2), var(--bg1));
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 1.4s cubic-bezier(.6,.05,.28,.99), opacity 1.2s ease 0.6s;
}
.win-panel::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: inherit; }
.win-arch  { top: 0; left: 0; right: 0; height: 34%; border-radius: 150px 150px 0 0; transform-origin: top center; }
.win-left  { top: 34%; left: 0; width: 50%; bottom: 26%; transform-origin: left center; }
.win-right { top: 34%; right: 0; width: 50%; bottom: 26%; transform-origin: right center; }
.win-bottom{ left: 0; right: 0; bottom: 0; height: 26%; }
.reveal-cover.leaving.window .win-arch  { transform: rotateX(115deg) translateY(-8px); opacity: 0; }
.reveal-cover.leaving.window .win-left  { transform: rotateY(-120deg); opacity: 0; }
.reveal-cover.leaving.window .win-right { transform: rotateY(120deg); opacity: 0; }
.reveal-cover.leaving.window .win-bottom{ transform: translateY(130%); opacity: 0; }
.reveal-cover.leaving.window { animation: cover-fade 0.8s ease 1.2s forwards; }
.reveal-cover.leaving.window .cover-kicker,
.reveal-cover.leaving.window .btn { animation: cover-fade 0.5s ease forwards; }

/* ============================================================
   Reveal: CURTAIN & CHARACTERS — couple walks off, rope pulls
   the drapes aside
   ============================================================ */
.curtain-drape {
  position: absolute; top: 0; bottom: 0; width: 56%; z-index: 1;
  background:
    repeating-linear-gradient(90deg,
      var(--bg2) 0 26px, var(--bg1) 26px 52px);
  box-shadow: inset 0 -40px 60px rgba(0,0,0,0.4);
  transition: transform 1.6s cubic-bezier(.7,.02,.3,1) 0.35s;
}
.curtain-drape.left  { left: -3%;  border-right: 6px solid var(--accent); }
.curtain-drape.right { right: -3%; border-left: 6px solid var(--accent); }
.curtain-rope {
  position: absolute; top: 0; right: 12%; width: 6px; height: 34%;
  background: linear-gradient(var(--accent), var(--accent2)); z-index: 3;
  border-radius: 4px; transition: transform 0.5s ease;
}
.curtain-rope::after {
  content: ""; position: absolute; bottom: -16px; left: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent2); box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.char-stage {
  position: relative; display: flex; justify-content: center; align-items: flex-end;
  gap: 6px; height: 150px; cursor: pointer; z-index: 4;
}
.char-glow {
  position: absolute; inset: -14px -40px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent2) 0%, transparent 72%);
  opacity: 0.5; animation: glowpulse 2.2s ease-in-out infinite;
}
@keyframes glowpulse { 50% { opacity: 0.85; transform: scale(1.08); } }
.char { width: 62px; height: 124px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45)); }
.reveal-cover.leaving.curtain .curtain-rope { transform: translateY(26px); }
.reveal-cover.leaving.curtain .curtain-drape.left  { transform: translateX(-104%); }
.reveal-cover.leaving.curtain .curtain-drape.right { transform: translateX(104%); }
.reveal-cover.leaving.curtain .char-glow { opacity: 0; transition: opacity 0.4s; }
.reveal-cover.leaving.curtain .char-m { animation: walk-left 1.5s ease-in forwards; }
.reveal-cover.leaving.curtain .char-f { animation: walk-right 1.5s ease-in forwards; }
@keyframes walk-left {
  0%   { transform: translateX(0) scaleX(1); }
  15%  { transform: translateX(-4vw) scaleX(-1) translateY(-4px); }
  40%  { transform: translateX(-22vw) scaleX(-1) translateY(0); }
  65%  { transform: translateX(-40vw) scaleX(-1) translateY(-4px); }
  100% { transform: translateX(-70vw) scaleX(-1); opacity: 0.4; }
}
@keyframes walk-right {
  0%   { transform: translateX(0) scaleX(1); }
  15%  { transform: translateX(4vw) translateY(-4px); }
  40%  { transform: translateX(22vw) translateY(0); }
  65%  { transform: translateX(40vw) translateY(-4px); }
  100% { transform: translateX(70vw); opacity: 0.4; }
}
.reveal-cover.leaving.curtain { animation: cover-fade 0.7s ease 1.5s forwards; }
.reveal-cover.leaving.curtain .cover-kicker,
.reveal-cover.leaving.curtain .small { animation: cover-fade 0.5s ease forwards; }

/* ============================================================
   Mobile optimization
   ============================================================ */
@media (max-width: 640px) {
  .topbar { position: static; padding-top: 12px; justify-content: center; }
  .topbar .links { justify-content: center; }
  .glass-pill { padding: 7px 13px; font-size: 13.5px; }
  .switcher select { max-width: 106px; padding: 7px 8px; font-size: 12px; }
  .wrap { padding: 14px; }
  .glass { padding: 18px 15px; border-radius: 20px; }
  .btn { padding: 11px 18px; font-size: 14px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile .n { font-size: 26px; }
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .price-card .amount { font-size: 34px; }
  h1 { font-size: 26px; }
  .spread { flex-direction: column; align-items: flex-start; }
  .spread .row { width: 100%; }
  .map-frame { height: 220px; }
  .invite-card { padding-top: 78px; }
  .motif-tl { width: 120px; height: 120px; }
  .motif-br { width: 150px; height: 150px; }
  .curtain-drape { width: 60%; }
}
@media (max-width: 400px) {
  .rsvp-grid { grid-template-columns: 1fr; }
  .steps span { font-size: 11px; padding: 4px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-scene video { display: none; }
  .btn, .btn:hover { transition: none; transform: none; }
  html { scroll-behavior: auto; }
  .gradient-wave { animation: none; opacity: 0.06; }
  .char-glow { animation: none; }
}
