/* ==========================================================================
   MyStreaming — FX: animazioni e ritocchi grafici
   Caricato dopo main.css. Rimuovendo questo file (e fx.js) il sito torna
   esattamente com'era. Rispetta "riduci movimento" del sistema operativo.
   ========================================================================== */

:root {
	--fx-ease: cubic-bezier(.16, 1, .3, 1);
	--fx-dur: .9s;
	--fx-green-2: #b5e46a;
	--fx-radius: 12px;
}

/* Barra di avanzamento lettura ------------------------------------------- */
.fx-progress {
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 3px;
	z-index: 100001;
	pointer-events: none;
	transform-origin: 0 50%;
	transform: scaleX(var(--fx-p, 0));
	background: linear-gradient(90deg, var(--ms-green), var(--fx-green-2));
	box-shadow: 0 0 12px rgba(141, 198, 63, .6);
}
.admin-bar .fx-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .fx-progress { top: 46px; } }

/* Header: vetro smerigliato quando scorre, si nasconde scendendo ---------- */
#header-outer.scrolled {
	background: rgba(253, 255, 252, .82);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	box-shadow: 0 10px 30px -14px rgba(1, 22, 39, .25);
}
#header-outer { transition: background-color .4s ease, box-shadow .4s ease, transform .5s var(--fx-ease); }
#header-outer.fx-hide { transform: translateY(-110%); }
.main-nav .sf-menu ul::before { border-radius: var(--fx-radius); }

/* ==========================================================================
   Hero home
   ========================================================================== */
.home-hero::after {
	content: "";
	position: absolute; inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 80% 60% at 50% 110%, rgba(1, 22, 39, .85), rgba(1, 22, 39, 0) 70%),
		linear-gradient(to bottom, rgba(1, 22, 39, .45), rgba(1, 22, 39, 0) 28%);
}
.hero-media { will-change: transform; transform: translate3d(0, calc(var(--fx-hs, 0) * 30%), 0); }
.hero-poster { animation: fx-kenburns 20s ease-out both; }
@keyframes fx-kenburns { from { transform: scale(1.14); } to { transform: scale(1); } }

.hero-content {
	opacity: calc(1 - var(--fx-hs, 0) * 1.6);
	transform: translate3d(0, calc(var(--fx-hs, 0) * -90px), 0);
}

/* Badge LIVE */
.fx-live {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 22px;
	padding: 8px 16px 8px 14px;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 999px;
	background: rgba(1, 22, 39, .35);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font: 600 11px/1 var(--ms-font);
	letter-spacing: .28em;
	text-transform: uppercase;
	transition: opacity .8s var(--fx-ease) .2s, transform .8s var(--fx-ease) .2s;
}
.fx-live i {
	width: 9px; height: 9px;
	border-radius: 50%;
	background: #ff3b3b;
	animation: fx-pulse 1.6s ease-out infinite;
}
@keyframes fx-pulse {
	0% { box-shadow: 0 0 0 0 rgba(255, 59, 59, .75); }
	70% { box-shadow: 0 0 0 11px rgba(255, 59, 59, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}

/* Claim più grande, parola per parola */
.home-hero .subheader {
	font-size: clamp(30px, 4.6vw, 68px);
	line-height: 1.08;
	letter-spacing: .02em;
	text-shadow: 0 4px 30px rgba(2, 2, 11, .55);
}
.fx-word {
	display: inline-block;
	opacity: 0;
	filter: blur(10px);
	transform: translateY(.45em);
	transition: opacity 1s var(--fx-ease), transform 1s var(--fx-ease), filter 1s var(--fx-ease);
	transition-delay: calc(.35s + var(--i, 0) * 110ms);
}
.fx-word.is-accent { color: var(--ms-green); }
.fx-on .home-hero:not(.fx-in) .fx-live { opacity: 0; transform: translateY(12px); }
.home-hero.fx-in .fx-word { opacity: 1; filter: none; transform: none; }

.section-down-arrow .mouse { border-color: rgba(255, 255, 255, .85); }
.section-down-arrow:hover .mouse { border-color: var(--ms-green); }
.section-down-arrow:hover .wheel { background: var(--ms-green); }

/* ==========================================================================
   Comparsa allo scroll
   (i selettori sono gli stessi osservati da fx.js)
   ========================================================================== */
.fx-on :where(
	.section-heading,
	.intro-col > *,
	.values-col,
	.service-item,
	.blog-recent-item,
	.clients-marquee,
	.blog-section .text-center,
	.title-wrap .page-title,
	.single-heading > *,
	.ms-card-col,
	.ms-milestone,
	.ms-iconbox,
	.ms-gallery,
	.related-service,
	.other-service,
	.cta-inner,
	#footer-widgets .widget
) {
	opacity: 0;
	transform: translate3d(0, 42px, 0);
	transition: opacity var(--fx-dur) var(--fx-ease), transform var(--fx-dur) var(--fx-ease);
	transition-delay: calc(var(--fx-i, 0) * 90ms);
}
.fx-on :where(.ms-milestone, .clients-marquee) { transform: scale(.94); }
.fx-on .fx-in { opacity: 1; transform: none; }

/* Titoli di sezione con trattino verde che si disegna */
.section-heading { position: relative; padding-bottom: 22px; }
.section-heading::after {
	content: "";
	position: absolute;
	left: 50%; bottom: 0;
	width: 64px; height: 3px;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--ms-green), var(--fx-green-2));
	transform: translateX(-50%) scaleX(1);
	transition: transform 1.1s var(--fx-ease) .35s;
}
.fx-on .section-heading:not(.fx-in)::after { transform: translateX(-50%) scaleX(0); }

/* Intro: trattino a sinistra del titolo */
.intro-section h1 { position: relative; padding-left: 26px; }
.intro-section h1::before {
	content: "";
	position: absolute;
	left: 0; top: 8px; bottom: 8px;
	width: 5px;
	border-radius: 5px;
	background: linear-gradient(180deg, var(--ms-green), var(--fx-green-2));
}

/* ==========================================================================
   Pulsanti: riflesso che attraversa
   ========================================================================== */
.ms-btn { position: relative; overflow: hidden; isolation: isolate; }
.ms-btn::after {
	content: "";
	position: absolute;
	top: 0; left: -80%;
	width: 50%; height: 100%;
	background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .5), transparent);
	transform: skewX(-20deg);
	transition: left .8s var(--fx-ease);
	pointer-events: none;
}
.ms-btn:hover::after, .ms-btn:focus-visible::after { left: 140%; }
.ms-btn:hover, .ms-btn:focus { box-shadow: 0 18px 36px -12px rgba(141, 198, 63, .65); }

/* ==========================================================================
   Cosa offriamo: card 3D + anello rotante attorno all'icona
   ========================================================================== */
#main-service .service-item.card-item { perspective: 900px; }
#main-service .service-item.card-item a {
	border-radius: 16px;
	transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
	transition: transform .5s var(--fx-ease), box-shadow .5s var(--fx-ease), background-color .5s ease;
	will-change: transform;
}
#main-service .service-item.card-item a:hover {
	--ty: -10px;
	background-color: #fff;
	box-shadow: 0 34px 60px -28px rgba(1, 22, 39, .45);
}
#main-service .service-item.card-item a.fx-tilting { transition: transform .12s linear, box-shadow .5s var(--fx-ease), background-color .5s ease; }

#main-service .service-item .img-box { position: relative; transition: transform .6s var(--fx-ease), box-shadow .6s ease; }
#main-service .service-item .img-box::before {
	content: "";
	position: absolute;
	inset: -9px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, var(--ms-green), rgba(141, 198, 63, 0) 35%, rgba(141, 198, 63, 0) 65%, var(--fx-green-2));
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
	opacity: 0;
	transition: opacity .4s ease;
	animation: fx-spin 2.6s linear infinite;
	animation-play-state: paused;
}
#main-service .service-item a:hover .img-box::before { opacity: 1; animation-play-state: running; }
#main-service .service-item a:hover .img-box { transform: translateZ(30px) scale(1.04); box-shadow: 0 18px 40px -14px rgba(1, 22, 39, .6); }
#main-service .img-box svg, #main-service .img-box img { transition: fill .6s ease, filter .6s ease, transform .6s var(--fx-ease); }
#main-service .service-item a:hover .img-box svg,
#main-service .service-item a:hover .img-box img { transform: scale(1.1); }
#main-service .service-item a:hover h3 { transform: translateZ(20px); }
#main-service .flex-wrapper .service-item h3 { transition: transform .5s var(--fx-ease); }
@keyframes fx-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Slider home: slide centrale in primo piano
   ========================================================================== */
.my-home-slider .slick-slide { opacity: .4; transform: scale(.94); transition: opacity .8s ease, transform .8s var(--fx-ease); }
.my-home-slider .slick-slide.slick-center { opacity: 1; transform: none; }
.my-home-slider .slick-prev, .my-home-slider .slick-next {
	background: rgba(255, 255, 255, .12);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, .25);
}

/* ==========================================================================
   Griglia servizi: immagine con zoom e "Scopri →"
   ========================================================================== */
/* Hover sobrio: solo zoom leggero dell'immagine, testi sempre leggibili */
.other-service-full .grid-item .img-box {
	position: relative;
	overflow: hidden;
	margin-top: 20px;
	border-radius: var(--fx-radius);
}
.other-service-full .grid-item.service-item img { margin-top: 0; transition: transform .8s var(--fx-ease); }
.other-service-full .grid-item a:hover img { transform: scale(1.05); }

/* Servizi correlati: icona che gira già c'era, aggiungiamo uno slittamento */
.service-item.list-item a { border-radius: 8px; transition: background-color .3s ease, transform .4s var(--fx-ease); }
.service-item.list-item a:hover { transform: translateX(6px); }
.related-service .service-item.list-item a:hover { background-color: rgba(255, 255, 255, .05); }
.other-service .service-item.list-item a:hover { background-color: rgba(255, 255, 255, .6); }

/* ==========================================================================
   Valori: macchie di colore che fluttuano
   ========================================================================== */
.values-section { position: relative; overflow: hidden; isolation: isolate; }
.values-section::before,
.values-section::after {
	content: "";
	position: absolute;
	z-index: -1;
	width: 520px; height: 520px;
	border-radius: 50%;
	filter: blur(90px);
	pointer-events: none;
	animation: fx-float 16s ease-in-out infinite alternate;
}
.values-section::before { top: -240px; left: -160px; background: rgba(141, 198, 63, .35); }
.values-section::after { bottom: -260px; right: -160px; background: rgba(1, 22, 39, .14); animation-delay: -8s; }
@keyframes fx-float {
	0% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(80px, 40px) scale(1.15); }
	100% { transform: translate(-40px, 90px) scale(.95); }
}
.values-section .entry-text strong { color: var(--ms-green); }

/* ==========================================================================
   Clienti: nastro continuo, loghi in grigio che si colorano
   ========================================================================== */
.clients-marquee {
	overflow: hidden;
	margin: 50px 0;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.clients-track {
	display: flex;
	width: max-content;
	animation: fx-marquee 45s linear infinite;
}
.clients-marquee:hover .clients-track { animation-play-state: paused; }
.clients-track .carousel-item-logo { flex: 0 0 auto; width: clamp(150px, 16vw, 240px); padding: 0 12px; }
.clients-track img {
	filter: grayscale(1);
	opacity: .6;
	mix-blend-mode: multiply;
	transition: filter .5s ease, opacity .5s ease, transform .5s var(--fx-ease);
}
.clients-track .carousel-item-logo:hover img { filter: none; opacity: 1; transform: scale(1.07); }
@keyframes fx-marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ==========================================================================
   Blog
   ========================================================================== */
.blog-recent-item .thumb { position: relative; border-radius: var(--fx-radius); transform: translateZ(0); }
.blog-recent-item .thumb::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ms-green), var(--fx-green-2));
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .6s var(--fx-ease);
}
.blog-recent-item:hover .thumb::after { transform: scaleX(1); }
.blog-recent-item .thumb img { transition: transform .9s var(--fx-ease); }
.blog-recent-item:hover .thumb img { transform: scale(1.07); }

.ms-card { border-radius: var(--fx-radius); transition: transform .6s var(--fx-ease), box-shadow .6s var(--fx-ease); }
.ms-card:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -24px rgba(1, 22, 39, .55); }
.ms-card .title { transition: transform .6s var(--fx-ease); }
.ms-card:hover .title { transform: translateY(-4px); }

/* ==========================================================================
   Pagine interne
   ========================================================================== */
.page-hero { overflow: hidden; }
.solution-page .title-wrap { position: relative; overflow: hidden; isolation: isolate; }
.solution-page .title-wrap::after {
	content: "";
	position: absolute;
	z-index: -1;
	right: -120px; top: -160px;
	width: 420px; height: 420px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(141, 198, 63, .35), rgba(141, 198, 63, 0) 70%);
	animation: fx-float 18s ease-in-out infinite alternate;
}
.solutions-menu a { position: relative; }
.ms-milestone .number { font-variant-numeric: tabular-nums; }
.ms-gallery img { transition: transform .8s var(--fx-ease); }
.ms-gallery:hover img { transform: scale(1.04); }
.ms-modal .modal-content { border-radius: 16px; overflow: hidden; }

/* ==========================================================================
   CTA footer: onde di segnale che si propagano
   ========================================================================== */
.cta-wrapper { position: relative; overflow: hidden; isolation: isolate; }
.cta-wrapper::before,
.cta-wrapper::after,
.cta-wrapper .go-contact::before {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	z-index: -1;
	width: 240px; height: 240px;
	margin: -120px 0 0 -120px;
	border-radius: 50%;
	border: 2px solid rgba(141, 198, 63, .55);
	pointer-events: none;
	animation: fx-ring 6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.cta-wrapper::after { animation-delay: -2s; }
.cta-wrapper .go-contact::before { animation-delay: -4s; }
@keyframes fx-ring {
	0% { transform: scale(.3); opacity: 0; }
	15% { opacity: 1; }
	100% { transform: scale(4.5); opacity: 0; }
}
.cta-wrapper h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1.1; font-weight: 400; }
.cta-wrapper h2::after {
	content: "\2192";
	display: inline-block;
	margin-left: .3em;
	color: var(--ms-green);
	transition: transform .5s var(--fx-ease);
}
.cta-wrapper .go-contact:hover h2::after { transform: translateX(12px); }

/* Footer */
#footer-outer { position: relative; }
#footer-widgets { position: relative; }
#footer-widgets::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--ms-green), transparent);
	opacity: .6;
}
#footer-widgets ul li a { display: inline-block; transition: transform .35s var(--fx-ease), color .3s; }
#footer-widgets ul li a:hover { transform: translateX(6px); }
#copyright .social a { border-radius: 50%; transition: transform .4s var(--fx-ease), color .3s; }
#copyright .social a:hover { transform: translateY(-4px); }

/* Torna su: cerchio con avanzamento */
#to-top {
	width: 46px; height: 46px;
	line-height: 46px;
	border-radius: 50%;
	font-size: 20px;
	isolation: isolate;
	background: conic-gradient(var(--ms-green) calc(var(--fx-p, 0) * 360deg), rgba(1, 22, 39, .18) 0);
}
#to-top::before {
	content: "";
	position: absolute;
	inset: 3px;
	z-index: -1;
	border-radius: 50%;
	background: var(--ms-navy);
	transition: background-color .3s;
}
#to-top:hover { background: conic-gradient(var(--ms-green) calc(var(--fx-p, 0) * 360deg), rgba(1, 22, 39, .18) 0); }
#to-top:hover::before { background: var(--ms-green); }
@media (max-width: 767px) { #to-top { right: 25px; } }

/* WhatsApp: richiamo discreto */
.wa-btn-icon { position: relative; }
.wa-btn-icon::after {
	content: "";
	position: absolute; inset: 0;
	border-radius: 50%;
	animation: fx-wa 3s ease-out infinite;
}
@keyframes fx-wa {
	0% { box-shadow: 0 0 0 0 rgba(45, 183, 66, .55); }
	60%, 100% { box-shadow: 0 0 0 16px rgba(45, 183, 66, 0); }
}

/* ==========================================================================
   Riduci movimento
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
	.clients-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
	.clients-track [aria-hidden="true"] { display: none; }
	.hero-media, .hero-content { transform: none; opacity: 1; }
	.cta-wrapper::before, .cta-wrapper::after, .cta-wrapper .go-contact::before, .values-section::before, .values-section::after { display: none; }
}
