/* The threshold: separate surfaces, physical door hinges and foreground paper. */
.cinematic-entrance{position:relative;isolation:isolate;perspective:1600px;min-height:calc(100svh - 76px);background:#30221b;overflow:hidden;--look-x:0deg;--look-y:0deg;padding-top:60px;padding-bottom:38px}
.cinematic-entrance .entrance-world{position:absolute;inset:0;z-index:-1;pointer-events:none;perspective:1600px;background:#3c2d21;overflow:hidden}
.entrance-courtyard{position:absolute;inset:-2%;background:url('/palace-scene.jpg') center/cover no-repeat;transform:translateZ(-160px) scale(1.17);filter:brightness(.78);opacity:.8;transition:filter 1.8s ease,opacity 1.8s ease}
.threshold-light{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 38%,#ffe1a17a,transparent 60%);opacity:.3}
.threshold-architecture{position:absolute;inset:30px max(5%,calc((100vw - 1120px)/2)) -20px;transform-style:preserve-3d;transform:rotateY(var(--look-x)) rotateX(var(--look-y));transition:transform .35s ease-out;will-change:transform}
.portal-vault{position:absolute;inset:-18px -27px 0;border:24px solid #b99b66;border-bottom:0;border-radius:48% 48% 0 0;box-shadow:inset 0 0 0 3px #f1dab0,0 0 0 3px #805c32,inset 0 0 0 12px #94703e,0 0 0 12px #e3c995,0 6px 25px #1c110d7a;pointer-events:none;transform:translateZ(26px)}
.portal-vault:before{content:'';position:absolute;inset:16px;border:2px solid #d6b476;border-bottom:0;border-radius:48% 48% 0 0}
.portal-column{position:absolute;top:27%;bottom:-20px;width:55px;background:linear-gradient(90deg,#70502f,#d5bb88 25%,#f1dcb1 48%,#b79a62 75%,#654628);border:1px solid #d8bd83;transform:translateZ(48px);box-shadow:8px 5px 18px #2e180e55;z-index:3}
.column-left{left:-45px}.column-right{right:-45px;box-shadow:-8px 5px 18px #2e180e55}
.portal-column:before,.portal-column:after{content:'';position:absolute;left:-9px;right:-9px;height:28px;background:linear-gradient(#dbc292,#8a6738 20%,#c4a570 40%,#ead1a0 65%,#8b6839);border:1px solid #aa874f}.portal-column:before{top:0}.portal-column:after{bottom:18px}
.portal-column i{display:block;position:absolute;top:45px;bottom:55px;width:1px;background:#6f502c;opacity:.55;left:25%}.portal-column i:nth-child(2){left:50%;background:#ffe5ae}.portal-column i:nth-child(3){left:75%}
.palace-doors{position:absolute;inset:0;transform-style:preserve-3d;perspective:1400px}
.palace-door{position:absolute;top:0;bottom:0;width:50%;background:repeating-linear-gradient(90deg,#4f292100 0 4px,#e7b66c05 4px 5px),linear-gradient(100deg,#4b2821,#703e2a 35%,#4c241f 78%,#362018);border:2px solid #a68045;box-shadow:inset 0 0 0 7px #4a271e,inset 0 0 0 9px #b29258,inset 0 0 50px #100b075e;backface-visibility:visible;transform-style:preserve-3d;will-change:transform}
.door-left{left:0;border-radius:100% 0 0 0 / 38% 0 0 0;transform-origin:0 50%;transform:rotateY(0)}
.door-right{right:0;border-radius:0 100% 0 0 / 0 38% 0 0;transform-origin:100% 50%;transform:rotateY(0);background-color:#4b2821}
.door-carving{position:absolute;inset:17% 12% 8%;border:1px solid #bc975a;border-radius:48% 48% 5px 5px;box-shadow:inset 0 0 0 6px #3f231d,inset 0 0 0 7px #8d6d3b,inset 0 0 0 15px #573424;overflow:hidden;background:linear-gradient(#5b3023a0,#36201b66)}
.door-medallion{position:absolute;width:min(60%,180px);aspect-ratio:1;top:11%;left:50%;transform:translateX(-50%);color:#c4a165;opacity:.75}.door-medallion svg{width:100%;height:100%;filter:drop-shadow(0 2px 1px #27140d)}
.door-jali{position:absolute;left:15%;right:15%;bottom:12%;height:33%;border:3px double #ad884e;opacity:.6;background:repeating-linear-gradient(45deg,transparent 0 14px,#b9955b88 14px 15px,transparent 15px 28px),repeating-linear-gradient(-45deg,transparent 0 14px,#b9955b88 14px 15px,transparent 15px 28px);box-shadow:inset 0 0 14px #0d0908}
.door-knocker{position:absolute;top:48%;width:24px;height:34px;border:5px solid #b39151;border-radius:50%;box-shadow:0 4px 5px #180f0a,inset 0 0 0 1px #ecd59b;transform:translateZ(8px)}.door-left .door-knocker{right:7%}.door-right .door-knocker{left:7%}
.door-knocker:before{content:'';position:absolute;width:12px;height:12px;top:-14px;left:1px;background:radial-gradient(at 30% 30%,#e7cd8b,#94672e);border-radius:50%;border:1px solid #caa667}
.door-edge{position:absolute;top:0;bottom:0;width:14px;background:linear-gradient(90deg,#3d211b,#ad8246 48%,#49281c);transform:rotateY(90deg);transform-origin:left}
.door-left .door-edge{right:-14px}.door-right .door-edge{left:0}
.door-seam{position:absolute;left:calc(50% - 1px);top:0;bottom:0;width:2px;background:#f4c779;box-shadow:0 0 16px 4px #e8b66336;transition:opacity .3s}
.portal-step{position:absolute;bottom:0;left:-50px;right:-50px;height:25px;background:linear-gradient(#e2cda5,#968166 25%,#e7d1ad 45%,#af9674 70%,#dfc9a6);border-top:1px solid #f9e5b4;transform:translateZ(60px)}
.entrance-lantern{position:absolute;top:5%;width:65px;height:180px;filter:drop-shadow(0 0 15px #ffbd5c88);transform-origin:top center;transform:translateZ(80px) rotateZ(-2deg)}
.entrance-lantern svg{width:100%;height:100%}.lantern-left{left:5%}.lantern-right{right:5%;transform:translateZ(80px) rotateZ(2deg)}
.entrance-vignette{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 47%,transparent 25%,#1b110d63 100%);pointer-events:none}
.threshold-dust{position:absolute;inset:0;transform:translateZ(110px);pointer-events:none}.mote{position:absolute;width:3px;height:3px;background:#f8d79b;border-radius:50%;box-shadow:0 0 7px #f5cb7a;opacity:.45}.mote-0{left:15%;top:25%}.mote-1{left:23%;top:65%}.mote-2{left:70%;top:22%}.mote-3{left:82%;top:53%}.mote-4{left:35%;top:14%}.mote-5{left:75%;top:72%}.mote-6{left:9%;top:81%}.mote-7{left:88%;top:85%}.mote-8{left:63%;top:88%}.mote-9{left:45%;top:91%}.mote-10{left:27%;top:37%}.mote-11{left:91%;top:32%}
.cinematic-entrance:after{display:none}
.cinematic-entrance>.eyebrow{position:relative;z-index:3;background:none;color:#efd5a3;padding:0;text-shadow:0 2px 9px #1a0e08;box-shadow:none;letter-spacing:.25em;margin-bottom:44px;font-size:.65rem}
.cinematic-entrance .envelope{transform:translateZ(100px) rotateX(8deg) rotateY(calc(-5deg + var(--look-x)));filter:drop-shadow(0 28px 22px #140b0888);transition:transform .45s ease-out;flex-shrink:0}
.cinematic-entrance .envelope-back{box-shadow:0 3px 0 #431628,0 6px 0 #7e3948,0 8px 0 #3d1724;border-color:#ad7e67}
.cinematic-entrance .envelope-pocket{background:radial-gradient(ellipse at 25% 15%,#923d50,#692139 65%,#4e182c);box-shadow:inset 0 0 35px #220b1c44}
.cinematic-entrance .envelope-pocket:after{inset:15px;border:1px solid #cda76a;box-shadow:inset 0 0 0 5px #7e354633,inset 0 0 0 6px #bc925d55}
.cinematic-entrance .seal{background:radial-gradient(circle at 35% 25%,#edcf87,#bd904a 50%,#987032);border:5px double #ebcd8a;color:#694626;box-shadow:0 5px 8px #250d1e77,inset 0 0 0 2px #8d652c;transform:translateZ(20px)}
.cinematic-entrance>#open{position:relative;z-index:4;background:linear-gradient(135deg,#e4c58b,#bf9552);color:#4d291f;border:1px solid #f1d59c;box-shadow:0 7px 18px #170d0a55,inset 0 0 0 4px #b48c4b33;min-width:230px;transition:opacity .3s}
.cinematic-entrance>#opening-status{position:relative;z-index:4;min-height:20px;color:#f7deae;font-size:.75rem;text-shadow:0 1px 4px #21100b}
.cinematic-entrance .envelope-foot{position:relative;color:#d9c197;background:none;font-size:.8rem;margin-top:18px;padding:0;text-shadow:0 1px 5px #1b0c08}
.portal-opening .envelope{animation:invitation-lift 1.45s cubic-bezier(.3,.05,.3,1) .62s forwards}
.portal-opening .envelope .seal{animation:seal-release .5s cubic-bezier(.25,.1,.3,1) forwards}
.portal-opening .envelope .envelope-flap{transition:transform .5s .2s,opacity .4s .5s;transform:rotateX(180deg);opacity:0}
.portal-opening .envelope .envelope-card{transition:transform .75s .28s,opacity .4s;transform:translateY(-95px);z-index:4}
.portal-opening .door-left{animation:open-left-door 1.6s cubic-bezier(.22,.61,.32,1) .85s forwards}
.portal-opening .door-right{animation:open-right-door 1.6s cubic-bezier(.22,.61,.32,1) .85s forwards}
.portal-opening .door-seam{opacity:0;transition-delay:.85s}
.portal-opening .entrance-courtyard{filter:brightness(1);opacity:1;animation:courtyard-forward 2s cubic-bezier(.2,.6,.3,1) .75s forwards}
.portal-opening .threshold-light{animation:threshold-bloom 1.9s .85s both}
.portal-opening .entrance-vignette{opacity:0;transition:opacity 1.8s .9s}
.portal-opening .threshold-architecture{animation:enter-portal 1.9s cubic-bezier(.2,.65,.3,1) .85s forwards}
.portal-opening .entrance-lantern{animation:lantern-pass 1.8s .9s forwards}
.portal-opening .threshold-dust{animation:dust-pass 2s .7s forwards}
.portal-opening>#open,.portal-opening>.eyebrow,.portal-opening .envelope-foot{opacity:0;transition:opacity .4s .25s;pointer-events:none}
.portal-opening>#opening-status{position:absolute;bottom:85px;left:15px;right:15px;margin:0;color:#fff4d9;text-shadow:0 1px 5px #27160c}
@keyframes seal-release{to{transform:translateZ(110px) translateY(-25px) rotateZ(-18deg) scale(1.15);opacity:0}}
@keyframes invitation-lift{20%{transform:translateZ(120px) rotateX(0deg) rotateY(0deg)}70%{opacity:1}100%{transform:translateZ(380px) translateY(48%) rotateX(-28deg) rotateY(0deg) scale(1.22);opacity:0}}
@keyframes open-left-door{to{transform:rotateY(-108deg)}}
@keyframes open-right-door{to{transform:rotateY(108deg)}}
@keyframes courtyard-forward{to{transform:translateZ(10px) scale(1.04)}}
@keyframes enter-portal{to{transform:translateZ(280px) scale(1.23)}}
@keyframes threshold-bloom{0%{opacity:.3}45%{opacity:.95}100%{opacity:.15}}
@keyframes lantern-pass{to{transform:translateZ(240px) scale(1.15);opacity:0}}
@keyframes dust-pass{to{transform:translateZ(280px) scale(1.5);opacity:0}}
/* Staggered live text after the threshold clears, once per deliberate opening. */
/* The crest arrives first; the invitation follows only after it has landed. */
.arrival-reveal .hero-monogram{transform-origin:50% 50%;backface-visibility:visible;animation:hero-crest-flight 1.7s cubic-bezier(.2,.7,.25,1) .5s both}
.arrival-reveal .scene-kicker,.arrival-reveal .royal-invitation>.royal-flourish,.arrival-reveal .scene-invite-label,.arrival-reveal .royal-invitation h1 span,.arrival-reveal .royal-invitation h1 em,.arrival-reveal .scene-message,.arrival-reveal .scene-date,.arrival-reveal .scene-place,.arrival-reveal .scene-rsvp,.arrival-reveal .scene-scroll,.arrival-reveal .scene-caption{animation:arrival-text 1s cubic-bezier(.16,1,.3,1) both}
.arrival-reveal .scene-kicker{animation-delay:2.25s}
.arrival-reveal .scene-invite-label{animation-delay:2.4s}
.arrival-reveal .royal-invitation h1 span:first-child{animation-delay:2.55s}
.arrival-reveal .royal-invitation h1 em{animation-delay:2.7s}
.arrival-reveal .royal-invitation h1 span:last-child{animation-delay:2.85s}
.arrival-reveal .scene-message{animation-delay:3s}
.arrival-reveal .scene-date{animation-delay:3.15s}
.arrival-reveal .scene-place,.arrival-reveal .royal-invitation>.royal-flourish{animation-delay:3.25s}
.arrival-reveal .scene-rsvp,.arrival-reveal .scene-scroll,.arrival-reveal .scene-caption{animation-delay:3.4s}
.arrival-reveal .chapter-nav{animation:hero-navigation-reveal .8s ease 3.35s both}
@keyframes hero-crest-flight{
  0%{opacity:0;transform:perspective(900px) translate3d(0,var(--crest-start-y,0px),0) rotateY(0deg) scale(2.4);filter:drop-shadow(0 18px 12px #70462244)}
  12%{opacity:1;transform:perspective(900px) translate3d(0,var(--crest-start-y,0px),0) rotateY(0deg) scale(2.4)}
  80%{opacity:1;transform:perspective(900px) translate3d(0,-4px,0) rotateY(360deg) scale(1.04);filter:drop-shadow(0 3px 2px #70462222)}
  100%{opacity:1;transform:perspective(900px) translate3d(0,0,0) rotateY(360deg) scale(1);filter:drop-shadow(0 1px 0 #fff4d1)}
}
@keyframes hero-navigation-reveal{from{opacity:0}to{opacity:1}}
@keyframes arrival-text{from{opacity:0;translate:0 20px;filter:blur(5px)}to{opacity:1;translate:0 0;filter:blur(0)}}
@media(max-width:700px){.cinematic-entrance{min-height:calc(100svh - 121px);padding:55px 20px 35px}.threshold-architecture{inset:38px 29px -15px}.portal-vault{inset:-12px -15px 0;border-width:15px;box-shadow:inset 0 0 0 2px #f1dab0,0 0 0 2px #805c32,inset 0 0 0 7px #94703e,0 0 0 7px #dec18c,0 5px 15px #1c110d7a;border-radius:48% 48% 0 0}.portal-vault:before{inset:9px;border-width:1px}.portal-column{width:27px;top:21%}.column-left{left:-22px}.column-right{right:-22px}.portal-column:before,.portal-column:after{left:-5px;right:-5px;height:20px}.palace-door{box-shadow:inset 0 0 0 4px #4a271e,inset 0 0 0 5px #b29258,inset 0 0 25px #100b075e}.door-carving{inset:17% 10% 8%;box-shadow:inset 0 0 0 3px #3f231d,inset 0 0 0 4px #8d6d3b,inset 0 0 0 8px #573424}.door-medallion{width:72%;top:9%}.door-jali{left:13%;right:13%;height:32%;background-size:auto}.door-knocker{width:15px;height:23px;border-width:3px}.door-knocker:before{width:8px;height:8px;left:0;top:-10px}.entrance-lantern{top:6%;width:36px;height:125px}.lantern-left{left:2px}.lantern-right{right:2px}.cinematic-entrance>.eyebrow{font-size:.54rem;letter-spacing:.18em;margin-bottom:35px;max-width:210px;line-height:1.9}.cinematic-entrance .envelope{width:min(390px,82vw);height:300px;transform:translateZ(50px) rotateX(6deg) rotateY(-4deg);margin-bottom:28px}.cinematic-entrance>#open{min-width:220px;min-height:50px;font-size:.8rem}.cinematic-entrance .envelope-foot{font-size:.73rem;max-width:230px;margin-top:13px}.cinematic-entrance>#opening-status{font-size:.7rem}.portal-opening>#opening-status{bottom:80px}.door-left{border-radius:100% 0 0 0 / 24% 0 0 0}.door-right{border-radius:0 100% 0 0 / 0 24% 0 0}.portal-step{left:-28px;right:-28px;height:22px}}
@media(max-width:360px){.cinematic-entrance{padding-top:48px;padding-bottom:27px}.cinematic-entrance .envelope{height:270px;width:82vw}.cinematic-entrance>.eyebrow{margin-bottom:30px}.cinematic-entrance .envelope-foot{font-size:.68rem}}
@media(prefers-reduced-motion:reduce){.cinematic-entrance .threshold-architecture,.cinematic-entrance .envelope{transform:none!important;transition:none!important}.arrival-reveal *{animation:none!important;filter:none!important}.cinematic-entrance .mote{display:none}}
.data-saving .entrance-courtyard{background-image:linear-gradient(#e4c999,#fff2d7)}
.arrival-reveal .world-backdrop .scene-camera{animation:arrival-courtyard 1.7s cubic-bezier(.16,1,.3,1) both}
@keyframes arrival-courtyard{from{transform:scale(1.12);filter:brightness(1.18)}to{transform:translateX(var(--world-pan)) scale(var(--camera-scale)) rotateX(var(--camera-tilt));filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.arrival-reveal .world-backdrop .scene-camera{animation:none!important}}
.cinematic-entrance.portal-opening{height:var(--entrance-height);min-height:var(--entrance-height)}


.cinematic-entrance.portal-opening .seal{opacity:1}

/* Gilded stationery and carved rosewood at the palace threshold. */
.cinematic-entrance{padding-top:95px;padding-bottom:55px;min-height:calc(100svh - 76px)}
.entrance-courtyard{filter:brightness(.9);opacity:.95}
.palace-door{background:repeating-linear-gradient(92deg,transparent 0 3px,#eabb6b06 3px 4px),radial-gradient(ellipse at 40% 25%,#754431,#361b19 74%);border-color:#c3a063;box-shadow:inset 0 0 0 5px #2b1713,inset 0 0 0 6px #d3b477,inset 0 0 0 11px #6b442c,inset 0 0 0 12px #95713c,inset 0 0 45px #12080680}
.door-carving{inset:15% 9% 6%;border-color:#c49b5c;background:radial-gradient(ellipse at 50% 25%,#97633a30,transparent 70%)}
.door-medallion{top:8%;width:62%;opacity:.85}
.door-jali{height:40%;bottom:7%;opacity:.4;background-size:40px 40px}
.door-inlay{position:absolute;inset:4% 6%;width:88%;height:92%;color:#ddb573;opacity:.55;filter:drop-shadow(0 1px 1px #150804)}
.portal-crown{position:absolute;top:-21px;left:calc(50% - 29px);width:58px;height:58px;color:#f1d39a;z-index:4;transform:translateZ(35px);filter:drop-shadow(0 3px 2px #351b0a)}
.portal-crown svg{width:100%;height:100%;background:radial-gradient(circle,#8b6538,#b79760 65%,transparent 66%);border-radius:50%}
.entrance-heading{position:relative;z-index:3;color:#fff;text-shadow:0 2px 12px #150803;margin-bottom:22px}
.entrance-overline{font-size:.55rem;text-transform:uppercase;letter-spacing:.24em;font-weight:400}
.entrance-heading p{font-family:var(--serif);font-size:clamp(1.8rem,3.8vw,2.7rem);font-style:italic;margin:7px 0 8px;line-height:1.2}
.entrance-heading-rule{display:flex;align-items:center;justify-content:center;gap:13px;color:#fff;font-size:1rem}
.entrance-heading-rule:before,.entrance-heading-rule:after{content:'';width:65px;height:1px;background:linear-gradient(90deg,transparent,#d3ad6c)}
.entrance-heading-rule:after{transform:rotate(180deg)}
.cinematic-entrance .envelope{width:min(460px,76vw);height:315px;margin-top:17px;margin-bottom:35px}
.cinematic-entrance .envelope-back{border-radius:8px;background:#461126;box-shadow:0 2px 0 #c29860,0 5px 0 #421629,0 7px 0 #a36c55,0 10px 0 #30111c}
.cinematic-entrance .envelope-pocket{border:1px solid #c49b62;border-radius:5px;background:repeating-linear-gradient(35deg,transparent 0 2px,#e69f7d04 2px 3px),radial-gradient(ellipse at 30% 5%,#8f344b,#551329 85%);box-shadow:inset 0 0 0 4px #471426,inset 0 0 0 5px #bf9560,inset 0 0 0 9px #56172d,inset 0 0 0 10px #c89d6150,inset 0 0 45px #21081555}
.cinematic-entrance .envelope-pocket:before{display:none}.cinematic-entrance .envelope-pocket:after{display:none}
.cinematic-entrance .envelope-flap{height:59%;background:repeating-linear-gradient(35deg,transparent 0 2px,#e69f7d05 2px 3px),linear-gradient(155deg,#9c4a5c,#64182f 80%);filter:drop-shadow(0 2px 0 #ddb674) drop-shadow(0 5px 5px #230b1e88)}
.cinematic-entrance .envelope-card{inset:-10px 22px 30px;background:#fff9e9;box-shadow:0 0 0 4px #fff9e9,0 0 0 5px #c8a572;transform:rotate(-1.5deg)}
.envelope-finery{position:absolute;inset:13px;color:#d4b078;pointer-events:none}
.foil-corner{position:absolute;width:85px;height:75px;filter:drop-shadow(0 1px 0 #260c16)}
.foil-tl{top:0;left:0}.foil-tr{top:0;right:0;transform:scaleX(-1)}.foil-bl{bottom:0;left:0;transform:scaleY(-1)}.foil-br{bottom:0;right:0;transform:scale(-1)}
.envelope-dedication{position:absolute;bottom:40px;left:0;right:0;font-family:var(--serif);font-size:1.45rem;letter-spacing:.025em;text-shadow:0 1px 1px #270b18}
.envelope-dedication i{font-size:.75em;margin:0 5px}
.envelope-date{position:absolute;bottom:24px;left:0;right:0;font-size:.45rem;letter-spacing:.28em}
.cinematic-entrance .seal{width:90px;height:90px;left:calc(50% - 45px);top:calc(59% - 30px);border:0;background:repeating-conic-gradient(#e6c57b 0deg 5deg,#967037 5deg 10deg);box-shadow:0 6px 7px #240b1b99;isolation:isolate}
.cinematic-entrance .seal:before{content:'';position:absolute;inset:4px;z-index:-1;border:2px solid #efcf87;border-radius:50%;background:radial-gradient(ellipse at 30% 20%,#f3d88e,#bf914c 60%,#8c622b);box-shadow:inset 0 0 0 2px #93662d,inset 0 0 0 4px #eccb81,inset 0 0 10px #805319}
.seal-engraving{position:absolute;inset:0;width:100%;height:100%;color:#785022;filter:drop-shadow(0 1px 0 #ffdfa3)}
.cinematic-entrance .seal .seal-letters{font-size:26px;letter-spacing:-3px;margin:0;color:#70471e;text-shadow:0 1px 0 #fce4a7;transform:translateY(-1px)}
.seal-letters i{font-size:15px;font-style:italic;vertical-align:middle;letter-spacing:0;margin:0 2px}
.cinematic-entrance>#open{min-height:54px;min-width:255px;border:1px solid #dfbd7d;border-radius:0;background:linear-gradient(115deg,#9b7137,#e6ca8b 25%,#f3dba1 48%,#c29955 85%,#a57b3d);box-shadow:0 9px 20px #170b0877,inset 0 0 0 4px #ac8548,inset 0 0 0 5px #efd29a;font-family:var(--serif);font-size:1rem;padding:12px 30px;color:#422818;letter-spacing:.025em;clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px)}
.cinematic-entrance .envelope-foot{max-width:290px;font-size:.85rem;line-height:1.7;color:#ebd6ac;margin-top:15px}
.portal-opening .entrance-heading{opacity:0;transition:opacity .4s .25s}
@media(max-width:700px){
 .cinematic-entrance{padding:90px 18px 40px;min-height:calc(100svh - 121px)}
 .entrance-heading{margin-bottom:24px}.entrance-heading p{font-size:1.9rem}.entrance-overline{font-size:.47rem;letter-spacing:.17em}
 .cinematic-entrance .envelope{width:min(350px,77vw);height:clamp(225px,58vw,268px);margin-top:9px;margin-bottom:35px}
 .cinematic-entrance .envelope-card{inset:-9px 16px 25px;padding:17px 12px}
 .cinematic-entrance .envelope-card h1{font-size:1.9rem}
 .cinematic-entrance .envelope-flap{height:57%}
 .cinematic-entrance .seal{width:76px;height:76px;left:calc(50% - 38px);top:calc(57% - 23px)}
 .cinematic-entrance .seal .seal-letters{font-size:23px}
 .foil-corner{width:62px;height:55px}.envelope-finery{inset:12px}
 .envelope-dedication{font-size:1.15rem;bottom:28px}.envelope-date{font-size:.36rem;bottom:15px;letter-spacing:.18em}
 .cinematic-entrance>#open{min-width:235px;min-height:52px;font-size:.93rem}
 .cinematic-entrance .envelope-foot{font-size:.75rem;max-width:245px;margin-top:15px}
 .portal-crown{width:44px;height:44px;left:calc(50% - 22px);top:-14px}
}
@media(max-width:360px){.cinematic-entrance{padding-top:83px}.entrance-heading p{font-size:1.65rem}.entrance-overline{font-size:.42rem}.envelope-dedication{font-size:1rem}.foil-corner{width:52px;height:46px}.cinematic-entrance .envelope{height:218px}.envelope-dedication{bottom:25px}.envelope-date{bottom:12px}.cinematic-entrance .envelope-foot{font-size:.7rem}}
/* Keep the seal above the dedication even on the narrowest stationery. */
@media(max-width:700px){.cinematic-entrance .envelope-flap{height:45%}.cinematic-entrance .seal{top:calc(45% - 27px)}}
@media(min-width:701px){.cinematic-entrance .envelope-flap{height:48%}.cinematic-entrance .seal{top:calc(48% - 25px)}}

/* One continuous pocket plane: opening must never snap its clipping or stack. */
.cinematic-entrance.portal-opening .envelope-pocket{clip-path:none}
.cinematic-entrance.portal-opening .envelope-card{z-index:1;transform:translateY(-72px) rotate(-1.5deg);transition:transform .8s .25s ease}
.cinematic-entrance.portal-opening .envelope-flap{backface-visibility:hidden}
/* The new page inherits the settled camera, without a second zoom reset. */
.arrival-reveal .world-backdrop .scene-camera{animation:none}
@media(max-width:600px){
 .entrance-courtyard{background-image:url('/palace-mobile.jpg');background-size:contain;background-position:center bottom;background-color:#f8e6c9;transform:none}
 .portal-opening .entrance-courtyard{animation:none}
}

/* A suspended, layered invitation object in front of the palace threshold. */
.cinematic-entrance{--spot-x:50%;perspective:1500px;background:#281914}
.invitation-display{position:relative;flex-shrink:0;transform-style:preserve-3d;perspective:1100px}
.invitation-float{position:relative;transform-style:preserve-3d;animation:stationery-float 9s ease-in-out infinite;will-change:transform}
.invitation-ground-shadow{position:absolute;left:9%;right:9%;bottom:15px;height:25px;background:radial-gradient(ellipse,#14090dcc,transparent 70%);border-radius:50%;filter:blur(9px);transform:translateZ(-40px) rotateX(58deg);pointer-events:none;animation:stationery-shadow 9s ease-in-out infinite}
.cinematic-entrance .envelope{filter:none;isolation:auto;transform-style:preserve-3d}
.cinematic-entrance:not(.portal-opening) .envelope{transform:translateZ(30px) rotateX(calc(11deg + var(--look-y))) rotateY(calc(-9deg + var(--look-x)))}
.cinematic-entrance .envelope:before{content:'';position:absolute;left:0;right:0;bottom:-7px;height:9px;background:linear-gradient(#b98c5d 0 1px,#4a142c 1px 4px,#b98c5d 4px 5px,#431327 5px);transform-origin:center top;transform:rotateX(-90deg);border-radius:0 0 4px 4px;pointer-events:none}
.cinematic-entrance .envelope:after{content:'';position:absolute;top:15px;bottom:0;left:-8px;width:9px;background:linear-gradient(90deg,#401026,#a36b59 45%,#4b162b);transform:rotateY(-90deg);transform-origin:right center;pointer-events:none}
.cinematic-entrance .envelope-back{transform:translateZ(-4px);box-shadow:0 2px 0 #d8ad6e,0 5px 0 #511b31,0 8px 0 #b57e5b,0 11px 0 #371222,0 23px 30px #17090b66}
.cinematic-entrance .envelope-card{transform:translateZ(3px) rotate(-1.5deg);background:repeating-linear-gradient(0deg,#fff7e900 0 2px,#bd9a6408 2px 3px),#fff9e9}
.cinematic-entrance .envelope-pocket{transform:translateZ(8px);background:repeating-linear-gradient(32deg,transparent 0 2px,#ffccab07 2px 3px),radial-gradient(ellipse at var(--spot-x) 15%,#953c55,#651d37 50%,#3e1026);box-shadow:inset 0 0 0 3px #361024,inset 0 0 0 4px #e0ba79,inset 0 0 0 7px #57182f,inset 0 0 0 8px #bc955c99,inset 0 -14px 30px #210a184d}
.cinematic-entrance .envelope-pocket:before{display:block;content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(115deg,transparent 15%,#f5bf9b13 40%,transparent 65%);transform:none;left:0;pointer-events:none;animation:velvet-light 12s ease-in-out infinite}
.cinematic-entrance:not(.portal-opening) .envelope-flap{transform:translateZ(12px);background:repeating-linear-gradient(32deg,transparent 0 2px,#f7bea507 2px 3px),linear-gradient(145deg,#a04b61,#64192f 80%)}
.flap-foil{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:#e2bf7a;stroke-width:.8;opacity:.7;pointer-events:none}
.cinematic-entrance .seal{transform:translateZ(39px) rotateZ(-7deg);width:100px;height:100px;left:calc(50% - 50px);top:calc(48% - 38px);box-shadow:1px 2px 0 #99672f,2px 4px 0 #684128,3px 6px 0 #a97b3b,4px 10px 9px #210a1cc4}
.cinematic-entrance .seal:after{content:'';position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,transparent 0deg,#fff4c380 38deg,transparent 65deg,transparent 220deg,#fff3ba60 250deg,transparent 280deg);mask:radial-gradient(circle,transparent 64%,#000 67%);-webkit-mask:radial-gradient(circle,transparent 64%,#000 67%);pointer-events:none;animation:seal-metal-light 12s linear infinite}
.cinematic-entrance .seal-logo{transform:translateZ(3px)}
.cinematic-entrance .entrance-heading{text-shadow:0 1px 0 #52361a,0 5px 17px #140708b0}
.cinematic-entrance .entrance-heading-rule{opacity:.7}
.cinematic-entrance>#open{background:linear-gradient(115deg,#a67837,#ebce8b 27%,#ffe8af 48%,#c69b52 83%,#977033);box-shadow:0 4px 0 #815a2c,0 7px 0 #b79050,0 14px 24px #180a0a85,inset 0 0 0 3px #a98447,inset 0 0 0 4px #ffe1a1;overflow:hidden;isolation:isolate}
.cinematic-entrance>#open:after{content:'';position:absolute;inset:-50% -100%;background:linear-gradient(110deg,transparent 44%,#fff9d580 49%,transparent 54%);transform:translateX(-50%);pointer-events:none;animation:invitation-button-glint 8s ease-in-out infinite}
.cinematic-entrance .envelope-foot{opacity:.82}
.palace-door{background:repeating-linear-gradient(91deg,transparent 0 3px,#d4a36305 3px 4px),radial-gradient(ellipse at var(--spot-x) 35%,#67402d,#311c1a 80%)}
.threshold-light{background:radial-gradient(ellipse at var(--spot-x) 40%,#ffe3a487,transparent 63%);opacity:.5}
.cinematic-entrance:not(.portal-opening) .entrance-lantern{animation:threshold-lantern-sway 8s ease-in-out infinite;filter:drop-shadow(0 0 12px #ffc45a80)}
.cinematic-entrance:not(.portal-opening) .lantern-right{animation-delay:-4s}
.entrance-petals{position:absolute;inset:0;z-index:5;overflow:hidden;perspective:900px;pointer-events:none;transition:opacity .4s}
.entrance-petal{position:absolute;top:-10%;left:7%;width:12px;height:18px;animation:threshold-petal-fall 29s linear infinite;animation-delay:-8s}
.entrance-petal i{display:block;width:100%;height:100%;background:radial-gradient(at 25% 20%,#e3a1a3,#a53b53 45%,#642037);border-radius:80% 15% 75% 25%;box-shadow:inset 1px 1px 2px #f9d1af55;animation:threshold-petal-turn 9s ease-in-out infinite alternate}
.entrance-petal-1{left:92%;width:9px;height:14px;animation-duration:34s;animation-delay:-23s;opacity:.6}.entrance-petal-2{left:14%;width:8px;height:13px;animation-duration:40s;animation-delay:-14s;opacity:.4}.entrance-petal-3{left:85%;animation-duration:31s;animation-delay:-4s}.entrance-petal-4{left:4%;animation-duration:37s;animation-delay:-28s;opacity:.5}.entrance-petal-5{left:96%;width:8px;height:12px;animation-duration:42s;animation-delay:-18s;opacity:.4}
@keyframes stationery-float{0%,100%{transform:translate3d(0,3px,0) rotateY(-1.5deg) rotateZ(-.4deg)}50%{transform:translate3d(0,-7px,12px) rotateY(2.5deg) rotateZ(.35deg)}}
@keyframes stationery-shadow{0%,100%{opacity:.65;scale:1}50%{opacity:.4;scale:.9}}
@keyframes velvet-light{0%,100%{opacity:.25;translate:-8% 0}50%{opacity:.9;translate:8% 0}}
@keyframes seal-metal-light{to{rotate:360deg}}
@keyframes invitation-button-glint{0%,65%{transform:translateX(-50%)}88%,100%{transform:translateX(50%)}}
@keyframes threshold-lantern-sway{0%,100%{rotate:-2deg}50%{rotate:2deg}}
@keyframes threshold-petal-fall{from{transform:translate3d(0,-5vh,0)}to{transform:translate3d(15px,120vh,40px)}}
@keyframes threshold-petal-turn{from{transform:rotateY(-30deg) rotateX(10deg) rotateZ(-25deg)}to{transform:rotateY(65deg) rotateX(45deg) rotateZ(40deg)}}
.portal-opening .invitation-float,.portal-opening .invitation-ground-shadow{animation-play-state:paused}
.cinematic-entrance.portal-opening .envelope{transform:var(--envelope-rest-pose);transition:none}
.portal-opening .invitation-ground-shadow,.portal-opening .entrance-petals{opacity:0;transition:opacity .5s}
.cinematic-entrance.portal-opening .envelope-card{transform:translateY(-72px) translateZ(3px) rotate(-1.5deg)}
.entrance-paused .invitation-float,.entrance-paused .invitation-ground-shadow,.entrance-paused .entrance-petal,.entrance-paused .entrance-petal i,.entrance-paused .entrance-lantern,.entrance-paused .seal:after,.entrance-paused .envelope-pocket:before,.entrance-paused>#open:after{animation-play-state:paused!important}
@media(max-width:700px){.cinematic-entrance .seal{width:84px;height:84px;left:calc(50% - 42px);top:calc(45% - 33px)}.cinematic-entrance:not(.portal-opening) .envelope{transform:translateZ(20px) rotateX(10deg) rotateY(-8deg)}.invitation-float{animation-duration:11s}.invitation-ground-shadow{animation-duration:11s}.entrance-petal{width:9px;height:14px}}
@media(max-width:600px){.cinematic-entrance .entrance-lantern{display:none}}
@media(prefers-reduced-motion:reduce){.invitation-float,.invitation-ground-shadow,.cinematic-entrance .seal:after,.cinematic-entrance>#open:after,.cinematic-entrance .envelope-pocket:before,.cinematic-entrance .entrance-lantern{animation:none!important}.invitation-float{transform:none!important}.entrance-petals{display:none}.cinematic-entrance .seal{transform:none}.invitation-ground-shadow{opacity:.35}}
.data-saving .invitation-float,.data-saving .invitation-ground-shadow,.data-saving .cinematic-entrance .seal:after,.data-saving .cinematic-entrance>#open:after,.data-saving .cinematic-entrance .envelope-pocket:before,.data-saving .cinematic-entrance .entrance-lantern{animation:none!important}
.data-saving .entrance-petals{display:none}

/* Additional slow petals around the opening stationery. */
.entrance-petal-6{left:18%;animation-duration:38s;animation-delay:-19s;opacity:.45}
.entrance-petal-7{left:80%;animation-duration:39s;animation-delay:-21s;opacity:.45}
.entrance-petal-8{left:9%;animation-duration:40s;animation-delay:-23s;opacity:.45}
.entrance-petal-9{left:92%;animation-duration:41s;animation-delay:-25s;opacity:.45}
.entrance-petal-10{left:32%;animation-duration:42s;animation-delay:-27s;opacity:.45}
.entrance-petal-11{left:66%;animation-duration:43s;animation-delay:-29s;opacity:.45}

/* A gentle invitation to scroll; dismissed for this opening after any scroll. */
.scene-scroll.scroll-prompt-bouncing>*{animation:scroll-invitation-bounce 1.8s ease-in-out infinite}
@keyframes scroll-invitation-bounce{0%,30%,60%,100%{transform:translateY(0)}15%{transform:translateY(-9px)}45%{transform:translateY(-4px)}}
.ambient-paused .scroll-prompt-bouncing>*{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.scene-scroll.scroll-prompt-bouncing>*{animation:none!important}}
