/* Reset e Variabili */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    scroll-behavior: smooth;
}

:root {
    --bg-color: #0b0b0f;
    --card-bg: #12121a;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --gradient-primary: linear-gradient(135deg, #ff007a 0%, #7928ca 50%, #00dfd8 100%);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 8%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(11, 11, 15, 0.8);
    backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8; /* Leggero feedback visivo quando ci si passa sopra col mouse */
}

.logo img {
    height: 24px;      /* Imposta l'altezza ideale del tuo logo */
    width: auto;       /* Mantiene le proporzioni corrette senza distorcere l'immagine */
    display: block;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: color 0.3s;
}

nav a.active {
    color: var(--text-color);
    border-bottom: 2px solid #00dfd8;
    padding-bottom: 4px;
}

nav a:hover {
    color: var(--text-color);
}

.btn-nav {
    background: var(--gradient-primary);
    padding: 10px 20px;
    border-radius: 50px;
    color: white !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    background: radial-gradient(circle at 80% 20%, rgba(121, 40, 202, 0.15) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Hero Section con Video */
.hero {
    position: relative; /* Necessario per posizionare video e overlay all'interno */
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    overflow: hidden; /* Taglia i bordi del video in eccedenza */
}

/* Stile del Video in Background */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%); /* Centra perfettamente il video */
    object-fit: cover; /* Si comporta come background-size: cover */
    z-index: 1; /* Sta dietro a tutto */
}

/* Overlay Scuro Potenziato per Massimo Contrasto */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Abbiamo alzato l'opacità del nero dal 50%-80% all'80%-95% */
    background: linear-gradient(to bottom, rgba(11, 11, 15, 0.80), rgba(11, 11, 15, 0.95)),
                radial-gradient(circle at 80% 20%, rgba(121, 40, 202, 0.20) 0%, transparent 50%);
    z-index: 2; /* Rimane sopra al video ma sotto al testo */
}

/* Contenuto della Hero */
.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 3; /* Porta il testo in primo piano sopra a video e overlay */
}


/* Contenitore per allineare i pulsanti in riga */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px; /* Spazio tra i pulsanti */
    margin-top: 30px;
    flex-wrap: wrap; /* Evita che si rompano su schermi minuscoli */
}

/* Base comune per tutti i nuovi pulsanti della hero */
.hero-buttons a {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px; /* Bordi tondi richiesti */
    transition: all 0.3s ease;
    display: inline-block;
}

/* STILE 1 & 2: Servizi e Lavori (Solo contorno bianco e testo bianco) */
.btn-outline {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1); /* Leggero feedback al passaggio */
    transform: translateY(-2px);
}

/* STILE 3: Contattami (Tasto pieno gradient, testo nero, ombra viola) */
.btn-filled {
    /* Sostituisci questi due colori con il tuo esatto gradiente se preferisci */
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%); 
    color: #000000 !important; /* Testo nero */
    border: none;
    /* Ombra sfumata viola sul retro (effetto glow) */
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); 
}

.btn-filled:hover {
    transform: translateY(-2px);
    /* L'ombra diventa leggermente più intensa quando ci passi sopra */
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.9); 
}

/* Ottimizzazione per dispositivi mobili (schermi piccoli) */
@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column; /* Su smartphone si mettono uno sotto l'altro per comodità */
        width: 100%;
        max-width: 280px;
        margin: 30px auto 0 auto;
    }
    .hero-buttons a {
        text-align: center;
    }
}


/* ==========================================================================
   INDICATORE DI SCROLL CINETICO (Fondo Hero)
   ========================================================================== */
   .scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.1s ease-out;
}

.scroll-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    transition: color 0.3s ease;
}

.scroll-line-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 50px;
    position: relative;
}

/* Linea verticale animata */
.scroll-line {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), #00dfd8);
    position: relative;
    overflow: hidden;
}

/* Effetto d'impulso di luce che scende lungo la linea */
.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #ffffff, transparent);
    animation: scrollPulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.scroll-arrow {
    color: #00dfd8;
    font-size: 1rem;
    font-weight: 300;
    margin-top: 4px;
    animation: arrowBounce 2s infinite ease-in-out;
}

/* Hover effect */
.scroll-indicator:hover .scroll-text {
    color: #ffffff;
}

/* --- ANIMAZIONI NATIVER --- */
@keyframes scrollPulse {
    0% { top: -100%; }
    80%, 100% { top: 100%; }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* Ottimizzazione responsive: solleviamo leggermente l'indicatore sui telefoni */
@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 30px;
    }
    .scroll-line-wrapper {
        height: 40px;
    }
    .scroll-line {
        height: 20px;
    }
}

.cta-btn {
    display: inline-block;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(121, 40, 202, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(121, 40, 202, 0.5);
}

/* Portfolio Section */
.portfolio {
    padding: 100px 8%;
}

.portfolio h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 50px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none; /* Rimuove la sottolineatura del link */
    color: inherit; /* Mantiene il colore del testo bianco */
    display: block;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 223, 216, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card-img {
    height: 300px;
    background-size: cover;
    background-position: center;
}

.card-info {
    padding: 25px;
}

.category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.card-info h3 {
    font-size: 1.5rem;
    margin-top: 10px;
    font-weight: 600;
}

/* Sezione Servizi / Tabella Moderna */
.services-section {
    padding: 100px 8%;
    background: radial-gradient(circle at 10% 80%, rgba(0, 223, 216, 0.08) 0%, transparent 40%);
}

.section-intro {
    max-width: 600px;
    margin-bottom: 60px;
}

.section-intro h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.section-intro p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Struttura della Tabella */
.modern-table {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.table-row {
    display: flex;
    align-items: center;
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.4s ease, transform 0.2s ease;
    position: relative;
    cursor: default;
}

/* Intestazione Tabella */
.table-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Colonne */
.col-num {
    width: 10%;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.col-service {
    width: 35%;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s;
}

.col-desc {
    width: 55%;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
    transition: color 0.3s;
}

/* Effetti Hover sulle Righe (Esclusa l'intestazione) */
.table-row:not(.table-header):hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(5px);
}

/* Illuminazione del testo e dei numeri all'hover */
.table-row:not(.table-header):hover .col-service {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.table-row:not(.table-header):hover .col-num {
    color: #00dfd8; /* Prende uno dei colori del gradient per accendersi */
}

.table-row:not(.table-header):hover .col-desc {
    color: var(--text-color);
}

/* Linea sfumata a sinistra all'hover (Dettaglio di classe) */
.table-row:not(.table-header)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.table-row:not(.table-header):hover::before {
    opacity: 1;
}

/* Ottimizzazione Mobile della Tabella */
@media (max-width: 768px) {
    .table-header {
        display: none; /* Nascondiamo l'header sui piccoli schermi */
    }
    .table-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 25px 10px;
    }
    .col-num {
        font-size: 0.9rem;
    }
    .col-service, .col-desc, .col-num {
        width: 100%;
    }
    .col-service {
        font-size: 1.25rem;
    }
    .table-row:not(.table-header):hover {
        transform: none; /* Evitiamo lo spostamento laterale su mobile */
    }
}


/* Sezione Contatti */
.contact-section {
    padding: 140px 8%;
    background: radial-gradient(circle at 50% 100%, rgba(121, 40, 202, 0.1) 0%, transparent 60%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-container {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    flex: 1;
    max-width: 500px;
}

.contact-info h2 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

.contact-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.direct-meta p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-color);
}

.direct-meta a {
    color: #00dfd8;
    text-decoration: none;
    font-weight: 600;
}

/* Il Form in stile Dark Cyber */
.contact-form-wrapper {
    flex: 1;
    background: rgba(18, 18, 26, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 20px;
}

.form-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, background 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7928ca;
    background: rgba(255, 255, 255, 0.06);
}

.submit-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 8%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #4b5563;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .contact-container {
        flex-direction: column;
        gap: 40px;
    }
    .contact-info h2 {
        font-size: 2.3rem;
    }
    .contact-form-wrapper {
        padding: 30px 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .grid { grid-template-columns: 1fr; }
    nav { display: none; } /* Qui potresti implementare un menu hamburger in JS */
}

/* ==========================================================================
   ADATTAMENTO RESPONSIVE PER HEADER ORIGINALE (Sotto i 768px)
   ========================================================================== */

/* Applichiamo il box-sizing globale all'header per gestire correttamente il padding al 100% di larghezza */
header {
    box-sizing: border-box;
}

/* Pulsante Hamburger (Invisibile su Desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101; /* Sopra lo sfondo dell'header */
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: #f3f4f6; /* Colore delle tre lineette */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .hamburger {
        display: flex; /* Mostra l'hamburger su smartphone */
    }

    /* Trasformiamo il tuo tag 'nav' in un menu a tendina a schermo intero */
    header nav {
        position: fixed;
        top: 0;
        right: -100%; /* Spostato fuori dallo schermo a destra */
        width: 100%;
        height: 100vh;
        background: #0b0b0f; /* Riprende il colore pieno del tuo header */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 35px; /* Spazio verticale tra i link */
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 100;
    }

    /* Resettiamo gli stili dei link per il layout verticale */
    header nav a {
        margin-left: 0; /* Rimuove il margine sinistro del desktop */
        font-size: 1.6rem;
        font-weight: 700;
    }

    /* Quando il JS attiva il menu, lo fa scivolare dentro da destra */
    header nav.active {
        right: 0;
    }

    /* ANIMAZIONE DA HAMBURGER A "X" WHEN ACTIVE */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}