:root {
    --bg-color: #0a0a0a;
    --surface-color: #1a1a1a;
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --font-main: 'Poppins', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

html,
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    width: 100%;
    line-height: 1.6;
}

/* 
           IL FIX DEFINITIVO:
           Una "gabbia" fissa che contiene le animazioni sfocate.
           Taglia via tutto ciò che esce dallo schermo.
        */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    /* Rende la gabbia ignorabile al click */
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--secondary-color);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #667eea;
    animation-delay: 2s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(50px) scale(1.1);
    }
}

/* Navbar Desktop */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    z-index: 1001;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.menu-btn {
    display: none;
}

/* Nascosto su PC */

/* Layout Generale Desktop */
section {
    padding: 100px 10%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 50px;
    text-align: center;
    background: -webkit-linear-gradient(right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero */
#home {
    align-items: flex-start;
    text-align: left;
    position: relative;
}

.hero-greeting {
    font-family: var(--font-code);
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.hero-name {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-typing {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 30px;
    height: 40px;
}

.hero-desc {
    max-width: 600px;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.btn {
    padding: 15px 30px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.4);
}

/* About & Terminale */
#about .about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.terminal-window {
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #333;
    padding: 10px;
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-code);
    color: #a5d6ff;
    font-size: 0.9rem;
}

.terminal-body p {
    margin-bottom: 4px;
    line-height: 1.4;
}

.keyword {
    color: #ff7b72;
}

.string {
    color: #a5d6ff;
}

.variable {
    color: #79c0ff;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--surface-color);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 242, 254, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.service-card:hover::before {
    transform: translateX(100%);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.1);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Projects Carousel */
.swiper {
    width: 100%;
    padding-top: 50px;
    padding-bottom: 50px;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 350px;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.swiper-slide:hover .slide-img {
    transform: scale(1.1);
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.swiper-slide:hover .slide-content {
    transform: translateY(0);
}

.slide-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.slide-desc {
    font-size: 0.9rem;
    color: #ddd;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    background: var(--surface-color);
    margin-top: 50px;
}

.socials {
    margin-bottom: 20px;
}

.socials a {
    color: var(--text-main);
    font-size: 1.5rem;
    margin: 0 15px;
    transition: color 0.3s;
}

.socials a:hover {
    color: var(--primary-color);
}


@media (max-width: 768px) {
    nav {
        padding: 20px;
    }

    /* Hamburger Menu */
    .menu-btn {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s;
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        display: flex;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        margin: 20px 0;
        font-size: 1.5rem;
    }

    section {
        padding: 100px 5%;
    }

    .hero-name {
        font-size: 2.8rem;
    }

    .hero-typing {
        font-size: 1.3rem;
        height: 60px;
    }

    #about .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .swiper-slide {
        width: 280px;
        height: 380px;
    }

    .slide-content {
        transform: translateY(0);
    }
}



/* Contact Section */
#contact .contact-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    gap: 20px;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.form-status {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    display: none;
}

.form-status.success {
    color: #27c93f;
    display: block;
}

.form-status.error {
    color: #ff5f56;
    display: block;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
        gap: 20px;
    }

    #contact .contact-container {
        padding: 30px 20px;
    }
}