/* Continuous paper geometry reconstructed from the exact Reel's normalized
   trajectory. The artwork remains identical in every frame; only its physical
   plane and projected lighting move. These are not recovered source CSS values. */
.envelope{background:#f4e9e6;perspective:none;transition:opacity .25s linear}
.envelope-scene{position:absolute;inset:0;overflow:hidden;margin:auto;isolation:isolate}
.paper-base,.paper-front,.flap-paper{position:absolute;inset:0;background-image:url('assets/paper-material.webp');background-size:418px 418px;background-position:center top}
.paper-front-wrap{position:absolute;inset:0;filter:drop-shadow(-.45px -.65px .35px #fff6) drop-shadow(.7px -.65px .55px #805b4d66)}
.paper-front{clip-path:polygon(0 46%,50% 20%,100% 49%,100% 100%,0 100%);background-position:center -70px}
.flap-shadow-stage{position:absolute;inset:0;perspective:1200svh;filter:drop-shadow(1.1px 1.4px .7px #8d6a4960)}
.envelope-flap{position:absolute;inset:0;transform-origin:50% 0%;transform-style:preserve-3d;transform:rotateX(0deg)}
.flap-paper{clip-path:polygon(0 0,100% 0,100% 27.3%,88% 32.7%,75% 38.2%,63% 43.1%,54% 46.7%,50% 48.3%,48% 48.8%,46% 48.5%,42% 47%,33% 43.2%,22% 38.6%,10% 33.6%,0 29.5%)}
.seal-anchor{position:absolute;left:48%;top:50%;width:35%;height:auto;aspect-ratio:1;transform:translate(-50%,-50%);transform-style:preserve-3d}
.wax-image{display:block;width:100%;height:100%;object-fit:contain;transform-origin:50% 50%;filter:drop-shadow(.7px 1.4px 1px #9c74432a)}
.asset-preload{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.envelope.opening .envelope-scene{animation:cover-dismiss 3.15s linear both}
.envelope.opening .envelope-flap{animation:flap-hinge 3.15s linear both}
.envelope.opening .wax-image{animation:seal-follow-curl 3.15s linear both}
.envelope.opening .flap-shadow-stage{animation:flap-light 3.15s linear both}
.envelope.opening .open-invitation{opacity:0;pointer-events:none}
.envelope.opening #skip{opacity:1;pointer-events:auto}
.open-label{bottom:7%;font-size:12px;font-weight:400;letter-spacing:.17em;color:#5e5154}
.envelope #skip{bottom:12px;font-size:12px;color:#5e5154;padding:8px 12px}
body.sealed:not(.unfolding) .language{opacity:0;pointer-events:none}
@keyframes flap-hinge{0%,22.2%{transform:rotateX(0deg)}90.5%{transform:rotateX(36deg)}100%{transform:rotateX(40deg)}}
/* Slight local counter-rotation models the curled paper/rigid wax attachment:
   the seal rides the same hinge but does not become a flattened ellipse. */
@keyframes seal-follow-curl{0%,22.2%{transform:rotateX(0deg)}90.5%{transform:rotateX(-25deg)}100%{transform:rotateX(-28deg)}}
@keyframes flap-light{
  0%,22.2%{filter:drop-shadow(1.1px 1.4px .7px #8d6a4960)}
  48%{filter:drop-shadow(1px 2px 1px #976b3c50) drop-shadow(5px 3px 3px #b5824c25)}
  70%{filter:drop-shadow(2px 4px 2px #9b682d60) drop-shadow(18px 10px 7px #b5783860)}
  90.5%,100%{filter:drop-shadow(3px 5px 2px #a06a2865) drop-shadow(40px 22px 14px #b97b35ad)}
}
@keyframes cover-dismiss{0%,90.5%{opacity:1}100%{opacity:0}}
@media(min-width:800px){.envelope-scene{width:48svh;max-width:100%}.envelope{background:#f4e9e6}}
@media(prefers-reduced-motion:reduce){.envelope-scene,.envelope-flap,.wax-image,.flap-shadow-stage{animation:none!important}.envelope{transition:none}}
/* Source-ordered hero planes: paper, soft botanical depth, crisp lower/upper
   foreground, then independently focused names and final details. */
.hero{background:#f5f2eb url('assets/hero-paper.webp') center top/418px 418px;min-height:100svh;height:100svh;display:block}
.hero-art,.opened .hero-art{position:absolute;inset:0;background:none;opacity:1;transform:none;transition:none}
.hero-art-frame{position:relative;width:100%;height:100%;margin:auto;overflow:hidden}
.botanical-shadows{position:absolute;inset:0;opacity:0;filter:blur(8px);pointer-events:none}
.shadow-top{position:absolute;top:0;left:0;width:100%;height:auto;transform-origin:left top;transform:translate(30%,-2%) scale(1.7);opacity:.32}
.shadow-bottom{position:absolute;bottom:0;left:0;width:100%;height:44%;transform-origin:right bottom;transform:translate(-26%,-8%) scale(1.5);opacity:.36}
.flowers-top,.flowers-bottom{position:absolute;left:0;width:100%;pointer-events:none;opacity:0}
.flowers-top{top:0;height:100%}.flowers-top img{position:absolute;top:0;left:0;width:100%;height:auto}.flower-top-left{clip-path:inset(0 50% 0 0)}.flower-top-right{clip-path:inset(0 0 0 50%)}
.flowers-bottom{bottom:0;height:40%}.flowers-bottom img{position:absolute;top:0;width:100%;height:100%;object-fit:fill}.flower-half-left{left:-5%;clip-path:inset(0 50% 0 0)}.flower-half-right{left:10%;clip-path:inset(0 0 0 50%)}
.opened .botanical-shadows{animation:hero-depth 1.4s ease .5s both}
.opened .flowers-bottom{animation:flower-reveal 1s ease 1.4s both}
.opened .flowers-top{animation:flower-reveal 1s ease 1.9s both}
.hero-copy{position:absolute;left:50%;top:27.6%;width:min(100%,620px);padding:0 18px;transform:translateX(-50%);text-align:center}
.hero .eyebrow{font-size:12px;line-height:2;letter-spacing:.22em}
.hero h1{font-size:56px;line-height:1.13;margin:28px 0 16px;font-style:italic}
.hero h1 small{font-size:30px;line-height:1.45;font-weight:400}
.hero .ornament{height:12px;margin:24px 0 20px;gap:14px;color:#8f9688}
.hero .ornament span{width:55px;background:#a7afa0}
.three-dots{font-size:17px;font-weight:400;letter-spacing:3px;line-height:1;transform:translateX(1.5px)}
.hero-date{font:20px/1.3 var(--serif);letter-spacing:.09em;margin:18px 0 12px;color:#4e5c4d}
.hero-venue{font-size:10px;line-height:1.7;letter-spacing:.18em;max-width:210px;margin:auto;color:#4e5c4d}
html[lang=th] .hero-venue{font-size:12px;line-height:1.7;letter-spacing:.04em}
.invite-line,.name-line,.name-amp,.hero-details{opacity:0}
.opened .invite-line{animation:copy-reveal .8s ease 1.9s both}
.opened .name-first{animation:focus-reveal .75s ease 2.4s both}
.opened .name-amp{animation:copy-reveal .6s ease 3s both}
.opened .name-second{animation:focus-reveal .75s ease 3.4s both}
.opened .hero-divider{animation:copy-reveal .75s ease 4.3s both}
.opened .hero-date{animation:copy-reveal .75s ease 4.45s both}
.opened .hero-venue{animation:copy-reveal .75s ease 4.6s both}
.scroll-cue{transition:opacity 1s ease 5.5s}
@keyframes hero-depth{from{opacity:0}to{opacity:1}}
@keyframes flower-reveal{from{opacity:0}to{opacity:.86}}
@keyframes copy-reveal{from{opacity:0}to{opacity:1}}
@keyframes focus-reveal{from{opacity:0;filter:blur(7px)}to{opacity:1;filter:none}}
@media(min-width:800px){.hero{min-height:740px}.hero-art-frame{width:48svh;max-width:100%}.hero-copy{width:48svh;max-width:100%;transform:translateX(-50%);padding:0 16px;top:27.6%}.hero h1{font-size:52px}}
@media(max-width:380px){.hero-copy{top:27%;transform:translateX(-50%);padding:0 14px}.hero h1{font-size:48px;margin-top:23px}.hero h1 small{font-size:26px}.hero-date{font-size:18px}.hero-venue{font-size:9px}html[lang=th] .hero-venue{font-size:11px}}
@media(prefers-reduced-motion:reduce){.botanical-shadows,.flowers-top,.flowers-bottom,.invite-line,.name-line,.name-amp,.hero-details{animation:none!important;filter:none;opacity:1}.botanical-shadows{filter:blur(8px);opacity:1}.flowers-top,.flowers-bottom{opacity:.86}.scroll-cue{opacity:1;transition:none}}

.hero:before{content:"";position:absolute;inset:0;background:#e7e7dd;opacity:.16;pointer-events:none}


/* Preserve a clear reading area with longer bilingual venue copy. On wide
   screens botanical edges meet the viewport, never float as cropped fragments. */
@media(max-width:380px){
  .flower-half-left{left:-12%}.flower-half-right{left:20%}
  .hero-venue{max-width:180px}.flowers-bottom{height:37%}
}
@media(min-width:800px){
  .hero-art-frame{width:100%;max-width:none}
  .flowers-top .flower-top-left{left:0;width:400px}
  .flowers-top .flower-top-right{left:auto;right:0;width:400px}
  .flowers-bottom{height:40%}
  .flowers-bottom .flower-half-left{left:0;width:400px}
  .flowers-bottom .flower-half-right{left:auto;right:0;width:400px}
  .botanical-shadows{left:50%;right:auto;width:440px;transform:translateX(-50%)}
  .hero-copy{width:420px}
}
/* Emil-style touch safeguards: preserve zoom and use readable form controls. */
@media(pointer:coarse){
  input:not([type=radio]),textarea{font-size:16px;min-height:44px}
  .language{top:12px;padding:0 8px;gap:4px}
  .language button{min-width:44px;min-height:44px}
  .stepper button,#minus,#plus{min-width:44px;min-height:44px}
  .choice{min-height:44px;align-items:center;margin:4px 0}
  .outline,.submit,#replay,#skip{min-height:44px}
  .text-link{min-height:44px;display:inline-flex;align-items:center}
  .open-label{bottom:9%}
}
button:not(.open-invitation):active{opacity:.75}

/* Larger hit areas do not enlarge the visible arrow or disable text selection. */
.scroll-cue{width:44px;height:44px;margin-left:-22px;display:flex;align-items:center;justify-content:center}
.questions details{padding:12px 0}
.questions summary{min-height:44px;display:flex;align-items:center}
input[type=number]{min-width:44px}
button,summary,a,input,textarea{touch-action:manipulation}
button,summary{user-select:none;-webkit-user-select:none}

/* Fine paper contact edges, not a whole-scene outline. Vector seams share the
   exact paper geometry: lower folds stay fixed; upper edge rides the hinge.
   A restrained warm left contact survives dense grain/high-DPR rasterization,
   while the existing right-dominant lifting shadow remains unchanged. */
.paper-fold-contact,.flap-edge-contact{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:none}
.paper-fold-contact path{stroke:#967c70;stroke-opacity:.4;stroke-width:.65px;vector-effect:non-scaling-stroke}
.flap-edge-contact path{stroke:url(#flapContactTone);stroke-width:.65px;stroke-linejoin:round;vector-effect:non-scaling-stroke}
