/* RESET E FONDAMENTALI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variabili per il layout */
:root {
    --color-background: #dbd5c9;
    /* Beige chiaro/caldo */
    --color-text: #111111;
    /* Nero scuro */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Sofia Sans Condensed', sans-serif;
    --max-width: 1300px;
    --padding-sides: 40px;
    --sidebar-width: 80px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #999;
}

/* -------------------- LAYOUT PRINCIPALE (GRID) -------------------- */
.page-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar verticale a sinistra */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: var(--padding-sides) 0;
    border-right: 1px solid rgba(17, 17, 17, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-background);
    z-index: 100;
}

.sidebar .logo {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.sidebar-nav a {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    transition: color 0.3s, opacity 0.3s;
}

.location-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* -------------------- MAIN CONTENT (GESTIONE TRADUZIONE) -------------------- */
.main-content {
    position: relative;
}

/* -------------------- SELETTORE LINGUA -------------------- */
.lang-selector-container {
    position: absolute;
    top: 40px;
    right: var(--padding-sides);
    z-index: 50;
}

.language-selector {
    position: relative;
    display: inline-block;
}

.current-lang-button {
    background-color: transparent;
    border: 1px solid var(--color-text);
    padding: 8px 12px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.current-lang-button:hover {
    background-color: rgba(17, 17, 17, 0.1);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-background);
    border: 1px solid var(--color-text);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    display: none;
    z-index: 60;
}

.lang-dropdown.open {
    display: block;
}

.lang-dropdown button {
    width: 100%;
    text-align: right;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.lang-dropdown button:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

/* -------------------- SEZIONE HERO (TITOLO MAGAZINE) -------------------- */
.hero-section {
    max-width: var(--max-width);
    margin: 100px 0 150px 0;
    padding: 0 var(--padding-sides);
}

.magazine-title {
    font-family: var(--font-secondary);
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1;
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.5rem;
    max-width: 600px;
}

/* EFFETTO TESTO OUTLINE */
.outline-text {
    color: transparent;
    -webkit-text-stroke: 1px var(--color-text);
    text-stroke: 1px var(--color-text);
    transition: -webkit-text-stroke 0.3s ease, color 0.3s ease;
    display: inline-block;
}

.magazine-title:hover .outline-text {
    -webkit-text-stroke: 0;
    text-stroke: 0;
    color: #ffffff;
}

/* -------------------- SEZIONE LAVORI -------------------- */
.work-section {
    padding-bottom: 100px;
}

.services-list {
    max-width: var(--max-width);
    margin: 0;
    padding: 0;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px var(--padding-sides);
    border-top: 1px solid rgba(17, 17, 17, 0.1);
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
}

.service-item:last-child {
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

.service-details {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2;
    transition: color 0.3s ease;
}

.service-item:hover {
    color: #ffffff;
}

/* Effetto di riempimento scuro all'hover */
.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-text);
    transform: translateX(-100%);
    transition: transform 0.4s ease-out;
    z-index: 1;
}

.service-item:hover::before {
    transform: translateX(0);
}

.service-index {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.7;
    min-width: 50px;
}

.service-title {
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    line-height: 1.2;
    font-weight: 700;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 2;
}

.service-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.service-year {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.7;
}

/* -------------------- SEZIONE ANIMAZIONE TESTO (CHAOS TEXT) -------------------- */
.chaos-text-section {
    padding: 80px var(--padding-sides);
    border-top: 1px solid rgba(17, 17, 17, 0.1);
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
    margin: 50px 0 100px 0;
    text-align: center;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.chaos-text-block {
    font-family: var(--font-secondary);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.85;
    cursor: pointer;
    display: inline-block;
    transform-style: flat;
    position: relative;
}

.chaos-text-word {
    display: inline-block;
    white-space: nowrap;
}

.chaos-text-letter {
    display: inline-block;
    position: relative;
    /* Transizione elastica per l'effetto ping-pong */
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.chaos-text-space {
    display: inline-block;
    width: 0.4em;
}

.chaos-text-word,
.chaos-text-letter {
    transform: translate(0, 0) rotate(0deg) scale(1);
}

/* -------------------- SEZIONE ABOUT -------------------- */
.about-section {
    background-color: var(--color-text);
    color: var(--color-background);
    padding: 80px 0;
    margin-bottom: 150px;
}

.about-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding-sides);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-profile-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    background-color: #333;
    border-radius: 8px;
    /* Aggiunto da te per coerenza */
}

.about-bio {
    font-size: 2rem;
    line-height: 1.3;
}

.cta-button {
    display: inline-block;
    border: 1px solid var(--color-background);
    padding: 10px 20px;
    color: var(--color-background);
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
    border-radius: 9999px;
    /* Aggiunto da te per coerenza (rounded-full) */
}

.cta-button:hover {
    background-color: var(--color-background);
    color: var(--color-text);
    transform: scale(1.05);
}

/* -------------------- SEZIONE CONTATTI -------------------- */
.contact-section {
    padding: 100px var(--padding-sides) 150px;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-heading {
    font-family: var(--font-secondary);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1;
}

.contact-email-link {
    font-family: var(--font-secondary);
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1;
    margin: 40px 0;
    padding-bottom: 5px;
    display: inline-block;
    position: relative;
}

.contact-email-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--color-text);
    transform: scaleX(0.2);
    transform-origin: left;
    transition: transform 0.4s ease-out;
    border-radius: 2px;
}

.contact-email-link:hover::after {
    transform: scaleX(1);
}

.contact-description {
    font-size: 1.25rem;
    max-width: 800px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.contact-social {
    display: flex;
    gap: 30px;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 700;
}


/* -------------------- FOOTER -------------------- */
.main-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px var(--padding-sides) 40px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.7;
}

.social-links a {
    margin-left: 15px;
}

/* -------------------- MODALE GALLERIA -------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 17, 17, 0.9);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100vw;
    height: 100vh;
    background-color: transparent;
    color: var(--color-background);
    position: relative;
    padding: 0;
    overflow-y: auto;
}

.gallery-main-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-header-text {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px var(--padding-sides) 40px;
    flex-shrink: 0;
}

.gallery-wrapper {
    flex-grow: 1;
    padding: 0 0 40px 0;
    overflow: hidden;
}

.gallery-container {
    display: flex;
    height: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 30px;
    padding-left: var(--padding-sides);
    padding-right: var(--padding-sides);
}

.gallery-container::-webkit-scrollbar {
    height: 6px;
}

.gallery-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.gallery-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.gallery-item {
    flex-shrink: 0;
    width: 700px;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 85%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-caption {
    height: 15%;
    padding: 10px 20px;
    color: var(--color-background);
    background-color: #1a1a1a;
    overflow: visible;
    white-space: normal;
}

.gallery-item-caption h4 {
    color: var(--color-background);
    margin-bottom: 2px;
    font-size: 1.1rem;
}

.gallery-item-caption p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.close-button {
    position: fixed;
    top: 40px;
    right: 40px;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    opacity: 0.9;
    color: var(--color-background);
    transition: opacity 0.3s, color 0.3s;
    z-index: 1001;
}

.close-button:hover {
    opacity: 1;
    color: #ff4444;
}

/* MEDIA QUERIES per la Responsività */
@media (max-width: 800px) {
    :root {
        --padding-sides: 25px;
    }

    .page-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .lang-selector-container {
        top: 25px;
        right: var(--padding-sides);
    }

    .close-button {
        top: 25px;
        right: 25px;
        font-size: 2rem;
    }

    .modal-header-text {
        padding: 40px 25px 20px;
    }

    .gallery-container {
        padding-left: var(--padding-sides);
        padding-right: var(--padding-sides);
        gap: 20px;
    }

    .gallery-item {
        width: 85vw;
        height: calc(100% - 20px);
    }

    .gallery-item img {
        height: 80%;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-profile-img {
        max-width: 200px;
        justify-self: center;
        border-radius: 8px;
    }

    .about-bio {
        font-size: 1.5rem;
        text-align: center;
    }

    .cta-button {
        justify-self: center;
    }

    .contact-email-link {
        margin: 20px 0 40px;
    }

    .contact-social {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .main-footer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .social-links a {
        margin: 0 8px;
    }

    .chaos-text-block {
        font-size: clamp(3rem, 6vw, 5rem);
    }
}
/* ======================================================================= */
/* 🚀 FIX RESPONSIVITÀ MOBILE (Gianluca Ieva Portfolio) 🚀 */
/* ======================================================================= */

/* 1. FIX GLOBALE ANTI-SCROLL */
/* Impedisce lo scorrimento orizzontale non voluto sulla pagina principale. */
.main-content {
    width: 100%;
    overflow-x: hidden;
}

/* 2. REGOLA GENERALE PER LA CENTRATURA SU DESKTOP-LIKE E OVERRIDE */
/* Resetta i margini per gli elementi a larghezza massima per prevenire problemi. */
.hero-section,
.work-section,
.about-content,
.contact-section,
.main-footer {
    /* Assicura che i blocchi di contenuto siano centrati quando hanno un max-width */
    margin-left: auto;
    margin-right: auto;
}

/* Annulla la regola di allineamento a sinistra della sezione Hero sul desktop */
/* (dove era "margin: 100px 0 150px 0;" o simile) */
.hero-section {
    margin: 100px auto 150px auto;
}


/* 3. MIGLIORAMENTI SPECIFICI PER MOBILE (sotto gli 800px) */
@media (max-width: 800px) {

    /* Aggiorna il padding per una migliore consistenza, se non già fatto correttamente nel tuo CSS */
    :root {
        --padding-sides: 25px;
    }

    /* Override per forzare la centratura dei blocchi di testo e bottoni */
    .hero-section {
        margin-top: 50px;
        /* Riduci lo spazio in alto su mobile */
        margin-bottom: 80px;
    }

    .intro-text {
        text-align: left;
        /* Mantieni l'allineamento a sinistra per i paragrafi */
        padding: 0 var(--padding-sides);
    }

    /* Assicura che gli elementi della lista lavori non creino overflow */
    .services-list {
        width: 100%;
    }

    /* Centratura per la sezione About */
    .about-bio {
        text-align: center;
    }

    .cta-button {
        /* Già gestito con justify-self: center nel tuo about-content grid, 
           ma aggiungiamo display: block per occupare una riga intera, se necessario. */
        display: inline-block;
    }

    /* Centratura del testo nella sezione Contatti */
    .contact-heading,
    .contact-description {
        text-align: center;
    }

    .contact-section {
        /* Assicura che il contenitore sia al 100% e centrato */
        width: 100%;
        padding: 50px var(--padding-sides);
        /* Aggiusta il padding */
    }

    /* Assicura che la testata del modale sia centrata */
    .modal-header-text {
        text-align: left;
        /* Mantieni l'allineamento a sinistra dei testi lunghi */
        padding: 40px 25px 20px;
    }

    /* Migliora la spaziatura del footer */
    .main-footer {
        padding: 20px var(--padding-sides) 40px;
    }
}
/* ======================================================================= */
/* 📱 FIX: Nascondi i tag dei servizi su Mobile (sotto 800px) 📱 */
/* ======================================================================= */

@media (max-width: 800px) {

    /* Seleziona la classe dei tag nel meta-dati del servizio e nascondila */
    .service-tag {
        display: none;
    }

    /* Regola opzionale: Aggiusta il layout dei meta-dati se il tag scompare */
    /* Questo assicura che il numero del servizio (es. 01) e l'anno siano ben allineati */
    .service-meta {
        /* Rimuovi eventuali spazi extra se avevi display: flex; per allineare */
        gap: 0;
        justify-content: flex-end;
        /* Allinea l'anno a destra */
    }
}
/* ======================================================================= */
/* 📱 FIX: Nascondi Tag e Anno sui Servizi in Modalità Mobile (< 800px) 📱 */
/* ======================================================================= */

@media (max-width: 800px) {

    /* Nasconde la descrizione del tag (es. "Prototipo y Diseño") */
    .service-tag {
        display: none;
    }

    /* Nasconde l'anno del servizio (es. "2024") */
    .service-year {
        display: none;
    }

    /* Assicurati che l'indice numerico (es. "01") sia l'unico elemento a destra del titolo */
    .service-meta {
        display: none;
        /* Nascondendo entrambi (tag e anno), puoi nascondere direttamente il loro contenitore per sicurezza */
    }

    /* OPZIONALE: Se preferisci mantenere .service-meta per futuri elementi, usa: */
    .service-details {
        flex-grow: 1;
        /* Permette al titolo di occupare tutto lo spazio disponibile */
    }
}
## 2. Codice CSS da **Sostituire** (nel tuo `style.css`) Sostituisci il blocco CSS precedente per lo splash screen con questo. Ho modificato la proprietà `transition` per includere `transform` e `opacity`,
e ho aggiornato le classi `.retract-top` e `.retract-bottom` per includere rotazione e dissolvenza. ```css
/* ======================================================================= */
/* 📱 NUOVO CODICE: MOBILE SPLASH SCREEN (Split Screen + Disintegrazione) 📱 */
/* ======================================================================= */

#mobile-splash-screen-new {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    /* Nascondi di default */
    overflow: hidden;
}

/* Stili per le due sezioni che si separano */
.split-top,
.split-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    background-color: var(--color-background-dark, #1a1a1a);
    /* AGGIORNATO: Aggiunta transizione su transform e opacity per l'effetto disintegrazione */
    transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}

.split-top {
    top: 0;
    height: 50%;
    /* Punto di trasformazione per la rotazione: in basso a destra */
    transform-origin: 100% 100%;
}

.split-bottom {
    bottom: 0;
    height: 50%;
    /* Punto di trasformazione per la rotazione: in alto a sinistra */
    transform-origin: 0% 0%;
}

/* Posizionamento e Stile del Testo Centrale (Usa i font del sito) */
.splash-logo-text {
    /* Centratura Assoluta Perfetta */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-family: inherit;
    font-weight: 700;

    color: var(--color-primary-light, #f0f0f0);
    font-size: clamp(2rem, 10vw, 4rem);
    text-align: center;
    z-index: 10000;
    opacity: 0;

    /* Animazione: appare in 0.5s e scompare in 0.5s */
    animation: text-pulse 2s forwards;
    animation-timing-function: cubic-bezier(0.86, 0, 0.07, 1);
}

/* Animazione del testo: appare a metà dell'animazione di split e poi scompare */
@keyframes text-pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ============================================================== */
/* Classi di movimento: AGGIUNTO EFFETTO DISINTEGRAZIONE/ROTAZIONE */
/* ============================================================== */

.retract-top {
    /* Sposta in alto, ruota di 10 gradi e svanisce */
    transform: translateY(-100%) rotate(10deg);
    opacity: 0;
}

.retract-bottom {
    /* Sposta in basso, ruota in direzione opposta di -10 gradi e svanisce */
    transform: translateY(100%) rotate(-10deg);
    opacity: 0;
}


/* ======================================================================= */
/* 📱 MEDIA QUERY: Rende lo Splash Screen visibile solo su Mobile 📱 */
/* ======================================================================= */

@media (max-width: 800px) {
    #mobile-splash-screen-new {
        display: block;
    }
}