/* One opener, one set of poses. No keyframes, native-details or 3D transforms. */
html.opening-ready body:has(#open-invitation):not([data-opening=complete]){overflow:hidden;min-height:100svh}
html.opening-ready #invitation-shell>main,html.opening-ready #invitation-shell>.site-footer{visibility:hidden}
body[data-opening=complete]{overflow:auto}
body[data-opening=complete] #invitation-shell>main,body[data-opening=complete] #invitation-shell>.site-footer{visibility:visible}
.opening-tools{position:fixed;z-index:202;top:0;left:0;right:0;text-align:center;padding:4px 20px;background:transparent;font:12px/1.5 var(--body)}
.opening-tools a{display:inline-flex;align-items:center;min-height:44px;color:#746b58;text-underline-offset:4px}
body[data-opening=complete] .opening-tools{display:none}
.envelope-summary{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;appearance:none;-webkit-appearance:none;border:0;border-radius:0;width:100%;height:100svh;margin:0;padding:50px 20px 24px;background:#fffdf7;color:#4d4435;text-align:center;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font:inherit;overflow:hidden}
.envelope-summary:focus-visible{outline:2px solid #9a7d45;outline-offset:-6px}
.envelope-summary__inner{display:flex;flex-direction:column;align-items:center;pointer-events:none}
.envelope-label{font:400 12px/1.4 var(--display);letter-spacing:.12em;text-transform:uppercase;color:#716752}
.opening-names{font:400 clamp(43px,9vw,58px)/1.15 var(--names);letter-spacing:0;color:#38342d;margin-top:12px}
.opening-names>span{font:400 .72em/1 var(--names);color:#b59252}
.opening-date{font:400 12px/1.5 var(--body);color:#766e61;letter-spacing:.06em;margin-top:10px}
.opening-hint{font:400 11px/1.5 var(--body);color:#7e7564;margin-top:18px;max-width:26em}
.envelope{position:relative;display:block;width:min(63vw,260px);aspect-ratio:2/3;margin:24px auto 0;pointer-events:none}
.envelope__back,.envelope__side,.envelope__front{position:absolute;background:#f1ebdf url('/assets/art/paper-ivory-v11.png') center/cover no-repeat}
.envelope__back{inset:0;z-index:0;box-shadow:3px 10px 20px #6f5c3626,inset -3px 0 5px #9f8e6820;border:1px solid #d9cfb9}
.envelope__card{position:absolute;inset:4% 7% 7%;z-index:1;display:block;padding:0;border:0;background:#fffdf7;overflow:hidden}
.envelope__card .identity-frame{display:block;width:100%;max-width:none;container-type:inline-size}
.envelope__card .identity-frame__art{display:block;width:100%;height:auto}
.envelope__card .identity-intro{font-size:2.93cqw!important}
.envelope__card .hero__names{font-size:15.6cqw!important}
.envelope__card .identity-event p,.envelope__card .mini-event{font-size:2.93cqw!important}
.envelope__card .identity-event img{width:3.3cqw;min-width:0}
.envelope__card .identity-venue{font-size:2.85cqw!important;letter-spacing:.035em}
.envelope__side{inset:0;z-index:2;transition:transform .8s cubic-bezier(.2,.7,.3,1)}
.envelope__side--left{clip-path:polygon(0 0,65% 53%,0 100%);transform-origin:left center}
.envelope__side--right{clip-path:polygon(100% 0,35% 53%,100% 100%);transform-origin:right center}
.envelope__front{inset:0;z-index:3;clip-path:polygon(0 100%,0 49%,50% 53%,100% 49%,100% 100%);transform-origin:50% 100%;transition:transform .8s cubic-bezier(.2,.7,.3,1)}
.envelope__flap{position:absolute;left:0;top:0;width:100%;height:56%;z-index:4;transform-origin:50% 0;overflow:visible;transition:transform .8s cubic-bezier(.2,.7,.3,1)}
.envelope__emboss{stroke:#d7cfbd;stroke-width:1.1;opacity:.6}
.envelope__seal{position:absolute;z-index:5;top:43%;left:calc(50% - 39px);width:78px;height:78px;background:url('/assets/art/seal-champagne-v11.png') center/contain no-repeat;filter:drop-shadow(0 3px 2px #78603935);transition:opacity .18s}
.envelope__tap{position:absolute;z-index:4;top:76%;left:0;right:0;font:400 17px/1.4 var(--display);letter-spacing:.11em;color:#856327}
body[data-opening]:not([data-opening=closed]) .envelope-label,body[data-opening]:not([data-opening=closed]) .opening-names,body[data-opening]:not([data-opening=closed]) .opening-date,body[data-opening]:not([data-opening=closed]) .opening-hint,body[data-opening]:not([data-opening=closed]) .envelope__tap{visibility:hidden}
body[data-opening=top-bottom] .envelope__flap,body[data-opening=left-right] .envelope__flap{transform:scaleY(-.94)}
body[data-opening=top-bottom] .envelope__front,body[data-opening=left-right] .envelope__front{transform:scaleY(-.86)}
body[data-opening]:not([data-opening=closed]) .envelope__seal{opacity:0}
body[data-opening=left-right] .envelope__side--left{transform:scaleX(-.94)}
body[data-opening=left-right] .envelope__side--right{transform:scaleX(-.94)}
body[data-opening=growing] .envelope-summary__inner{visibility:hidden}
.opening-fly-card{position:fixed!important;z-index:201;margin:0!important;max-width:none!important;transform-origin:0 0;pointer-events:none;transition:transform .95s cubic-bezier(.2,.7,.25,1);will-change:transform}
body[data-opening=complete] #open-invitation{display:none}
body[data-motion=reduced] .envelope__flap,body[data-motion=reduced] .envelope__front,body[data-motion=reduced] .envelope__side,body[data-motion=reduced] .opening-fly-card{transition:none}
@media(max-height:720px){.envelope{width:min(56vw,210px);margin-top:16px}.opening-names{font-size:42px}.opening-date{font-size:11px}.opening-hint{margin-top:12px}}
@media print{.envelope-summary,.opening-tools,.opening-fly-card{display:none!important}#invitation-shell>main,#invitation-shell>.site-footer{visibility:visible!important}body{overflow:auto!important}}

body[data-opening]:not([data-opening=closed]) .opening-tools{visibility:hidden}
/* Opacity also clears cached glyph layers in WebKit while preserving layout. */
html.opening-ready #invitation-shell>main,html.opening-ready #invitation-shell>.site-footer{opacity:0}
body[data-opening=complete] #invitation-shell>main,body[data-opening=complete] #invitation-shell>.site-footer{opacity:1}
body[data-opening]:not([data-opening=closed]) .envelope-label,body[data-opening]:not([data-opening=closed]) .opening-names,body[data-opening]:not([data-opening=closed]) .opening-date,body[data-opening]:not([data-opening=closed]) .opening-hint,body[data-opening]:not([data-opening=closed]) .envelope__tap{opacity:0}

/* Progressive enhancement: the invitation is readable if the opener cannot run. */
html:not(.opening-ready) .envelope-summary,html:not(.opening-ready) .opening-tools{display:none}
@media print{html.opening-ready #invitation-shell>main,html.opening-ready #invitation-shell>.site-footer{visibility:visible!important;opacity:1!important}body,html.opening-ready body:has(#open-invitation):not([data-opening=complete]){overflow:visible!important;height:auto!important;min-height:0!important}#invitation-shell{display:block!important;position:static!important}}
