/* ───────────────────────────────────────────────────────────────
   Design tokens — sampled from the invitation artwork
   ─────────────────────────────────────────────────────────────── */
:root {
  --paper: #f5e6d3;          /* champagne: the page, under the gold damask */
  --paper-deep: #ead6bd;
  --wine: #722f37;           /* deep wine red: the arch, the runner, buttons */
  --wine-deep: #4a1520;      /* dark burgundy: text */
  --wine-soft: #9a5a60;
  --burgundy: #800020;       /* accents: blossoms, hearts, the pulse */
  --ivory: #fff9f2;          /* warm ivory: lettering on wine */
  --white: #fffcf7;
  --rose: #f5e6d3;           /* light fills (pills, plaques) */
  --rose-deep: #9a6b4f;      /* small labels */
  --blush: #800020;
  --gold: #c6a15b;
  --gold-deep: #a98545;
  --ink: #4a1520;
  --muted: #7a5150;
  --hairline: rgba(255, 249, 242, 0.85);
  --overlay: rgba(74, 21, 32, 0.92);

  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --font-script: "Great Vibes", "Segoe Script", cursive;
  --font-arabic: "Amiri", "Traditional Arabic", serif;
  --font-calligraphy: "Noto Nastaliq Urdu", "Amiri", "Traditional Arabic", serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-door: cubic-bezier(0.65, 0, 0.3, 1);

  /* The card fills a phone's width (slightly bleeding its outer pattern) and a desktop's height */
  --card-w: min(108vw, (100svh - 7rem) * 0.7095, 720px);
  --pattern-size: calc(var(--card-w) * 0.697);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper) url("../assets/pattern.webp") center top / var(--pattern-size) auto repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
button { font: inherit; }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .7rem 1.2rem; border-radius: 999px;
  background: var(--wine); color: var(--ivory); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--wine-deep); outline-offset: 3px; }
.arch :focus-visible, .gate :focus-visible, .music:focus-visible { outline-color: var(--ivory); }

/* ───────────────────────────────────────────────────────────────
   Shared: pills, script titles, reveal-on-scroll
   ─────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: .75em 1.7em;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--rose); color: var(--wine-deep);
  font-family: var(--font-sans); font-size: .72rem; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: background-color .35s ease, color .35s ease, transform .35s var(--ease-out), box-shadow .35s ease;
}
.pill svg { width: 1.25em; height: 1.25em; flex: none; }
.pill:hover { background: var(--white); transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgba(58, 16, 18, .45); }
.pill:active { transform: translateY(0); }
.pill--wine { background: var(--wine); color: var(--ivory); }
.pill--wine:hover { background: var(--wine-deep); }
.pill--outline { background: transparent; border-color: var(--wine); color: var(--wine-deep); }
.pill--outline:hover { background: rgba(81, 24, 23, .07); }

.script-title {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 3.7rem); line-height: 1.15;
  color: var(--wine); text-align: center;
}

.js-ready [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 140ms);
}
.js-ready [data-reveal].is-visible { opacity: 1; transform: none; }

/* ───────────────────────────────────────────────────────────────
   Opening: the ring-proposal portrait on pure white
   ─────────────────────────────────────────────────────────────── */
.gate { display: none; }
.js-ready .gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 1.25rem;
  background: #fff;
  cursor: pointer;
  transition: opacity 1.1s ease .35s, visibility 0s linear 1.5s;
}
.gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.gate.is-gone { display: none !important; }

.gate__inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: .7rem; text-align: center; }

/* the stage's gold frame, drawn in on white */
.gate__frame {
  --cs: clamp(70px, 15vw, 130px);
  position: absolute; inset: 10px; pointer-events: none;
  animation: fade-in 1.6s ease .1s both;
}
.gate__frame::before, .gate__frame::after { content: ""; position: absolute; border: solid var(--gold); }
.gate__frame::before { inset: calc(var(--cs) * .0875); border-width: 1.4px; border-radius: calc(var(--cs) * .1625); opacity: .85; }
.gate__frame::after  { inset: calc(var(--cs) * .15);   border-width: .7px;  border-radius: calc(var(--cs) * .15); opacity: .6; }
.gate__frame .frame-crest { top: calc(var(--cs) * .0875); width: min(48vw, 250px); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.gate__sky { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.gate__greeting {
  font-family: var(--font-script); font-size: clamp(2rem, 7vw, 2.6rem);
  color: var(--wine); line-height: 1.1;
  animation: rise 1.2s var(--ease-out) both;
}
.gate__eyebrow {
  font-size: .68rem; letter-spacing: .42em; text-transform: uppercase; color: var(--gold-deep);
  padding-left: .42em;
  animation: rise 1.2s var(--ease-out) .1s both;
}
.gate__portrait {
  width: min(88vw, 600px, (100svh - 400px) * 1.5); height: auto;
  filter: drop-shadow(0 14px 22px rgba(74, 21, 32, .16));
  animation: portrait-in 1.6s var(--ease-out) .2s both;
}
@keyframes portrait-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.gate__names {
  font-family: var(--font-calligraphy); font-weight: 600;
  font-size: clamp(1.9rem, 7vw, 2.7rem); line-height: 2.1;
  color: var(--wine);
  margin: -.5rem 0 -.55rem;
  animation: rise 1.3s var(--ease-out) .55s both;
}
.gate__names-en {
  font-family: var(--font-script); font-size: clamp(1.9rem, 6.5vw, 2.5rem); line-height: 1.15;
  color: var(--wine-deep);
  animation: rise 1.3s var(--ease-out) .65s both;
}
.gate__names-en span { color: var(--gold-deep); }
.gate__divider { width: min(56vw, 230px); height: auto; margin: -.3rem 0 -.5rem; animation: divider-draw 1.6s var(--ease-out) .8s both; }
.gate__date {
  font-family: var(--font-serif); font-weight: 600; font-size: .95rem;
  letter-spacing: .4em; padding-left: .4em; color: var(--gold-deep);
  animation: rise 1.2s var(--ease-out) .85s both;
}
.gate__button {
  min-height: 48px; padding: .85rem 2.3rem;
  border: 1px solid var(--wine); border-radius: 999px;
  background: var(--wine); color: var(--ivory);
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; padding-left: calc(2.3rem + .32em);
  cursor: pointer;
  animation: rise 1.2s var(--ease-out) .8s both;
  transition: background-color .3s ease, transform .3s var(--ease-out), box-shadow .3s ease;
}
.gate__button:hover { background: var(--wine-deep); transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(74, 21, 32, .6); }
.gate__sound { font-size: .68rem; letter-spacing: .14em; color: var(--muted); animation: rise 1.2s var(--ease-out) .95s both; }

/* "Tap to open": the portrait lifts gently and the white page dissolves into the invitation */
.gate.is-open :is(.gate__greeting, .gate__eyebrow, .gate__names, .gate__names-en, .gate__divider, .gate__date, .gate__button, .gate__sound) { animation: step-back .5s ease both; }
.gate.is-open :is(.gate__frame, .gate__sky) { opacity: 0; transition: opacity .6s ease; }
.gate.is-open .gate__portrait { animation: portrait-lift 1.4s var(--ease-out) both; }
@keyframes step-back { to { opacity: 0; transform: translateY(10px); } }
@keyframes portrait-lift { to { opacity: 0; transform: scale(1.08) translateY(-2%); } }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

/* ───────────────────────────────────────────────────────────────
   1. Hero: the invitation card, layer by layer
   ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 1.25rem 0 3.25rem;
  overflow: clip;
}

.card {
  position: relative;
  width: var(--card-w);
  aspect-ratio: 3875 / 5462;
  container-type: inline-size;
}
.card__plate {
  width: 100%; height: 100%;
  /* feather the artwork's outer edge into the page pattern so the card has no hard seam */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 3.5%, #000 93%, transparent 100%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 3.5%, #000 93%, transparent 100%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}

.card__layer, .card__portrait, .card__countdown {
  position: absolute;
  left: calc(var(--l) * 1%); top: calc(var(--t) * 1%); width: calc(var(--w) * 1%);
  height: auto;
}
.card__portrait { aspect-ratio: 985 / 764; }
.card__portrait img { width: 100%; height: 100%; }
/* a glint travels across the gilded frame now and then */
.card__shine {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("../assets/card/portrait.webp") center / 100% 100% no-repeat;
  mask: url("../assets/card/portrait.webp") center / 100% 100% no-repeat;
  background: linear-gradient(110deg, rgba(255, 246, 220, 0) 42%, rgba(255, 246, 220, .55) 50%, rgba(255, 246, 220, 0) 58%) no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  mix-blend-mode: screen;
}
.hero.is-open .card__shine { animation: shine 7s ease-in-out 3.4s infinite; }
@keyframes shine { 0% { background-position: 130% 0; } 38%, 100% { background-position: -30% 0; } }

/* the countdown hangs on an ivory plaque just under the arch */
.card__countdown { --l: 20; --t: 94.4; --w: 60; }

/* entrance choreography — runs once the doors open */
.js-ready .hero [data-step] {
  transition: opacity 1s var(--ease-out), transform 1.3s var(--ease-out), clip-path 1.5s var(--ease-door);
}
.js-ready .hero:not(.is-open) .card__plate { opacity: 0; transform: scale(1.035); }
.js-ready .card__plate { transition: opacity 1.2s ease, transform 2.2s var(--ease-out); }
.js-ready .hero:not(.is-open) [data-step] { opacity: 0; transform: translateY(1.6cqw); }
/* the portrait opens like an iris, the ornament draws outwards from its rose */
.js-ready .hero:not(.is-open) .card__portrait { transform: scale(.9); clip-path: ellipse(0% 0% at 50% 50%); }
.js-ready .hero .card__portrait { clip-path: ellipse(72% 72% at 50% 50%); }
.js-ready .hero:not(.is-open) .card__ornament { opacity: 1; transform: none; clip-path: inset(0 50% 0 50%); }
.js-ready .hero .card__ornament { clip-path: inset(0 0 0 0); }
.hero [data-step="1"] { transition-delay: .25s !important; }
.hero [data-step="2"] { transition-delay: .55s !important; }
.hero [data-step="3"] { transition-delay: 1.45s !important; }
.hero [data-step="4"] { transition-delay: 1.65s !important; }
.hero [data-step="5"] { transition-delay: 1.85s !important; }
.hero [data-step="6"] { transition-delay: 2.1s !important; }
.hero [data-step="7"] { transition-delay: 2.3s !important; }
.hero [data-step="8"] { transition-delay: 2.55s !important; }
.hero [data-step="9"] { transition-delay: 2.9s !important; }

/* countdown — digits roll upward like the reference */
.countdown { color: var(--wine); text-align: center; }
.card__countdown .countdown {
  padding: 1.7cqw 2.6cqw 1cqw;
  border: 1px solid var(--gold); border-radius: 999px;
  outline: .5px solid rgba(201, 167, 100, .55); outline-offset: -.7cqw;
  background: linear-gradient(#fffaf4, #f6ece4);
  box-shadow: 0 2cqw 4cqw -2.4cqw rgba(58, 16, 18, .55);
}
.countdown__clock {
  display: flex; justify-content: center; align-items: flex-start;
  gap: .35cqw;
}
.countdown__unit { position: relative; padding-bottom: calc(max(8px, 1.32cqw) * 1.6 + .5cqw); }
.countdown__value {
  display: flex;
  font-family: var(--font-serif); font-weight: 600;
  font-size: 5.2cqw; line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown__sep {
  font-family: var(--font-serif); font-weight: 600; font-size: 4.8cqw; line-height: .95;
  color: var(--gold);
}
.countdown__label {
  font-size: max(8px, 1.32cqw); letter-spacing: .22em; text-transform: uppercase; color: var(--rose-deep);
  position: absolute; left: 50%; bottom: 0; translate: -50% 0;
  white-space: nowrap; padding-left: .22em;
}
.digit { position: relative; display: block; width: .56em; height: 1.05em; overflow: hidden; }
.digit > span { position: absolute; inset: 0; text-align: center; }
.digit > .is-in  { animation: digit-in .55s var(--ease-out) both; }
.digit > .is-out { animation: digit-out .55s var(--ease-out) both; }
@keyframes digit-in  { from { transform: translateY(85%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes digit-out { from { transform: none; opacity: 1; } to { transform: translateY(-85%); opacity: 0; } }

.countdown__done {
  font-family: var(--font-script); font-size: 5cqw; line-height: 1.2; color: var(--wine);
  padding: 0 1em;
}

.scroll-cue {
  position: absolute; bottom: .9rem; left: 50%; translate: -50% 0;
  display: grid; justify-items: center; gap: .45rem;
  color: var(--wine-deep); text-decoration: none;
  font-size: .62rem; letter-spacing: .35em; text-transform: uppercase; padding-left: .35em;
}
.scroll-cue__line { width: 1px; height: 26px; background: linear-gradient(var(--wine), transparent); transform-origin: top; animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ───────────────────────────────────────────────────────────────
   2. The stage — Om Kalthoum at the top of the staircase
   Idle: as in the reference, the illustration is still and only
   "Tap to Listen" moves. While the song plays (.is-performing on
   <html>), the scene performs; --level carries the music's loudness.
   ─────────────────────────────────────────────────────────────── */
.stage {
  --level: 0;
  --cs: clamp(78px, 19vw, 150px);   /* frame corner size */
  position: relative;
  min-height: 100svh;
  display: grid; justify-items: center; align-content: start;
  padding-top: calc(var(--cs) * .62);
  overflow: clip;
  isolation: isolate;
}
.stage__scene {
  --sw: min(118vw, 640px, (100svh - 11rem) * 0.79);
  position: relative; z-index: 2;
  width: var(--sw);
  justify-self: start;
  margin-left: calc(50% - var(--sw) / 2);   /* centred even when wider than a phone */
  aspect-ratio: 600 / 760;
}
/* paper grain over the whole illustrated scene */
.stage::after, .venue-card::after {
  content: ""; position: absolute; inset: 0; z-index: 6;
  background: url("../assets/art/paper.png") repeat;
  mix-blend-mode: multiply; opacity: .45;
  pointer-events: none;
}

/* warm washes and drifting light */
.stage__sky {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(55% 38% at 50% 44%, rgba(255, 249, 232, .9), rgba(255, 249, 232, 0) 72%),
    radial-gradient(38% 28% at 14% 18%, rgba(255, 236, 200, .55), transparent 70%),
    radial-gradient(42% 32% at 88% 26%, rgba(198, 161, 91, .18), transparent 70%),
    radial-gradient(60% 30% at 50% 100%, rgba(190, 177, 160, .22), transparent 70%);
}
.stage__light { position: absolute; inset: -10% 0 0; }
.ray {
  position: absolute; top: -12%;
  width: clamp(70px, 16vw, 190px); height: 95%;
  background: linear-gradient(to bottom, rgba(255, 238, 196, .95), rgba(255, 238, 196, .3) 55%, rgba(255, 238, 196, 0) 88%);
  filter: blur(14px);
  transform-origin: 50% 0;
  opacity: .5;
  animation: ray-breathe 11s ease-in-out infinite;
  will-change: opacity, transform;
}
.ray--1 { left: 12%; rotate: 22deg; animation-delay: -2s; }
.ray--2 { left: 30%; rotate: 10deg; animation-duration: 13s; }
.ray--3 { left: 47%; rotate: -2deg; width: clamp(90px, 20vw, 240px); animation-delay: -6s; }
.ray--4 { left: 63%; rotate: -12deg; animation-duration: 9s; animation-delay: -4s; }
.ray--5 { left: 78%; rotate: -24deg; animation-delay: -8s; }
@keyframes ray-breathe {
  0%, 100% { opacity: .4; transform: rotate(-1.5deg) scaleY(.96); }
  50%      { opacity: .95; transform: rotate(1.5deg) scaleY(1.02); }
}
.is-performing .ray { animation-duration: 5s; }

/* ornamental frame */
.stage__frame { position: absolute; inset: 10px; z-index: 5; pointer-events: none; }
.stage__frame::before, .stage__frame::after {
  content: ""; position: absolute; border: solid #c9a764;
}
.stage__frame::before { inset: calc(var(--cs) * .0875); border-width: 1.4px; border-radius: calc(var(--cs) * .1625); opacity: .85; }
.stage__frame::after  { inset: calc(var(--cs) * .15);   border-width: .7px;  border-radius: calc(var(--cs) * .15); opacity: .6; }
.frame-corner { position: absolute; width: var(--cs); height: var(--cs); z-index: 1; }
.frame-corner--tl { top: 0; left: 0; }
.frame-corner--tr { top: 0; right: 0; scale: -1 1; }
.frame-corner--bl { bottom: 0; left: 0; scale: 1 -1; }
.frame-corner--br { bottom: 0; right: 0; scale: -1 -1; }
.frame-crest {
  position: absolute; z-index: 1; left: 50%; top: calc(var(--cs) * .0875);
  width: min(58vw, 300px); height: auto;
  translate: -50% -66.7%;
}

/* wide screens: garlands and lanterns fill the frame's sides */
.stage__sides { display: none; }
@media (min-width: 900px) {
  .stage__sides { display: block; position: absolute; inset: 10px; z-index: 3; pointer-events: none; }
  .stage__garland { position: absolute; bottom: 4%; height: 74%; width: auto; opacity: .95; }
  .stage__garland--left  { left: calc(var(--cs) * .15); }
  .stage__garland--right { right: calc(var(--cs) * .15); height: 62%; }
  .stage .lantern--stage { top: calc(var(--cs) * .15); width: clamp(58px, 5vw, 80px); pointer-events: auto; }
  .lantern--stage-l { left: 15%; }
  .lantern--stage-r { right: 15%; animation-delay: -3s; }
  .js-ready .stage .stage__sides { opacity: 0; transition: opacity 2s ease .8s; }
  .js-ready .stage.is-intro .stage__sides { opacity: 1; }
}

/* names */
.stage__title { position: relative; z-index: 4; text-align: center; padding: 0 1.25rem; margin-bottom: -1.2rem; }
.stage__eyebrow {
  font-size: .66rem; letter-spacing: .42em; text-transform: uppercase; color: var(--wine-deep);
  padding-left: .42em; margin-bottom: .35rem;
}
.stage__names {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(2.9rem, 12vw, 5rem); line-height: 1.1;
  color: var(--wine-deep);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: .28em;
}
.stage__amp { color: var(--gold-deep); font-size: .8em; }
.stage__arabic {
  font-family: var(--font-calligraphy); font-weight: 600;
  font-size: clamp(1.7rem, 6.4vw, 2.4rem); line-height: 2.1;
  color: var(--burgundy);
  margin: -.55rem 0 -.15rem;
}
.stage__sub {
  margin-top: .4rem;
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(.8rem, 2.8vw, .95rem); letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); padding-left: .28em;
}
.stage__date { display: block; margin-top: .2rem; font-size: .92em; letter-spacing: .36em; color: var(--gold-deep); }

/* branches: sway together like a breeze; tap to rustle */
.stage__branches { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.branch-wrap { position: absolute; width: 50%; }
.branch-wrap--left  { left: -12%; top: 8%; }
.branch-wrap--right { right: -16%; top: 62%; width: 44%; scale: -1 -1; }  /* flipped in place: grows up from the lower right */
.branch {
  display: block; width: 100%; height: auto;
  transform-origin: 0 14%;
  animation: breeze 7s ease-in-out infinite;
  pointer-events: auto; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-drag: none;
}
.branch-wrap--right .branch { animation-delay: -1.3s; animation-duration: 8s; }
.branch.is-rustling { animation: rustle .9s ease-out 1, breeze 7s ease-in-out .9s infinite; }
@keyframes breeze { 0%, 100% { rotate: 0deg; } 35% { rotate: 2.4deg; } 70% { rotate: -1deg; } }
@keyframes rustle { 0% { rotate: 0deg; } 20% { rotate: 6deg; } 45% { rotate: -4deg; } 70% { rotate: 2deg; } 100% { rotate: 0deg; } }

/* intro: the opening scene plays once the doors open */
.js-ready .stage [data-intro] { opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease, transform 1.4s var(--ease-out); }
.js-ready .stage [data-intro="1"] { transition-delay: .9s; }
.js-ready .stage [data-intro="2"] { transition-delay: 1.15s; }
.js-ready .stage [data-intro="3"] { transition-delay: 1.5s; }
.js-ready .stage.is-intro [data-intro] { opacity: 1; transform: none; }
.js-ready .stage .stage__frame, .js-ready .stage .stage__branches { opacity: 0; transition: opacity 1.8s ease .5s; }
.js-ready .stage.is-intro .stage__frame, .js-ready .stage.is-intro .stage__branches { opacity: 1; }
.js-ready .stage .branch-wrap { transition: transform 2.2s var(--ease-out) .4s; }
.js-ready .stage:not(.is-intro) .branch-wrap--left  { transform: translate(-30px, -20px) rotate(-6deg); }
.js-ready .stage:not(.is-intro) .branch-wrap--right { transform: translate(30px, -20px) rotate(6deg); }

/* swallows */
.birds { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.bird {
  position: absolute; left: 0; top: 0;
  width: clamp(44px, 9vw, 72px); height: auto;
  pointer-events: auto; cursor: pointer;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.bird img { display: block; width: 100%; height: auto; animation: bird-glide 1.8s ease-in-out infinite alternate; filter: drop-shadow(0 6px 8px rgba(74, 21, 32, .22)); }
.bird.is-gliding img { animation-duration: 3s; }
.bird.is-startled img { animation-duration: .25s; }

/* butterfly over the venue card */
.butterfly-zone { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.butterfly { position: absolute; left: 0; top: 0; width: clamp(24px, 4.6vw, 36px); will-change: transform; }
.butterfly__wing { transform-box: view-box; transform-origin: 20px 18px; animation: wing .22s ease-in-out infinite alternate; }
@keyframes wing { from { transform: scaleX(1); } to { transform: scaleX(.18); } }

/* The romantic sky (from the reference invitation): a fixed layer between the page's
   damask and the content. Gilded birds and heart-tipped arrows cross the screen on
   their own lanes; gold stars twinkle; small wine hearts rise. */
main { position: relative; z-index: 1; }
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky:not(.is-active) * { animation-play-state: paused !important; }
.sky__star { position: absolute; height: auto; opacity: 0; animation: star-twinkle 4.5s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(255, 241, 193, .8)); }
@keyframes star-twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0deg); } 50% { opacity: .85; transform: scale(1) rotate(20deg); } }
.sky__heart { position: absolute; bottom: -40px; display: block; opacity: .4; animation: heart-rise linear infinite; }
.sky__heart svg { display: block; }
@keyframes heart-rise {
  0% { transform: translate(0, 0) scale(.8); opacity: 0; }
  10% { opacity: .55; }
  50% { transform: translate(30px, -55vh) scale(1); }
  90% { opacity: .45; }
  100% { transform: translate(-10px, -112vh) scale(1.1); opacity: 0; }
}
.sky__flyer { position: absolute; left: 0; display: block; opacity: 0; animation-timing-function: linear; animation-iteration-count: infinite; animation-fill-mode: both; }
.sky__flyer img, .sky__flyer svg { display: block; width: 100%; height: auto; }
.sky__flyer--ltr { animation-name: fly-ltr; }
.sky__flyer--rtl { animation-name: fly-rtl; }
.sky__flyer--rtl img { scale: -1 1; }
/* travel takes the first 60% of each cycle, then the flyer rests off-screen */
@keyframes fly-ltr {
  0% { transform: translate(-30vw, 0); opacity: 0; }
  4% { opacity: .9; }
  15% { transform: translate(12vw, -4vh); }
  30% { transform: translate(45vw, 3vh); }
  45% { transform: translate(80vw, -3vh); }
  56% { opacity: .9; }
  60%, 100% { transform: translate(125vw, 2vh); opacity: 0; }
}
@keyframes fly-rtl {
  0% { transform: translate(125vw, 0); opacity: 0; }
  4% { opacity: .9; }
  15% { transform: translate(85vw, 4vh); }
  30% { transform: translate(50vw, -3vh); }
  45% { transform: translate(15vw, 3vh); }
  56% { opacity: .9; }
  60%, 100% { transform: translate(-30vw, -2vh); opacity: 0; }
}
.sky__bird img { animation: bird-glide 1.8s ease-in-out infinite alternate; filter: drop-shadow(0 6px 8px rgba(74, 21, 32, .25)); }
.sky__arrow { width: 96px; }
.sky__arrow svg { transform: rotate(var(--tilt, 0deg)); filter: drop-shadow(0 0 6px rgba(243, 217, 139, .7)); }
@keyframes bird-glide { from { transform: translateY(-4px) rotate(-2deg) scaleY(.96); } to { transform: translateY(4px) rotate(2deg) scaleY(1.04); } }
@media (max-width: 640px) {
  .sky__bird { width: 52px !important; }
  .sky__arrow { width: 72px; }
  .sky__heart:nth-of-type(n + 4) { display: none; }
}

/* ambient petals + gold dust (one canvas for the whole page) */
.ambient { position: fixed; inset: 0; z-index: 55; width: 100vw; height: 100vh; pointer-events: none; }
/* the white opening screen stays still and clean: petals appear once the invitation opens */
.js-ready:not(.is-opened) .ambient { opacity: 0; }
.ambient { transition: opacity 1.5s ease .6s; }

/* when the tab is hidden, everything decorative rests */
.is-page-hidden *, .is-page-hidden *::before, .is-page-hidden *::after { animation-play-state: paused !important; }
.stage__layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
/* glow and rays are compositor-only layers centred on the halo (300, 330 of 600×760) */
.stage__glow {
  position: absolute; left: 0; top: 3.95%; width: 100%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 253, 246, .95), rgba(246, 240, 226, .6) 42%, rgba(246, 240, 226, 0));
  transform: scale(calc(1 + var(--level) * 0.09));
  opacity: calc(.82 + var(--level) * .18);
  transition: transform .12s linear, opacity .12s linear;
  will-change: transform, opacity;
}
.stage__rays { transform-origin: 50% 43.42%; will-change: transform; }

.st-tread { fill: #ebe4d4; }
.st-riser { fill: #d3c8b2; }
.st-landing { fill: #e6decb; }
.st-runner { fill: var(--wine); }
.st-runner-riser { fill: var(--wine-deep); }

/* every moving part pivots in the artwork's own coordinates */
.st-mic, .st-scarf, .st-arm, .st-head, .st-mouth,
.musician__body, .musician__head, .musician__strum, .musician__fingers {
  transform-box: view-box;
}
.st-mic       { transform-origin: 334px 0; }
.st-scarf     { transform-origin: 334px 368px; }
.st-arm       { transform-origin: 270px 280px; }
.st-head      { transform-origin: 300px 262px; }
.st-mouth     { transform-origin: 300px 248px; }

/* entrance: the scene settles in as it scrolls into view */
.js-ready .stage__scene :is(.st-halo, .stage__rays) { opacity: 0; transition: opacity 1.6s ease .1s; }
.js-ready .stage__scene:not(.is-visible) .stage__glow { opacity: 0; }
.js-ready .stage__scene .st-mic-drop { transform: translateY(-60px); transition: transform 1.8s var(--ease-out) .35s; }
.js-ready .stage__scene .st-singer { opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease .2s, transform 1.4s var(--ease-out) .2s; }
.js-ready .stage__scene .st-stairs { opacity: 0; transition: opacity 1.2s ease; }
.js-ready .stage__scene .listen { opacity: 0; transition: opacity 1s ease 1s; }
.js-ready .stage__scene.is-visible :is(.st-halo, .stage__rays),
.js-ready .stage__scene.is-visible .st-singer,
.js-ready .stage__scene.is-visible .st-stairs,
.js-ready .stage__scene.is-visible .listen { opacity: 1; transform: none; }
.js-ready .stage__scene.is-visible .st-mic-drop { transform: none; }

/* performance: loops defined once, paused unless the music is playing */
.stage__rays { animation: spin 120s linear infinite; }
.st-mic      { animation: mic-sway 3.6s ease-in-out infinite; }
.st-scarf    { animation: scarf-sway 2.8s ease-in-out infinite; }
.st-arm      { animation: arm-gesture 4.2s ease-in-out infinite; }
.st-head     { animation: head-sway 3.4s ease-in-out infinite; }
.st-mouth    { animation: sing 0.9s ease-in-out infinite; }
.stage__rays, .st-mic, .st-scarf, .st-arm, .st-head, .st-mouth,
.musician__body, .musician__head, .musician__strum, .musician__fingers,
.hang-oud, .stage__notes span { animation-play-state: paused; }
.is-performing :is(.stage__rays, .st-mic, .st-scarf, .st-arm, .st-head, .st-mouth,
  .musician__body, .musician__head, .musician__strum, .musician__fingers,
  .hang-oud, .stage__notes span) { animation-play-state: running; }

/* the halo breathes with the music's loudness (see .stage__glow) */
/* no analyser available (e.g. opened from a file): pulse at the song's tempo */
.is-performing.no-analyser .stage__glow { animation: glow-beat var(--beat, .9s) ease-in-out infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes mic-sway   { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes scarf-sway { 0%, 100% { transform: rotate(-2.5deg) skewX(0); } 50% { transform: rotate(3deg) skewX(-2deg); } }
@keyframes arm-gesture { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(5deg); } 65% { transform: rotate(2deg); } }
@keyframes head-sway  { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.8deg); } }
@keyframes sing { 0%, 100% { transform: scaleY(.55); } 40% { transform: scaleY(1.15); } 70% { transform: scaleY(.8); } }
@keyframes glow-beat { 0%, 100% { transform: scale(1); opacity: .82; } 50% { transform: scale(1.06); opacity: 1; } }

/* notes drifting up from the microphone */
.stage__notes {
  position: absolute; left: 56.5%; top: 23%;
  width: 1px; height: 1px;
  opacity: 0; transition: opacity .8s ease;
  pointer-events: none;
}
.is-performing .stage__notes { opacity: 1; }
.stage__notes span {
  position: absolute; left: 0; top: 0;
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", serif;
  font-size: clamp(14px, 3.4vw, 20px); line-height: 1;
  color: var(--wine-deep);
  opacity: 0;
  animation: note-rise 5.4s ease-out infinite;
}
.stage__notes span:nth-child(2) { animation-delay: -.9s;  --dx: -38px; color: var(--rose-deep); }
.stage__notes span:nth-child(3) { animation-delay: -1.8s; --dx: 30px; }
.stage__notes span:nth-child(4) { animation-delay: -2.7s; --dx: -18px; color: var(--burgundy); }
.stage__notes span:nth-child(5) { animation-delay: -3.6s; --dx: 44px; color: var(--rose-deep); }
.stage__notes span:nth-child(6) { animation-delay: -4.5s; --dx: -50px; }
@keyframes note-rise {
  0%   { transform: translate(0, 0) rotate(-8deg) scale(.7); opacity: 0; }
  12%  { opacity: .95; }
  100% { transform: translate(var(--dx, 24px), -150px) rotate(10deg) scale(1.05); opacity: 0; }
}

/* "Tap to Listen" — sits beside the microphone, gently wavering like the reference */
.listen {
  position: absolute; left: 60%; top: 20.5%;
  width: 35%; aspect-ratio: 220 / 150;
  padding: 0; border: 0; border-radius: 1rem;
  background: none; color: var(--wine-deep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.listen__art { width: 100%; height: 100%; overflow: visible; animation: waver 3.2s ease-in-out infinite; transform-origin: 40% 60%; }
.listen__text { font-family: var(--font-script); font-size: 30px; fill: currentColor; }
.listen__text--playing { display: none; }
.listen[aria-pressed="true"] .listen__text--idle { display: none; }
.listen[aria-pressed="true"] .listen__text--playing { display: inline; }
.listen__clef { color: var(--wine); }
.listen__note { animation: note-bob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.listen__note:nth-child(2) { animation-delay: -.6s; }
.listen__note:nth-child(3) { animation-delay: -1.2s; }
.listen__note:nth-child(4) { animation-delay: -1.8s; }
.listen:hover .listen__art { filter: drop-shadow(0 0 6px rgba(246, 240, 226, .95)); }
.listen:focus-visible { outline: 2px solid var(--wine-deep); outline-offset: 4px; }
@keyframes waver { 0%, 100% { transform: rotate(-1.6deg) translateY(0); } 50% { transform: rotate(1.4deg) translateY(-3px); } }
@keyframes note-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ───────────────────────────────────────────────────────────────
   Musicians (static in the reference; they play while the music does)
   ─────────────────────────────────────────────────────────────── */
.musician {
  position: absolute; z-index: 2;
  bottom: -2%;
  width: 36%; height: auto; aspect-ratio: 220 / 280;
  overflow: visible;
  pointer-events: none;
}
.musician--nay { left: -12%; }
.musician--oud { right: -12%; }
.musician__body    { transform-origin: 110px 170px; animation: body-sway 3.2s ease-in-out infinite; }
.musician__head    { transform-origin: 110px 68px;  animation: head-nod 1.6s ease-in-out infinite; }
.musician__strum   { transform-origin: 78px 132px;  animation: strum .36s ease-in-out infinite alternate; }
.musician__fingers { transform-origin: 70px 112px;  animation: fingers .5s steps(2, jump-none) infinite alternate; }
.musician--oud .musician__body { animation-duration: 3.8s; animation-delay: -1s; }
@keyframes body-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.2deg); } }
@keyframes head-nod  { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg) translateY(1px); } }
@keyframes strum     { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes fingers   { from { transform: translate(0, 0); } to { transform: translate(1.5px, -2px); } }

/* ───────────────────────────────────────────────────────────────
   3. Message arch — the card's arch, re-told
   ─────────────────────────────────────────────────────────────── */
.message {
  display: grid; justify-items: center;
  padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(4rem, 10vw, 7rem);
  overflow: clip;
}

.arch-scene {
  --aw: min(80vw, 440px);
  position: relative;
  width: var(--aw);
  margin-top: 0;
}
.arch {
  position: relative;
  width: 100%;
  min-height: calc(var(--aw) * 1.45);
  display: grid; align-content: center;
  border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 3px 3px;
  background: var(--wine);
  color: var(--white);
  box-shadow: 0 30px 60px -40px rgba(58, 16, 18, .55);
}
.arch::before {
  content: ""; position: absolute; inset: calc(var(--aw) * .024);
  border: 1px solid var(--hairline);
  border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 2px 2px;
  pointer-events: none;
}
.arch__content {
  position: relative;
  display: grid; justify-items: center; gap: 1.35rem;
  /* bottom: room for the two musicians seated at the arch's corners */
  padding: calc(var(--aw) * .26) 13% calc(var(--aw) * .4);
  text-align: center;
}
.arch__ornament { width: 34px; height: 34px; color: var(--rose); }
.arch__arabic {
  font-family: var(--font-arabic); font-weight: 400;
  font-size: clamp(1.25rem, 4.6vw, 1.6rem); line-height: 1.9;
  color: var(--ivory);
}
.arch__text {
  font-size: clamp(.68rem, 2.5vw, .78rem); font-weight: 300;
  line-height: 2.1; letter-spacing: .2em; text-transform: uppercase;
}
.arch__actions { display: grid; justify-items: center; gap: .7rem; }
.arch__deadline { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }

/* Placed exactly where they sit on the card (arch = 2880 artwork px wide,
   dome top at y 406), so the foliage meets the arch's sides and dome as printed. */
.arch-scene__garland {
  position: absolute; z-index: 1;
  height: auto;
  pointer-events: none;
}
.arch-scene__garland--left  { width: 26.389%; left: -17.257%; top: calc(var(--aw) * .3903); transform-origin: 68% 100%; }
.arch-scene__garland--right { width: 26.910%; left: 90.382%;  top: calc(var(--aw) * .1264); transform-origin: 36% 100%; }
.arch-scene.is-visible .arch-scene__garland--left  { animation: sway-l 9s ease-in-out 1.2s infinite; }
.arch-scene.is-visible .arch-scene__garland--right { animation: sway-r 10s ease-in-out 1.2s infinite; }
/* gentle: the inner edge meets the arch, so a big sway would open a gap */
@keyframes sway-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-.5deg); } }
@keyframes sway-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(.5deg); } }

/* ───────────────────────────────────────────────────────────────
   3. Details
   ─────────────────────────────────────────────────────────────── */
.details {
  position: relative;
  display: grid; justify-items: center; gap: clamp(2.6rem, 7vw, 3.6rem);
  padding: clamp(3rem, 8vw, 5rem) 1rem clamp(4rem, 10vw, 6rem);
  overflow: clip;
}
.details__garland {
  position: absolute; z-index: 0;
  width: clamp(54px, 11vw, 150px); height: auto;
  pointer-events: none;
}
.details__garland--left  { left: 0; top: 4%; }
.details__garland--right { right: 0; bottom: 3%; }

/* ouds hanging beside the details, as in the reference */
.hang-oud {
  position: absolute; z-index: 0;
  width: clamp(48px, 9vw, 110px); height: auto;
  transform-origin: 50% 0;
  animation: oud-swing 4.6s ease-in-out infinite;
  pointer-events: none;
}
.hang-oud--left  { left: clamp(6px, 3vw, 40px); bottom: 6%; rotate: -14deg; }
.hang-oud--right { right: clamp(6px, 3vw, 40px); top: 30%; rotate: 12deg; animation-delay: -2.3s; }
@keyframes oud-swing { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

.detail {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: .65rem;
  max-width: 30rem; padding: 0 clamp(2.6rem, 9vw, 3rem);
  text-align: center;
}
.detail__icon {
  width: 46px; height: 46px; color: var(--wine); margin-bottom: .2rem;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s var(--ease-out) .3s;
}
.detail.is-visible .detail__icon, html:not(.js-ready) .detail__icon { stroke-dashoffset: 0; }
.detail__title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.3rem, 4.8vw, 1.6rem); line-height: 1.25;
  letter-spacing: .06em; text-transform: uppercase; color: var(--wine-deep);
}
.detail__text { font-family: var(--font-serif); font-weight: 500; font-size: 1.15rem; line-height: 1.5; color: var(--muted); }
.detail__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: .5rem; }
.detail__photo { width: min(100%, 26rem); margin-top: .6rem; border-radius: calc(min(100vw, 26rem) / 2) calc(min(100vw, 26rem) / 2) 4px 4px; overflow: hidden; }
.detail__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ───────────────────────────────────────────────────────────────
   4. Closing
   ─────────────────────────────────────────────────────────────── */
.closing {
  display: grid; justify-items: center; gap: 1.3rem;
  padding: clamp(2rem, 6vw, 4rem) 1rem calc(clamp(4rem, 10vw, 6rem) + env(safe-area-inset-bottom));
  text-align: center;
}
.keepsake {
  width: min(78vw, 420px); margin-bottom: 1.2rem;
  box-shadow: 0 34px 60px -36px rgba(58, 16, 18, .6), 0 2px 6px rgba(58, 16, 18, .12);
}
.js-ready .keepsake[data-reveal] { transform: translateY(40px) rotate(-2.5deg) scale(.97); }
.js-ready .keepsake[data-reveal].is-visible { transform: none; }
.closing__names { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; letter-spacing: .32em; text-transform: uppercase; color: var(--wine-deep); padding-left: .32em; }
.closing__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: .6rem; }
.closing__arabic { font-family: var(--font-calligraphy); font-weight: 600; font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 2.1; color: var(--burgundy); margin: -1.2rem 0 -.6rem; }
.closing__foot { margin-top: 1.6rem; font-size: .66rem; letter-spacing: .4em; color: var(--muted); }

/* ───────────────────────────────────────────────────────────────
   Music control & toast
   ─────────────────────────────────────────────────────────────── */
.music {
  position: fixed; z-index: 40;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); background: var(--wine); color: var(--ivory);
  box-shadow: 0 10px 24px -12px rgba(58, 16, 18, .6);
  cursor: pointer;
  transition: transform .3s var(--ease-out), background-color .3s ease;
}
.music:hover { transform: scale(1.06); background: var(--wine-deep); }
.music__note { width: 20px; height: 20px; grid-area: 1 / 1; }
.music__bars { grid-area: 1 / 1; display: none; gap: 3px; align-items: flex-end; height: 16px; }
.music__bars i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: bars 1s ease-in-out infinite; }
.music__bars i:nth-child(2) { animation-delay: -.35s; }
.music__bars i:nth-child(3) { animation-delay: -.7s; }
.music[aria-pressed="true"] .music__note { display: none; }
.music[aria-pressed="true"] .music__bars { display: flex; }
@keyframes bars { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom));
  translate: -50% 0;
  padding: .7rem 1.3rem; border-radius: 999px;
  background: var(--overlay); color: var(--ivory);
  font-size: .75rem; letter-spacing: .08em;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .35s ease, transform .35s var(--ease-out);
}
.toast.is-shown { opacity: 1; transform: none; }

/* ───────────────────────────────────────────────────────────────
   Connective tissue: dividers, vines, lanterns
   ─────────────────────────────────────────────────────────────── */
.scroll-cue { z-index: 7; }

/* gold dividers draw outward from their centre star */
.divider { display: block; width: min(72vw, 360px); height: auto; margin: 0 auto; }
/* (the clip lives in the animation, so the element stays observable while hidden) */
.js-ready .divider[data-reveal] { transform: none; }
.js-ready .divider[data-reveal].is-visible { animation: divider-draw 1.6s var(--ease-out) both; }
@keyframes divider-draw { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }

/* vines grow up the sides of the invitation card on wide screens */
.hero { isolation: isolate; }
.vine { display: none; position: absolute; top: 8%; bottom: 8%; width: 110px; z-index: -1; pointer-events: none; }
.vine--left  { left: max(1rem, calc(50% - var(--card-w) / 2 - 150px)); }
.vine--right { right: max(1rem, calc(50% - var(--card-w) / 2 - 150px)); scale: -1 1; }
@media (min-width: 980px) { .vine { display: block; } }
.vine svg { width: 100%; height: 100%; overflow: visible; }
.vine__stem { fill: none; stroke: #8a5a4a; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3.4s var(--ease-out); }
.vine__leaf { opacity: 0; scale: .2; transform-box: fill-box; transform-origin: 0 50%; transition: opacity .8s ease, scale 1.1s var(--ease-out); }
.vine.is-grown .vine__stem { stroke-dashoffset: 0; }
.vine.is-grown .vine__leaf { opacity: 1; scale: 1; }

/* Egyptian lanterns over the message arch: they swing, and glow with the music */
.lantern {
  position: absolute; z-index: 3; top: -2%;
  width: 14%; height: auto;
  transform-origin: 50% 0;
  animation: lantern-swing 6s ease-in-out infinite;
  filter: brightness(calc(1 + var(--level, 0) * .3)) drop-shadow(0 6px 10px rgba(120, 90, 40, .18));
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lantern--left  { left: 1%; }
.lantern--right { right: 1%; animation-delay: -2.4s; animation-duration: 6.8s; }
.lantern.is-swinging { animation: lantern-tap 1.8s ease-out 1, lantern-swing 6s ease-in-out 1.8s infinite; }
@keyframes lantern-swing { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes lantern-tap { 0% { rotate: 0deg; } 15% { rotate: 9deg; } 35% { rotate: -6deg; } 55% { rotate: 4deg; } 75% { rotate: -2deg; } 100% { rotate: 0deg; } }

/* ───────────────────────────────────────────────────────────────
   Venue scene: a botanical arch with a chandelier
   ─────────────────────────────────────────────────────────────── */
.venue-card {
  --vw: min(88vw, 470px);
  position: relative; z-index: 1;
  width: var(--vw);
  margin-top: calc(var(--vw) * .06);
  padding: calc(var(--vw) * .5) clamp(1.4rem, 7vw, 2.6rem) calc(var(--vw) * .16);
  border-radius: calc(var(--vw) / 2) calc(var(--vw) / 2) 6px 6px;
  background:
    radial-gradient(70% 40% at 50% 18%, rgba(255, 246, 222, .95), rgba(255, 246, 222, 0) 70%),
    linear-gradient(#faf6ec, #f3ecdd);
  box-shadow: 0 40px 70px -46px rgba(60, 50, 30, .55), 0 2px 8px rgba(60, 50, 30, .06);
  text-align: center;
}
.venue-card::after { border-radius: inherit; opacity: .35; }
.venue-card__inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: .9rem; }
/* double gold border, echoing the card's hairline */
.venue-card::before {
  content: ""; position: absolute; inset: 10px; z-index: 1; pointer-events: none;
  border: 1.2px solid #c9a764; outline: .6px solid rgba(201, 167, 100, .55); outline-offset: -7px;
  border-radius: calc(var(--vw) / 2 - 10px) calc(var(--vw) / 2 - 10px) 3px 3px;
}
.venue-card__chandelier {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--vw) * .05);
  width: 44%; height: auto;
  translate: -50% 0;
  transform-origin: 50% 0;
  animation: lantern-swing 9s ease-in-out infinite;
}
.venue-card__chandelier:hover { filter: brightness(1.08) drop-shadow(0 0 10px rgba(255, 226, 160, .7)); }
.venue-card__branch { position: absolute; z-index: 1; width: 50%; pointer-events: none; }
.venue-card__branch img { width: 100%; height: auto; transform-origin: 0 14%; animation: breeze 8s ease-in-out infinite; }
.venue-card__branch--tl { top: 9%; left: -17%; rotate: -14deg; }
.venue-card__branch--br { bottom: -9%; right: -24%; width: 46%; }
.venue-card .pill--outline { background: #faf6ec; }
.venue-card .pill--outline:hover { background: #f0ebde; }
.venue-card__branch--br img { scale: -1 -1; animation-delay: -3s; }

.venue-card__eyebrow { font-size: .66rem; letter-spacing: .42em; text-transform: uppercase; color: var(--rose-deep); padding-left: .42em; }
.date-block { display: grid; justify-items: center; gap: .1rem; color: var(--wine-deep); }
.date-block__weekday { font-size: .78rem; letter-spacing: .36em; text-transform: uppercase; padding-left: .36em; }
.date-block__month { font-family: var(--font-script); font-size: clamp(2.2rem, 9vw, 2.8rem); line-height: 1.1; color: var(--wine); }
.date-block__row { display: flex; align-items: center; gap: 1rem; }
.date-block__line { width: clamp(2.4rem, 12vw, 4rem); height: 1px; background: linear-gradient(90deg, transparent, #c9a764 30%, #c9a764 70%, transparent); }
.date-block__day { font-family: var(--font-serif); font-weight: 700; font-size: clamp(3.6rem, 16vw, 4.8rem); line-height: .95; font-variant-numeric: lining-nums; }
.date-block__year { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; letter-spacing: .5em; padding-left: .5em; color: var(--muted); }

.venue-card__time { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wine-deep); }
.venue-card__time svg { width: 24px; height: 24px; color: var(--wine); }
.venue-card__note { font-family: var(--font-serif); font-weight: 500; font-size: 1.02rem; color: var(--muted); margin-top: -.4rem; }
.venue-card__divider { width: 78%; height: auto; margin: .2rem 0; }

.venue-card__place { display: grid; justify-items: center; gap: .45rem; }
.venue-card__pin { width: 34px; height: 34px; color: var(--wine); }
.venue-card__venue { font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.2rem, 5vw, 1.55rem); letter-spacing: .07em; text-transform: uppercase; color: var(--wine-deep); line-height: 1.25; max-width: 20rem; }
.venue-card__venue a { text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 50% 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out), color .3s ease; }
.venue-card__venue a[href]:hover { background-size: 100% 1px; color: var(--wine); }
/* an Arabic venue name: no capitals or letter-spacing, which would break the joined letters */
.venue-card__venue a:lang(ar) { font-family: var(--font-arabic); font-weight: 700; font-size: clamp(1.9rem, 7.5vw, 2.4rem); letter-spacing: 0; text-transform: none; line-height: 1.5; }
.venue-card__address { font-family: var(--font-serif); font-weight: 500; font-size: 1.05rem; color: var(--muted); }
.venue-card__actions, .venue-card__calendar { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .3rem; }
/* live countdown inside the venue card */
.venue-card__countdown { display: grid; justify-items: center; gap: .55rem; margin-top: .3rem; }
.countdown--venue { color: var(--wine-deep); }
.countdown--venue .countdown__clock { gap: .3rem; }
.countdown--venue .countdown__unit {
  padding: .55rem .5rem 1.45rem; min-width: 3.6rem;
  border: 1px solid rgba(201, 167, 100, .6); border-radius: .8rem;
  background: linear-gradient(#fffcf7, #f7efe6);
}
.countdown--venue .countdown__value { font-size: clamp(1.9rem, 8.4vw, 2.5rem); justify-content: center; }
.countdown--venue .countdown__sep { font-size: clamp(1.5rem, 6vw, 1.9rem); line-height: 2.1; }
.countdown--venue .countdown__label { font-size: .56rem; bottom: .5rem; }
.countdown--venue .countdown__done { font-size: 2.2rem; }

/* "Add to calendar" opens a small menu of calendars */
.cal-menu { position: relative; display: inline-grid; justify-items: center; }
.cal-menu__options {
  position: absolute; z-index: 8; bottom: calc(100% + .6rem); left: 50%; translate: -50% 0;
  display: grid; min-width: 14.5rem; padding: .45rem;
  border: 1px solid rgba(201, 167, 100, .65); border-radius: 1.1rem;
  background: #fffaf4;
  box-shadow: 0 26px 44px -24px rgba(58, 16, 18, .6);
  animation: menu-in .35s var(--ease-out) both;
}
.cal-menu__item {
  display: block; padding: .8rem 1rem;
  border: 0; border-radius: .75rem;
  background: none; color: var(--wine-deep);
  font-family: var(--font-sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color .25s ease;
}
.cal-menu__item:hover, .cal-menu__item:focus-visible { background: rgba(81, 24, 23, .07); }
.cal-menu.is-open .pill { background: rgba(81, 24, 23, .07); }
@keyframes menu-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pill--map { padding-inline: 1.6em 1.9em; box-shadow: 0 10px 22px -12px rgba(81, 24, 23, .6); }
.pill--map svg { stroke-dasharray: none; }

/* closing: birds lift off above the keepsake */
.closing { position: relative; }
.birds--closing { z-index: 0; }

/* ───────────────────────────────────────────────────────────────
   Responsive refinements
   ─────────────────────────────────────────────────────────────── */
@media (min-width: 700px) {
  .hero { padding-top: 1.75rem; }
}

/* Landscape phones: let the card scroll rather than shrink to illegibility */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --card-w: min(92vw, 420px); }
  .gate__inner { gap: .4rem; }
  .gate__eyebrow, .gate__greeting { display: none; }
  .gate__portrait { width: min(60vw, (100svh - 205px) * 1.5); }
  .gate__names { font-size: 1.6rem; line-height: 1.9; margin-bottom: .1rem; }
  .gate__names-en, .gate__divider, .gate__date, .gate__frame .frame-crest { display: none; }
}

/* ───────────────────────────────────────────────────────────────
   Reduced motion: everything appears in place, nothing travels
   ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .scroll-cue__line { animation: none; transform: none; }
  .hero [data-step], .hero .card__plate { transition-delay: 0s !important; }
  /* nothing drifts or flies: petals, dust, birds and the butterfly are not drawn */
  .ambient, .birds, .butterfly-zone, .sky, .gate__sky { display: none !important; }
  .vine__stem { stroke-dashoffset: 0; } .vine__leaf { opacity: 1; scale: 1; }
}
