@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,900&family=Montserrat:wght@300;400&display=swap');

:root {
    --accent: #9370DB; /* Il tuo viola originale */
    --accent-glow: #BF8FFF;
    --bg: #0a0a0a;
}

/* 1. RESET E PREPARAZIONE ANIMAZIONE */
html, body {
    margin: 0;
    padding: 0;
    background-color: #0a0a0a; /* Evita il flash bianco */
}

body {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    /* Animazione potenziata */
    animation: fadeInPage 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    -webkit-animation: fadeInPage 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes fadeInPage {
    0% { 
        opacity: 0; 
        transform: translateY(30px) scale(0.98); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@-webkit-keyframes fadeInPage {
    0% { 
        opacity: 0; 
        -webkit-transform: translateY(30px) scale(0.98); 
    }
    100% { 
        opacity: 1; 
        -webkit-transform: translateY(0) scale(1); 
    }
}

.grain {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9998;
    pointer-events: none;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Resolution_White_Noise_Video_Frame.png');
    opacity: 0.04; /* Deve essere quasi invisibile */
}

/* Definiamo l'animazione base */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: revealIn 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes revealIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Applichiamo i ritardi (Stagger) */
h1 { animation-delay: 0.2s; opacity: 0; animation: revealIn 1s forwards; }
.header-description { animation-delay: 0.4s; opacity: 0; animation: revealIn 1s forwards; }
.social-links { animation-delay: 0.5s; opacity: 0; animation: revealIn 1s forwards; }

/* Ritardi per i progetti nella lista */
.project-item:nth-child(1) { animation-delay: 0.6s; }
.project-item:nth-child(2) { animation-delay: 0.7s; }
.project-item:nth-child(3) { animation-delay: 0.8s; }
.project-item:nth-child(4) { animation-delay: 0.9s; }
.project-item:nth-child(5) { animation-delay: 1.0s; }
.project-item:nth-child(6) { animation-delay: 1.2s; }
.project-item:nth-child(7) { animation-delay: 1.4s; }
.project-item:nth-child(8) { animation-delay: 1.6s; }
.project-item:nth-child(9) { animation-delay: 1.8s; }
/* FIX LINK: restano viola anche dopo il click */
a, a:visited, a:active {
    color: var(--accent) !important;
    text-decoration: none !important;
}

a:hover {
    color: var(--accent-glow) !important;
    text-shadow: 0 0 10px var(--accent-glow);
}

header {
    padding: 100px 5%;
}
/* Stile per la descrizione sotto il nome */
.header-description {
    max-width: 450px; /* Evita che il testo vada da una parte all'altra dello schermo */
    margin-top: 20px;
    padding-left: 5px; /* Lo allinea leggermente con l'inizio del testo sopra */
}

.header-description p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #888; /* Grigio chiaro per non appesantire */
    text-transform: none; /* Lasciamo le minuscole per eleganza */
    letter-spacing: 0.5px;
}

/* Opzionale: un piccolo dettaglio animato sulla descrizione */
.header-description p::before {
    content: "// ";
    color: var(--accent); /* Un tocco del tuo viola */
    font-weight: bold;
}

.social-links {
    margin-top: 25px;
    display: flex;
    gap: 20px;
    padding-left: 5px;
}

.social-icon, 
.social-icon:visited, 
.social-icon:active {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6) !important; /* Colore bianco spento di default */
    text-decoration: none !important;
    transition: all 0.3s ease;
    outline: none;
}

/* Effetto al passaggio del mouse (Hover) */
.social-icon:hover {
    color: var(--accent) !important; /* Diventa viola */
    transform: translateY(-3px);
    text-shadow: 0 0 15px var(--accent-glow);
}
/* Il nome gigante e sottile che "gasa" */
h1 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 900;
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 0.9;
    margin: 0;
    letter-spacing: -3px;
    background: linear-gradient(180deg, #FFFFFF 35%, #9370DB 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Lista Progetti Elegante (stile Lauren Waller) */
.project-list {
    margin-top: 50px;
    padding: 0 5%;
}

.project {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.4s;
}

.project:hover {
    padding-left: 20px;
    border-bottom: 1px solid var(--accent);
}

.project h3 {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0;
}

.project p {
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

/* LISTA PROGETTI */
.project-list { padding: 0 5%; margin-bottom: 100px; }

.project-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.3s;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
}

.project-header h3 {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin: 0;
}

.project-header p {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.7rem;
    color: #666;
}

/* ESPANSIONE */
.project-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-item.active .project-content {
    max-height: 600px; /* Altezza sufficiente a mostrare il contenuto */
}

.content-inner {
    display: flex;
    gap: 40px;
    padding-bottom: 50px;
    align-items: flex-start;
}

.content-inner img {
    width: 300px;
    border: 1px solid var(--accent);
    border-radius: 4px;
}

.details p { color: #aaa; line-height: 1.6; margin-bottom: 20px; }

/* Responsive Mobile */
@media (max-width: 768px) {
    .content-inner { flex-direction: column; gap: 20px; }
    .content-inner img { width: 100%; }
}

/* Modale Fix */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(15px);
}

.modal-content {
    max-width: 800px;
    margin: 5% auto;
    text-align: center;
}

#modal-img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--accent);
}