/* GET Italia – effetti animati del sito (si accendono e spengono da Impostazioni → Effetti animati).
   Le classi html.fx-* vengono aggiunte solo se l'effetto è attivo e il visitatore non ha scelto «riduci movimento». */

@property --hv-x { syntax: "<percentage>"; inherits: false; initial-value: -110%; }

/* Titoli che entrano sfocati e si mettono a fuoco */
html.fx-blurIn h2[data-fx="blur"] { font-kerning: none; font-variant-ligatures: none; }
.bi-w { display: inline-block; white-space: nowrap; }
.bi-l { display: inline-block; }
html.fx-blurIn .bi-ready:not(.is-in) .bi-l { opacity: 0; filter: blur(8px); }

/* Blocchi che salgono quando entrano nello schermo */
html.fx-rise .ri-ready { transition: opacity .6s cubic-bezier(.2,.8,.2,1) var(--d,0s), translate .6s cubic-bezier(.2,.8,.2,1) var(--d,0s); }
html.fx-rise .ri-ready:not(.is-in) { opacity: 0; translate: 0 32px; }

/* Riflesso luminoso sui pulsanti */
html.fx-sheen .btn { position: relative; isolation: isolate; --hv-line: #ffffff40; }
html.fx-sheen .btn--yellow { --hv-line: #ffffff66; }
html.fx-sheen .btn--outline { --hv-line: #1e234614; }
html.fx-sheen .btn--outline:hover, html.fx-sheen .btn--outline-light { --hv-line: #ffffff2e; }
html.fx-sheen .btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent calc(30% + var(--hv-x)), var(--hv-line) calc(48% + var(--hv-x)), transparent calc(66% + var(--hv-x)));
  transition: --hv-x .8s cubic-bezier(.2,.8,.2,1);
}
html.fx-sheen .btn:is(:hover, :focus-visible)::after { --hv-x: 110%; }

/* Pulsanti magnetici: lo spostamento è calcolato dallo script */
html.fx-magnetic [data-fx="magnetic"] { will-change: translate; }

/* Card che si inclinano seguendo il mouse */
html.fx-cardHover .fx-tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, translate .2s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) and (pointer: fine) {
  html.fx-cardHover .fx-tilt:hover { translate: 0 -6px; box-shadow: 0 24px 48px -24px #15193559; }
  html.fx-cardHover .section--navy .fx-tilt:hover { box-shadow: 0 24px 48px -24px #000c; }
}

/* Grafici che si riempiono */
html.fx-count .fx-bars .colchart__col i { transform-origin: 50% 100%; transition: transform 1s cubic-bezier(.2,.8,.2,1); }
html.fx-count .fx-bars .hbars__track i { transform-origin: 0 50%; transition: transform 1s cubic-bezier(.2,.8,.2,1); }
html.fx-count .fx-bars .colchart__col:nth-child(2) i, html.fx-count .fx-bars .hbars__row:nth-child(2) i { transition-delay: .08s; }
html.fx-count .fx-bars .colchart__col:nth-child(3) i, html.fx-count .fx-bars .hbars__row:nth-child(3) i { transition-delay: .16s; }
html.fx-count .fx-bars .colchart__col:nth-child(4) i, html.fx-count .fx-bars .hbars__row:nth-child(4) i { transition-delay: .24s; }
html.fx-count .fx-bars .colchart__col:nth-child(n+5) i, html.fx-count .fx-bars .hbars__row:nth-child(n+5) i { transition-delay: .32s; }
html.fx-count .fx-bars:not(.is-in) .colchart__col i { transform: scaleY(0); }
html.fx-count .fx-bars:not(.is-in) .hbars__track i { transform: scaleX(0); }

/* Pulsante «Torna su» */
.gi-totop {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  color: #fff; background: #1e2346b3; border: 1px solid #ffffff26; cursor: pointer;
  box-shadow: 0 6px 16px -8px #0008; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .3s, transform .3s, background-color .2s;
}
.gi-totop.is-on { opacity: 1; pointer-events: auto; transform: none; }
.gi-totop svg { display: block; }
@media (hover: hover) and (pointer: fine) { .gi-totop.is-on:hover { background: #1e2346d9; transform: translateY(-2px); } }
html.rm .gi-totop { transition: none; }
body:has(.cookie:not([hidden])) .gi-totop { bottom: calc(24px + var(--cookie-h, 0px)); }
@media print { .gi-totop { display: none; } }
