/* Small, finite entrances preserve the ivory page and its final composition. */
.stage { --page-enter-y: 14px; --motion-ease: cubic-bezier(.22, 1, .36, 1); isolation: isolate; }
.stage[data-direction="backward"] { --page-enter-y: -14px; }
.page { z-index: 1; background: transparent; transform: none; transition: opacity .38s ease, visibility .38s; }
.page.is-active { animation: page-arrive .65s var(--motion-ease) both; }

/* One continuous background underneath all slides; opaque, matte colour planes.
   No gradients, flashing highlights, video download or canvas redraw loop. */
.paper-background { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.paper-plane { position: absolute; inset: -18% -16%; display: block; will-change: transform; }
.paper-plane-left {
  background: #e8e2d5; opacity: .72;
  clip-path: polygon(0 0, 42% 0, 10% 100%, 0 100%);
  animation: paper-left 16s ease-in-out -4s infinite alternate;
}
.paper-plane-right {
  background: #ede7dc; opacity: .85;
  clip-path: polygon(100% 0, 100% 100%, 60% 100%);
  animation: paper-right 20s ease-in-out -9s infinite alternate;
}
.paper-plane-fold {
  background: #fffdf7; opacity: .85;
  clip-path: polygon(0 0, 28% 0, 0 52%);
  animation: paper-fold 18s ease-in-out -2s infinite alternate;
}
@keyframes paper-left {
  from { transform: translate(-6%, -2%); }
  to { transform: translate(7%, 3%); }
}
@keyframes paper-right {
  from { transform: translate(6%, 4%); }
  to { transform: translate(-7%, -3%); }
}
@keyframes paper-fold {
  from { transform: translate(-3%, -4%); }
  to { transform: translate(9%, 5%); }
}

@keyframes page-arrive {
  from { opacity: 0; transform: translateY(var(--page-enter-y)); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes quiet-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes portrait-reveal {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes seal-reveal {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: .82; transform: scale(1); }
}
@keyframes row-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes swipe-rise {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-2px); }
}
@keyframes music-turn { to { transform: rotate(360deg); } }

.page.is-active .page-logo {
  animation: quiet-reveal .85s var(--motion-ease) .05s both;
}
.page.is-active .cover-content h1,
.page.is-active .page-heading h2 {
  animation: quiet-reveal .85s var(--motion-ease) .15s both;
}
.page.is-active .cover-subtitle,
.page.is-active .page-heading .zh-heading {
  animation: quiet-reveal .8s var(--motion-ease) .3s both;
}
.page.is-active .cover-content .origin,
.page.is-active .agenda-date {
  animation: quiet-reveal .8s var(--motion-ease) .42s both;
}
.page.is-active .page-copy > p {
  animation: quiet-reveal .75s var(--motion-ease) .28s both;
}
.page.is-active .page-copy > p:nth-child(2) { animation-delay: .38s; }
.page.is-active .page-copy > p:nth-child(3) { animation-delay: .48s; }
.page.is-active .page-copy > p:nth-child(4) { animation-delay: .58s; }
.page.is-active .page-copy > p:nth-child(5) { animation-delay: .68s; }
.page.is-active .guest-photo {
  animation: portrait-reveal .95s var(--motion-ease) .25s both;
}
.page.is-active .guest-name {
  animation: quiet-reveal .8s var(--motion-ease) .43s both;
}
.page.is-active .guest-introduction {
  animation: quiet-reveal .8s var(--motion-ease) .56s both;
}
.page.is-active .agenda-table tr {
  animation: row-reveal .75s ease .38s both;
}
.page.is-active .agenda-table tr:nth-child(2) { animation-delay: .47s; }
.page.is-active .agenda-table tr:nth-child(3) { animation-delay: .56s; }
.page.is-active .agenda-table tr:nth-child(4) { animation-delay: .65s; }
.page.is-active .agenda-table tr:nth-child(5) { animation-delay: .74s; }
.page.is-active .agenda-actions,
.page.is-active .contact-actions,
.page.is-active .contact-phones {
  animation: quiet-reveal .75s var(--motion-ease) .65s both;
}
.page.is-active .contact-ending { animation-delay: .78s; }
.page.is-active .seal {
  animation: seal-reveal .95s var(--motion-ease) .6s both;
}
.page.is-active .page-footer {
  animation: quiet-reveal .75s var(--motion-ease) .75s both;
}
.page.is-active .swipe-hint svg {
  animation: swipe-rise 2.8s ease-in-out 1.5s infinite;
}
.music-toggle[aria-pressed="true"] svg {
  animation: music-turn 16s linear infinite;
}
.music-toggle[aria-pressed="false"] svg { animation-play-state: paused; }

.icon-button, .text-button, .mode-switch button, .music-toggle {
  transition: background-color .22s ease, border-color .22s ease,
    color .22s ease, transform .22s ease;
}
.indicator-dots button { transition: width .35s ease, background-color .35s ease; }
.page-nav button { transition: color .25s ease, opacity .25s ease; }
@media (hover: hover) {
  .icon-button:not(:disabled):hover { transform: translateY(-2px); color: var(--gold); }
  .text-button:hover { border-color: var(--gold); color: var(--gold); background: #a18a5e08; }
  .page-nav button:hover { opacity: 1; }
}
.icon-button:not(:disabled):active, .text-button:active, .music-toggle:active {
  transform: translateY(1px);
}
.motion-paused .page, .motion-paused .page *, .motion-paused .music-toggle svg,
.motion-paused .paper-plane {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .viewer *, .viewer *::before, .viewer *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .paper-background { display: none; }
  .viewer *, .viewer *::before, .viewer *::after {
    animation: none !important;
    transition: none !important;
  }
}
