/* Curtain cover: a painted tapestry, two rope-pulling asurs and the live HTML wording. */
dialog.cover.invitation-cover{position:fixed;inset:0;width:100%;max-width:none;height:100svh;max-height:100svh;margin:0;padding:0!important;border:0;overflow:hidden;background:#062f40;color:#fff2d8;text-align:center;perspective:none;isolation:isolate}
dialog.cover.invitation-cover[open]{display:block}
dialog.cover.invitation-cover.is-opening{background:transparent}
dialog.cover.invitation-cover.is-fading{opacity:0;transition:opacity .5s ease}
.cover .curtain{position:absolute;inset:0;overflow:hidden;pointer-events:none;background:#062f40 url('images/cover/silk-tile.webp') 0 0/300px 300px}
.cover .curtain canvas{display:block;max-width:none}
.cover.is-opening .curtain,.cover.is-fading .curtain{background:none}
.cover .curtain-cloth[hidden]{display:none}
.cover .curtain-rig{z-index:2}
/* The cover appears as one finished picture: plain night-blue until the painted cloth, asurs and wording are all ready,
   then everything fades in together. A CSS-only fallback shows the wording if the module never reports back. */
.cover:not([data-curtain]) .curtain{background-image:none}
.cover:not([data-curtain]) .curtain>canvas,.cover:not([data-curtain]) .cover-letter{opacity:0;animation:cv-fallback 0s 6s forwards}
.cover[data-curtain] .curtain,.cover[data-curtain] .cover-letter{animation:cv-appear .32s ease-out}
@keyframes cv-fallback{to{opacity:1}}
@keyframes cv-appear{from{opacity:0}}

.cover-letter{position:absolute;z-index:3;left:var(--cv-copy-x,3%);top:var(--cv-copy-y,40%);width:var(--cv-copy-w,94%);height:var(--cv-copy-h,56%);container-type:inline-size;display:flex;flex-direction:column;align-items:center;justify-content:space-between;overflow:visible;padding:0;text-shadow:0 2px 10px #001822,0 0 22px #001822;will-change:transform,opacity}
.cv-top,.cv-bottom{position:relative;display:flex;flex-direction:column;align-items:center;max-width:100%}
.cv-bottom{width:100%;padding-inline:var(--cv-pad,0px);padding-bottom:max(0px,env(safe-area-inset-bottom))}
.cv-invocation{font:clamp(13px,4cqw,18px)/1.4 Devanagari,serif;color:#f0d69a;margin:0 0 3px}
.cv-intro{font-size:clamp(16px,5cqw,24px);line-height:1.15;margin:0 0 4px}
.cover #cover-title{font-size:clamp(34px,12.5cqw,86px);line-height:.98;font-weight:400;letter-spacing:-.02em;margin:0;max-width:100%;overflow-wrap:anywhere;color:#fff2d8}
.cover #cover-title em{font-style:italic;color:#f0d69a;font-size:.62em}
.cv-city{font-size:clamp(17px,5.2cqw,26px);line-height:1.15;margin:8px 0 0}
.cv-city span{display:block;font-size:.84em;margin-top:2px}
.cv-recipient{width:100%;max-width:100%;margin:0 auto;border-top:1px solid #e5ca8a99;padding-top:7px}
.cv-recipient span,.cv-recipient strong{display:block}
.cv-recipient span{font-size:clamp(14px,4cqw,18px);line-height:1.2}
.cv-recipient strong{font-size:clamp(19px,6cqw,29px);line-height:1.12;margin-top:1px;font-weight:600;overflow-wrap:anywhere}
.cover #open-invitation.cv-open{width:fit-content;align-self:center;margin-top:9px;min-height:48px;min-width:44px;max-width:100%;padding:9px 20px;border:1px solid #f4e1b6;border-radius:2px;background:#f5e3bd;color:#092d3a;font:600 clamp(17px,5.2cqw,22px)/1.15 Cormorant,Georgia,serif;cursor:pointer;text-shadow:none;box-shadow:0 4px 16px #00101899;touch-action:manipulation}
.cover #open-invitation.cv-open:hover{background:#fff5dc}.cover #open-invitation.cv-open:focus-visible{outline:3px solid #fff;outline-offset:4px}.cover #open-invitation.cv-open:active{transform:scale(.98)}
.cover-letter [data-invite-notice]{font:16px/1.35 Cormorant,serif;color:#fff2d8;margin:6px 0 0}.cover-letter [data-invite-notice]:empty{display:none}

/* Wide screens: tapestry emblem on the left, wording on the right. */
.cover.curtain-wide .cover-letter{justify-content:center;gap:clamp(10px,3svh,28px)}
.cover.curtain-wide .cv-bottom{padding-inline:0}
.cover.curtain-wide .cv-recipient{max-width:min(100%,26em)}
.cover.curtain-wide #cover-title{font-size:clamp(34px,min(14.5cqw,12svh),110px)}

/* Progressive fitting, applied by mountain.js when the wording would overflow. */
.cover.cover-tight #cover-title{font-size:clamp(26px,min(9.6cqw,7.4svh),54px)}
.cover.cover-tight .cv-intro{display:none}.cover.cover-tight .cv-invocation{font-size:12px;margin-bottom:2px}
.cover.cover-tight .cv-city{font-size:16px;margin-top:3px}.cover.cover-tight .cv-recipient{padding-top:4px}
.cover.cover-tight .cv-recipient strong{font-size:17px}.cover.cover-tight .cv-recipient span{font-size:13px}
.cover.cover-tight #open-invitation.cv-open{margin-top:5px;min-height:46px}
.cover.cover-overflow .cover-letter{overflow-y:auto;overscroll-behavior:contain;justify-content:flex-start;gap:6px}
.cover.cover-overflow #open-invitation.cv-open{position:sticky;bottom:0;isolation:isolate;background:transparent;box-shadow:none}
/* Full-width backing so scrolled wording never shows beside the sticky button; the cream plate sits above it. */
.cover.cover-overflow #open-invitation.cv-open::before,.cover.cover-overflow #open-invitation.cv-open::after{content:"";position:absolute;z-index:-1;pointer-events:none}
.cover.cover-overflow #open-invitation.cv-open::before{left:calc(50% - 50cqw);width:100cqw;top:-12px;bottom:-6px;background:linear-gradient(#07354200,#073542 10px)}
.cover.cover-overflow #open-invitation.cv-open::after{inset:0;background:#f5e3bd;box-shadow:0 4px 16px #00101899}
.cover.cover-overflow #open-invitation.cv-open:hover::after{background:#fff5dc}

@media(max-height:560px) and (min-width:560px){
 .cv-intro{display:none}
 .cv-city{margin-top:4px}
}
@media(prefers-reduced-motion:reduce){dialog.cover.invitation-cover.is-fading{transition:none}}
