/* ph-mdv2 motion layer (all pages). Everything here only applies with .m-js, which motion.js sets
   when motion is allowed: without JS or with reduced motion the site is static and fully visible. */

/* page-to-page cross-fade (browsers with cross-document view transitions; others navigate normally) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .35s ease both m-vt-out; }
::view-transition-new(root) { animation: .5s cubic-bezier(.2, .7, .2, 1) both m-vt-in; }
@keyframes m-vt-out { to { opacity: 0; } }
@keyframes m-vt-in { from { opacity: 0; transform: translateY(10px); } }
.site-head { view-transition-name: site-head; }
::view-transition-old(site-head), ::view-transition-new(site-head) { animation: none; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* titles: words rise out of a soft blur */
.m-js .m-split .m-w { display: inline-block; opacity: 0; filter: blur(12px); transform: translateY(.38em);
  transition: opacity 1s ease, filter 1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i) * 65ms + var(--d0, 80ms)); }
.m-js .m-split.is-in .m-w { opacity: 1; filter: blur(0); transform: none; }

/* generic reveal (fade + rise), staggered with --d */
.m-js .m-rv { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform 1s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.m-js .m-rv.is-in { opacity: 1; transform: none; }

/* hero photo: slow parallax, set from JS */
.m-js .hv2-media img, .m-js .hv2-media video { will-change: transform; transform: translate3d(0, var(--py, 0px), 0) scale(1.06); }

/* percorso: the line fills with the scroll, steps light up when it reaches them */
.m-js .hs-steps::before { transform: none !important; transition: none; }
.m-js .hs-steps::after { content: ""; position: absolute; left: 36px; right: 10%; top: 35px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #6aaef0, #2f7fd6); transform-origin: left; transform: scaleX(var(--p, 0)); }
.hs-step-ico { transition: background .6s ease, color .6s ease, box-shadow .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1), border-color .6s; }
.m-js .hs-step.is-lit .hs-step-ico { background: linear-gradient(140deg, #3b8de0, #16335c); color: #fff; border-color: transparent; transform: scale(1.05);
  box-shadow: 0 0 0 7px rgba(47, 127, 214, .1), 0 20px 36px -16px rgba(47, 127, 214, .85); }
@media (max-width: 1180px) { .m-js .hs-steps::after { display: none; } }

/* images open like a curtain (clip on the img: a clipped figure would never count as visible) */
.m-js .hs-onco-img.hs-reveal, .m-js .hs-doc-img.hs-reveal { opacity: 1; transform: none; }
.m-js .hs-onco-img img, .m-js .hs-doc-img img { animation: none; clip-path: inset(0 100% 0 0); transform: scale(1.16);
  transition: clip-path 1.4s cubic-bezier(.77, 0, .18, 1), transform 2s cubic-bezier(.2, .7, .2, 1); }
.m-js .hs-reveal.is-in > img { clip-path: inset(0 0 0 0); transform: scale(1); }

/* numbers: a thin ring fills around each icon */
@property --ring { syntax: "<number>"; inherits: false; initial-value: 0; }
.m-js .stats-v2 .stat-ico { position: relative; }
.m-js .stats-v2 .stat-ico::after { content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from -90deg, #2f7fd6 calc(var(--ring) * 360deg), rgba(47, 127, 214, .12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  transition: --ring 1.6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.m-js .stats-v2 .stat.is-in .stat-ico::after { --ring: 1; }

/* cards: gentle 3D tilt and a light sheen that follows the pointer (desktop) */
.m-tilt { position: relative; transform-style: preserve-3d; }
.m-tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 45%); mix-blend-mode: soft-light; }
.m-tilt.is-hover::after { opacity: 1; }
.m-tilt.is-hover { transition: transform .18s ease-out, box-shadow .3s !important; box-shadow: 0 30px 50px -30px rgba(22, 51, 92, .55); }
.m-tilt.m-was:not(.is-hover) { transition: transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, opacity .9s !important; } /* m-was: set on first hover, after the reveal */

/* magnetic buttons */
.m-mag { transition: transform .5s cubic-bezier(.2, .7, .2, 1), background .2s, border-color .2s, color .2s; }
.m-mag.is-hover { transition: transform .15s ease-out, background .2s, border-color .2s, color .2s; }

/* printing: everything visible */
@media print { .m-js .m-rv, .m-js .m-split .m-w { opacity: 1 !important; transform: none !important; filter: none !important; } }
/* client 06/11: the connecting line runs behind the circles, never over them */
.hs-steps::before, .hs-steps::after { z-index: 0; }
.hs-step { z-index: 1; }
.hs-step-ico { position: relative; z-index: 2; }
