/* motion.css — demo Sestolando (fs-motion, ondata 5b, 04/12/2026). Contratto: ufficio/07-motion.md
   Regole: si anima solo transform e opacity (più pochi fill a scatti); ogni stato nascosto sta sotto html.mv,
   che mette js/motion.js e che con prefers-reduced-motion non c'è. Senza questo file la pagina resta intera e ferma.
   Le animazioni «a tempo» si chiamano tempo-* e durano 4 s (o 2 s): motion.js le allinea all'inizio della timeline.
   Le scene in loop si spengono fuori schermo con .mv-fuori (le mette motion.js), così non costano niente. */

/* ===================== HERO ===================== */
/* H3 · nota calda sotto l'ultima «o» */
.marchio__lettera--o::after{content:""; position:absolute; z-index:-1; left:50%; bottom:.06em; width:.9em; height:.3em; translate:-50% 0; border-radius:50%;
  background:radial-gradient(closest-side, rgba(255,111,97,.7), rgba(255,111,97,0)); opacity:.4; pointer-events:none}
@keyframes tempo-nota-o{0%{opacity:1; transform:scale(1.15)} 7%{opacity:.4; transform:none} 50%{opacity:1; transform:scale(1.15)} 57%,100%{opacity:.4; transform:none}}
html.mv .marchio__lettera--o::after{animation:tempo-nota-o 4s linear infinite}

/* H5 · stelle che brillano a turno (tre svg separati: l'opacità gira sul compositore) */
@keyframes stelle{0%,100%{opacity:.35} 50%{opacity:1}}
html.mv .hero__stelle > .stelle--a{animation:stelle 3.2s ease-in-out infinite}
html.mv .hero__stelle > .stelle--b{animation:stelle 4.4s ease-in-out -1.4s infinite}
html.mv .hero__stelle > .stelle--c{animation:stelle 5.6s ease-in-out -2.9s infinite}

/* K2 · alone della luna che respira (solo desktop, dove si vede) */
@keyframes alone{0%,100%{opacity:.7; transform:scale(.96)} 50%{opacity:1; transform:scale(1.04)}}
html.mv .hero__alone{animation:alone 8s ease-in-out infinite}

/* H6 · finestre dell'hotel: si accendono una dopo l'altra, poi ogni tanto una sfarfalla */
@keyframes fin-accendi{from{opacity:0}}
@keyframes fin-sfarfalla{0%,43%,50%,100%{fill-opacity:1} 44%{fill-opacity:.12} 47%{fill-opacity:.85} 49%{fill-opacity:.2}}
html.mv .scena__finestre rect{animation:fin-accendi .3s ease-out backwards}
html.mv .scena__finestre rect:nth-child(3n+2){animation:fin-accendi .3s ease-out backwards, fin-sfarfalla 9s step-end 3s infinite}
html.mv .scena__finestre rect:nth-child(5n+4){animation:fin-accendi .3s ease-out backwards, fin-sfarfalla 11s step-end 6s infinite}

/* H7 · seggiovia: le seggiole salgono lente lungo il cavo (640,470 → 900,318) */
@keyframes seggiola{0%{transform:translate(640px,470px); opacity:0} 6%{opacity:1} 92%{opacity:1} 100%{transform:translate(900px,318px); opacity:0}}
html.mv .seggiola{animation:seggiola 20s linear infinite}
html.mv .seggiola:nth-child(2){animation-delay:-5s} html.mv .seggiola:nth-child(3){animation-delay:-10s} html.mv .seggiola:nth-child(4){animation-delay:-15s}

/* H8 · fumo dal camino */
@keyframes fumo{0%{opacity:0; transform:none} 25%{opacity:.4} 100%{opacity:0; transform:translateY(-16px) scale(1.7)}}
.scena__fumo circle{transform-box:fill-box; transform-origin:50% 50%}
html.mv .scena__fumo circle{animation:fumo 3.2s ease-out infinite}
html.mv .scena__fumo circle:nth-child(2){animation-delay:-1.6s}

/* K1 · la coppia sulla neve: lui fa il passo base, lei fa il giro sotto il braccio sui tempi 5-6-7 */
@keyframes tempo-coppia-lui{0%{transform:none} 6%{transform:translateX(3px)} 12.5%{transform:translateX(3px)} 18%{transform:translateX(1px)} 25%,50%{transform:none}
  56%{transform:translateX(-3px)} 62.5%{transform:translateX(-3px)} 68%{transform:translateX(-1px)} 75%,100%{transform:none}}
@keyframes tempo-coppia-lei{0%{transform:none} 6%{transform:translateX(3px)} 12.5%{transform:translateX(3px)} 18%{transform:translateX(1px)} 25%,50%{transform:none}
  58%{transform:scaleX(.42)} 58.1%{transform:scaleX(-.42)} 66%{transform:scaleX(-1)} 74%{transform:scaleX(-.42)} 74.1%{transform:scaleX(.42)} 82%,100%{transform:none}}
/* QA P2-1: nel giro scaleX non scende mai sotto 0,42 (salto netto a metà, come la spalla che passa): lei non diventa mai una striscia */
@keyframes tempo-gonna{0%,50%{transform:none} 58%,74%{transform:scale(1.3,.9)} 66%{transform:scale(1.18,.94)} 84%,100%{transform:none}}
html.mv .coppia__lui{animation:tempo-coppia-lui 4s ease-in-out infinite}
html.mv .coppia__lei{animation:tempo-coppia-lei 4s ease-in-out infinite}
html.mv .coppia__gonna{animation:tempo-gonna 4s ease-in-out infinite}

/* fuori schermo le scene dell'hero non girano (al rientro motion.js le rimette a tempo) */
html.mv #hero.mv-fuori :is(.hero__stelle > svg, .hero__alone, .seggiola, .scena__fumo circle, .coppia__lui, .coppia__lei, .coppia__gonna, .scena__finestre rect){animation:none}

/* ===================== 1 · WEEKEND: icone del mestiere a turno (E0-E5) ===================== */
.icona-mestiere svg *{transform-box:fill-box}
.mestiere{cursor:pointer}
@keyframes ico-sci{0%{transform:none} 25%{transform:translate(-4px,-1.5px) rotate(-8deg)} 50%{transform:translate(3px,1.5px) rotate(7deg)} 75%{transform:translate(-1px,0) rotate(-3deg)} 100%{transform:none}}
@keyframes ico-sbuffo{0%,20%{opacity:0; transform:scale(.4)} 45%{opacity:1; transform:translate(-2px,-1px) scale(1.2)} 100%{opacity:0; transform:translate(-4px,-3px) scale(1.6)}}
.mestiere.is-gioca [data-icona="sci"] .ico__sciatore{transform-origin:50% 100%; animation:ico-sci 1.6s cubic-bezier(.4,0,.2,1)}
.mestiere.is-gioca [data-icona="sci"] .ico__sbuffo{transform-origin:50% 50%; animation:ico-sbuffo 1.6s ease-out}
@keyframes ico-ciaspola{0%,100%{transform:none} 20%{transform:translateY(-3px) rotate(-8deg)} 40%{transform:none}}
@keyframes ico-impronta{0%{opacity:0; transform:scale(.3)} 100%{opacity:1; transform:none}}
.mestiere.is-gioca .ico__ciaspola--sx{transform-origin:50% 100%; animation:ico-ciaspola 1.6s ease-in-out}
.mestiere.is-gioca .ico__ciaspola--dx{transform-origin:50% 100%; animation:ico-ciaspola 1.6s ease-in-out .5s backwards}
.mestiere.is-gioca .ico__impronta{transform-origin:50% 50%; animation:ico-impronta .3s ease-out backwards}
.mestiere.is-gioca .ico__impronta:nth-of-type(1){animation-delay:.3s} .mestiere.is-gioca .ico__impronta:nth-of-type(2){animation-delay:.8s} .mestiere.is-gioca .ico__impronta:nth-of-type(3){animation-delay:1.3s}
@keyframes ico-piede{0%,100%{transform:none} 15%{transform:translateY(-4px)} 30%{transform:none}}
.mestiere.is-gioca .ico__piede--sx{animation:ico-piede 2s ease-in-out}
.mestiere.is-gioca .ico__piede--dx{animation:ico-piede 2s ease-in-out .5s backwards}
@keyframes ico-nota{0%,50%,100%{transform:none} 15%,65%{transform:translateY(-3px) rotate(-6deg)}}
@keyframes ico-notina{0%{opacity:0; transform:none} 25%{opacity:1} 100%{opacity:0; transform:translateY(-7px)}}
.mestiere.is-gioca .ico__nota{transform-origin:50% 100%; animation:ico-nota 2s ease-in-out}
.mestiere.is-gioca .ico__notina{animation:ico-notina 1.4s ease-out .2s backwards}
.mestiere.is-gioca .ico__notina + .ico__notina{animation-delay:.7s}
@keyframes ico-vapore{0%{stroke-dashoffset:12; opacity:0} 20%{opacity:1} 70%{stroke-dashoffset:0; opacity:1} 100%{stroke-dashoffset:-12; opacity:0}}
@keyframes ico-panna{0%,100%{transform:none} 30%{transform:translateY(-1.5px) scale(1.06)} 45%{transform:translateY(0) scale(1.04,.94)} 60%{transform:none}}
.mestiere.is-gioca .ico__vapore{stroke-dasharray:12; animation:ico-vapore 2.4s ease-in-out}
.mestiere.is-gioca .ico__vapore + .ico__vapore{animation-delay:.4s}
.mestiere.is-gioca .ico__panna{transform-origin:50% 100%; animation:ico-panna 2.4s ease-in-out}
.mestiere.is-gioca .icona-mestiere{transition:transform .2s var(--ease); transform:translateY(-2px)}

/* ===================== R1 · ingressi a scorrimento ===================== */
html.mv [data-mv="entra"]{transition:opacity .52s cubic-bezier(.2,.7,.2,1), transform .52s cubic-bezier(.2,.7,.2,1); transition-delay:calc(var(--i, 0) * 70ms)}
html.mv [data-mv="entra"]:not(.is-dentro){opacity:0; transform:translateY(16px)}

/* ===================== 2 · PROGRAMMA ===================== */
/* C1: il cielo lo scrive motion.js (opacità e transform); qui solo le luci della pista */
html.mv .programma__cielo .luce-pista{opacity:.18; transition:opacity .3s ease-out}
html.mv .programma__cielo .luce-pista.is-accesa{opacity:1}
/* C2: il pannello del giorno scelto entra in dissolvenza (telefono) */
@keyframes pannello-entra{from{opacity:0; transform:translateY(8px)}}
@media (max-width:1023.98px){ html.mv .programma__pannello.is-attivo{animation:pannello-entra .18s cubic-bezier(.2,.7,.2,1)} }
/* C3: le tre luci della sera lampeggiano sull'1-2-3 */
@keyframes tempo-sera{0%{opacity:1; transform:scale(1.3)} 9%{opacity:1; transform:none} 12.5%,100%{opacity:.5; transform:none}}
html.mv .sera__luci i{animation:tempo-sera 4s linear infinite}
html.mv .sera__luci i:nth-child(2){animation-delay:.5s} html.mv .sera__luci i:nth-child(3){animation-delay:1s}
html.mv #programma.mv-fuori .sera__luci i{animation:none}

/* ===================== 3 · SERATE: luci della pista ===================== */
/* D1: i fasci si accendono uno dopo l'altro all'ingresso, poi oscillano a tempo */
@keyframes tempo-luce{0%,100%{transform:rotate(-12deg)} 50%{transform:rotate(12deg)}}
html.mv .luce{transition:opacity .4s ease-out; animation:tempo-luce 4s ease-in-out infinite}
html.mv .luce:nth-child(2){transition-delay:.14s; animation-delay:-1s} html.mv .luce:nth-child(3){transition-delay:.28s; animation-delay:-2s} html.mv .luce:nth-child(4){transition-delay:.42s; animation-delay:-3s}
html.mv #serate:not(.is-visibile) .luce{opacity:0}
/* D2: le piastrelle si accendono a tempo, una per battuta (cambi a scatti: 8 ridisegni ogni 4 s) */
@keyframes tempo-pavimento{0%,11%{fill:#8A3550}}
html.mv .pista__pavimento rect{animation:tempo-pavimento 4s step-start infinite}
html.mv .pista__pavimento rect:nth-child(4n+2){animation-delay:.5s} html.mv .pista__pavimento rect:nth-child(4n+3){animation-delay:1.5s} html.mv .pista__pavimento rect:nth-child(4n){animation-delay:2.5s}
html.mv .pista__pavimento rect:nth-child(5n){animation-delay:3s} html.mv .pista__pavimento rect:nth-child(7n){animation-delay:2s}
/* D3: le coppie ondeggiano a tempo, perno ai piedi */
@keyframes tempo-sagoma{0%,100%{transform:rotate(-3deg)} 25%{transform:rotate(0)} 50%{transform:rotate(3deg)} 75%{transform:rotate(0)}}
.sagoma--coppia{transform-box:fill-box; transform-origin:50% 100%}
html.mv .sagoma--coppia{animation:tempo-sagoma 4s ease-in-out infinite}
html.mv .sagoma--coppia + .sagoma--coppia{animation-delay:-2s}
/* D4: i dischi dei DJ girano piano */
@keyframes tempo-disco{to{transform:rotate(1turn)}}
html.mv .dj__disco{animation:tempo-disco 4s linear infinite}
html.mv #serate.mv-fuori :is(.luce, .pista__pavimento rect, .sagoma--coppia, .dj__disco){animation:none}

/* ===================== 5 · PACCHETTI ===================== */
/* P1: il cerchietto scelto pulsa una volta */
@keyframes segno{from{transform:scale(.4); opacity:.4}}
html.mv .chip:has(.chip__input:checked) .chip__segno::after{animation:segno .18s ease-out}
/* P3: la pillola del risparmio entra con un piccolo pop (ogni volta che compare) */
@keyframes risparmio{from{transform:scale(.85); opacity:0}}
html.mv .prezzo__risparmio{animation:risparmio .24s cubic-bezier(.3,1.4,.5,1)}
/* (P2 cambio di prezzo e P4 sbuffo dal chip: motion.js) */

/* ===================== 7 · DOMANDE ===================== */
@keyframes faq-apri{from{opacity:0; transform:translateY(8px)}}
html.mv .faq__voce[open] .faq__risposta{animation:faq-apri .18s cubic-bezier(.2,.7,.2,1)}

/* ===================== FOOTER: il marchio balla anche qui (Z1) ===================== */
html.mv .piede__lettere .marchio__lettera{animation:4s linear infinite}
html.mv .piede__lettere .marchio__lettera:nth-child(-n+3){animation-name:tempo-passo-g1}
html.mv .piede__lettere .marchio__lettera:nth-child(n+4):nth-child(-n+6){animation-name:tempo-passo-g2}
html.mv .piede__lettere .marchio__lettera:nth-child(n+7){animation-name:tempo-passo-g3}
html.mv #piede.mv-fuori .piede__lettere .marchio__lettera{animation:none}

/* galleria dell'hotel: foto che scorrono con dissolvenza e zoom lento (8 foto x 4 s) */
@keyframes galleria-scorre{0%{opacity:0; transform:scale(1.02)}3%{opacity:1}12.5%{opacity:1}15.5%{opacity:0; transform:scale(1.1)}100%{opacity:0; transform:scale(1.1)}}
html.mv .galleria__foto{opacity:0; animation:galleria-scorre 32s linear infinite}
html.mv .galleria__foto:nth-child(2){animation-delay:4s} html.mv .galleria__foto:nth-child(3){animation-delay:8s}
html.mv .galleria__foto:nth-child(4){animation-delay:12s} html.mv .galleria__foto:nth-child(5){animation-delay:16s}
html.mv .galleria__foto:nth-child(6){animation-delay:20s} html.mv .galleria__foto:nth-child(7){animation-delay:24s}
html.mv .galleria__foto:nth-child(8){animation-delay:28s}
html.mv #hotel.mv-fuori .galleria__foto{animation-play-state:paused}

/* striscia della promo: il testo scorre da destra a sinistra, si ferma al passaggio del mouse o col focus */
@keyframes striscia-scorre{from{transform:translateX(0)}to{transform:translateX(-50%)}}
html.mv .striscia__nastro{animation:striscia-scorre 32s linear infinite}
html.mv .striscia:hover .striscia__nastro, html.mv .striscia:focus-visible .striscia__nastro{animation-play-state:paused}
