/* ==========================================================================
   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 document never scrolls: the stage is fixed and app.js moves the camera one scene per gesture.
   html.in-journey is set by app.js on the invitation page; plain pages such as /details scroll normally. */
body { margin: 0; min-height: 100vh; line-height: 1.5; }
html.in-journey, html.in-journey body { overflow: hidden; height: 100%; }
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; touch-action: pinch-zoom; } /* one finger drives the journey; two still zoom */
/* 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, .couple-figure, .lamp, .mist, .hall-flame path) { 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; }
/* The heart between the names (_Heart.cshtml): sized and coloured by the .amp rule around it. */
.heart { display: inline-block; width: 0.66em; height: 0.66em; margin: 0 0.12em; vertical-align: 0.02em; fill: currentColor; }
/* 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 through an iris (app.js): over the second half of the reveal the gates
   scene is lifted above the paper and clipped to a growing circle, and this soft paper-coloured rim, a
   fixed gradient that app.js sizes and scales by transform, feathers the edge. Both are compositor
   operations, so nothing repaints while it opens. */
.iris-edge { position: absolute; left: 50%; top: 55%; z-index: 4; width: 0; height: 0; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(244, 234, 214, 0) 84%, #f4ead6 100%); transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; will-change: transform; }

/* ==========================================================================
   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-size: 0.85em; 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: safe 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-mono .mono { display: inline-flex; align-items: baseline; gap: 0.16em; white-space: nowrap; }
.farewell-mono .heart { margin: 0; vertical-align: 0; }
.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; }
}
.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; }
/* Warm bars above the actions: "Send your wishes" (always) and the WhatsApp RSVP (when Wedding:RsvpPhone is set). */
.cta { display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin: 1.5rem 0 0; padding: 0.75rem 1.3rem; border: 1px solid var(--gold); border-radius: 999px; background: linear-gradient(90deg, rgba(201, 162, 74, 0.24), rgba(201, 162, 74, 0.1)); color: var(--ivory); text-decoration: none; transition: background 0.3s, transform 0.3s, box-shadow 0.3s; }
.cta:hover, .cta:focus-visible { background: rgba(201, 162, 74, 0.3); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); outline: none; }
.cta svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--gold-soft); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cta-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.cta-text b { font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 2.8vw, 1.35rem); }
.cta-text small { margin-top: 0.15em; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(232, 207, 143, 0.75); }
.cta { width: 100%; font: inherit; }
.cta + .cta { margin-top: 0.6rem; }
.ctas + .actions { margin-top: 0.7rem; }
@media (max-height: 520px) { .cta { margin-top: 0.7rem; padding: 0.45rem 1rem; } .cta-text b { font-size: 1rem; } .cta-text small { display: none; } }
/* Very short landscape screens: the two bars share a row and the closing lines step aside so the card fits. */
@media (max-height: 420px) { .farewell-card { padding: 0.7rem 0.9rem; } .ctas { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; margin-top: 0.7rem; } .ctas .cta { margin-top: 0; } .farewell-line, .farewell-maker { display: none; } }
.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); }
.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 three 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; }

/* 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); }
.venue-address { text-wrap: balance; }
/* Wide screens (landscape phones, laptops) crop the canvas top and bottom, and sized by the width the venue text ran
   off the bottom under the nudge. There it is placed from the middle of the screen and its type follows the height.
   It keeps its width, so the address wraps between the lamp posts instead of running behind them. */
@media (min-aspect-ratio: 3/2) {
  .venue-text { top: calc(50% + 11vh); }
  .venue-eyebrow { font-size: clamp(0.55rem, 1.7vh, 0.8rem); }
  .venue-name { font-size: clamp(1.2rem, 6.4vh, 3.6rem); }
  .venue-address { font-size: clamp(0.68rem, 2.4vh, 1.1rem); }
  .venue-hint { font-size: clamp(0.55rem, 1.6vh, 0.78rem); }
}
/* Short screens: a little higher and tighter, so the name, the address and the map hint fit above the nudge. */
@media (min-aspect-ratio: 3/2) and (max-height: 520px) {
  .venue-text { top: calc(50% + 7vh); }
}
@media (max-height: 520px) {
  .venue-eyebrow { margin-bottom: 0.25em; }
  .venue-address { margin-top: 0.3em; }
  .venue-hint { margin-top: 0.6em; }
}
/* Short portrait phones, or tall phones behind thick browser bars: the text sits a little higher, clear of the nudge. */
@media (orientation: portrait) and (max-height: 700px) {
  .venue-text { top: 61%; }
}
.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)); }

/* The couple at the gate. The illustration (800 x 1200 with alpha) stands on the path in front of the
   doors, canvas x 600 with its feet at y 900, and fades in as the doors swing open; the welcome line
   follows a moment later. A warm gradient glow ties it into the lamp light and a slow, tiny breathing
   transform keeps it alive without any per-frame paint. */
.couple { --o: clamp(0, calc((var(--lp, 0) - 0.34) / 0.16), 1); position: absolute; left: 50%; top: 75%; height: 24.2%; aspect-ratio: 2 / 3; transform: translate(-50%, calc(-100% + (1 - var(--o)) * 18px)); opacity: var(--o); }
.couple-glow { position: absolute; left: 50%; top: 58%; width: 200%; height: 110%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 196, 120, 0.34), rgba(255, 196, 120, 0.12) 50%, transparent); }
.couple-shadow { position: absolute; left: 50%; bottom: -1.4%; width: 96%; height: 5%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), transparent); }
.couple-figure { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; animation: greet 5s ease-in-out infinite alternate; }
.couple-figure img { display: block; width: 100%; height: 100%; }
@keyframes greet { from { transform: translateY(0) scale(1); } to { transform: translateY(-0.5%) scale(1.012); } }
.gate-welcome { --o2: clamp(0, calc((var(--lp, 0) - 0.4) / 0.12), 1); position: absolute; left: 50%; top: 103%; width: max-content; max-width: 78vw; margin: 0; transform: translate(-50%, calc((1 - var(--o2)) * 10px)); opacity: var(--o2); text-align: center; line-height: 1.2; }
.gate-welcome::before { content: ""; position: absolute; left: 50%; top: 50%; width: 150%; height: 230%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(8, 12, 30, 0.62), rgba(8, 12, 30, 0) 70%); z-index: -1; }
.gate-welcome-eyebrow { display: block; margin-bottom: 0.35em; font-size: clamp(0.5rem, 0.9vmax, 0.78rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); }
.gate-welcome-line { display: block; font-family: var(--display); font-style: italic; font-size: clamp(1rem, 2.3vmax, 2.1rem); color: var(--ivory); text-shadow: 0 0 22px rgba(244, 187, 106, 0.35), 0 2px 10px rgba(0, 0, 0, 0.6); }
/* Short landscape screens: no room under their feet, so the welcome sits above their heads in the arch. */
@media (max-height: 520px) { .couple { top: 72%; } .gate-welcome { top: auto; bottom: 103%; } }

/* 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; }
/* The caption under the dial is a size container 384 canvas units wide, so its type is set in cqi and keeps its
   proportion to the tower on every screen (sized by the viewport, it outgrew the tower on wide screens and ran into
   the divider). The divider (.now-orn) is part of the caption and follows the text. Each size has a px floor for
   small screens, and a viewport-based value before it for browsers without container units. */
.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.1; text-align: center; color: var(--ink); pointer-events: none; container-type: inline-size; }
.now-label { font-size: clamp(0.5rem, 0.8vmax, 0.7rem); font-size: max(0.5rem, 3.3cqi); letter-spacing: 0.24em; text-transform: uppercase; color: var(--bronze); }
.clock-now b { font-family: var(--display); font-weight: 400; font-size: clamp(1.05rem, 2.2vmax, 2rem); font-size: max(1.05rem, 10cqi); font-variant-numeric: tabular-nums; }
.now-mark { margin-top: 0.3em; font-family: var(--display); font-style: italic; font-size: clamp(0.66rem, 1vmax, 0.9rem); font-size: max(0.66rem, 4.8cqi); color: var(--bronze); text-wrap: balance; }
.now-orn { display: block; width: 83.333%; height: auto; margin-top: 0.5em; margin-top: 2.6cqi; overflow: visible; }

/* Grand hall: the stage backdrop. A velvet drape hangs in the alcove (placed in % of the art box so it stays on
   the art: canvas x 447-753, y 372-680), its lines surfacing one after another as the camera arrives (--at = the
   --lp at which each starts), marigold strands at its sides, and the brass lamps' flames beside the steps. The
   drape is a size container, so its text is sized in cqi and follows its width. */
.hall-stage {
  --o: clamp(0, calc((var(--lp, 0) - 0.04) / 0.12), 1);
  position: absolute; left: 50%; top: 31%; width: 17%; height: 25.7%; container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; /* no padding: percentage padding would follow the art box, and cqi is 1% of the content box */
  transform: translate(-50%, calc((1 - var(--o)) * 18px)); opacity: var(--o);
  text-align: center; color: var(--ivory); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 3%, rgba(0, 0, 0, 0.07) 3% 7%, rgba(255, 255, 255, 0) 7% 11%),
    linear-gradient(180deg, #6a1f2c 0%, #7e2736 45%, #4e1421 100%);
  border: 1px solid rgba(201, 162, 74, 0.7);
  box-shadow: inset 0 0 0 5px #7a2030, inset 0 0 0 6px rgba(201, 162, 74, 0.45), 0 18px 34px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.hall-stage::before { content: ""; position: absolute; left: -9%; right: -9%; top: -1.6cqi; height: 2.6cqi; border-radius: 999px; background: linear-gradient(180deg, #f3dc95, #c9a24a 55%, #8a6a2a); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); }
.hall-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3.4cqi; height: 3.4cqi; background: repeating-linear-gradient(90deg, #d4ae5a 0 1cqi, rgba(0, 0, 0, 0) 1cqi 1.8cqi); opacity: 0.9; }
.hall-stage > * { --o2: clamp(0, calc((var(--lp, 0) - var(--at, 0)) / 0.1), 1); margin: 0; max-width: 78cqi; transform: translateY(calc((1 - var(--o2)) * 12px)); opacity: var(--o2); }
.hall-eyebrow { font-size: max(0.55rem, 4.6cqi); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); }
.hall-date { margin-top: 3cqi; font-family: var(--display); font-style: italic; font-size: max(0.85rem, 7cqi); line-height: 1.15; text-wrap: balance; }
.hall-motif { width: 42%; height: auto; margin: 3.5cqi 0 2.5cqi; }
.hall-title { font-family: var(--display); font-weight: 400; font-size: max(1.4rem, 15cqi); line-height: 1; color: #f3dc95; text-shadow: 0 0 18px rgba(244, 187, 106, 0.35), 0 2px 6px rgba(0, 0, 0, 0.55); }
.hall-time { margin-top: 2.5cqi; font-size: max(0.6rem, 4.6cqi); letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; }
.hall-strand { position: absolute; top: 3%; width: 4.2cqi; height: 70%; max-width: none; transform: none; opacity: 1;
  background-image: radial-gradient(circle 2cqi at 50% 50%, #f0a030 88%, rgba(0, 0, 0, 0) 100%), radial-gradient(circle 2cqi at 50% 50%, #f7c94a 88%, rgba(0, 0, 0, 0) 100%), linear-gradient(90deg, rgba(0, 0, 0, 0) 44%, rgba(70, 30, 10, 0.55) 44% 56%, rgba(0, 0, 0, 0) 56%);
  background-size: 100% 8.4cqi, 100% 8.4cqi, 100% 100%; background-position: 0 0, 0 4.2cqi, 0 0; background-repeat: repeat-y, repeat-y, no-repeat; }
.hall-strand--l { left: 3.2cqi; }
.hall-strand--r { right: 3.2cqi; }
.hall-flame { opacity: clamp(0, calc((var(--lp, 0) - var(--at, 0)) / 0.12), 1); }
.hall-flame path { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.7s ease-in-out infinite alternate; }
.hall-flame--r path { animation-delay: -0.9s; animation-duration: 1.9s; }
@media (orientation: portrait) {
  .hall-stage { width: min(72vw, 22%); height: 24%; top: 30%; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hall-stage { width: 22%; }
}

/* ---------- 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); }

/* The nudge (app.js): after three idle seconds at a rest with the road open, a small pill at the foot of the
   stage says how to move on. The chevron bobs the way the gesture goes: down for a scroll, up for a swipe. */
.nudge { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.5rem 1.05rem 0.5rem 0.85rem; border: 1px solid rgba(201, 162, 74, 0.35); border-radius: 999px; background: rgba(11, 18, 36, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--gold-soft); font-size: clamp(0.6rem, 0.9vmax, 0.74rem); letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, 10px); opacity: 0; visibility: hidden; transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s; pointer-events: none; }
.nudge.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 1.2s ease, transform 1.2s ease, visibility 0s; }
.nudge svg { --bob: 4px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nudge--touch svg { --bob: -4px; transform: rotate(180deg); }
.nudge.is-visible svg { animation: nudge-bob 1.5s ease-in-out infinite; }
/* Short landscape screens have little room below the scenes' text, so the nudge is slimmer and sits lower. */
@media (max-height: 520px) {
  .nudge { bottom: max(8px, env(safe-area-inset-bottom)); gap: 0.4rem; padding: 0.3rem 0.85rem 0.3rem 0.65rem; }
  .nudge svg { width: 14px; height: 14px; }
}
@keyframes nudge-bob { 0%, 100% { translate: 0 0; opacity: 0.55; } 50% { translate: 0 var(--bob); opacity: 1; } }

/* ---------- 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; overscroll-behavior: contain; }
.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); color: var(--ink); 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:focus { outline: none; } /* the card takes the initial focus so the dialog opens at its top, not scrolled to the first button */
.details-card .eyebrow { color: var(--bronze); }
/* The illustrated couple in a gold palace arch at the top of the card, against a dusk sky. */
.details-photo { display: block; width: min(52vw, 200px); height: auto; aspect-ratio: 2 / 3; margin: 0 auto 1.3rem; object-fit: cover; object-position: 50% 100%; padding: 6% 4% 0; background: linear-gradient(180deg, #101a3a 0%, #2b3a6a 45%, #6a5470 75%, #b8845e 100%); border-radius: 999px 999px 8px 8px; border: 1px solid rgba(201, 162, 74, 0.7); outline: 1px solid rgba(201, 162, 74, 0.35); outline-offset: 5px; box-shadow: 0 14px 30px rgba(42, 33, 23, 0.18); }
/* A close button that stays at the top right while the panel scrolls, for small screens where the
   backdrop is hard to reach and the return link sits below the fold. */
.dialog-bar { position: sticky; top: 0; z-index: 2; height: 0; display: flex; justify-content: flex-end; margin: 0; }
.dialog-close { width: 40px; height: 40px; margin: 8px 8px 0 0; padding: 0; border: 1px solid rgba(201, 162, 74, 0.55); border-radius: 50%; background: rgba(11, 18, 36, 0.62); color: var(--gold-soft); display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background 0.3s, border-color 0.3s; }
.dialog-close:hover, .dialog-close:focus-visible { background: rgba(201, 162, 74, 0.25); border-color: var(--gold); outline: none; }
.dialog-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.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); }

/* ---------- wishes: the form in the dialog, and the couple's reading page at /wishes ---------- */
.wishes-form { margin: 1.4rem 0 0; text-align: left; }
.field { display: block; margin: 0 0 1rem; }
.field span { display: block; margin-bottom: 0.35rem; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze); }
.field input, .field textarea { display: block; width: 100%; padding: 0.7rem 0.9rem; border: 1px solid rgba(138, 106, 42, 0.45); border-radius: 6px; background: rgba(255, 255, 255, 0.6); color: var(--ink); font: inherit; font-size: 1rem; }
.field textarea { resize: vertical; min-height: 6.5rem; font-family: var(--display); font-size: 1.15rem; line-height: 1.35; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.25); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wishes-status { min-height: 1.2em; margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--wax); }
.wishes-form .details-actions { margin-top: 0.4rem; }
.wishes-form .btn { background: rgba(201, 162, 74, 0.18); cursor: pointer; }
.wishes-form .btn:disabled { opacity: 0.6; cursor: default; }
.wishes-thanks { margin-top: 1.4rem; }
.wish-list { list-style: none; margin: 1.4rem 0 0; padding: 0; text-align: left; }
.wish-list li { padding: 0.9rem 0; border-top: 1px solid rgba(138, 106, 42, 0.25); }
.wish-text { margin: 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.wish-meta { margin: 0.35rem 0 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bronze); }

.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 .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; }
.no-js .wishes { 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 ---------- */
/* ---------- per-wedding extras, each shown only when its setting is filled in ---------- */
/* The letter: a line of blessing above the motif (Blessing) and a line under the names (InviteLine). */
.blessing { margin: 0 0 0.9rem; font-size: 0.64rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bronze); text-wrap: balance; }
.invite-line { max-width: 30ch; margin: 0.8rem auto 0; font-family: var(--display); font-style: italic; font-size: clamp(1.1rem, 2.8vw, 1.45rem); color: var(--bronze); text-wrap: balance; }

/* A verse in the evening sky over the garden path (Couplet), like the welcome at the gate: it rises into view as the
   camera walks the path and sits in the open sky above the trees. Placed in the art box (canvas y ~ 300) so it keeps
   clear of the corner controls on every screen. */
.verse { --o: clamp(0, calc((var(--lp, 0) - 0.12) / 0.18), 1); position: absolute; left: 50%; top: 27%; width: min(30%, 88vw); margin: 0; transform: translate(-50%, calc((1 - var(--o)) * 14px)); opacity: var(--o); text-align: center; pointer-events: none; }
.verse::before { content: ""; position: absolute; left: 50%; top: 50%; width: 130%; height: 190%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(8, 12, 30, 0.5), rgba(8, 12, 30, 0) 70%); z-index: -1; }
.verse-text { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(1.05rem, 2.2vmax, 2rem); line-height: 1.3; color: var(--ivory); text-shadow: 0 0 22px rgba(244, 187, 106, 0.35), 0 2px 10px rgba(0, 0, 0, 0.6); text-wrap: balance; }
.verse-source { margin: 0.6em 0 0; font-size: clamp(0.5rem, 0.9vmax, 0.78rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-soft); }
@media (orientation: landscape) and (max-height: 520px) {
  .verse { top: 24%; }
  .verse-text { font-size: clamp(0.95rem, 4.6vh, 1.3rem); }
}

/* The wedding's other functions (Events): a line on the hall stage, which grows to hold it, and on the closing card. */
.hall-stage--events { top: 28%; height: 31%; }
.hall-event { margin-top: 2.4cqi; font-size: max(0.5rem, 3.2cqi); line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-soft); }
.hall-event span { white-space: nowrap; }
.farewell-event { margin-top: 0.3rem; opacity: 0.85; }
/* Narrow phones: each part of a date line takes its own line, so no dot is left hanging at a line's end, and the
   drifting lantern's label, which the card would cut off, stays hidden. */
@media (max-width: 520px) {
  .farewell-date .nowrap { display: block; }
  .farewell-date .dot { display: none; }
  .drift-label { display: none; }
}

/* The details panel: the blessing, each family, and the couplet. */
.details-blessing { margin: 0 0 1rem; font-size: 0.64rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--bronze); }
.details-families { display: grid; gap: 1rem; max-width: 36ch; margin: 1.4rem auto 0; }
.details-person p { margin: 0; }
.details-person-name { font-family: var(--display); font-size: 1.35rem; line-height: 1.2; }
.details-person-name span { margin-left: 0.35em; font-family: var(--body); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--bronze); }
.details-person-work { margin-top: 0.15rem !important; font-size: 0.82rem; color: #5a4a3a; }
.details-person-family { margin-top: 0.2rem !important; font-family: var(--display); font-style: italic; font-size: 1.02rem; line-height: 1.3; color: #5a4a3a; }
.details-couplet { max-width: 32ch; margin: 1.8rem auto 0; padding: 0; }
.details-couplet p { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.1rem; line-height: 1.35; }
.details-couplet cite { display: block; margin-top: 0.45rem; font-style: normal; font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--bronze); }

/* The maker's lantern (MakerLantern): a small paper lantern bearing the DotTut mark that floats in the top-left corner
   along the journey. At each new chapter it says who made the invitation for a few seconds, and on hover or focus;
   a tap opens the maker's site in a new tab. It waits until the letter is opened and steps aside on the farewell,
   where the drifting lantern and the credit line take over. */
.maker-lantern { position: fixed; left: max(12px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); z-index: 22; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-soft); transition: opacity 0.8s ease, visibility 0s linear 0s; }
html.locked .maker-lantern, .maker-lantern.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }
.maker-lantern-body { display: block; width: clamp(26px, 3.2vmax, 38px); animation: maker-float 5.5s ease-in-out infinite; } /* the glow is drawn in the svg: a CSS filter here kept the gate couple from painting */
.maker-lantern-body svg { display: block; width: 100%; height: auto; }
.maker-flame { transform-origin: 60px 171px; transform-box: view-box; animation: flame 1.7s ease-in-out infinite alternate; }
@keyframes maker-float { 0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); } 50% { transform: translate3d(0, -6px, 0) rotate(2deg); } }
.maker-lantern-label { display: flex; flex-direction: column; padding: 0.38rem 0.8rem 0.42rem; border: 1px solid rgba(201, 162, 74, 0.38); border-radius: 999px; background: rgba(11, 18, 36, 0.86); line-height: 1.15; white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: opacity 0.6s ease, transform 0.6s ease; pointer-events: none; }
.maker-lantern-label b { font-family: var(--display); font-weight: 400; font-size: 0.98rem; color: var(--ivory); }
.maker-lantern-label small { font-size: 0.54rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-soft); }
.maker-lantern.is-telling .maker-lantern-label, .maker-lantern:hover .maker-lantern-label, .maker-lantern:focus-visible .maker-lantern-label { opacity: 1; transform: none; }
.maker-lantern:focus-visible { outline: none; }
.maker-lantern:focus-visible .maker-lantern-label { opacity: 1; transform: none; border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .maker-lantern-body, .maker-flame { animation: none; }
}
@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, .couple-figure, .lamp, .mist, .drift-lantern, .drift-body, .drift-flame, .nudge svg, .hall-flame path { animation: none; }
  .nudge, .nudge.is-visible { transform: translate(-50%, 0); }
  .drift-label { opacity: 1; animation: 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; }
}
