/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #d1d5db; /* Softer light gray for elegance */
    line-height: 1.7;
    background: #0f172a; /* Deep slate for sophistication */
    overflow-x: hidden; /* Evita scroll orizzontale non voluto */
    -webkit-font-smoothing: antialiased; /* Crisp text rendering */
    -moz-osx-font-smoothing: grayscale;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a; /* Deep slate background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.7s ease-out;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Loader */
.loader {
    position: relative;
    width: 60px; /* Size for prominence */
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Triangle Shape with Spin */
.loader::before {
    content: '▲'; /* Triangolo Unicode */
    position: absolute;
    font-family: 'Montserrat', sans-serif; /* Matches your body font */
    font-size: 48px; /* Large enough to be clear */
    font-weight: 700; /* Bold for definition */
    color: #94a3b8; /* Metallic slate */
    text-shadow: 0 0 15px rgba(148, 163, 184, 0.6), 0 0 25px rgba(148, 163, 184, 0.3);
    animation: spinTriangle 1.8s ease-in-out infinite; /* Nome dell'animazione aggiornato */
}

/* Animation */
@keyframes spinTriangle { /* Nome aggiornato per coerenza */
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.1); /* Slight pulse at halfway */
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.8;
    }
}

/* Container Generale */
.container {
    max-width: 1400px; /* Larghezza massima per desktop */
    margin: 0 auto;
    padding: 0 30px; /* Padding laterale di default */
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, #1e3a8a, #64748b); /* Refined gradient */
    backdrop-filter: blur(12px);
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.5s ease;
}

.header.scrolled {
    background: rgba(30, 58, 138, 0.95);
    padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between; /* Mantiene logo a sinistra, nav a destra su desktop */
    align-items: center;
    padding: 15px 20px; /* Padding interno del container dell'header */
    flex-wrap: wrap; /* Permette agli elementi di andare a capo su schermi più piccoli */
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    color: #e2e8f0; /* Soft off-white */
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.logo:hover {
    color: #94a3b8; /* Metallic slate */
    text-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex; /* Menu orizzontale su desktop */
    list-style: none;
}

.nav-link {
    color: #e2e8f0;
    text-decoration: none;
    margin-left: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
    display: none; /* Nascosto di default su desktop */
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    color: #fff;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.03); /* Ultra-subtle glassmorphism */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    padding: 20px; /* Padding aggiunto per schermi molto piccoli */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Deeper overlay for sophistication */
    z-index: 0;
}

.hero-content {
    z-index: 1;
    padding: 40px;
    max-width: 900px; /* Limita la larghezza su desktop per leggibilità */
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: 1.8rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    animation: fadeInUp 1.2s ease-out;
    line-height: 1.1; /* Migliora la spaziatura tra le righe su mobile */
}

.hero-subtitle {
    font-size: 1.6rem;
    color: #d1d5db;
    margin-bottom: 2.5rem;
    font-weight: 300;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: #64748b; /* Refined slate */
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #94a3b8;
    transform: translateY(-3px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    width: 30px;
    height: 50px;
}

.scroll-indicator span {
    display: block;
    width: 18px;
    height: 18px;
    border-bottom: 2px solid #94a3b8;
    border-right: 2px solid #94a3b8;
    transform: rotate(45deg);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 0; transform: rotate(45deg) translate(-12px, -12px); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: rotate(45deg) translate(12px, 12px); }
}

/* About Section */
.about-section {
    padding: 7rem 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #e2e8f0;
    text-align: center;
    margin-bottom: 3.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 2px;
    background: #94a3b8;
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

.about-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    padding: 0 20px; /* Padding per evitare che il contenuto tocchi i bordi su mobile */
}

.about-text {
    flex: 1;
    color: #d1d5db;
    font-weight: 300;
}

.about-text p {
    margin-bottom: 1.8rem;
    font-size: 1.1rem;
}

.about-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stat-number {
    font-size: 2.8rem;
    color: #94a3b8;
    display: block;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(148, 163, 184, 0.3);
}

.stat-item span:last-child {
    color: #d1d5db;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Footer */
.footer {
    padding: 4rem 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    text-align: center;
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 1.5rem 0;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    padding: 5px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

.social-links {
    margin-top: 25px;
    padding-bottom: 20px; /* Padding per distanziare dal copyright */
}

.social-links a {
    color: #fff;
    font-size: 2rem;
    margin: 0 15px; /* Margine ridotto per schermi piccoli */
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #63b3ed;
    transform: scale(1.2);
}

/* Animations */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Media Queries per la Responsività --- */

/* Tablet e schermi mobile più grandi (fino a 768px di larghezza) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* Header */
    .header .container {
        flex-direction: row; /* Mantieni logo e toggle sulla stessa riga su mobile */
        justify-content: space-between; /* Spazia logo e toggle */
        align-items: center;
        padding: 15px 20px; /* Padding standard per l'header */
    }

    .logo {
        position: relative; /* Rimuovi la posizione assoluta se presente per il logo mobile */
        z-index: 1002; /* Assicurati che il logo sia sopra il menu aperto */
    }

    .menu-toggle {
        display: block; /* Mostra il toggle del menu */
        position: relative; /* Mantienilo nel flusso del documento per flexbox */
        z-index: 1002; /* Assicurati che sia sopra il menu aperto */
        font-size: 2.2rem; /* Leggermente più grande per facilitare il tocco */
        color: #e2e8f0; /* Colore più chiaro per coerenza con il logo */
    }

    .nav-list {
        position: fixed;
        top: 0;
        right: -100%; /* Inizialmente nascosto fuori schermo */
        width: 100%; /* Copre l'intera larghezza per maggiore impatto */
        height: 100vh; /* Copre l'intera altezza della viewport */
        background: rgba(30, 58, 138, 0.98); /* Sfondo più scuro per il menu */
        backdrop-filter: blur(20px); /* Aumentato il blur per un effetto più "vetroso" */
        flex-direction: column;
        justify-content: center; /* Centra verticalmente i link nel menu */
        align-items: center; /* Centra orizzontalmente i link nel menu */
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Animazione più vivace */
        padding: 80px 20px; /* Padding per lasciare spazio in alto e in basso */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5); /* Ombra più pronunciata */
    }

    .nav-list.active {
        right: 0; /* Rende il menu visibile */
    }

    .nav-list li {
        width: 100%; /* Assicurati che ogni elemento li prenda tutta la larghezza per centrare il link */
        text-align: center; /* Centra il testo del link */
    }

    .nav-link {
        display: block; /* Essenziale per margin e padding block */
        margin: 1.8rem auto; /* Magine più ampio e 'auto' per centrare orizzontalmente */
        width: calc(100% - 80px); /* Larghezza ridotta per margine laterale */
        max-width: 300px; /* Limita la larghezza massima per non essere troppo grande */
        font-size: 1.3rem; /* Aumenta la dimensione del font per maggiore leggibilità */
        padding: 18px 30px; /* Padding generoso */
        border-radius: 40px; /* Bordi molto arrotondati */
        background: rgba(255, 255, 255, 0.15); /* Sfondo più visibile e opaco */
        border: 1px solid rgba(255, 255, 255, 0.3); /* Bordo più definito */
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* Ombra più pronunciata */
        transition: all 0.3s ease-in-out;
    }

    .nav-link:hover,
    .nav-link:focus { /* Aggiunto focus per accessibilità */
        background: rgba(255, 255, 255, 0.3);
        color: #fff;
        transform: translateY(-3px) scale(1.02); /* Effetto leggero di sollevamento e ingrandimento */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }


    /* Hero Section */
    .hero-title {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }

    /* About Section */
    .about-content {
        flex-direction: column;
        gap: 3rem;
    }

    .about-text p {
        font-size: 1rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 2.5rem;
        width: 100%;
    }

    .stat-item {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
    }

    .social-links a {
        font-size: 1.8rem;
        margin: 0 10px;
    }
}

/* Schermi mobile piccoli (fino a 480px di larghezza) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header .container {
        padding: 10px;
    }

    .logo {
        font-size: 2rem;
    }

    .hero-content {
        padding: 20px;
    }

    .hero-title {
        font-size: 2.2rem; /* Ridotto leggermente di più */
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem; /* Ridotto leggermente di più */
    }

    .cta-button {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.8rem; /* Ridotto */
        margin-bottom: 2rem;
    }

    .about-text p {
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-item span:last-child {
        font-size: 0.9rem;
    }

    .nav-list {
        padding: 60px 10px; /* Padding leggermente ridotto per schermi molto piccoli */
    }

    .nav-link {
        margin: 1.5rem auto; /* Margine adattato per schermi più piccoli */
        width: calc(100% - 60px); /* Larghezza adattata */
        max-width: 250px; /* Limite per schermi molto piccoli */
        padding: 15px 25px; /* Padding adattato */
        font-size: 1.1rem; /* Dimensione del font adattata */
    }
}