/* One physical envelope: lining, invitation, pocket, and a single hinged flap.
   Motion is coordinated by invitation-reveal-v8.js, including the card handoff. */
#reveal.v6-reveal { overflow: clip; }
#reveal .v6-envelope {
  width: min(590px,88vw,70svh);
  aspect-ratio: 1494 / 1053;
  isolation: isolate;
  transform-style: flat;
  filter: none;
  animation: none;
  transition: none;
}
#reveal .v6-envelope-back,
#reveal .v6-envelope-front,
#reveal .v6-envelope-flap { border-radius: 0; box-shadow: none; }
#reveal .v6-envelope-back {
  z-index: 1;
  background: repeating-linear-gradient(0deg,rgba(105,80,53,.022) 0 1px,transparent 1px 3px),
    linear-gradient(180deg,#ded1be,#f1e6d6);
  clip-path: polygon(2.1% 3%,98% 3%,98% 97.5%,2.1% 97.5%);
}
#reveal .v6-envelope-back::after {
  background: linear-gradient(180deg,rgba(94,71,44,.22),rgba(94,71,44,.05) 65%);
  opacity: 1;
}
#reveal .v6-envelope-front {
  z-index: 5;
  background: url('/ivory-envelope-v7.webp') center / 100% 100% no-repeat;
  /* Fixed pocket opening; changing this outline mid-animation caused a pop. */
  clip-path: polygon(2.1% 3%,2.1% 10%,5% 16%,49.3% 63.5%,93% 18%,97% 12%,98% 3%,98% 97.5%,2.1% 97.5%);
}
#reveal .v6-envelope-front::after { display: none; }
#reveal .v6-envelope-flap {
  z-index: 7;
  height: 100%;
  transform-origin: 50% 3%;
  background: url('/ivory-envelope-v7.webp') center / 100% 100% no-repeat;
  clip-path: polygon(2.1% 3%,98% 3%,97% 12%,93% 18%,49.3% 64%,5% 16%,2.1% 10%);
  backface-visibility: visible;
}
#reveal .v6-flap-inner { display: none; }
#reveal .v6-card-preview {
  z-index: 4;
  left: 10%; right: 10%; bottom: 7%;
  opacity: 1; visibility: visible;
  transform: none;
  transform-origin: top left;
  border-radius: 8px;
  box-shadow: 0 34px 86px rgba(0,0,0,.42);
}
#reveal .v6-seal {
  top: 60%; width: 30%; padding: 0;
  background: url('/burgundy-seal-v7.webp') center / contain no-repeat;
  box-shadow: none;
  animation: none;
  filter: drop-shadow(0 5px 3px rgba(48,15,16,.27));
}
#reveal .v6-seal-ring, #reveal .v6-seal-initials { display: none; }
#reveal .v6-fragment {
  top: 60%; width: 30%; height: auto; aspect-ratio: 1;
  transform: translate(-50%,-50%);
  border-radius: 0; box-shadow: none;
  background: url('/burgundy-seal-v7.webp') center / contain no-repeat;
}
/* Complementary irregular pieces retain the actual embossed wax surface. */
#reveal .v6-fragment-1 { clip-path: polygon(0 0,52% 0,48% 21%,55% 34%,49% 50%,26% 43%,0 48%); }
#reveal .v6-fragment-2 { clip-path: polygon(52% 0,100% 0,100% 40%,73% 46%,49% 50%,55% 34%,48% 21%); }
#reveal .v6-fragment-3 { clip-path: polygon(0 48%,26% 43%,49% 50%,34% 68%,40% 100%,0 100%); }
#reveal .v6-fragment-4 { clip-path: polygon(49% 50%,73% 46%,100% 40%,100% 100%,67% 100%,62% 73%); }
#reveal .v6-fragment-5 { clip-path: polygon(49% 50%,62% 73%,67% 100%,40% 100%,34% 68%); }
#reveal .v6-fragment-6 { display: none; }
#reveal .v6-address { bottom: 8%; }
#reveal .v6-address small { display: none; }
#reveal .v6-address strong { font-size: clamp(17px,4.5vw,25px); }
#reveal[data-state] .v6-envelope,
#reveal[data-state] .v6-seal,
#reveal[data-state] .v6-crack,
#reveal[data-state] .v6-fragment,
#reveal[data-state] .v6-envelope-flap,
#reveal[data-state] .v6-card-preview { animation: none; }
#reveal[data-state] .v6-envelope { transform: none; }
#reveal[data-state="seal_breaking"] .v6-reveal-head,
#reveal[data-state="envelope_opening"] .v6-reveal-head { opacity: 0; pointer-events: none; }
#reveal[data-state="seal_breaking"] .v6-address,
#reveal[data-state="seal_breaking"] .v6-envelope-copy { opacity: 0; }
#reveal[data-state="envelope_opening"] .v6-card-preview { opacity: 1; visibility: visible; }
#reveal:not([data-state="sealed"]) .v6-envelope-copy { opacity: 0; }
#reveal .v6-invitation-scene { transform: none; transition: none; }
#reveal .v6-invitation-card { transform: none; }
#reveal[data-state="invitation_reveal"] .v6-invitation-card { animation: none; opacity: 1; }
#reveal[data-state="invitation_reveal"] .v6-envelope-scene {
  transform: none; transition: none;
}
#reveal[data-state="sealed"] .v6-envelope-scene { transition: none; }
#reveal[data-state="invitation_reveal"] .v6-seal,
#reveal[data-state="invitation_reveal"] .v6-address { visibility: hidden; }
.v6-envelope-copy { text-align: center; font-size: 14px; }
@media (max-width:720px) {
  #reveal .v6-reveal-head { top: max(72px,env(safe-area-inset-top)); width: calc(100% - 40px); }
  #reveal .v6-reveal-head .eyebrow { font-size: 11px; letter-spacing: .17em; }
  #reveal .v6-reveal-head h1 { font-size: clamp(24px,6.5vw,32px); line-height: 1.12; }
  #reveal .v6-skip { top: max(14px,env(safe-area-inset-top)); font-size: 14px; }
  #reveal .v6-envelope-scene { padding: 165px 12px 115px; gap: 22px; }
  #reveal .v6-envelope-copy { max-width: 290px; font-size: 14px; line-height: 1.5; }
}
@media (max-height:620px) and (orientation:landscape) {
  #reveal .v6-reveal-head { top: 20px; width: 65vw; }
  #reveal .v6-reveal-head h1 { font-size: 23px; }
  #reveal .v6-envelope-scene { padding: 115px 12px 45px; gap: 12px; }
  #reveal .v6-envelope { width: min(350px,44vw,66svh); }
}
@media (prefers-reduced-motion:reduce) {
  #reveal .v6-envelope-scene, #reveal .v6-invitation-scene { transition: none; }
}
