:root {
    --bg-color: #050505;
    --main-color: #00f2ff;    
    --accent-color: #bc13fe;  
    --hot-pink: #ff00f2;      
    --font-main: 'Courier New', Courier, monospace;
    --font-display: 'Impact', 'Arial Narrow Bold', sans-serif;
    --text-glow: 0 0 10px rgba(0, 242, 255, 0.9), 0 0 20px rgba(0, 242, 255, 0.4);
}

* { box-sizing: border-box; }

/* --- FIX MOBILE HEIGHT (100dvh) --- */
/* Usa l'altezza dinamica per evitare salti con la barra indirizzi */
body, 
.fullscreen-bg-video, 
.fullscreen-bg-image, 
#intro-video, 
.overlay {
    height: 100vh; /* Fallback */
    height: 100dvh; 
}

body {
    background-color: var(--bg-color);
    background-image: url('tuo-paesaggio-milano.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--main-color);
    font-family: var(--font-main);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    text-transform: uppercase;
    overflow-x: hidden;
    animation: background-soft-pulse 30s ease-in-out infinite alternate;
}

@keyframes background-soft-pulse {
    0% { transform: scale(1); filter: brightness(0.7) contrast(1.1); }
    100% { transform: scale(1.03); filter: brightness(0.9) contrast(1.2); }
}

/* --- SFONDI E VIDEO --- */

/* 1. Video Tram (Loop di sfondo) */
.fullscreen-bg-video {
    position: fixed;
    top: 0; left: 0; width: 100%;
    object-fit: cover;
    z-index: -1;
    transition: opacity 1.5s ease;
    opacity: 1;
    filter: brightness(1.1);
}

/* 2. Immagine Genesis (Schermata Iniziale) */
.fullscreen-bg-image {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: url('gabryland-genesis.png') no-repeat center center;
    background-size: cover;
    z-index: -1;
    transition: opacity 1.5s ease;
    opacity: 1; 
}

/* Utility per nascondere con transizione */
.hidden-bg { opacity: 0 !important; visibility: hidden; }

/* 3. Video Intro (Origin) - Full Screen */
#intro-video {
    position: fixed;
    top: 0; left: 0; 
    width: 100%;
    
    /* Full Screen: niente bande nere */
    object-fit: cover;
    object-position: center;
    
    z-index: 9999; /* Sopra a tutto */
    background: #000;
    transition: opacity 1s ease-out;
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- EFFETTI SOVRAPPOSTI (Pioggia & Scanlines) --- */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.15; 
}

/* --- TERMINALE UI --- */
.terminal {
    width: 100%;
    max-width: 850px;
    z-index: 10;
    background: rgba(10, 10, 10, 0.85); 
    backdrop-filter: blur(12px);
    padding: 40px;
    border: 1px solid var(--main-color);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
}

.glitch-neon {
    font-size: clamp(1.8rem, 8vw, 5.2rem); 
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    animation: neon-flicker 3.5s infinite;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { text-shadow: 0 0 10px #fff, 0 0 25px var(--main-color), 0 0 50px var(--accent-color); opacity: 1; }
    20%, 24%, 55% { text-shadow: none; opacity: 0.6; }
}

#boot-action { margin-top: 40px; margin-bottom: 80px; }

#reboot-btn {
    background: transparent;
    color: #fff;
    border: 3px solid var(--accent-color);
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 5px;
    padding: 20px 50px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-color), inset 0 0 10px var(--accent-color);
    text-shadow: 0 0 10px #fff, 0 0 20px var(--accent-color);
    animation: btn-neon-pulse 2s infinite;
}

@keyframes btn-neon-pulse {
    0%, 100% { box-shadow: 0 0 15px var(--accent-color), inset 0 0 10px var(--accent-color); filter: brightness(1); }
    50% { box-shadow: 0 0 30px var(--accent-color), inset 0 0 15px var(--accent-color); filter: brightness(1.3); }
}

#reboot-btn:hover { background: var(--accent-color); transform: scale(1.05); }

#mute-btn {
    background: transparent;
    color: var(--main-color);
    border: 1px solid rgba(0, 242, 255, 0.4);
    font-size: 0.7rem;
    padding: 6px 12px;
    cursor: pointer;
    opacity: 0.6;
}

/* --- SYSTEM LOG --- */
.system-log { text-align: left; min-height: 160px; border-left: 3px solid var(--accent-color); padding-left: 20px; margin: 25px 0; }
.system-log p { color: #ffffff; font-size: 0.95rem; font-weight: 600; margin: 10px 0; }

/* --- SCROLL ORIZZONTALE (ARCHIVE) --- */
.horizontal-scroll-container { display: flex; overflow-x: auto; gap: 15px; padding: 20px 0; scrollbar-width: none; scroll-snap-type: x mandatory; }
.scroll-item { flex: 0 0 280px; scroll-snap-align: center; border: 1px solid rgba(0, 242, 255, 0.6); background: rgba(0,0,0,0.8); padding: 12px; transition: 0.4s; }
.scroll-item.is-active { border-color: var(--hot-pink); box-shadow: 0 0 20px var(--hot-pink); transform: translateY(-5px); }

.video-container { width: 100%; aspect-ratio: 1/1; position: relative; overflow: hidden; filter: brightness(1.2) contrast(1.1); }
.static-thumb, .hover-video { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s; }
.hover-video { position: absolute; top: 0; left: 0; opacity: 0; }
.scroll-item.is-active .static-thumb { opacity: 0; }
.scroll-item.is-active .hover-video { opacity: 1; }
.item-label { display: block; margin-top: 15px; color: #fff; text-shadow: 0 0 10px var(--main-color); font-size: 0.9rem; text-align: center; font-weight: bold; letter-spacing: 2px; }

/* --- VISIBILITA' UI --- */
.hidden-ui { display: none !important; }
.reveal-ui { display: block !important; animation: fadeIn 0.8s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- LINK & FOOTER --- */
.divider { color: var(--hot-pink); text-shadow: 0 0 12px var(--hot-pink); font-size: 0.9rem; margin: 50px 0 15px; letter-spacing: 6px; font-weight: bold; }
.links { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 40px; }
.links a { color: #fff; text-shadow: 0 0 8px var(--main-color); border: 1px solid var(--main-color); padding: 12px 24px; text-decoration: none; font-size: 0.85rem; }

.site-footer {
    background: rgba(0, 0, 0, 0.85);
    border-top: 2px solid var(--accent-color);
    margin-top: 60px;
    padding: 30px 20px;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--main-color);
    text-shadow: 0 0 5px rgba(0, 242, 255, 0.4);
    position: relative;
    z-index: 5;
    width: 100%;
}

.site-footer p { margin: 8px 0; font-weight: 500; }

.site-footer a, .footer-contact {
    color: var(--hot-pink) !important;
    text-decoration: none;
    border-bottom: 1px dashed var(--hot-pink);
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}

.site-footer a:hover, .footer-contact:hover {
    background-color: var(--hot-pink);
    color: #fff !important;
    box-shadow: 0 0 15px var(--hot-pink);
    border-bottom: 1px solid transparent;
}

/* --- MOBILE RESPONSIVE --- */
@media screen and (max-width: 768px) {
    body { 
        padding: 10px; 
        background-attachment: scroll; 
        overflow-x: hidden; 
        width: 100vw;
    }

.terminal { 
        /* Riduciamo l'opacità dello sfondo (da 0.85 a 0.60) */
        background: rgba(5, 5, 5, 0.60) !important; 
        
        /* Aumentiamo il blur per rendere il testo leggibile sopra il video */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px); /* Per Safari/iOS */
        
        /* Aggiungiamo un bordo più evidente per staccarlo dallo sfondo */
        border: 1px solid rgba(0, 242, 255, 0.4);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
        
        /* Margine extra in basso per vedere il video mentre si scrolla */
        margin-bottom: 100px; 
        
        /* Assicuriamo che non tocchi i bordi fisici */
        width: 100%;
        border-radius: 15px;
    }

    .glitch-neon { 
        font-size: clamp(2.5rem, 10vw, 3.5rem); 
        margin-bottom: 20px; 
    }
    
    header { display: flex; flex-direction: column; gap: 15px; }
    
    /* TASTO SYSTEM_INIT OTTIMIZZATO */
    #reboot-btn { 
        padding: 20px 10px; 
        font-size: 1.1rem; 
        width: 100%; 
        max-width: 300px;
        touch-action: manipulation; 
    }
    
    .controls { position: absolute; top: 10px; right: 10px; }
    #mute-btn { font-size: 0.6rem; padding: 4px 8px; }

    /* SCROLL ORIZZONTALE MOBILE */
    .horizontal-scroll-container { 
        scroll-snap-type: x mandatory; 
        padding: 0 5px; 
        gap: 15px; 
        justify-content: flex-start; 
    }
    
    .scroll-item { 
        /* PRIMA ERA: flex: 0 0 85vw; (Troppo grande) */
        
        /* NUOVO VALORE: 70vw */
        /* Questo lascia spazio laterale per vedere il prossimo elemento */
        flex: 0 0 70vw; 
        
        transform: none !important; 
        box-shadow: none !important; 
        background: rgba(0,0,0,0.8);
        
        /* Manteniamo l'allineamento al centro per il focus */
        scroll-snap-align: center;
        
        /* Aggiungiamo un margine laterale per distanziare meglio nel flusso */
        margin: 0 10px;
    }
    
    .scroll-item.is-active { border-color: var(--hot-pink); box-shadow: 0 0 10px var(--hot-pink) !important; }
    .item-label { font-size: 0.7rem; margin-top: 8px; }

    /* LAYOUT VERTICALE */
    .signal-stream-container { width: 100%; }
    .spotify-track { display: flex; flex-direction: column; gap: 15px; }
    .spotify-card iframe { height: 152px; }
    
    .links { flex-direction: column; width: 100%; }
    .links a { width: 100%; text-align: center; display: block; }
}