/* Mustafa & Layan (demo) · "Black Tie": a velvet theatre curtain, a travelling spotlight, a chandelier.
   Glamour-night lane: warm black stage, champagne light, ivory type. The light carries the colour.
   Rules: objects centred by LAYOUT (inset/left/right:0 + margin:auto + explicit size); GSAP adds only
   x/y/scale/rotation/opacity. Sizes come from JS custom properties (--U --P --VH ...). Only bitmaps scale. */
:root {
  --black: #0d0b0c;
  --ivory: #f3ece0;
  --ivory-2: rgba(243, 236, 224, .78);
  --champ: #e7d3a6;
  --champ-2: #b89a62;
  --display: 'Rakkas', 'Amiri', serif;
  --serif: 'Amiri', serif;
  --latin: 'Bodoni Moda', 'Didot', serif;
  --sans: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --U: 360px; --P: 99px; --VH: 640px;
  --chTop: 60px; --chH: 217px; --nmTop: 290px; --mqTop: 150px; --mqH: 310px; --plTop: 200px; --cardTop: 220px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--black); color: var(--ivory); }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.locked { overflow: hidden; }
p, h2 { margin: 0; }
img { display: block; max-width: none; }

/* ------------------------------------------------ stage */
#track { position: relative; }
.stage { position: relative; }
html.film .stage { direction: ltr; position: sticky; top: 0; height: 100lvh; overflow: hidden; contain: layout paint; }
html.film .stage > * { position: absolute; pointer-events: none; }
html.film .cur, html.film .beam, html.film .chand, html.film .marquee, html.film .drop { will-change: transform; }
.lay { inset: 0; }
/* the rear wall: the same black velvet far upstage, unlit (photographic, Gemini) */
.back { z-index: 1; background: #0b0809 url(assets/backwall.webp) center top / auto 100% repeat-x; }
.back::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 55% at 50% 58%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .6) 100%); }
/* the painted Baghdad drop (a scenic canvas flown in for the venue): starts under the valance */
.sky { z-index: 2; top: calc(var(--P) * .8); bottom: 0; left: 0; right: 0; overflow: hidden; background: #120d0a; opacity: 0; }
.drop { position: absolute; inset: 0; background: url(assets/baghdad.webp) center top / cover no-repeat; transform-origin: 50% 70%; }
.sky::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 6, 5, .55) 0%, rgba(8, 6, 5, 0) 22%, rgba(8, 6, 5, 0) 70%, rgba(8, 6, 5, .5) 100%), radial-gradient(90% 60% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .45) 100%); }
.floor { z-index: 2; top: auto; height: 26%; background: url(assets/floor-2.webp) center top / cover no-repeat; }

.pool { z-index: 6; left: calc(50% - var(--U) * .525); bottom: 7%; width: calc(var(--U) * 1.05); height: calc(var(--U) * .32); background: url(assets/pool.webp) center / 100% 100% no-repeat; opacity: 0; }
.halo { z-index: 6; left: calc(50% - var(--U) * .6); top: calc(var(--chTop) + var(--chH) * .45 - var(--U) * .6); width: calc(var(--U) * 1.2); height: calc(var(--U) * 1.2); background: url(assets/halo.webp) center / 100% 100% no-repeat; opacity: 0; }
.chand { z-index: 7; left: 0; right: 0; margin: 0 auto; top: var(--chTop); width: var(--chW); height: var(--chH); }
.chand .ch-img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 calc(var(--U) * .05) rgba(255, 214, 150, .28)); }
.chand .gl { position: absolute; width: calc(var(--U) * .07); height: calc(var(--U) * .07); margin: calc(var(--U) * -.035) 0 0 calc(var(--U) * -.035); opacity: 0; }

/* the marquee: a photographed gilt frame of bulbs; its glow layer breathes (no chasing lights) */
.marquee { z-index: 7; left: 0; right: 0; margin: 0 auto; top: var(--mqTop); width: var(--mqW); height: var(--mqH); }
.mq-back { position: absolute; left: 15.5%; right: 15.5%; top: 11%; bottom: 12.3%; background: radial-gradient(80% 70% at 50% 45%, #1d1612 0%, #0c0909 100%); }
.mq-img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); }
.bulbs { position: absolute; inset: -3%; opacity: 0; }
.mq-glow { position: absolute; inset: 0; background: url(assets/marquee-glow.webp) center / 100% 100% no-repeat; mix-blend-mode: screen; }

.slit { z-index: 11; left: 0; right: 0; margin: 0 auto; top: 0; bottom: 0; width: calc(var(--U) * .16); background: linear-gradient(90deg, rgba(255, 220, 160, 0), rgba(255, 226, 172, .3) 50%, rgba(255, 220, 160, 0)), linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .35)); opacity: 0; }
/* velvet panels: one Gemini photo of a closed curtain, each half mirrored into a repeat-x tile */
.cur { z-index: 10; top: 0; bottom: 0; width: 56%; background-color: #0a0708; background-repeat: repeat-x; background-size: auto 100%; }
.cur-l { left: 0; background-image: url(assets/velvet-l.webp); background-position: right top; transform-origin: 0 50%; }
.cur-r { right: 0; background-image: url(assets/velvet-r.webp); background-position: left top; transform-origin: 100% 50%; }
.cur::after { content: ''; position: absolute; top: 0; bottom: 0; width: 14%; }
.cur-l::after { right: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .35)); }
.cur-r::after { left: 0; background: linear-gradient(270deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .35)); }
.beam { z-index: 11; left: calc(50% - var(--U) * .55); top: calc(var(--P) * -.4); height: calc(var(--VH) * .97); width: calc(var(--U) * 1.1); background: url(assets/beam.webp) center top / 100% 100% no-repeat; transform-origin: 50% 0; opacity: 0; }
.dust { position: absolute; inset: 0; background: url(assets/dust-1.webp) center top / 100% 100% no-repeat; }
.dust.d2 { background-image: url(assets/dust-2.webp); opacity: 0; }
.cpool { z-index: 11; left: calc(50% - var(--U) * .625); top: calc(var(--cardTop) - var(--U) * .5); width: calc(var(--U) * 1.25); height: calc(var(--U) * 1.25); background: url(assets/halo.webp) center / 100% 100% no-repeat; opacity: .9; }
.dim { z-index: 11; inset: 0; background: #000; opacity: .25; }
/* the valance (Gemini photo, swags + bullion fringe); the gate carries an identical copy over the tassel rope */
.valance { z-index: 13; left: 0; right: 0; top: calc(var(--valH) * -.05); height: var(--valH); background: url(assets/valance.webp) center top / auto 100% round; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .6)); pointer-events: none; }

/* ------------------------------------------------ scenes (text) */
.sc { direction: rtl; position: relative; z-index: 12; text-align: center; padding: 3rem 1.4rem; }
html.film .sc { inset: 0; padding: 0; opacity: 0; visibility: hidden; }
.ln { display: block; }

.s-verse { display: flex; flex-direction: column; align-items: center; justify-content: center; }
html.film .s-verse { bottom: 18%; top: var(--P); }
.basmala { font-size: calc(var(--U) * .043); color: var(--champ); margin-bottom: calc(var(--U) * .05); }
.verse { font-weight: 700; font-size: calc(var(--U) * .108); line-height: 1.7; white-space: nowrap; color: var(--ivory); text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.sura { margin-top: calc(var(--U) * .03); font-family: var(--sans); font-size: calc(var(--U) * .034); color: var(--champ); }

html.film .nm-body { position: absolute; left: 1rem; right: 1rem; top: var(--nmTop); }
.hosts, .bride { font-size: calc(var(--U) * .047); line-height: 1.75; color: var(--ivory-2); }
.names { margin: calc(var(--U) * .02) 0 0; font-family: var(--display); font-size: calc(var(--U) * .16); line-height: 1.35; white-space: nowrap; color: var(--ivory); text-shadow: 0 0 28px rgba(255, 220, 160, .25); }
.amp { font-size: .5em; color: var(--champ); vertical-align: .25em; }
.latin { font-family: var(--latin); font-style: italic; font-size: calc(var(--U) * .05); color: var(--champ); margin: calc(var(--U) * -.01) 0 calc(var(--U) * .03); letter-spacing: .02em; }

html.film .mq-text { position: absolute; left: 0; right: 0; margin: 0 auto; top: var(--mqTop); height: var(--mqH); width: var(--mqW); padding: 0 calc(var(--mqW) * .17); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.d-day { font-family: var(--display); font-size: calc(var(--U) * .068); color: var(--champ); line-height: 1.3; }
.d-num { font-family: var(--display); font-size: calc(var(--U) * .23); line-height: 1.05; color: var(--ivory); text-shadow: 0 0 30px rgba(255, 220, 160, .35); }
.d-month { font-family: var(--display); font-size: calc(var(--U) * .06); line-height: 1.4; color: var(--ivory); }
.d-rule { width: calc(var(--U) * .2); height: 1px; background: var(--champ-2); margin: calc(var(--U) * .03) auto calc(var(--U) * .025); }
.d-time { font-size: calc(var(--U) * .04); color: var(--ivory-2); white-space: nowrap; }
.d-count { margin-top: calc(var(--U) * .035); font-family: var(--sans); font-size: calc(var(--U) * .034); color: var(--champ); white-space: nowrap; }
.d-count #cNum { font-family: var(--display); font-size: 1.5em; color: var(--ivory); }

html.film .place-body { position: absolute; left: 1rem; right: 1rem; top: var(--plTop); }
.place-body { display: flex; flex-direction: column; align-items: center; }
.p-kicker { font-family: var(--sans); font-size: calc(var(--U) * .036); color: var(--champ); }
.v-name { font-family: var(--serif); font-weight: 700; font-size: calc(var(--U) * .1); line-height: 1.5; color: var(--ivory); white-space: nowrap; }
.v-sub { font-size: calc(var(--U) * .05); color: var(--ivory-2); margin-bottom: calc(var(--U) * .045); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: min(100%, calc(var(--U) * .9), 360px); }
html.film .s-place .actions { pointer-events: auto; }
.btn { font-family: var(--sans); font-size: calc(var(--U) * .036); text-decoration: none; color: var(--black); background: var(--champ); min-height: 44px; padding: 0 .5rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn.ghost { background: rgba(13, 11, 12, .55); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(231, 211, 166, .55); }
.dress { margin-top: calc(var(--U) * .04); font-family: var(--sans); font-size: calc(var(--U) * .033); color: var(--champ); }

.s-close { display: flex; flex-direction: column; align-items: center; justify-content: center; }
html.film .s-close { top: var(--nmTop); bottom: auto; justify-content: flex-start; }
.dua { font-weight: 700; font-size: calc(var(--U) * .085); line-height: 1.65; color: var(--ivory); text-shadow: 0 2px 16px rgba(0, 0, 0, .7); }
.dua .ln { white-space: nowrap; }
.sign { margin-top: calc(var(--U) * .05); font-size: calc(var(--U) * .05); color: var(--ivory-2); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.fam { margin-top: calc(var(--U) * .02); font-family: var(--sans); font-size: calc(var(--U) * .035); color: var(--champ); }

/* ------------------------------------------------ gate */
#gate { position: fixed; inset: 0; z-index: 30; touch-action: none; }
#gate.gone { display: none; }
.g-card { position: absolute; left: 0; right: 0; top: var(--cardTop); transform: translateY(-50%); text-align: center; padding: 0 1rem; }
.g-kicker { font-family: var(--sans); font-size: calc(var(--U) * .038); color: var(--champ); }
.g-names { font-family: var(--display); font-size: calc(var(--U) * .155); line-height: 1.4; color: var(--ivory); white-space: nowrap; text-shadow: 0 0 30px rgba(255, 220, 160, .3); }
.g-names span { font-size: .5em; color: var(--champ); vertical-align: .25em; }
.g-latin { font-family: var(--latin); font-style: italic; font-size: calc(var(--U) * .05); color: var(--champ); }
.g-date { margin-top: calc(var(--U) * .05); padding-top: calc(var(--U) * .035); font-family: var(--sans); font-size: calc(var(--U) * .036); color: var(--ivory-2); border-top: 1px solid rgba(231, 211, 166, .35); display: inline-block; }
.g-hint { position: absolute; left: 0; right: 0; bottom: calc(21% + env(safe-area-inset-bottom)); text-align: center; font-family: var(--sans); font-size: calc(var(--U) * .04); color: var(--champ); }
.cord { position: absolute; top: calc(var(--valH) * -.1); right: calc(50% - var(--U) * .44); height: var(--tasH); width: auto; z-index: 2; pointer-events: none; transform-origin: 50% 0; filter: drop-shadow(-6px 10px 10px rgba(0, 0, 0, .55)); }
#gate .valance { position: absolute; z-index: 2; }
#open { all: unset; position: absolute; inset: 0; cursor: pointer; z-index: 3; }
#open:focus-visible { outline: 2px solid var(--champ); outline-offset: -8px; }

/* ------------------------------------------------ RSVP: an ivory programme card under the stage */
#rsvp { position: relative; z-index: 8; background: var(--black); padding: 3.5rem 1.1rem calc(2.5rem + env(safe-area-inset-bottom)); text-align: center; }
.programme { max-width: 440px; margin: 0 auto; background: #f6efe2; color: #161214; padding: 2.6rem 1.3rem 2rem; box-shadow: inset 0 0 0 6px #f6efe2, inset 0 0 0 7px var(--champ-2), inset 0 0 0 10px #f6efe2, inset 0 0 0 11px rgba(184, 154, 98, .5); }
.r-kicker { font-family: var(--sans); font-size: .8rem; color: #8a6f3e; }
.r-title { margin: .3rem 0 .5rem; font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.4; color: #161214; }
.r-sub { font-size: 1.02rem; color: #4d4447; margin-bottom: 1.8rem; }
.credit { display: inline-block; margin-top: 2.4rem; font-family: var(--sans); font-size: .76rem; color: var(--champ); text-decoration: none; opacity: .75; }

#cue { position: fixed; left: 0; right: 0; margin: auto; bottom: calc(1.2rem + env(safe-area-inset-bottom)); width: 2px; height: 34px; z-index: 20; opacity: 0; visibility: hidden; pointer-events: none; overflow: hidden; border-radius: 2px; background: rgba(231, 211, 166, .2); }
#cue i { position: absolute; inset: 0; background: var(--champ); }

/* ------------------------------------------------ fallback (reduced motion / no GSAP): stacked and calm */
html:not(.film) .stage > [aria-hidden="true"] { display: none; }
html:not(.film) .sc { min-height: 70svh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
html:not(.film) .sc > * { opacity: 0; transform: translateY(12px); transition: opacity .8s ease, transform .8s ease; }
html:not(.film) .sc.in > * { opacity: 1; transform: none; }
html:not(.film) .verse, html:not(.film) .names { white-space: normal; }
html:not(.film) .mq-text { padding: 2rem 1rem; box-shadow: inset 0 0 0 2px var(--champ-2); width: min(100%, 320px); }
html:not(.film) .d-count { margin-top: 1rem; }
html:not(.film) #gate { background: var(--black) url(assets/velvet-l.webp) left top / auto 100% repeat-x; }
html:not(.film) .cord { display: none; }

.sep { opacity: .45; padding: 0 .25em; }
/* desktop: the painted drop keeps its portrait canvas (river + dome), centred, its edges fade into the dark */
@media (min-aspect-ratio: 4/5) {
  html.film .drop { left: calc(50% - (100lvh - var(--P) * .8) * .279); right: auto; width: calc((100lvh - var(--P) * .8) * .558); background-size: 100% 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
}
