/* ==========================================================================
   wedding.dottut.com  |  Fantasy royal palace at dusk  |  2.5D scroll journey
   Steps 1-2: foundation, sealed invitation, seal break, names and date reveal.
   Later scene interiors are placeholders until their build step.
   ========================================================================== */

:root {
  --night: #0b1224;
  --dusk: #17233f;
  --amber: #e0a458;
  --gold: #c9a24a;
  --gold-soft: #e8cf8f;
  --cream: #f4e9d3;
  --ivory: #fbf6ea;
  --marble: #e9e4da;
  --ink: #2a2117;
  --bronze: #8a6a2a;
  --wax: #7a1f2b;
  --display: "Cormorant Garamond", Constantia, "Book Antiqua", Georgia, serif;
  --body: Manrope, "Segoe UI", system-ui, sans-serif;
  --hairline: 1px solid rgba(201, 162, 74, 0.35);
}

* { box-sizing: border-box; }
html { background: var(--night); color: var(--cream); font-family: var(--body); -webkit-text-size-adjust: 100%; scrollbar-width: none; overscroll-behavior-y: none; }
html::-webkit-scrollbar { display: none; } /* the journey line is the progress indicator */
/* The track only gives the page its scrollable length; the stage is fixed and app.js drives it.
   Resting points are handled in app.js (a gentle glide after the guest pauses), not by scroll snapping. */
.track { position: relative; overflow: clip; }
body { margin: 0; min-height: 100vh; line-height: 1.5; }
html.locked, html.locked body { overflow: hidden; height: 100%; }
html.has-dialog { overflow: hidden; }
button { font: inherit; color: inherit; }
.muted { opacity: 0.7; }
.eyebrow { margin: 0 0 0.8rem; font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }

/* ---------- loading veil ---------- */
.veil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--night); transition: opacity 1.2s ease; }
.veil p { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(1.2rem, 3vw, 1.6rem); color: var(--gold-soft); letter-spacing: 0.02em; }
.veil--hidden { opacity: 0; pointer-events: none; }
.dots i { display: inline-block; width: 3px; height: 3px; margin-left: 4px; border-radius: 50%; background: var(--gold-soft); animation: dot 1.6s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.25s; }
.dots i:nth-child(3) { animation-delay: 0.5s; }
@keyframes dot { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ---------- stage, scenes, depth layers ---------- */
.stage { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
/* Cinematic finish over every scene: a gentle colour grade (cool sky, warm ground) and fine film grain. */
.stage::before { content: ""; position: absolute; inset: 0; z-index: 200; pointer-events: none; mix-blend-mode: soft-light; background: linear-gradient(180deg, rgba(12, 22, 64, 0.35) 0%, rgba(12, 22, 64, 0) 42%, rgba(255, 170, 90, 0.22) 100%); }
.stage::after { content: ""; position: absolute; inset: 0; z-index: 201; pointer-events: none; opacity: 0.075; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 180px 180px; }
/* Shallow depth of field on larger screens: the far horizon and the near foreground soften slightly. */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .scene--world .layer[style*="--depth:.1"] { filter: blur(0.7px); }
  .scene--world .layer[style*="--depth:1"] { filter: blur(1.3px); }
}
.scene { position: absolute; inset: 0; overflow: hidden; visibility: hidden; contain: layout paint; }
.scene[data-state="active"], .scene[data-state="next"] { visibility: visible; }

/* The camera. app.js writes each layer's transform every frame from the scene's local progress:
   translate3d(0, lp * depth * -3%, 0) scale(1 + lp * depth * zoom). Deeper layers (higher --depth)
   drift and scale more, which reads as the camera gliding forward. Writing the transform directly
   keeps the per-frame style work to a few elements instead of restyling the whole scene. */
.layer {
  --depth: 0.5;
  position: absolute; inset: -8%;
  pointer-events: none; /* artwork never takes taps; interactive pieces opt back in below */
  transform-origin: 50% 60%;
}
/* Only the two scenes that can be seen keep compositor layers; hidden scenes also pause their ambient life. */
.scene[data-state="active"] .layer, .scene[data-state="next"] .layer { will-change: transform; }
/* Ambient life that lives inside the big SVGs (lamp flicker, water, chandeliers) sits in its own small
   svg.fx per layer with its own compositor layer, so those animations never re-rasterise the artwork. */
.scene[data-state="active"] .fx, .scene[data-state="next"] .fx { will-change: transform; }
.scene:not([data-state="active"], [data-state="next"]) :is(.fireflies i, .petals svg, .ripples, .jet, .chandelier, .marker-body, .marker-ring, .lantern-sway, .lantern-flame, .lantern-cue span, .hint span, .stars i, .lamp, .mist) { animation-play-state: paused; }
.farewell { z-index: 4; }
.layer--fit { inset: 0; } /* for layers whose edges must stay on screen, such as the paper frame */
.map-marker, .sky-lantern { pointer-events: auto; }
.scene-copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 8vw; text-align: center; pointer-events: none; /* app.js lifts it by lp * -6vh */
}
.scene-copy h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1.05; color: var(--ivory); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45); }
.note { max-width: 36ch; margin: 1rem 0 0; font-size: 0.95rem; color: rgba(244, 233, 211, 0.72); }
.tag { margin: 1.6rem 0 0; padding: 0.35rem 0.9rem; border: var(--hairline); border-radius: 999px; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(232, 207, 143, 0.6); }

/* Dusk-to-night palette per chapter, so the skeleton already shows the colour journey. */
.scene[data-chapter="palace"]   { background: linear-gradient(180deg, #0e1730 0%, #2a3b66 45%, #8a5a3a 78%, #3a2a24 100%); }
.scene[data-chapter="ceremony"] { background: linear-gradient(180deg, #2a1a12 0%, #6b3f22 55%, #3a2416 100%); }
.scene[data-chapter="venue"]    { background: linear-gradient(180deg, #0b1224 0%, #1f2f5a 50%, #0d1a33 100%); }
.scene[data-chapter="wedding"]  { background: linear-gradient(180deg, #070c1a 0%, #141f3e 55%, #3a2a24 100%); }

/* Placeholder shapes: a far glow, a mid silhouette, a near foreground with two lanterns. */
.ph { position: absolute; }
.ph--far { left: 50%; top: 14%; width: 44vmin; height: 44vmin; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(232, 207, 143, 0.38), rgba(232, 207, 143, 0) 68%); }
.ph--mid { left: 50%; bottom: 26%; width: 130vmin; height: 44vmin; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: rgba(11, 18, 36, 0.5); }
.ph--near { left: -12%; right: -12%; bottom: -10%; height: 32%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: rgba(4, 7, 16, 0.85); }
.ph--near::before, .ph--near::after { content: ""; position: absolute; top: 18%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-soft); box-shadow: 0 0 22px 8px rgba(224, 164, 88, 0.45); }
.ph--near::before { left: 22%; }
.ph--near::after { right: 22%; }

/* ==========================================================================
   Pre-scene: the sealed invitation on the marble table.
   data-state (set by app.js): dark → lit → ready → breaking → opening → rising → entering → opened
   ========================================================================== */
.scene--invitation { z-index: 100; visibility: visible; background: radial-gradient(70% 55% at 50% 30%, #1b1a27 0%, #0b0d15 60%, #06070c 100%); perspective: 1200px; transition: opacity 1s ease, visibility 1s; }
.scene--invitation[data-state="opened"] { opacity: 0; visibility: hidden; }
.scene--invitation[data-state="opened"] :is(.dust i, .diya .flame, .cue span, .room) { animation: none; }
.scene--invitation[data-state="opened"] .room-glow::after { animation: none; }

/* The room is the camera rig: a slow push toward the table once the candle is lit.
   It is a flat painting context (children paint in document order) that supplies perspective
   to the envelope, which keeps its own 3D space for the flap. */
.room { position: absolute; inset: 0; transform-origin: 50% 62%; perspective: 1200px; }
.scene--invitation:not([data-state="dark"]) .room { animation: push 7s ease-out forwards; }
@keyframes push { from { transform: scale(1); } to { transform: scale(1.09) translateY(1%); } }

.table, .diya, .window, .drape, .valance, .petal, .env-shadow, .envelope, .room-glow { opacity: 0; transition: opacity 1.8s ease 0.4s; }
.scene--invitation:not([data-state="dark"]) :is(.table, .diya, .window, .drape, .valance, .petal, .env-shadow, .envelope, .room-glow) { opacity: 1; }

.room-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 66% 60%, rgba(224, 164, 88, 0.5), rgba(224, 164, 88, 0.12) 40%, transparent 72%); }
.room-glow::after { content: ""; position: absolute; inset: 0; background: radial-gradient(45% 40% at 66% 58%, rgba(255, 214, 150, 0.32), transparent 70%); animation: flicker 5s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: 0.7; } 35% { opacity: 1; } 70% { opacity: 0.82; } }

.dust { position: absolute; inset: 0; pointer-events: none; }
.dust i { position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: rgba(232, 207, 143, 0.75); box-shadow: 0 0 6px 1px rgba(232, 207, 143, 0.35); opacity: 0; animation: drift var(--t) ease-in-out var(--d) infinite alternate; }
@keyframes drift { 0% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 0.8; } 70% { opacity: 0.5; } 100% { transform: translate(16px, -46px); opacity: 0; } }

.table { position: absolute; left: 0; right: 0; top: 46%; bottom: -1%; clip-path: polygon(6% 0, 94% 0, 106% 100%, -6% 100%); }
.table .marble { display: block; width: 100%; height: 100%; filter: brightness(0.78) saturate(0.85); }
.table::before { content: ""; position: absolute; left: 6%; right: 6%; top: 0; height: 1px; background: rgba(255, 255, 255, 0.14); }
.table::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 7, 13, 0.92) 0%, rgba(5, 7, 13, 0.55) 26%, rgba(5, 7, 13, 0.22) 55%, rgba(5, 7, 13, 0.4) 100%), linear-gradient(90deg, rgba(5, 7, 13, 0.75), transparent 24%, transparent 76%, rgba(5, 7, 13, 0.75)); }

/* Palace room behind the table: drapes, valance, an arched lattice window onto the dusk sky. */
.room { --env-w: min(70vw, 47vh, 520px); }
.window { position: absolute; left: 50%; bottom: 53%; height: 40vh; aspect-ratio: 3 / 4; transform: translateX(-50%); box-shadow: 0 0 90px 24px rgba(70, 90, 150, 0.22); }
.window svg { display: block; width: 100%; height: 100%; }
.drape { position: absolute; top: 0; width: 18vw; height: 52%; background: linear-gradient(90deg, #2c1118 0%, #180a0e 70%, #120709 100%); }
.drape--l { left: 0; border-bottom-right-radius: 45% 100%; box-shadow: inset -2px 0 0 rgba(201, 162, 74, 0.3); }
.drape--r { right: 0; border-bottom-left-radius: 45% 100%; background: linear-gradient(270deg, #2c1118 0%, #180a0e 70%, #120709 100%); box-shadow: inset 2px 0 0 rgba(201, 162, 74, 0.3); }
.valance { position: absolute; left: 0; right: 0; top: 0; height: 5.5vh; background: linear-gradient(180deg, #2a1218, #1a0b0f); border-bottom: 1px solid rgba(201, 162, 74, 0.5); }

/* Two brass oil lamps on the far edge of the table, one each side of the envelope, flames turned inward. */
.diya { position: absolute; top: 44%; width: 10vmin; height: auto; }
.diya--l { left: max(3vw, calc(50% - var(--env-w) / 2 - 12vmin)); }
.diya--r { left: min(calc(97vw - 10vmin), calc(50% + var(--env-w) / 2 + 2vmin)); transform: scaleX(-1); }
.diya .flame { transform-origin: 118px 68px; animation: flame 1.7s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scale(1, 1) translateX(0); } 50% { transform: scale(0.94, 1.06) translateX(0.6px); } to { transform: scale(1.04, 0.96) translateX(-0.6px); } }

.petal { position: absolute; width: 3.2vmin; height: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.p1 { left: 22%; top: 77%; transform: rotate(-24deg); }
.p2 { left: 71%; top: 79%; transform: rotate(38deg); }
.p3 { left: 33%; top: 80.5%; transform: rotate(72deg) scale(0.85); }
.p4 { left: 63%; top: 74.5%; transform: rotate(-58deg) scale(0.9); }

.env-shadow { position: absolute; left: 50%; top: 67%; width: calc(var(--env-w) * 1.08); height: 9vh; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent); filter: blur(8px); }

/* The envelope lies on the table, tilted toward the viewer. --tx/--ty are the pointer lean. */
.envelope {
  --tx: 0deg; --ty: 0deg;
  position: absolute; left: 50%; top: 62%;
  width: var(--env-w); aspect-ratio: 520 / 335;
  transform: translate(-50%, -50%) rotateX(calc(25deg + var(--ty))) rotateY(var(--tx));
  transform-style: preserve-3d;
  transition: opacity 1.8s ease 0.4s, transform 0.6s ease-out;
}
.env-back, .env-front { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.env-back { transform: translateZ(0); }
.env-front { transform: translateZ(2px); }
.env-light { position: absolute; left: 50%; top: 32%; width: 80%; height: 64%; transform: translate(-50%, -50%) translateZ(0.5px); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 224, 170, 0.95), rgba(224, 164, 88, 0.55) 55%, transparent 100%); opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
.letter { position: absolute; left: 6%; top: 7%; width: 88%; height: 84%; transform: translateZ(1px); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12); transition: transform 1s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.8s ease; }
.letter-art { display: block; width: 100%; height: 100%; }
.env-flap { position: absolute; left: 0; top: 0; width: 100%; height: 62%; transform-origin: 50% 0; transform: translateZ(3px) rotateX(0deg); transition: transform 0.95s cubic-bezier(0.55, 0.05, 0.3, 1); }
.env-flap svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }

.seal { position: absolute; left: 50%; top: 58%; width: 19%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; transform: translate(-50%, -50%) translateZ(4px); transition: transform 0.5s ease, opacity 0.45s ease; }
.seal svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); transition: transform 0.4s ease; }
.seal:hover svg, .seal:focus-visible svg { transform: scale(1.05); }
.seal:focus-visible { outline: none; }
.seal:focus-visible svg { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 6px rgba(232, 207, 143, 0.8)); }
.seal .cracks path { stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset 0.35s ease-in; }

.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 70% at 50% 60%, transparent 40%, rgba(5, 7, 13, 0.85) 100%); }

.cue { position: absolute; left: 50%; top: 84%; margin: 0; transform: translateX(-50%); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 0, 0, 0.5); white-space: nowrap; opacity: 0; transition: opacity 1.2s ease; }
.cue span { display: inline-block; animation: breathe 3s ease-in-out infinite; }
.scene--invitation[data-state="ready"] .cue { opacity: 1; }

/* breaking: cracks run through the wax, the seal swells */
.scene--invitation[data-state="breaking"] .seal { transform: translate(-50%, -50%) translateZ(4px) scale(1.1); }
.scene--invitation:not([data-state="dark"], [data-state="lit"], [data-state="ready"]) .seal .cracks path { stroke-dashoffset: 0; }

/* opening onward: the seal falls away, the flap swings back */
.scene--invitation:is([data-state="opening"], [data-state="rising"], [data-state="entering"], [data-state="opened"]) .seal { opacity: 0; transform: translate(-50%, 20%) translateZ(4px) rotate(18deg) scale(0.9); pointer-events: none; }
.scene--invitation:is([data-state="opening"], [data-state="rising"], [data-state="entering"], [data-state="opened"]) .env-flap { transform: translateZ(-2px) rotateX(-168deg); } /* hinge ends behind the letter so it cannot draw across it */

/* rising onward: warm light spills out, the letter lifts from the pocket */
.scene--invitation:is([data-state="rising"], [data-state="entering"], [data-state="opened"]) .env-light { opacity: 1; }
.scene--invitation:is([data-state="rising"], [data-state="entering"], [data-state="opened"]) .letter { transform: translateZ(1px) translateY(-66%); }

/* entering: the letter comes to the camera and its paper fills the view */
.scene--invitation:is([data-state="entering"], [data-state="opened"]) .letter { transform: translateZ(80px) translateY(-78%) scale(1.3); opacity: 0; transition: transform 1.3s cubic-bezier(0.4, 0, 0.6, 1), opacity 1s ease 0.3s; }
.paper-wipe { position: absolute; inset: 0; z-index: 5; clip-path: circle(0% at 50% 60%); transition: clip-path 1.4s cubic-bezier(0.5, 0, 0.35, 1); pointer-events: none; }
.paper-wipe::after { content: ""; position: absolute; inset: 0; background: radial-gradient(55% 45% at 50% 60%, rgba(224, 164, 88, 0.6), transparent 70%); transition: opacity 1s ease 1.1s; }
.scene--invitation:is([data-state="entering"], [data-state="opened"]) .paper-wipe { clip-path: circle(125% at 50% 60%); }
.scene--invitation[data-state="opened"] .paper-wipe::after { opacity: 0; }

/* ==========================================================================
   Scene: the opened invitation paper. Welcome line, names, date.
   ========================================================================== */
.paper-bg { background: radial-gradient(120% 90% at 50% 40%, #fbf6ea 0%, #f4ead6 55%, #e6d6b6 100%); }
.scene--reveal .frame { position: absolute; inset: clamp(14px, 4vw, 42px); border: 1px solid rgba(138, 106, 42, 0.6); outline: 1px solid rgba(138, 106, 42, 0.28); outline-offset: 5px; }
.corner { position: absolute; width: clamp(40px, 9vw, 84px); height: auto; }
.c-tl { left: -1px; top: -1px; }
.c-tr { right: -1px; top: -1px; transform: rotate(90deg); }
.c-br { right: -1px; bottom: -1px; transform: rotate(180deg); }
.c-bl { left: -1px; bottom: -1px; transform: rotate(-90deg); }
.motif { width: clamp(90px, 18vw, 160px); height: auto; margin: 0 0 0.6rem; }
.welcome { max-width: 32ch; margin: 0 0 1.4rem; font-family: var(--display); font-style: italic; font-size: clamp(1.15rem, 3vw, 1.6rem); color: var(--bronze); }
.names { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 8vw, 5.2rem); line-height: 1.05; color: var(--ink); }
.names .amp { margin: 0 0.1em; font-style: italic; font-size: 0.75em; color: #b08a3a; }
/* Narrow screens: the ampersand takes its own centred line between the two names. */
@media (max-width: 720px) {
  .names .amp { display: block; margin: 0.08em auto; font-size: 0.7em; line-height: 1; }
}
.rule { width: 72px; height: 1px; margin: 1.5rem auto; background: linear-gradient(90deg, transparent, var(--bronze), transparent); }
.date { margin: 0; font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink); }
.hint { margin: 3.5rem 0 0; font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: rgba(138, 106, 42, 0.85); }
.hint span { display: inline-block; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* The reveal sequence: items appear in order (--d delay) once the invitation has opened. */
.scene--reveal .seq { opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease var(--d, 0s), transform 1.2s ease var(--d, 0s); }
.scene--reveal .frame.seq { transform: none; }
.scene--reveal.is-revealing .seq { opacity: 1; transform: none; }

/* The paper opens into the world: over the second half of the reveal a soft hole grows from the
   centre of the paper, showing the palace gates beneath (the engine skips its fade for this scene). */
.scene--reveal {
  --hole: clamp(0, calc((var(--lp, 0) - 0.5) / 0.5 * 140), 140);
  -webkit-mask-image: radial-gradient(circle at 50% 55%, transparent calc(var(--hole) * 1% - 12%), #000 calc(var(--hole) * 1%));
  mask-image: radial-gradient(circle at 50% 55%, transparent calc(var(--hole) * 1% - 12%), #000 calc(var(--hole) * 1%));
}

/* ==========================================================================
   World scenes. Each depth layer holds a square art box (side = the longer viewport edge, plus
   the layer bleed) so a 1200 x 1200 viewBox maps 1:1 to percentages and the centre survives both
   portrait and landscape framing. --zoom sets how far the camera travels through the scene.
   ========================================================================== */
/* A 3:2 canvas (viewBox -300 0 1800 1200) sized to cover the layer: on a desktop nearly the whole
   scene is in view; on a phone the centre 514 units, the same framing the scenes were designed for.
   Percent positions of HTML pieces are (300 + x) / 1800 across and y / 1200 down. */
.art-box { position: absolute; left: 50%; top: 50%; width: max(108vw, 162vh); height: calc(max(108vw, 162vh) * 2 / 3); transform: translate(-50%, -50%); }
.art-box > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene--world::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 52%, rgba(4, 6, 14, 0.42) 100%); }
/* Stars are HTML dots over the sky (positions in art-box %, --s is the diameter as a % of its width), so
   each twinkle is a composited opacity animation rather than a re-rasterisation of the whole sky. */
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; left: var(--x); top: var(--y); width: var(--s, 0.16%); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; opacity: var(--a, 0.6); animation: twinkle 4.5s ease-in-out infinite; }
.stars i:nth-child(2n) { animation-delay: -1.5s; }
.stars i:nth-child(3n) { animation-delay: -3s; animation-duration: 5.5s; }
@keyframes twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.lamp { animation: lampflicker 3.8s ease-in-out infinite alternate; }
.lamp:nth-of-type(2n) { animation-delay: -1.7s; animation-duration: 4.6s; }
@keyframes lampflicker { from { opacity: 0.86; } to { opacity: 1; } }
.mist { position: absolute; left: -20%; right: -20%; bottom: 10%; height: 22%; background: radial-gradient(ellipse at 50% 50%, rgba(200, 212, 240, 0.13), transparent 70%); filter: blur(14px); animation: mist 28s ease-in-out infinite alternate; pointer-events: none; }
.mist--pool { bottom: 14%; height: 18%; background: radial-gradient(ellipse at 50% 50%, rgba(180, 200, 240, 0.12), transparent 70%); }
@keyframes mist { from { transform: translateX(-3%) scaleX(1); } to { transform: translateX(3%) scaleX(1.06); } }
.scene--gates { --zoom: 0.55; }
.scene--courtyard { --zoom: 0.26; }
.scene--garden { --zoom: 0.4; }
.scene--clock { --zoom: 0.18; }

/* Doors swing away from the camera as --open runs 0..1, derived from --lp, which app.js writes on the
   door containers themselves ([data-lp]) so the artwork around them is never restyled. */
.scene--gates .gate-doors { --open: clamp(0, calc((var(--lp, 0) - 0.12) / 0.5), 1); }
.scene--doors :is(.doors, .door-light) { --open: clamp(0, calc((var(--lp, 0) - 0.08) / 0.5), 1); }
.scene--doors { --zoom: 0.5; }
.scene--hall { --zoom: 0.2; }
.gate-doors, .doors { position: absolute; perspective: 900px; }
.gate-doors { left: 43.8889%; top: 45%; width: 12.2222%; height: 25%; }
.doors--entry { left: 43.8889%; top: 33.333%; width: 12.2222%; height: 38.333%; }
.door-light { position: absolute; left: 50%; top: 50%; width: 30.667%; height: 60%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 210, 140, 0.75), rgba(255, 190, 110, 0.25) 55%, transparent); opacity: var(--open, 0); pointer-events: none; }
.chandelier { animation: flicker 5s ease-in-out infinite; }

/* Reflection pool and venue in one continuous shot: the marker and name surface in its second half. */
.scene--pool { --zoom: 0.45; }
.ripples { animation: ripple 7s ease-in-out infinite alternate; }
@keyframes ripple { from { transform: translateX(-8px); opacity: 0.7; } to { transform: translateX(8px); opacity: 1; } }
.map-marker { --o: clamp(0, calc((var(--lp, 0) - 0.45) / 0.15), 1); position: absolute; left: 50%; top: 49%; width: 5%; transform: translate(-50%, -60%); opacity: var(--o); display: block; text-decoration: none; }
.marker-body { display: block; animation: bob 3.6s ease-in-out infinite; }
.marker-body > svg { display: block; width: 100%; height: auto; transition: transform 0.3s ease, filter 0.3s ease; }
.map-marker:hover .marker-body > svg, .map-marker:focus-visible .marker-body > svg { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(243, 220, 149, 0.85)); }
.map-marker:focus-visible { outline: none; }
.marker-ring { position: absolute; left: 50%; top: 39%; width: 70%; aspect-ratio: 1; margin: -35% 0 0 -35%; border: 2px solid rgba(243, 220, 149, 0.8); border-radius: 50%; animation: ring 2.8s ease-out infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(0.7); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
.marker-reflection { position: absolute; left: 0; top: 100%; width: 100%; height: auto; transform: scaleY(-1); opacity: 0.3; filter: blur(1.5px); -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%); pointer-events: none; }
.venue-text { --o: clamp(0, calc((var(--lp, 0) - 0.55) / 0.15), 1); position: absolute; left: 50%; top: 64%; width: min(41.333%, 72vw); transform: translate(-50%, calc((1 - var(--o)) * 18px)); opacity: var(--o); text-align: center; pointer-events: none; }
.venue-text::before { content: ""; position: absolute; left: 50%; top: 50%; width: 120%; height: 160%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(8, 16, 36, 0.6), rgba(8, 16, 36, 0) 70%); z-index: -1; }
/* Mandap with the final lantern in one shot. The lantern waits on the carpet from a third of the way in.
   Tapping it adds .is-lit to the scene: the flame and glow come up, the lantern rises and drifts, the
   night deepens behind it, more stars appear, and the final message surfaces over the darkened mandap. */
.scene--mandap { --zoom: 0.22; }
.scene--mandap .layer { z-index: 0; }
.night-veil { position: absolute; inset: 0; z-index: 1; background: rgba(3, 6, 16, 0.62); opacity: 0; transition: opacity 6s ease; pointer-events: none; }
.scene--mandap.is-lit .night-veil { opacity: 1; }
.scene--mandap .layer--front { z-index: 2; }
.stars-late { opacity: 0; transition: opacity 5s ease 1.5s; }
.scene--mandap.is-lit .stars-late { opacity: 1; }
.lantern-shadow, .sky-lantern, .lantern-cue { --o: clamp(0, calc((var(--lp, 0) - 0.3) / 0.15), 1); }
.lantern-shadow { position: absolute; left: 50%; top: 83.4%; width: 6%; height: 1.3%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent); opacity: var(--o); transition: opacity 2s ease; }
.scene--mandap.is-lit .lantern-shadow { opacity: 0; }
.sky-lantern { position: absolute; left: 50%; top: 71%; width: 5.333%; padding: 0; border: 0; background: none; cursor: pointer; transform: translate(-50%, 0); opacity: var(--o); }
.scene--mandap.is-lit .sky-lantern { opacity: 1; }
.sky-lantern:focus-visible { outline: none; }
.sky-lantern:focus-visible svg { filter: drop-shadow(0 0 10px rgba(243, 220, 149, 0.9)); }
.lantern-sway { display: block; transform-origin: 50% 0; animation: sway 4s ease-in-out infinite; }
.sky-lantern svg { display: block; width: 100%; height: auto; }
.lantern-glow, .lantern-flame { opacity: 0; transition: opacity 1.2s ease; }
.scene--mandap.is-lit .lantern-glow, .scene--mandap.is-lit .lantern-flame { opacity: 1; }
.lantern-flame { transform-origin: 60px 171px; transform-box: view-box; animation: flame 1.7s ease-in-out infinite alternate; }
.scene--mandap.is-lit .sky-lantern { animation: rise 9s cubic-bezier(0.4, 0, 0.6, 1) 0.8s forwards; cursor: default; }
@keyframes rise { 0% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-10%, -58vh) scale(0.4); opacity: 0.75; } }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.lantern-cue { position: absolute; left: 50%; top: 84.8%; margin: 0; transform: translateX(-50%); font-size: clamp(0.55rem, 0.9vmax, 0.78rem); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(232, 207, 143, 0.75); white-space: nowrap; pointer-events: none; opacity: var(--o); transition: opacity 0.5s; }
.lantern-cue span { display: inline-block; animation: breathe 3s ease-in-out infinite; }
.scene--mandap.is-lit .lantern-cue { opacity: 0; }
.final-message { position: absolute; left: 50%; top: 46%; width: min(42.667%, 88vw); transform: translate(-50%, 16px); opacity: 0; transition: opacity 1.6s ease 5s, transform 1.6s ease 5s; text-align: center; pointer-events: none; }
.scene--mandap.is-lit .final-message { opacity: 1; transform: translate(-50%, 0); }
.final-message::before { content: ""; position: absolute; left: 50%; top: 50%; width: 120%; height: 170%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(5, 8, 20, 0.65), rgba(5, 8, 20, 0) 70%); z-index: -1; }
.final-eyebrow { margin: 0 0 0.5em; font-size: clamp(0.55rem, 0.95vmax, 0.8rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); }
.final-text { margin: 0 auto; max-width: 30ch; font-family: var(--display); font-style: italic; font-size: clamp(1.1rem, 2.6vmax, 2.4rem); line-height: 1.25; color: var(--ivory); text-shadow: 0 0 22px rgba(244, 187, 106, 0.35), 0 2px 10px rgba(0, 0, 0, 0.6); }
.final-names { margin: 0.7em 0 0; font-family: var(--display); font-size: clamp(1rem, 2vmax, 1.8rem); color: var(--gold-soft); }
.final-names .amp { font-style: italic; color: var(--gold); }

/* Farewell: the actions live on one translucent royal card that surfaces as the guest arrives. */
.scene--farewell { --zoom: 0.1; }
.farewell { --o: clamp(0, calc((var(--lp, 0) - 0.05) / 0.2), 1); position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; padding: 0 5vw; opacity: var(--o); transform: translateY(calc((1 - var(--o)) * 20px)); }
.farewell-card { pointer-events: auto; width: min(92vw, 560px); padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.1rem, 4vw, 2.2rem); text-align: center; color: var(--cream); background: rgba(8, 12, 28, 0.58); border: 1px solid rgba(201, 162, 74, 0.45); border-radius: 4px; box-shadow: inset 0 0 0 6px rgba(8, 12, 28, 0.35), inset 0 0 0 7px rgba(201, 162, 74, 0.28), 0 30px 60px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.farewell-mono { width: 54px; height: 54px; margin: 0 auto 0.9rem; display: grid; place-items: center; border: 1px solid rgba(201, 162, 74, 0.6); border-radius: 50%; font-family: var(--display); font-size: 1.15rem; color: var(--gold-soft); }
.farewell-names { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.1; color: var(--ivory); }
.farewell-names .amp { font-style: italic; font-size: 0.8em; color: var(--gold); }
.farewell-date { margin: 0.7rem 0 0; font-size: clamp(0.62rem, 1.6vw, 0.8rem); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); }
.farewell-date .nowrap { white-space: nowrap; }
.farewell-date .dot { margin: 0 0.2em; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 1.5rem 0 0; }
.actions--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .actions--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Short landscape phones: keep the whole card on screen. */
@media (max-height: 520px) {
  .farewell-card { padding: 0.9rem 1rem; }
  .farewell-mono { width: 38px; height: 38px; margin-bottom: 0.4rem; font-size: 0.85rem; }
  .farewell-names { font-size: 1.4rem; }
  .farewell-date { margin-top: 0.4rem; font-size: 0.6rem; }
  .actions { margin-top: 0.7rem; gap: 0.4rem; }
  .act { padding: 0.45rem 0.3rem; gap: 0.25rem; font-size: 0.56rem; }
  .act svg { width: 16px; height: 16px; }
  .farewell-line { margin-top: 0.6rem; font-size: 0.9rem; }
  .farewell-url { display: none; }
}
.act { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.85rem 0.4rem; border: 1px solid rgba(201, 162, 74, 0.45); border-radius: 6px; background: rgba(201, 162, 74, 0.06); color: var(--cream); text-decoration: none; font: inherit; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; transition: background 0.3s, border-color 0.3s, transform 0.3s; }
.act:hover, .act:focus-visible { background: rgba(201, 162, 74, 0.16); border-color: var(--gold); outline: none; transform: translateY(-2px); }
.act svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-soft); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.farewell-line { margin: 1.4rem 0 0; font-family: var(--display); font-style: italic; font-size: clamp(1rem, 2.4vw, 1.2rem); color: rgba(244, 233, 211, 0.85); }
.farewell-url { margin: 0.5rem 0 0; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(232, 207, 143, 0.6); }
.contacts--actions li { flex-direction: column; gap: 0.3rem; padding: 0.8rem 0; border-top: 1px solid rgba(138, 106, 42, 0.25); }
.contacts--actions li:first-child { border-top: 0; }
.contact-name { font-family: var(--display); font-size: 1.2rem; }
.contact-actions { display: flex; gap: 0.5rem; margin-top: 0.3rem; }

/* Gentle indicators when a tap is needed and nothing has happened for ten seconds (.needs-hint). */
.seal::after { content: ""; position: absolute; inset: -22%; border-radius: 50%; border: 2px solid rgba(243, 220, 149, 0.9); opacity: 0; pointer-events: none; }
.sky-lantern::after { content: ""; position: absolute; left: 50%; top: 42%; width: 150%; aspect-ratio: 1; margin: -75% 0 0 -75%; border-radius: 50%; border: 2px solid rgba(243, 220, 149, 0.9); opacity: 0; pointer-events: none; }
.needs-hint .seal::after, .needs-hint .sky-lantern::after { animation: ring 1.8s ease-out infinite; }
.needs-hint .cue, .needs-hint .lantern-cue { color: var(--gold-soft); font-size: clamp(0.72rem, 1.1vmax, 0.95rem); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 14px rgba(0, 0, 0, 0.6); }
.needs-hint .cue span, .needs-hint .lantern-cue span { animation-duration: 1.4s; }

/* After the lantern rises the road to the farewell opens; say so quietly. */
.continue-hint { position: absolute; left: 50%; bottom: 5%; z-index: 3; margin: 0; transform: translateX(-50%); font-size: clamp(0.55rem, 0.9vmax, 0.78rem); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(232, 207, 143, 0.75); opacity: 0; transition: opacity 1.2s ease 9.5s; pointer-events: none; }
.scene--mandap.is-lit .continue-hint { opacity: 1; }
.continue-hint span { display: block; animation: breathe 3s ease-in-out infinite; }

/* The lit lantern drifts on through the farewell sky; following it leads to the makers' site. */
.drift-lantern { position: absolute; left: 16%; top: 12%; z-index: 4; width: clamp(34px, 4vmax, 64px); text-decoration: none; animation: drift 70s ease-in-out infinite alternate; }
.drift-body { display: block; animation: bob 4.2s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(255, 200, 120, 0.55)); transition: transform 0.3s ease; }
.drift-lantern:hover .drift-body, .drift-lantern:focus-visible .drift-body { transform: scale(1.08); }
.drift-lantern:focus-visible { outline: none; }
.drift-body svg { display: block; width: 100%; height: auto; }
.drift-flame { transform-origin: 60px 171px; transform-box: view-box; animation: flame 1.7s ease-in-out infinite alternate; }
.drift-label { position: absolute; left: 50%; top: 104%; transform: translateX(-50%); white-space: nowrap; text-align: center; font-size: clamp(0.55rem, 0.85vmax, 0.78rem); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(232, 207, 143, 0.85); opacity: 0; animation: labelin 1.2s ease 6s forwards; }
.drift-site { display: none; color: var(--ivory); }
.drift-lantern:hover .drift-follow, .drift-lantern:focus-visible .drift-follow { display: none; }
.drift-lantern:hover .drift-site, .drift-lantern:focus-visible .drift-site { display: inline; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(60vw); } }
@keyframes labelin { to { opacity: 1; } }
.farewell-maker { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; color: rgba(232, 207, 143, 0.75); text-decoration: none; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; transition: color 0.3s; }
.farewell-maker img { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(201, 162, 74, 0.5); }
.farewell-maker:hover, .farewell-maker:focus-visible { color: var(--ivory); outline: none; }
/* Short landscape: the card fills the height, so the lantern waits in the side margin instead of drifting behind it. */
@media (max-height: 520px) {
  .drift-lantern { left: calc((100vw - min(92vw, 560px)) / 4 - 17px); top: 14%; animation: none; }
  .drift-label { display: none; }
}

/* Landscape screens see most of the canvas, so the lantern stands on the steps in the lower third. */
@media (min-aspect-ratio: 1/1) {
  .sky-lantern { top: 60%; width: 6%; }
  .lantern-shadow { top: 73.6%; width: 7%; }
  .lantern-cue { top: 76%; }
}

.venue-eyebrow { margin: 0 0 0.4em; font-size: clamp(0.55rem, 0.95vmax, 0.8rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); }
.venue-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.6vmax, 3.6rem); line-height: 1.05; color: var(--ivory); text-shadow: 0 0 26px rgba(244, 187, 106, 0.45), 0 2px 10px rgba(0, 0, 0, 0.6); }
.venue-address { margin: 0.5em 0 0; font-size: clamp(0.75rem, 1.3vmax, 1.1rem); letter-spacing: 0.06em; color: rgba(244, 233, 211, 0.85); }
.venue-hint { margin: 1.2em 0 0; font-size: clamp(0.55rem, 0.9vmax, 0.78rem); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(232, 207, 143, 0.7); }
.door { position: absolute; top: 0; width: 50%; height: 100%; backface-visibility: hidden; }
.door svg { display: block; width: 100%; height: 100%; }
.door-l { left: 0; transform-origin: 0 50%; transform: rotateY(calc(var(--open) * 84deg)); }
.door-r { right: 0; transform-origin: 100% 50%; transform: rotateY(calc(var(--open) * -84deg)); }

/* Fountain water, fireflies, drifting petals: slow ambient life, never busy. */
.jet { transform-origin: 600px 790px; animation: jet 2.4s ease-in-out infinite alternate; }
@keyframes jet { from { transform: scaleY(0.94); } to { transform: scaleY(1.04); } }
.fireflies, .petals { position: absolute; inset: 0; pointer-events: none; }
.fireflies i { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: #ffe6a8; box-shadow: 0 0 8px 3px rgba(255, 214, 140, 0.55); opacity: 0; animation: firefly var(--t) ease-in-out var(--d) infinite; }
@keyframes firefly { 0%, 100% { opacity: 0; transform: translate(0, 0); } 25% { opacity: 0.9; } 50% { opacity: 0.2; transform: translate(18px, -22px); } 75% { opacity: 0.8; transform: translate(-10px, -40px); } }
.petals svg { position: absolute; left: var(--x); top: -6%; width: 16px; height: auto; opacity: 0; animation: petal var(--t) linear var(--d) infinite; }
@keyframes petal { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 8% { opacity: 0.9; } 90% { opacity: 0.8; } 100% { transform: translate(14vw, 112vh) rotate(540deg); opacity: 0; } }

/* Palace clock: countdown sub-dials inside the face, live hands, and the palace time under the dial
   (positions in art-box %, matching the SVG's 1200-unit coordinates). */
.countdown { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
.cd { position: absolute; width: 3.778%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 50% 40%, #f6efe0, #e6dbc2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; text-align: center; }
.cd--days { left: 50%; top: 38.333%; }
.cd--hours { left: 45.556%; top: 45%; }
.cd--minutes { left: 54.444%; top: 45%; }
.cd--seconds { left: 50%; top: 51.667%; }
.cd b { font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 2.9vmax, 2.7rem); font-variant-numeric: tabular-nums; }
.cd span { margin-top: 0.3em; font-size: clamp(0.5rem, 0.85vmax, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); }
.hand { transform-origin: 600px 540px; transform-box: view-box; }
.clock-now { position: absolute; left: 50%; top: 63.2%; width: 21.333%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; color: var(--ink); pointer-events: none; }
.now-label { font-size: clamp(0.5rem, 0.9vmax, 0.8rem); letter-spacing: 0.24em; text-transform: uppercase; color: var(--bronze); }
.clock-now b { font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 3vmax, 3rem); font-variant-numeric: tabular-nums; }
.now-mark { margin-top: 0.3em; font-family: var(--display); font-style: italic; font-size: clamp(0.7rem, 1.3vmax, 1.15rem); color: var(--bronze); }

/* Grand hall: engraved marble tablets rise into view one after another (--at = the --lp at which each starts). */
.tablets { position: absolute; inset: 0; pointer-events: none; }
.tablet {
  --o: clamp(0, calc((var(--lp, 0) - var(--at, 0)) / 0.14), 1);
  position: absolute; padding: 4% 4% 5%;
  transform: translate(-50%, calc(-50% + (1 - var(--o)) * 24px)); opacity: var(--o);
  text-align: center; color: #4a3a22; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  background: linear-gradient(160deg, #f3ecdd 0%, #e2d7c1 55%, #cbbfa8 100%);
  border: 1px solid rgba(138, 106, 42, 0.6); border-radius: 46% 46% 4px 4px / 22% 22% 4px 4px;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.35), inset 0 0 0 6px rgba(138, 106, 42, 0.35), 0 18px 30px rgba(0, 0, 0, 0.35);
}
.tablet--main { left: 50%; top: 47%; width: 21%; }
.tablet--date { left: 30%; top: 52%; width: 16%; }
.tablet--time { left: 70%; top: 52%; width: 16%; }
.tablet-eyebrow { margin: 0 0 0.3em; font-size: clamp(0.5rem, 0.95vmax, 0.8rem); letter-spacing: 0.26em; text-transform: uppercase; color: var(--bronze); }
.tablet-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 2.7vmax, 3rem); line-height: 1.05; color: var(--bronze); }
.tablet-motif { width: 60%; height: auto; margin: 0.4em 0; }
.tablet-line { margin: 0; font-family: var(--display); font-size: clamp(0.85rem, 1.4vmax, 1.4rem); }
.tablet-line .amp { font-style: italic; color: var(--bronze); }
.tablet-text { margin: 0; font-family: var(--display); font-size: clamp(0.9rem, 1.45vmax, 1.5rem); line-height: 1.15; text-wrap: balance; }
@media (orientation: portrait) {
  .tablet--main { top: 42%; width: 20%; }
  .tablet--date { left: 50%; top: 61%; width: 20%; }
  .tablet--time { left: 50%; top: 77%; width: 20%; }
}

/* ---------- journey line: thin royal line with glowing chapter markers ---------- */
.journey { position: fixed; right: clamp(10px, 2vw, 22px); top: 50%; z-index: 20; width: 28px; height: min(46vh, 360px); transform: translateY(-50%); transition: opacity 0.8s; }
html.locked .journey { opacity: 0; pointer-events: none; }
.journey-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, rgba(201, 162, 74, 0.5) 12%, rgba(201, 162, 74, 0.5) 88%, transparent); }
.journey-spark { position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--gold-soft); box-shadow: 0 0 10px 2px rgba(232, 207, 143, 0.7); transform: translate3d(0, calc(var(--pos, 0) * var(--jh, 300px)), 0); will-change: transform; } /* --jh: the line's height in px, set by app.js */
.journey-mark { position: absolute; left: 50%; top: calc(var(--at) * 100%); width: 28px; height: 28px; padding: 0; border: 0; background: none; transform: translate(-50%, -50%); display: grid; place-items: center; cursor: pointer; }
.journey-mark::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(201, 162, 74, 0.5); transition: all 0.4s; }
.journey-mark.is-active::before { width: 8px; height: 8px; background: var(--gold-soft); box-shadow: 0 0 12px 3px rgba(232, 207, 143, 0.6); }
.journey-label { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-soft); white-space: nowrap; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.journey-mark:hover .journey-label, .journey-mark:focus-visible .journey-label { opacity: 1; }
.journey-mark:focus-visible { outline: none; }
.journey-mark:focus-visible::before { box-shadow: 0 0 0 3px rgba(232, 207, 143, 0.5); }

/* ---------- corner controls ---------- */
.controls { position: fixed; top: max(12px, env(safe-area-inset-top)); right: clamp(10px, 2vw, 22px); z-index: 30; display: flex; gap: 8px; }
.ctl { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(201, 162, 74, 0.35); background: rgba(11, 18, 36, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--gold-soft); display: grid; place-items: center; cursor: pointer; transition: background 0.3s, border-color 0.3s; }
.ctl:hover, .ctl:focus-visible { background: rgba(201, 162, 74, 0.18); border-color: var(--gold); outline: none; }
.ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 40; margin: 0; padding: 0.5rem 1rem; border: var(--hairline); border-radius: 999px; background: rgba(11, 18, 36, 0.85); color: var(--gold-soft); font-size: 0.8rem; letter-spacing: 0.08em; transform: translate(-50%, 8px); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- details panel (dialog in the experience, plain page at /details, static without JS) ---------- */
.details { width: min(92vw, 560px); max-height: 88vh; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: auto; }
.details::backdrop { background: rgba(5, 8, 18, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.details-card { padding: clamp(1.5rem, 5vw, 2.6rem); background: var(--ivory); border: 1px solid rgba(201, 162, 74, 0.55); box-shadow: inset 0 0 0 8px var(--ivory), inset 0 0 0 9px rgba(201, 162, 74, 0.45); text-align: center; }
.details-card .eyebrow { color: var(--bronze); }
.details-names { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 6vw, 2.8rem); line-height: 1.1; }
.details-names .amp { font-style: italic; font-size: 0.8em; color: var(--bronze); }
.details-lead { max-width: 34ch; margin: 0.8rem auto 0; font-family: var(--display); font-style: italic; font-size: 1.1rem; color: #5a4a3a; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.2rem; margin: 1.8rem 0 0; text-align: left; }
.facts dt { padding-top: 0.2rem; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze); }
.facts dd { margin: 0; font-size: 1rem; }
.details-actions { margin: 1.6rem 0 0; }
.btn { display: inline-block; padding: 0.6rem 1.4rem; border: 1px solid var(--bronze); border-radius: 999px; color: var(--ink); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; }
.btn:hover, .btn:focus-visible { background: rgba(201, 162, 74, 0.15); }
.details-sub { margin: 1.8rem 0 0.6rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze); }
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 0.8rem; padding: 0.4rem 0; }
.contacts a { color: var(--ink); }
.details-closing { max-width: 34ch; margin: 1.8rem auto 0; font-family: var(--display); font-style: italic; font-size: 1.15rem; }
.details-sign { margin: 0.4rem 0 0; font-family: var(--display); font-size: 1.2rem; color: var(--bronze); }
.details-close { margin: 0.9rem 0 0; text-align: center; }
.link { padding: 0.5rem 1rem; border: 0; background: none; color: var(--gold-soft); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; }
.link:hover, .link:focus-visible { color: var(--ivory); }

.plain { max-width: 560px; margin: 6vh auto; padding: 0 5vw; }
.plain-back { margin: 1.4rem 0 0; text-align: center; }
.plain-back a { color: var(--gold-soft); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; }

/* No JavaScript: hide the stage, show the details as a normal page. */
.no-js .stage, .no-js .track, .no-js .journey, .no-js .controls, .no-js .veil { display: none; }
.no-js .details { display: block; position: static; width: auto; max-width: 560px; max-height: none; margin: 4vh auto; padding: 0 5vw; }
.no-js .details-close { display: none; }
.nojs-note { max-width: 560px; margin: 6vh auto 0; padding: 0 5vw; text-align: center; font-size: 0.9rem; color: rgba(244, 233, 211, 0.75); }
.nojs-note a { color: var(--gold-soft); }

/* ---------- reduced motion: keep every scene and fact, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .layer, .scene-copy { transform: none; }
  .room, .room-glow::after, .dust i, .diya .flame, .cue span, .hint span, .jet, .fireflies i, .petals svg, .chandelier, .ripples, .marker-body, .marker-ring, .lantern-sway, .lantern-flame, .lantern-cue span, .stars i, .lamp, .mist, .drift-lantern, .drift-body, .drift-flame, .continue-hint span { animation: none; }
  .drift-label { opacity: 1; animation: none; }
  html { scroll-snap-type: none; }
  .scene--mandap.is-lit .sky-lantern { animation: none; opacity: 0.85; transform: translate(-50%, -140%) scale(0.7); transition: transform 1.5s ease, opacity 1.5s ease; }
  .final-message { transition-delay: 1s; }
  .night-veil, .stars-late { transition-duration: 1.5s; transition-delay: 0s; }
  .petals { display: none; }
  .fx { will-change: auto; }
  .journey-spark, .veil, .seal, .envelope { transition: none; }
  .scene--reveal .seq { transition-delay: 0s; transform: none; }
}
