:root {
  --ivory: #fbf3e4;
  --ivory-soft: rgba(251, 243, 228, .82);
  --gold: #d9b26a;
  --gold-deep: #b58a3c;
  --emerald: #0e3b2b;
  --emerald-line: rgba(217, 178, 106, .16);
  --rose: #94566a;
  --rose-line: rgba(251, 225, 200, .14);
  --pista: #cfc58a;
  --pista-ink: #2f3a1d;
  --pista-line: rgba(70, 82, 30, .16);
  --night: #071a33;
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-caps: "Cinzel", "Cormorant Garamond", serif;
  --font-text: "Cormorant Infant", "Cormorant Garamond", serif;
  --font-arabic: "Amiri", serif;
  --bw: min(72vw, 560px);
  --lw: min(34vw, 260px);
  --vh: 100vh;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--emerald);
  color: var(--ivory);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}
img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
a { color: inherit; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* oil-canvas grain over everything */
.canvas-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .07;
  background: url("../assets/img/grain.webp") repeat 0 0 / 256px 256px;
}

/* ---------- ACT 1: the world ---------- */
.world { position: relative; height: 430vh; background: #f2a64a; }
.stage {
  position: sticky; top: 0; height: var(--vh); width: 100%;
  overflow: hidden; isolation: isolate;
}
/* centred with margins, never transforms: GSAP owns transform and only moves y */
.layer { position: absolute; left: 50%; width: var(--w); margin-left: calc(var(--w) / -2); }

.sky { --w: max(100vw, calc(var(--vh) * 0.62)); top: 0; height: auto; aspect-ratio: 1920 / 3396; }
.skyline { --w: max(108vw, calc(var(--vh) * 1.3)); top: 100%; height: auto; aspect-ratio: 2400 / 1029; }
.ground { --w: 100vw; --dw: min(84vw, calc(var(--vh) * 1.45)); --ch: max(150vh, 56vw); top: 100%; }
/* platform front edge dissolves into the forecourt: court fades in first (underneath),
   then the platform lip fades out on top, so the floor reads as one continuous surface */
.dargah {
  --dh: calc(var(--dw) / 1.767);
  position: relative; z-index: 1; display: block; margin: 0 auto;
  width: var(--dw); height: auto; aspect-ratio: 2200 / 1245;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 86%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 0, #000 86%, transparent 97%);
}
.court {
  position: absolute; left: 0; right: 0; z-index: 0;
  top: calc(var(--dw) / 1.767 * 0.84); height: var(--ch);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 calc(var(--dw) / 1.767 * 0.1));
  mask-image: linear-gradient(to bottom, transparent 0, #000 calc(var(--dw) / 1.767 * 0.1));
}
.court img { width: 100%; height: 100%; object-fit: fill; }
.court::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(14, 59, 43, .75) 76%, var(--emerald) 93%);
}

/* clouds: two depths; the camera sinks through them */
.cloud { pointer-events: none; }
.cloud img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 50%, transparent 86%);
  mask-image: linear-gradient(to bottom, #000 0, #000 50%, transparent 86%);
}
.cloud-far { --w: max(150vw, calc(var(--vh) * 3)); top: 47%; opacity: .92; }
.cloud-near { --w: max(200vw, calc(var(--vh) * 4)); top: 60%; }
.cloud-near img { transform: scaleX(-1); }
.cloud-drift { animation: cloudDrift 22s ease-in-out infinite alternate; }
.cloud-near .cloud-drift { animation-duration: 30s; animation-direction: alternate-reverse; }
@keyframes cloudDrift { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

.palms { inset: 0; left: 0; width: auto; margin-left: 0; pointer-events: none; }
.palm { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; }
.palm img { position: absolute; top: 0; height: 100%; width: auto; }
.palm-l { left: 0; }
.palm-l img { left: 0; clip-path: inset(0 50% 0 0); }
.palm-r { right: 0; }
.palm-r img { right: 0; clip-path: inset(0 0 0 50%); }

.title {
  position: absolute; left: 0; right: 0; top: 15vh; z-index: 5;
  text-align: center; perspective: 900px; pointer-events: none;
}
.title h1 { margin: 0; font-weight: 300; line-height: .95; transform-style: preserve-3d; }
.title span { display: block; }
.t-first, .t-second {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.8rem, 8.4vw, 7.6rem); letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 3px 22px rgba(10, 30, 80, .45), 0 1px 2px rgba(10, 30, 80, .35);
}
.t-joiner {
  font-family: var(--font-caps); font-size: clamp(.9rem, 1.6vw, 1.35rem);
  letter-spacing: .6em; text-transform: uppercase; margin: .55em 0 .6em .6em;
  color: #fff; text-shadow: 0 2px 10px rgba(10, 30, 80, .5);
}

/* ---------- lantern logo ---------- */
.lantern-hang {
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0; animation: lanternSway 7s ease-in-out infinite;
}
.thread {
  display: block; width: 1.5px; flex: none;
  background: linear-gradient(to bottom, rgba(217, 178, 106, 0), var(--gold) 35%, var(--gold-deep));
}
.lantern-img {
  width: 100%; height: auto;
  filter: drop-shadow(0 0 26px rgba(255, 190, 90, .5)) drop-shadow(0 14px 18px rgba(0, 0, 0, .3));
}
@keyframes lanternSway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg); } }

/* hero: drops in once the clouds part (GSAP moves y only) */
.hero-lantern {
  display: none; --hl: clamp(96px, 12vw, 168px);
  position: absolute; top: 0; left: 50%; z-index: 4; pointer-events: none;
  width: var(--hl); margin-left: calc(var(--hl) / -2);
}
.js .hero-lantern { display: block; }
.hero-lantern .thread { height: clamp(36px, 9vh, 110px); }

/* loader: the lantern glows until the world is ready, then rises away */
.loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #14503a 0, var(--emerald) 62%);
  transition: opacity .9s ease .35s, visibility 0s linear 1.25s;
}
.loader .lantern-hang {
  --ll: clamp(150px, 30vw, 250px);
  position: absolute; top: 0; left: 50%; width: var(--ll); margin-left: calc(var(--ll) / -2);
  translate: 0 0; transition: translate 1.2s cubic-bezier(.6, 0, .3, 1);
}
.loader .thread { height: clamp(60px, 14vh, 150px); }
.loader .lantern-img { animation: lanternPulse 2.4s ease-in-out infinite; }
@keyframes lanternPulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 190, 90, .35)) drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); }
  50% { filter: drop-shadow(0 0 52px rgba(255, 200, 100, .85)) drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); }
}
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; pointer-events: none; }
body:not(.is-loading) .loader .lantern-hang { translate: 0 -70vh; }
body.is-loading { overflow: hidden; }

/* finale: lantern warms up as the countdown comes into view */
.finale-lantern { width: clamp(84px, 11vw, 120px); margin: 0 auto 1.8rem; }
.finale-lantern .thread { height: clamp(40px, 8vh, 70px); }
.finale-lantern .lantern-img {
  --glow: .25;
  filter: drop-shadow(0 0 calc(var(--glow) * 64px) rgba(255, 190, 90, calc(var(--glow) * .9))) drop-shadow(0 14px 18px rgba(0, 0, 0, .35));
}

/* ---------- petals ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.petal { position: absolute; top: 0; left: 0; will-change: transform; }

/* ---------- sections ---------- */
.sec { position: relative; padding: 12vh 20px 0; text-align: center; }
.sec > * { position: relative; }
.pattern {
  position: absolute !important; inset: 0; pointer-events: none;
  -webkit-mask: url("../assets/img/pattern.svg") repeat 0 0 / 180px 180px;
  mask: url("../assets/img/pattern.svg") repeat 0 0 / 180px 180px;
}
.sec-emerald { background: var(--emerald); padding-top: 6vh; }
.sec-emerald .pattern { background: var(--emerald-line); }
.sec-rose { background: var(--rose); }
.sec-rose .pattern { background: var(--rose-line); }
.sec-pista { background: var(--pista); color: var(--pista-ink); }
.sec-pista .pattern { background: var(--pista-line); }
.sec-night { background: var(--night); overflow: hidden; padding-bottom: 0; }

.col { max-width: 640px; margin: 0 auto; }
.small {
  font-family: var(--font-text); font-size: 1.05rem; letter-spacing: .02em;
  color: var(--ivory-soft); margin-top: 1.4rem;
}
.sec-pista .small { color: rgba(47, 58, 29, .8); }
.names-list { font-family: var(--font-text); font-size: 1.2rem; font-weight: 500; }
.bismillah { font-family: var(--font-arabic); font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--gold); line-height: 1.6; }
.translit { font-family: var(--font-caps); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.caps-heading {
  font-family: var(--font-caps); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: .14em; line-height: 1.15;
  margin: 3.2rem 0 .4rem;
}
.sec-emerald .caps-heading { color: var(--gold); }
.lead { font-size: 1.15rem; color: var(--ivory-soft); }
.body { font-size: 1.15rem; line-height: 1.7; max-width: 560px; margin: 1.2rem auto 0; color: var(--ivory-soft); }
.sec-pista .body { color: rgba(47, 58, 29, .85); }
.eyebrow { font-family: var(--font-caps); text-transform: uppercase; letter-spacing: .4em; font-size: .8rem; }

.couple { margin: 2.6rem 0 0; }
.script-name {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(3.4rem, 10vw, 6.2rem); line-height: 1; color: var(--ivory);
}
.person .small { margin-top: .8rem; }
.parents { font-size: 1.15rem; font-weight: 500; }
.amp { font-family: var(--font-display); font-style: italic; font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--gold); margin: 1.4rem 0; line-height: 1; }
/* Lisan ud-Dawat invite block */
.ar-invite, .ar-invite .small, .ar-invite .script-name, .ar-invite .amp { font-family: var(--font-arabic); font-style: normal; }
.ar-invite .salutation { font-size: clamp(1.5rem, 3.6vw, 2.1rem); color: var(--gold); line-height: 1.7; }
.ar-invite .praise { font-size: 1.35rem; color: var(--ivory); margin-top: .6rem; }
.ar-invite .poem { font-size: 1.3rem; line-height: 2; color: var(--gold); margin-top: 1.4rem; }
.ar-invite .body { font-size: 1.25rem; line-height: 2; }
.ar-invite .script-name { font-weight: 700; font-size: clamp(2.6rem, 8vw, 4.4rem); line-height: 1.4; }
.ar-invite .amp { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.6; }
.ar-invite .parents { font-size: 1.25rem; line-height: 1.8; }
.events-lead { margin-top: 3.2rem; font-family: var(--font-caps); text-transform: uppercase; letter-spacing: .3em; font-size: .85rem; color: var(--gold); }

/* events */
.events {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 3vw, 44px);
  max-width: 1100px; margin: 2.6rem auto 0;
}
.event {
  position: relative; width: clamp(230px, 26vw, 290px); aspect-ratio: 1360 / 2048;
  color: #3a2a17; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .3));
}
.event img { position: absolute; inset: 0; width: 100%; height: 100%; }
.event-body {
  position: absolute; left: 17%; right: 17%; top: 23%; bottom: 14%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
}
.event h3 {
  margin: 0 0 .3rem; font-family: var(--font-caps); font-weight: 500; text-transform: uppercase;
  letter-spacing: .16em; font-size: 1.15rem; color: #6b4a1a;
}
.event-rule { width: 38px; height: 1px; background: var(--gold-deep); }
.event p { font-size: 1rem; line-height: 1.35; }
.event .ev-venue { font-weight: 600; }

/* CTA ring button */
.cta { padding: 14vh 0 4vh; }
.cta .caps-heading { margin-top: 0; }
.ring-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 64px; height: 64px; margin: 1.6rem auto 0; border-radius: 50%;
  touch-action: manipulation;
}
.ring-btn .ring {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid currentColor;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.ring-btn::before, .ring-btn::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 1px solid currentColor; opacity: 0; animation: pulse 2.6s ease-out infinite;
}
.ring-btn::after { animation-delay: 1.3s; }
.ring-btn:hover .ring, .ring-btn:focus-visible .ring { transform: scale(1.2); }
.ring-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
.sec-emerald .ring-btn { color: var(--gold); }
.cta .small { margin-top: .6rem; }
.cta.is-hidden { display: none; }

/* bridges: object rests on the viewport floor, then crosses the seam */
.bridge-track {
  position: relative; z-index: 10; height: 115vh; pointer-events: none;
  margin-bottom: calc(var(--bw) * -0.37);
}
.bridge {
  position: sticky; top: calc(var(--vh) - var(--bw) * 0.746 - 1vh);
  width: var(--bw); height: auto; margin: 0 auto;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .35));
}
.bridge-track--lantern { margin-bottom: calc(var(--lw) * -0.67); }
.bridge--lantern {
  width: var(--lw); top: calc(var(--vh) - var(--lw) * 1.34 - 1vh);
  filter: drop-shadow(0 0 40px rgba(255, 180, 80, .55)) drop-shadow(0 20px 26px rgba(0, 0, 0, .3));
  animation: lanternBridge 3.4s ease-in-out infinite;
}
@keyframes lanternBridge {
  0%, 100% { filter: drop-shadow(0 0 32px rgba(255, 180, 80, .45)) drop-shadow(0 20px 26px rgba(0, 0, 0, .3)); }
  50% { filter: drop-shadow(0 0 60px rgba(255, 190, 90, .8)) drop-shadow(0 20px 26px rgba(0, 0, 0, .3)); }
}

/* photo inside the marble window */
.photo-frame {
  position: relative; width: min(100%, 580px); aspect-ratio: 1100 / 1657; margin: 3.2rem auto 0;
}
.photo-frame .frame-photo {
  position: absolute; left: 24.5%; right: 24.5%; top: 37%; bottom: 17.5%;
  width: 51%; height: 45.5%; object-fit: cover; object-position: 50% 0%;
  /* push photo below the scalloped arch so faces sit in the open part; padding shows wall colour */
  box-sizing: border-box; padding-top: 17%; background: #f2ede6;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
}
.frame-window { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* things to know */
.details { padding-top: calc(var(--bw) * 0.37 + 10vh); }
.ttk {
  list-style: none; padding: 0; margin: 3.6rem auto 0; max-width: 1040px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 26px;
}
.ttk li { padding: 0 6px; }
.ttk svg { width: 42px; height: 42px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.ttk h3 { font-family: var(--font-caps); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; font-size: 1rem; margin: .9rem 0 .4rem; }
.ttk p { font-size: 1.02rem; line-height: 1.5; color: rgba(47, 58, 29, .82); }
.sec-pista .ring-btn { color: var(--pista-ink); }

/* finale */
.finale { padding-top: calc(var(--lw) * 0.67 + 10vh); }
.stars {
  position: absolute !important; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent),
    radial-gradient(1px 1px at 28% 42%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff9, transparent),
    radial-gradient(1px 1px at 63% 30%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 78% 16%, #fff9, transparent),
    radial-gradient(1px 1px at 88% 44%, #fff6, transparent),
    radial-gradient(1px 1px at 6% 52%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 54% 52%, #fff7, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
.finale-copy { z-index: 2; }
.countdown-title { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); color: var(--gold); margin: 0; }
.countdown { display: flex; justify-content: center; gap: clamp(14px, 4vw, 40px); margin-top: 1.4rem; }
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.countdown span { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { font-family: var(--font-caps); font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; margin-top: .5rem; color: var(--gold); }
.signoff { margin-top: 1.4rem; font-style: italic; color: var(--gold); font-size: 1.1rem; }
.night-wrap { position: relative; margin: 4vh -20px 0; overflow: hidden; }
.night {
  --w: max(100%, 760px); width: var(--w); height: auto; position: relative; left: 50%; margin-left: calc(var(--w) / -2);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
  animation: nightBreath 6s ease-in-out infinite;
}
@keyframes nightBreath { 0%, 100% { filter: brightness(.96); } 50% { filter: brightness(1.04); } }


/* audio */
.audio-toggle {
  position: fixed; right: 18px; top: 18px; z-index: 70; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(251, 243, 228, .5); background: rgba(14, 59, 43, .45); color: var(--ivory);
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.audio-bars { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.audio-bars i { display: block; width: 2px; height: 4px; background: currentColor; }
.audio-toggle[aria-pressed="true"] .audio-bars i { animation: bars 1s ease-in-out infinite; }
.audio-toggle[aria-pressed="true"] .audio-bars i:nth-child(2) { animation-delay: .2s; }
.audio-toggle[aria-pressed="true"] .audio-bars i:nth-child(3) { animation-delay: .4s; }
@keyframes bars { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* reveals (JS adds .in) */
.js .reveal { opacity: 0; transform: translateY(28px); }

/* load intro */
.is-loading .title h1 { opacity: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ttk { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  :root { --bw: 66vw; --lw: 30vw; }
  .world { height: 300vh; }
  .title { top: 17vh; }
  .ground { --w: 150vw; --dw: 150vw; --ch: 120vh; }
  .skyline { --w: 230vw; }
  .cloud-far { --w: 320vw; top: 50%; }
  .cloud-near { --w: 420vw; top: 62%; }
  /* palm image overflows top and bottom so its cut edges never show */
  .palm img { height: 116%; top: -14%; }
  .palm-l img { left: calc(22vw - var(--vh) * 1.16 * 1.768 * 0.25); }
  .palm-r img { right: calc(22vw - var(--vh) * 1.16 * 1.768 * 0.25); }
  .sec { padding: 7vh 18px 0; }
  .sec-emerald { padding-top: 2vh; }
  .caps-heading { margin-top: 2.2rem; font-size: 1.9rem; }
  .couple { margin-top: 1.6rem; }
  .script-name { font-size: 3.2rem; }
  .amp { margin: .8rem 0; }
  .events-lead { margin-top: 2.2rem; }
  .events { gap: 14px; margin-top: 1.6rem; }
  .event { width: min(62vw, 250px); }
  .cta { padding: 9vh 0 2vh; }
  .bridge-track { height: 72vh; }
  .story, .details { padding-top: calc(var(--bw) * 0.37 + 5vh); }
  .finale { padding-top: calc(var(--lw) * 0.67 + 6vh); }
  .photo-frame { width: min(100%, 440px); margin-top: 2.2rem; }
  .ttk { grid-template-columns: 1fr 1fr; gap: 22px 14px; margin-top: 2.2rem; }
  .ttk p { font-size: .95rem; }
  .countdown div { min-width: 52px; }
  .night-wrap { margin-top: 2vh; }
}

@media (prefers-reduced-motion: reduce) {
  .world { height: auto; }
  .stage { position: relative; }
  .ring-btn::before, .ring-btn::after, .bridge--lantern, .night, .stars,
  .lantern-hang, .loader .lantern-img { animation: none; }
  .loader, .loader .lantern-hang { transition-duration: .01s; transition-delay: 0s; }
  .finale-lantern .lantern-img { --glow: .7; }
  .js .reveal { opacity: 1; transform: none; }
}
