/* Slow autonomous movement in distinct foreground, middle and distant layers. */
.ambient-petals{position:fixed;inset:0;pointer-events:none;z-index:3;overflow:hidden;perspective:1100px}
.petal-track{position:absolute;top:0;left:var(--petal-left,10%);width:16px;height:22px;opacity:.72;animation:petal-descent var(--fall-duration,32s) linear infinite;animation-delay:var(--fall-delay,-10s);will-change:transform}
.drifting-petal{display:block;width:100%;height:100%;border-radius:80% 12% 78% 25%;background:radial-gradient(at 28% 18%,#d87d83 0,#ae4058 35%,#792338 78%,#521e2d);box-shadow:inset 1px 1px 2px #f1a3a166,inset -2px -1px 3px #4c172b88,2px 5px 5px #55213519;transform-style:preserve-3d;animation:petal-sway var(--sway-duration,8s) ease-in-out infinite alternate;animation-delay:var(--fall-delay,-10s);will-change:transform}
.track-0{--petal-left:4%;--fall-duration:35s;--fall-delay:-8s;--drift:35px}
.track-1{--petal-left:13%;--fall-duration:29s;--fall-delay:-19s;--drift:-30px;width:10px;height:15px;opacity:.55}
.track-2{--petal-left:25%;--fall-duration:39s;--fall-delay:-14s;--drift:70px;width:8px;height:12px;opacity:.4}
.track-3{--petal-left:38%;--fall-duration:34s;--fall-delay:-28s;--drift:-50px;width:11px;height:16px;opacity:.5}
.track-4{--petal-left:53%;--fall-duration:44s;--fall-delay:-4s;--drift:35px;width:7px;height:11px;opacity:.4}
.track-5{--petal-left:68%;--fall-duration:31s;--fall-delay:-22s;--drift:45px;width:10px;height:15px;opacity:.55}
.track-6{--petal-left:83%;--fall-duration:37s;--fall-delay:-16s;--drift:-65px;width:14px;height:20px}
.track-7{--petal-left:95%;--fall-duration:33s;--fall-delay:-29s;--drift:-30px}
.track-8{--petal-left:8%;--fall-duration:26s;--fall-delay:-17s;--drift:50px;width:23px;height:30px;opacity:.55;filter:blur(.4px)}
.track-9{--petal-left:89%;--fall-duration:28s;--fall-delay:-6s;--drift:-40px;width:21px;height:29px;opacity:.5;filter:blur(.4px)}
.track-10{--petal-left:19%;--fall-duration:42s;--fall-delay:-32s;--drift:30px;width:7px;height:10px;opacity:.35}
.track-11{--petal-left:76%;--fall-duration:40s;--fall-delay:-37s;--drift:-40px;width:8px;height:12px;opacity:.4}
.track-12{--petal-left:46%;--fall-duration:46s;--fall-delay:-25s;--drift:40px;width:7px;height:10px;opacity:.3}
.track-13{--petal-left:59%;--fall-duration:43s;--fall-delay:-34s;--drift:-50px;width:8px;height:12px;opacity:.35}
/* A fuller shower, staggered across depth and position. */
.track-14{--petal-left:6%;--fall-duration:34s;--fall-delay:-14s;--drift:43px;width:14px;height:20px;opacity:0.51}
.track-15{--petal-left:91%;--fall-duration:41s;--fall-delay:-26s;--drift:-50px;width:8px;height:14px;opacity:0.59}
.track-16{--petal-left:31%;--fall-duration:32s;--fall-delay:-19s;--drift:57px;width:11px;height:17px;opacity:0.35}
.track-17{--petal-left:73%;--fall-duration:39s;--fall-delay:-22s;--drift:-64px;width:14px;height:20px;opacity:0.43}
.track-18{--petal-left:17%;--fall-duration:46s;--fall-delay:-39s;--drift:31px;width:8px;height:14px;opacity:0.51}
.track-19{--petal-left:57%;--fall-duration:37s;--fall-delay:-22s;--drift:-38px;width:11px;height:17px;opacity:0.59}
.track-20{--petal-left:42%;--fall-duration:44s;--fall-delay:-30s;--drift:45px;width:14px;height:20px;opacity:0.35}
.track-21{--petal-left:85%;--fall-duration:35s;--fall-delay:-26s;--drift:-52px;width:8px;height:14px;opacity:0.43}
.track-22{--petal-left:23%;--fall-duration:42s;--fall-delay:-25s;--drift:59px;width:11px;height:17px;opacity:0.51}
.track-23{--petal-left:64%;--fall-duration:33s;--fall-delay:-6s;--drift:-26px;width:14px;height:20px;opacity:0.59}
.track-24{--petal-left:48%;--fall-duration:40s;--fall-delay:-24s;--drift:33px;width:8px;height:14px;opacity:0.35}
.track-25{--petal-left:97%;--fall-duration:47s;--fall-delay:-28s;--drift:-40px;width:11px;height:17px;opacity:0.43}
.track-26{--petal-left:35%;--fall-duration:38s;--fall-delay:-27s;--drift:47px;width:14px;height:20px;opacity:0.51}
.track-27{--petal-left:79%;--fall-duration:45s;--fall-delay:-22s;--drift:-54px;width:8px;height:14px;opacity:0.59}
@keyframes petal-descent{from{transform:translate3d(0,-16vh,0) rotateZ(-15deg)}to{transform:translate3d(var(--drift,35px),116vh,0) rotateZ(80deg)}}
@keyframes petal-sway{from{transform:translateX(-16px) rotateX(10deg) rotateY(-30deg) rotateZ(-25deg)}to{transform:translateX(22px) rotateX(60deg) rotateY(35deg) rotateZ(60deg)}}
.royal-depth-set{position:absolute;inset:0;transform-style:preserve-3d;perspective:1300px;pointer-events:none;transform:translate3d(0,var(--decor-y,0px),55px) rotateY(var(--decor-turn,0deg))}
.suspended-lantern{position:absolute;top:-20px;width:64px;height:250px;transform-style:preserve-3d;transform:translateZ(70px)}
.world-lantern-left{left:2.8%}.world-lantern-right{right:2.8%;top:15px}
.lantern-chain{height:72px;width:2px;position:relative;left:50%;background:repeating-linear-gradient(#6e512c 0 3px,#ceb278 3px 6px);box-shadow:1px 0 #e7c48966}
.lantern-swing{position:relative;width:100%;height:160px;transform-origin:50% -72px;transform-style:preserve-3d;animation:lantern-sway 10s ease-in-out infinite alternate}
.world-lantern-right .lantern-swing{animation-duration:12s;animation-delay:-7s}
.lantern-swing svg{position:relative;width:100%;height:100%;filter:drop-shadow(2px 8px 5px #3f281b55);transform:translateZ(8px)}
.lantern-aura{position:absolute;inset:20% -70% 0;background:radial-gradient(ellipse at center,#ffdb8f55,transparent 65%);filter:blur(4px);transform:translateZ(-12px)}
@keyframes lantern-sway{from{transform:rotateZ(-2.2deg) rotateY(-8deg)}to{transform:rotateZ(2.2deg) rotateY(8deg)}}
.garden-plinth{position:absolute;bottom:-15px;width:90px;height:175px;transform-style:preserve-3d;transform:translateZ(90px) rotateY(14deg);filter:drop-shadow(8px 10px 9px #543c2540)}
.plinth-left{left:1.2%}.plinth-right{right:1.2%;transform:translateZ(90px) rotateY(-14deg)}
.plinth-cap,.plinth-base{position:absolute;left:-8px;right:-8px;height:22px;background:linear-gradient(#ecd8ad,#c2a16b 35%,#f4dfb0 50%,#ae8a53 80%,#dbbc83);border:1px solid #c5a269;transform:translateZ(12px);box-shadow:0 5px 0 #96764c}
.plinth-cap{top:40px}.plinth-base{bottom:0}
.plinth-shaft{position:absolute;inset:63px 4px 22px;background:repeating-linear-gradient(90deg,#a68a5f 0,#e6d1a3 10%,#c2a371 20%,#e6d1a3 30%);border:1px solid #9f7e4f;box-shadow:inset -9px 0 8px #7b62354a;transform:translateZ(4px)}
.plinth-shaft:after{content:'';position:absolute;right:-10px;top:0;bottom:0;width:10px;background:#a28558;transform-origin:left;transform:rotateY(75deg)}
.plinth-bouquet{position:absolute;top:-30px;left:50%;width:86px;height:86px;transform:translateX(-50%) translateZ(35px);transform-style:preserve-3d}
.sculpted-flower{position:absolute;width:68px;height:68px;left:9px;top:0;transform-style:preserve-3d;transform:rotateX(-12deg) rotateZ(-18deg)}
.flower-petal{position:absolute;width:31px;height:42px;left:19px;top:8px;border-radius:65% 35% 60% 40%;transform-origin:50% 70%;background:radial-gradient(at 30% 20%,#e78f90,#a83853 52%,#69243c);box-shadow:inset 1px 2px 4px #f1b3ac66,2px 3px 5px #471a2d55;transform:rotateZ(var(--flower-turn)) rotateX(28deg) translateZ(5px)}
.flower-petal-0{--flower-turn:0deg}.flower-petal-1{--flower-turn:45deg}.flower-petal-2{--flower-turn:90deg}.flower-petal-3{--flower-turn:135deg}.flower-petal-4{--flower-turn:180deg}.flower-petal-5{--flower-turn:225deg}.flower-petal-6{--flower-turn:270deg}.flower-petal-7{--flower-turn:315deg}
.sculpted-flower b{position:absolute;left:29px;top:30px;width:13px;height:13px;border-radius:50%;background:radial-gradient(at 25% 20%,#f1cd7c,#a77a2c);box-shadow:0 2px 3px #4b1c2e55;transform:translateZ(18px)}
.garden-leaf{position:absolute;width:25px;height:55px;border-radius:90% 0 90% 0;background:linear-gradient(65deg,#253f27,#617348 48%,#b6b17a 50%,#405b37 53%,#263f2c);transform:rotate(-40deg) translateZ(-8px);left:0;top:25px;box-shadow:2px 4px 4px #322b1b33}.leaf-b{left:auto;right:0;top:25px;transform:rotate(55deg) translateZ(-10px)}
.terrace-depth-floor{position:absolute;left:0;right:0;bottom:-65px;height:110px;background:repeating-linear-gradient(90deg,#d7bd8b22 0 80px,#ad8b5444 81px 82px),linear-gradient(#f3e3c54d,#d0b17d77);border-top:1px solid #bc9c6388;transform-origin:bottom;transform:rotateX(68deg) translateZ(15px)}
.motion-off .petal-track,.motion-off .drifting-petal,.motion-off .lantern-swing,.ambient-paused .petal-track,.ambient-paused .drifting-petal,.ambient-paused .lantern-swing{animation-play-state:paused}
.motion-off .royal-depth-set{transform:none}
@media(max-width:1000px){.suspended-lantern{width:42px}.world-lantern-left{left:1.3%}.world-lantern-right{right:1.3%}.garden-plinth{width:65px;height:155px}.plinth-left{left:-8px}.plinth-right{right:-8px}.plinth-bouquet{scale:.8}.lantern-chain{height:60px}.lantern-swing{height:130px;transform-origin:50% -60px}}
@media(max-width:700px){.petal-track:nth-child(n+17){display:none}.track-2,.track-4{opacity:.28}.petal-track{width:10px;height:15px}.track-0,.track-7{width:14px;height:20px}.suspended-lantern{width:27px;top:24px}.world-lantern-left{left:2px}.world-lantern-right{right:2px;top:5px}.lantern-chain{height:65px}.lantern-swing{height:90px}.garden-plinth{width:46px;height:116px;bottom:-23px;opacity:.82}.plinth-left{left:-12px}.plinth-right{right:-12px}.plinth-cap{top:31px;height:14px}.plinth-base{height:14px}.plinth-shaft{top:47px;bottom:14px}.plinth-bouquet{scale:.6;top:-29px;transform-origin:50% 85%}.terrace-depth-floor{display:none}}
@media(prefers-reduced-motion:reduce){.ambient-petals{display:none}.lantern-swing{animation:none!important;transform:none}.royal-depth-set{transform:none!important}}
.data-saving .ambient-petals,.data-saving .garden-plinth{display:none}
@media print{.ambient-petals,.royal-depth-set{display:none}}
/* Perspective pushes near objects outward: compensate inside the camera frustum. */
.world-lantern-left{left:12%;top:110px}.world-lantern-right{right:12%;top:80px}
.plinth-left{left:12%}.plinth-right{right:12%}.garden-plinth{bottom:85px}
.terrace-depth-floor{bottom:35px}
@media(max-width:700px){.world-lantern-left{left:12%;top:110px}.world-lantern-right{right:12%;top:85px}.plinth-left{left:11%}.plinth-right{right:11%}.garden-plinth{bottom:85px}}
@media(hover:hover) and (pointer:fine){.motion-active .royal-arched-card{transition:transform 1s cubic-bezier(.16,1,.3,1),opacity .8s,rotate .5s ease,translate .5s ease}.motion-active .royal-arched-card:hover{rotate:y -1.8deg;translate:0 -4px}.motion-active .royal-arched-card:hover>.royal-card-frame{filter:drop-shadow(2px 20px 18px #51311d30)}}
@media(prefers-reduced-motion:reduce){.royal-arched-card{rotate:none!important;translate:none!important}}

/* Portrait artwork retains its full frame, including both peacocks and pillars. */
@media(max-width:600px){
 .world-backdrop .scene-camera{inset:0;transform:none!important}
 .world-backdrop .palace-art{object-fit:contain;object-position:center bottom;transform:none!important;filter:none;background:#f8e6c9}
 .world-backdrop .scene-haze{background:radial-gradient(ellipse 31% 37% at 50% 40%,#fff4dce0,transparent 100%)}
 .world-backdrop .garden-plinth{display:none}
 .world-backdrop .suspended-lantern{display:none}
}
@media(max-width:700px){
 .immersive-invitation .royal-invitation{width:68%;padding-top:85px;padding-bottom:100px}
 .immersive-invitation .royal-invitation h1{font-size:clamp(3rem,12.2vw,4.6rem);margin-bottom:16px}
 .immersive-invitation .scene-invite-label{margin-bottom:14px}
 .immersive-invitation .scene-message{margin-bottom:14px;font-size:.75rem}
 .immersive-invitation .scene-date{color:#67381d}
 .immersive-invitation .scene-place{color:#5b3b24}
 .immersive-invitation .scene-rsvp{color:#623b27}
}

@media(max-width:600px) and (min-aspect-ratio:1/2){.world-backdrop .palace-art{object-fit:cover}.entrance-courtyard{background-size:cover}}
/* The heading receives reading focus after opening without a decorative box. */
#invitation-heading:focus{outline:none}

/* Scrolling through successive palace thresholds. Native scrolling stays in control. */
.journey-light{position:absolute;inset:0;pointer-events:none;opacity:.32;background:conic-gradient(from var(--light-angle,-30deg) at 50% -25%,transparent 0deg,#fff5ca55 24deg,transparent 48deg,transparent 315deg,#f4c87838 340deg,transparent 360deg);mix-blend-mode:soft-light}
.journey-portal{position:absolute;inset:3% 3% 0;width:94%;height:100%;fill:none;stroke:#b98d48;stroke-width:1;opacity:var(--portal-opacity,0);transform:perspective(1000px) translateZ(30px) scale(var(--portal-scale,.82));transform-origin:50% 45%;filter:drop-shadow(0 0 9px #ffe5a9);pointer-events:none}
.journey-portal path+path{stroke:#fff0bf;stroke-width:2;opacity:.65}
.motion-active .immersive-invitation .journey-chapter:not(.palace-journey){transform:perspective(1400px) translateY(var(--chapter-lift,0px)) rotateX(var(--chapter-tilt,0deg)) scale(var(--chapter-scale,1));transform-origin:50% 0;will-change:transform}
.motion-active .journey-chapter>.royal-card-frame{filter:drop-shadow(0 15px 20px #51311d28)}
.motion-active .journey-chapter:focus-within{transform:none!important}
.motion-active .royal-invitation{transform:translate3d(0,var(--names-y,0px),25px) rotateX(var(--hero-turn,0deg)) scale(var(--invitation-depth,1));opacity:var(--invitation-opacity,1);transform-origin:50% 28%}
.motion-active .event.depth-reveal,.motion-active .event.depth-reveal.in-view{transform:perspective(1000px) translate3d(var(--card-x,0px),var(--card-y,0px),0) rotateY(var(--card-turn,0deg)) rotateZ(var(--card-roll,0deg)) scale(var(--card-scale,1));opacity:1;transition:none;transform-origin:50% 65%;will-change:transform}
.motion-active .event:focus-within{transform:none!important}
.motion-active .day-heading{background:linear-gradient(110deg,transparent 25%,#ecc48235 48%,transparent 72%) var(--foil-position,-50%) 0/200% 100%,linear-gradient(115deg,#641c31,#87344a)}
.chapter-nav:after{content:'';display:block;position:absolute;left:12px;right:12px;bottom:2px;height:2px;background:#b38b47;transform:scaleX(var(--journey-progress,0));transform-origin:left center;pointer-events:none;border-radius:2px}
@media(max-width:700px){.motion-active .immersive-invitation .journey-chapter:not(.palace-journey){transform:perspective(1100px) translateY(var(--chapter-lift,0px)) rotateX(var(--chapter-tilt,0deg)) scale(var(--chapter-scale,1))}.journey-portal{inset:1% 2% 0;width:96%;stroke-width:.8}.motion-active .royal-invitation{transform:translateY(var(--names-y,0px)) rotateX(var(--hero-turn,0deg)) scale(var(--invitation-depth,1))}}
.motion-off .journey-portal,.data-saving .journey-portal,.motion-off .journey-light,.data-saving .journey-light{display:none}
.motion-off .royal-invitation{opacity:1!important}
@media(prefers-reduced-motion:reduce){.journey-portal,.journey-light{display:none}.royal-invitation{opacity:1!important}.chapter-nav:after{transform:none;display:none}.event.depth-reveal{transform:none!important;transition:none!important}}
@media print{.journey-portal,.journey-light{display:none}.royal-invitation{opacity:1!important}}

/* Release the opening scene as the next chapter arrives, without an empty hold. */
.motion-active .immersive-invitation .palace-journey{height:130svh}
@media print{.event.depth-reveal{transform:none!important}}
