/* ═══ Tokens — venue swatches + invitation print ═══ */
:root {
  --velvet: #602430;
  --crimson: #8c1e29;
  --emerald: #0b3a26;
  --emerald-deep: #052116;
  --ink-green: #0d4429;
  --gold-hi: #f1d27a;
  --night: #090d18;
  --cream: #f1e6cb;

  --f-km-display: "Moulpali", "Moul", "Noto Serif Khmer", serif;
  --f-km: "Noto Serif Khmer", "Battambang", serif;
  --f-latin: "Cormorant Garamond", "Times New Roman", serif;
  --f-caps: "Cinzel", "Cormorant Garamond", serif; /* engraved theatre capitals for tracked labels */
  --f-print: "Moul", "Battambang", serif;          /* the envelope keeps the printed letterforms */
  --f-zh: "Noto Serif SC", "Songti SC", serif;

  /* the printed envelope: forest-green paper, tone-on-tone deboss, gold foil, pale-mint name label (from the print files + the real one) */
  --env-paper: #2e4a3f;
  --env-paper-deep: #22392f;
  --foil: linear-gradient(100deg, #b98a2c, #f3d78a 38%, #d4a64a 55%, #f6e1a0 72%, #a97b22);
  --label: #d9e9ee;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--cream);
  font-family: var(--f-latin);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-stage { overflow-x: hidden; overflow-y: auto; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

/* ═══ Chrome ═══ */
.chrome {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: clamp(16px, 2.4vw, 36px) clamp(16px, 2.4vw, 40px);
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }
.chrome::before { content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(rgba(4, 17, 11, .92), rgba(4, 17, 11, 0)); opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.scrolled .chrome::before { opacity: 1; }
.chrome-k img { width: clamp(52px, 5.6vw, 96px); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
/* phones: the page's text runs the full width, so once it is scrolled the K shrinks into a slim band that
   stays solid down to its foot: headings and card text pass under it without tangling with the monogram */
@media (max-width: 720px) {
  .chrome { transition: padding .4s ease; }
  .chrome-k img { display: block; transition: width .4s ease; }
  .scrolled .chrome { padding-block: 8px; align-items: center; }
  .scrolled .chrome-k img { width: 38px; }
  .scrolled .chrome::before { inset: 0 0 -18px; background: linear-gradient(rgba(4, 17, 11, .96), rgba(4, 17, 11, .92) 72%, rgba(4, 17, 11, 0)); }
}
.chrome-sound {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--cream);
}
.chrome-sound svg { width: 30px; height: 30px; }
.chrome-sound .mute { display: none; }
.chrome-sound[aria-pressed="false"] .waves { display: none; }
.chrome-sound[aria-pressed="false"] .mute { display: inline; }
.chrome-sound:focus-visible, .envelope:focus-visible, .act-dot:focus-visible {
  outline: 2px solid var(--gold-hi); outline-offset: 4px; border-radius: 6px;
}

/* opt-in tilt (iOS asks for motion permission only from a tap) */
.tilt-btn {
  position: absolute; z-index: 5; right: clamp(16px, 2.4vw, 40px); top: calc(clamp(16px, 2.4vw, 36px) + 56px);
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  font-family: var(--f-latin), var(--f-km); font-size: 15px; letter-spacing: .06em; color: var(--cream);
  background: rgba(10, 6, 8, .55); border: 1px solid rgba(230, 191, 98, .55); border-radius: 999px; cursor: pointer;
  opacity: 0; transition: opacity .8s ease 3.4s; /* after the planes have locked */
}
.tilt-btn svg { width: 20px; height: 20px; }
.tilt-btn[hidden] { display: none; }
.is-stage .tilt-btn { opacity: 1; }
.tilt-btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }

/* ═══════════ ENVELOPE SCENE ═══════════ */
.scene-envelope { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow: hidden; }
.velvet {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  background: #3a0a12 url("assets/velvet.webp") no-repeat;
  background-size: 200% 100%;
  transition: transform 1.9s cubic-bezier(.6, .02, .25, 1), filter 1.9s ease;
  will-change: transform;
}
.velvet-l { left: 0; background-position: left center; transform-origin: left center; }
.velvet-r { right: 0; background-position: right center; transform-origin: right center; }

.env-wrap { position: relative; z-index: 2; margin-top: -5.5svh; perspective: 1800px; }
.envelope {
  position: relative; display: block;
  height: min(80svh, 124vw); aspect-ratio: 1067 / 1474;
  padding: 0; border: 0; background: none; cursor: pointer;
  container-type: size;
  transition: transform 1.1s cubic-bezier(.5, 0, .2, 1), opacity .9s ease;
  animation: envFloat 6s ease-in-out infinite;
}
@keyframes envFloat { 50% { transform: translateY(-6px); } }

/* a two-sided paper object: front with the print, back with the flap; it turns over to open */
.envelope { transform-style: preserve-3d; }
.env-pocket { /* the back */
  position: absolute; inset: 0; border-radius: 2px;
  background: var(--env-paper) url("assets/env-back.webp") center / 100% 100% no-repeat;
  box-shadow: 0 30px 50px rgba(20, 0, 4, .6), 0 6px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .25);
  transform: rotateY(180deg) translateZ(3px); /* layers, back to front: back panel · card · front panel, 3px apart */
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* front */
.env-body {
  position: absolute; inset: 0; z-index: 3; border-radius: 2px;
  transform: translateZ(3px); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 8.5cqh;
  background: var(--env-paper) url("assets/env-front.webp") center / 100% 100% no-repeat;
  box-shadow: 0 30px 50px rgba(20, 0, 4, .6), 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(0, 0, 0, .25);
  text-align: center;
}
.env-body > * { flex-shrink: 0; position: relative; }
.env-k { width: 44cqw; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)) drop-shadow(0 0 6px rgba(255, 214, 130, .18)); }
.env-orn { width: 26cqw; margin-top: 2.6cqh; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.env-title, .env-sub, .env-date, .env-venue {
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35));
  /* the gold fill is clipped to the box: pad it so Khmer vowels above and subscripts below are not sliced off */
  padding: .5em .2em .35em; margin-bottom: -.35em;
}
.env-title { margin-top: calc(6.2cqh - .5em); white-space: nowrap; font-family: var(--f-print); font-size: 7cqw; line-height: 1.45; }
.env-sub { margin-top: calc(.2cqh - .5em); font-family: var(--f-print); font-size: 3.8cqw; line-height: 1.5; }
.env-name {
  display: grid; place-items: center;
  width: 66cqw; height: 6.6cqh; margin-top: 2.4cqh;
  background: linear-gradient(var(--label), #c8dde3);
  border: max(1.5px, .45cqw) solid #c99a3a;
  box-shadow: inset 0 0 0 max(1px, .2cqw) rgba(255, 255, 255, .55), 0 1px 2px rgba(0, 0, 0, .35);
  font-family: var(--f-print); font-size: 3.8cqw; color: #2a3a33;
}
.env-date, .env-venue {
  white-space: nowrap;
  font-family: "Battambang", serif; font-weight: 700; font-size: max(3.15cqw, 12px); line-height: 1.5;
}
.env-date { margin-top: calc(5.6cqh - .5em); }
.env-venue { margin-top: calc(1cqh - .5em); }

/* tuck flap on the back: lies closed over the top, lifts up over the top edge to stand open */
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 30.93cqw;
  transform-origin: 50% 0; transform-style: preserve-3d;
  transform: translateZ(1px) rotateX(0deg);
}
.flap-out, .flap-in { position: absolute; inset: 0; background: center / 100% 100% no-repeat; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-out { background-image: url("assets/env-flap-out.webp"); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.flap-in { background-image: url("assets/env-flap-in.webp"); transform: rotateX(180deg); }

/* organza butterfly (cut from the real one) sits on the back; it takes off as the envelope opens */
.env-bfly {
  position: absolute; left: 50%; top: 27%; width: 40%; aspect-ratio: 354 / 360; translate: -50% 0;
  transform: translateZ(4px); transform-style: preserve-3d;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35));
}
.env-bfly img { position: absolute; top: 0; height: 100%; }
.env-bfly .w-l { right: 50%; width: 48.3%; transform-origin: 100% 50%; animation: wingL 3.2s ease-in-out infinite; }
.env-bfly .w-r { left: 50%; width: 51.7%; transform-origin: 0 50%; animation: wingR 3.2s ease-in-out infinite; }
@keyframes wingL { 50% { transform: rotateY(24deg); } }
@keyframes wingR { 50% { transform: rotateY(-24deg); } }
.is-opening .env-bfly { animation: bflyAway 1.6s cubic-bezier(.45, 0, .6, 1) forwards; }
.is-opening .env-bfly .w-l { animation: flapL .22s ease-in-out infinite; }
.is-opening .env-bfly .w-r { animation: flapR .22s ease-in-out infinite; }
@keyframes flapL { 50% { transform: rotateY(62deg); } }
@keyframes flapR { 50% { transform: rotateY(-62deg); } }
@keyframes bflyAway {
  0% { transform: translateZ(4px); }
  25% { transform: translate3d(-4%, -8%, 60px) rotate(-6deg); }
  100% { transform: translate3d(-120%, -190%, 220px) rotate(-24deg) scale(.7); opacity: 0; }
}

/* the butterfly once it has taken off: lifted out of the envelope into the scene by app.js (flyButterfly) */
.bfly-free {
  position: absolute; z-index: 30; pointer-events: none;
  perspective: 700px; transform-style: preserve-3d; will-change: transform;
  /* a deeper shadow and a faint warm halo, so the white organza reads against the pale card */
  filter: drop-shadow(0 9px 10px rgba(16, 32, 24, .5)) drop-shadow(0 0 12px rgba(255, 222, 160, .45));
}
.bfly-free img { position: absolute; top: 0; height: 100%; }
.bfly-free .w-l { right: 50%; width: 48.3%; transform-origin: 100% 50%; animation: flapL .24s ease-in-out infinite; }
.bfly-free .w-r { left: 50%; width: 51.7%; transform-origin: 0 50%; animation: flapR .24s ease-in-out infinite; }

/* inner card */
/* inner card = Page 1 of the print: sage paper, emerald wave frame, crimson butterflies + K.
   Sized in its own cqw so it scales as one printed sheet (trim 1500 × 2100 pt). */
.env-card {
  --ic-ink: #003b23;
  --ic-crimson: #87000c;
  position: absolute; left: 8%; width: 84%; top: 3%; aspect-ratio: 1500 / 2100; z-index: 2;
  container-type: inline-size;
  transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 14.2cqw 7cqw 0;
  background: #ccd8d4;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .28);
  font-family: "Battambang", var(--f-km); font-weight: 700; color: var(--ic-ink); text-align: center;
  transition: transform 1.1s cubic-bezier(.3, 0, .2, 1);
}
.env-card > * { position: relative; flex-shrink: 0; }
.ic-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ic-bfly { position: absolute; top: 8.4cqw; width: 9.4cqw; }
.ic-bfly-l { left: 8.6cqw; transform: rotate(-8deg); }
.ic-bfly-r { right: 8.6cqw; transform: scaleX(-1) rotate(-8deg); }
.ic-title { font-family: "Moulpali", var(--f-km-display); font-weight: 400; font-size: 6.5cqw; line-height: 1.5; white-space: nowrap; }
.ic-parents {
  display: grid; grid-template-columns: 1fr 9cqw 1fr; align-items: center; width: 100%;
  margin-top: 4.6cqw; font-weight: 400; font-size: 3.85cqw; line-height: 1.6; white-space: nowrap;
}
.ic-star { width: 9cqw; }
.ic-head { margin-top: 8.5cqw; font-family: "Moulpali", var(--f-km-display); font-weight: 400; font-size: 5.1cqw; line-height: 1.5; }
.ic-body { margin-top: 3.4cqw; font-size: 2.9cqw; line-height: 1.8; white-space: nowrap; }
.ic-couple { display: grid; grid-template-columns: 1fr 27cqw 1fr; align-items: center; width: 100%; margin-top: 6.6cqw; }
.ic-name { display: flex; flex-direction: column; align-items: center; }
.ic-name small { font-weight: 400; font-size: 3.1cqw; line-height: 1.6; }
.ic-name b { font-size: 4.6cqw; line-height: 1.5; white-space: nowrap; }
.ic-name i { margin-top: .4cqw; font-family: var(--f-latin); font-style: italic; font-weight: 600; font-size: 3.3cqw; line-height: 1.1; color: var(--ic-crimson); }
.ic-k { position: relative; display: block; }
.ic-k img { width: 100%; }
.ic-k small { /* "ជាគូនឹង" is set across the K's stem, knocked out in sage */
  position: absolute; left: 50%; top: 47%; translate: -50% -50%;
  font-weight: 400; font-size: 2.5cqw; line-height: 1; white-space: nowrap; color: var(--ic-ink);
  -webkit-text-stroke: .7cqw #ccd8d4; paint-order: stroke fill;
}
.ic-when { display: flex; flex-direction: column; align-items: center; margin-top: 2.6cqw; font-weight: 400; font-size: 2.85cqw; line-height: 2.15; }
.ic-date { font-weight: 700; font-size: 3.6cqw; line-height: 1.6; }
.ic-lunar { font-weight: 700; font-size: 3.3cqw; }
.ic-venue { margin-top: 1cqw; font-weight: 700; font-size: 3.9cqw; line-height: 1.6; }
.ic-sign { margin-top: 5cqw; font-weight: 400; font-size: 2.85cqw; line-height: 1.6; }

.tap-hint { position: absolute; z-index: 2; left: 50%; bottom: 4.2svh; translate: -50% 0; margin: 0; text-align: center; transition: opacity .5s ease; }
.tap-hint span {
  display: block; padding: 0 1em .9em;
  font-family: var(--f-caps); font-weight: 500; font-size: clamp(15px, 1.5vw, 24px);
  letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; color: var(--cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}
.tap-hint .tap-km { /* Khmer is not tracked or capitalised */
  padding-bottom: .1em; font-family: var(--f-km); font-size: clamp(15px, 1.4vw, 22px);
  letter-spacing: .04em; text-indent: 0; text-transform: none; color: var(--amber-hi);
}
.tap-hint::after {
  content: ""; display: block; width: clamp(200px, 18vw, 300px); height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(241, 210, 122, .75) 50%, transparent);
}
.tap-hint::before {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; translate: -50% 0;
  border-radius: 50%; background: radial-gradient(closest-side, #fff6d8, #f0c060 45%, rgba(240, 192, 96, 0));
  animation: glint 2.6s ease-in-out infinite;
}
@keyframes glint { 50% { opacity: .35; } }

/* ── Opening sequence ── */
/* the envelope's own moves are keyframed (a transition here would snap: it is handed over from the idle float animation) */
.is-flipping .envelope { cursor: default; animation: envFlip .9s cubic-bezier(.55, 0, .25, 1) forwards; }
@keyframes envFlip {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  45% { transform: translateY(-2svh) rotateY(95deg) scale(1.03); }
  100% { transform: translateY(6svh) rotateY(180deg) scale(.94); }
}
.is-flipping .tap-hint { opacity: 0; }
/* quick open: the envelope drops and comes forward while the card slides out (whole card fits, --rd-*), then pushes
   in on the couple's names (--zm-*); both measured in app.js on tap. The curtain opens straight after. */
.is-opening .envelope { animation: envSettle 1.9s cubic-bezier(.45, 0, .25, 1) forwards; }
@keyframes envSettle {
  0% { transform: translateY(6svh) rotateY(180deg) scale(.94); }
  55% { transform: translateY(var(--rd-y, 24svh)) rotateY(180deg) scale(var(--rd-s, .78)); }
  100% { transform: translateY(var(--zm-y, 24svh)) rotateY(180deg) scale(var(--zm-s, .78)); }
}
/* once past upright the flap drops behind the card's plane, so the card slides out of the pocket in front of it */
.is-opening .env-flap { animation: flapOpen .8s cubic-bezier(.55, 0, .25, 1) .1s both; }
@keyframes flapOpen {
  0% { transform: translateZ(1px) rotateX(0deg); }
  62% { transform: translateZ(1px) rotateX(120deg); }
  100% { transform: translateZ(-4.5px) rotateX(180deg); }
}
.is-opening .env-card { transform: rotateY(180deg) translateY(-97%); transition-delay: .55s; transition-duration: .75s; } /* starts once the flap is past upright (.1s + 62% of .8s); a sliver stays tucked in the pocket */
.is-opening .tap-hint { opacity: 0; }
.is-rising .envelope { animation: envSink 1.2s ease-out forwards; } /* keeps drifting in on the names as it fades */
@keyframes envSink {
  from { transform: translateY(var(--zm-y, 24svh)) rotateY(180deg) scale(var(--zm-s, .78)); }
  to { transform: translateY(var(--zo-y, 24svh)) rotateY(180deg) scale(var(--zo-s, .78)); }
}
.is-rising .env-wrap { opacity: 0; transition: opacity .9s ease; } /* fade the wrapper: opacity on the envelope itself would flatten its 3D */
.is-rising .velvet-l { transform: translateX(-102%) skewY(-2deg) scaleX(.6); filter: brightness(.6); }
.is-rising .velvet-r { transform: translateX(102%) skewY(2deg) scaleX(.6); filter: brightness(.6); }
.is-stage .scene-envelope { visibility: hidden; pointer-events: none; }


/* ═══════════════════════════════════════════════
   SHARED SYSTEM — one theatre, one night
   Every section sits on the same velvet-night ground;
   printed-card content sits on sage "paper" with the emerald scallop;
   media sits in gilt frames; light = amber globes.
   ═══════════════════════════════════════════════ */
:root {
  --sage-paper: #cdd9d4;
  --sage-ink: #0a3d26;
  /* the one "printed" surface: the invitation's emerald, framed in gilt */
  --programme-bg:
    radial-gradient(80% 38% at 50% 0%, rgba(255, 190, 120, .13), transparent 72%),
    radial-gradient(90% 40% at 50% 100%, rgba(15, 82, 50, .35), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 4px),
    linear-gradient(#0e4630, #0b3a26 55%, #052116);
  --wine-deep: #04110b; /* programme ground: emerald night (was wine) */
  --wine: #082017;
  --amber: #e9c27a;
  --amber-hi: #f6dc97;
  --rule: rgba(233, 194, 122, .38);
  --gilt: linear-gradient(135deg, #f0cd77, #8f6213 32%, #e6bf62 55%, #6e4a0e 80%, #d9ad52);
  --globe-on: radial-gradient(circle at 42% 38%, #fffbe9, #ffe2a0 55%, #e9a94e);
  --globe-off: radial-gradient(circle at 42% 38%, #efe7da, #b9ab98 62%, #6e6258);
}

/* ═══════════ STAGE — layered ═══════════ */
.scene-stage {
  position: relative; height: 100svh; z-index: 1; overflow: hidden; visibility: hidden;
  background: linear-gradient(#080b16 0%, #0a0d1a 45%, #1d0f0b 66%, var(--wine-deep) 100%);
}
.is-flipping .scene-stage, .is-stage .scene-stage { visibility: visible; } /* paint the stage on the tap, not mid-animation */
.scene-stage::after { /* stage floor melts into the programme below */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6svh; z-index: 4; pointer-events: none; /* short: the footlights mark the stage's edge now */
  background: linear-gradient(transparent, var(--wine-deep));
}
.stage-frame {
  --px: 0; --py: 0;
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, 177.78svh); aspect-ratio: 16 / 9;
  translate: -50% -50%;
  transform: scale(1.06);
  transition: transform 4s cubic-bezier(.2, .6, .2, 1);
}
@media (max-aspect-ratio: 5/4) {
  .stage-frame { width: 240vw; top: 45%; }
}
/* the stage's entrance starts as the curtain parts; behind the WebGL curtain (.gl-curtain) the gap shows only light,
   so there it waits for the stage to take over (is-stage), when that light is at its fullest and about to clear */
body:not(.gl-curtain).is-rising .stage-frame, .is-stage .stage-frame { transform: scale(1); }

/* world units: 1600 × 900 → percentages */
.layer {
  position: absolute; inset: 0;
  will-change: transform;
}
.layer > img, .layer > button, .layer > .glows, .layer > i { position: absolute; }

/* ═══ Multiplane depth assembly ═══
   The stage is one picture cut into planes, hung on a camera rig (.stage-cam).
   · Rest: each plane keeps a small real depth (--zr, px) and is scaled by (1 − zr / perspective), so head-on it
     reads as one flat picture, but any camera turn (pointer, phone tilt, idle drift) shows true parallax.
   · Assembly: when the curtain parts, every plane starts far off its mark on Z (--z0: back planes deep behind
     the screen, front planes behind the camera) while the camera swings round; they converge back to front and
     lock in. Back planes are scale-compensated (--k) so the sky stays full-bleed instead of a shrunken card.
   · Scroll: leaving the stage pulls the planes apart again (--zs × scroll progress, written per plane by app.js). */
.scene-stage { perspective: 1000px; perspective-origin: 50% 50%; }
@media (max-aspect-ratio: 5/4) { .scene-stage { perspective-origin: 50% 45%; } } /* frame sits at top: 45% there */
/* camera aim, set by app.js on .stage-cam itself. Registered as NOT inherited: changing it then restyles the
   camera rig alone, instead of every plane and decoration inside it (an inherited custom property invalidates
   the whole subtree, ~12 times a second while the camera drifts). */
@property --cx { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --cy { syntax: '<number>'; inherits: false; initial-value: 0; }
.stage-frame { transform-style: preserve-3d; }
.stage-cam {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(var(--cy) * -2.4deg)) rotateY(calc(var(--cx) * 3.4deg));
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.layer {
  --zr: 0; --z0: 0; --k: 0; --zs: 0px; --t0: 0s; --b0: 0px;
  /* scroll pull-apart: app.js writes each plane's own `translate` (--zs x scroll progress) straight onto it */
  transform: translateZ(calc(var(--zr) * 1px)) scale(calc(1 - var(--zr) / 1000));
}
/* z order of the planes follows the DOM order at every moment, so they never cut through each other */
.l-sky    { --zr: -260; --z0: -1700; --k: 1;   --zs: -260px; --t0: 0s; }
.l-floor  { --zr: -120; --z0: -1250; --k: 1;   --zs: -180px; --t0: .06s; }
.l-wings  { --zr: -90;  --z0: -820;  --k: .55; --zs: -90px;  --t0: .16s; }
.l-arcade { --zr: -40;  --z0: -420;  --k: .4;  --zs: 0px;    --t0: .3s; }
.l-front  { --zr: 30;   --z0: 340;   --zs: 160px; --t0: .5s;  --b0: 5px; }
.l-foot   { --zr: 60;   --z0: 520;   --zs: 240px; --t0: .58s; --b0: 6px; }
.l-proj   { --zr: 90;   --z0: 640;   --zs: 320px; --t0: .66s; --b0: 7px; }
.l-air    { --zr: 160;  --z0: 820;   --zs: 430px; --t0: .76s; --b0: 8px; }
/* atmosphere planes filling the two bottom corners (between and in front of the set) */
.l-mist   { --zr: 45;   --z0: 430;   --zs: 200px; --t0: .54s; }
.l-embers { --zr: 120;  --z0: 700;   --zs: 380px; --t0: .7s; }
.l-flutter { --zr: 210; --z0: 860;  --zs: 520px; --t0: .8s; }
.l-bloom  { --zr: 245;  --z0: 880;   --zs: 580px; --t0: .82s; --b0: 6px; }
.l-apron  { --zr: 262;  --z0: 890;   --zs: 600px; --t0: .9s; }
.l-bokeh  { --zr: 280;  --z0: 900;   --zs: 640px; --t0: .84s; --b0: 10px; }
body:not(.gl-curtain).is-rising .layer, .is-stage .layer { animation: planeLock 2.6s cubic-bezier(.16, .84, .3, 1) var(--t0) backwards; }
@keyframes planeLock {
  0%   { opacity: 0; filter: blur(var(--b0)) brightness(.5);
         transform: translate3d(0, calc(var(--z0) * -.04px), calc(var(--z0) * 1px)) scale(calc(1 - var(--z0) * var(--k) / 1000)); }
  30%  { opacity: 1; }
  86%  { filter: blur(0) brightness(1.08); /* each plane catches the light as it seats, a hair past its mark… */
         transform: translateZ(calc((var(--zr) - var(--z0) * .012) * 1px)) scale(calc(1 - var(--zr) / 1000)); }
  100% { opacity: 1; filter: none; transform: translateZ(calc(var(--zr) * 1px)) scale(calc(1 - var(--zr) / 1000)); } /* …and locked */
}
/* touch devices: compositor-only assembly (transform + opacity). Animating blur/brightness on eight
   full-frame planes repaints every frame on a mid-range phone, so the light-catch stays desktop-only. */
@keyframes planeLockLite {
  0%   { opacity: 0; transform: translate3d(0, calc(var(--z0) * -.04px), calc(var(--z0) * 1px)) scale(calc(1 - var(--z0) * var(--k) / 1000)); }
  30%  { opacity: 1; }
  86%  { transform: translateZ(calc((var(--zr) - var(--z0) * .012) * 1px)) scale(calc(1 - var(--zr) / 1000)); }
  100% { opacity: 1; transform: translateZ(calc(var(--zr) * 1px)) scale(calc(1 - var(--zr) / 1000)); }
}
@media (hover: none), (pointer: coarse) {
  body:not(.gl-curtain).is-rising .layer, .is-stage .layer { animation-name: planeLockLite; }
}
/* Save-Data: the stage simply appears, already assembled */
.save-data .layer, .save-data .stage-cam, .save-data .wing, .save-data .scene-stage::before { animation: none !important; }

/* the camera cranes round the set while it assembles, so the depth between the planes reads */
body:not(.gl-curtain).is-rising .stage-cam, .is-stage .stage-cam { animation: camSwing 3.4s cubic-bezier(.22, .7, .22, 1) backwards; }
@keyframes camSwing {
  0%   { transform: rotateX(8deg) rotateY(-11deg); }
  100% { transform: rotateX(calc(var(--cy) * -2.4deg)) rotateY(calc(var(--cx) * 3.4deg)); }
}
/* the two wing cutouts slide in from the sides of the frame as their plane comes forward */
.wing-l { --wx: -34%; }
.wing-r { --wx: 34%; }
body:not(.gl-curtain).is-rising .wing, .is-stage .wing { animation: wingIn 2.5s cubic-bezier(.2, .8, .25, 1) .16s backwards; }
@keyframes wingIn { from { translate: var(--wx) 0; } to { translate: 0 0; } }
/* the moment the last plane seats, a gilt flash runs across the assembled picture */
.scene-stage::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 226, 160, .22) 48%, rgba(255, 246, 220, .34) 50%, rgba(255, 226, 160, .22) 52%, transparent 65%) no-repeat;
  background-size: 260% 100%; background-position: 120% 0;
}
body:not(.gl-curtain).is-rising .scene-stage::before, .is-stage .scene-stage::before { animation: planeFlash 1.3s ease-out 2.95s both; }
@keyframes planeFlash {
  0% { opacity: 0; background-position: 120% 0; }
  20% { opacity: 1; }
  100% { opacity: 0; background-position: -20% 0; }
}

/* ── lifetime palette: each act tints the corner light (set by app.js, cross-faded via registered properties) ── */
@property --glow  { syntax: '<color>'; inherits: true; initial-value: #ffdeaa; }
@property --glow2 { syntax: '<color>'; inherits: true; initial-value: #ffb46c; }
@property --ember { syntax: '<color>'; inherits: true; initial-value: #f7cf6a; }
@property --mist  { syntax: '<color>'; inherits: true; initial-value: #ffd4b4; }
/* the palette is set (by app.js) and cross-faded only on the planes that use it: an inherited custom property
   animating on the stage root would restyle every element of the stage on every frame of the fade */
.l-mist, .l-embers, .l-flutter, .l-apron, .l-bokeh { transition: --glow 1.2s ease, --glow2 1.2s ease, --ember 1.2s ease, --mist 1.2s ease; }
/* the envelope is gone once the stage is up: stop its loops (they would keep restyling hidden elements) */
.is-stage .scene-envelope, .is-stage .scene-envelope * { animation: none !important; }

/* ── corner atmosphere: floor mist · rising embers · foreground bokeh ──
   Each is its own depth plane, so camera turns slide them against the set and scrolling flings the nearest
   (bokeh) past the lens. Positions are set by app.js from the part of the frame that is actually on screen.
   Only transform and opacity animate. */
.l-mist, .l-embers, .l-bokeh { pointer-events: none; }
.mist {
  position: absolute; top: 66%; height: 30%; width: 80%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mist) 30%, transparent), color-mix(in srgb, var(--mist) 12%, transparent) 55%, transparent);
  animation: mistDrift 28s ease-in-out infinite alternate;
}
.mist-a { left: -18%; }
.mist-b { right: -18%; top: 70%; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow2) 26%, transparent), color-mix(in srgb, var(--glow2) 10%, transparent) 55%, transparent); animation-duration: 36s; animation-direction: alternate-reverse; }
@keyframes mistDrift { from { transform: translateX(-6%) scaleY(.9); } to { transform: translateX(14%) scaleY(1.1); } }

.ember {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fffbe8, var(--ember) 40%, transparent 72%);
  box-shadow: 0 0 calc(var(--s) * 1.6) calc(var(--s) * .3) color-mix(in srgb, var(--ember) 55%, transparent);
  opacity: 0; animation: emberRise var(--dur) linear var(--delay) infinite;
}
@keyframes emberRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.5); }
  12%  { opacity: .95; }
  50%  { transform: translate(calc(var(--dx) * -.6), calc(var(--rise) * -.5)) scale(1); }
  75%  { opacity: .6; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--rise) * -1)) scale(.7); }
}
.ember.burst { animation: emberBurst var(--dur) cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes emberBurst {
  0%   { opacity: 0; transform: translate(0, 0) scale(.4); }
  10%  { opacity: 1; transform: translate(0, 0) scale(1.3); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--rise) * -1)) scale(.5); }
}

.orb {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  opacity: var(--o); scale: calc(1 + var(--beat, 0) * .14);
  animation: orbFloat var(--dur) ease-in-out var(--delay) infinite alternate;
}
.orb.soft { background: radial-gradient(circle, color-mix(in srgb, var(--glow) 75%, transparent), color-mix(in srgb, var(--glow2) 30%, transparent) 44%, transparent 70%); }
.orb.rim  { background: radial-gradient(circle, color-mix(in srgb, var(--glow) 26%, transparent) 0 50%, color-mix(in srgb, var(--glow) 70%, white 30%) 60%, transparent 70%); }
.orb.rose { background: radial-gradient(circle, color-mix(in srgb, var(--glow2) 62%, transparent), color-mix(in srgb, var(--glow2) 24%, transparent) 46%, transparent 70%); }
@keyframes orbFloat {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--fx), var(--fy)); opacity: calc(var(--o) * .55); }
}
.wash {
  position: absolute; bottom: 0; height: 75%; opacity: 0;
  background: radial-gradient(ellipse at var(--ax) 100%, color-mix(in srgb, var(--glow) 85%, transparent), color-mix(in srgb, var(--glow2) 25%, transparent) 38%, transparent 68%);
}
.wash-l { --ax: 0%; }
.wash-r { --ax: 100%; }
.l-bokeh.flare .wash { animation: washFlare 1.6s ease-out; }
.l-bokeh.flare .orb { animation: orbFlare 1.6s ease-out, orbFloat var(--dur) ease-in-out var(--delay) infinite alternate; }
@keyframes orbFlare { 15% { scale: 1.35; filter: brightness(1.6); } }
@keyframes washFlare { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

/* foreground flower banks: the nearest painted plane, kept low so the venue stays clear. They sway a little
   from the bottom, and rustle when a new lifetime comes on. */
.l-bloom { pointer-events: none; }
.bloom-bank {
  position: absolute; object-fit: cover; transform-origin: 50% 100%;
  animation: bloomSway 7s ease-in-out infinite alternate;
}
.bloom-l { object-position: left bottom; -webkit-mask-image: linear-gradient(to right, #000 72%, transparent); mask-image: linear-gradient(to right, #000 72%, transparent); }
.bloom-r { object-position: right bottom; animation-delay: -3.5s; -webkit-mask-image: linear-gradient(to left, #000 72%, transparent); mask-image: linear-gradient(to left, #000 72%, transparent); }
@keyframes bloomSway { from { transform: rotate(-.5deg) skewX(.9deg); } to { transform: rotate(.5deg) skewX(-.9deg); } }
.l-bloom.rustle .bloom-bank { animation: bloomRustle .9s ease-out, bloomSway 7s ease-in-out .9s infinite alternate; }
@keyframes bloomRustle { 20% { transform: skewX(2.4deg) scaleY(1.03); } 45% { transform: skewX(-1.8deg); } 70% { transform: skewX(.8deg); } }

/* once the stage has scrolled out of view, its ~60 looping decorations stop (embers, orbs, mist, flowers, wings,
   lamp flicker…) so they cost nothing while the guest reads the rest of the page */
.scene-stage.is-off *, .scene-stage.is-off *::before, .scene-stage.is-off *::after { animation-play-state: paused !important; }

/* stage apron: footlights along the very front of the stage. Seven footlights, one per lifetime,
   come on as the acts are lit; each throws a cone of light up the stage and a pool on the floor, in the lifetime's
   colours. */
.l-apron { pointer-events: none; }
.foot { position: absolute; translate: -50% -100%; aspect-ratio: 2 / 1; }
.foot .hood { /* the bronze shell of the lamp, gilt rim, open towards the stage */
  position: absolute; inset: 22% 0 0; border-radius: 46% 46% 8% 8% / 80% 80% 14% 14%;
  background: linear-gradient(#fff0b8, #e6bf62 12%, #8f6213 34%, #3a2408 78%, #1c1206);
  box-shadow: inset 0 2px 1px rgba(255, 246, 214, .6), 0 3px 5px rgba(0, 0, 0, .65);
}
.foot .bulb { /* the lit lip of the lamp, peeking over the rim */
  position: absolute; left: 12%; right: 12%; top: 0; height: 44%; border-radius: 50%;
  background: radial-gradient(closest-side, #fff, #fffbe9 30%, color-mix(in srgb, var(--glow) 85%, transparent) 62%, transparent);
  box-shadow: 0 0 14px 5px color-mix(in srgb, var(--glow) 60%, transparent);
  opacity: .12; transition: opacity 1s ease;
}
.foot .cone { /* light thrown up the stage */
  position: absolute; left: 50%; bottom: 55%; width: 760%; aspect-ratio: 1 / 1.1; translate: -50% 0;
  background: radial-gradient(44% 100% at 50% 100%, color-mix(in srgb, var(--glow) 78%, transparent), color-mix(in srgb, var(--glow2) 26%, transparent) 50%, transparent 74%);
  -webkit-mask-image: linear-gradient(to top, #000 6%, transparent 92%); mask-image: linear-gradient(to top, #000 6%, transparent 92%);
  opacity: 0; transform-origin: 50% 100%; transform: scaleY(.5); transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
.foot .pool { /* and spilled on the floor in front */
  position: absolute; left: 50%; top: 62%; width: 420%; aspect-ratio: 4 / 1; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 60%, transparent), transparent);
  opacity: 0; transition: opacity 1.2s ease;
}
.foot.on .bulb { opacity: 1; animation: flicker 4.2s ease-in-out infinite; }
.foot.on .cone { opacity: calc(.62 + var(--beat, 0) * .3); transform: scaleY(1); }
.foot.on .pool { opacity: .85; }
.foot:nth-child(odd).on .bulb { animation-delay: -2.1s; }

/* organza butterflies: same two-wing cut as the envelope's, wings beating in real 3D; app.js moves each one */
.flutter {
  position: absolute; left: 0; top: 0; aspect-ratio: 354 / 360;
  perspective: 600px; transform-style: preserve-3d; will-change: transform;
  filter: drop-shadow(0 2px 7px color-mix(in srgb, var(--glow) 70%, rgba(0, 0, 0, .5))); /* one shadow pass, not two: wings repaint every frame */
}
.flutter img { position: absolute; top: 0; height: 100%; }
.flutter .w-l { right: 50%; width: 48.3%; transform-origin: 100% 50%; animation: flapL var(--flap, .3s) ease-in-out infinite; }
.flutter .w-r { left: 50%; width: 51.7%; transform-origin: 0 50%; animation: flapR var(--flap, .3s) ease-in-out infinite; }
.l-sky { inset: -14% -8% -8%; } /* extra bleed: the camera rig swings round during assembly */
@media (max-aspect-ratio: 5/4) { .l-sky { inset: -90% -8% 10%; } } /* tall screens: sky reaches up past the short frame */
.l-sky img { width: 100%; height: 100%; object-fit: cover; }
.l-floor {
  top: calc(698 / 900 * 100%); /* tucks under the slanted inner foot of each wing */
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(255, 196, 120, .16), transparent 70%),
    linear-gradient(#3a1d14, #1e0d09 45%, var(--wine-deep));
}
.wing { width: calc(516 / 1600 * 100%); top: calc(66 / 900 * 100%); -webkit-box-reflect: below -2px linear-gradient(transparent 62%, rgba(0, 0, 0, .28)); }
.wing-l { left: calc(-8 / 1600 * 100%); }
.wing-r { left: calc(1092 / 1600 * 100%); transform: scaleX(-1); }
.arcade { left: 30%; top: calc(101 / 900 * 100%); width: 40%; -webkit-box-reflect: below -2px linear-gradient(transparent 60%, rgba(0, 0, 0, .3)); }
.front { left: 32.5%; top: calc(621 / 900 * 100%); width: 35%; -webkit-box-reflect: below -4px linear-gradient(transparent 50%, rgba(0, 0, 0, .25)); }

/* stage lip: dragon & phoenix candles */

.candle { position: absolute; width: calc(36 / 1600 * 100%); aspect-ratio: 164 / 640; translate: -50% -100%; }
.candle img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); -webkit-box-reflect: below -2% linear-gradient(transparent 70%, rgba(0, 0, 0, .28)); }
.candle::after { content: ""; position: absolute; left: -40%; right: -40%; bottom: -2%; height: 5%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent); }
.candle-p .halo { animation-delay: -1.3s; }
.candle .halo {
  position: absolute; left: 50%; width: 520%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 210, 140, .5), rgba(255, 150, 70, .12) 50%, transparent);
  top: 5%; animation: flicker 3.2s ease-in-out infinite; scale: calc(1 + var(--beat, 0) * .3);
}

/* lamp glows (inside their layer, so they move with it) */
.glows { inset: 0; pointer-events: none; }
.glows i {
  position: absolute; translate: -50% -50%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 214, 150, .42), rgba(255, 170, 80, 0));
  animation: flicker 5s ease-in-out infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .8; } 52% { opacity: .95; } 76% { opacity: .76; } }

/* poster in the arcade's gilt frame */
.poster {
  left: calc(699 / 1600 * 100%); top: calc(319.6 / 900 * 100%);
  width: calc(201.2 / 1600 * 100%); height: calc(303.4 / 900 * 100%);
  padding: 0; border: 0; overflow: hidden; cursor: pointer; background: #2a0b10;
  container-type: inline-size;
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease, transform 6s ease; }
.poster:hover img { transform: scale(1.04); }
.poster img.swap { opacity: 0; }
/* living poster (poster-depth.js): depth-tilt WebGL copy of the photo, over the plain <img> fallback.
   Hidden at once when the projector slides the next act in, faded back in once it has landed. */
.poster-gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: transform 6s ease; }
.poster-gl.on { opacity: 1; transition: opacity .5s ease, transform 6s ease; }
.poster:hover .poster-gl { transform: scale(1.04); }
.poster::after { content: ""; position: absolute; inset: 0; z-index: 2; box-shadow: inset 0 0 20px rgba(20, 0, 0, .6); pointer-events: none; }
.poster:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.poster-year { position: absolute; left: 7%; top: 3%; z-index: 1; font-family: var(--f-latin); font-style: italic; font-weight: 600; font-size: 11cqw; color: #f3d27b; text-shadow: 0 1px 0 #4a1e06, 0 2px 4px rgba(0, 0, 0, .6); }
.poster-neon {
  position: absolute; right: 5%; top: 4%; z-index: 1;
  writing-mode: vertical-rl; padding: 4cqw 1.6cqw;
  font-family: var(--f-zh); font-weight: 700; font-size: max(8.6cqw, 12px); line-height: 1.1; color: #ffe1b4;
  border: 1px solid #ff7a64; background: rgba(130, 8, 18, .85);
  animation: neon 7s steps(1) infinite;
}
@keyframes neon { 0%, 100% { opacity: 1; } 61% { opacity: .6; } 62% { opacity: 1; } 64% { opacity: .75; } 65% { opacity: 1; } }
.poster-title {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10cqw 0 4cqw;
  font-family: var(--f-latin); font-weight: 600; font-size: 5.6cqw; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  text-align: center; color: var(--amber-hi);
  background: linear-gradient(transparent, rgba(20, 4, 4, .75));
}
/* a poster too small to carry its title at a readable size (phones; class set by app.js): the caption under
   the stage names the lifetime instead */
.poster-small .poster-title { display: none; }

/* the projector light lands on the screen and flickers like film */
.poster::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(130% 55% at 50% 100%, rgba(255, 228, 175, .26), transparent 70%);
  animation: projFlicker 2.6s steps(1) infinite;
}
.poster > img.slide-in { z-index: 0; }

/* projector: an old film projector on a velvet-draped table (world 1600 × 900) */
.l-proj > * { position: absolute; pointer-events: none; }
.beam {
  left: calc(690 / 1600 * 100%); top: calc(612 / 900 * 100%);
  width: calc(220 / 1600 * 100%); height: calc(80 / 900 * 100%);
  clip-path: polygon(4% 0, 96% 0, 54.5% 100%, 45.5% 100%);
  background:
    linear-gradient(90deg, transparent, rgba(255, 240, 205, .35) 50%, transparent),
    linear-gradient(to top, rgba(255, 238, 196, .9), rgba(255, 228, 175, .45) 55%, rgba(255, 222, 160, .28));
  -webkit-mask-image: linear-gradient(transparent, #000 14%);
  mask-image: linear-gradient(transparent, #000 14%);
  mix-blend-mode: screen;
  animation: projFlicker 2.6s steps(1) infinite;
}
.beam i { /* dust in the light */
  position: absolute; inset: -40% 0 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 250, 230, .9), transparent),
    radial-gradient(1px 1px at 62% 12%, rgba(255, 250, 230, .8), transparent),
    radial-gradient(1.5px 1.5px at 44% 58%, rgba(255, 250, 230, .7), transparent),
    radial-gradient(1px 1px at 78% 44%, rgba(255, 250, 230, .8), transparent),
    radial-gradient(1px 1px at 34% 82%, rgba(255, 250, 230, .7), transparent);
  background-size: 100% 50%;
  animation: motes 7s linear infinite;
}
@keyframes motes { to { transform: translateY(-25%); } }
@keyframes projFlicker { 0%, 100% { opacity: 1; } 23% { opacity: .86; } 24% { opacity: 1; } 57% { opacity: .92; } 71% { opacity: .82; } 72% { opacity: 1; } }
.beam.change { animation: beamBlink .5s ease; }
@keyframes beamBlink { 30% { opacity: .25; } }

.proj-glow {
  left: calc(800 / 1600 * 100%); top: calc(690 / 900 * 100%);
  width: calc(210 / 1600 * 100%); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 226, 160, .55), rgba(255, 180, 90, .14) 55%, transparent);
  mix-blend-mode: screen;
  animation: flicker 5s ease-in-out infinite;
}
.proj-table {
  left: calc(728 / 1600 * 100%); top: calc(742 / 900 * 100%);
  width: calc(144 / 1600 * 100%); height: calc(78 / 900 * 100%);
  -webkit-box-reflect: below 0 linear-gradient(transparent 55%, rgba(0, 0, 0, .22));
}
.proj-table .cloth {
  position: absolute; inset: 8% 0 0;
  background:
    radial-gradient(55% 40% at 50% 0%, rgba(255, 205, 150, .4), transparent 75%),
    linear-gradient(90deg, rgba(12, 0, 3, .8), transparent 30%, transparent 70%, rgba(12, 0, 3, .85)),
    repeating-linear-gradient(90deg, #4e0a15 0, #7d1625 4%, #9a2030 6%, #6a1220 8.5%, #4e0a15 11%);
  clip-path: polygon(10% 0, 90% 0, 99% 93%, 93% 99%, 86% 96%, 79% 100%, 72% 97%, 64% 100%, 57% 97%, 50% 100%, 43% 97%, 36% 100%, 28% 97%, 21% 100%, 14% 96%, 7% 99%, 1% 93%);
}
.proj-table::before { /* table top, lit by the projector */
  content: ""; position: absolute; left: 9%; right: 9%; top: 0; height: 18%; z-index: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 160, .6), transparent), linear-gradient(#a42435, #6a1220);
}
.proj-table::after { /* shadow on the floor */
  content: ""; position: absolute; left: -6%; right: -6%; bottom: -8%; height: 16%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
}
.projector { /* old film projector stood on the table, back to the audience, lens throwing the beam up to the screen */
  left: calc(730 / 1600 * 100%); top: calc(638 / 900 * 100%);
  width: calc(140 / 1600 * 100%); height: auto; aspect-ratio: 140 / 120; overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}
.pj-reel { transform-box: fill-box; transform-origin: center; animation: reelSpin 4s linear infinite; }
.pj-reel-2 { animation-duration: 3.2s; }
@keyframes reelSpin { to { transform: rotate(360deg); } }
.pj-glass { filter: drop-shadow(0 0 2px #ffe8b0) drop-shadow(0 -2px 5px rgba(255, 226, 160, .9)); animation: lensGlow 2.6s ease-in-out infinite; }
@keyframes lensGlow { 50% { opacity: .82; } }
@media (prefers-reduced-motion: reduce) { .pj-reel { animation: none; } }

/* air: butterflies from the printed card + four-point sparkles */
.bfly {
  left: calc(var(--x) / 1600 * 100%); top: calc(var(--y) / 900 * 100%);
  width: calc(var(--s) / 1600 * 100%); translate: -50% -50%; rotate: var(--r);
  filter: drop-shadow(0 0 4px rgba(255, 80, 80, .35));
  animation: bflyFlap 1.6s ease-in-out infinite, bflyDrift 9s ease-in-out infinite;
}
.bfly:nth-child(2) { animation-delay: -.5s, -3s; }
.bfly:nth-child(3) { animation-delay: -1s, -6s; }
@keyframes bflyFlap { 50% { transform: scaleX(.55); } }
@keyframes bflyDrift { 50% { translate: calc(-50% + 8px) calc(-50% - 10px); } } /* translate, not margins: no layout per frame */
.spark {
  left: calc(var(--x) / 1600 * 100%); top: calc(var(--y) / 900 * 100%);
  width: calc(var(--s) / 1600 * 100%); aspect-ratio: 1; translate: -50% -50%;
  background: #c7d39a;
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
  animation: twinkle 4s ease-in-out infinite;
}
.spark:nth-of-type(2n) { animation-delay: -2s; }
@keyframes twinkle { 50% { opacity: .4; scale: .7; } }
/* 3-D romduol and Indian cork blossoms falling over the venue and the curtain call (falling-flowers.js) */
canvas.flower-fall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* act navigation */
.acts {
  position: absolute; left: 50%; bottom: max(1svh, 8px); translate: -50% 0; z-index: 5;
  width: min(560px, 92vw); text-align: center;
  opacity: 0; transition: opacity 1.2s ease 2.4s;
}
.is-stage .acts { opacity: 1; }
.acts-caption {
  margin: 0 0 .5em; font-family: var(--f-caps); white-space: nowrap;
  font-weight: 500; font-size: clamp(13px, 1.1vw, 19px);
  letter-spacing: .34em; text-indent: .34em; text-transform: uppercase; color: var(--cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}
.cap-act { display: none; }
.poster-small .cap-tag { display: none; }
.poster-small .cap-act { display: inline; letter-spacing: .2em; margin-right: -.2em; }
.poster-small .acts-caption { text-indent: 0; }
.acts-rule, .rule { position: relative; display: flex; justify-content: center; }
.acts-rule::before, .rule::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 18%, var(--rule) 82%, transparent);
}
.acts-dots { position: relative; display: flex; gap: 4px; padding: 0 14px; }
.act-dot, .prog-dot { position: relative; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.act-dot::before, .prog-dot::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; translate: -50% -50%;
  border-radius: 50%; background: var(--globe-off); opacity: .7;
  transition: opacity .5s ease, box-shadow .5s ease;
}
.act-dot.lit::before, .prog-dot.lit::before { background: var(--globe-on); opacity: 1; box-shadow: 0 0 10px 2px rgba(255, 200, 110, .55); }
.act-dot[aria-selected="true"]::after, .prog-dot[aria-current="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 19px; height: 19px; translate: -50% -50%;
  border-radius: 50%; border: 1px solid rgba(241, 210, 122, .55);
}
.scroll-cue { position: relative; display: block; width: 28px; height: 22px; margin: 0 auto; }
.scroll-cue::after { content: ""; position: absolute; inset: -11px -8px; } /* 44px to tap; the chevron keeps its place */
@media (hover: none), (pointer: coarse) { /* a finger-sized target for each lamp; the lamps keep their size */
  .acts-dots { gap: 2px; }
  .act-dot { width: 40px; height: 44px; margin: -7px 0; }
}
.scroll-cue span { display: block; width: 10px; height: 10px; margin: 6px auto; border-right: 1.5px solid var(--gold-hi); border-bottom: 1.5px solid var(--gold-hi); transform: rotate(45deg); animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 50% { transform: translate(0, 5px) rotate(45deg); opacity: .5; } }

/* programme: one footlight per section, fixed on the right */
.programme {
  position: fixed; right: clamp(10px, 1.6vw, 26px); top: 50%; translate: 0 -50%;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; pointer-events: none; transition: opacity .6s ease;
}
.is-stage.scrolled .programme { opacity: 1; pointer-events: auto; }
.prog-dot span {
  position: absolute; right: 34px; top: 50%; translate: 0 -50%; white-space: nowrap;
  padding: 4px 10px; border-radius: 2px; background: rgba(17, 6, 9, .9); border: 1px solid var(--rule);
  font-family: var(--f-latin); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.prog-dot:hover span, .prog-dot:focus-visible span { opacity: 1; }
@media (max-width: 720px) { .programme { display: none; } }

/* ═══════════ PROGRAMME SECTIONS ═══════════ */
#main { background: var(--wine-deep); }
.sec {
  position: relative; padding: clamp(80px, 11vw, 140px) 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--cream);
  background:
    radial-gradient(70% 40% at 50% 0%, color-mix(in srgb, rgba(255, 176, 110, .13), rgba(120, 140, 230, .07) calc(var(--dusk, 0) * 100%)), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(15, 82, 50, .22), transparent 70%),
    var(--wine-deep);
}
.sec + .sec { border-top: 1px solid rgba(233, 194, 122, .08); }

/* ── interlude: one photograph across the whole page, no words on it. Its top and foot fade into the page, so it
   reads as a view opening between two sections rather than a banner. On a phone it is 70% of the screen tall and
   crops to the couple; on a wide screen it grows until the picture's full width is on show (never past 86%). ── */
.interlude {
  position: relative; margin: 0; overflow: hidden;
  height: min(86vh, max(70vh, 66.67vw)); height: min(86svh, max(70svh, 66.67vw));
}
.interlude.reveal { transform: none; } /* it fades in and settles; a full-width picture does not slide up */
.interlude img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; /* keep their feet on the stone */
  filter: brightness(.9); /* a shade under the photograph's daylight, so it sits with the dark sections */
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 90%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 90%, transparent);
  transform: scale(1.06); transition: transform 2.8s cubic-bezier(.2, .7, .2, 1);
}
.interlude.in img { transform: none; }
@media (max-width: 720px) { .sec { padding-block: 60px; } } /* phones: less empty scroll between the sections */
.nw { white-space: nowrap; } /* words that must stay on one line (a year, the hotel's name) */
@media (max-width: 600px) { /* too narrow for both halves on one line: stack them, without the dot between */
  .en-note .nw, .hall-open .nw { display: block; }
  .en-note .sep, .hall-open .sep { display: none; }
}
/* the three threads: emerald Khmer silk and red Chinese silk tied at the centre, sheer organza
   weaving through. Replaces the velvet valances. The art is 3200×200 and fades out at both ends,
   so it is centred and cropped on narrow screens. --u scales it. Source: scripts/silk-ribbons.py */
.valance, .clock-valance, .cine-valance {
  --u: clamp(.8px, .09vw, 1.15px);
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; pointer-events: none;
  height: calc(var(--u) * 130);
  background: url("assets/ornament/silk-ribbons.svg?v=3") 50% 0 / auto 100% no-repeat;
  filter: drop-shadow(0 calc(var(--u) * 5) calc(var(--u) * 6) rgba(0, 0, 0, .45));
  /* soft ends when the box is narrower than the art (framed clock and cinema) */
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
/* three-fx.js swaps the SVG for live 3D silk once WebGL is up */
.gl-silk { background: none; filter: none; mask-image: none; } /* the 3D scene casts its own shadow onto the page */
/* the canvas reaches 60% above the band (the silks sweep in from the upper corners and the ball drops in)
   and hangs 40% below it (the streamers); nothing ends in a hard line: it fades out softly at every edge */
.silk-gl {
  position: absolute; left: 0; top: -60%; width: 100%; height: 200%; display: block;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 95%, transparent);
  mask-composite: intersect;
}
#invitation { padding-top: clamp(130px, 16vw, 210px); }
.site-foot > .valance { top: calc(var(--u) * 78); } /* the footer clips: room above for the 3D silk canvas (60% of the band) */

.km-display { font-family: var(--f-km-display); font-weight: 400; line-height: 1.6; margin: 0; }
.sec-head { max-width: 680px; margin-bottom: clamp(30px, 4vw, 50px); }
.sec-head h2 { font-size: clamp(26px, 4.2vw, 44px); color: var(--amber); }
.sec-head h2::after { /* gold hairline either side of the sparkle, as under the stage caption */
  content: ""; display: block; width: min(260px, 70%); margin: 14px auto 0; height: 14px;
  background-image:
    linear-gradient(90deg, transparent, var(--rule) 25%, transparent 46%, transparent 54%, var(--rule) 75%, transparent);
  background-size: 100% 1px; background-position: center; background-repeat: no-repeat; }
.sec-head h2 { position: relative; }
.sec-head h2::before {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 14px; height: 14px; translate: -50% 0;
  background: var(--amber);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}
.eyebrow {
  margin: 0 0 .6em; font-family: var(--f-caps); font-size: clamp(12px, 1vw, 14px); font-weight: 600;
  letter-spacing: .34em; text-indent: .34em; text-transform: uppercase; color: rgba(241, 230, 203, .7);
}
.sec-lead { margin: 1.2em auto 0; font-family: var(--f-km); font-size: 16px; line-height: 1.9; color: rgba(241, 230, 203, .88); }
.sec-lead .en, .en-note, .loc-en { font-family: var(--f-latin); font-style: italic; font-size: 17px; letter-spacing: .02em; }
.sec-foot { margin-top: 28px; font-family: var(--f-km); color: rgba(241, 230, 203, .75); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* shared components */
.gilt { padding: clamp(5px, .8vw, 10px); background: var(--gilt); box-shadow: 0 0 0 1px #3a2306, 0 26px 50px rgba(0, 0, 0, .55); }
.gilt > * { display: block; box-shadow: inset 0 0 0 1px rgba(58, 35, 6, .8); }
.paper {
  color: rgba(241, 230, 203, .9);
  border: clamp(4px, .6vw, 7px) solid; border-image: var(--gilt) 1;
  background: var(--programme-bg);
  box-shadow: 0 0 0 1px #3a2306, 0 26px 50px rgba(0, 0, 0, .5);
}
.btn {
  display: inline-block; margin-top: 18px; padding: 13px 26px; border: 1px solid var(--amber); border-radius: 2px;
  background: var(--amber); color: #2a0d0f; text-decoration: none; cursor: pointer;
  font-family: var(--f-km); font-size: 15px; font-weight: 700; letter-spacing: .02em;
  transition: background .25s ease, color .25s ease;
  text-wrap: balance; /* a two-language label that has to wrap breaks into even lines */
}
.btn:hover { background: var(--amber-hi); }
.btn-ghost { background: none; color: var(--amber); }
.btn-ghost:hover { background: rgba(233, 194, 122, .12); color: var(--amber-hi); }
.paper .btn { background: var(--amber); border-color: var(--amber); color: #1f0f06; }
.paper .btn:hover { background: var(--amber-hi); }
.tabset { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tabset button {
  padding: 9px 16px; border: 1px solid var(--rule); border-radius: 2px; background: none; cursor: pointer;
  font-family: var(--f-latin); font-size: 15px; font-weight: 600; color: rgba(241, 230, 203, .85);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.tabset button:hover { border-color: var(--amber); }
.tabset button[aria-selected="true"], .tabset button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #2a0d0f; }
.btn:focus-visible, .tabset button:focus-visible, .gallery button:focus-visible, .era-poster:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* ── the programme card: the print's words, set as a gilt-framed theatre programme ── */
.card {
  position: relative; width: min(760px, 100%);
  padding: clamp(70px, 8vw, 92px) clamp(26px, 7vw, 84px) clamp(50px, 7vw, 80px);
  font-family: var(--f-km); line-height: 1.9;
}
.card.paper {
  color: rgba(241, 230, 203, .9);
  border-width: clamp(5px, .7vw, 8px);
  box-shadow: 0 0 0 1px #3a2306, 0 30px 60px rgba(0, 0, 0, .6);
}
.card > svg.scallop-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card-title {
  font-size: clamp(26px, 5vw, 44px); text-wrap: balance;
  background: linear-gradient(#fbe9b0, #e2b552 55%, #b6852a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-title.sm { font-size: clamp(26px, 4.6vw, 44px); }
.card-title::after { /* hairline · sparkle · hairline, as under the section heads */
  content: ""; display: block; width: min(240px, 60%); height: 1px; margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, var(--rule) 30%, var(--rule) 70%, transparent);
}
.sparkle { display: block; width: 40px; height: 40px; flex-shrink: 0; background: var(--amber); clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%); }
.sparkle.big { width: 70px; height: 70px; margin: 34px auto; }
.parents { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(10px, 3vw, 30px); margin: 18px 0 8px; font-size: clamp(15px, 2.2vw, 22px); color: var(--cream); }
.parents p { margin: 0; }
.invite-head { margin-top: 18px; font-size: clamp(24px, 4.4vw, 40px); color: var(--amber); }
.guest-line { margin: 6px 0 0; font-family: var(--f-km-display); font-size: clamp(17px, 2.6vw, 24px); color: var(--amber-hi); }
.invite-body { max-width: 34em; margin: 12px auto 0; font-size: clamp(14.5px, 1.9vw, 18px); color: rgba(241, 230, 203, .82); }
.couple { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(8px, 2vw, 18px); margin: 30px 0 18px; container-type: inline-size; }
.couple p { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.couple small { font-size: 14px; color: rgba(241, 230, 203, .65); }
.couple strong { font-family: var(--f-km-display); font-weight: 400; white-space: nowrap; font-size: clamp(19px, 4.3cqw, 27px); color: var(--amber-hi); }
.couple em { font-family: var(--f-latin); font-size: 15px; opacity: .8; }
.couple-k { margin: 0; width: clamp(84px, 19cqw, 118px); }
.couple-k figcaption { font-size: 13px; color: var(--amber); margin-top: -4px; }
.when { padding-top: 22px; border-top: 1px solid rgba(233, 194, 122, .2); }
.when p { margin: 0; font-size: clamp(14.5px, 1.9vw, 18px); }
.when .when-date { font-family: var(--f-km-display); font-size: clamp(18px, 2.8vw, 26px); margin: 4px 0; color: var(--amber); }
.when .when-venue { font-family: var(--f-km-display); font-size: clamp(19px, 3vw, 28px); margin-top: 10px; color: var(--amber-hi); }
.sign-off { margin: 26px 0 0; font-size: 15px; }
.en-note { margin: 10px 0 0; color: rgba(241, 230, 203, .6); }
.thx-body { max-width: 32em; margin: 14px auto 0; font-size: clamp(14.5px, 1.9vw, 18px); color: rgba(241, 230, 203, .82); }
.thx-end { margin: 12px 0 0; font-weight: 700; color: var(--amber); }

/* ── countdown: the red thread of fate ──
   Chinese lore says an invisible red thread ties two people who are meant to marry. Here it ties the groom's K
   to the bride's; the numbers hang from it as red lacquer charms. The two K's slide along the thread toward the
   囍 knot as the day nears (--p: 0 at 100 days out → 1 on the day, set in sections.js). */
.clock {
  position: relative; width: min(860px, 100%);
  padding: clamp(96px, 11vw, 128px) clamp(14px, 4vw, 48px) clamp(30px, 4vw, 44px); /* room under the knot for its streamers */
  border: clamp(4px, .6vw, 7px) solid; border-image: var(--gilt) 1;
  background: var(--programme-bg);
  box-shadow: 0 0 0 1px #3a2306, 0 0 60px rgba(255, 190, 110, .08), 0 30px 60px rgba(0, 0, 0, .55);
}
/* light travelling round the gilt edge: one soft highlight, no blinking */
@property --edge-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.clock-edge {
  position: absolute; inset: calc(clamp(4px, .6vw, 7px) * -1); padding: clamp(4px, .6vw, 7px); pointer-events: none; z-index: 2;
  background: conic-gradient(from var(--edge-a), transparent 0deg 300deg, rgba(255, 244, 214, .0) 312deg, rgba(255, 246, 220, .95) 336deg, rgba(255, 236, 190, 0) 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mix-blend-mode: screen; filter: drop-shadow(0 0 6px rgba(255, 220, 150, .8));
  animation: edgeRun 7s linear infinite;
}
@keyframes edgeRun { to { --edge-a: 360deg; } }
/* a stage spotlight pooling on the numbers, gold dust drifting up through it */
.clock-spot {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(42% 70% at 50% 58%, rgba(255, 214, 150, .16), transparent 70%),
    conic-gradient(from 180deg at 50% -30%, transparent 0 160deg, rgba(255, 226, 170, .07) 172deg, rgba(255, 226, 170, .1) 180deg, rgba(255, 226, 170, .07) 188deg, transparent 200deg 360deg);
  animation: spotBreathe 6s ease-in-out infinite;
}
@keyframes spotBreathe { 50% { opacity: .75; } }
.clock-spot i {
  position: absolute; inset: 0 25% -40%;
  background:
    radial-gradient(1.4px 1.4px at 14% 22%, #ffe9b8, transparent), radial-gradient(1px 1px at 38% 64%, #ffe9b8, transparent),
    radial-gradient(1.6px 1.6px at 62% 30%, #ffe9b8, transparent), radial-gradient(1px 1px at 86% 72%, #ffe9b8, transparent),
    radial-gradient(1.2px 1.2px at 50% 90%, #ffe9b8, transparent), radial-gradient(1px 1px at 24% 46%, #ffe9b8, transparent);
  background-size: 100% 50%; opacity: .7;
  animation: dustUp 16s linear infinite;
}
@keyframes dustUp { to { transform: translateY(-50%); } }
.clock > .countdown, .clock > .clock-cap { position: relative; z-index: 1; }
.clock-valance { --u: clamp(.62px, .07vw, .85px); top: calc(var(--u) * -56); } /* ribbon tied across the frame edge, clear of the caption */
.clock-cap {
  margin: 0 0 clamp(16px, 2.4vw, 24px); font-family: var(--f-caps); font-weight: 600; font-size: clamp(12px, 1.2vw, 14px);
  letter-spacing: .42em; text-indent: .42em; text-transform: uppercase; color: var(--amber-hi);
  text-shadow: 0 0 12px rgba(255, 200, 110, .45);
}
/* the thread: a quadratic sag in a 1000 × 120 box, y = 16 + 160·t·(1 − t) at t = x / width */
@property --tl { syntax: "<number>"; inherits: true; initial-value: .04; }
.fate { --th: clamp(60px, 9vw, 104px); }
.fate-line { position: relative; height: var(--th); margin-top: clamp(26px, 3.4vw, 36px); }
.fate-line::before, .fate-line::after { /* gold studs the thread is tied to */
  content: ""; position: absolute; top: calc(var(--th) * 16 / 120); width: clamp(7px, 1vw, 11px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3cc, #e6bf62 50%, #8f6213); box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}
.fate-line::before { left: 0; }
.fate-line::after { left: 100%; }
.fate-thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.fate-thread path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.fate-thread .cord { stroke: #a3202c; stroke-width: 3.5; }
.fate-thread .twist { stroke: #ee7a72; stroke-width: 1.3; stroke-dasharray: 2 4; opacity: .65; } /* twisted silk */
.fate-thread .glint { /* light runs in from both ends and meets at the knot */
  stroke: #fff0cc; stroke-width: 2.4; stroke-dasharray: 60 940; stroke-dashoffset: 60; opacity: 0;
  animation: threadGlint 6s cubic-bezier(.45, 0, .7, 1) infinite;
}
@keyframes threadGlint { 8% { opacity: .95; } 62% { stroke-dashoffset: -940; opacity: .95; } 66%, 100% { stroke-dashoffset: -940; opacity: 0; } }
.fate-knot { /* 囍 on a red diamond knot at the centre; it glows warmer as the K's draw close */
  position: absolute; z-index: 2; left: 50%; top: calc(var(--th) * 56 / 120); translate: -50% -50%; isolation: isolate;
  display: grid; place-items: center; width: clamp(30px, 4vw, 46px); aspect-ratio: 1;
  font-family: "Ma Shan Zheng", var(--f-zh); font-size: clamp(15px, 2vw, 23px); line-height: 1; color: #ffe7b0;
  scale: calc(.85 + var(--p, 0) * .25); transition: scale 1.4s cubic-bezier(.3, 1.5, .5, 1);
}
.fate-knot::before {
  content: ""; position: absolute; inset: 12%; z-index: -1; rotate: 45deg; border-radius: 3px;
  background: radial-gradient(circle at 35% 30%, #d8363e, #8c1520 78%);
  box-shadow: inset 0 0 0 1.5px rgba(246, 220, 151, .75), 0 4px 10px rgba(0, 0, 0, .5),
    0 0 calc(6px + var(--p, 0) * 22px + var(--beat, 0) * 12px) rgba(255, 90, 70, calc(.2 + var(--p, 0) * .5));
}
.fate-knot::after { /* its tassel */
  content: ""; position: absolute; z-index: -2; left: 50%; top: 92%; translate: -50% 0; width: 34%; height: 90%;
  background: linear-gradient(#f0cd77 0 16%, transparent 16%), repeating-linear-gradient(90deg, #b3202c 0 1.5px, #7d1019 1.5px 3px);
  clip-path: polygon(32% 0, 68% 0, 68% 16%, 100% 100%, 0 100%, 32% 16%);
}
.fate-bead { /* the couple's portraits, threaded on: t runs .04 → .41 (groom) and mirrored for the bride */
  --tl: calc(.04 + .37 * var(--p, 0));
  position: absolute; z-index: 3; top: calc(var(--th) * (16 + 160 * var(--tl) * (1 - var(--tl))) / 120); translate: -50% -50%;
  display: grid; place-items: center; width: clamp(42px, 7vw, 78px); aspect-ratio: 1; border-radius: 50%;
  border: clamp(2px, .3vw, 3px) solid transparent;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .5);
  transition: --tl 3s cubic-bezier(.25, .7, .2, 1) .5s;
}
.clock:not(.in) .fate-bead { --tl: .04; } /* they set out from the ends when the frame comes into view */
.fate-bead.groom { left: calc(var(--tl) * 100%); background: radial-gradient(circle at 35% 30%, #17633f, #062b1c) padding-box, var(--gilt) border-box; }
.fate-bead.bride { left: calc((1 - var(--tl)) * 100%); background: radial-gradient(circle at 35% 30%, #fffaf0, #e6d8bb) padding-box, var(--gilt) border-box; }
.fate-bead img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fate-bead small {
  position: absolute; bottom: calc(100% + 3px); left: 50%; translate: -50% 0; white-space: nowrap;
  font-family: var(--f-km); font-size: clamp(12px, 1.3vw, 14px); line-height: 1.5; color: var(--amber-hi); text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
/* the charms hang at t = 1/8, 3/8, 5/8, 7/8, so each cord reaches up to the thread at that x */
.charms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cd-unit { --y: 33.5; --cord: calc(var(--th) * (120 - var(--y)) / 120); position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.cd-unit:nth-child(2), .cd-unit:nth-child(3) { --y: 53.5; }
.cd-unit:nth-child(1) { --dl: -1.1s; } .cd-unit:nth-child(2) { --dl: -3.4s; } .cd-unit:nth-child(3) { --dl: -.3s; } .cd-unit:nth-child(4) { --dl: -2.2s; }
.hang { /* swings from the point where its cord meets the thread */
  position: relative; width: min(86%, 150px); transform-origin: 50% calc(var(--cord) * -1);
  animation: sway 6s ease-in-out var(--dl, 0s) infinite;
}
.hang.nudge { animation: sway 6s ease-in-out var(--dl, 0s) infinite, nudge 1.3s cubic-bezier(.3, .6, .3, 1); }
@keyframes sway { 0%, 100% { rotate: -1.6deg; } 50% { rotate: 1.6deg; } }
@keyframes nudge { 18% { transform: rotate(5deg); } 42% { transform: rotate(-3deg); } 68% { transform: rotate(1.4deg); } 100% { transform: none; } }
.hang::before { /* the cord */
  content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: var(--cord); translate: -50% 0;
  background: linear-gradient(90deg, #6e0d16, #cf4a4c, #6e0d16);
}
.charm { /* a red lacquer diamond, like the paper 囍 diamonds hung at weddings; the digits stay upright */
  position: relative; aspect-ratio: 1; container-type: inline-size; isolation: isolate;
}
.charm::before { /* the diamond: a square of side w/√2 turned 45°, in a gilt rim with an inner gold rule */
  content: ""; position: absolute; inset: 14.6%; z-index: -1; rotate: 45deg; border-radius: 6%;
  border: clamp(2px, .4vw, 4px) solid transparent;
  background: linear-gradient(135deg, #c8303a, #a01b26 50%, #7a111b) padding-box, var(--gilt) border-box;
  box-shadow: inset 0 0 0 4px #a01b26, inset 0 0 0 5px rgba(246, 220, 151, .55), 8px 8px 16px rgba(0, 0, 0, .4);
}
.charm::after { /* gold bead at the top corner where the cord ties on */
  content: ""; position: absolute; left: 50%; top: 0; translate: -50% -45%; width: 9%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff3cc, #e6bf62 50%, #8f6213); box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.tassel {
  display: block; width: clamp(10px, 1.5vw, 16px); height: clamp(22px, 3.2vw, 38px); margin: -4px auto 0;
  background: linear-gradient(#f0cd77 0 18%, transparent 18%), repeating-linear-gradient(90deg, #b3202c 0 1.5px, #7d1019 1.5px 3px);
  clip-path: polygon(30% 0, 70% 0, 70% 18%, 100% 100%, 0 100%, 30% 18%);
}
.digits {
  position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
  font-family: var(--f-print); font-size: 29cqw; line-height: 1; /* Moul digits run .78–1.03em: two slots fit the diamond's waist */
  filter: drop-shadow(0 .03em 0 #3a0508) drop-shadow(0 0 .18em rgba(255, 200, 110, .3));
}
.digits:has(.dg:nth-child(3)) { font-size: 20cqw; } /* 100+ days */
.dg { position: relative; display: grid; place-items: center; width: .92em; }
.dg b {
  grid-area: 1 / 1; font-weight: 400; padding: .1em 0;
  background: linear-gradient(#fff3cc, #f0cd77 45%, #b6852a 80%, #e6bf62); -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* a turned digit drifts up and fades; the new one settles in, flaring gold */
.dg b.out { animation: dgOut .6s cubic-bezier(.5, 0, .8, .4) forwards; }
.dg b.in { animation: dgIn .75s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes dgOut { to { opacity: 0; transform: translateY(-34%) scale(1.08); filter: blur(5px); } }
@keyframes dgIn {
  from { opacity: 0; transform: translateY(26%) scale(.86); filter: blur(6px) brightness(2.2); }
  55% { opacity: 1; filter: blur(0) brightness(1.6); }
  to { opacity: 1; transform: none; filter: none; }
}
.cd-unit small {
  display: grid; gap: 2px; margin-top: clamp(8px, 1.2vw, 12px);
  font-family: var(--f-km); font-size: clamp(12px, 1.5vw, 15px); color: var(--cream);
}
.cd-unit small em { font-family: var(--f-caps); font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--amber); }
/* on the day: the charms fall away, the K's meet at the knot and it swells */
.tied .charms { display: none; }
.tied .fate-knot { scale: 1.9; }
.tied .fate { padding-bottom: clamp(30px, 4vw, 50px); }
@media (max-width: 520px) {
  .hang { width: 84%; }
  .cd-unit small em { letter-spacing: .06em; text-indent: .06em; }
  .clock-cap { letter-spacing: .16em; text-indent: .16em; }
}
@media (max-width: 340px) { /* the narrowest phones: the labels stay 12px and give up their tracking instead */
  .cd-unit small em { letter-spacing: 0; text-indent: 0; }
  .clock-cap { letter-spacing: .06em; text-indent: .06em; }
}
@media (prefers-reduced-motion: reduce) {
  .hang, .hang.nudge, .fate-thread .glint { animation: none; }
  .fate-bead { transition: none; }
}
.cd-done { font-size: clamp(22px, 3.4vw, 34px); color: var(--amber); }


/* ── gallery: one row per lifetime, led by its poster ── */
.gallery { list-style: none; margin: 0; padding: 0; width: min(1200px, 100%); display: grid; grid-template-columns: 120px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.gallery li[hidden] { display: none; }
.era-head { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.era-poster { display: block; padding: 3px; border: 0; background: var(--gilt); cursor: pointer; }
.era-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.era-head span { font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); line-height: 1.4; }
.era-head span b { display: block; font-weight: inherit; color: var(--amber-hi); } /* "Act I" on its own line beside the photos */
.era-head span i { display: none; }
.gallery button.ph[data-more]::after { /* on a lifetime's last photo in the grid: how many more the viewer holds */
  content: "+" attr(data-more); position: absolute; right: 8px; bottom: 8px; padding: 1px 10px 2px;
  font-family: var(--f-latin); font-weight: 600; font-size: 16px; letter-spacing: .06em; color: var(--amber-hi);
  background: rgba(10, 3, 5, .72); border: 1px solid var(--rule); border-radius: 2px;
}
.gallery button.ph { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #2a1014; cursor: zoom-in; overflow: hidden; box-shadow: 0 0 0 1px rgba(233, 194, 122, .25); }
.gallery .ph img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 30%; transition: transform .8s ease; }
.gallery .ph:hover img { transform: scale(1.04); }
.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 3, 5, .96); color: var(--cream); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 3, 5, .9); }
.lightbox img { max-width: 92vw; max-height: 82svh; object-fit: contain; box-shadow: 0 0 0 6px #b88a2e; }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; margin: 0; padding: 0 16px; text-align: center; font-size: clamp(13px, 3.6vw, 16px); line-height: 1.5; letter-spacing: .14em; text-indent: .14em; text-transform: uppercase; color: var(--amber); }
.lb-count { display: block; font-size: 13px; letter-spacing: .2em; text-indent: .2em; color: rgba(241, 230, 203, .75); }
.lb-btn { position: absolute; width: 52px; height: 52px; border: 1px solid var(--rule); background: rgba(17, 6, 9, .7); color: var(--cream); font-size: 30px; line-height: 1; cursor: pointer; border-radius: 2px; }
.lb-close { top: 16px; right: 16px; font-size: 22px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }

/* ── agenda ── */
.ag-date, .when p, .en-note, .loc-en { text-wrap: balance; }
.ag-date { margin: 6px 0 22px; font-family: var(--f-km-display); font-size: clamp(17px, 2.6vw, 24px); line-height: 1.7; color: var(--amber); }
.ag-date small { color: rgba(241, 230, 203, .7); }
.ag-date small { font-family: var(--f-km); font-size: clamp(13px, 1.8vw, 16px); }
.agenda { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; text-align: left; }
.agenda li { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; padding: 10px 0; }
.agenda img { width: 42px; height: 42px; object-fit: contain; }
.agenda .ag-what { font-size: clamp(14px, 1.9vw, 17px); line-height: 1.7; }
.agenda .ag-time { font-weight: 700; color: var(--amber); font-size: clamp(14px, 1.9vw, 17px); white-space: nowrap; }
.agenda .ag-time::before { content: ""; display: inline-block; width: clamp(16px, 5vw, 60px); margin: 0 10px 4px 0; border-bottom: 1.5px dashed rgba(233, 194, 122, .45); }
.agenda li.evening { margin-top: 10px; padding-top: 18px; border-top: 1px solid rgba(233, 194, 122, .22); }
.agenda li.evening .ag-time { color: var(--amber-hi); } /* the evening reception stands apart */

/* ── location ── */
.loc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: center; width: min(1040px, 100%); text-align: left; }
.loc-map { margin: 0; }
.loc-info h3 { font-size: clamp(22px, 3vw, 32px); color: var(--amber); }
.loc-info p { margin: .3em 0; font-family: var(--f-km); line-height: 1.8; }
.loc-info .loc-en { color: rgba(241, 230, 203, .75); }
.loc-time { font-weight: 700; }
.qr-mini { display: flex; align-items: center; gap: 14px; margin: 24px 0 0; }
.qr-mini img { width: 112px; padding: 4px; background: var(--gilt); }
.qr-mini figcaption { font-family: var(--f-km); font-size: 14px; color: rgba(241, 230, 203, .8); }

/* ── gift: the money pocket from the print ── */
.pocket-face {
  position: relative; padding: 28px 28px 24px;
  background: var(--env-paper) url("assets/env-lattice.webp") center / 150px; /* blind-debossed K lattice, as on the real envelope */
  border: clamp(4px, .6vw, 7px) solid; border-image: var(--gilt) 1;
  outline: 1px solid rgba(233, 194, 122, .45); outline-offset: -10px;
  box-shadow: 0 0 0 1px #3a2306, 0 26px 50px rgba(0, 0, 0, .55);
  color: #f1e6cb;
}
.pocket-title { margin: 0 0 16px; font-family: var(--f-km-display); font-size: clamp(18px, 2.4vw, 22px); color: var(--amber); }
.pocket-qr { position: relative; padding: 10px; background: #fbf6e9; }
.pocket-qr img { width: 100%; }
.khqr-badge { position: absolute; left: 50%; top: 0; translate: -50% -55%; padding: 3px 12px; background: #e1232e; color: #fff; font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .08em; border-radius: 2px; }
.pocket-name { margin: 16px 0 2px; font-family: var(--f-caps); font-weight: 600; font-size: 14px; letter-spacing: .08em; color: var(--amber-hi); }
.pocket-meta { margin: 0; font-family: var(--f-km); font-size: 14px; color: rgba(241, 230, 203, .78); }

/* ── RSVP: a reply card, two choices, an optional headcount; a gold seal once answered ── */
.rsvp-card { width: min(600px, 100%); margin: 0 auto; padding: clamp(24px, 4.5vw, 44px); font-family: var(--f-km); text-align: center; }
.rsvp-for { margin: 0 0 clamp(18px, 3vw, 26px); display: grid; gap: 4px; }
.rsvp-for small { font-family: var(--f-caps); font-size: 12px; letter-spacing: .28em; text-indent: .28em; text-transform: uppercase; color: rgba(241, 230, 203, .65); }
.rsvp-for strong { font-family: var(--f-km-display); font-weight: 400; font-size: clamp(18px, 2.6vw, 24px); line-height: 1.7; color: var(--amber-hi); overflow-wrap: anywhere; }
.rsvp-form { display: grid; gap: 20px; }
.rsvp-choice { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rsvp-legend { grid-column: 1 / -1; float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 15px; color: rgba(241, 230, 203, .88); }
.rsvp-opt { position: relative; display: block; cursor: pointer; }
.rsvp-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rsvp-opt-face {
  height: 100%; display: grid; justify-items: center; gap: 4px; padding: 20px 14px 18px;
  border: 1px solid var(--rule); border-radius: 2px; background: rgba(3, 20, 12, .4);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease, transform .25s ease;
}
.rsvp-opt-face strong { font-weight: 700; font-size: 16px; color: var(--cream); }
.rsvp-opt-face em { font-family: var(--f-latin); font-size: 17px; color: rgba(241, 230, 203, .75); }
.rsvp-tick {
  width: 26px; height: 26px; margin-bottom: 6px; border-radius: 50%; border: 1px solid var(--rule);
  display: grid; place-items: center; transition: background .25s ease, border-color .25s ease;
}
.rsvp-tick::after { /* the four-point sparkle of the section rules, lit when chosen */
  content: ""; width: 12px; height: 12px; background: #1f0f06; scale: 0; transition: scale .3s cubic-bezier(.3, 1.6, .5, 1);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}
.rsvp-opt:hover .rsvp-opt-face { border-color: var(--amber); }
.rsvp-opt input:checked + .rsvp-opt-face { border-color: var(--amber); background: rgba(233, 194, 122, .12); box-shadow: inset 0 0 0 1px var(--amber), 0 10px 26px rgba(0, 0, 0, .35); transform: translateY(-2px); }
.rsvp-opt input:checked + .rsvp-opt-face .rsvp-tick { background: var(--amber); border-color: var(--amber); }
.rsvp-opt input:checked + .rsvp-opt-face .rsvp-tick::after { scale: 1; }
.rsvp-opt input:checked + .rsvp-opt-face strong { color: var(--amber-hi); }
.rsvp-opt input:focus-visible + .rsvp-opt-face { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.rsvp-count { display: grid; justify-items: center; gap: 10px; }
.rsvp-count label { display: grid; gap: 2px; font-size: 15px; color: var(--amber-hi); }
.rsvp-count label small { font-size: 13px; color: rgba(241, 230, 203, .7); }
.rsvp-count .en { font-family: var(--f-latin); font-style: italic; font-size: 16px; color: rgba(241, 230, 203, .8); }
.rsvp-stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(233, 194, 122, .45); border-radius: 2px; background: rgba(3, 20, 12, .45); }
.rsvp-stepper button { width: 46px; min-height: 46px; border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--amber); transition: background .2s ease; }
.rsvp-stepper button:hover { background: rgba(233, 194, 122, .12); }
.rsvp-stepper button:focus-visible, .rsvp-stepper input:focus { outline: 2px solid var(--gold-hi); outline-offset: -2px; }
.rsvp-stepper input {
  width: 72px; border: 0; border-inline: 1px solid rgba(233, 194, 122, .3); background: none; text-align: center;
  color: var(--cream); font-family: var(--f-latin); font-size: 22px; font-weight: 600; -moz-appearance: textfield; appearance: textfield;
}
.rsvp-stepper input::-webkit-inner-spin-button, .rsvp-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rsvp-form .btn { justify-self: center; margin-top: 0; }
.rsvp-form .btn:disabled { opacity: .55; cursor: default; }
.rsvp-form .form-msg { text-align: center; }
.rsvp-done { display: grid; justify-items: center; gap: 10px; }
.rsvp-seal {
  width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a3343f, var(--crimson) 55%, #4d0f16);
  box-shadow: inset 0 0 0 3px rgba(241, 210, 122, .55), inset 0 0 0 6px rgba(77, 15, 22, .6), 0 10px 24px rgba(0, 0, 0, .45);
}
.rsvp-seal img { width: 52%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.rsvp-done:not(.is-yes) .rsvp-seal { background: radial-gradient(circle at 35% 30%, #3f6e57, var(--emerald) 60%, var(--emerald-deep)); }
.rsvp-done-title { font-size: clamp(22px, 3.4vw, 30px); color: var(--amber); outline: none; }
.rsvp-done-text { margin: 0; max-width: 34em; font-size: 16px; line-height: 1.9; color: rgba(241, 230, 203, .9); }
.rsvp-done-note { margin: 0; font-size: 14px; color: var(--amber-hi); }
.rsvp-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.rsvp-done.stamp .rsvp-seal { animation: rsvp-stamp .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.rsvp-done.stamp .rsvp-done-title, .rsvp-done.stamp .rsvp-done-text { animation: rsvp-rise .7s .25s ease both; }
@keyframes rsvp-stamp { from { opacity: 0; scale: 1.8; rotate: -18deg; } 60% { opacity: 1; } to { scale: 1; rotate: 0deg; } }
@keyframes rsvp-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 480px) { .rsvp-choice { grid-template-columns: 1fr; } }
.rsvp-card [hidden], #rsvp[hidden] { display: none; }

/* ── wishing board ── */
.wish-form { width: min(560px, 100%); padding: clamp(24px, 4vw, 36px); text-align: left; display: grid; gap: 16px; font-family: var(--f-km); }
.wish-form label { display: grid; gap: 6px; font-size: 15px; }
.wish-form input:not([type="radio"]), .wish-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(233, 194, 122, .45); border-radius: 2px;
  background: rgba(3, 20, 12, .45); color: var(--cream); font: inherit; font-size: 16px; resize: vertical;
}
.wish-form input:focus, .wish-form textarea:focus { outline: 2px solid var(--gold-hi); outline-offset: 1px; border-color: transparent; }
.wish-form label { color: var(--amber-hi); }
.wish-side { display: flex; flex-wrap: wrap; gap: 0 22px; }
.wish-side label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.wish-side input { accent-color: var(--amber); width: 18px; height: 18px; }
.wish-side label { color: rgba(241, 230, 203, .88); }
.wish-form .btn { justify-self: start; margin-top: 4px; }
.form-msg { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--amber-hi); }
/* how many wishes are already on the board */
.wish-count { margin: 1.1em auto 0; display: grid; justify-items: center; gap: 2px; font-family: var(--f-km); color: rgba(241, 230, 203, .88); }
.wish-count-n {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-km-display); font-size: clamp(34px, 5vw, 48px); line-height: 1.3; color: var(--gold-hi);
  text-shadow: 0 0 18px rgba(241, 210, 122, .35);
}
.wish-count-n::before, .wish-count-n::after { /* gold sparkles either side */
  content: ""; width: 14px; aspect-ratio: 1; background: var(--amber);
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
}
.wish-count-km { font-size: 16px; }
.wish-count-en { display: block; font-family: var(--f-latin); font-style: italic; font-size: 16px; letter-spacing: .02em; opacity: .85; }
.wish-count.bump .wish-count-n { animation: wishBump .7s ease-out; }
@keyframes wishBump { 30% { scale: 1.25; text-shadow: 0 0 28px rgba(241, 210, 122, .8); } }
@media (prefers-reduced-motion: reduce) { .wish-count.bump .wish-count-n { animation: none; } }
/* preview / not-connected note above the lantern sky */
.wish-mode[hidden] { display: none; }
.wish-mode {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  width: min(1100px, 100%); margin: 0 0 14px; padding: 10px 16px; border: 1px dashed rgba(233, 194, 122, .6);
  font-family: var(--f-km); font-size: 14px; color: var(--amber-hi); background: rgba(3, 20, 12, .45);
}
.wish-mode[data-mode="offline"] { border-color: rgba(240, 138, 74, .8); color: #f3b38a; }
.wish-mode-clear[hidden] { display: none; }
.wish-mode-clear {
  padding: 4px 12px; border: 1px solid rgba(233, 194, 122, .6); border-radius: 2px; background: none;
  color: inherit; font: inherit; font-size: 13px; cursor: pointer;
}
.wish-mode-clear:hover { background: rgba(233, 194, 122, .12); }
.wish-local { border-style: dashed !important; }
.wish-local-tag { font-style: normal; font-size: 12px; letter-spacing: .04em; padding: 1px 8px; border: 1px solid rgba(233, 194, 122, .5); border-radius: 999px; color: var(--amber-hi); }
.wish-form .wish-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wish-wall p { white-space: pre-line; overflow-wrap: anywhere; }
.wish-wall { list-style: none; margin: 36px 0 0; padding: 0; width: min(1100px, 100%); display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px; text-align: left; }
.wish-wall li { flex: 0 1 340px; }
.wish-wall li {
  position: relative; padding: 22px 20px 16px;
  background: var(--programme-bg); color: rgba(241, 230, 203, .9); border-radius: 2px;
  border: 1px solid rgba(233, 194, 122, .55); outline: 1px solid rgba(233, 194, 122, .25); outline-offset: -6px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .4); font-family: var(--f-km);
}
.wish-wall li:not(.wish-empty)::before { /* gold sparkle, as on the programme cards */
  content: ""; position: absolute; right: 14px; top: 14px; width: 16px; aspect-ratio: 1; background: var(--amber);
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
}
.wish-wall strong { color: var(--amber-hi); }
.wish-wall p { margin: 0 0 12px; padding-right: 22px; font-size: 15.5px; line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; }
.wish-wall footer { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; opacity: .85; }
.wish-wall strong { font-weight: 700; }
.wish-wall.wish-empty { columns: auto; }
.wish-wall li.wish-empty { text-align: center; color: rgba(241, 230, 203, .7); font-family: var(--f-km); background: none; box-shadow: none; border: 0; outline: 0; }

/* ── footer: the curtain comes down ── */
.site-foot { position: relative; padding: clamp(240px, 24vw, 330px) 16px 70px; text-align: center; background: var(--wine-deep); color: rgba(241, 230, 203, .75); }
.site-foot > img { width: 84px; margin: 0 auto 10px; }
.site-foot p { margin: 0; letter-spacing: .22em; font-size: 14px; }

@media (max-width: 720px) {
  .parents, .couple { grid-template-columns: 1fr; gap: 10px; }
  .parents .sparkle { margin: 0 auto; }
  .couple-k { margin: 0 auto; }
  .loc { grid-template-columns: 1fr; }
  .agenda li { grid-template-columns: 38px 1fr; }
  .agenda img { width: 34px; height: 34px; }
  .agenda .ag-time { grid-column: 2; }
  .agenda .ag-time::before { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .era-head { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .era-head span b, .era-head span i { display: inline; font-style: normal; color: inherit; }
  .loc { text-align: center; }
  .qr-mini { display: none; } /* a QR to scan is no use on the phone that is showing it: the button opens the map */
  .era-poster { width: 56px; flex-shrink: 0; }
  .gallery .era-head + li { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
  .layer, .stage-cam { transform: none !important; translate: none !important; }
}

/* ═══════════════════════════════════════════════
   MOTION LAYER — Three.js curtain + lanterns, paper tilt
   ═══════════════════════════════════════════════ */

/* WebGL cloth curtain replaces the two CSS velvet panels once its texture is ready */
.curtain-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.curtain-gl.loose { position: fixed; z-index: 20; } /* finishing its run over the stage, after the letter scene has gone */
.gl-curtain .velvet { visibility: hidden; }

/* the letter tilts with the pointer / phone; a sheen crosses the print */
.scene-envelope { perspective: 1600px; }
.env-wrap {
  transform: rotateX(calc(var(--py, 0) * -5deg)) rotateY(calc(var(--px, 0) * 7deg));
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.is-flipping .env-wrap, .is-opening .env-wrap, .is-rising .env-wrap { transform: none; }
.env-body::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 248, 220, .34) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  background-position: calc(50% - var(--px, 0) * 45%) 0;
  mix-blend-mode: soft-light;
  transition: background-position .6s cubic-bezier(.2, .7, .2, 1);
}

/* printed cards: paper in the hand */
.card.reveal.in { transition: opacity .9s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.card.tilt { transform: perspective(1400px) rotateX(calc((.5 - var(--my, .5)) * 4deg)) rotateY(calc((var(--mx, .5) - .5) * 5deg)); }
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at calc(var(--mx, .5) * 100%) calc(var(--my, .5) * 100%), rgba(255, 255, 240, .4), transparent 45%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity .4s ease;
}
.card.tilt::after { opacity: 1; }

/* agenda: rows set in one by one, icons pop like stamps */
.agenda li { opacity: 0; translate: -10px 0; transition: opacity .6s ease, translate .6s ease; transition-delay: calc(var(--i, 0) * 90ms + .25s); }
.agenda img { scale: .6; transition: scale .5s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(var(--i, 0) * 90ms + .4s); }
.card.in .agenda li { opacity: 1; translate: 0; }
.card.in .agenda img { scale: 1; }

/* lantern sky over the wishing board */
.lantern-sky { display: none; position: relative; width: min(1100px, 100%); margin: 0 0 32px; padding: clamp(5px, .8vw, 10px); background: var(--gilt); box-shadow: 0 0 0 1px #3a2306, 0 26px 50px rgba(0, 0, 0, .55); }
.lantern-sky.on { display: block; }
.lantern-sky::before { /* the same night sky as the stage */
  content: ""; display: block; height: clamp(320px, 56svh, 560px);
  background: #0b0f1d url("assets/stage/sky.webp") center 30% / cover no-repeat;
}
.lantern-sky canvas { position: absolute; inset: clamp(5px, .8vw, 10px); width: calc(100% - 2 * clamp(5px, .8vw, 10px)); height: calc(100% - 2 * clamp(5px, .8vw, 10px)); display: block; }
.lantern-hint {
  position: absolute; left: 50%; bottom: 22px; translate: -50% 0; margin: 0; width: max-content; max-width: 90%;
  font-family: var(--f-km); font-size: 14px; color: rgba(241, 230, 203, .85); text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8); pointer-events: none;
}
.lantern-note[hidden] { display: none; }
/* the wish, unfolded: a rice-paper note hanging from its lantern on a gold cord */
.lantern-note {
  --band: #b8561c;
  position: absolute; z-index: 3; width: min(300px, 78%);
  padding: 40px 22px 20px; text-align: left; font-family: var(--f-km); color: #3b1a0c;
  isolation: isolate; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .5));
  transform-origin: 50% 22px; /* swings and unfolds about its eyelet */
}
.lantern-note[data-side="bride"] { --band: #a42a26; }
.lantern-note::after { /* the paper, with a torn lower edge */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(var(--band), var(--band)) top / 100% 12px no-repeat,
    linear-gradient(#d9b35a, #d9b35a) 0 12px / 100% 2px no-repeat,
    repeating-linear-gradient(176deg, rgba(120, 80, 30, .05) 0 1px, transparent 1px 7px),
    linear-gradient(#fbf1d8, #ecd9ad);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 92% 100%, 84% calc(100% - 5px), 73% 100%, 62% calc(100% - 4px), 50% 100%, 39% calc(100% - 5px), 27% 100%, 16% calc(100% - 4px), 7% 100%, 0 calc(100% - 5px));
}
.lantern-note::before { /* eyelet the cord is tied through */
  content: ""; position: absolute; left: 50%; top: 22px; width: 12px; height: 12px; translate: -50% -50%;
  border-radius: 50%; background: #2a140a; box-shadow: 0 0 0 2px #c99a3a;
}
.lantern-note.unfold { animation: noteUnfold .45s cubic-bezier(.2, .9, .3, 1.15) both, noteSway 4.2s ease-in-out .45s infinite; }
@keyframes noteUnfold { from { opacity: 0; scale: .25 .1; } to { opacity: 1; scale: 1 1; } }
@keyframes noteSway { 0%, 100% { rotate: -1.2deg; } 50% { rotate: 1.2deg; } }
.lantern-cord[hidden] { display: none; }
.lantern-cord { /* from the lantern's base down to the note's eyelet */
  position: absolute; z-index: 2; width: 2px; margin-left: -1px; transform-origin: 50% 0; pointer-events: none;
  background: linear-gradient(#f1d27a, #c99a3a); box-shadow: 0 0 4px rgba(255, 200, 120, .5);
}
.lantern-cord.unfold { animation: cordDrop .3s ease-out both; }
@keyframes cordDrop { from { scale: 1 0; } to { scale: 1 1; } }
.lantern-note strong { color: #5a1c10; }
.lantern-note p { margin: 0 0 12px; padding-right: 6px; font-size: 15.5px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; max-height: 9.5em; overflow: auto; }
.lantern-note footer { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 8px; border-top: 1px dashed rgba(90, 28, 16, .35); font-size: 13px; color: rgba(59, 26, 12, .8); }
.lantern-note button { position: absolute; right: 4px; top: 16px; width: 32px; height: 32px; border: 0; background: none; color: #5a1c10; cursor: pointer; font-size: 15px; }
.lantern-note button:focus-visible { outline: 2px solid var(--band); }
@media (prefers-reduced-motion: reduce) { .lantern-note.unfold, .lantern-cord.unfold { animation: none; } }

/* ── #1 a glint crosses the gold K on the letter ── */
.env-body .env-glint {
  position: absolute; left: 26%; top: 28%; width: 48%; height: 26%; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 246, 205, .9) 50%, transparent 58%) no-repeat 150% 0 / 300% 100%;
  -webkit-mask: radial-gradient(closest-side, #000 55%, transparent); mask: radial-gradient(closest-side, #000 55%, transparent);
  mix-blend-mode: overlay;
  animation: kGlint 5.5s ease-in-out infinite 1.5s;
}
@keyframes kGlint { 0% { background-position: 150% 0; } 45%, 100% { background-position: -50% 0; } }

/* ── a gold sheen passes along the debossed scrolls on the letter's front ── */
.env-body .env-sparkle {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask: url("assets/env-front-pattern.webp") center / 100% 100% no-repeat;
          mask: url("assets/env-front-pattern.webp") center / 100% 100% no-repeat;
  /* a faint gilt wash travels slowly across the scrolls */
  background: linear-gradient(125deg, transparent 46%, rgba(240, 196, 100, .5) 50%, transparent 54%) no-repeat 140% 0 / 300% 300%;
  animation: scrollWash 9s ease-in-out infinite .3s;
}
@keyframes scrollWash { 0% { background-position: 140% 0; } 55%, 100% { background-position: -40% 100%; } }
.is-flipping .env-sparkle, .is-opening .env-sparkle, .is-rising .env-sparkle { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .env-sparkle { display: none; } }

/* ── #4 between acts: the little curtain drops, the stage leans in ── */
.poster-drape {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: #5a0f18 url("assets/velvet.webp") center / cover;
  transform-origin: 50% 0; transform: scaleY(0);
}
.poster-drape::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5%; background: repeating-linear-gradient(90deg, #e6bf62 0 3px, #8f6213 3px 6px); }
.poster.drop .poster-drape { animation: drape 1.2s cubic-bezier(.6, 0, .3, 1); }
@keyframes drape { 0% { transform: scaleY(0); } 38%, 55% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
.stage-frame.push { transform: scale(1.035); transition-duration: 1.1s; }

/* ── #7 cinema: house lights down, projector beam on the screen ── */
body::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(5, 2, 3, .84); opacity: 0; pointer-events: none; transition: opacity 1.2s ease; }
body.cinema::after { opacity: 1; }
.cinema .cine { z-index: 41; }

/* ── #8 walk-through hall ── */
.hall-open { margin: -10px 0 26px; font-family: var(--f-km); }
.hall { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0b0806; color: var(--cream); overflow: hidden; }
.hall::backdrop { background: #090d18; }
.hall .lb-btn:disabled { opacity: .25; pointer-events: none; }
/* walk through the lifetimes: one layered painted world per act */
.lt-stage { position: absolute; inset: 0; z-index: 0; isolation: isolate; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.lt-stage:active { cursor: grabbing; }
/* multiplane assembly: each plane arrives from its own depth (--az, with --as part-compensating the perspective
   so far planes grow into place and the front settles back) and locks flat at Z = 0, far first, front last.
   Transform and opacity only, so it stays on the compositor; lifetimes.js waits ASSEMBLE_MS (the front's
   delay + duration) before the world starts to idle. */
.lt-scene { position: absolute; inset: 0; overflow: hidden; visibility: hidden; opacity: 0; perspective: 1000px; perspective-origin: 50% 45%; }
.lt-scene.is-on { visibility: visible; opacity: 1; z-index: 2; }
.lt-scene.is-on .lt-layer, .lt-scene.is-on .lt-strip { animation: ltAssemble 1.35s cubic-bezier(.16, .8, .24, 1) var(--ad, 0s) both; }
.lt-far { --az: -560px; --as: 1.3; --ay: 3vh; --ad: 0s; }
.lt-mid { --az: -280px; --as: 1.14; --ay: 7vh; --ad: .1s; }
.lt-strip { --az: -160px; --as: 1; --ay: 5vh; --ad: .22s; }
.lt-front { --az: 300px; --as: 1; --ay: 12vh; --ad: .34s; }
.lt-scene.is-leaving { visibility: visible; z-index: 3; animation: ltOut 1.05s cubic-bezier(.5, 0, .7, .4) both; pointer-events: none; }
@keyframes ltAssemble { from { opacity: 0; translate: 0 var(--ay) var(--az); scale: var(--as); } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lt-scene.is-on .lt-layer, .lt-scene.is-on .lt-strip { animation: none; } }
@keyframes ltOut { to { opacity: 0; scale: 1.6; filter: blur(14px); } }
.lt-layer { position: absolute; top: 0; left: 0; height: 100%; background: center / cover no-repeat; will-change: transform; pointer-events: none; }
.lt-far { height: 104%; top: -2%; }
.lt-front { filter: saturate(1.05) brightness(.96); }
.lt-mid { background-position: center bottom; }
.lt-front { background-position: center bottom; z-index: 3; }
/* the photos: a hand-hung strip between the middle and front layers */
.lt-strip { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: clamp(28px, 4vw, 64px); padding: 0 max(12vw, 60px); will-change: transform; }
.lt-poster { flex: none; margin: 0; width: clamp(150px, 19vw, 260px); text-align: center; }
.lt-pimg { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border: 6px solid var(--frame, #c9962a); box-shadow: 0 24px 50px rgba(0, 0, 0, .55); }
.lt-pimg::after { content: ""; position: absolute; inset: 0; z-index: 1; box-shadow: 0 0 0 1px rgba(255, 230, 170, .4) inset; pointer-events: none; }
.lt-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the living poster (depth-view.js) fades in over the plain photo once the world has locked */
.lt-gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.lt-gl.on { opacity: 1; }
.lt-poster figcaption { margin-top: 12px; font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--cap, #f3d9a0); text-shadow: 0 1px 6px #000; }
.lt-ph { flex: none; position: relative; width: clamp(220px, 27vw, 400px); aspect-ratio: 3 / 2; padding: 0; border: 0; background: var(--mat, #1c1210); cursor: zoom-in; translate: 0 var(--dy, 0); rotate: var(--rot, 0deg); box-shadow: 0 0 0 var(--fw, 8px) var(--frame, #c9962a), 0 0 0 calc(var(--fw, 8px) + 2px) var(--frame-edge, rgba(60, 30, 10, .6)), 0 26px 50px rgba(0, 0, 0, .55); transition: rotate .5s ease, scale .5s ease; }
.lt-ph:nth-of-type(3n) { width: clamp(170px, 19vw, 290px); aspect-ratio: 4 / 5; }
.lt-ph img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; pointer-events: none; }
.lt-ph::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 60vh; background: linear-gradient(transparent, var(--cord, rgba(240, 210, 150, .55))); translate: -50% calc(-1 * var(--fw, 8px)); }
.lt-ph:hover, .lt-ph:focus-visible { rotate: 0deg; scale: 1.04; outline: none; }
.lt-ph:focus-visible { box-shadow: 0 0 0 var(--fw, 8px) var(--frame, #c9962a), 0 0 0 calc(var(--fw, 8px) + 4px) #fff; }
/* era frames */
.lt-angkor { --frame: #c9962a; --frame-edge: #5a3a12; --mat: #2a1c10; }
.lt-imperial { --frame: #a3171c; --frame-edge: #d8a63a; --fw: 10px; --cord: rgba(230, 60, 40, .7); }
.lt-jungle { --frame: #b98f3a; --frame-edge: #2e4a2a; --cord: rgba(200, 230, 170, .5); }
.lt-deco { --frame: #1d2a3a; --frame-edge: #c8a050; --fw: 9px; --cap: #e8c77e; }
.lt-laterite { --frame: #8a3e26; --frame-edge: #d2a35a; }
.lt-mint { --frame: #faf4e6; --frame-edge: #6a4428; --fw: 12px; --mat: #faf4e6; --cord: rgba(110, 70, 40, .5); }
.lt-mint .lt-ph { padding: 0 0 22px; background: #faf4e6; }
.lt-ivory { --frame: #efe7d6; --frame-edge: #c9b48a; --fw: 7px; --mat: #fff; --cap: #6b5a3c; --cord: rgba(160, 140, 100, .5); }
.lt-ivory .lt-poster figcaption { text-shadow: 0 1px 6px rgba(255, 255, 255, .9); }
/* floating motes in each world's light */
.lt-motes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.lt-motes i { position: absolute; left: var(--x); top: 105%; width: calc(8px * var(--s)); height: calc(8px * var(--s)); border-radius: 50%; background: var(--tint); opacity: 0; animation: ltMote var(--d) linear var(--delay) infinite; }
.lt-motes i.petal { border-radius: 70% 0 70% 0; width: calc(10px * var(--s)); }
.lt-motes i.firefly, .lt-motes i.spark { box-shadow: 0 0 10px 3px var(--tint); width: calc(4px * var(--s)); height: calc(4px * var(--s)); }
.lt-motes i.dust { width: calc(3px * var(--s)); height: calc(3px * var(--s)); }
@keyframes ltMote { 10% { opacity: .85; } 50% { translate: 4vw -55vh; rotate: 180deg; } 90% { opacity: .7; } 100% { translate: -3vw -112vh; rotate: 360deg; opacity: 0; } }
@media (max-width: 640px) {
  .lt-ph { width: 68vw; }
  .lt-ph:nth-of-type(3n) { width: 52vw; }
  .lt-poster { width: 46vw; }
}
.hall-title { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 140px); margin: 0; padding: 7px 18px; border-radius: 999px; background: rgba(12, 6, 4, .55); text-align: center; pointer-events: none; font-weight: 600; font-size: clamp(15px, 1.6vw, 20px); letter-spacing: .24em; text-transform: uppercase; color: var(--amber); text-shadow: 0 1px 8px #000; }
.hall-hint { position: absolute; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 6px 16px; border-radius: 14px; background: rgba(12, 6, 4, .55); text-align: center; pointer-events: none; font-family: var(--f-km); font-size: 14px; line-height: 1.6; color: rgba(241, 230, 203, .75); text-shadow: 0 1px 6px #000; }
.hall-hint span { font-family: var(--f-latin); font-style: italic; font-size: 15px; }
/* choosing a lifetime: labelled previous / next steps either side of a I–VII rail along the foot of the hall */
.hall-nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 22px clamp(12px, 3vw, 36px) calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(8, 4, 3, .72) 45%); }
.hall-step { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; max-width: 100%; padding: 8px 20px; border: 1px solid rgba(240, 205, 130, .7); border-radius: 999px; background: rgba(18, 9, 6, .78); color: var(--cream); font: inherit; text-align: left; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transition: background .3s ease, transform .3s ease, box-shadow .3s ease; }
.hall-prev { justify-self: start; }
.hall-next { justify-self: end; text-align: right; background: linear-gradient(180deg, #e9c46d, #b8862a); border-color: #f6dc98; color: #2a1606; }
.hall-step:hover, .hall-step:focus-visible { transform: translateY(-2px); outline: none; box-shadow: 0 0 0 2px #fff3cf, 0 12px 28px rgba(0, 0, 0, .5); }
.hall-step:disabled { visibility: hidden; }
.hs-arrow { font-size: 30px; line-height: 1; }
.hs-text { display: grid; gap: 1px; min-width: 0; }
.hs-text small { font-family: var(--f-km), var(--f-latin); font-size: 12px; letter-spacing: .06em; opacity: .85; }
.hs-text b { overflow: hidden; font-weight: 600; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.hall-next.is-calling { animation: hallCall 1.6s ease-in-out infinite; }
.hall-next.is-calling .hs-arrow { animation: hallNudge 1.6s ease-in-out infinite; }
@keyframes hallCall { 50% { box-shadow: 0 0 0 6px rgba(246, 220, 152, .35), 0 0 34px 6px rgba(246, 200, 110, .55); } }
@keyframes hallNudge { 50% { translate: 5px 0; } }
.hall-rail { position: relative; display: flex; gap: clamp(6px, 1.2vw, 14px); margin: 0; padding: 0; list-style: none; }
.hall-rail::before { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, rgba(240, 205, 130, .8) 12%, rgba(240, 205, 130, .8) 88%, transparent); }
.hall-rail button { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(240, 205, 130, .65); border-radius: 50%; background: rgba(18, 9, 6, .85); color: rgba(241, 230, 203, .8); font: 600 11px/1 var(--f-latin); letter-spacing: .04em; cursor: pointer; transition: transform .3s ease, background .3s ease, color .3s ease; }
.hall-rail button.is-seen { color: #f1d79a; }
.hall-rail button:hover, .hall-rail button:focus-visible { transform: scale(1.12); outline: none; border-color: #fff3cf; }
.hall-rail button.is-on { transform: scale(1.22); background: linear-gradient(180deg, #e9c46d, #b8862a); border-color: #f6dc98; color: #2a1606; box-shadow: 0 0 16px rgba(246, 200, 110, .6); }
@media (max-width: 760px) {
  .hall-nav { grid-template-columns: 1fr 1fr; row-gap: 12px; padding-top: 30px; }
  .hall-rail { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .hall-step { min-height: 50px; padding: 6px 14px; gap: 8px; }
  .hs-text small { font-size: 11px; }
  .hs-text b { font-size: 13px; letter-spacing: .1em; }
  .hs-en { display: none; }
  .hall-hint { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) { .hall-rail button { width: 30px; height: 30px; } }
@media (prefers-reduced-motion: reduce) { .hall-next.is-calling, .hall-next.is-calling .hs-arrow { animation: none; } .hall-next.is-calling { box-shadow: 0 0 0 3px #fff3cf; } }

/* ── #9 the programme runs from dawn (top) into night (evening reception) ── */
#agenda::before, #agenda::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
#agenda::before { background: linear-gradient(rgba(233, 150, 96, .24), rgba(255, 200, 140, .08) 40%, transparent 75%); opacity: calc(1 - var(--sky, 0)); }
#agenda::after { background: url("assets/stage/sky.webp") center / cover; opacity: calc(var(--sky, 0) * .4); mix-blend-mode: screen; }
#agenda > .card { z-index: 1; }

/* ── #10 map: the river shimmers, the route draws itself in gold, the hotel pulses ── */
.map-art { position: relative; display: block; overflow: hidden; }
.map-river {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("assets/print/river-mask.webp") 0 0 / 100% 100%; mask: url("assets/print/river-mask.webp") 0 0 / 100% 100%; mask-mode: luminance;
  background: linear-gradient(100deg, transparent 30%, rgba(200, 240, 230, .3) 45%, transparent 60%) no-repeat 0 0 / 300% 100%;
  mix-blend-mode: screen; animation: river 7s linear infinite;
}
@keyframes river { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.map-route {
  position: absolute; left: 49.09%; top: 39.16%; width: 30%; height: 38.29%; max-width: none; pointer-events: none;
  clip-path: inset(0 0 100% 0); transition: clip-path 2.6s cubic-bezier(.5, 0, .3, 1) .6s;
  filter: drop-shadow(0 0 4px rgba(246, 210, 122, .7));
}
.loc.in .map-route { clip-path: inset(0); }
.map-pin { position: absolute; left: 60.4%; top: 82%; width: 13%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 2px solid rgba(246, 210, 122, .9); pointer-events: none; opacity: 0; animation: pin 2.2s ease-out infinite 3s; }
@keyframes pin { 0% { scale: .3; opacity: .9; } 100% { scale: 1.4; opacity: 0; } }
.loc-map { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.loc-map.tilt, .pocket.tilt { transform: perspective(1200px) rotateX(calc((.5 - var(--my, .5)) * 5deg)) rotateY(calc((var(--mx, .5) - .5) * 6deg)); }

/* ── #11 the money pocket: once it arrives, a band of gold light scans down the QR and its corner
   marks breathe, so it reads as "scan me". Both sit outside the code's modules' contrast: the
   light is a faint additive sheen and the marks sit in the paper margin. ── */
.pocket { position: relative; width: min(380px, 100%); }
.pocket.reveal.in { transition: opacity .9s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.pocket-inner { position: relative; }
.pocket-qr::before { /* gold corner marks in the margin round the code */
  content: ""; position: absolute; inset: 4px; pointer-events: none; z-index: 1;
  --c: rgba(201, 150, 52, .95); --l: 22px; --w: 3px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 0 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 100% 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 0 100% / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 100% 100% / var(--w) var(--l);
  background-repeat: no-repeat; opacity: 0;
}
.pocket-qr::after { /* the scanning light */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(255, 214, 130, .18) 70%, rgba(255, 226, 160, .5) 97%, transparent) 0 -40% / 100% 28% no-repeat;
  mix-blend-mode: screen; opacity: 0;
}
.pocket.in .pocket-qr::before { animation: qrMarks 2.8s ease-in-out .6s infinite; }
.pocket.in .pocket-qr::after { animation: qrScan 3.6s cubic-bezier(.45, 0, .55, 1) .9s infinite; }
@keyframes qrMarks { 0%, 100% { opacity: .55; inset: 4px; } 50% { opacity: 1; inset: 1px; } }
@keyframes qrScan { 0% { background-position: 0 -40%; opacity: 0; } 8% { opacity: 1; } 62% { background-position: 0 140%; opacity: 1; } 70%, 100% { background-position: 0 140%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pocket.in .pocket-qr::after { animation: none; }
  .pocket.in .pocket-qr::before { animation: none; opacity: .8; }
}
.pocket-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }

/* ── #13 curtain call: the velvet stands closed at the foot of the page, then parts on the last two pictures
   (three-fx.js) while romduol and cork blossoms fall (falling-flowers.js); without WebGL or with reduced
   motion the pictures simply show ── */
.site-foot { min-height: 100svh; padding-bottom: clamp(48px, 7vw, 90px); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden; }
.site-foot > img, .site-foot > p { position: relative; z-index: 3; }
.curtain-call { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; }
.foot-air { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* the last two pictures fill the page behind everything: the wide shot and the close-up side by side,
   blended where they meet. The names and date stand in the gap between the two couples (about 47% across
   at any width), darkened so they read. On a tall screen the pictures stack below the knot and the text. */
.site-foot { background: #06140d; }
.foot-photos { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: 2fr 3fr; overflow: hidden; }
.foot-photos img { display: block; width: 100%; height: 100%; min-width: 0; max-width: none; object-fit: cover; }
.foot-photos img:first-child { object-position: 50% 74%; }
.foot-photos img:last-child {
  object-position: 50% 42%;
  margin-left: -7vw; width: calc(100% + 7vw); /* overlaps the wide shot and fades in over it */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7vw); mask-image: linear-gradient(to right, transparent, #000 7vw);
}
.foot-photos::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(22vw 70% at 46% 62%, rgba(4, 16, 10, .62), rgba(4, 16, 10, .3) 60%, transparent),
    linear-gradient(rgba(4, 16, 10, .85), rgba(4, 16, 10, .45) 28%, transparent 48%, transparent 78%, rgba(4, 16, 10, .45));
}
.site-foot > img, .site-foot > p { translate: -4vw 0; max-width: min(38vw, 440px); }
.site-foot > .foot-date span { display: block; }
.site-foot > .foot-venue { flex-direction: column; align-items: center; gap: 0; }
@media (max-aspect-ratio: 3/4) {
  .site-foot { --top: clamp(150px, 42vw, 200px); min-height: calc(var(--top) + 216.7vw); }
  .site-foot > img, .site-foot > p { translate: none; max-width: none; }
  .foot-photos { top: var(--top); display: block; }
  .foot-photos img, .foot-photos img:last-child { width: 100%; height: auto; margin: 0; object-fit: fill; }
  .foot-photos img:first-child { -webkit-mask-image: linear-gradient(transparent, #000 12%); mask-image: linear-gradient(transparent, #000 12%); }
  .foot-photos img:last-child { margin-top: -10vw; -webkit-mask-image: linear-gradient(transparent, #000 10vw); mask-image: linear-gradient(transparent, #000 10vw); }
  .foot-photos::after { background: linear-gradient(rgba(6, 20, 13, .9), rgba(6, 20, 13, .72) 26%, rgba(6, 20, 13, .38) 36%, transparent 46%); }
}

/* ── #14 lamps breathe with the music (--beat is set from the audio) ── */
.glows i { scale: calc(1 + var(--beat, 0) * .35); }
.act-dot.lit::before, .prog-dot.lit::before { box-shadow: 0 0 calc(10px + var(--beat, 0) * 12px) calc(2px + var(--beat, 0) * 3px) rgba(255, 200, 110, .55); }
.site-foot > p { color: var(--cream); text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.site-foot > .foot-names { font-family: var(--f-caps); font-size: clamp(14px, 1.5vw, 19px); letter-spacing: .3em; text-indent: .3em; }
.site-foot > .foot-date { /* the date, large in engraved gold */
  margin: .12em 0 .18em; font-family: var(--f-caps); font-weight: 500; line-height: 1.1;
  font-size: clamp(48px, 6.4vw, 96px); letter-spacing: .08em; text-indent: .08em; color: var(--amber);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .85), 0 0 28px rgba(233, 194, 122, .25);
}
.site-foot > .foot-venue { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .2em .8em; font-size: clamp(14px, 1.5vw, 18px); letter-spacing: .14em; }
.foot-venue .km-display { font-size: 1.2em; letter-spacing: 0; line-height: 1.6; color: var(--amber); }
.site-foot > img { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
.hall.loading::after { content: "…"; position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 40px; letter-spacing: .2em; color: var(--amber); animation: glint 1.2s ease-in-out infinite; }

/* ═══════════ FILM — the picture house ═══════════
   Marquee → gilt proscenium with velvet curtains that part as you arrive →
   projector beam overhead, the screen's own colours glowing into the room, seat rows in front. */
.cine {
  overflow: hidden; isolation: isolate;
  padding: clamp(70px, 9vw, 120px) 16px 0;
  background:
    radial-gradient(60% 50% at 50% 46%, rgba(255, 200, 130, .08), transparent 70%),
    linear-gradient(#030c08, #06160f 40%, #030a06);
}
.cine > * { position: relative; z-index: 1; }

/* projector beam from the booth behind you, converging on the screen */
.cine-beam {
  position: absolute; z-index: 0; left: 50%; top: 0; translate: -50% 0;
  width: 190vw; height: calc(clamp(70px, 9vw, 120px) + 280px + min(1100px, 92vw) * 9 / 16);
  clip-path: polygon(0 0, 100% 0, calc(50% + min(550px, 46vw)) 100%, calc(50% - min(550px, 46vw)) 100%);
  background: linear-gradient(rgba(255, 238, 205, .11), rgba(255, 232, 190, .035) 70%, rgba(255, 232, 190, .06));
  mix-blend-mode: screen; pointer-events: none;
  opacity: .45; transition: opacity 1.4s ease;
}
.cine-beam i {
  position: absolute; inset: 0;
  background:
    radial-gradient(1.2px 1.2px at 12% 20%, #fff8e0, transparent), radial-gradient(1px 1px at 33% 64%, #fff8e0, transparent),
    radial-gradient(1.5px 1.5px at 51% 38%, #fff8e0, transparent), radial-gradient(1px 1px at 68% 12%, #fff8e0, transparent),
    radial-gradient(1.2px 1.2px at 84% 56%, #fff8e0, transparent), radial-gradient(1px 1px at 42% 88%, #fff8e0, transparent);
  background-size: 34% 30%; opacity: .55;
  animation: motes 14s linear infinite;
}
.cinema .cine-beam { opacity: 1; animation: projFlicker 2.6s steps(1) infinite; }

/* the proscenium */
.cine-stage { width: min(1100px, 92vw); }
.cine-glow { /* the film's own colours spill into the house */
  position: absolute; inset: -14% -10%; width: 120%; height: 128%; z-index: -1;
  filter: blur(60px) saturate(1.5); opacity: .5; transition: opacity 1.2s ease;
}
.cinema .cine-glow { opacity: .9; }
.cine-valance { --u: clamp(.62px, .075vw, .9px); left: -3%; right: -3%; top: calc(var(--u) * -62); z-index: 3; }
.cine-frame {
  padding: clamp(6px, 1vw, 12px); background: var(--gilt);
  box-shadow: 0 0 0 1px #3a2306, 0 40px 80px rgba(0, 0, 0, .7);
}
.cine-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px rgba(58, 35, 6, .8); }
.cine-screen video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cine-screen::after { /* vignette, like light thrown on a real screen */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(120% 90% at 50% 50%, transparent 62%, rgba(0, 0, 0, .45));
}
.cine-grain {
  position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: 0; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(4) infinite; transition: opacity .8s ease;
}
.cine.playing .cine-grain { opacity: .22; }
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

/* velvet curtains: closed until you arrive, part to the sides, close again between reels */
.cine-curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .42) 0, rgba(0, 0, 0, 0) 3.5%, rgba(255, 190, 180, .08) 5.5%, rgba(0, 0, 0, 0) 7.5%, rgba(0, 0, 0, .42) 11%),
    linear-gradient(rgba(0, 0, 0, .25), transparent 18%, transparent 80%, rgba(0, 0, 0, .45)),
    #3a0a12 url("assets/velvet.webp") center / cover;
  transition: transform 1.6s cubic-bezier(.65, 0, .25, 1);
}
.cc-l { left: 0; transform-origin: left center; }
.cc-r { right: 0; transform-origin: right center; }
.cc-l::after, .cc-r::after { /* gold fringe on the leading edge */
  content: ""; position: absolute; top: 0; bottom: 0; width: 5px;
  background: repeating-linear-gradient(#e6bf62 0 3px, #8f6213 3px 6px);
}
.cc-l::after { right: 0; } .cc-r::after { left: 0; }
.cine.open .cc-l { transform: translateX(-88%) scaleX(.9); }
.cine.open .cc-r { transform: translateX(88%) scaleX(.9); }
.cine.open.reel-change .cc-l, .cine.open.reel-change .cc-r { transform: none; transition-duration: .7s; }

/* gold film-reel play button */
.cine-play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 14px;
  border: 0; padding: 0; cursor: pointer; color: var(--cream);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .45), rgba(0, 0, 0, .15) 70%, transparent);
  transition: opacity .6s ease;
}
.cine-play .reel {
  position: relative; width: clamp(74px, 9vw, 108px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 12, 14, .55) 0 60%, rgba(20, 6, 8, .75) 61%);
  box-shadow: inset 0 0 0 1.5px var(--amber), 0 0 0 1px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
}
.cine-play .reel::before { /* sprocket holes running round the rim */
  content: ""; position: absolute; inset: 7%; border-radius: 50%;
  border: 3px dashed rgba(233, 194, 122, .75);
  animation: reelSpin 12s linear infinite;
}
.cine-play .reel::after { /* play triangle */
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; translate: -36% -50%;
  border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--amber-hi);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6));
}
@keyframes reelSpin { to { rotate: 360deg; } }
.cine-play:hover .reel { box-shadow: inset 0 0 0 2px var(--amber-hi), 0 0 24px rgba(255, 200, 110, .45), 0 10px 30px rgba(0, 0, 0, .55); }
.cine-play:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: -6px; }
.cine-play-label { font-family: var(--f-km); font-weight: 600; font-size: clamp(14px, 1.4vw, 17px); letter-spacing: .06em; text-shadow: 0 1px 8px #000; }
.cine.started .cine-play { opacity: 0; pointer-events: none; }

/* reel cards: each reel's still as its own little screen — Khmer left, Chinese right */
.tickets {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 28px);
  width: min(620px, 100%); margin: 0 0 clamp(40px, 7.5vw, 110px); /* room for the silk tied over the screen below */
}
.reel-card {
  position: relative; aspect-ratio: 16 / 9; padding: 0; cursor: pointer; overflow: visible;
  border: clamp(3px, .5vw, 6px) solid; border-image: var(--gilt) 1;
  background: #000 center / cover no-repeat;
  box-shadow: 0 0 0 1px #3a2306, 0 18px 36px rgba(0, 0, 0, .55);
  filter: saturate(.55) brightness(.62);
  transition: filter .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease;
}
.reel-khmer { background-image: url("media/trailer-khmer.webp"); --rc-fade: rgba(3, 20, 12, .92); }
.reel-chinese { background-image: url("media/trailer-chinese.webp"); --rc-fade: rgba(40, 4, 8, .9); }
.rc-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.reel-card::before { /* the reel's colour rising under the title */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(transparent 35%, var(--rc-fade));
}
.reel-card:hover { filter: saturate(.85) brightness(.85); transform: translateY(-3px); }
.reel-card[aria-selected="true"] {
  filter: none; transform: translateY(-4px);
  box-shadow: 0 0 0 1px #3a2306, 0 0 28px rgba(255, 200, 110, .28), 0 22px 44px rgba(0, 0, 0, .6);
}
.reel-card:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 5px; }
.rc-corner {
  position: absolute; z-index: 3; width: clamp(22px, 3.4vw, 40px); aspect-ratio: 1; pointer-events: none;
  background: var(--corner-khmer) center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7));
}
.reel-chinese .rc-corner { background-image: var(--corner-fret); }
.rc-corner.tl { left: -9px; top: -9px; }
.rc-corner.tr { right: -9px; top: -9px; transform: scaleX(-1); }
.rc-corner.bl { left: -9px; bottom: -9px; transform: scaleY(-1); }
.rc-corner.br { right: -9px; bottom: -9px; transform: scale(-1); }
.rc-text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; justify-items: center;
  padding: 0 8px clamp(8px, 1.4vw, 14px); color: var(--cream); text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.rc-text small { font-family: var(--f-caps); font-weight: 600; font-size: clamp(9px, 1vw, 11px); letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; color: var(--amber); }
.rc-text strong { font-family: var(--f-km-display); font-weight: 400; font-size: clamp(17px, 2.6vw, 26px); line-height: 1.45; color: var(--amber-hi); }
.rc-text strong:lang(zh) { font-family: "Ma Shan Zheng", var(--f-zh); letter-spacing: .08em; }
.rc-text em { font-family: var(--f-latin); font-size: clamp(12px, 1.3vw, 15px); opacity: .85; }
.rc-now { /* lit tag on the reel that is playing */
  position: absolute; z-index: 3; left: 50%; top: clamp(8px, 1.4vw, 14px); translate: -50% 0; white-space: nowrap;
  padding: 3px 10px; font-family: var(--f-caps); font-weight: 600; font-size: clamp(8px, .9vw, 10px); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase;
  color: #1f0f06; background: var(--amber); border-radius: 1px; opacity: 0; transition: opacity .4s ease;
}
.reel-card[aria-selected="true"] .rc-now { opacity: 1; }
.rc-seal {
  position: absolute; z-index: 3; right: clamp(10px, 1.8vw, 18px); top: clamp(10px, 1.8vw, 18px);
  display: grid; place-items: center; width: clamp(24px, 3vw, 34px); aspect-ratio: 1; rotate: -6deg;
  font-family: "Ma Shan Zheng", var(--f-zh); font-size: clamp(16px, 2vw, 23px); line-height: 1; color: #fbe9d0;
  background: #a3202c; border-radius: 3px; box-shadow: inset 0 0 0 1.5px rgba(251, 233, 208, .55);
}
@media (max-width: 480px) { .rc-now, .rc-text small { display: none; } }

/* the audience: rows of seat backs, rim-lit by the screen */
.seats { width: 100vw; height: clamp(90px, 12vw, 150px); margin-top: clamp(30px, 4vw, 50px); }
.seats i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 70%;
  background:
    radial-gradient(ellipse 46% 60% at 50% 100%, #010604 97%, transparent 100%) 0 100% / 92px 100% repeat-x;
  filter: drop-shadow(0 -1px 0 rgba(255, 210, 150, .22));
}
.seats i + i { height: 100%; bottom: -38%; background-size: 118px 100%; background-position: 46px 100%; filter: drop-shadow(0 -1px 0 rgba(255, 210, 150, .3)); }

@media (prefers-reduced-motion: reduce) {
  .cine-curtain { display: none; }
  .clock-edge { display: none; }
}

/* ═══ two reels, one picture house ═══
   data-reel="khmer": gold Khmer flame-scroll corners, gold dust in the beam.
   data-reel="chinese": lattice-fret corners, calligraphy title, a 囍 seal, paper lanterns. */
.cine {
  --corner-khmer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%23e6bf62' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M3 57V16Q3 3 16 3h41'/%3E%3Cpath d='M9 46C9 25 25 9 46 9c-11 6-15 12-13 21-9-2-16 3-24 16z' fill='%23e6bf62' fill-opacity='.85' stroke='none'/%3E%3Cpath d='M14 34c2-10 9-17 19-19'/%3E%3Ccircle cx='21' cy='21' r='3.2'/%3E%3Cpath d='M46 9c5 1 8 4 9 9M9 46c1 5 4 8 9 9'/%3E%3C/svg%3E");
  --corner-fret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%23e6bf62' stroke-width='2.2' stroke-linecap='square'%3E%3Cpath d='M3 57V3h54'/%3E%3Cpath d='M10 57V10h47'/%3E%3Cpath d='M17 50V17h33v14H31v-7h-7v19h12'/%3E%3C/svg%3E");
}
.cine-frame { position: relative; }
.cine-corner {
  position: absolute; z-index: 4; width: clamp(34px, 5vw, 64px); aspect-ratio: 1; pointer-events: none;
  background: var(--corner-khmer) center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
  transition: opacity .5s ease;
}
.cine[data-reel="chinese"] .cine-corner { background-image: var(--corner-fret); }
.cine-corner.tl { left: -12px; top: -12px; }
.cine-corner.tr { right: -12px; top: -12px; transform: scaleX(-1); }
.cine-corner.bl { left: -12px; bottom: -12px; transform: scaleY(-1); }
.cine-corner.br { right: -12px; bottom: -12px; transform: scale(-1); }

/* paper lanterns either side of the screen */
.lantern {
  position: absolute; z-index: 5; top: 6%; width: clamp(30px, 4vw, 56px); aspect-ratio: .82; border-radius: 46% / 50%;
  background:
    repeating-linear-gradient(90deg, rgba(60, 0, 6, .35) 0 2px, transparent 2px 22%),
    radial-gradient(circle at 50% 45%, #ffb36b, #e2402f 45%, #8c1520 85%);
  box-shadow: 0 0 26px 6px rgba(255, 110, 60, .35);
  transform-origin: 50% -60%; opacity: 0; translate: 0 -30px;
  transition: opacity .7s ease, translate .9s cubic-bezier(.3, 1.4, .5, 1);
  animation: lanternSway 4.5s ease-in-out infinite;
}
.lantern::before { /* gold cap + cord */
  content: ""; position: absolute; left: 30%; right: 30%; top: -8%; height: 12%; background: var(--gilt); border-radius: 2px;
  box-shadow: 0 -40px 0 -1px transparent;
}
.lantern::after { /* tassel */
  content: ""; position: absolute; left: 44%; right: 44%; top: 98%; height: 42%;
  background: linear-gradient(#e6bf62, #a3202c 30%, #a3202c); border-radius: 0 0 2px 2px;
}
.lantern-l { left: -6%; }
.lantern-r { right: -6%; animation-delay: -2.2s; }
.cine[data-reel="chinese"] .lantern { opacity: 1; translate: 0 0; transition-delay: .6s; }
@keyframes lanternSway { 50% { rotate: 4deg; } 0%, 100% { rotate: -4deg; } }
@media (max-width: 640px) { .lantern-l { left: -2%; } .lantern-r { right: -2%; } .lantern { top: -2%; } }


