/* Play-to-open invitations (assets/js/xp). Each design adds its own styles; these are shared. Loaded after formats.css. */

.inv .x-wait { min-height: 100svh; display: grid; place-items: center; color: var(--i-deep); font: 600 15px 'Mukta', sans-serif; }
.inv .x-wait i { width: 34px; height: 34px; margin: 0 auto 10px; display: block; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: x-turn 1s linear infinite; }
@keyframes x-turn { to { transform: rotate(1turn); } }

/* the opening prints the names where each design puts them */
.op-words-x { top: 6svh; }
.op .x-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.op .x-layer { position: absolute; inset: 0; }
.op .x-btn { position: absolute; z-index: 4; touch-action: none; }

/* the first page */
.inv.xp > .hero.hero-x { height: 100svh; min-height: 560px; max-height: 1060px; overflow: hidden; }
.hero-x .x-layer { position: absolute; inset: 0; }
.hero-x .names span { font-size: 13cqw; }
.hero-x .scroll-hint { z-index: 5; }
.inv.xp > .hero-x .inv-head { margin: 0 0 6px; }

/* sections share the design's paper; each design can restyle .plate */
.inv.xp main > .sec { overflow: hidden; padding: 16px 14px; background: none; }
.inv.xp main > .sec .plate { position: relative; padding: 28px 20px 24px; background: var(--i-paper); color: var(--i-ink); border-radius: 18px; box-shadow: 0 12px 28px rgba(0, 0, 0, .14); }
.inv.xp .sec.dark { background: none !important; color: var(--i-ink); }
.inv.xp .sec.dark h2 { color: var(--i-deep); }
.inv.xp .sec.dark .btn.ghost { color: var(--i-accent) !important; border-color: var(--i-accent); }
.inv.xp .count div { border-color: var(--i-gold); }
.inv.xp .count b { color: var(--i-deep); }
.inv.xp .fdivider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 18px; color: var(--i-gold); }
.inv.xp .fdivider span { width: 54px; height: 1px; background: currentColor; opacity: .7; }
.inv.xp .fdivider .fmark { width: 22px; height: 22px; }

/* how each section arrives */
.xp.xe-flip .sec.will { opacity: 0; transform: perspective(900px) rotateX(-70deg); transform-origin: 50% 0; transition: opacity .6s, transform .9s cubic-bezier(.2, .9, .3, 1.2); }
.xp.xe-swing .sec.will { opacity: 0; transform: perspective(900px) rotateY(55deg); transform-origin: 0 50%; transition: opacity .6s, transform .9s cubic-bezier(.2, .9, .3, 1.1); }
.xp.xe-zoom .sec.will { opacity: 0; transform: scale(.6); transition: opacity .5s, transform .8s cubic-bezier(.2, .9, .3, 1.3); }
.xp.xe-slide .sec.will:nth-of-type(odd) { opacity: 0; transform: translateX(-60%); transition: opacity .6s, transform .8s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-slide .sec.will:nth-of-type(even) { opacity: 0; transform: translateX(60%); transition: opacity .6s, transform .8s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-drop .sec.will { opacity: 0; transform: translateY(-80px) rotate(-3deg); transition: opacity .4s, transform .9s cubic-bezier(.3, 1.6, .5, 1); }
.xp.xe-unfold .sec.will { opacity: 0; transform: perspective(800px) rotateX(88deg) scaleY(.4); transform-origin: 50% 100%; transition: opacity .5s, transform 1s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-blur .sec.will { opacity: 0; filter: blur(14px); transform: scale(1.06); transition: opacity .9s, filter .9s, transform .9s; }
.xp.xe-skew .sec.will { opacity: 0; transform: skewY(8deg) translateY(50px); transition: opacity .6s, transform .8s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-pop .sec.will { opacity: 0; transform: scale(.3) rotate(-8deg); transition: opacity .3s, transform .7s cubic-bezier(.3, 1.8, .5, 1); }
.xp.xe-spin .sec.will { opacity: 0; transform: rotate(-200deg) scale(.2); transition: opacity .6s, transform 1s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-stamp .sec.will { opacity: 0; transform: scale(2.2) rotate(6deg); transition: opacity .25s, transform .45s cubic-bezier(.6, 0, .9, .6); }
/* a clipped section is never seen by the page's watcher, so these clip the card inside it */
.xp.xe-wipe .sec.will, .xp.xe-curtain .sec.will, .xp.xe-iris .sec.will { opacity: 1; transform: none; }
.xp.xe-wipe .sec.will > .plate { clip-path: inset(0 100% 0 0); transition: clip-path 1s cubic-bezier(.6, 0, .2, 1); }
.xp.xe-curtain .sec.will > .plate { clip-path: inset(50% 0 50% 0); transition: clip-path .9s cubic-bezier(.6, 0, .2, 1); }
.xp.xe-iris .sec.will > .plate { clip-path: circle(0 at 50% 50%); transition: clip-path 1.1s cubic-bezier(.6, 0, .2, 1); }
.xp.xe-wipe .sec.will.in > .plate, .xp.xe-curtain .sec.will.in > .plate { clip-path: inset(-30px -30px -30px -30px); }
.xp.xe-iris .sec.will.in > .plate { clip-path: circle(150% at 50% 50%); }
.xp.xe-tilt .sec.will { opacity: 0; transform: perspective(700px) rotateX(35deg) rotateZ(-6deg) translateY(80px); transition: opacity .7s, transform 1s cubic-bezier(.2, .9, .3, 1); }
.xp.xe-float .sec.will { opacity: 0; transform: translateY(90px); transition: opacity 1.2s, transform 1.6s cubic-bezier(.15, .8, .2, 1); }
.xp.xe-type .sec.will { opacity: 0; letter-spacing: .4em; transition: opacity .8s, letter-spacing 1s; }
.xp.xe-type .sec.will.in { letter-spacing: normal; }
.inv.xp main > .sec.will.in { opacity: 1; transform: none; filter: none; transition-delay: .05s; }

@media (prefers-reduced-motion: reduce) {
  .xp .sec.will, .xp .sec.will > .plate { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
  .op *, .hero-x * { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}
