/* =========================================================================
   NexumGDPR - Scene Landing stile "Apple Pro"
   --p  = progresso scena (0 → 1) scritto da landing-scenes.js
   --sp = progresso del singolo elemento nella sua finestra data-step
   ========================================================================= */

/* ---------- Base scena ---------- */
.scene {
    position: relative;
    --p: 0;
}

.scene-sticky {
    position: relative;
}

.scenes-full .scene {
    height: var(--scene-length, 240vh);
}

.scenes-full .scene-sticky {
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    overflow: hidden;
}

.scenes-lite .scene,
.scenes-static .scene {
    height: auto;
    padding: 3.5rem 0;
}

/* ---------- Primitivi di animazione legati allo scroll ---------- */
.step-in {
    opacity: var(--sp, 0);
    transform: translateY(calc(56px * (1 - var(--sp, 0)))) scale(calc(0.94 + 0.06 * var(--sp, 0)));
    will-change: transform, opacity;
}

.step-out {
    opacity: calc(1 - var(--sp, 0));
    transform: translateY(calc(-70px * var(--sp, 0))) scale(calc(1 - 0.05 * var(--sp, 0)));
    will-change: transform, opacity;
}

.step-blur-in {
    opacity: var(--sp, 0);
    filter: blur(calc(14px * (1 - var(--sp, 0))));
    transform: scale(calc(1.06 - 0.06 * var(--sp, 0)));
}

.scenes-static .step-in,
.scenes-static .step-blur-in {
    opacity: 1;
    transform: none;
    filter: none;
}

.scenes-static .step-out {
    opacity: 1;
    transform: none;
}

/* ---------- Titoli scena "Apple Pro" ---------- */
.scene-head {
    text-align: center;
    max-width: 880px;
    margin: 0 auto;
    padding-top: 3.2vh;
}

.scene-title {
    font-size: clamp(2.1rem, 4.6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.06;
    margin-bottom: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scene-sub {
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    color: #94a3b8;
    line-height: 1.55;
    max-width: 680px;
    margin: 0 auto;
}

/* =========================================================================
   SCENA 0 - HERO
   ========================================================================= */
.scene-hero {
    --scene-length: 250vh;
}

.hero-stage {
    display: grid;
    place-items: center;
    height: 100%;
}

.hero-stage > * {
    grid-area: 1 / 1;
}

.hero-copy {
    align-self: start;
    text-align: center;
    max-width: 920px;
    padding-top: 4.5vh;
    z-index: 1;
}

.hero-copy h1 {
    font-size: clamp(2.3rem, 4.7vw, 4.3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.04;
    margin: 0.6rem 0 1rem;
    background: linear-gradient(180deg, #ffffff 10%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-copy .hero-tagline {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto 1.4rem;
    line-height: 1.6;
}

.hero-copy .hero-ctas {
    justify-content: center;
}

.hero-public-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1rem;
    font-size: 0.84rem;
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
}

/* Quando il testo dell'Hero è sfumato non deve più intercettare i click */
.scenes-full .hero-copy.is-step-done {
    pointer-events: none;
    visibility: hidden;
}

/* Dispositivo (portatile disegnato in CSS, nessun marchio) */
.hero-device-wrap {
    perspective: 1800px;
    z-index: 2;
}

.hero-device {
    --dw: min(980px, 84vw, calc((100vh - 76px) * 0.62 * 1.6));
    width: var(--dw);
    transform-origin: 50% 100%;
    transform:
        translateY(calc(38vh * (1 - var(--sp, 0))))
        rotateX(calc(34deg * (1 - var(--sp, 0))))
        scale(calc(0.8 + 0.26 * var(--sp, 0)));
    will-change: transform;
}

.device-screen {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 18px 18px 6px 6px;
    padding: 12px;
    background: linear-gradient(180deg, #1f2433 0%, #0d1018 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 40px 120px rgba(79, 70, 229, calc(0.18 + 0.3 * var(--sp, 0))),
        0 0 0 1px rgba(0, 0, 0, 0.6) inset;
}

.device-screen::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: #2a3142;
}

.device-viewport {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #0b1020;
    position: relative;
}

.device-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
}

.device-base {
    position: relative;
    height: 16px;
    width: 112%;
    margin-left: -6%;
    border-radius: 0 0 22px 22px;
    background: linear-gradient(180deg, #3a4152 0%, #1a1e29 60%, #0f121a 100%);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.device-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 18%;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 0 0 10px 10px;
    background: #12151d;
}

/* Dashboard "scheletro" provvisoria (sostituita dallo screenshot reale in Tappa 2) */
.mock-app {
    display: grid;
    grid-template-columns: 17% 1fr;
    height: 100%;
    font-size: clamp(7px, 0.78vw, 11px);
    color: #cbd5e1;
}

.mock-side {
    background: #0e1426;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.2em 0.9em;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.mock-logo {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.8em;
}

.mock-logo span {
    width: 1.6em;
    height: 1.6em;
    border-radius: 0.45em;
    background: linear-gradient(135deg, #6366f1, #a855f7);
}

.mock-nav {
    display: flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.45em 0.6em;
    border-radius: 0.5em;
    color: #94a3b8;
}

.mock-nav i {
    width: 1.1em;
    text-align: center;
}

.mock-nav.is-on {
    background: rgba(99, 102, 241, 0.18);
    color: #fff;
}

.mock-main {
    padding: 1.3em 1.5em;
    display: flex;
    flex-direction: column;
    gap: 1.1em;
    overflow: hidden;
}

.mock-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mock-top strong {
    font-size: 1.45em;
    color: #fff;
}

.mock-pill {
    padding: 0.35em 0.8em;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    font-weight: 700;
}

.mock-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9em;
}

.mock-kpi {
    padding: 0.9em 1em;
    border-radius: 0.8em;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.mock-kpi b {
    display: block;
    font-size: 1.9em;
    color: #fff;
    line-height: 1.1;
}

.mock-kpi small {
    color: #94a3b8;
}

.mock-table {
    border-radius: 0.8em;
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.mock-row {
    display: grid;
    grid-template-columns: 2.2fr 1.4fr 1fr;
    gap: 0.8em;
    align-items: center;
    padding: 0.75em 1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mock-row:last-child {
    border-bottom: none;
}

.mock-row.is-head {
    background: rgba(255, 255, 255, 0.03);
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85em;
}

.mock-bar {
    height: 0.55em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.mock-status {
    justify-self: start;
    padding: 0.25em 0.7em;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9em;
}

.mock-status.ok { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.mock-status.sign { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }
.mock-status.wait { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }

/* Chip flottanti attorno al dispositivo */
.hero-chip {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 290px;
    padding: 0.85rem 1.05rem;
    border-radius: 1rem;
    background: rgba(15, 18, 32, 0.82);
    border: 1px solid rgba(129, 140, 248, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.35;
}

.hero-chip i {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: 0.65rem;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.hero-chip.c1 { top: 16%; left: 2%; }
.hero-chip.c2 { top: 30%; right: 1%; }
.hero-chip.c3 { bottom: 20%; left: 4%; }
.hero-chip.c4 { bottom: 9%; right: 3%; }

.hero-chip.c2 i { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.hero-chip.c3 i { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.hero-chip.c4 i { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }

.hero-closing {
    align-self: end;
    z-index: 4;
    margin-bottom: 2.4vh;
    text-align: center;
    font-size: clamp(1.05rem, 1.6vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.hero-closing span {
    background: linear-gradient(90deg, #a5b4fc, #6ee7b7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 2.2vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: calc(1 - var(--p) * 8);
    pointer-events: none;
}

.hero-scroll-hint i {
    animation: nxHintBounce 1.6s ease-in-out infinite;
}

@keyframes nxHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* Hero in modalità lite / statica: tutto in colonna */
.scenes-lite .hero-stage,
.scenes-static .hero-stage {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scenes-lite .hero-copy,
.scenes-static .hero-copy {
    opacity: 1;
    transform: none;
    padding-top: 1rem;
}

.scenes-lite .hero-device,
.scenes-static .hero-device {
    --dw: min(980px, 92vw);
    transform: rotateX(calc(18deg * (1 - var(--sp, 0)))) scale(calc(0.92 + 0.08 * var(--sp, 0)));
}

.scenes-lite .hero-chip,
.scenes-static .hero-chip {
    position: static;
    max-width: none;
    width: 100%;
}

.scenes-lite .hero-chips,
.scenes-static .hero-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.scenes-lite .hero-scroll-hint,
.scenes-static .hero-scroll-hint {
    display: none;
}

.scenes-lite .hero-closing,
.scenes-static .hero-closing {
    margin-bottom: 0;
}

/* =========================================================================
   SCENA 1 - NUMERI
   ========================================================================= */
.scene-numbers {
    --scene-length: 210vh;
}

.numbers-stage {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6vh;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
}

.number-card {
    position: relative;
    padding: 2rem 1.4rem 1.6rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid rgba(255, 255, 255, calc(0.06 + 0.12 * var(--sp, 0)));
    text-align: center;
    overflow: hidden;
}

.number-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    transform-origin: left center;
    transform: scaleX(var(--sp, 0));
    background: linear-gradient(90deg, #6366f1, #a855f7, #10b981);
}

.number-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    font-size: 1.2rem;
    background: rgba(99, 102, 241, 0.16);
    color: #a5b4fc;
}

.number-value {
    font-size: clamp(2.6rem, 4.6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #ffffff 20%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.number-label {
    margin-top: 0.7rem;
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1rem;
}

.number-sub {
    margin-top: 0.25rem;
    font-size: 0.84rem;
    color: #94a3b8;
}

.numbers-closing {
    text-align: center;
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.numbers-closing span {
    background: linear-gradient(90deg, #6ee7b7, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 980px) {
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .numbers-grid {
        grid-template-columns: 1fr;
    }
}
