:root {
    /* Color Palette - Enterprise Dark with Acid Green Accent */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-primary: #ccff00;
    /* Verde acido */
    --accent-secondary: #9acd32;
    /* Verde acido scuro */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-main: 'Outfit', sans-serif;

    /* Spacing & Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 800;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.accent-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    margin-bottom: 2rem;
}

.accent-line.center {
    margin: 0 auto 3rem auto;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 100;
    transition: var(--transition-medium);
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 15, 0.7);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.logo-icon {
    color: var(--accent-primary);
    font-weight: 800;
}

.logo-ext {
    font-size: 0.5em;
    font-weight: 300;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    position: relative;
    padding: 0.5rem 0;
    transition: var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 1.5rem;
}

.lang-switcher span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s ease;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(80%);
    display: inline-block;
    vertical-align: middle;
}

.lang-switcher span:hover {
    color: var(--text-primary);
}

.lang-switcher span:hover .flag-icon {
    transform: scale(1.2);
    filter: grayscale(0%);
}

.lang-switcher .active {
    color: var(--accent-primary);
}

.lang-switcher .active .flag-icon {
    filter: grayscale(0%);
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.5);
}

.lang-switcher .separator {
    color: var(--text-secondary);
    opacity: 0.3;
}

/* Hamburger Menu */

.nav-link:hover {
    color: var(--accent-primary);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 2rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/hero_bg.png');
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 0.4;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0) 0%, var(--bg-primary) 100%);
    z-index: -1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    z-index: 1;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.nickname {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.hero-roles {
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
}

.title {
    font-size: 5vw;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 1200px) {
    .title {
        font-size: 5rem;
    }
}

.description {
    font-size: 1.5rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.cta-container {
    display: flex;
    gap: 1.5rem;
}

.social-links-hero {
    display: flex;
    gap: 1.5rem;
    margin-top: 3.5rem;
}

.social-links-hero a {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.social-links-hero a:hover {
    color: #000;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px -5px rgba(204, 255, 0, 0.4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    border-radius: 12px;
    /* Less "pill" more "modern tech" */
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    font-family: var(--font-main);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 10px 20px -10px rgba(204, 255, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    transition: all 0.6s ease;
    z-index: 1;
}

.btn-primary:hover::after {
    left: 120%;
}


.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -12px rgba(204, 255, 0, 0.6);
    background: #e1ff66;
    /* Lighter acid green */
}

.btn-primary i {
    font-size: 1.1rem;
    margin-right: 12px;
}

.cv-download-wrapper {
    margin-top: 4.5rem;
    /* Increased for better separation from stats */
    display: flex;
    justify-content: flex-start;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.1);
    transform: translateY(-3px);
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

/* Sections */
section {
    padding: 6rem 0;
}

.glass-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.section-title {
    text-align: center;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.profile-img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-medium);
}

.about-image-wrapper:hover .profile-img {
    transform: scale(1.05);
}

.img-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 0.8rem;
    letter-spacing: -1px;
}


.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-medium);
}

.skill-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    left: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
    z-index: 2;
}

.timeline-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: var(--transition-medium);
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 400;
}

.timeline-content h4 span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 10px;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-content p {
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
}

/* Footer */
footer {
    padding: 5rem 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px; /* Matching the button style */
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(204, 255, 0, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards ease-out;
}

.fade-in-delayed {
    opacity: 0;
    animation: fadeIn 1s 0.5s forwards ease-out;
}

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s 0.2s forwards ease-out;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Classes */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.reveal-active {
    opacity: 1;
    transform: translate(0);
}

/* Responsive */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }

    .title {
        font-size: 3rem;
    }

    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        width: 50%;
        padding-left: 0;
        padding-right: 40px;
    }

    .timeline-item:nth-child(even) {
        margin-left: auto;
        padding-left: 40px;
        padding-right: 0;
    }

    .timeline-dot {
        left: 100%;
        transform: translateX(-50%);
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 0;
    }

    .navbar .logo {
        font-size: 1.4rem;
    }

    .hero-section {
        padding-top: 80px; /* Evita sovrapposizione con navbar fissa */
        justify-content: flex-start;
        padding-bottom: 2rem;
    }

    .title {
        font-size: 2.5rem; /* Ridotto per evitare overflow laterale */
        margin-top: 1rem;
    }

    .container {
        padding: 0 1.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .nav-links {
        display: none;
        /* simple mobile menu fallback */
    }

    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 0;
    }

    .timeline-item:nth-child(even) {
        margin-left: 0;
        padding-left: 60px;
    }

    .timeline-dot {
        left: 11px;
        transform: none;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: 11px;
    }

    .cta-container {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }
}