/* TopSmash — animazioni
   Tutto è disattivato con prefers-reduced-motion.
   ------------------------------------------------------------------ */

@keyframes ts-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ts-rise-clip { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes ts-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ts-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@keyframes ts-float {
	0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
	33% { transform: translate3d(3%, -4%, 0) scale(1.06); }
	66% { transform: translate3d(-3%, 3%, 0) scale(.96); }
}
@keyframes ts-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes ts-ball-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes ts-ball-run { to { offset-distance: 100%; } }
@keyframes ts-draw { to { stroke-dashoffset: 0; } }
@keyframes ts-spin { to { transform: rotate(360deg); } }
@keyframes ts-shimmer { to { background-position: 200% 0; } }

/* Comparsa allo scroll */
.ts-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ts-ease), transform .7s var(--ts-ease); will-change: opacity, transform; }
.ts-reveal.is-in { opacity: 1; transform: none; }
.ts-reveal--left { transform: translateX(-28px); }
.ts-reveal--right { transform: translateX(28px); }
.ts-reveal--zoom { transform: scale(.94); }

/* Ritardi a cascata per le griglie */
.ts-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ts-ease), transform .6s var(--ts-ease); }
.ts-stagger.is-in > * { opacity: 1; transform: none; }
.ts-stagger.is-in > *:nth-child(1) { transition-delay: .04s; }
.ts-stagger.is-in > *:nth-child(2) { transition-delay: .10s; }
.ts-stagger.is-in > *:nth-child(3) { transition-delay: .16s; }
.ts-stagger.is-in > *:nth-child(4) { transition-delay: .22s; }
.ts-stagger.is-in > *:nth-child(5) { transition-delay: .28s; }
.ts-stagger.is-in > *:nth-child(6) { transition-delay: .34s; }
.ts-stagger.is-in > *:nth-child(7) { transition-delay: .40s; }
.ts-stagger.is-in > *:nth-child(8) { transition-delay: .46s; }


/* Rete decorativa nel footer */
.ts-netpattern line { stroke: var(--ts-line-strong); stroke-width: 1; }

/* Titolo con sfumatura animata */
.ts-gradtext {
	background: linear-gradient(90deg, var(--ts-green), var(--ts-sky), var(--ts-lime), var(--ts-green));
	background-size: 200% 100%;
	-webkit-background-clip: text; background-clip: text; color: transparent;
	animation: ts-shimmer 8s linear infinite;
}

/* Immagine che si svela con una tendina */
.ts-curtain { position: relative; overflow: hidden; }
.ts-curtain::after { content: ""; position: absolute; inset: 0; background: var(--ts-bg); transform-origin: 100% 50%; transition: transform 1s var(--ts-ease); }
.ts-curtain.is-in::after { transform: scaleX(0); }

/* Caricamento iniziale */
.ts-boot .ts-header, .ts-boot .ts-hero__inner { animation: ts-fade .8s var(--ts-ease) both; }

/* ── Luci d'ambiente: aloni arancio/blu, scintille, punto luce che segue il mouse ── */
.ts-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ts-ambient__orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .26; animation: ts-float 28s ease-in-out infinite; will-change: transform; }
.ts-ambient__orb--1 { width: 50vw; height: 50vw; left: -16vw; top: 6vh; background: radial-gradient(circle, var(--ts-lime), transparent 64%); }
.ts-ambient__orb--2 { width: 46vw; height: 46vw; right: -14vw; top: 34vh; background: radial-gradient(circle, var(--ts-sky), transparent 64%); animation-delay: -10s; }
.ts-ambient__orb--3 { width: 34vw; height: 34vw; left: 34vw; bottom: -18vh; background: radial-gradient(circle, var(--ts-green), transparent 66%); opacity: .16; animation-delay: -19s; }
.ts-ambient__spot {
	position: absolute; left: 0; top: 0; width: 720px; height: 720px; margin: -360px 0 0 -360px;
	background: radial-gradient(circle, color-mix(in srgb, var(--ts-lime) 11%, transparent) 0%, color-mix(in srgb, var(--ts-sky) 6%, transparent) 35%, transparent 62%);
	opacity: 0; transition: opacity .5s ease; will-change: transform;
}
.ts-pointer-on .ts-ambient__spot { opacity: 1; }

/* Tema chiaro: luci più discrete */
.ts-scheme-light .ts-ambient__orb { opacity: .14; }
.ts-scheme-light .ts-ambient__spot { background: radial-gradient(circle, color-mix(in srgb, var(--ts-lime) 9%, transparent), transparent 60%); }

/* Le sezioni alternate lasciano passare le luci */
.ts-section--alt { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ts-bg-2) 72%, transparent) 90px, color-mix(in srgb, var(--ts-bg-2) 72%, transparent) calc(100% - 90px), transparent); }

@media (prefers-reduced-motion: reduce) {
	.ts-ambient__spot { display: none; }
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.ts-reveal, .ts-stagger > * { opacity: 1 !important; transform: none !important; }
	.ts-hero__title .ts-line > span { transform: none; }
	.ts-curtain::after { display: none; }
	.ts-marquee__track { animation: none; }
}
