/* --- V2.0 MARS: NEW ERA --- */
:root {
    --bg-dark: #070202;
    --bg-panel: #110505;
    --bg-glass: rgba(20, 5, 5, 0.6);
    --mars-red: #ff2a00;
    --mars-orange: #ff6600;
    --mars-glow: rgba(255, 42, 0, 0.5);
    --border-color: rgba(255, 69, 0, 0.2);
    --text-main: #f0f0f0;
    --text-muted: #998888;
    --font-head: 'Rajdhani', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --font-code: 'Share Tech Mono', monospace;
    --gradient: linear-gradient(135deg, var(--mars-red), var(--mars-orange));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-body); overflow: hidden; }

/* --- MARS PRELOADER --- */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #030101; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: 0.8s ease; }
.mars-loader { position: relative; width: 80px; height: 80px; margin-bottom: 20px; }
.mars-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; background: var(--mars-red); border-radius: 50%; box-shadow: 0 0 30px var(--mars-red); animation: pulseCore 1s infinite alternate; }
.mars-ring { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 2px solid transparent; border-top: 2px solid var(--mars-orange); border-bottom: 2px solid var(--mars-red); border-radius: 50%; animation: spinRing 2s linear infinite; }
.loader-text { font-family: var(--font-code); color: var(--mars-orange); letter-spacing: 3px; font-size: 0.9rem; margin-bottom: 15px; }
.loader-progress { width: 200px; height: 2px; background: #220a0a; position: relative; overflow: hidden; }
.loader-progress::after { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 50%; background: var(--gradient); animation: loadingBar 1.5s ease-in-out infinite; }

@keyframes pulseCore { from { transform: translate(-50%, -50%) scale(0.8); } to { transform: translate(-50%, -50%) scale(1.2); } }
@keyframes spinRing { 100% { transform: rotate(360deg); } }
@keyframes loadingBar { 0% { left: -50%; } 100% { left: 100%; } }

/* --- FLOATING NAVBAR --- */
.floating-nav { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 1200px; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border-color); border-radius: 50px; padding: 10px 25px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.logo-container { display: flex; align-items: center; gap: 10px; }
.kw-logo { font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; border: 2px solid var(--mars-red); border-radius: 8px; padding: 2px 8px; }
.logo-text { font-family: var(--font-head); font-weight: 700; letter-spacing: 2px; font-size: 1.2rem; }
.nav-menu { display: flex; gap: 25px; list-style: none; }
.nav-link { text-decoration: none; color: var(--text-muted); font-family: var(--font-code); font-size: 0.9rem; letter-spacing: 1px; transition: 0.3s; padding: 5px 10px; border-radius: 20px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,42,0,0.1); box-shadow: 0 0 10px var(--mars-glow); }
.mobile-only { display: none; }
.btn-uplink { background: transparent; border: 1px solid var(--mars-orange); color: var(--mars-orange); padding: 8px 20px; border-radius: 30px; font-family: var(--font-code); cursor: pointer; transition: 0.3s; }
.btn-uplink:hover { background: var(--mars-orange); color: #000; box-shadow: 0 0 15px var(--mars-orange); }

/* --- PAGE SYSTEM --- */
.page { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; padding-top: 100px; opacity: 0; visibility: hidden; transition: 0.5s ease; overflow: hidden; }
.active-page { opacity: 1; visibility: visible; z-index: 1; }
.scrollable-page { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.flex-center { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.container-padding { padding: 60px 0; }

/* --- HERO ASYMMETRIC --- */
.hero-split { min-height: 85vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 50px; }
.cyber-badge { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,42,0,0.1); border: 1px solid var(--mars-red); padding: 5px 15px; border-radius: 30px; font-family: var(--font-code); color: var(--mars-red); margin-bottom: 20px; font-size: 0.85rem; }
.live-dot { width: 8px; height: 8px; background: var(--mars-red); border-radius: 50%; box-shadow: 0 0 10px var(--mars-red); animation: blink 1s infinite; }
.hero-left h1 { font-family: var(--font-head); font-size: 4.5rem; line-height: 1; text-transform: uppercase; margin-bottom: 20px; }
.mars-text-glow { color: var(--mars-orange); text-shadow: 0 0 20px var(--mars-glow); }
.hero-left p { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; margin-bottom: 30px; max-width: 90%; }
.btn { padding: 12px 30px; border-radius: 8px; font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; cursor: pointer; transition: 0.3s; border: none; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.primary { background: var(--gradient); color: #fff; box-shadow: 0 5px 20px var(--mars-glow); }
.primary:hover { transform: translateY(-3px); box-shadow: 0 8px 30px var(--mars-red); }
.secondary { background: var(--bg-glass); border: 1px solid var(--border-color); color: #fff; margin-left: 15px; }
.secondary:hover { border-color: var(--mars-orange); color: var(--mars-orange); background: rgba(255,102,0,0.1); }

/* --- HOLOGRAM HUD LOGO (AGGIORNATO) --- */
.hologram-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.hero-right { position: relative; height: 400px; display: flex; justify-content: center; align-items: center; }

.holo-orb { 
    width: 280px; 
    height: 280px; 
    border-radius: 50%; 
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 0 80px var(--mars-glow); 
    animation: breatheOrb 4s ease-in-out infinite alternate; 
    position: relative; 
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(255,42,0,0.05) 0%, transparent 60%);
}

.holo-orb::after { 
    content: ''; 
    position: absolute; 
    top: -10px; left: -10px; right: -10px; bottom: -10px; 
    border: 1px dashed var(--mars-orange); 
    border-radius: 50%; 
    animation: spinRing 15s linear infinite; 
    opacity: 0.5; 
}

/* LA MAGIA DEL CSS: Converte il tuo logo verde/azzurro in arancione scuro/fluo */
.holo-logo {
    width:130%; /* Regola se necessario */
    height: auto;
    object-fit: contain;
    border-radius: 50%; /* Se l'immagine è quadrata, questo la fa tonda */
    z-index: 2;
    /* Questi filtri cambiano la tonalità, aumentano il contrasto e aggiungono l'ombra olografica */
    filter: sepia(1) hue-rotate(-50deg) saturate(4) brightness(0.9) drop-shadow(0 0 20px var(--mars-orange));
    animation: floatLogo 3s ease-in-out infinite alternate;
}

/* Esempio di cosa cercare e modificare */

.holo-logo {
    animation: movimento-perfetto 3s ease-in-out infinite; /* <--- QUESTA RIGA */
}

.holo-orb {
    animation: movimento-perfetto 3s ease-in-out infinite; /* <--- DEVE ESSERE UGUALE */
}

@keyframes floatLogo { 
    0% { transform: translateY(5px) scale(0.98); } 
    100% { transform: translateY(-5px) scale(1.02); } 
}
@keyframes breatheOrb { 0% { transform: scale(0.95); opacity: 0.8; } 100% { transform: scale(1.05); opacity: 1; } }

.hud-panel { position: absolute; background: rgba(10,2,2,0.8); backdrop-filter: blur(5px); border: 1px solid var(--mars-red); padding: 15px 20px; border-radius: 10px; display: flex; align-items: center; gap: 15px; font-family: var(--font-code); color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.5); z-index: 10; }
.hud-panel i { font-size: 1.5rem; color: var(--mars-orange); }
.hud-panel span { display: block; font-size: 0.7rem; color: var(--text-muted); }
.hud-panel strong { font-size: 1.1rem; }
.panel-1 { top: 5%; left: -20px; }
.panel-2 { bottom: 5%; right: -20px; }

/* --- INFINITE SCROLL MARQUEE --- */
.tech-marquee-wrapper { width: 100%; overflow: hidden; background: #050101; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 20px 0; margin-top: 20px; }
.tech-marquee { width: 100%; overflow: hidden; display: flex; }
.marquee-content { display: flex; gap: 50px; animation: scrollMarquee 20s linear infinite; white-space: nowrap; }
.marquee-content span { font-family: var(--font-code); font-size: 1.2rem; font-weight: bold; color: #554444; display: flex; align-items: center; gap: 10px; }
.marquee-content span i { color: var(--mars-red); }
@keyframes scrollMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- BENTO BOX GRID --- */
.bento-section { padding: 80px 0; }
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 250px; gap: 20px; }
.bento-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 24px; padding: 30px; position: relative; overflow: hidden; transition: 0.4s; display: flex; flex-direction: column; justify-content: center; }
.bento-card:hover { border-color: var(--mars-orange); box-shadow: 0 10px 30px rgba(255,102,0,0.1); transform: translateY(-5px); }
.span-2 { grid-column: span 2; }
.bento-icon { font-size: 2.5rem; color: var(--mars-orange); margin-bottom: 20px; }
.feature-card h3 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.stat-card { text-align: center; align-items: center; background: linear-gradient(135deg, rgba(255,42,0,0.05), transparent); }
.stat-num { font-family: var(--font-head); font-size: 4.5rem; font-weight: 900; color: #fff; text-shadow: 0 0 20px var(--mars-glow); }
.stat-card .plus { font-size: 2rem; color: var(--mars-orange); font-weight: bold; }
.stat-card p { font-family: var(--font-code); color: var(--text-muted); letter-spacing: 2px; margin-top: 5px; }

/* --- SERVICES (DATAPADS) --- */
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-family: var(--font-head); font-size: 3.5rem; margin-bottom: 10px; }
.section-header p { color: var(--text-muted); font-family: var(--font-code); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.service-datapad { background: rgba(15,5,5,0.8); backdrop-filter: blur(10px); border: 1px solid #331111; border-radius: 16px; padding: 40px 30px; position: relative; cursor: pointer; transition: 0.4s; overflow: hidden; }
.pad-glow { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,102,0,0.1) 0%, transparent 50%); opacity: 0; transition: 0.5s; pointer-events: none; }
.service-datapad:hover { border-color: var(--mars-red); transform: translateY(-5px); box-shadow: 0 15px 40px rgba(255,42,0,0.15); }
.service-datapad:hover .pad-glow { opacity: 1; }
.pad-icon { font-size: 2.5rem; color: var(--mars-red); margin-bottom: 20px; transition: 0.3s; }
.service-datapad:hover .pad-icon { transform: scale(1.1); text-shadow: 0 0 15px var(--mars-red); }
.service-datapad h3 { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 15px; }
.service-datapad p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 30px; }
.pad-footer { font-family: var(--font-code); font-size: 0.8rem; color: var(--mars-orange); border-top: 1px solid #331111; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; }

/* --- HOLOGRAPHIC BOX (PORTFOLIO/CONTACT) --- */
.holographic-box { background: rgba(10,2,2,0.6); backdrop-filter: blur(15px); border: 1px solid var(--border-color); border-radius: 20px; padding: 60px; text-align: center; max-width: 700px; position: relative; overflow: hidden; box-shadow: inset 0 0 50px rgba(255,42,0,0.05); }
.box-scanline { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: rgba(255,102,0,0.5); box-shadow: 0 0 10px var(--mars-orange); animation: scan 3s linear infinite; }
.big-icon { font-size: 4.5rem; color: var(--mars-orange); margin-bottom: 20px; filter: drop-shadow(0 0 15px var(--mars-glow)); }
.holographic-box h2 { font-family: var(--font-head); font-size: 2.8rem; margin-bottom: 15px; }
.holographic-box p { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; }
.mt-20 { margin-top: 20px; }
.sub-text { font-family: var(--font-code); font-size: 0.85rem; color: #665555; }
@keyframes scan { 0% { top: -10%; } 100% { top: 110%; } }

/* --- CREW --- */
.crew-grid { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.crew-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 16px; width: 100%; max-width: 380px; overflow: hidden; transition: 0.4s; position: relative; }
.crew-card:hover { border-color: var(--mars-orange); transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
.crew-banner { height: 100px; background: var(--gradient); }
.banner-astra { background: linear-gradient(135deg, #ff8c00, #ff0055); }
.crew-avatar { position: absolute; top: 50px; left: 30px; width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--bg-panel); background: #000; }
.crew-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.crew-avatar .dot { position: absolute; bottom: 0; right: 0; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--bg-panel); }
.dot.red { background: #ff2a00; box-shadow: 0 0 10px #ff2a00; }
.dot.gold { background: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.crew-info { padding: 50px 30px 30px; }
.crew-info h3 { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 5px; }
.role-tag { font-family: var(--font-code); font-size: 0.75rem; color: var(--mars-orange); border: 1px solid var(--mars-orange); padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 15px; }
.tag-astra { color: #ff0055; border-color: #ff0055; }
.crew-bio { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; min-height: 60px; }
.crew-skills { display: flex; gap: 15px; font-size: 1.5rem; color: #554444; }
.crew-skills i:hover { color: var(--text-main); }

.support-staff-section { margin-top: 50px; }
.staff-divider { display: flex; align-items: center; margin-bottom: 25px; }
.staff-divider::before, .staff-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.staff-divider span { padding: 0 15px; font-family: var(--font-code); color: var(--text-muted); font-size: 0.8rem; letter-spacing: 2px; }
.staff-bar-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.staff-chip { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); padding: 8px 18px; border-radius: 50px; font-size: 0.9rem; }
.staff-chip strong { color: var(--mars-orange); font-family: var(--font-head); margin-right: 8px; }

/* --- MODAL --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content.bento-style { background: var(--bg-panel); border: 1px solid var(--mars-red); border-radius: 20px; max-width: 600px; width: 90%; transform: scale(0.9); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-overlay.active .modal-content { transform: scale(1); }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 2rem; color: #fff; cursor: pointer; transition: 0.3s; }
.close-btn:hover { color: var(--mars-red); transform: rotate(90deg); }
.modal-header { padding: 30px; text-align: center; border-bottom: 1px solid var(--border-color); background: linear-gradient(180deg, rgba(255,42,0,0.1), transparent); border-radius: 20px 20px 0 0; }
.modal-icon-box { font-size: 3rem; color: var(--mars-orange); margin-bottom: 10px; }
.modal-header h2 { font-family: var(--font-head); font-size: 2rem; }
.modal-body { padding: 30px; }
.modal-features { list-style: none; margin-bottom: 30px; }
.modal-features li { padding: 10px 0; border-bottom: 1px solid #220a0a; color: #ddd; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.modal-features li i { color: var(--mars-red); font-size: 0.8rem; }
.modal-cta { width: 100%; justify-content: center; }

/* --- FOOTERS --- */
.static-footer, .abs-footer { text-align: center; padding: 25px; font-family: var(--font-code); color: #554444; font-size: 0.85rem; }
.abs-footer { position: relative; margin-top: auto; }
strong { color: var(--mars-orange); }

/* --- CANVAS & ANIMATIONS --- */
canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; }
.slide-up { animation: slideUp 0.8s forwards; opacity: 0; transform: translateY(30px); }
.delay-1 { animation-delay: 0.2s; } .delay-2 { animation-delay: 0.4s; } .delay-3 { animation-delay: 0.6s; }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(40px); transition: 0.6s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
.float-anim { animation: float 4s ease-in-out infinite; }
.delay-anim-1 { animation-delay: 2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.stagger-1 { transition-delay: 0.1s; } .stagger-2 { transition-delay: 0.2s; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .hero-split { grid-template-columns: 1fr; text-align: center; margin-top: 50px; }
    .hero-left p { margin: 0 auto 30px; }
    .hero-right { display: none; }
    .bento-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .span-2 { grid-column: span 1; }
    .floating-nav { width: 95%; padding: 10px 20px; }
    .nav-menu { position: fixed; top: 70px; left: 50%; transform: translateX(-50%) scale(0.9); width: 95%; background: var(--bg-panel); border: 1px solid var(--mars-red); border-radius: 20px; flex-direction: column; padding: 20px; opacity: 0; visibility: hidden; transition: 0.3s; }
    .nav-menu.active { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }
    .nav-actions { display: none; }
    .mobile-only { display: block; }
    .hamburger { display: block; cursor: pointer; }
    .bar { display: block; width: 25px; height: 3px; background: #fff; margin: 5px auto; transition: 0.3s; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}