/* The invitation's envelope, the same as in the Ziarama app (ZyEnvelopeIntro):
   a starry night, the names, an envelope of warm paper with gold edges, a red
   wax seal, a flap opening in 3D, a letter sliding out. Moved by
   wedding-envelope-zy-v1.js; the night sky and the letter's unfolding come
   from wedding-envelope-night-v1.js. */
.zy-envelope,.zi-envelope-unfold{--zy-gold:#C99A3A;--zy-paper:#FFF6E6;--zy-inside:#EFDDBB}
.zy-envelope{
  --zy-w:min(82vw,380px);--zy-h:calc(var(--zy-w) * .64);
  --zy-card-w:calc(var(--zy-w) * .88);--zy-card-h:calc(var(--zy-card-w) * 1.32);
  position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;
  overflow:hidden;color:#F4E9DA;font-family:"Cormorant Garamond",Georgia,serif;
  -webkit-user-select:none;user-select:none;
}
body.zi-envelope-intro-open{overflow:hidden}
.zy-envelope[data-state="done"]{display:none}

/* The night: deep plum by day, a true black in dark mode, stars on top. */
.zy-envelope__night{position:absolute;inset:0;z-index:-2;
  background:linear-gradient(180deg,#07060F 0%,#130E22 38%,#221528 72%,#2A191D 100%)}
@media (prefers-color-scheme:dark){.zy-envelope__night{background:linear-gradient(180deg,#000 0%,#030308 38%,#07060C 72%,#0B0909 100%)}}
html[data-theme="dark"] .zy-envelope__night,html[data-bs-theme="dark"] .zy-envelope__night,body.dark .zy-envelope__night{
  background:linear-gradient(180deg,#000 0%,#030308 38%,#07060C 72%,#0B0909 100%)}
.zy-envelope .zi-envelope-intro__sky{display:block}

.zy-envelope__controls{position:absolute;top:max(12px,env(safe-area-inset-top));right:12px;display:flex;gap:8px;z-index:5}
.zy-envelope__control{appearance:none;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.12);color:#fff;
  border-radius:999px;padding:8px 16px;font:600 14px/1 "DM Sans",system-ui,sans-serif;cursor:pointer;backdrop-filter:blur(6px)}
.zy-envelope__control[aria-pressed="true"]{opacity:.6}

.zy-envelope__stage{position:relative;display:flex;flex-direction:column;align-items:center;will-change:opacity}
.zy-envelope__names{text-align:center;padding:0 24px;will-change:transform,opacity}
.zy-envelope__names h2{margin:0;font-family:"Great Vibes",cursive;font-weight:400;font-size:46px;line-height:1.1;color:#F4E9DA;
  text-shadow:0 0 18px rgba(201,154,58,.35)}
.zy-envelope__subtitle{margin:6px 0 0;text-transform:uppercase;letter-spacing:2.4px;font-size:13px;font-weight:600;color:var(--zy-gold)}
.zy-envelope__for{margin:10px 0 0;font-size:17px;font-style:italic;color:rgba(244,233,218,.86)}

.zy-envelope__lift{margin-top:26px;perspective:625px;will-change:transform}
.zy-envelope__body{position:relative;width:var(--zy-w);height:var(--zy-h);transform-style:preserve-3d;will-change:transform}
.zy-envelope__table{position:absolute;left:6%;right:6%;bottom:-10%;height:16%;border-radius:999px;box-shadow:0 0 28px 2px rgba(0,0,0,.18)}
.zy-envelope__inside{position:absolute;inset:0;border-radius:10px;background:var(--zy-inside)}

/* The letter lives above the envelope's bottom edge only. */
.zy-envelope__pocket-clip{position:absolute;left:-60%;right:-60%;top:-400%;bottom:2px;overflow:hidden;z-index:2;pointer-events:none}
.zy-envelope__letter{position:absolute;left:50%;width:var(--zy-card-w);height:var(--zy-card-h);margin-left:calc(var(--zy-card-w) / -2);
  top:calc(var(--zy-h) * 4 + 8px);box-sizing:border-box;border-radius:14px;background:#FBF3EA;border:1px solid rgba(201,154,58,.45);
  box-shadow:0 10px 30px rgba(0,0,0,.22);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  padding:22px 18px;text-align:center;color:#3B2C20;will-change:transform}
.zy-letter__kicker{text-transform:uppercase;letter-spacing:2.6px;font-size:11px;font-weight:600;color:var(--zy-gold)}
.zy-letter__names{font-family:"Great Vibes",cursive;font-weight:400;font-size:clamp(28px,8vw,38px);line-height:1.1;color:#3B2C20}
.zy-letter__rule{width:46px;height:1px;background:linear-gradient(90deg,transparent,var(--zy-gold),transparent)}
.zy-letter__line,.zy-letter__question{font-size:16px;font-style:italic;color:#6B5847}
.zy-letter__date{font-size:13px;letter-spacing:2px;color:#8A7461}
.zy-letter__answers{display:flex;gap:10px;margin-top:4px}
.zy-letter__answers i{font-style:normal;border:1px solid rgba(201,154,58,.55);border-radius:999px;padding:6px 18px;font-size:14px;font-weight:600;color:#3B2C20}
.zy-letter__cover{width:100%;flex:1 1 auto;min-height:0;border-radius:10px;overflow:hidden;background:#EFE3D2}
.zy-letter__cover img{width:100%;height:100%;object-fit:cover;display:block}
.zi-envelope-letter--guided{justify-content:flex-start}

.zy-envelope__pocket{position:absolute;inset:0;width:100%;height:100%;z-index:3;filter:drop-shadow(0 1px 0 rgba(255,255,255,.25))}

.zy-envelope__flap{position:absolute;left:0;right:0;top:0;height:58%;z-index:4;transform-origin:50% 0;will-change:transform}
.zy-envelope__flap svg{display:block;width:100%;height:100%;filter:drop-shadow(0 2px 3px rgba(0,0,0,.25))}
.zy-flap__inside,.zy-flap__liner{opacity:0}
.zy-envelope__flap.is-behind{z-index:1}
.zy-envelope__flap.is-behind .zy-flap__front{opacity:0}
.zy-envelope__flap.is-behind .zy-flap__inside,.zy-envelope__flap.is-behind .zy-flap__liner{opacity:1}

.zy-envelope__sweep{position:absolute;inset:0;border-radius:10px;z-index:5;pointer-events:none;opacity:0;
  background:linear-gradient(115deg,rgba(255,255,255,0) 35%,rgba(255,255,255,.45) 50%,rgba(255,255,255,0) 65%);
  background-size:300% 100%;background-repeat:no-repeat}
.zy-envelope__dust{position:absolute;left:50%;top:58%;width:240px;height:240px;margin:-124px 0 0 -120px;z-index:6;pointer-events:none}

.zy-envelope__seal{position:absolute;left:50%;top:58%;width:44px;height:44px;margin:-26px 0 0 -22px;z-index:7;border-radius:50%;box-shadow:0 3px 8px rgba(0,0,0,.3)}
.zy-seal{position:absolute;inset:0;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 35% 35%,#B8333F,#7A1622 72%);color:#C9283B;font-style:normal;font-size:19px;line-height:1;
  will-change:transform}
.zy-seal--left{clip-path:inset(0 50% 0 0)}
.zy-seal--right{clip-path:inset(0 0 0 50%)}

.zy-envelope__status{position:absolute;left:0;right:0;bottom:max(18px,env(safe-area-inset-bottom));margin:0;text-align:center;
  font-size:14px;font-style:italic;color:rgba(244,233,218,.62)}

@media (prefers-reduced-motion:reduce){
  .zy-envelope__lift,.zy-envelope__flap,.zy-envelope__letter,.zy-seal{transition:none!important}
}
