/* A front-facing invitation that turns over before its wax seal opens. */
.envelope-stage{width:min(540px,calc(100vw - 64px));margin-top:28px}
.envelope{width:100%;height:auto;aspect-ratio:1.6;perspective:1800px;isolation:auto;container-type:inline-size;filter:drop-shadow(0 25px 30px #17071066)}
.envelope-turn{position:absolute;inset:0;transform-style:preserve-3d;transition:transform 1.1s cubic-bezier(.55,.08,.22,1);will-change:transform}
.envelope-address-face,.envelope-seal-face{position:absolute;inset:0;border-radius:5px;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.envelope-address-face{overflow:hidden;background:radial-gradient(ellipse at 25% 20%,#fffdf3 0%,#f2e4c8 72%,#e8d4ad 100%);border:1px solid #d7b97c;box-shadow:inset 0 1px 1px #fffdf8,inset 0 -2px 3px #b99a6266}
.envelope-address-face:before{content:'';position:absolute;inset:18px;border:1px solid #b58b455e;box-shadow:0 0 0 5px #fbf2df,inset 0 0 0 4px #f8efdb,inset 0 0 0 5px #b58b4540;pointer-events:none}
.envelope-address-face:after{content:'';position:absolute;inset:0;opacity:.18;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23987843' opacity='.19' filter='url(%23grain)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");pointer-events:none}
.envelope-address-copy{position:absolute;inset:10% 10% 12%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#6b2639}
.envelope-crest{width:15%;height:auto;aspect-ratio:160/150;color:#a47b35;margin-bottom:1.5%;filter:drop-shadow(0 1px 0 #fffaf0)}
.envelope-address-copy .script{font-size:clamp(25px,10cqw,54px);line-height:1.15;margin:0 0 4%;text-shadow:0 1px 0 #fffaf2}
.envelope-recipient-names{display:flex;align-items:center;justify-content:center;gap:.5em;font-family:var(--serif);font-size:clamp(16px,4.5cqw,25px);line-height:1.2;letter-spacing:.015em;max-width:100%}
.envelope-recipient-names em{font-size:.85em;color:#a17d42}
.envelope-gold-rule{display:flex;align-items:center;gap:10px;margin-top:4%;color:#ad8749;font-size:11px;line-height:1}
.envelope-gold-rule:before,.envelope-gold-rule:after{content:'';width:36px;height:1px;background:linear-gradient(90deg,transparent,#b99558)}
.envelope-gold-rule:after{transform:rotate(180deg)}
.envelope-corner{position:absolute;width:13%;height:21%;color:#b48e4f;opacity:.7;fill:none;stroke:currentColor;stroke-width:1}
.envelope-corner-tl{top:8%;left:5%}.envelope-corner-br{bottom:8%;right:5%;transform:rotate(180deg)}
.envelope-ritual-mark{position:absolute;top:2%;right:2%;width:25%;height:auto;transform:rotate(-10deg);pointer-events:none;z-index:2}
.envelope-seal-face{transform:rotateY(180deg);background:#efe1c5;box-shadow:inset 0 0 0 1px #d7b97c}
.envelope-seal-face .envelope-back{background:linear-gradient(140deg,#e1cda6,#f3e7cc 60%,#e4cfaa);border-color:#c7a56a}
.envelope-seal-face .envelope-front{background:linear-gradient(150deg,#fffaf0,#eee0c0);clip-path:polygon(0 0,50% 54%,100% 0,100% 100%,0 100%)}
.envelope-seal-face .envelope-copy{top:59%}
.envelope-seal-face .envelope-copy .script{font-size:clamp(27px,8cqw,43px)}
.envelope-seal-face .envelope-copy .micro{font-size:clamp(7px,1.8cqw,10px);letter-spacing:.2em}
.envelope-seal-face .wax-seal{width:21%;height:auto;aspect-ratio:1;top:28%;pointer-events:none}
.envelope-seal-face .seal-open{font-size:clamp(14px,3.6cqw,20px)}
.envelope-seal-face .envelope-letter{inset:5% 6%;gap:5%;transition:transform 1.05s 2.35s cubic-bezier(.22,.7,.2,1),opacity .4s 2.3s}
.envelope-seal-face .envelope-letter .script{font-size:clamp(24px,7cqw,38px)}
.envelope-trigger{position:absolute;inset:-5px;z-index:12;background:transparent;border:0;border-radius:8px;padding:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.envelope-trigger:focus-visible{outline:2px solid #f4d899;outline-offset:9px}
.envelope-trigger:disabled{cursor:default}
.gate .gate-bottom{margin-top:38px;gap:14px;font-size:12px;letter-spacing:.18em;color:#f3dfbd}
.gate .hint-line{width:28px;flex-shrink:0}
.gate.opening .envelope{animation:none}
.gate.opening .envelope-turn{transform:rotateY(180deg)}
.gate.opening .wax-seal{opacity:1;animation:seal-lift .65s 1.08s cubic-bezier(.25,.7,.3,1) both}
.gate.opening .envelope-flap{animation:royal-flap-open 1.05s 1.6s cubic-bezier(.4,0,.17,1) both;transition:none}
.gate.opening .envelope-letter{opacity:1;transform:translateY(-42%) rotate(-1deg)}
.gate.opening .envelope-copy{transition:opacity .4s 1.1s}
@keyframes royal-flap-open{0%{transform:rotateX(0);z-index:6}49%{z-index:6}50%{z-index:1}100%{transform:rotateX(180deg);z-index:1}}
@media(max-width:650px){
 .envelope-stage{width:calc(100vw - 56px);max-width:420px;margin-top:14px}
 .envelope-address-face:before{inset:12px;box-shadow:0 0 0 4px #fbf2df,inset 0 0 0 3px #f8efdb,inset 0 0 0 4px #b58b4540}
 .gate .gate-bottom{margin-top:31px;gap:10px;font-size:10px;letter-spacing:.15em}
 .gate .hint-line{width:18px}
 .envelope-address-copy{inset:9% 9% 11%}
 .envelope-gold-rule{gap:7px;font-size:9px}
 .envelope-gold-rule:before,.envelope-gold-rule:after{width:25px}
}
@media(max-height:540px){
 .envelope-stage{width:min(440px,calc(100vw - 88px),calc((100svh - 170px)*1.6));margin-top:20px}
 .gate .gate-top{top:28px}.gate .gate-footer{bottom:24px}
 .gate .gate-bottom{margin-top:23px}
}
@media(prefers-reduced-motion:reduce){
 .envelope-turn{transition:none}
 .gate.opening .wax-seal{animation:none;opacity:0}
 .gate.opening .envelope-flap{animation:none;transform:rotateX(180deg);z-index:1}
 .envelope-seal-face .envelope-letter,.gate.opening .envelope-copy{transition:none}
}

/* Approved Bengali velvet envelope and a matching ceremonial backdrop. */
.gate{background:radial-gradient(ellipse at 50% 40%,#6a2c3c 0%,#451623 47%,#230b14 100%)}
.gate:before{inset:27px;border-color:#caa15b54;box-shadow:inset 0 0 0 6px #2c0d17aa,inset 0 0 0 7px #cda45e30}
.gate:after{inset:17px;border-color:#caa15b3b}
.gate-grain{opacity:.38;mix-blend-mode:soft-light}
.gate-floral{display:none}
.gate-alpana{position:absolute;width:clamp(180px,24vw,330px);height:auto;aspect-ratio:1;color:#dfbf7a;opacity:.19;pointer-events:none}
.gate-alpana-tl{top:48px;left:47px}
.gate-alpana-br{bottom:48px;right:47px;transform:rotate(180deg)}
.gate .gate-top{color:#f0d8aa;text-shadow:0 1px 7px #1e0612aa}
.gate .gate-footer{color:#e3c695;letter-spacing:.2em}
.envelope-stage{width:min(640px,calc(100vw - 72px));margin-top:24px}
.envelope{aspect-ratio:1198/742;filter:drop-shadow(0 32px 36px #15050d99)}
.envelope-address-face{border:0;border-radius:1.2%;background:#650711;box-shadow:0 0 0 1px #e0b45c4d}
.envelope-address-face:before,.envelope-address-face:after{display:none}
.envelope-front-art{position:absolute;left:-11.185309%;top:-13.477089%;width:122.036728%;height:145.013477%;max-width:none;object-fit:fill;pointer-events:none;user-select:none}
.envelope-guest-name{position:absolute;left:20%;right:20%;top:72%;height:11%;display:flex;align-items:center;justify-content:center;text-align:center;color:#f8dfb1;font-family:var(--serif);font-size:clamp(16px,4.5cqw,29px);line-height:1.1;overflow-wrap:anywhere;pointer-events:none}
.envelope-seal-face{background:#5e0814;box-shadow:inset 0 0 0 1px #cba45d}
.envelope-seal-face .envelope-back{background:linear-gradient(145deg,#4d0610,#9d2132 58%,#4a0310);border-color:#c7a25e}
.envelope-seal-face .envelope-front{background:linear-gradient(145deg,#8f182b,#5e0716 72%,#450612);box-shadow:inset 0 -1px 1px #d3ad65}
.envelope-seal-face .envelope-front:before,.envelope-seal-face .envelope-front:after{background:#e3be78;opacity:.55}
.envelope-seal-face .envelope-flap{background:linear-gradient(165deg,#a42b39 3%,#730d20 60%,#490512);filter:drop-shadow(0 2px 1px #d7ac5840)}
.envelope-seal-face .wax-seal{top:28%;width:20%;box-shadow:0 8px 22px #18030e99,inset 0 0 0 3px #f9d99588,inset 0 0 0 6px #8e622c80,inset 0 0 0 8px #f2ce8480}
.seal-flower{display:flex;align-items:center;justify-content:center;width:42%;height:42%;color:#815719;filter:drop-shadow(0 1px 1px #ffe9ac)}
.seal-flower svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.1}
.gate .gate-bottom{color:#f3dab0;font-size:13px;letter-spacing:.18em;text-shadow:0 1px 5px #260814}
.gate .hint-line{background:linear-gradient(90deg,transparent,#dab46b)}
.gate .hint-line:last-child{transform:rotate(180deg)}
@media(max-width:650px){
 .gate:before{inset:22px;box-shadow:inset 0 0 0 5px #2c0d17aa,inset 0 0 0 6px #cda45e30}
 .gate:after{inset:12px}
 .gate-alpana{width:180px;opacity:.15}
 .gate-alpana-tl{top:88px;left:29px}.gate-alpana-br{bottom:83px;right:29px}
 .envelope-stage{width:calc(100vw - 48px);max-width:420px;margin-top:14px}
 .gate .gate-bottom{font-size:11px;letter-spacing:.13em;gap:9px;margin-top:31px}
 .gate .hint-line{width:16px}
 .gate .gate-footer{font-size:10px;letter-spacing:.14em}
}
@media(max-width:360px){.gate .gate-bottom{font-size:10px;letter-spacing:.12em}.gate .gate-footer{font-size:9px}}
@media(max-height:540px){
 .envelope-stage{width:min(440px,calc(100vw - 72px),calc((100svh - 180px)*1.615));margin-top:16px}
 .gate-alpana{width:130px;opacity:.12}
 .gate-alpana-tl{top:40px;left:30px}.gate-alpana-br{bottom:40px;right:30px}
 .gate .gate-bottom{margin-top:23px;font-size:10px}
}
