/* --- Reset e Variabili Generali --- */
:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --accent-color: #0085ff;
    --card-bg: #f8f9fa;
    --header-bg: rgba(255, 255, 255, 0.95);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory; /* Attiva lo snap verticale a schermo intero */
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* --- Accessibilità (Skip Link & Focus) --- */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

a:focus, button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* --- Header e Navigazione --- */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(5px);
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.main-header nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 1rem;
}

.main-header nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    margin: 0 1rem;
    transition: color 0.2s;
}

.main-header nav a:hover {
    color: var(--accent-color);
}

/* --- Struttura Sezioni Full-Screen --- */
.fullscreen-section {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start; /* Blocca la sezione all'inizio dello schermo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 2rem 2rem 2rem; /* Spazio per l'header fisso */
}

.section-content {
    max-width: 900px;
    width: 100%;
}

h1, h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; }

/* --- Layout Specifici delle Sezioni --- */
a {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

a:visited {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

/* Landing */
.social-links a {
    display: inline-block;
    margin-right: 1.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}


/* Projects Grid (Responsive) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

/* Publications & Events */
.publications-list, .events-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.publications-list li, .event-item {
    margin-bottom: 1.2rem;
}

.btn-scholar {
    display: inline-block;
    background: var(--accent-color);
    color: white !important;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    a:visited {
        color: white !important;
    }
}

/* --- Dispositivi Mobili (Ottimizzazione) --- */
@media (max-width: 768px) {
    html {
        scroll-snap-type: none; /* Disattiva lo snap su mobile se i contenuti sono lunghi */
    }
    .fullscreen-section {
        height: auto;
        min-height: 100vh;
        padding: 100px 1rem 3rem 1rem;
    }
    .main-header nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Stile per simulare l'H1 dentro il div */
.h1-style {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Cursore della macchina da scrivere */
.cursor {
    font-weight: 100;
    color: var(--accent-color);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Gestione dei blocchi successivi */
#fade-in-blocks {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    margin-top: 1.5rem;
}

/* Classe che attiveremo con JavaScript */
#fade-in-blocks.visible {
    opacity: 1;
    transform: translateY(0);
}

.bio-block {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.hi {
    color: var(--accent-color);
    font-weight: 600;
}

/* Rispetto per gli utenti che preferiscono ridotta animazione (Accessibilità) */
@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; display: none; }
    #fade-in-blocks { opacity: 1; transform: none; transition: none; }
}