/* Approved paper and salon-door openings. Scoped to automatic wedding envelopes.
   Hinge parents never clip, filter or fade while rotating: only their faces do. */
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene{
 --hinge-ink:#65463b;position:fixed;inset:0;padding:0;overflow:hidden;
 display:grid;place-items:center;background:#e7e2d8!important;text-align:center;
 color:var(--hinge-ink);transition:none;filter:none!important;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene[hidden]{display:none!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene::before,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene::after,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene>.opening-spotlight,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene>.opening-curtain,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene>.opening-stage{display:none!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-inner{
 position:relative;inset:auto;width:min(100vw,53dvh);height:100dvh;min-height:0;max-height:none;
 display:block;padding:0;margin:0;overflow:clip;isolation:isolate;outline:0;border:0;border-radius:0;
 background:#fff8ee var(--wedding-opening-art) center/cover no-repeat!important;
 box-shadow:0 20px 50px #4b3d302d;animation:none!important;transform:none!important;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-inner::before,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-inner::after{display:none!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-inner>:not(#weddingStationery):not(.template-brand):not(.envelope-recipient):not(.opening-button):not(.opening-skip):not(.opening-owner-access):not(#openingTitle){display:none!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene #openingTitle{
 position:absolute!important;inset:auto!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
 clip-path:inset(50%);overflow:hidden;white-space:nowrap;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene #weddingStationery{
 display:block!important;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .template-brand{
 position:absolute!important;z-index:15;top:max(18px,env(safe-area-inset-top))!important;left:20px!important;right:auto!important;
 width:auto!important;transform:none!important;background:#fff8eef2;padding:9px 14px!important;border-radius:24px;
 font:400 20px/1 'Kislap Cormorant Garamond',Georgia,serif!important;color:#65463b!important;box-shadow:none;text-shadow:none;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .template-brand span{display:none}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .envelope-recipient{
 position:absolute;z-index:15;inset:9% 8% auto!important;width:auto!important;max-height:12%;margin:0!important;
 color:#65463b!important;transform:none!important;background:#fff8eef2;border-radius:4px;padding:8px 12px;overflow:auto;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .envelope-recipient small{font-size:11px}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .envelope-recipient strong{font-size:18px;overflow-wrap:anywhere}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-button{
 position:absolute;z-index:15;top:auto!important;bottom:max(7%,52px)!important;left:20%!important;right:20%!important;
 width:60%!important;min-width:0!important;min-height:46px!important;height:auto!important;margin:0!important;padding:12px 8px!important;
 border:1px solid #bfa16e!important;border-radius:26px!important;background:#fff8eaf2!important;color:#65463b!important;
 font:400 12px/1.4 'Kislap Lato',sans-serif!important;letter-spacing:.06em;box-shadow:none!important;text-shadow:none!important;
 transform:none!important;opacity:1!important;white-space:normal;
}
body[data-wedding-hinge=doors] #openingScene .opening-button{background:#ead6a8f2!important;color:#152333!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-skip{
 position:absolute;z-index:15;top:max(18px,env(safe-area-inset-top))!important;bottom:auto!important;left:auto!important;right:18px!important;
 width:auto!important;min-height:44px;padding:9px 13px!important;margin:0!important;
 background:#fff8eef2!important;border:1px solid #c6b28f!important;border-radius:25px;
 font:400 11px/1.4 'Kislap Lato',sans-serif!important;color:#65463b!important;text-decoration:none;opacity:1!important;transform:none!important;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-owner-access{
 position:absolute;z-index:15;inset:auto 20% max(12px,env(safe-area-inset-bottom))!important;width:60%;min-height:32px;
 display:grid;place-items:center;color:#65463b!important;background:#fff8eef2;border:0;border-radius:24px;
 font:400 11px/1.4 'Kislap Lato',sans-serif;letter-spacing:.02em;opacity:1!important;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene :is(button,a):focus-visible{outline:2px solid #97734e!important;outline-offset:4px}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene.hinge-playing .opening-button{opacity:0!important;pointer-events:none}
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-button::before,
body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-button::after{display:none!important}
body[data-wedding-hinge]:not([data-wedding-hinge=""]):has(#openingScene:not([hidden])) #invitationSound{
 position:fixed;top:auto!important;bottom:max(7dvh,52px)!important;right:auto!important;
 left:calc(50% - min(50vw,26.5dvh) + 12px)!important;width:44px!important;height:46px!important;min-width:0!important;
 padding:10px!important;justify-content:center;background:#fff8eef2!important;color:#65463b!important;
}
body[data-wedding-hinge]:not([data-wedding-hinge=""]):has(#openingScene:not([hidden])) #invitationSound span{display:none}

.hinge-welcome{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:90px 30px 130px;color:var(--wedding-opening-ink);text-align:center;opacity:0}
.hinge-welcome strong{font:400 clamp(38px,6dvh,60px)/1.1 'Kislap Cormorant Garamond',Georgia,serif;text-wrap:balance;overflow-wrap:anywhere}
.hinge-welcome small,.hinge-welcome span{font:400 12px/1.6 'Kislap Lato',sans-serif;max-width:30ch;overflow-wrap:anywhere}
.hinge-doors{position:absolute;inset:0;z-index:4;perspective:1150px}
.hinge-door{position:absolute;top:0;bottom:0;width:50%;transform-style:preserve-3d}
.hinge-door-left{left:0;transform-origin:0 50%}.hinge-door-right{right:0;transform-origin:100% 50%}
.hinge-door-front,.hinge-door-back{position:absolute;inset:0;backface-visibility:hidden}
.hinge-door-front{overflow:hidden;background:#101e2d}
.hinge-door-art{position:absolute;left:0;top:0;bottom:0;width:200%;background:url('/assets/navy-salon-doors.webp') center/cover}
.hinge-door-right .hinge-door-art{left:-100%}
.hinge-door-back{transform:rotateY(180deg) translateZ(1px);background:#122332;border:1px solid #ab8e5966;box-shadow:inset 0 0 0 17px #0c1c2a}
.hinge-door-shade{position:absolute;inset:0;backface-visibility:hidden;background:linear-gradient(90deg,#030b1399,#030b1311);opacity:0}
.hinge-door-right .hinge-door-shade{background:linear-gradient(270deg,#030b1399,#030b1311)}
.hinge-door-heading{position:absolute;z-index:5;top:20%;left:9%;right:9%;text-align:center;font:italic 42px/1.1 'Kislap Cormorant Garamond',Georgia,serif;color:#e4c98f;text-shadow:0 2px 5px #0008;overflow-wrap:anywhere}
.hinge-door-heading small{display:block;font:400 11px/1.6 'Kislap Lato',sans-serif;letter-spacing:.08em;margin-top:15px}
.hinge-paper{position:absolute;inset:0;z-index:4;perspective:1200px;background:#f7f0e5 url('/assets/rose-embossed-paper-v3.webp') center/cover}
.hinge-paper-heading{position:absolute;top:20%;left:9%;right:9%;text-align:center;color:#694b3e;font:400 clamp(32px,6dvh,49px)/1.2 'Kislap Great Vibes',Georgia,serif;text-wrap:balance;overflow-wrap:anywhere}
.hinge-envelope-back,.hinge-pocket{position:absolute;left:6%;right:6%;top:44%;bottom:21%;background:#e6d2b5 url('/assets/rose-embossed-paper-v3.webp') center/cover}
.hinge-envelope-back{z-index:1;border-radius:3px;box-shadow:0 14px 24px #6d50332d;background-blend-mode:multiply}
.hinge-lining{position:absolute;inset:0;background:linear-gradient(135deg,#b3925c,#ecd9af 52%,#a88a53);opacity:.42}
.hinge-pocket{z-index:4;clip-path:polygon(0 0,50% 54%,100% 0,100% 100%,0 100%);border-radius:0 0 3px 3px;background-color:#e9dbc2;background-blend-mode:multiply}
.hinge-pocket::after{content:'';position:absolute;inset:0;background:linear-gradient(35deg,#9b714b15,transparent 46%,#fff7eacc)}
.hinge-seams{position:absolute;inset:0;fill:none;stroke:#8b6a4638;stroke-width:1;width:100%;height:100%}
.hinge-flap{position:absolute;z-index:6;top:44%;height:22.75%;left:6%;right:6%;transform-origin:50% 0;transform-style:preserve-3d}
.hinge-flap-face{position:absolute;inset:0;clip-path:polygon(0 0,100% 0,50% 100%);backface-visibility:hidden;background:#faf3e6 url('/assets/rose-embossed-paper-v3.webp') center/cover}
.hinge-flap-face::after{content:'';position:absolute;inset:0;background:linear-gradient(178deg,transparent 35%,#b28a5b30)}
.hinge-flap-reverse{transform:rotateY(180deg);background:#dec596 url('/assets/wedding-blush-paper-v2.webp') center/cover;background-blend-mode:multiply}
.hinge-letter-window{position:absolute;inset:0;z-index:2;clip-path:inset(0 0 21% 0)}
.hinge-letter{position:absolute;z-index:2;top:34%;height:47%;left:13%;right:13%;padding:28px 22px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:17px;background:#fff9ef url('/assets/wedding-blush-paper-v2.webp') center/cover;box-shadow:0 6px 14px #6c4c3524;color:#67473c;transform:translateY(38.3%) rotateZ(-2deg)}
.hinge-letter::after{content:'';position:absolute;inset:12px;border:1px solid #b39a6e88;pointer-events:none}
.hinge-letter strong{font:400 clamp(28px,5.5dvh,44px)/1.1 'Kislap Great Vibes',Georgia,serif;overflow-wrap:anywhere;max-width:100%}
.hinge-letter p{font:italic 20px/1.25 'Kislap Cormorant Garamond',Georgia,serif;margin:0;overflow-wrap:anywhere}
.hinge-letter small{font:400 11px/1.7 'Kislap Lato',sans-serif;letter-spacing:.03em}
.hinge-seal{position:absolute;z-index:7;top:calc(64% - 39px);left:calc(50% - 39px);width:78px;height:78px;object-fit:contain;filter:drop-shadow(0 5px 4px #69462a40)}
.hinge-light{position:absolute;inset:-15%;z-index:8;opacity:0;pointer-events:none;background:radial-gradient(ellipse,#fff9e8 0%,#fbe7bf8c 30%,transparent 67%)}
.hinge-beam{position:absolute;z-index:3;top:0;bottom:0;left:calc(50% - 2px);width:4px;background:#fff1c3;box-shadow:0 0 22px 8px #ffe8b178;opacity:0}
body[data-wedding-hinge=doors] .hinge-light{background:radial-gradient(ellipse,#ffe9b180,transparent 62%)}
body[data-wedding-hinge=doors] .hinge-welcome{background:linear-gradient(180deg,#07172888,#07172855 65%,transparent 88%);color:#fff2da}
@media(max-width:520px){body[data-wedding-hinge]:not([data-wedding-hinge=""]) #openingScene .opening-inner{width:100vw;box-shadow:none}.hinge-letter{padding-inline:19px;gap:14px}.hinge-paper-heading{font-size:44px}.hinge-door-heading{font-size:38px}}
@media(max-width:520px){body[data-wedding-hinge]:not([data-wedding-hinge=""]):has(#openingScene:not([hidden])) #invitationSound{left:12px!important}}
@media(max-height:600px){.hinge-paper-heading{top:20%;font-size:32px}.hinge-letter{gap:6px;padding:14px 19px}.hinge-letter strong{font-size:28px}.hinge-letter p{font-size:16px}.hinge-seal{width:58px;height:58px;left:calc(50% - 29px);top:calc(64% - 29px)}}
