/* --- VARIABILI PALETTE BLU ELETTRICO SCURO --- */
:root {
    --bg-abyss: #01030a;
    --bg-panel: rgba(3, 10, 28, 0.85); /* Reso meno trasparente per ridurre il carico della GPU */
    --electric-cyan: #00d9ff;
    --electric-cobalt: #0044ff;
    --border-blue: rgba(0, 119, 255, 0.28);
    --neon-shadow: 0 0 18px rgba(0, 102, 255, 0.65), 0 0 35px rgba(0, 217, 255, 0.25);
    --text-primary: #d8eeff;
    --text-secondary: #5c7fa3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-abyss);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- SFONDO CANVAS, GRIGLIA E BAGLIORE PROFONDO --- */
#bg-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -3;
pointer-events: none; /* Evita che il canvas blocchi i click */
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
    linear-gradient(rgba(0, 85, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 85, 255, 0.06) 1px, transparent 1px);
    background-size: 45px 45px;
    z-index: -2;
    pointer-events: none;
}

.ambient-glow {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(0, 68, 255, 0.16) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* --- NAVBAR --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 18px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(1, 3, 10, 0.9);
    backdrop-filter: blur(8px); /* Ridotto da 14px a 8px per performance */
    border-bottom: 1px solid var(--border-blue);
    z-index: 1000;
    will-change: transform; /* Forza accelerazione GPU */
}

.header-logo-img {
    height: 35px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.4));
    transition: filter 0.3s ease;
}

.header-logo-img:hover {
    filter: drop-shadow(0 0 15px rgba(0, 217, 255, 0.8));
}

nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--electric-cobalt), var(--electric-cyan));
    box-shadow: 0 0 10px var(--electric-cyan);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--electric-cyan);
}

nav a:hover::after {
    width: 100%;
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 120px 8% 60px;
    gap: 50px;
}

.hero-content {
    max-width: 650px;
    text-align: left;
}

.badge {
    display: inline-block;
    padding: 6px 20px;
    border: 1px solid rgba(0, 136, 255, 0.5);
    border-radius: 30px;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--electric-cyan);
    background: rgba(0, 40, 120, 0.25);
    box-shadow: 0 0 20px rgba(0, 68, 255, 0.35);
    margin-bottom: 25px;
}

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.4rem, 4.5vw, 4rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 22px;
    background: linear-gradient(180deg, #ffffff 15%, var(--electric-cyan) 65%, var(--electric-cobalt) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 22px rgba(0, 85, 255, 0.45));
}

.hero p {
    max-width: 600px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 42px;
}

/* Immagine Icona Hero */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-icon {
    width: 100%;
    max-width: 350px; /* Leggermente ridotto */
    border-radius: 22%;
    box-shadow: 0 0 60px rgba(0, 102, 255, 0.5);
    animation: float 6s ease-in-out infinite;
    will-change: transform; /* Ottimizzazione cruciale per le animazioni fluide */
}

@keyframes float {
    0% { transform: translateY(0px) scale(1) translateZ(0); }
    50% { transform: translateY(-15px) scale(1.02) translateZ(0); }
    100% { transform: translateY(0px) scale(1) translateZ(0); }
}

/* --- BOTTONE CYBER --- */
.btn-cyber {
    display: inline-block;
    padding: 16px 42px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, var(--electric-cobalt), #0088ff);
    text-decoration: none;
    border: 1px solid var(--electric-cyan);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    filter: drop-shadow(0 0 12px rgba(0, 102, 255, 0.6)); /* Drop-shadow invece di box-shadow per il clip-path */
    transition: all 0.3s ease;
    will-change: transform, filter;
}

.btn-cyber:hover {
    background: var(--electric-cyan);
    color: var(--bg-abyss);
    transform: translateY(-3px);
    filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.9));
}

/* --- SEZIONI E CARD --- */
.section {
    padding: 100px 8%;
}

.section-title {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.4rem;
    margin-bottom: 60px;
    letter-spacing: 3px;
    color: #ffffff;
}

.section-title span {
    color: var(--electric-cyan);
    text-shadow: 0 0 16px rgba(0, 136, 255, 0.8);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-blue);
    padding: 40px 30px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 30, 90, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--electric-cyan), transparent);
    transition: left 0.5s ease;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--electric-cyan);
    box-shadow: 0 10px 30px rgba(0, 68, 255, 0.3), inset 0 0 25px rgba(0, 136, 255, 0.2);
}

.card-icon {
    font-size: 2.3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.7));
}

.card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    margin-bottom: 14px;
    color: #ffffff;
    letter-spacing: 1px;
}

.card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* --- TERMINAL STATISTICHE --- */
.terminal-box {
    background: linear-gradient(145deg, rgba(2, 8, 24, 0.95), rgba(4, 16, 46, 0.9));
    border: 1px solid rgba(0, 136, 255, 0.45);
    border-radius: 10px;
    padding: 45px 30px;
    box-shadow: inset 0 0 35px rgba(0, 55, 180, 0.25);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px;
    text-align: center;
}

.stat h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.9rem;
    color: var(--electric-cyan);
    text-shadow: 0 0 18px rgba(0, 136, 255, 0.8);
}

.stat p {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-blue);
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: rgba(1, 2, 8, 0.95);
}

/* --- ANIMAZIONI --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 968px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 140px;
        gap: 40px;
    }
    .hero-content {
        text-align: center;
        margin: 0 auto;
    }
    .hero p {
        margin: 0 auto 30px auto;
    }
    .floating-icon {
        max-width: 250px;
    }
    .header-logo-img {
        height: 25px;
    }
}

@media (max-width: 768px) {
    nav ul { display: none; }
    .hero h1 { font-size: 2.3rem; }
}
