/* RESET E IMPOSTAZIONI DI BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body, html {
    height: 100%;
    background-color: #0a0a0a; /* Sfondo di sicurezza scuro */
    color: white;
    overflow: hidden; /* Blocca lo scroll nella splash page */
}

/* STRUTTURA DELLA SPLASH PAGE */
.splash {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* SFONDO DINAMICO */
    /* Nota: il percorso è img/hero-bg.png perché l'immagine è nella cartella img */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), 
                url('img/hero-bg.gif') center/cover no-repeat;
    
    text-align: center;
}

/* ANIMAZIONE FADE-IN (INIZIO) */
.fade-in {
    animation: fadeInEffect 2.2s ease-out forwards;
}

@keyframes fadeInEffect {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* TITOLO */
h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    letter-spacing: 12px;
    margin-bottom: 60px;
    font-weight: 300;
    text-transform: uppercase;
}

/* CONTENITORE PULSANTI */
.lang-selection {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px;
}

/* PULSANTI RETTANGOLARI - STILE BASE */
.btn-lang {
    background: transparent; /* Partenza pulita */
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 420px;
    height: 130px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    /* Transizione più rapida e decisa per il contrasto */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(5px);
}

/* CONTENUTO INTERNO */
.btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lang-title, .lang-slogan {
    position: absolute;
    width: 100%;
    padding: 0 30px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Titolo: Elegante e distanziato */
.lang-title {
    opacity: 1;
    transform: translateY(0);
    font-size: 1.4rem;
    font-weight: 400; /* Più leggero per un look architettonico */
    letter-spacing: 5px;
}

/* Slogan: Nascosto inizialmente */
.lang-slogan {
    opacity: 0;
    transform: translateY(30px);
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.5;
}

/* --- EFFETTO A CONTRASTO AL PASSAGGIO (HOVER) --- */
.btn-lang:hover {
    /* Inversione: lo sfondo diventa bianco solido o grigio ghiaccio */
    background: rgba(255, 255, 255, 0.95); 
    color: #0a0a0a; /* Il testo diventa scuro per massimo contrasto */
    border-color: white;
    transform: scale(1.02); /* Leggerissimo zoom per feedback tattile */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.btn-lang:hover .lang-title {
    opacity: 0;
    transform: translateY(-30px);
}

.btn-lang:hover .lang-slogan {
    opacity: 1;
    transform: translateY(0);
    color: #0a0a0a; /* Assicuriamo che lo slogan sia scuro sul fondo bianco */
    font-weight: 500; /* Leggermente più marcato per leggibilità */
}

/* OTTIMIZZAZIONE MOBILE */
@media (max-width: 850px) {
    .btn-lang {
        width: 100%;
        max-width: 340px;
        height: 120px;
    }
}
/* --- PAGINE INTERNE (CV & PORTFOLIO) --- */

/* Sfondo bianco pulito per le pagine di lettura */
.bg-white {
    background-color: #fff;
    color: #111;
}

/* Layout specifico per il CV */
.cv-page {
    max-width: 1100px;
    margin: 0 auto;
}

.cv-header h1 {
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 10px;
}

/* Timeline e Voci del CV */
.cv-section {
    margin-top: 60px;
}

.cv-item {
    margin-top: 30px;
    padding-left: 30px;
    border-left: 1px solid #eee; /* Linea sottile verticale */
    position: relative;
    transition: all 0.3s ease;
}

.cv-item:hover {
    border-left: 1px solid #9CA3AF; /* Il tuo grigio bold al passaggio */
}

.cv-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cv-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #111;
}

.cv-desc {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.7;
    max-width: 800px;
}

/* Box di Download e Info laterali */
.cv-download-box {
    border-radius: 4px;
    text-align: center;
}

/* --- GRID PORTFOLIO --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.portfolio-item {
    position: relative;
    height: 500px;
    background-color: #f4f4f4;
    overflow: hidden;
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.portfolio-overlay p:first-child {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #9CA3AF; /* Grigio bold */
    margin-bottom: 10px;
}

.portfolio-overlay p:last-child {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 300;
}
/* --- PORTFOLIO GRID OPTIMIZATION --- */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Trasformiamo il link in un blocco contenitore */
.portfolio-item {
    display: block;          /* Importante: rende cliccabile l'intera area */
    position: relative;
    height: 550px;
    background-color: #f4f4f4;
    overflow: hidden;
    text-decoration: none;   /* Rimuove sottolineature automatiche */
    color: inherit;          /* Impedisce al testo di diventare blu */
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), filter 0.5s ease;
    display: block;          /* Evita spazi bianchi sotto l'immagine */
}

.portfolio-item:hover img {
    transform: scale(1.08);
    filter: grayscale(0%);
}

/* Overlay che appare/si scurisce al passaggio */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    transition: background 0.4s ease;
}

/* Stile testi dentro l'overlay */
.portfolio-overlay p:first-child {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #9CA3AF; /* Il tuo grigio bold */
    text-transform: uppercase;
    margin-bottom: 12px;
}

.portfolio-overlay p:last-child {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 300;
}

/* Feedback visivo: scurisce leggermente l'overlay al passaggio */
.portfolio-item:hover .portfolio-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 60%);
}
/* Responsive */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .cv-header h1 {
        font-size: 2.2rem;
    }
}
body.no-scroll {
    overflow: hidden;
}