/* The keepsake is printed in two layers so the swans can meet above the date. */
.swan-pair {
  position: relative;
  aspect-ratio: 3 / 2;
  isolation: isolate;
  mix-blend-mode: normal;
}
.swan-pair > span {
  position: absolute;
  inset: 0;
  background: url(assets/swan-pair.webp) center / contain no-repeat;
}
.swan-left {clip-path: inset(0 50% 0 0);}
.swan-right {clip-path: inset(0 0 0 50%);}
.ripple {
  position: absolute;
  left: 30%;
  bottom: 18%;
  width: 40%;
  height: 6%;
  border: 1px solid #a696a1;
  border-radius: 50%;
  opacity: 0;
}
.date-window {overflow: hidden; display: block;}
.date-window span {display: block;}
@property --wreath-sweep {
  syntax: '<angle>';
  inherits: false;
  initial-value: 180deg;
}

/* A hinged painting and a second leaf of text share the event card's crease. */
.event-extra.paper-spread {
  display: grid;
  grid-template-columns: minmax(106px, 31%) 1fr;
  max-width: 590px;
  margin: 14px 15px 9px clamp(84px, 9vw, 115px);
  background: #e6dacf;
  border: 1px solid #c6b3a3;
  box-shadow: 0 4px 11px #5b3d4714;
  perspective: 1000px;
}
.pop-scene {
  position: relative;
  min-height: 125px;
  background: #eee2cc;
  padding: 6px;
  transform-origin: right center;
  backface-visibility: hidden;
}
.pop-scene img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: cover;
  object-position: 50% 44%;
  border: 1px solid #b79c79;
}
.pop-scene i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 86%, #644a3d28 100%);
  pointer-events: none;
}
.pop-page {
  transform-origin: left center;
  padding: 20px;
  border-left: 1px solid #cab9a4;
  background: linear-gradient(90deg, #e6dac8, #fbf5e8 7%, #fffaf0 85%, #f6eddf);
}
.pop-page p {font-size: 19px;}
.pop-page .links {gap: 10px 16px;}
.guest-q .fold {perspective: 850px;}
.guest-q .fold > div {overflow: visible; min-height: 0;}
.guest-q .fold p {
  padding: 15px 20px 17px;
  margin-bottom: 14px;
  background: linear-gradient(176deg, #e8dfcf, #fcf6e9 18%, #f8f0e3);
  border: 1px solid #d4c4b4;
  border-top: 2px solid #bc9f9e;
  box-shadow: 1px 3px 6px #6047500a;
  transform-origin: top;
}

/* These decorative doors live inside the existing arched venue illustration. */
.venue-print {position: relative;}
.venue-print .arch {position: relative; isolation: isolate;}
.venue-shutters {
  position: absolute;
  inset: 7px;
  overflow: hidden;
  border-radius: inherit;
  perspective: 760px;
  pointer-events: none;
  display: none;
}
.venue-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% + .3px);
  backface-visibility: hidden;
  background-image: url(assets/venue-doors.webp);
  background-size: 200% 100%;
  box-shadow: 0 1px 5px #3f2f3560;
}
.venue-door::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #593e34;
  opacity: 0;
  transition: opacity .8s;
}
.venue-door.left {left: 0; background-position: left; transform-origin: left;}
.venue-door.right {right: 0; background-position: right; transform-origin: right;}
.venue-replay {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  padding-bottom: 10px;
  color: #70536c;
  font: 500 12px/1.2 var(--sans);
}
.venue-replay .icon {width: 14px; height: 14px;}
.venue-replay:focus-visible {outline-offset: 4px;}

/* The actual family letter rises from the envelope and folds back inside. */
.correspondence {max-width: 420px; margin: 0 auto;}
.letter-slot {display: grid; grid-template-rows: 0fr;}
.letter-sleeve {overflow: hidden; min-height: 0; perspective: 800px;}
.note-open .letter-slot {grid-template-rows: 1fr;}
.last-note {
  position: relative;
  margin: 10px 6px 20px;
  padding: 22px 22px 19px;
  backface-visibility: hidden;
  border: 1px solid #c7b497;
  outline: 1px solid #e1d2bb;
  outline-offset: -5px;
  background: linear-gradient(170deg, #fffaf0, #f9f0dd);
  box-shadow: 0 5px 12px #654f4f10;
  animation: none;
  transform-origin: bottom center;
}
.last-note p {margin: 0 auto 10px;}
.last-note strong {display: inline-block; font-size: clamp(30px, 5vw, 37px);}
.note-open .tiny-letter {opacity: 0; transition: opacity .2s .52s, transform .6s ease;}
.note-open .envelope-button {margin-top: 10px;}

@media(max-width:650px) {
  .event-extra.paper-spread {grid-template-columns: 1fr; margin: 12px 2px 4px 10px;}
  .pop-scene {min-height: 105px; transform-origin: bottom;}
  .pop-scene img {object-position: 50% 43%;}
  .pop-scene i {background: linear-gradient(0deg, #63433433, transparent 17%);}
  .pop-page {
    transform-origin: top;
    border: 0;
    border-top: 1px solid #c4ae94;
    padding: 15px 16px 11px;
    background: linear-gradient(180deg, #e8dcca, #fff9ec 13%, #fbf4e5);
  }
  .pop-page p {font-size: 18px;}
  .guest-q .fold p {padding: 13px 15px 16px;}
}

@media(prefers-reduced-motion:no-preference) {
  .save-text.arrive .swan-left {animation: swan-left-in 1.65s cubic-bezier(.18,.58,.18,1) both;}
  .save-text.arrive .swan-right {animation: swan-right-in 1.65s cubic-bezier(.18,.58,.18,1) both;}
  .save-text.arrive .ripple {animation: ripple-out 1.1s .9s ease-out both;}
  @keyframes swan-left-in {from {transform:translate(-19%, 4%) rotate(-4deg); opacity:.15;} to {transform:none; opacity:1;}}
  @keyframes swan-right-in {from {transform:translate(19%, 4%) rotate(4deg); opacity:.15;} to {transform:none; opacity:1;}}
  @keyframes ripple-out {0% {transform:scale(.2,.4); opacity:0;} 26% {opacity:.48;} 100% {transform:scale(1.9,1.25); opacity:0;}}
  .date-card.arrive .wreath img {
    mask-image: conic-gradient(from 0deg, transparent 0deg calc(180deg - var(--wreath-sweep)), #000 calc(180deg - var(--wreath-sweep)) calc(180deg + var(--wreath-sweep)), transparent calc(180deg + var(--wreath-sweep)) 360deg);
    animation: wreath-grow 1.65s cubic-bezier(.22,.61,.32,1) both;
  }
  .date-card.arrive .date-window span {animation: date-roll .9s .38s cubic-bezier(.15,.68,.18,1) both;}
  @keyframes wreath-grow {from {--wreath-sweep:0deg;} to {--wreath-sweep:180deg;}}
  @keyframes date-roll {from {transform:translateY(100%) rotateX(-50deg);} to {transform:none;}}
  .heading.arrive .ornament i {animation: foil-line .8s ease-out both;}
  .heading.arrive .ornament svg {animation: flower-turn .9s ease-out both;}
  @keyframes foil-line {from {scale:0 1;} to {scale:1 1;}}
  @keyframes flower-turn {from {rotate:-70deg;scale:.45;} to {rotate:0deg;scale:1;}}
  .venue-print.has-shutters {padding-bottom:43px;}
  .has-shutters .venue-shutters {display:block;}
  .has-shutters .venue-door {transition:transform .46s cubic-bezier(.33,.02,.75,1);}
  .doors-open .venue-door {transition:transform 1.55s cubic-bezier(.26,.04,.15,1);}
  .doors-open .venue-door::after {opacity:.3;}
  .doors-open .venue-door.left {transform:rotateY(-107deg);}
  .doors-open .venue-door.right {transform:rotateY(107deg);}
  .letter-slot {transition:grid-template-rows .75s cubic-bezier(.2,.67,.25,1);}
  .last-note {opacity:0; transform:translateY(75%) scale(.61) rotateX(-36deg); transition:transform .55s,opacity .3s;}
  .note-open .last-note {opacity:1;transform:none;transition:transform .86s .06s cubic-bezier(.15,.64,.2,1),opacity .32s .08s;}
  .note-open .last-note strong {animation: signature-write 1.05s .58s ease both;}
  @keyframes signature-write {from {clip-path:inset(0 100% 0 0);} to {clip-path:inset(0);}}
}
@media(prefers-reduced-motion:reduce) {
  .venue-replay {display:none;}
}
