/* Movimento allo scorrimento: parallasse, tendine sulle foto, testi a scaletta, icone disegnate, striscia */

/* intestazione che si restringe */
.top-in { transition: height .4s ease; }
.top.scrolled .top-in { height: 58px; }
.top.scrolled .logo-icon { width: 34px; height: 34px; }
.logo-icon { transition: width .4s, height .4s; }
@media (min-width: 961px) { .top.scrolled + * { } }

/* apertura: entrata a scaletta; la parallasse la muove main.js */
.hero-bg { animation: none; transform: scale(1.08); will-change: transform; }
.hero-in { will-change: transform, opacity; }
.hero-in > * { opacity: 0; transform: translateY(30px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.loaded .hero-in > * { opacity: 1; transform: none; }
.loaded .hero-in > :nth-child(1) { transition-delay: .25s; }
.loaded .hero-in > :nth-child(2) { transition-delay: .55s; }
.loaded .hero-in > :nth-child(3) { transition-delay: .8s; }
.hero h1 .hero-pre { display: block; opacity: 0; transform: translateY(14px); transition: opacity .9s .1s, transform .9s .1s; }
.loaded .hero h1 .hero-pre { opacity: 1; transform: none; }

/* foto: tendina laterale + leggera riduzione dello zoom + parallasse */
.split-img { overflow: hidden; }
.pimg { position: absolute; left: 0; right: 0; top: -12%; height: 124%; background-size: cover; background-position: center 25%; will-change: transform; }
.wipe { clip-path: inset(0 0 0 100%); transition: clip-path 1.3s cubic-bezier(.77,0,.18,1); }
.split.reverse .wipe { clip-path: inset(0 100% 0 0); }
.wipe.in { clip-path: inset(0 0 0 0); }
.wipe .pimg { scale: 1.18; transition: scale 1.8s cubic-bezier(.2,.7,.2,1); }
.wipe.in .pimg { scale: 1; }
.split-mark { opacity: 0; transition: opacity 1s .9s, transform 1.2s .9s cubic-bezier(.2,.7,.2,1); transform: translate(-50%,-30%) rotate(-8deg); }
.wipe.in .split-mark { opacity: 1; transform: translate(-50%,-50%) rotate(0); }

/* testi a scaletta: ogni riga entra dopo la precedente */
.stagger > * { opacity: 0; transform: translateY(34px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * .11s); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger .rule { width: 0 !important; opacity: 1; transform: none; transition: width 1s cubic-bezier(.77,0,.18,1); transition-delay: calc(var(--i, 0) * .11s + .1s); }
.stagger.in .rule { width: 48px !important; }
.contact-list.stagger > li { transform: translateX(40px); }
.contact-list.stagger.in > li { transform: none; }

/* icone che si disegnano */
.draw path, .draw circle { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.65,0,.35,1); transition-delay: calc(var(--d, 0s) + .3s); }
.in .draw path, .in .draw circle, .draw.in path, .draw.in circle { stroke-dashoffset: 0; }

/* riquadri e schede: più movimento */
.reveal.up { transform: translateY(70px); }
.reveal.up.in { transform: none; }
.card.reveal.up { transform: translateY(80px) scale(.96); }
.card.reveal.in { transform: none; }

/* telefono: stessi movimenti, un po' più brevi */
@media (max-width: 960px) {
  .wipe { clip-path: inset(100% 0 0 0); }
  .split.reverse .wipe { clip-path: inset(100% 0 0 0); }
  .wipe.in { clip-path: inset(0 0 0 0); }
  .stagger > * { transform: translateY(24px); }
  .band .reveal.left, .band .reveal.right, .band .reveal.up { transform: translateY(28px); }
  .band .reveal.in { transform: none; }
  .band .box:nth-child(2) { --d: .12s; } .band .box:nth-child(3) { --d: .24s; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-in > *, .hero h1 .hero-pre, .stagger > *, .split-mark { opacity: 1 !important; transform: none !important; transition: none !important; }
  .wipe { clip-path: none !important; transition: none; }
  .wipe .pimg { scale: 1; transition: none; }
  .stagger .rule { width: 48px !important; }
  .draw path, .draw circle { stroke-dashoffset: 0; transition: none; }
}
