        /* --- RESET & BASE --- */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html, body {
            height: 100%;
            background: var(--bg-color);
            color: var(--text-title);
            font-family: "Montserrat", sans-serif;
            overflow: hidden; 
            cursor: none !important; 
            transition: background 0.6s ease;
              
            /* blocco selezione testo */
            user-select: none;
            -webkit-user-select: none; /* Safari */
            -ms-user-select: none;     /* IE */
        }

         /* Bloccare drag e interazione immagini*/
        img {
            pointer-events: none;
            -webkit-user-drag: none;
        }
        
        a, button {
            cursor: none !important;
        }

        /* --- WRAPPER SLOT MACHINE --- */
        #master-wrapper {
            height: 100vh;
            width: 100%;
            transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
            will-change: transform;
        }

        /* --- TITOLO PROGETTO (Solo inizio pagina) --- */
        .project-header {
            position: absolute;
            top: 5vh; /* Distanza dall'alto */
            
            /* Allineamento dinamico: segue la stessa logica del contenuto */
            left: 5%; 
                        
            font-family: "Syncopate", sans-serif;
            font-weight: 400;
            font-size: clamp(15px, 5vw, 45px);
            letter-spacing: 6px;
            text-transform: uppercase;
            color: var(--project-title-color);
            z-index: 10;
            margin-bottom: 20px;
        }

        /* --- SEZIONI --- */
        .fase-section {
            height: 100vh;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0 10%;
            position: relative;
        }

        .fase-container {
            display: flex;
            align-items: center;
            gap: 5vw; /* Usiamo vw per il gap così si restringe con lo schermo */
            max-width: 1200px;
            width: 90%;

            /* Applichiamo il margine sinistro variabile */
            margin-left: var(--container-margin-left);
            
            /* FIX: Permette al contenuto di non collassare su schermi bassi */
            min-height: 0; 
        }

        /* --- FIX IMMAGINI RESPONSIVE --- */
        /* Abbiamo rimosso le altezze fisse in px per evitare tagli su schermi da 13/14" */
        .fase-image, 
        .fase-image-v {
            flex: 1.2;
            display: flex;
            justify-content: center;
            align-items: center;
        }


        .fase-image img, 
        .fase-image-v img {
            width: auto; /* Cambiato da 100% a auto */
            max-width: 100%; /* Impedisce che esca lateralmente */
            height: auto;
            max-height: 60vh;
            object-fit: contain;
            border-radius: 10px;
            display: block;
        }

        .fase-text {
            flex: 0.8;
        }

        .fase-text h2 {
            font-family: "Syncopate", sans-serif;
            font-weight: 400;
            font-size: clamp(1.5rem, 3vw, 2.5rem); /* Scalabile in base alla risoluzione */
            margin-bottom: 20px;
            letter-spacing: 5px;
            color: var(--text-title);
        }

        .fase-text p {
            line-height: 1.8;
            opacity: var(--p-opacity);
            color: var(--text-body);
            font-size: clamp(0.9rem, 1.2vw, 1.1rem); /* Testo leggibile su ogni schermo */
        }

        /* --- MENU LATERALE --- */
        .side-menu {
            position: fixed;
            left: 5%;
            top: 50%;
            transform: translateY(-50%);
            z-index: 100;
            display: flex;
            flex-direction: column;
            gap: 20px;
            mix-blend-mode: difference;
        }

        .side-menu a {
            color: var(--menu-color);
            text-decoration: none;
            font-size: 0.7rem;
            letter-spacing: 2px;
            text-transform: uppercase;
            opacity: var(--menu-inactive-opacity);
            transition: 0.3s;
            display: flex;
            align-items: center;
            gap: 10px;
            pointer-events: auto;
        }

        .side-menu a.active {
            opacity: 1;
            font-weight: bold;
        }

        /* --------------------------------------------------------------------------------------------- */
        /* --- CURSORE --- */
        /* --------------------------------------------------------------------------------------------- */

        .cursor-dot, .cursor-outline {
            position: fixed;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 9999;
            mix-blend-mode: difference;
        }

        .cursor-dot {
            width: 16px;
            height: 16px;
            background-color: var(--cursor-color);
            border-radius: 50%;
            transition: width 0.3s, height 0.3s, opacity 0.3s;
        }

        .cursor-outline {
            width: 30px;
            height: 30px;
            border: 2px solid var(--cursor-color);
            border-radius: 50%;
            transition: opacity 0.3s;
        }

        .cursor-dot.hovering {
            width: 50px;
            height: 50px;
            opacity: 0.5;
        }

        .cursor-outline.hovering {
            opacity: 0;
        }

        /* Nasconde il cursore su tutti i dispositivi che non hanno un mouse (Touch) */
        @media (pointer: coarse), (hover: none) {
            .cursor-dot, 
            .cursor-outline {
                display: none !important;
            }

            /* Ripristina il cursore normale di sistema per il touch */
            body, a, button {
                cursor: auto !important;
            }
        }

        /* --------------------------------------------------------------------------------------------- */

        /* --- BACK HOME --- */
        .back-home {
            position: absolute;
            top: 5%;
            right: 5%;
            z-index: 100;
            color: var(--menu-color);
            text-decoration: none;
            font-size: 0.7rem;
            letter-spacing: 2px;
            mix-blend-mode: difference;
            opacity: 0.7;
            transition: 0.3s;
        }
        .back-home:hover { opacity: 1; }

        /* --- 🔧 FIX PER SCHERMI DA 13 POLLICI E SIMILI (Laptop) --- */
        @media (max-width: 1200px) {

            /* Abilito il touch da mobile*/
            html, body {
                overflow-y: auto !important; /* Riabilita lo scorrimento verticale */
                height: auto !important;     /* Permette alla pagina di allungarsi */
            }

            #master-wrapper {
                height: auto !important;
                transform: none !important;  /* Disabilita l'effetto slot machine che blocca il touch */
            }
            
            .fase-section {
                height: auto !important;     /* Evita che le sezioni siano bloccate all'altezza dello schermo */
                min-height: 100vh;
                
                display: flex;
                flex-direction: column;
                justify-content: flex-start; /* Allinea dall'alto invece che al centro */
                padding-top: 120px; /* CREA LO SPAZIO PER IL TASTO BACK */
                padding-bottom: 60px;
            }


            /* 1. Nascondiamo il menu laterale che occuperebbe spazio utile */
            .side-menu {
                display: none !important;
            }
                    
            /* 2. Il contenitore passa a layout verticale e annulla i margini laterali */
            .fase-container {
                margin-left: 0 !important;
                width: 100%;
                max-width: 100%;
                padding: 0 5%;
                flex-direction: column !important; /* Forza il testo sopra o sotto l'immagine */
                justify-content: center;
                gap: 30px;
                min-height: 0;
            }

            /* 3. Gestione ordine: nelle sezioni pari l'immagine resta sopra il testo */
            .fase-section:nth-child(even) .fase-container {
                flex-direction: column-reverse !important; 
            }

            /* 4. FIX IMMAGINI: Evitiamo il formato rettangolare forzato e i tagli */
            .fase-image, .fase-image-v {
                width: 100%;
                flex: none;
                display: flex;
                justify-content: center;
            }

            .fase-image img, .fase-image-v img {
                width: auto;         /* L'immagine non si allarga forzatamente */
                max-width: 90%;      /* Impedisce all'immagine di toccare i bordi */
                height: auto;        /* Mantiene le proporzioni originali */
                max-height: 45vh;    /* Limita l'altezza per non spingere il testo fuori schermo */
                object-fit: contain; /* CRUCIALE: Mostra l'immagine intera senza tagliarla mai */
                margin: 0 auto;
                border-radius: 10px;
            }

            /* 5. Testo centrato e spaziato */
            .fase-text {
                flex: none;
                width: 100%;
                text-align: center;
            }

            .fase-text h2 {
                font-size: 1.8rem;
                margin-top: 10px;
                margin-bottom: 15px;
                letter-spacing: 3px;
            }

            .fase-text p {
                margin: 0 auto;
                max-width: 90%;
                font-size: 0.95rem;
            }

            /* 6. Adattamento pulsante Back */
            .back-home {
                top: 80px; 
                right: 5%;
                background: rgba(0,0,0,0.5); /* Fondo scuro per leggibilità sopra le immagini */
                padding: 5px 10px;
                border-radius: 4px;
            }
        }

        /* Ottimizzazione ulteriore per smartphone molto stretti */
        @media (max-width: 480px) {
            .fase-text h2 { 
                font-size: 1.4rem; 
            }
            .fase-image img, .fase-image-v img { 
                max-height: 35vh; 
            }
        }

        /* Allineamento specifico per desktop */
        @media (min-width: 1201px) {
            .project-header {
                left: 5%; 
                padding-left: 20px; 
            }
        }
        
       
      
        /* --------------------------------------------------------------------------- */       
        /* --- NAVIGAZIONE IN FONDO ALLA SEZIONE --- */
        /* --------------------------------------------------------------------------- */       
        .project-navigation {
            position: absolute;
            bottom: 4vh; /* Lo tiene agganciato al fondo della sezione */
            left: 0;
            width: 100%;
            display: flex;
            justify-content: center;
            gap: 60px;
            z-index: 100;
        }

        .nav-btn {
            font-family: "Syncopate", sans-serif;
            font-size: 0.7rem;
            letter-spacing: 3px;
            text-decoration: none;
            color: var(--text-title);
            opacity: 0.5;
            transition: 0.3s;
            mix-blend-mode: difference;
        }

        .nav-btn.prev {
            display: inline-flex;
            align-items: center;
            animation: arrow-bounce-left 1.5s infinite ease-in-out;
            opacity: 0.7; /* Leggermente trasparente di base */
            transition: opacity 0.3s;
        }

        .nav-btn.next {
            display: inline-flex;
            align-items: center;
            animation: arrow-bounce-right 1.5s infinite ease-in-out;
            opacity: 0.7;
            transition: opacity 0.3s;
        }

        /* Al passaggio del mouse diventano solo più luminose */
        .nav-btn:hover {
            opacity: 1;
            letter-spacing: 5px;
        }

        /* Animazione per la freccia PREV (va verso sinistra) */
        @keyframes arrow-bounce-left {
            0%, 100% { transform: translateX(0); }
            50% { transform: translateX(-15px); }
        }

        /* Animazione per la freccia NEXT (va verso destra) */
        @keyframes arrow-bounce-right {
            0%, 100% { transform: translateX(0); }
            50% { transform: translateX(15px); }
        }

        /* --- FIX PER VERSIONE MOBILE / LAPTOP (< 1200px) --- */
        @media (max-width: 1200px) {
            .fase-section {
                display: flex;
                flex-direction: column; /* Forza la sezione a incolonnare i pezzi */
                justify-content: center;
                height: auto !important;
                padding-bottom: 60px; /* Spazio per le frecce */
            }

            .project-navigation {
                position: relative; /* Rimuove il posizionamento assoluto che causa sovrapposizioni */
                bottom: auto;
                margin-top: 40px; /* Spazio tra il testo e le frecce */
                gap: 30px;
                padding-bottom: 20px;
            }

            .nav-btn {
                font-size: 0.8rem; /* Leggermente più grande per il touch */
                opacity: 0.8; /* Più visibile su mobile */
            }
        }