/* Motion layer: animation only. No copy, layout or palette changes.
   Everything is gated on .m-on (set by motion.js when reduced motion is not requested). */
@keyframes m-rise{from{opacity:0;translate:0 16px;filter:blur(8px)}}
@keyframes m-char{from{opacity:0;translate:0 .42em;scale:.92;filter:blur(10px)}}
@keyframes m-drop{from{opacity:0;translate:0 -100%}}
@keyframes m-seal-in{0%{opacity:0;scale:1.7;filter:blur(6px)}60%{opacity:1;scale:.94;filter:blur(0)}100%{scale:1}}
@keyframes m-breathe{0%,100%{scale:1}50%{scale:1.045}}
@keyframes m-glint{0%{translate:-130% 0}28%,100%{translate:130% 0}}
@keyframes m-ring{0%{opacity:0;scale:1}12%{opacity:.85}100%{opacity:0;scale:2.2}}
@keyframes m-seal-pop{0%{scale:1}20%{scale:.86}52%{scale:1.16;opacity:1;filter:brightness(1.35)}100%{scale:1.65;opacity:0;filter:brightness(1.9) blur(5px)}}
@keyframes m-flap{0%{transform:rotateX(0);filter:brightness(1)}45%{filter:brightness(1.45)}100%{transform:rotateX(180deg);opacity:.25;filter:brightness(.7)}}
@keyframes m-glow{0%{opacity:0;scale:.15}55%{opacity:1;scale:1}100%{opacity:1;scale:1.35}}
@keyframes m-bloom{0%{opacity:0;scale:.4}55%{opacity:.93;scale:1.5}100%{opacity:.75;scale:2.3}}
@keyframes m-shimmer{0%{background-position:120% 0}55%,100%{background-position:-120% 0}}
@keyframes m-line-glint{0%{translate:-110% 0;opacity:0}15%{opacity:1}60%,100%{translate:260% 0;opacity:0}}
@keyframes m-nudge{0%,62%,100%{translate:0 0}76%{translate:5px 0}}
@keyframes m-tick{from{translate:0 -.3em;opacity:.15;filter:blur(3px)}}
@keyframes m-dot{0%{scale:0;box-shadow:0 0 0 0 #c8ad8500}55%{scale:1.7;box-shadow:0 0 0 7px #c8ad8540}100%{scale:1;box-shadow:0 0 0 0 #c8ad8500}}
@keyframes m-float{0%,100%{translate:0 0}50%{translate:0 -5px}}
@keyframes m-arch{from{clip-path:inset(9% 21% 0 21% round 50% 50% 0 0 / 34% 34% 0 0)}to{clip-path:inset(0 0 0 0 round 0 0 0 0 / 0 0 0 0)}}
@keyframes m-zoom{from{scale:1.22}to{scale:1}}

.m-split{display:inline}
.m-ch{display:inline-block;white-space:pre}
.m-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;display:block}

@media (prefers-reduced-motion:no-preference){

/* ---------- Envelope: arrival ---------- */
.m-on .cover#cover .m-canvas{z-index:5}
.m-on .cover#cover.m-intro .cover-top{animation:m-rise 1.1s .15s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .cover#cover.m-intro .cover-note{animation:m-rise 1.1s .35s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .cover#cover.m-intro .cover-names .m-ch{animation:m-char 1.1s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(.55s + var(--i)*48ms)}
.m-on .cover#cover.m-intro .cover-date{animation:m-rise 1.1s 1.25s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .cover#cover.m-intro .envelope-seal{animation:m-seal-in 1.2s .45s cubic-bezier(.2,.7,.2,1) backwards,m-breathe 3.6s 1.8s ease-in-out infinite}
.m-on .cover#cover.m-intro .open-button{animation:m-rise 1.1s 1.5s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .cover#cover.m-intro .cover-bottom{animation:m-rise 1.1s 1.7s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .cover#cover .envelope-seal:after{content:'';position:absolute;inset:0;background:linear-gradient(115deg,transparent 34%,#fff4d8aa 50%,transparent 66%);translate:-130% 0;pointer-events:none;animation:m-glint 5s 2.4s ease-in-out infinite}
.m-on .cover#cover .m-ring{position:absolute;left:var(--rx,50%);top:var(--ry,58%);width:var(--rw,92px);aspect-ratio:1;border-radius:50%;border:1px solid #e8cf9fb0;translate:-50% -50%;pointer-events:none;z-index:4;opacity:0;animation:m-ring 3s 2.2s cubic-bezier(.2,.6,.3,1) infinite}
.m-on .cover#cover .m-ring+.m-ring{animation-delay:3.7s}
.m-on .cover#cover .open-button{overflow:hidden}
.m-on .cover#cover .open-button:after{content:'';position:absolute;left:0;bottom:-1px;width:38%;height:1px;background:linear-gradient(90deg,transparent,#fff1d6,transparent);pointer-events:none;animation:m-line-glint 3.8s 2.6s ease-in-out infinite}
.m-on .cover#cover .open-button span{display:inline-block;animation:m-nudge 2.8s 2.4s ease-in-out infinite}
.m-on [dir=rtl] .cover#cover .open-button span{animation-direction:reverse}
.m-on .cover#cover .cover-names i .m-ch,.m-on .hero h1 .amp .m-ch{background:linear-gradient(105deg,#c8ad85 40%,#fff1d6 50%,#c8ad85 60%) 0 0/250% 100%;-webkit-background-clip:text;background-clip:text;color:transparent}
.m-on .cover#cover.m-intro .cover-names i .m-ch{animation:m-char 1.1s cubic-bezier(.2,.7,.2,1) backwards,m-shimmer 6s 2.4s ease-in-out infinite;animation-delay:calc(.55s + var(--i)*48ms),2.4s}

/* ---------- Envelope: opening ---------- */
.m-on .cover#cover .m-glow{position:absolute;left:var(--rx,50%);top:var(--ry,58%);width:130vmax;aspect-ratio:1;translate:-50% -50%;border-radius:50%;background:radial-gradient(circle,#fff0d2 0%,#efd3a2d0 12%,#c8ad8566 30%,#c8ad8500 58%);z-index:2;opacity:0;pointer-events:none}
.m-on .cover#cover .m-bloom{position:absolute;inset:-40%;z-index:9;pointer-events:none;opacity:0;background:radial-gradient(circle at var(--bx,50%) var(--by,58%),#fff6e4 0%,#f6e3c2f0 14%,#e9cc9ccc 28%,#c8ad8566 44%,#4a142600 62%)}
.m-on .cover#cover.opening .m-ring{animation:none;opacity:0}
.m-on .cover#cover.opening .envelope-seal{animation:m-seal-pop .7s cubic-bezier(.3,0,.2,1) forwards}
.m-on .cover#cover.opening .envelope-seal:after{animation:none;opacity:0}
.m-on .cover#cover.opening .envelope-flap{animation:m-flap 1.1s .18s cubic-bezier(.5,0,.2,1) forwards}
.m-on .cover#cover.opening .m-glow{animation:m-glow 1.2s .2s cubic-bezier(.2,.7,.2,1) forwards}
.m-on .cover#cover.opening .m-bloom{animation:m-bloom 1.5s .5s cubic-bezier(.45,0,.25,1) forwards}
.m-on .cover#cover.opening :is(.cover-top,.cover-note,.cover-names,.cover-date,.cover-bottom,.open-button){opacity:0;filter:blur(6px);translate:0 -12px;transition:opacity .45s ease,filter .45s ease,translate .7s cubic-bezier(.2,.7,.2,1)}

/* ---------- Hero ---------- */
.m-on .hero-art .m-canvas{z-index:1}
.m-on #page.revealed>header>*{animation:m-drop 1s .35s cubic-bezier(.2,.7,.2,1) backwards}
.m-on #page.revealed>header>nav{animation-delay:.5s}
.m-on #page.revealed #names .m-ch{animation:m-char 1.2s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(.8s + var(--i)*55ms)}
.m-on #page.revealed .hero h1 .amp .m-ch{animation:m-char 1.2s cubic-bezier(.2,.7,.2,1) backwards,m-shimmer 6.5s 3s ease-in-out infinite;animation-delay:calc(.8s + var(--i)*55ms),3s}
.m-on #page.revealed .image-caption span{animation:m-rise 1.3s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:1.7s}
.m-on #page.revealed .image-caption span+span{animation-delay:1.95s}
.m-on #page.revealed .hero-date strong{animation:m-rise 1.2s 1.5s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .hero .text-link span,.m-on .day-location-link span{display:inline-block;animation:m-float 2.6s 3s ease-in-out infinite}

/* ---------- Section reveals (extends the existing choreography) ---------- */
.m-on .choreo-ready{transition:opacity 1.1s ease,transform 1.3s cubic-bezier(.2,.7,.2,1),filter 1.1s ease;transition-delay:var(--reveal-delay,0ms)}
.m-on .choreo-ready:not(.choreo-seen):not(.venue-showcase):not(.countdown){filter:blur(10px)}
.m-on :is(.celebration>h2,.closing>h2,.day-heading,.count-intro).choreo-ready:not(.choreo-seen){transform:translateY(46px) scale(.97);filter:blur(14px)}
.m-on .countdown.choreo-ready:not(.choreo-seen){transform:none}
.m-on .countdown.choreo-seen>div{animation:m-rise 1.1s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .countdown.choreo-seen>div:nth-child(2){animation-delay:.12s}
.m-on .countdown.choreo-seen>div:nth-child(3){animation-delay:.24s}
.m-on .countdown.choreo-seen>div:nth-child(4){animation-delay:.36s}
.m-on .countdown span{display:inline-block}
.m-on .countdown span.m-tick{animation:m-tick .6s cubic-bezier(.2,.7,.2,1)}

/* Botanical line art draws itself in */
.m-on .botanical-frame .m-path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 3.2s cubic-bezier(.45,0,.2,1)}
.m-on .botanical-frame .m-path:nth-child(2){transition-delay:.5s}
.m-on .botanical-frame .m-path:nth-child(3){transition-delay:1s}
.m-on .botanical-frame.m-drawn .m-path{stroke-dashoffset:0}

/* Day timeline */
.m-on .day-moment.choreo-seen:after{animation:m-dot 1.4s .45s cubic-bezier(.2,.7,.2,1) backwards}
.m-on .day-moment.choreo-seen .moment-art{animation:m-float 6s 2.2s ease-in-out infinite}

/* Venue: arch opens into the full photograph */
.m-on .venue-showcase .venue-photo-frame{overflow:hidden}
.m-on .venue-showcase.choreo-seen .venue-photo-frame{animation:m-arch 2.1s cubic-bezier(.65,0,.2,1) both}
.m-on .venue-showcase.choreo-seen .venue-photo img{animation:m-zoom 3s cubic-bezier(.2,.7,.2,1) both}
.m-on .venue-showcase.choreo-seen .venue-title>*{animation:m-rise 1.2s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:.7s}
.m-on .venue-showcase.choreo-seen .venue-title>h2{animation-delay:.9s}
.m-on .venue-showcase.choreo-seen .venue-title>p:last-child{animation-delay:1.1s}

/* Closing */
.m-on .closing .m-canvas{z-index:-1}
.m-on .closing>h2.choreo-seen i{background:linear-gradient(100deg,var(--ink) 40%,#b8925f 50%,var(--ink) 60%) 0 0/300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:m-shimmer 7s 1.4s ease-in-out infinite}

/* Buttons */
.m-on .button{position:relative;overflow:hidden}
.m-on .button:after{content:'';position:absolute;top:0;bottom:0;left:0;width:45%;background:linear-gradient(105deg,transparent,#f4e6cf33,transparent);translate:-120% 0;pointer-events:none;transition:translate .9s cubic-bezier(.2,.7,.2,1)}
.m-on .button:hover:after{translate:260% 0}
}

@media (prefers-reduced-motion:reduce){.m-canvas,.m-ring,.m-glow,.m-bloom{display:none!important}}
