/* assets/hero-lab.css - Hero "Tron / HUD"
   Foto o video a tutto schermo come in origine (layout e regole responsive originali invariati),
   sopra una scena WebGL (hero-lab.js + Three.js gia' nel progetto): griglia al neon, scie di luce,
   reattore olografico con LED, polvere luminosa. Colori: solo quelli del sito.
   html[data-hx] lo imposta lo script inline in <head>; assente = hero originale (?hx=0 in locale). */

:root {
    --hl-navy: #0b1730;
    --hl-ink: #0a1a40;
    --hl-blue: #2575fc;
    --hl-cyan: #00c6ff;
    --hl-violet: #7c5cff;
    --hl-ease: cubic-bezier(.22, .8, .24, 1);
    --hl-wrap: min(1320px, 100vw - 3rem);
    --hl-gut: calc((100vw - var(--hl-wrap)) / 2);
    --hl-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --hl-fade: 64px;
}

.hl3d, .hl-fade, .hl-picker, .hl-prog { display: none; }

/* ---------------- livelli: foto < velo < scena 3D < testo < controlli ---------------- */
html[data-hx] #main-content .hero { isolation: isolate; background: var(--hl-navy); --sp: 0; }
html[data-hx] #main-content .hero__waves { display: none; }
html[data-hx] #main-content .hero__slide--active { z-index: auto; }
html[data-hx] #main-content .hero__slide--video .hero__video { z-index: 0; filter: saturate(.9) contrast(1.06) brightness(.88); }
html[data-hx] #main-content .hero__slide::before {
    z-index: 1;
    background:
        radial-gradient(90% 70% at 70% 35%, rgba(37, 117, 252, .16), transparent 70%),
        linear-gradient(180deg, rgba(6, 12, 30, .58) 0%, rgba(8, 20, 52, .62) 55%, rgba(6, 12, 30, .86) 100%);
}
html[data-hx] #main-content .hero__slide .hero__content { z-index: 6; }   /* testi sempre sopra scena 3D, sfumatura e controlli */
html[data-hx] #main-content .hero__slider-controls { z-index: 5; }

html[data-hx] .hl3d { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none;
    opacity: 0; transition: opacity 1.2s ease; }
html[data-hx] .hl3d.is-on { opacity: 1; }

/* raccordo con la sezione successiva: la scena sfuma nel bianco, la trama a puntini continua */
html[data-hx] .hl-fade { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: var(--hl-fade); z-index: 4; pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .7) 60%, #fff); }
html[data-hx] .hl-fade::before { content: ""; position: absolute; inset: 0;
    background: radial-gradient(rgba(37, 117, 252, .3) 1px, transparent 1.6px) 0 0 / 26px 26px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000); mask-image: linear-gradient(to bottom, transparent, #000); }

/* ---------------- testi: titolo con gradiente luce del brand ---------------- */
html[data-hx] #main-content .hero h1, html[data-hx] #main-content .hero .hero__title {
    background: linear-gradient(100deg, #fff 0%, #fff 42%, #bfeeff 70%, #5fd4ff 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
    text-shadow: none; filter: drop-shadow(0 6px 26px rgba(4, 10, 28, .55));
    padding-bottom: .1em;   /* il gradiente copre anche le discendenti (p, g) */
}
html[data-hx] #main-content .hero p { color: rgba(255, 255, 255, .9); text-shadow: 0 2px 14px rgba(4, 10, 28, .5); }
html[data-hx] #main-content .hero .btn--primary { box-shadow: 0 0 0 1px rgba(0, 198, 255, .35), 0 10px 30px -8px rgba(0, 198, 255, .55); }

/* intro testi */
html[data-hx] #main-content .hero__slide--active .hero__content > * { animation: hl-in 1s var(--hl-ease) both; }
html[data-hx] #main-content .hero__slide--active .hero__content > :nth-child(2) { animation-delay: .1s; }
html[data-hx] #main-content .hero__slide--active .hero__content > :nth-child(3) { animation-delay: .2s; }
html[data-hx] #main-content .hero__slide--active .hero__content > :nth-child(4) { animation-delay: .32s; }
@keyframes hl-in { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }

/* ---------------- desktop: testo a sinistra, il reattore 3D occupa la destra ---------------- */
@media (min-width: 1025px) and (min-height: 600px) {
    html[data-hx] { --hl-fade: 120px; }
    html[data-hx] #main-content .hero__slide { align-items: stretch; text-align: left; }
    html[data-hx] #main-content .hero__slide .hero__content {
        width: var(--hl-wrap); max-width: none; margin-inline: auto; padding-inline: 0;
        align-items: flex-start; text-align: left;
    }
    html[data-hx] #main-content .hero__badges, html[data-hx] #main-content .hero__cta-group { justify-content: flex-start; }
    /* colonna testo = 58% del contenitore; la parola piu' lunga (~9 em) ci sta sempre */
    html[data-hx] #main-content .hero h1, html[data-hx] #main-content .hero .hero__title {
        font-size: min(6.2rem, calc(var(--hl-wrap) * .58 / 8.6), 9.5svh); line-height: 1; letter-spacing: -.04em;
        max-width: calc(var(--hl-wrap) * .58); text-align: left; margin-bottom: .35em;
    }
    html[data-hx] #main-content .hero p { margin-left: 0; margin-right: 0; max-width: min(46ch, calc(var(--hl-wrap) * .5)); text-align: left; }
    html[data-hx] #main-content .hero__slider-dots { left: var(--hl-gut); transform: none; bottom: 1.6rem; }
    html[data-hx] #main-content .hero__slider-dot { background: rgba(37, 117, 252, .3); border: 0; width: 10px; height: 10px; }
    html[data-hx] #main-content .hero__slider-dot--active { background: linear-gradient(90deg, var(--hl-cyan), var(--hl-blue)); width: 34px; }
    html[data-hx] #main-content .hero__slide .hero__content { margin-bottom: calc(var(--hl-fade) * .55); }
    html[data-hx] #main-content .hero__slider-btn { width: 48px; height: 48px; font-size: 1.2rem; background: rgba(6, 12, 30, .35); border: 1px solid rgba(0, 198, 255, .45); }
    html[data-hx] #main-content .hero__slider-btn:hover { background: var(--hl-cyan); border-color: var(--hl-cyan); color: var(--hl-navy); }
    html[data-hx] #main-content .hero__slider-btn--prev { left: 1rem; }
    html[data-hx] #main-content .hero__slider-btn--next { right: 1rem; }

    .hl-picker { display: flex; position: fixed; left: 14px; top: 92px; z-index: 99999; gap: 4px; padding: 5px; border-radius: 999px;
        background: rgba(10, 26, 64, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font: 600 12px/1 var(--hl-mono); color: #fff; align-items: center; }
    .hl-picker span { padding: 0 8px 0 10px; opacity: .6; }
    .hl-picker a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; }
    .hl-picker a[aria-current="true"] { background: linear-gradient(135deg, var(--hl-cyan), var(--hl-blue)); }
}

/* =====================================================================
   RACCORDO CON LE SEZIONI (tutte le risoluzioni)
   ===================================================================== */
html[data-hx] .bp-pre { clip-path: inset(0 100% 0 0 round var(--radius, 18px)); }
html[data-hx] .bp-pre.bp-in { clip-path: inset(0 0 0 0 round var(--radius, 18px)); transition: clip-path 1.1s var(--hl-ease); }
.bp-scan { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; z-index: 6; pointer-events: none;
    background: linear-gradient(var(--hl-cyan), var(--hl-blue)); box-shadow: 0 0 18px 2px rgba(0, 198, 255, .55); opacity: 0; }
.bp-in > .bp-scan { animation: bp-scan 1.1s var(--hl-ease) forwards; }
@keyframes bp-scan { 0% { left: 0; opacity: 1; } 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
html[data-hx] .bp-eb::before { transform: scaleX(0); transform-origin: left center; }
html[data-hx] .bp-eb.bp-in::before { transform: none; transition: transform .9s var(--hl-ease) .15s; }

@media (prefers-reduced-motion: reduce) {
    html[data-hx] #main-content .hero__slide .hero__content > * { animation: none !important; }
    html[data-hx] .bp-pre { clip-path: none; }
    html[data-hx] .bp-eb::before { transform: none; }
}

/* =====================================================================
   TESTO DELLA HERO IN RILIEVO: spessore estruso nei colori del brand (fisso)
   ===================================================================== */
html[data-hx] #main-content .hero { --mx: 0; --my: 0; }
html[data-hx] #main-content .hero h1, html[data-hx] #main-content .hero .hero__title {
    filter:
        drop-shadow(0 1px 0 #9fe6ff)
        drop-shadow(0 1px 0 #4fb8ff)
        drop-shadow(0 1px 0 #2575fc)
        drop-shadow(0 1px 0 #1b4fd6)
        drop-shadow(0 2px 0 #12348f)
        drop-shadow(0 16px 24px rgba(2, 8, 24, .6));
}
html[data-hx] #main-content .hero__badges .badge { box-shadow: 0 8px 24px -8px rgba(2, 8, 24, .6), inset 0 1px 0 rgba(255, 255, 255, .25); }
html[data-hx] #main-content .hero .btn { box-shadow: 0 14px 30px -10px rgba(2, 8, 24, .65); }
html[data-hx] #main-content .hero .btn--primary { box-shadow: 0 0 0 1px rgba(0, 198, 255, .35), 0 14px 34px -10px rgba(0, 198, 255, .6); }

/* testi fermi: nessuna inclinazione col mouse ne' spostamento con lo scroll */
}

/* =====================================================================
   INDICATORE DI AVANZAMENTO: esagono che si completa con lo scroll, al clic torna su
   ===================================================================== */
html[data-hx] .hl-prog {
    display: grid; place-items: center; position: fixed; left: 20px; bottom: 20px; z-index: 60;
    width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--hl-ink);
    opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
    transition: opacity .45s var(--hl-ease), transform .45s var(--hl-ease);
}
html[data-hx] .hl-prog.is-on { opacity: 1; transform: none; pointer-events: auto; }
.hl-prog svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
    filter: drop-shadow(0 8px 18px rgba(10, 26, 64, .22)); transition: transform .5s var(--hl-ease); }
.hl-prog .tr { fill: rgba(255, 255, 255, .86); stroke: rgba(37, 117, 252, .16); stroke-width: 3; }
.hl-prog .bar { fill: none; stroke: url(#hlpg); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round;
    stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); }
.hl-prog .core { fill: none; stroke: rgba(37, 117, 252, .28); stroke-width: 1.2; transform-origin: 32px 32px;
    transform: rotate(calc(var(--p, 0) * 360deg)); }
.hl-prog b { position: relative; font: 700 13px/1 var(--hl-mono); letter-spacing: .02em; color: var(--hl-ink); transition: opacity .25s, transform .25s; }
.hl-prog b::after { content: '%'; font-size: 9px; margin-left: 1px; color: var(--hl-blue); }
.hl-prog .up { position: absolute; font: 700 18px/1 var(--hl-mono); color: #fff; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.hl-prog:hover .tr, .hl-prog:focus-visible .tr { fill: url(#hlpg); stroke: transparent; }
.hl-prog:hover b, .hl-prog:focus-visible b { opacity: 0; transform: translateY(-6px); }
.hl-prog:hover .up, .hl-prog:focus-visible .up { opacity: 1; transform: none; }
.hl-prog:hover svg { transform: rotate(30deg); }
.hl-prog:focus-visible { outline: none; }
.hl-prog:focus-visible svg { filter: drop-shadow(0 0 0 3px rgba(0, 198, 255, .5)); }
@media (max-width: 768px) {
    html[data-hx] .hl-prog { width: 50px; height: 50px; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
    .hl-prog b { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .hl-prog, .hl-prog svg, .hl-prog b, .hl-prog .up { transition: none; } }
