:root {
    --primary: #1e6bc8;
    --primary-dark: #16539c;
    --bg-dark: #0d0d0d;
    --bg-card: #161616;
    --text-main: #e5e5e5;
    --text-muted: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    color: var(--text-main);
    background: var(--bg-dark);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

section {
    padding: 100px 8%;
}

/* HEADER */
header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    max-width: 1400px;
    margin: 0 auto;
}

nav a.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: -0.5px;
    text-decoration: none;
    z-index: 1001;
}

nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: .3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul li a:hover {
    color: #fff;
}

nav ul li a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: .3s;
}

nav ul li a:hover::after {
    width: 100%;
}

/* MOBILE MENU TOGGLE */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: white;
    transition: 0.3s;
}

/* HERO */
#home {
    height: 100vh;
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 25px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(13, 13, 13, 1)),
        url('https://blog.uniecampus.it/wp-content/uploads/2018/12/rossini-alessandro-scaled.jpg') center/cover no-repeat;
    background-attachment: fixed;
    color: white;
    padding-left: 8%;
    position: relative;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #0d0d0d 120%);
    pointer-events: none;
}

#home h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s forwards ease-out;
    z-index: 1;
}

#home h1 span {
    color: var(--primary);
    background: linear-gradient(45deg, #1e6bc8, #4fa3ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#home p {
    max-width: 600px;
    font-size: 1.2rem;
    color: #d0d0d0;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s .2s forwards ease-out;
    z-index: 1;
}

#home .subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
    margin-top: -10px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s .1s forwards ease-out;
    z-index: 1;
}

#home a {
    padding: 16px 40px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: 0.3s;
    width: fit-content;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s .4s forwards ease-out;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(30, 107, 200, 0.3);
}

#home a:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(30, 107, 200, 0.4);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SECTIONS COMMON */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.8s;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header h2 {
    font-size: 2.5rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 15px;
}

.section-header .line {
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 0 auto;
    border-radius: 2px;
}

/* SETTORI */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03));
    pointer-events: none;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-10px);
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #fff;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* CHI SIAMO */
#chi-siamo {
    background: #111;
}

#chi-siamo .content {
    max-width: 1100px;
    margin: auto;
    display: flex;
    gap: 60px;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s;
}

#chi-siamo .content.visible {
    opacity: 1;
    transform: translateY(0);
}

.image-wrapper {
    flex: 1;
    position: relative;
}

.image-wrapper::after {
    content: '';
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary);
    border-radius: 20px;
    z-index: 0;
    transition: 0.3s;
}

.image-wrapper:hover::after {
    top: 10px;
    left: -10px;
}

#chi-siamo img {
    width: 100%;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.text-wrapper {
    flex: 1;
}

.text-wrapper p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d6d6d6;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.stat-item h4 {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
}

.stat-item span {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CONTATTI */
#contatti {
    position: relative;
    overflow: hidden;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
}

.contact-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    flex: 1;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    opacity: 0;
    transform: translateY(30px);
}

.contact-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.contact-icon {
    color: var(--primary);
    margin-bottom: 20px;
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
}

.contact-card p {
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* FOOTER */
footer {
    background: #050505;
    padding: 40px 8%;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
}

.contact-card p {
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* FOOTER */
footer {
    background: #050505;
    padding: 40px 8%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #666;
    font-size: 0.9rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    section {
        padding: 80px 5%;
    }

    #home h1 {
        font-size: 3rem;
    }

    #chi-siamo .content {
        flex-direction: column;
        gap: 40px;
    }

    .image-wrapper {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: #111;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease-in-out;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    nav ul.active {
        right: 0;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    #home {
        background-attachment: scroll;
        /* Better performance on mobile */
    }
}