/* ============================================================
   NEXIM FOUNDATION — PRO ELEVATION LAYER v2 (motion + depth)
   Caricato dopo vertical.css. Targetta le classi nx-*.
   Brand-aware: usa --nx-brand/--nx-accent del child theme, così
   ogni divisione ha la sua aurora. Non altera i contenuti.
   ============================================================ */
:root, body{
  --pro-a: var(--nx-accent, #43e0ff);
  --pro-b: var(--nx-brand,  #3e8bff);
  --pro-grad: linear-gradient(120deg, var(--pro-a) 0%, var(--pro-b) 55%, #8b7bff 115%);
  --pro-ease: cubic-bezier(.22,1,.36,1);
  --pro-spot: rgba(67,224,255,.10);
  --pro-line-glow: rgba(67,224,255,.4);
}
@supports (color: color-mix(in srgb, red 10%, transparent)){
  :root, body{
    --pro-spot: color-mix(in srgb, var(--pro-a) 11%, transparent);
    --pro-line-glow: color-mix(in srgb, var(--pro-a) 45%, transparent);
  }
}

/* ---- fondamenta: selection, scrollbar, type ---- */
::selection{ background: var(--pro-b); color:#fff; }
html{ scrollbar-width: thin; scrollbar-color: #2a2f3d var(--nx-bg, #0a0b0f); }
@media (hover:hover) and (pointer:fine){
  ::-webkit-scrollbar{ width:10px; height:10px; }
  ::-webkit-scrollbar-track{ background: var(--nx-bg, #0a0b0f); }
  ::-webkit-scrollbar-thumb{ background:#232836; border-radius:8px; border:2px solid var(--nx-bg,#0a0b0f); }
  ::-webkit-scrollbar-thumb:hover{ background: var(--pro-b); }
}
h1,h2,h3,.nx-section-head h2{ text-wrap: balance; }

html.lenis, html.lenis body{ height:auto; }
.lenis.lenis-smooth{ scroll-behavior:auto!important; }
.lenis.lenis-smooth [data-lenis-prevent]{ overscroll-behavior:contain; }
.lenis.lenis-stopped{ overflow:hidden; }

/* ---- progress + cursor ---- */
.pro-progress{ position:fixed; top:0; left:0; height:2px; width:100%; z-index:2000;
  transform:scaleX(0); transform-origin:0 50%; background:var(--pro-grad);
  box-shadow:0 0 14px var(--pro-line-glow); will-change:transform; pointer-events:none; }
.pro-cursor{ position:fixed; top:0; left:0; width:32px; height:32px; border-radius:50%;
  border:1.5px solid var(--pro-line-glow); z-index:9998; pointer-events:none;
  transform:translate(-50%,-50%); mix-blend-mode:screen; opacity:0;
  transition:width .25s var(--pro-ease),height .25s var(--pro-ease),background .25s,border-color .25s,opacity .3s; }
.pro-cursor.is-active{ width:58px; height:58px; background:var(--pro-spot); border-color:var(--pro-a); }
.pro-cursor-dot{ position:fixed; top:0; left:0; width:5px; height:5px; border-radius:50%; background:var(--pro-a);
  z-index:9999; pointer-events:none; transform:translate(-50%,-50%); box-shadow:0 0 10px var(--pro-line-glow);
  opacity:0; transition:opacity .3s; }
@media (hover:hover) and (pointer:fine){ .pro-cursor.ready, .pro-cursor-dot.ready{ opacity:1; } }

/* ---- reveal ---- */
.pro-reveal{ opacity:0; transform:translateY(28px) scale(.985);
  transition:opacity .9s var(--pro-ease),transform .9s var(--pro-ease),filter .9s var(--pro-ease); will-change:opacity,transform; }
.nx-section-head.pro-reveal{ filter:blur(6px); }
.pro-reveal.is-in{ opacity:1; transform:none; filter:none; }
.no-js .pro-reveal{ opacity:1; transform:none; filter:none; }

/* ---- HERO: aurora brand-aware + parallax + grana + griglia orizzonte ---- */
.nx-vhero{ isolation:isolate; overflow:hidden; }
.nx-vhero__inner{ position:relative; z-index:6; }
.nx-vhero__bg{ will-change:transform; transform:scale(1.08); animation:proKenBurns 24s ease-in-out infinite alternate; }
@keyframes proKenBurns{ from{ transform:scale(1.08) translate3d(0,0,0); } to{ transform:scale(1.18) translate3d(-1.5%,-1.5%,0); } }
.pro-hero-canvas{ position:absolute; inset:0; z-index:3; width:100%; height:100%; opacity:.5; pointer-events:none; mix-blend-mode:screen; }
.pro-hero-blobs{ position:absolute; inset:-20%; z-index:2; pointer-events:none; overflow:hidden; }
.pro-hero-blobs i{ position:absolute; display:block; border-radius:50%; filter:blur(72px); opacity:.38; mix-blend-mode:screen; will-change:transform; }
.pro-hero-blobs i:nth-child(1){ width:46vw; height:46vw; left:-6%; top:-14%;
  background:radial-gradient(circle, var(--pro-b), transparent 70%); animation:proFloat 20s ease-in-out infinite alternate; }
.pro-hero-blobs i:nth-child(2){ width:40vw; height:40vw; right:-8%; top:0;
  background:radial-gradient(circle, var(--pro-a), transparent 70%); animation:proFloat 26s ease-in-out infinite alternate-reverse; }
.pro-hero-blobs i:nth-child(3){ width:30vw; height:30vw; left:32%; bottom:-20%;
  background:radial-gradient(circle, #8b7bff, transparent 70%); opacity:.22; animation:proFloat 30s ease-in-out infinite alternate; }
@keyframes proFloat{ from{ transform:translate3d(-4%,-2%,0) scale(1); } to{ transform:translate3d(5%,4%,0) scale(1.16); } }
.pro-hero-grid{ position:absolute; left:-12%; right:-12%; bottom:-2%; height:44%; z-index:2; pointer-events:none; opacity:.35;
  background-image:
    linear-gradient(var(--pro-line-glow) 1px, transparent 1px),
    linear-gradient(90deg, var(--pro-line-glow) 1px, transparent 1px);
  background-size:46px 46px;
  transform:perspective(640px) rotateX(62deg); transform-origin:50% 100%;
  -webkit-mask-image:linear-gradient(180deg, transparent 0%, #000 60%); mask-image:linear-gradient(180deg, transparent 0%, #000 60%); }
.nx-vhero::after{ content:""; position:absolute; inset:0; z-index:4; pointer-events:none; opacity:.45; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }

/* titolo hero: entrata blur-in + accento gradiente brand sull'enfasi */
.nx-vhero h1{ opacity:0; transform:translateY(26px); filter:blur(8px); animation:proRise 1.05s var(--pro-ease) .15s both; }
.nx-vhero__sub, .nx-vhero__ctas, .nx-vhero__trust{ opacity:0; transform:translateY(22px); animation:proRise 1s var(--pro-ease) both; }
.nx-vhero__sub{ animation-delay:.32s; } .nx-vhero__ctas{ animation-delay:.46s; } .nx-vhero__trust{ animation-delay:.6s; }
@keyframes proRise{ to{ opacity:1; transform:none; filter:none; } }
.nx-vhero h1 em{ background:linear-gradient(100deg, #fff 10%, var(--pro-a) 55%, var(--pro-b) 110%);
  -webkit-background-clip:text; background-clip:text; color:transparent; font-style:inherit; }
.nx-vhero__panel{ border-color:var(--nx-line-2); box-shadow:0 24px 70px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05); overflow:hidden; }
.nx-vhero__panel::after{ content:""; position:absolute; left:0; right:0; height:1px; top:0;
  background:linear-gradient(90deg, transparent, var(--pro-line-glow), transparent);
  animation:proScan 4.5s var(--pro-ease) infinite; pointer-events:none; }
@keyframes proScan{ 0%{ transform:translateY(0); opacity:0; } 12%{ opacity:1; } 88%{ opacity:1; } 100%{ transform:translateY(210px); opacity:0; } }

/* ---- HEADER: shrink + glass + hairline gradiente ---- */
.nx-header{ transition:background .3s var(--pro-ease),box-shadow .3s var(--pro-ease),backdrop-filter .3s; }
.nx-header::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px; pointer-events:none; opacity:.5;
  background:linear-gradient(90deg, transparent 0%, var(--pro-line-glow) 30%, var(--pro-line-glow) 70%, transparent 100%); }
.nx-header.pro-shrink{ backdrop-filter:saturate(160%) blur(14px); box-shadow:0 10px 30px -12px rgba(4,12,28,.4); }

/* logo testuale: wordmark vero (fix "senza logo") */
.nx-logo-text{ font-family:'Space Grotesk','Inter',sans-serif; font-weight:700; letter-spacing:-.02em; font-size:1.35rem; line-height:1; display:inline-flex; gap:.18em; align-items:baseline; }
.nx-logo-text strong{ font-weight:700; background:var(--pro-grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
.nx-logo-img{ transition:transform .3s var(--pro-ease); }
.nx-logo:hover .nx-logo-img{ transform:translateY(-1px) scale(1.02); }

/* nav: underline animato */
.nx-nav__list a{ position:relative; }
.nx-nav__list a::after{ content:""; position:absolute; left:11px; right:11px; bottom:4px; height:1px;
  background:var(--pro-grad); transform:scaleX(0); transform-origin:0 50%; transition:transform .3s var(--pro-ease); }
.nx-nav__list a:hover::after, .nx-nav__list .current-menu-item > a::after{ transform:scaleX(1); }

/* ---- BUTTONS: primary gradiente + glow, sheen, ghost fill ---- */
.nx-btn{ position:relative; overflow:hidden; isolation:isolate; will-change:transform; }
.nx-btn--primary{ background:linear-gradient(135deg, var(--pro-a) 0%, var(--pro-b) 70%); border-color:transparent; color:#041021;
  box-shadow:0 10px 26px -12px var(--pro-line-glow), inset 0 1px 0 rgba(255,255,255,.25); }
.nx-btn--primary:hover{ background:linear-gradient(135deg, var(--pro-a) 10%, var(--pro-b) 90%); border-color:transparent; color:#041021;
  box-shadow:0 16px 38px -12px var(--pro-line-glow), inset 0 1px 0 rgba(255,255,255,.3); filter:brightness(1.06); }
.nx-btn--primary::after, .nx-btn--lg::after{ content:""; position:absolute; inset:0; z-index:-1; transform:translateX(-130%) skewX(-12deg);
  background:linear-gradient(110deg, transparent 20%, rgba(255,255,255,.4) 50%, transparent 80%); transition:transform .7s var(--pro-ease); }
.nx-btn--primary:hover::after, .nx-btn--lg:hover::after{ transform:translateX(130%) skewX(-12deg); }
.nx-btn--ghost:hover{ background:var(--pro-spot); }

/* ---- CARDS: bordo gradiente + spotlight + tilt ---- */
.nx-services__item, .nx-hub-card, .nx-offer, .nx-post-card{ position:relative; transform-style:preserve-3d; will-change:transform;
  transition:transform .3s var(--pro-ease),box-shadow .3s var(--pro-ease),border-color .3s,background .25s; }
.nx-services__item::before, .nx-hub-card::before, .nx-offer::before{ content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; pointer-events:none; z-index:3;
  background:var(--pro-grad); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude; opacity:0; transition:opacity .3s var(--pro-ease); }
.nx-services__item:hover::before, .nx-hub-card:hover::before, .nx-offer:hover::before{ opacity:1; }
.nx-services__item:hover, .nx-hub-card:hover{ box-shadow:0 24px 70px -30px var(--pro-line-glow); }
.nx-services__code{ transition:color .3s var(--pro-ease); }
.nx-services__item:hover .nx-services__code{ color:var(--pro-a); }
/* spotlight che segue il puntatore (JS setta --pro-mx/--pro-my) */
.pro-spot::after{ content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:1; opacity:0; transition:opacity .35s var(--pro-ease);
  background:radial-gradient(440px circle at var(--pro-mx,50%) var(--pro-my,50%), var(--pro-spot), transparent 65%); }
.pro-spot:hover::after{ opacity:1; }
.nx-hub-card.pro-spot::after{ z-index:1; }
.nx-why__item.pro-spot::after, .nx-process__step.pro-spot::after{ border-radius:0; }

/* ---- NUMERI: gradiente + tabular ---- */
.nx-why__n, .nx-stat__n{ background:linear-gradient(120deg, var(--pro-a) 0%, var(--pro-b) 80%);
  -webkit-background-clip:text; background-clip:text; color:transparent; font-variant-numeric:tabular-nums; }
.nx-stats-bar [data-n]{ font-variant-numeric:tabular-nums; }
.nx-why__item, .nx-process__step{ position:relative; transition:background .25s; }
.nx-why__item:hover, .nx-process__step:hover{ background:var(--nx-surf,#13151c); }

/* ---- SECTION HEAD: kicker con riga che si disegna ---- */
.nx-section-head{ position:relative; }
.nx-kicker{ position:relative; color:var(--pro-a); }
.nx-section-head .nx-kicker::after{ content:""; position:absolute; left:50%; bottom:-8px; height:1px; width:56px;
  transform:translateX(-50%) scaleX(0); transform-origin:50% 50%;
  background:var(--pro-grad); transition:transform .8s var(--pro-ease) .25s; }
.nx-section-head.is-in .nx-kicker::after{ transform:translateX(-50%) scaleX(1); }

/* ---- TRUST STRIP: marquee infinito (costruito da pro.js) ---- */
.pro-marquee{ overflow:hidden; -webkit-mask-image:linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image:linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.pro-marquee .nx-trust-strip__list{ flex-wrap:nowrap; justify-content:flex-start; width:max-content; gap:0;
  animation:proMarquee var(--pro-marq-dur,30s) linear infinite; }
.pro-marquee .nx-trust-strip__list li{ margin-inline-end:56px; white-space:nowrap; }
.pro-marquee:hover .nx-trust-strip__list{ animation-play-state:paused; }
@keyframes proMarquee{ to{ transform:translateX(-50%); } }

/* ---- CTA BAND: aurora conica che ruota ---- */
.nx-vband{ isolation:isolate; overflow:hidden; }
.nx-vband::before{ content:""; position:absolute; inset:-45%; z-index:-1; pointer-events:none;
  background:conic-gradient(from 0deg, transparent 0 62%, var(--pro-line-glow) 76%, transparent 88%);
  animation:proSpin 28s linear infinite; filter:blur(52px); opacity:.8; }
@keyframes proSpin{ to{ transform:rotate(1turn); } }

/* ---- COMMERCIAL (offer/faq/compare) ---- */
.nx-offer--featured{ box-shadow:0 24px 70px -34px var(--pro-line-glow); }
.nx-faq-acc{ transition:border-color .25s, background .25s; }
.nx-faq-acc:hover{ border-color:var(--nx-line-3, rgba(255,255,255,.22)); }

/* ---- POST CARDS ---- */
.nx-post-card__media{ overflow:hidden; }
.nx-post-card__media img{ transition:transform .6s var(--pro-ease), filter .4s; }
.nx-post-card:hover .nx-post-card__media img{ transform:scale(1.05); filter:grayscale(0) contrast(1.05) brightness(.95); }

/* ---- FOOTER: hairline gradiente + micro-interazioni ---- */
.nx-footer{ position:relative; }
.nx-footer::before{ content:""; position:absolute; top:-1px; left:0; right:0; height:1px; pointer-events:none; opacity:.4;
  background:linear-gradient(90deg, transparent, var(--pro-line-glow) 35%, var(--pro-line-glow) 65%, transparent); }
.nx-footer__col a, .nx-footer__list a{ display:inline-block; transition:color .15s, transform .2s var(--pro-ease); }
.nx-footer__col a:hover, .nx-footer__list a:hover{ transform:translateX(3px); }

/* ---- NETBAR: hairline luminosa sotto ---- */
.nx-netbar{ position:relative; }
.nx-netbar::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px; pointer-events:none; opacity:.25;
  background:linear-gradient(90deg, transparent, rgba(34,211,238,.6) 50%, transparent); }

/* ============================================================
   CORP (nexim.it, classi nxc-*) + NEWS (nxn-*) + divisionali
   ============================================================ */
/* hero corp "Iliad-style": aurora + entrance (il kenburns lo ha già via nxc-pan) */
.nxc-hero{ isolation:isolate; overflow:hidden; }
.nxc-hero__inner{ position:relative; z-index:6; }
.nxc-hero__eyebrow, .nxc-hero h1, .nxc-hero__sub, .nxc-hero__ctas, .nxc-hero__numbers{
  opacity:0; transform:translateY(24px); animation:proRise 1s var(--pro-ease) both; }
.nxc-hero h1{ filter:blur(8px); animation-delay:.15s; animation-duration:1.05s; }
.nxc-hero__eyebrow{ animation-delay:.05s; } .nxc-hero__sub{ animation-delay:.32s; }
.nxc-hero__ctas{ animation-delay:.46s; } .nxc-hero__numbers{ animation-delay:.6s; }
.nxc-hero .pro-hero-canvas{ opacity:.4; }
/* hero news (CSS-only bg) */
.nxn-hero{ isolation:isolate; overflow:hidden; position:relative; }
.nxn-hero__inner{ position:relative; z-index:6; }
/* card divisioni corp + eventi + sedi */
.nxc-div, .nxc-event, .nxc-office, .nxn-card, .nxn-vert, .nxm-cat, .nxm-product, .nxm-pa-card,
.nxw-svc, .nx-hw__card, .nxb-plan, .nx-press__card{
  position:relative; will-change:transform;
  transition:transform .3s var(--pro-ease), box-shadow .3s var(--pro-ease), border-color .3s, background .25s; }
.nxc-div:hover, .nxm-product:hover, .nxb-plan:hover{ box-shadow:0 24px 70px -30px var(--pro-line-glow); }
.nxc-div::before, .nxm-product::before, .nxb-plan::before{ content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; pointer-events:none; z-index:3;
  background:var(--pro-grad); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude; opacity:0; transition:opacity .3s var(--pro-ease); }
.nxc-div:hover::before, .nxm-product:hover::before, .nxb-plan:hover::before{ opacity:1; }
/* numeri corp */
.nxc-bignum__item-n, .nxc-hero__numbers-n{ font-variant-numeric:tabular-nums; }
/* CTA finale corp: stessa aurora conica del vband */
.nxc-cta-big{ isolation:isolate; overflow:hidden; position:relative; }
.nxc-cta-big::before{ content:""; position:absolute; inset:-45%; z-index:-1; pointer-events:none;
  background:conic-gradient(from 0deg, transparent 0 62%, var(--pro-line-glow) 76%, transparent 88%);
  animation:proSpin 28s linear infinite; filter:blur(52px); opacity:.8; }

/* ---- accessibilità / motion / mobile ---- */
@media (prefers-reduced-motion:reduce){
  .pro-reveal{ opacity:1!important; transform:none!important; filter:none!important; transition:none; }
  .nx-vhero h1, .nx-vhero__sub, .nx-vhero__ctas, .nx-vhero__trust, .nx-vhero__bg, .pro-hero-blobs i,
  .nxc-hero__eyebrow, .nxc-hero h1, .nxc-hero__sub, .nxc-hero__ctas, .nxc-hero__numbers{ animation:none!important; opacity:1!important; transform:none!important; filter:none!important; }
  .pro-marquee .nx-trust-strip__list{ animation:none; flex-wrap:wrap; justify-content:center; width:auto; }
  .nx-vband::before, .nx-vhero__panel::after, .nxc-cta-big::before{ animation:none; display:none; }
  .pro-cursor, .pro-cursor-dot, .pro-progress, .pro-hero-grid{ display:none; }
}
@media (max-width:760px){
  .pro-cursor, .pro-cursor-dot{ display:none; }
  .pro-hero-blobs i{ filter:blur(46px); }
  .pro-hero-grid{ background-size:34px 34px; opacity:.25; }
}
