/* Riang · the motion layer: what makes the page feel like a party.

   Hand-written (the importer does not touch it) and loaded after fit.css. Four parts:
     1. living stickers   every .deco .o pops in, then keeps moving in a way that suits what it is
     2. the opening       the cover pops away, the first screen arrives piece by piece
     3. arrivals          each section's content rises in turn; small rewards (name, countdown, button)
     4. ambient           falling leaves, stars, bursts or confetti, kept to the page's side gutters

   Stickers move with the `translate`, `rotate` and `scale` properties, never `transform`: several
   themes already use `transform` to mirror or tilt a sticker, and that must survive.

   REDUCED MOTION. A birthday invitation animates whatever the OS preference says (the same decision
   as the birthday keepsakes, 2026-11). The block at the foot of this file undoes base.css's
   reduced-motion rules; riang.js halves the ambient particles instead of removing them. */

/* ------------------------------------------------------------ 1. living stickers */
.deco .o {
  scale: 0;
  transition: scale .7s cubic-bezier(.34, 1.56, .64, 1);
  transition-delay: calc(var(--i, 0) * 110ms + 120ms);
  animation: var(--live, riang-bob 5.4s ease-in-out infinite);
  animation-delay: calc(var(--i, 0) * -1.3s);
  will-change: translate, rotate;
}
/* --fit: riang.js draws a sticker smaller where it would otherwise sit on words (see declash) */
.is-seen .deco .o { scale: var(--fit, 1); }
.deco .o:nth-child(1) { --i: 0; }
.deco .o:nth-child(2) { --i: 1; }
.deco .o:nth-child(3) { --i: 2; }
.deco .o:nth-child(4) { --i: 3; }
.deco .o:nth-child(5) { --i: 4; }
.deco .o:nth-child(6) { --i: 5; }
.deco .o:nth-child(7) { --i: 6; }
.deco .o:nth-child(8) { --i: 7; }

/* riang.js names each sticker's kind of movement from the picture it shows. */
.deco .o[data-live="drift"] { --live: riang-drift 7s ease-in-out infinite; }
.deco .o[data-live="swing"] { --live: riang-swing 3.6s ease-in-out infinite; transform-origin: 50% 0; }
.deco .o[data-live="sway"] { --live: riang-sway 5s ease-in-out infinite; transform-origin: 50% 100%; }
.deco .o[data-live="rise"] { --live: riang-rise 4.6s ease-in-out infinite; transform-origin: 50% 100%; }
.deco .o[data-live="pulse"] { --live: riang-pulse 4.2s ease-in-out infinite; }
.deco .o[data-live="wiggle"] { --live: riang-wiggle 3.2s ease-in-out infinite; }
.deco .o[data-live="rumble"] { --live: riang-rumble 1.1s ease-in-out infinite; }
.deco .o[data-live="still"] { --live: riang-breathe 6s ease-in-out infinite; }
/* A sticker that would sit on top of words is taken away (riang.js measures; see declash). */
.deco .o.is-clash { scale: 0 !important; }

@keyframes riang-bob { 0%, 100% { translate: 0 0; rotate: -1.5deg; } 50% { translate: 0 -9px; rotate: 1.5deg; } }
@keyframes riang-drift { 0%, 100% { translate: 0 0; rotate: -3deg; } 25% { translate: -10px -8px; rotate: 2deg; } 50% { translate: -4px -14px; rotate: 4deg; } 75% { translate: 8px -6px; rotate: -1deg; } }
@keyframes riang-swing { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
@keyframes riang-sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@keyframes riang-rise { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -12px; rotate: 3deg; } }
@keyframes riang-pulse { 0%, 100% { translate: 0 0; rotate: -2deg; } 40% { translate: 0 -12px; rotate: 1deg; } 60% { translate: 0 -10px; rotate: 2deg; } }
@keyframes riang-wiggle { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -8deg; } 80% { rotate: 7deg; } 90% { rotate: -4deg; } }
@keyframes riang-rumble { 0%, 100% { translate: 0 0; } 25% { translate: 1px -1.5px; } 75% { translate: -1px 1px; } }
@keyframes riang-breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* ------------------------------------------------------------ 2. the opening */
#gate { transition: opacity .55s ease .2s, visibility 0s linear .8s; }
#gate .gate__in { transition: scale .6s cubic-bezier(.5, -0.4, .7, 1), opacity .45s ease .15s; }
#gate.is-open .gate__in { scale: 1.18; opacity: 0; }
/* the cover's photo and button are alive while it waits to be opened */
.photo--cover, .photo--side { animation: riang-float 5s ease-in-out infinite; }
@keyframes riang-float { 0%, 100% { translate: 0 0; rotate: -1.2deg; } 50% { translate: 0 -7px; rotate: 1.2deg; } }
.btn--open { position: relative; animation: riang-nudge 2.8s ease-in-out infinite; }
.btn--open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid currentColor; opacity: 0; pointer-events: none; animation: riang-ring 2.8s ease-out infinite; }
@keyframes riang-nudge { 0%, 70%, 100% { scale: 1; rotate: 0deg; } 78% { scale: 1.06; rotate: -2deg; } 86% { scale: 1.06; rotate: 2deg; } 93% { scale: 1.02; rotate: 0deg; } }
@keyframes riang-ring { 0%, 60% { opacity: 0; scale: 1; } 70% { opacity: .55; scale: 1; } 100% { opacity: 0; scale: 1.25 1.6; } }
.gate__in .ttl > *, .gate__in .guest, .gate__in .gate__date, .gate__in .btn--open, .gate__in .photo--cover {
  opacity: 0; translate: 0 18px;
}
.gate__in.is-seen .ttl > *, .gate__in.is-seen .guest, .gate__in.is-seen .gate__date, .gate__in.is-seen .btn--open, .gate__in.is-seen .photo--cover {
  opacity: 1; translate: 0 0; transition: opacity .6s ease, translate .7s cubic-bezier(.2, .9, .3, 1.3);
}
.gate__in.is-seen .photo--cover { transition-delay: .05s; }
.gate__in.is-seen .ttl > :nth-child(1) { transition-delay: .2s; }
.gate__in.is-seen .ttl > :nth-child(2) { transition-delay: .3s; }
.gate__in.is-seen .ttl > :nth-child(3) { transition-delay: .4s; }
.gate__in.is-seen .ttl > :nth-child(n+4) { transition-delay: .5s; }
.gate__in.is-seen .gate__date { transition-delay: .55s; }
.gate__in.is-seen .guest { transition-delay: .65s; }
.gate__in.is-seen .btn--open { transition-delay: .8s; }

/* the burst thrown when the cover opens, and again for a reply or a wish that was sent */
.riang-burst { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; }
.riang-burst i {
  position: absolute; left: 0; top: 0; width: var(--w, 9px); height: var(--h, 13px); border-radius: var(--r, 2px); background: var(--c, #ffc93c);
  animation: riang-burst var(--t, 1.4s) cubic-bezier(.12, .7, .3, 1) forwards;
}
@keyframes riang-burst {
  0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 120px)) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ------------------------------------------------------------ 3. arrivals */
/* base.css fades a whole section in as one block; here its pieces arrive one after another. */
.sec__in { opacity: 1; transform: none; transition: none; }
.sec__in > * { opacity: 0; translate: 0 24px; }
.sec__in.in > * { opacity: 1; translate: 0 0; transition: opacity .6s ease, translate .7s cubic-bezier(.2, .9, .3, 1.25); transition-delay: calc(var(--k, 0) * 90ms); }
.sec__in > :nth-child(1) { --k: 0; }
.sec__in > :nth-child(2) { --k: 1; }
.sec__in > :nth-child(3) { --k: 2; }
.sec__in > :nth-child(4) { --k: 3; }
.sec__in > :nth-child(5) { --k: 4; }
.sec__in > :nth-child(n+6) { --k: 5; }

/* the first screen: the photo pops, the name lands with a bounce */
.sec--hero .sec__in.in .photo--hero { animation: riang-pop .8s cubic-bezier(.34, 1.56, .64, 1) both, riang-float 5.5s ease-in-out .8s infinite; }
@keyframes riang-pop { 0% { scale: .6; } 100% { scale: 1; } }
/* on the name's own box, not the span inside: two themes paint the name through background-clip */
.sec--hero .sec__in.in .ttl__name { animation: riang-jelly 1s cubic-bezier(.3, 1.4, .5, 1) .35s both; }
.sec--closing .sec__in.in .closing__name { animation: riang-jelly 1s cubic-bezier(.3, 1.4, .5, 1) .35s both; }
@keyframes riang-jelly { 0% { scale: .4 .4; } 45% { scale: 1.12 .92; } 65% { scale: .96 1.05; } 82% { scale: 1.03 .98; } 100% { scale: 1 1; } }
.ttl__age span, .ttl__tag span { animation: riang-wiggle 4s ease-in-out 1.2s infinite; }

/* the countdown: tiles drop in one by one, the seconds tick with a little jump */
.sec__in.in .cd__c { animation: riang-drop .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.sec__in.in .cd__c:nth-child(2) { animation-delay: .08s; }
.sec__in.in .cd__c:nth-child(3) { animation-delay: .16s; }
.sec__in.in .cd__c:nth-child(4) { animation-delay: .24s; }
.cd__n { display: inline-block; }
.cd__n.is-tick { animation: riang-tick .45s ease-out; }
@keyframes riang-drop { 0% { translate: 0 -18px; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
@keyframes riang-tick { 0% { translate: 0 -5px; scale: 1.12; } 100% { translate: 0 0; scale: 1; } }

/* lists and tiles arrive in turn */
.sec__in.in .dt, .sec__in.in .run__i, .sec__in.in .infos__i, .sec__in.in .gallery__item, .sec__in.in .wish, .sec__in.in .bank {
  animation: riang-item .6s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--n, 0) * 90ms + 250ms);
}
.sec__in.in .gallery__item { animation-name: riang-tile; }
.sec__in.in :is(.dt, .run__i, .infos__i, .gallery__item, .wish, .bank):nth-child(2) { --n: 1; }
.sec__in.in :is(.dt, .run__i, .infos__i, .gallery__item, .wish, .bank):nth-child(3) { --n: 2; }
.sec__in.in :is(.dt, .run__i, .infos__i, .gallery__item, .wish, .bank):nth-child(4) { --n: 3; }
.sec__in.in :is(.dt, .run__i, .infos__i, .gallery__item, .wish, .bank):nth-child(5) { --n: 4; }
.sec__in.in :is(.dt, .run__i, .infos__i, .gallery__item, .wish, .bank):nth-child(n+6) { --n: 5; }
@keyframes riang-item { 0% { translate: -14px 0; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
@keyframes riang-tile { 0% { scale: .7; rotate: -6deg; opacity: 0; } 100% { scale: 1; rotate: 0deg; opacity: 1; } }

/* small things under the finger */
.h-sec .orn--head-top svg, .h-sec .orn--head-top img { animation: riang-wiggle 3.6s ease-in-out infinite; transform-origin: 50% 80%; }
.btn--cta .ic--end, .btn--map .ic--end { animation: riang-point 1.4s ease-in-out infinite; }
@keyframes riang-point { 0%, 100% { translate: 0 0; } 50% { translate: 4px 0; } }
.btn:active { scale: .96; }
.riang-music[aria-pressed="true"] .ic { animation: riang-swing 1.2s ease-in-out infinite; transform-origin: 50% 20%; }

/* ------------------------------------------------------------ 4. ambient */
/* riang.js builds .fx for every theme and keeps its pieces to the side gutters on a phone, so nothing
   falls across the words. The theme's own .fx i rules (confetti colours, petals, bubbles) still apply. */
.fx i { will-change: transform; }
.fx--leaf i { width: 15px; height: 9px; border-radius: 0 100% 0 100%; background: var(--c, #6aa93a); animation-name: fx-leaf; }
@keyframes fx-leaf {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; } 8% { opacity: .85; }
  25% { transform: translate3d(22px, 26vh, 0) rotate(calc(var(--rot) * .25)); } 50% { transform: translate3d(-14px, 52vh, 0) rotate(calc(var(--rot) * .5)); }
  75% { transform: translate3d(18px, 78vh, 0) rotate(calc(var(--rot) * .75)); } 92% { opacity: .7; }
  100% { transform: translate3d(0, 106vh, 0) rotate(var(--rot)); opacity: 0; }
}
/* stars stay where they are and twinkle */
.fx--star i { top: var(--top, 20%); width: var(--size, 8px); height: var(--size, 8px); background: var(--c, #fff);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: fx-twinkle ease-in-out infinite; }
@keyframes fx-twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0); } 50% { opacity: .95; transform: scale(1.15) rotate(45deg); } }
.fx--star b { position: absolute; top: 12%; left: -20%; width: 90px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff); opacity: 0; animation: fx-shoot 9s linear 3s infinite; }
@keyframes fx-shoot { 0%, 86% { transform: translate3d(0, 0, 0) rotate(18deg); opacity: 0; } 88% { opacity: .9; } 100% { transform: translate3d(140vw, 44vh, 0) rotate(18deg); opacity: 0; } }
/* comic bursts pop in the gutters */
.fx--pop i { top: var(--top, 20%); width: var(--size, 22px); height: var(--size, 22px); background: var(--c, #ffd21f);
  clip-path: polygon(50% 0, 62% 26%, 90% 14%, 78% 40%, 100% 54%, 74% 62%, 82% 92%, 56% 76%, 40% 100%, 34% 70%, 4% 78%, 22% 52%, 0 34%, 30% 30%); animation: fx-pop ease-out infinite; }
@keyframes fx-pop { 0%, 62%, 100% { transform: scale(0) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.2) rotate(6deg); opacity: .95; } 80% { transform: scale(1) rotate(0); opacity: .95; } 92% { transform: scale(1) rotate(0); opacity: 0; } }

/* ------------------------------------------------------------ reduced motion: still a party */
@media (prefers-reduced-motion: reduce) {
  #gate { transition: opacity .55s ease .2s, visibility 0s linear .8s; }
  .fx { display: block; }
}
