* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Header & Hero Section */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 100px 20px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--dark-color);
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
main {
    max-width: 1000px;
    margin: -40px auto 50px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
}

/* Skills/Passions Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grid-item {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}

.grid-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Contact Section */
.contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.contact-link {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.contact-link:hover {
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--dark-color);
    color: white;
    font-size: 0.9rem;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --accent-color: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Header & Hero Section */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 100px 20px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    /* Aggiunto perspective per l'effetto 3D */
    perspective: 1000px;
}

/* --- MODIFICA QUI: Aggiunta Animazione --- */
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);

    /* Applica l'animazione chiamata 'spinCoin' */
    animation: spinCoin 6s infinite linear;
    /* Assicura che l'effetto 3D funzioni sull'elemento */
    transform-style: preserve-3d;
}

/* Definizione dell'animazione (keyframe) */
@keyframes spinCoin {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

/* ---------------------------------------- */

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--dark-color);
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
main {
    max-width: 1000px;
    margin: -40px auto 50px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
}

/* Skills/Passions Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grid-item {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}

.grid-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Contact Section */
.contact-section {
    text-align: center;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.contact-link {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.contact-link:hover {
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--dark-color);
    color: white;
    font-size: 0.9rem;
}

/* Selettore Lingua */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 8px;
}

.lang-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: white;
    color: var(--primary-color);
}

/* Wrapper del carousel nell'header */
.header-carousel-wrapper {
    width: 100%;
    margin-bottom: 25px;
    /* Distanzia il menu dalla foto profilo */
    overflow: hidden;
}

/* Traccia interna scorrevole */
.header-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: nowrap;
    padding: 5px 10px;
    justify-content: center;
    /* Se sono pochi si centrano, se sono tanti scorrono */
    scrollbar-width: none;
    /* Nasconde la scrollbar su Firefox */
}

/* Nasconde la scrollbar su Chrome, Safari e Edge */
.header-carousel::-webkit-scrollbar {
    display: none;
}

/* Singoli "bottoni/pillole" del carousel */
.carousel-pill {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 50px;
    /* Effetto pillola stiloso */
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.carousel-pill:hover {
    background: #ffffff;
    color: var(--primary-color, #007bff);
    border-color: #ffffff;
    transform: translateY(-2px);
}

/* Su schermi larghi allinea a sinistra o lascia centrato a seconda del gusto */
@media (min-width: 768px) {
    .header-carousel {
        justify-content: center;
    }
}