/* ─── RESET & VARIABILI ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-body: #0a0a0a;
    --bg-card: #141414;
    --bg-input: #0e0e0e;
    --accent: #ff4500; 
    --accent-wa: #25D366;
    --accent-ig: #1a1a1a; 
    --text-main: #e6e6e6;
    --text-dim: #999999;
    --radius-lg: 30px;  
    --radius-btn: 999px;
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* ─── NAVBAR (Logo Ingrandito e Bottoni) ─── */
nav {
    position: fixed;
    top: 0; width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(15px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; }
.brand img { width: 65px; height: 65px; object-fit: contain; } 
.brand-name { font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; color: #fff; }
.brand-name span { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 25px; }
.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-dim); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; transition: var(--transition); letter-spacing: 1px; }
.nav-links a:hover { color: #fff; }

.nav-btns { display: flex; gap: 10px; align-items: center; }
.btn-nav {
    text-decoration: none;
    padding: 12px 22px;
    border-radius: var(--radius-btn);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-title);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-wa { background: var(--accent-wa); color: #fff; }
.btn-ig { background: var(--accent-ig); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.btn-wa:hover, .btn-ig:hover { transform: scale(1.05); }

@media (max-width: 992px) { .nav-links { display: none; } }

/* ─── HERO CON SFONDO ─── */
.hero {
    padding: 240px 0 140px;
    text-align: center;
    background-image: linear-gradient(rgba(10, 10, 10, 0.75), rgba(10, 10, 10, 0.75)), url('img/sfondoCarbonio.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.hero h2 { font-family: var(--font-title); font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.1; margin-bottom: 25px; text-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.hero p { color: var(--text-dim); max-width: 650px; margin: 0 auto 40px; font-size: 1.15rem; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }

.btn-main {
    display: inline-block;
    padding: 20px 50px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-btn);
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(255, 69, 0, 0.4); }

/* ─── GRID PRODOTTI (NUOVO STILE A SCORRIMENTO) ─── */
section { padding: 100px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-family: var(--font-title); font-size: 2rem; margin-bottom: 10px; }
.underline { width: 50px; height: 3px; background: var(--accent); margin: 0 auto; border-radius: 10px; }

/* Griglia fissa a 3 colonne */
.grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; 
}

/* Responsive: 2 colonne su tablet, 1 su mobile */
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card {
    position: relative;
    height: 350px; /* Altezza della card */
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-card);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    align-items: flex-end; /* Spinge il testo verso il basso */
    cursor: pointer;
}

/* Sfumatura scura per rendere leggibile il testo */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.2) 60%, rgba(10,10,10,0) 100%);
    transition: var(--transition);
    z-index: 1;
}

.card:hover { 
    transform: translateY(-10px); 
    border-color: rgba(255, 69, 0, 0.5); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

/* La sfumatura sale quando passi col mouse */
.card:hover::before {
    background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.8) 100%);
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    width: 100%;
    text-align: left;
}

.card h3 { 
    font-family: var(--font-title); 
    font-size: 1.3rem; 
    margin: 0; 
    color: #fff;
    transition: var(--transition);
}

/* Il testo della descrizione è nascosto inizialmente */
.card p { 
    color: var(--text-dim); 
    font-size: 0.95rem; 
    line-height: 1.5; 
    margin-top: 15px;
    max-height: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Il testo appare spuntando dal basso quando passi col mouse */
.card:hover p {
    max-height: 150px;
    opacity: 1;
    transform: translateY(0);
}


/* Forza la visibilità su mobile quando la card è attiva */
@media (max-width: 768px) {
    .card.active .card-content {
        opacity: 1;
        transform: translateY(0);
        background: rgba(0, 0, 0, 0.8); /* Opzionale: scurisce lo sfondo per leggere meglio */
    }
}


/* ─── NUOVA SEZIONE GALLERY ─── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 30px;
}
.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.gallery-item:hover img {
    transform: scale(1.1);
}


/* --- FRECCE VIDEO STYLE (Minimal Dark) --- */
.video-arrow {
    position: absolute;
    top: 55%; /* Allineate al centro dei video */
    transform: translateY(-50%);
    background-color: rgba(20, 20, 20, 0.7); /* Grigio molto scuro/nero */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    font-size: 14px;
}

.video-arrow:hover {
    background-color: #1a1a1a;
    border-color: var(--accent); /* Diventa arancione al passaggio */
    transform: translateY(-50%) scale(1.1);
}

.video-arrow.left {
    left: -15px; /* Leggermente fuori dal bordo del container */
}

.video-arrow.right {
    right: -15px;
}

/* Nascondi su Mobile e Tablet */
@media (max-width: 1024px) {
    .video-arrow {
        display: none !important;
    }
}

/* Nasconde la barra di scorrimento brutta su PC */
.video-slider {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}
.video-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}


/* ─── SEZIONE COMMUNITY (ISPIRED BY IMAGE) ─── */
.community-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}
.btn-community {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    margin: 0 auto 20px auto;
    padding: 20px 30px;
    border: 2px solid #fff;
    border-radius: 50px; /* Bordo arrotondato stile pillola */
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: var(--transition);
}
.btn-community:hover {
    background: #fff;
    color: #0a0a0a; /* Testo nero quando si passa col mouse */
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

/* ─── SEZIONE VIDEO (Corretta) ─── */
.video-section {
    padding: 100px 0; /* Stesso padding delle altre sezioni */
}

.video-slider {
    width: 100%;
    overflow-x: auto; /* Permette lo scorrimento orizzontale */
    display: flex;
    gap: 20px;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Nasconde barra Firefox */
}

.video-slider::-webkit-scrollbar {
    display: none; /* Nasconde barra Chrome/Safari */
}

.video-card {
    flex: 0 0 280px; /* Impedisce ai video di restringersi */
    scroll-snap-align: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-card video {
    width: 100%;
    height: 500px; /* Altezza verticale per i progetti */
    object-fit: cover;
    display: block;
}

/* ─── FORM ─── */
.form-container { max-width: 650px; margin: 0 auto; background: var(--bg-card); padding: 50px; border-radius: var(--radius-lg); }
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 20px 25px; background: var(--bg-input); border: 1px solid rgba(255,255,255,0.05); border-radius: 20px; color: #fff; font-family: var(--font-body); font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

footer { padding: 80px 0; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; color: var(--text-dim); font-size: 0.9rem; }

.icon-wa { width: 18px; height: 18px; fill: currentColor; }

/* CHECKBOX PRIVACY */
/* CONTAINER */
.custom-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* NASCONDE CHECKBOX DEFAULT */
.custom-checkbox input {
    display: none;
}

/* BOX */
.checkmark {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 2px solid #333;
    background: #111;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

/* HOVER */
.custom-checkbox:hover .checkmark {
    border-color: var(--accent);
}

/* CHECK ATTIVO */
.custom-checkbox input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

/* ICONA CHECK */
.checkmark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
    opacity: 0;
    transition: var(--transition);
}

/* MOSTRA CHECK */
.custom-checkbox input:checked + .checkmark::after {
    opacity: 1;
}

/* TESTO */
.checkbox-text a {
    color: var(--accent);
    text-decoration: underline;
}