:root {
    /* TEMA CHIARO (Corporate Mode) - Default di base */
    --bg-dark: #f4f4f5;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent-cyan: #0284c7;
    --border-color: #d1d5db;
    --nav-bg: rgba(244, 244, 245, 0.9);
    --hero-bg: radial-gradient(circle at center, #e5e7eb 0%, #f4f4f5 100%);
    --scanline-overlay: rgba(0, 0, 0, 0.03);
    --btn-hover-bg: #111827;
    --btn-hover-text: #ffffff;
    --font-head: 'Orbitron', sans-serif;
    --font-text: 'JetBrains Mono', monospace;
}

body.light-mode {
    /* TEMA CHIARO (Corporate Mode) */
    --bg-dark: #f4f4f5;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent-cyan: #0284c7;
    --border-color: #d1d5db;
    --nav-bg: rgba(244, 244, 245, 0.9);
    --hero-bg: radial-gradient(circle at center, #e5e7eb 0%, #f4f4f5 100%);
    --scanline-overlay: rgba(0, 0, 0, 0.03);
    --btn-hover-bg: #111827;
    --btn-hover-text: #ffffff;
}

/* --- BASE & TRANSIZIONI --- */
/* --- BASE & TRANSIZIONI --- */
* {
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    /* FIX 1: Colora il "fondo" del browser di nero, addio spazio bianco! */
    background-color: var(--bg-dark); 
    /* FIX 2: Taglia via ogni possibile sbavatura orizzontale alla radice */
    overflow-x: hidden; 
}

body {
    margin: 0;
    padding: 0;
    /* FIX 3: Forza il body a coprire sempre il 100% dello schermo (dvh è perfetto per mobile) */
    min-height: 100vh;
    min-height: 100dvh; 
    display: flex; 
    flex-direction: column;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-text);
    /* FIX 4: Impedisce agli elementi di allargare la pagina di lato */
    overflow-x: hidden; 
    width: 100%;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* TEMA SCURO (Hacker Mode) - Si attiva solo con la classe */
body.dark-mode {
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent-cyan: #00ffff;
    --border-color: #222222;
    --nav-bg: rgba(0, 0, 0, 0.8);
    --hero-bg: radial-gradient(circle at center, #111111 0%, #000000 100%);
    --scanline-overlay: rgba(255, 255, 255, 0.02);
    --btn-hover-bg: #000000;
    --btn-hover-text: #ffffff;
}

.navbar, .hero-full, .card, .btn, .roadmap-item, section, footer {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* --- EFFETTO SCANLINE --- */
.scanline {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, var(--scanline-overlay), rgba(0, 0, 0, 0.01), var(--scanline-overlay));
    background-size: 100% 3px, 5px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- NAVIGATION --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: var(--nav-bg);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo a {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links > a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links > a:hover, .nav-links > a.active {
    color: var(--accent-cyan);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 20px;
    padding: 5px;
    opacity: 0.7;
    transition: transform 0.2s, opacity 0.2s;
    color: var(--text-main);
}

.theme-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- MENU A TENDINA (DROPDOWN) DESKTOP --- */
.dropdown {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

.dropbtn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-text);
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    padding: 10px 0;
    transition: color 0.3s;
}

.dropdown:hover .dropbtn {
    color: var(--accent-cyan);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-card);
    min-width: 180px;
    border: 1px solid var(--border-color);
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 101;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(0, 255, 255, 0.05);
    color: var(--accent-cyan);
    padding-left: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- HAMBURGER BUTTON (Nascosto su Desktop) --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

.hamburger .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin: 0 0 10px 0;
}

h2 {
    color: var(--accent-cyan);
    font-size: 2rem;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

p {
    color: var(--text-muted);
}

/* --- HERO SECTION (LA HOME CENTRATA) --- */
.hero-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: var(--hero-bg);
}

.main-logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    color: var(--accent-cyan);
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.hero-desc {
    max-width: 600px;
    margin: 0 auto 40px auto;
    color: var(--text-muted);
}

/* --- BUTTONS --- */
.cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    font-family: var(--font-head);
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 1px;
    text-align: center;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-dark);
    border: 1px solid var(--text-main);
}

.btn-primary:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* --- LAYOUT & CARDS --- */
.page-content {
    flex: 1;
    padding: 60px 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 2.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-left: 3px solid var(--text-main);
}

/* --- ROADMAP & DEV STATUS --- */
.roadmap-item {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.phase {
    font-family: var(--font-head);
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--accent-cyan);
    min-width: 120px;
}

.phase.muted { color: var(--text-muted); }
.muted-text { color: var(--text-muted); }

.dev-status { display: flex; align-items: center; margin-bottom: 15px; font-size: 0.9rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 15px; flex-shrink: 0;}
.dot-green { background: #00ff00; box-shadow: 0 0 8px #00ff00; }
.dot-orange { background: #ffa500; box-shadow: 0 0 8px #ffa500; }
.dot-red { background: #ff0000; box-shadow: 0 0 8px #ff0000; }

/* --- FOOTER & SOCIALS --- */
footer {
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 0.8rem;
    text-align: center;
    margin-top: auto;
}

.footer-socials { margin-bottom: 15px; }
.footer-socials a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 10px;
    font-family: var(--font-head);
    font-weight: bold;
    transition: color 0.2s;
}
.footer-socials a:hover { color: var(--accent-cyan); }

/* --- ANIMAZIONI --- */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- WHITEPAPER LAYOUT --- */
.whitepaper-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
    align-items: flex-start;
}

.whitepaper-sidebar {
    width: 250px;
    position: sticky;
    top: 100px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.wp-nav-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 0;
    font-size: 0.85rem;
    font-family: var(--font-head);
    border-left: 2px solid transparent;
    padding-left: 15px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wp-nav-link:hover, .wp-nav-link.active {
    color: var(--accent-cyan);
    border-left-color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.05);
}

.whitepaper-content {
    flex-grow: 1;
    min-width: 0; 
}

.wp-section {
    margin-bottom: 80px;
    scroll-margin-top: 100px;
}

.wp-section h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.wp-section h3 {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin: 30px 0 15px 0;
}

.wp-section p {
    margin-bottom: 15px;
    color: var(--text-muted);
    line-height: 1.8;
}

.wp-section ul {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 20px;
}

.wp-section li { margin-bottom: 10px; }
.wp-section strong { color: var(--text-main); }


/* =========================================
   MEDIA QUERY PER MOBILE (Sotto i 768px)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Attiva l'Hamburger Menu */
    .hamburger {
        display: flex; 
    }

    .navbar {
        padding: 15px 20px; 
    }

    /* 2. Trasforma la navigazione in una Sidebar a scorrimento */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 280px; /* Leggermente più larga per i sottomenu */
        height: 100vh;
        background-color: var(--bg-card);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        align-items: flex-start;
        padding-top: 80px; 
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.8);
        z-index: 999;
        overflow-y: auto; /* Permette lo scroll se il menu è lungo */
    }

    .nav-links.active {
        right: 0; 
    }

    /* 3. Allineamento Base Link e Container Dropdown */
    .nav-links > a, .dropdown {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links > a {
        padding: 18px 25px;
        display: block;
    }

    /* 4. Fix dei bottoni Dropdown (Allineamento e Click Area) */
    .dropbtn {
        width: 100%;
        text-align: left; /* Fondamentale: allinea il testo a sinistra */
        padding: 18px 25px;
        font-size: 0.85rem;
    }

    /* 5. Fix del contenuto Dropdown su Mobile (Niente sovrapposizioni) */
    .dropdown-content {
        position: static; /* Spinge i contenuti giù, non vola sopra */
        box-shadow: none;
        border: none;
        min-width: 100%;
        background-color: transparent;
        border-top: 1px solid var(--border-color);
    }

    /* 6. Indentazione visiva per i sotto-link (Effetto Cartella) */
    .dropdown-content a {
        padding: 15px 25px 15px 45px; 
        border-bottom: 1px solid var(--border-color);
        font-size: 0.75rem;
    }
    .dropdown-content a:last-child {
        border-bottom: none;
    }

    /* 7. Bottone Tema e Animazione Hamburger */
    .theme-btn {
        margin: 20px 25px;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* 8. Fix per le griglie a 2 colonne (es: Black Market / Meccaniche) */
    .grid-2 {
        grid-template-columns: 1fr; /* Mette tutto su una colonna singola */
        gap: 20px;
    }

    /* 9. Fix per il Whitepaper Layout */
    .whitepaper-wrapper { flex-direction: column; }
    .whitepaper-sidebar {
        width: 100%; 
        position: relative; 
        top: 0;
        border-right: none; 
        border-bottom: 1px solid var(--border-color);
        padding-right: 0; 
        padding-bottom: 20px; 
        max-height: 250px;
    }
}