:root {
  --neon-orange: #FF4500;
  --terminal-green: #00ff41;
  --bg-dark: #0a0a0a;
}

* { box-sizing: border-box; margin: 0; padding: 0;}
html { scroll-behavior: smooth; }

/* --- STATO 1: BORING MODE (Stile LaTeX/Paper REPLICA) --- */

body.boring-mode {
    background-color: #ffffff;
    font-family: 'Times New Roman', Times, serif; 
    overflow: hidden;
    height: 100vh;
    color: #000;
}

#boring-layer {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center; 
    padding: 20px;
}

.paper-content {
    max-width: 900px; /* Allargato leggermente per far stare i 3 autori */
    width: 100%;
    text-align: center;
}

/* Gruppo Titolo con Linee */
.paper-header-group {
    border-top: 4px solid #000;    /* La linea spessa in alto */
    border-bottom: 1px solid #000; /* La linea sottile in basso */
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.paper-title {
    font-size: 2.2rem; /* Dimensione simile all'immagine */
    font-weight: bold;
    line-height: 1.2;
    color: #000;
    margin: 0;
}

/* Griglia Autori */
.authors-grid {
    display: flex;
    justify-content: space-between; /* Distribuisce le 3 colonne */
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.3;
}

.author-col {
    flex: 1; /* Ogni autore prende lo stesso spazio */
    padding: 0 10px;
}

.author-name {
    font-weight: bold;
    margin-bottom: 2px;
}

.author-col p {
    margin: 0;
}

/* Abstract */
.paper-abstract {
    max-width: 800px;
    margin: 0 auto; /* Centra il blocco abstract */
    text-align: justify; /* Giustifica il testo come nel paper */
}

.paper-abstract h3 {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    color: #000;
}

.paper-abstract p {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Footer (rimane uguale) */
.paper-footer {
    margin-top: 4rem;
    font-size: 0.9rem;
    color: #666;
    font-family: 'Courier New', Courier, monospace;
}

.blink-text {
    animation: blink 1.5s infinite;
    cursor: pointer;
}

@keyframes blink { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0; } 
}

/* --- BUTTON STYLE FOR BORING LAYER --- */
.boring-button {
    background: transparent;
    border: 2px solid #000;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.boring-button:hover {
    background: #000;
    color: #fff;
    animation: none; /* Stop blinking on hover */
}


/* --- STATO 2: DARK MODE (Reddit World) --- */
body.dark-mode {
    background-color: var(--bg-dark);
    font-family: 'VT323', monospace;
    overflow-y: auto; /* Riabilita lo scroll */
}

body.dark-mode #boring-layer {
    display: none !important; /* Nasconde il foglio bianco */
}

body.dark-mode #reddit-layer {
    display: block;
}

/* --- NUOVO LAYOUT INTRODUTTIVO (Avatar a SX, Testo a DX) --- */

/* Contenitore flessibile che affianca Avatar e Testo */
.intro-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Allinea gli elementi in alto */
    justify-content: center; /* Centra il tutto nella pagina */
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 15vh; /* Spazio dall'alto per centrarlo visivamente */
    gap: 50px; /* Spazio tra l'avatar e il box verde */
    position: relative; 
    z-index: 5; /* Porta tutto il contenuto (avatar, testi, bottoni) SOPRA lo sfondo */
}

/* 1. COLONNA SINISTRA: L'Avatar */
.left-col {
    flex: 0 0 150px; /* Larghezza fissa per la colonna avatar */
}

/* Rende l'avatar "appiccicoso" se si scrolla la pagina */
.avatar-sticky {
    position: sticky;
    top: 50px;
}

.pixel-avatar {
    width: 100%;
    image-rendering: pixelated; /* Funziona anche sui video! */
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.4));
}

/* --- STILE NOMI AVATAR --- */

.avatar-name {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-align: center;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0px 2px 2px rgba(0,0,0,0.8); /* Leggibilità su sfondo scuro */
}

/* Colori specifici per personaggio */
.name-reddit { 
    color: #00ff41; /* Verde Matrix */
}

.name-user { 
    color: #00e5ff; /* Ciano Neon */
}

.name-scientist { 
    color: #FFFF00; /* Giallo (come il bordo della nuvola) */
}

/* Fix per l'avatar sticky (Intro) */
.avatar-sticky {
    /* Assicura che il nome stia dentro il blocco sticky */
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 2. COLONNA DESTRA: Box Verde + Bottone */
.right-col {
    flex: 1; /* Occupa tutto lo spazio rimanente */
    display: flex;
    flex-direction: column;
    gap: 40px; /* Distanza tra il box di testo e il bottone */
}

/* Il Box Verde (Terminale) */
.terminal-box {
    border: 1px solid var(--terminal-green); 
    padding: 30px;
    
    /* MODIFICA QUI: Da rgba(0, 20, 0, 0.5) a quasi nero solido */
    background-color: rgba(0, 5, 0, 0.95); 
    
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
    min-height: 200px; 
}

/* Il testo che si scrive da solo */
#intro-text {
    font-family: 'VT323', monospace;
    font-size: 1.5rem; /* Grandezza testo */
    color: #ffffff;
    line-height: 1.4;
    white-space: pre-wrap; /* Mantiene gli a capo del testo JS */
    margin: 0;
}

/* Il cursore lampeggiante alla fine del testo */
.cursor {
    color: var(--terminal-green);
    font-weight: bold;
    font-size: 1.5rem;
    animation: blink 1s infinite;
}

/* 3. IL BOTTONE ARANCIONE */
.action-area {
    /* Contenitore per allineare il bottone se serve, qui standard */
}

.enter-rabbit-hole {
    background: transparent;
    border: 2px solid var(--neon-orange); /* Bordo arancione spesso */
    color: var(--neon-orange);
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    padding: 15px 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    display: inline-block;
}

.enter-rabbit-hole:hover {
    background: var(--neon-orange);
    color: #0a0a0a; /* Testo diventa nero su sfondo arancione */
    box-shadow: 0 0 20px var(--neon-orange); /* Effetto neon */
}

/* --- SCENE 0.5: DASHBOARD STYLE --- */

/* Il contenitore principale della dashboard */
.dashboard-panel {
    border: 2px solid var(--terminal-green);
    background-color: rgba(0, 10, 0, 0.8);
    position: relative;
    padding: 5px; /* Un piccolo bordo interno */
    margin-bottom: 30px; /* Più spazio sotto */
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.15); /* Ombra più grande */
    
    /* Sfondo a griglia per il pannello */
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 2; /* Assicura che stia SOPRA lo sfondo binario */
}

/* L'intestazione del pannello */
.panel-header {
    background: var(--terminal-green);
    color: #000;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--terminal-green);
}

.panel-body {
    padding: 40px; /* Più spazio interno per il testo */
    min-height: 350px; /* Altezza minima maggiore */
    font-size: 1.4rem;
}

/* Decorazione "Chaotic" */
.chart-decoration {
    position: absolute;
    bottom: 10px; right: 10px;
    width: 100px; height: 30px;
    border-left: 1px solid var(--terminal-green);
    border-bottom: 1px solid var(--terminal-green);
    opacity: 0.5;
}

.chart-decoration::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent 40%, var(--terminal-green) 45%, transparent 50%);
    background-size: 10px 10px;
}

/* --- SFONDO BINARIO SCORREVOLE PER SCENE 0.5 --- */

/* 1. Prepariamo la scena */
/* --- GLOBAL BINARY BACKGROUND (Applied to all scenes) --- */
body.dark-mode::before {
    content: '';
    position: fixed; /* Fixed so it stays while scrolling */
    top: 0; left: 0; width: 100%; height: 100%;
    
    z-index: -1; /* Behind everything */
    opacity: 0.6; 
    
    /* The Binary Pattern */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='20'%3E%3Ctext x='0' y='15' fill='%23555555' font-family='monospace' font-size='14'%3E0 1 0 1 1 0 0 1 0 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    
    /* Animation */
    animation: scrollBinaryBg 20s linear infinite;
    pointer-events: none;
}
/* Remove the background specific to scene-0-5 since it's now global */
#scene-0-5 { background: transparent; } /* Remove old specific background */

/* --- 1. IL FILTRO ARANCIONE (Persistente) --- */
/* Questa classe gestisce SOLO l'effetto visivo (sfondo e ombra).
   Rimarrà attiva per tutto il sito. */

body.orange-lens-active::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 999; /* Sopra tutto */
    
    /* MODIFICA 1: Sfondo (Tinta) - Molto leggero (5%) */
    background: rgba(255, 69, 0, 0.05); 
    
    /* MODIFICA 2: Vignettatura - Leggera (25%) */
    box-shadow: inset 0 0 100px rgba(255, 69, 0, 0.25); 
    
    pointer-events: none; /* Lascia passare i click */
    animation: lensFadeIn 0.5s ease-out;
}

/* --- 2. IL CURSORE OCCHIALI (Temporaneo) --- */
/* Questa è la NUOVA classe che attiveremo SOLO nella Scena 1.
   Gestisce solo l'icona del mouse. */

body.glasses-cursor-mode,
body.glasses-cursor-mode a, 
body.glasses-cursor-mode button, 
body.glasses-cursor-mode .enter-rabbit-hole {
    /* Ensure you have a 'glasses.png' in your assets folder! */
    cursor: url("../images/cursor.png"), auto !important;
}

@keyframes lensFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 3. Definizione animazione */
@keyframes scrollBinaryBg {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -300px 0;
    }
}

/* --- SCENE 1: DIALOGUE LAYOUT --- */

.dialogue-container {
    max-width: 100%;
    margin: 0 auto;
    padding-top: 10vh;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Spazio verticale tra le righe */
}

/* RIGA DIALOGO (Avatar + Box) */
.speech-row {
    display: flex;
    align-items: flex-start; /* Allinea in alto */
    gap: 20px;
    width: 100%;
}

/* Wrapper per l'avatar piccolo nella conversazione */
.avatar-wrapper {
    flex: 0 0 100px; /* Larghezza fissa per l'avatar */
}

.pixel-avatar-speech {
    width: 100%;
    image-rendering: pixelated;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 5px rgba(0, 255, 65, 0.5));
}

/* BOX VERDE (Stile Terminale Identico all'Intro) */
.terminal-box.green-style {
    flex: 1; 
    border: 1px solid #00ff41; 
    
    /* MODIFICA QUI: Da 0.8 a 0.95 per coprire i numeri dietro */
    background-color: rgba(0, 5, 0, 0.95); 
    
    padding: 20px;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    position: relative;
}
/* --- LAYOUT RIGA NARRATORE (Nuovo) --- */
.narrator-row {
    display: flex;
    align-items: center; /* Centra verticalmente Nuvola e Avatar */
    justify-content: space-between;
    gap: 20px; /* Spazio tra la nuvola e il nerd */
    width: 100%;
    margin: 30px 0; /* Il margine ora è sul contenitore, non sulla nuvola */
    position: relative;
}

/* --- STILE NARRATORE "NUVOLA NEON" (Aggiornato) --- */
.narrator-cloud {
    /* LAYOUT FLEX: La nuvola prende tutto lo spazio disponibile */
    flex: 1; 
    margin: 0; /* Rimuoviamo il margine perché gestito dalla riga */

    /* 1. OPACITÀ E SFONDO */
    background-color: rgba(255, 255, 255, 0.85); 
    color: #000;

    /* 2. FORMA NUVOLA */
    border-radius: 50px; 
    padding: 30px;
    
    /* 3. ALONE NEON GIALLO */
    border: 2px solid #FFFF00;
    box-shadow: 
        0 0 25px rgba(255, 255, 0, 0.8),
        inset 0 0 15px rgba(255, 255, 0, 0.3);

    /* Stile Testo */
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    position: relative;
    z-index: 20;
    
    /* Animazione Entrata (Slide-in) */
    transform: translateX(-100vw); /* Parte da fuori schermo a sinistra */
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 1.2s ease;
}

/* Rimuoviamo la freccia */
.narrator-cloud::after {
    display: none;
}

/* Classe attiva per l'animazione */
.narrator-cloud.slide-in-active {
    transform: translateX(0);
    opacity: 1;
}

/* Colore testo forte dentro la nuvola */
.narrator-cloud strong {
    color: #d4a000;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.5);
}

/* --- STILE AVATAR NERD (Nuovo) --- */
#nerd-avatar {
    flex: 0 0 120px; /* Dimensione fissa per il contenitore del Nerd */
    display: flex;
    
    flex-direction: column; 
    
    justify-content: center;
    align-items: center;
    /* L'opacità iniziale è gestita dalle classi utility sotto */
}

/* Utility per nascondere/mostrare (Resta uguale) */
.hidden-opacity {
    opacity: 0;
    pointer-events: none; /* Impedisce di cliccare cose invisibili */
    transition: opacity 1.5s ease;
}
.visible-opacity {
    opacity: 1;
    pointer-events: auto;
}

/* --- SCENE 2 SPECIFIC: DATA & ANALYSIS LAYOUT --- */

/* Container for Chart + Text side by side */
.data-display-row {
    display: flex;
    flex-wrap: wrap; /* Wraps on mobile */
    gap: 20px;
    margin: 30px 0;
    width: 100%;
    align-items: stretch;
}

/* 1. CHART WRAPPER */
.chart-wrapper {
    flex: 2; /* Takes up 2/3 of space */
    border: 1px solid var(--terminal-green);
    background: rgba(0, 10, 0, 0.6);
    padding: 10px;
    min-height: 400px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1)
}

.static-chart-img {
    width: 100%;        /* Occupa tutta la larghezza del box */
    height: auto;       /* Mantiene le proporzioni originali */
    display: block;
    margin-top: 15px;   /* Spazio sotto l'header verde */
    border: 1px solid #003300;
    filter: drop-shadow(0 0 5px rgba(0, 255, 65, 0.2)); /* Effetto glow leggero */
}

.chart-header {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #000;
    color: var(--terminal-green);
    padding: 0 10px;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    border: 1px solid var(--terminal-green);
}

.plotly-chart {
    width: 100%;
    height: 100%;
    min-height: 380px;
}

/* 2. ANALYSIS PANEL (Narrator Tech Style) */

.narrator-bubble-box {
    /* Layout e Spaziatura */
    flex: 1;
    padding: 30px;
    margin: 10px;
    
    /* Stile Visuale */
    background-color: #e0e0e0; /* Grigio chiaro */
    color: #111111; /* Testo quasi nero */
    border-radius: 40px; /* Bordi molto arrotondati */
    border: 3px solid #FFFF00; /* Bordo Giallo Neon */
    
    /* Effetto Glow Esterno */
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.6); 
    
    /* Font */
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
    line-height: 1.6;
    
    /* Posizionamento */
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* ANIMAZIONE INIZIALE (Nascosto) */
    opacity: 0; 
    transform: translateY(20px);
    transition: all 0.8s ease;
}

/* --- QUESTA È LA CLASSE CHE MANCAVA --- */
.narrator-bubble-box.visible {
    opacity: 1 !important;
    transform: translateY(0);
}
/* -------------------------------------- */

/* Classe per le parole evidenziate in Oro/Arancio */
.gold-highlight {
    color: #DAA520; 
    font-weight: bold;
    text-shadow: 0px 0px 1px rgba(0,0,0,0.2);
}

.panel-label {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #FFFF00;
    margin-bottom: 15px;
    opacity: 0.7;
    letter-spacing: 1px;
}

.tech-readout-text {
    font-family: 'Roboto', sans-serif; /* Clean font for objective truth */
    color: #e0e0e0;
    font-size: 1.1rem;
    line-height: 1.5;
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.tech-readout-text strong {
    color: #FFFF00;
    font-weight: 700;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .data-display-row {
        flex-direction: column;
    }
    .chart-wrapper, .analysis-panel {
        flex: 1;
        width: 100%;
    }
}


.chart-iframe {
    width: 100%;
    height: 100%;       
    border: none;
    display: block;
    overflow: hidden; /* Evita le barre di scorrimento doppie */
}

/* --- USER DIALOGUE (RIGHT SIDE) --- */
.speech-row.user-right {
    text-align: left;
}

/* Stile box specifico per l'User (Ciano/Blue Neon) */
.terminal-box.cyan-style {
    flex: 1;
    border: 1px solid #00e5ff; 
    
    /* MODIFICA QUI: Sfondo più scuro e più coprente */
    background-color: rgba(0, 5, 15, 0.95); 
    
    padding: 20px;
    color: #e0f7fa;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    position: relative;
}

.terminal-box.cyan-style .cursor {
    color: #00e5ff;
}

/* --- TERMINAL TABLE STYLE --- */
.table-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    
    /* MODIFICA QUI: Da rgba(0,0,0,0.3) a quasi nero solido */
    background-color: rgba(0, 5, 0, 0.95); 
    
    /* Opzionale: Aggiungi un bordo per definirla meglio */
    border: 1px solid var(--terminal-green);
}

.terminal-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #fff;
}

.terminal-table th {
    border-bottom: 2px solid var(--terminal-green);
    text-align: left;
    padding: 10px;
    color: var(--terminal-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.terminal-table td {
    border-bottom: 1px dashed #333;
    padding: 8px 10px;
}

.terminal-table tr:hover td {
    background-color: rgba(0, 255, 65, 0.1);
    color: #fff;
}

.terminal-table .rank-col { color: #888; width: 50px; }
.terminal-table .num-col { text-align: right; color: #DAA520; font-weight: bold; }
/* --- AGGIUNTA PER TABELLA DOPPIA COLONNA --- */
.terminal-table .sep-col {
    width: 30px; /* Spazio tra le due colonne */
    border-bottom: none !important; /* Rimuove la riga tratteggiata nel mezzo */
}

/* SCENE */
.step {
    min-height: 100vh;
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px dashed #333;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    
    /* MODIFICA QUI: Alziamo l'opacità di base da 0.3 a 0.5 o 0.6 per renderlo più leggibile */
    opacity: 0.4; 
    
    /* MODIFICA QUI: Transizione fluida */
    transition: opacity 0.8s ease-in-out;
    
    color: var(--terminal-green);
}

.step.active-scene { 
    opacity: 1 !important; /* Forza la visibilità totale */
}
.narrative-text { border-left: 3px solid var(--neon-orange); padding-left: 15px; color: #ccc; font-family: 'Roboto', sans-serif; }
.chart-container { width: 100%; min-height: 500px; background: #111; border: 1px dashed #444; margin: 20px 0; }

/* --- SCENE 8: LAB MODE & STAT CARDS --- */

/* Sfondo Laboratorio Tecnico */
.lab-mode-bg {
    position: relative;
    
    /* --- FIX START --- */
    /* We remove the specific black background and grid so the global layers show through */
    background: transparent; 
    /* --- FIX END --- */
    
    /* OPTIONAL: If you still want the faint Cyan Grid to overlay the binary code, 
       uncomment the lines below. Otherwise, leave them removed to match other scenes exactly. */
    
    /* background-image: 
        linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px; 
    */
}

/* Contenitore delle Stat Cards */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    flex-wrap: wrap;
}

/* Design della singola Stat Card */
.stat-card {
    background: rgba(0, 20, 20, 0.9);
    border: 2px solid #00e5ff; /* Ciano Lab */
    padding: 20px;
    width: 300px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'VT323', monospace;
}

.stat-title {
    color: #00e5ff;
    font-size: 1.4rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    width: 100%;
}

.stat-value {
    color: #fff;
    font-size: 3.5rem; /* Numero grande */
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.stat-desc {
    color: #aaa;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* --- STILE REFERENCES (Uguale a Boring Mode) --- */

#reference-layer {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    
    height: 100vh; 
    
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;

    padding: 50px 20px 150px 20px;
    
    overflow-y: auto; 
}

.reference-item p {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #000;
    /* Hanging indent per stile accademico */
    padding-left: 30px;
    text-indent: -30px;
}

/* GLITCH EFFECT */
.glitch-active { animation: glitch-anim 0.3s infinite; filter: invert(1); }
@keyframes glitch-anim {
  0% { transform: translate(0) }
  20% { transform: translate(-3px, 3px) }
  40% { transform: translate(-3px, -3px) }
  60% { transform: translate(3px, 3px) }
  80% { transform: translate(3px, -3px) }
  100% { transform: translate(0) }
}

#answer-42-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85); /* Darkens the background */
    z-index: 100;
    pointer-events: none; /* Let clicks pass through if needed */
    backdrop-filter: blur(2px);
}

.huge-42 {
    font-size: 12rem;
    font-family: 'VT323', monospace;
    color: #fff;
    line-height: 1;
    margin: 0;
    /* Glitchy Text Shadow */
    text-shadow: 
        5px 5px 0px var(--neon-orange), 
        -5px -5px 0px var(--terminal-green);
    animation: shake-42 0.5s infinite;
}

.sub-42 {
    font-family: 'Courier New', Courier, monospace;
    color: var(--terminal-green);
    font-size: 1.5rem;
    margin-top: 10px;
    letter-spacing: 5px;
}

@keyframes shake-42 {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* --- SIDE NAVIGATION --- */
#story-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%); /* Centers it vertically */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Spacing between dots */
    z-index: 10000; /* Ensure it stays on top of everything */
}

.nav-dot {
    width: 12px;
    height: 12px;
    background-color: transparent;
    border: 2px solid var(--terminal-green); /* Green Outline */
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

/* Hover State & Active State */
.nav-dot:hover, 
.nav-dot.active {
    background-color: var(--terminal-green); /* Fill it green */
    box-shadow: 0 0 10px var(--terminal-green); /* Glow effect */
    transform: scale(1.3);
}

/* The Label (Hidden by default, shown on hover) */
.nav-dot::after {
    content: attr(data-label); /* Grabs the text from HTML */
    position: absolute;
    right: 25px; /* Position to the left of the dot */
    top: 50%;
    transform: translateY(-50%);
    
    font-family: 'VT323', monospace;
    color: var(--terminal-green);
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    white-space: nowrap;
    opacity: 0; /* Invisible */
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-right: 1px solid var(--terminal-green);
}

/* Show label on hover */
.nav-dot:hover::after {
    opacity: 1;
}

body.review-mode .step {
    opacity: 1 !important; /* Rende tutte le scene luminose */
    transition: none !important;
}

/* Forza la visibilità di tutti gli elementi nascosti */
body.review-mode .hidden-opacity {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Forza l'apertura delle nuvolette del narratore */
body.review-mode .narrator-cloud {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Forza l'apertura dei box di analisi scientifica */
body.review-mode .narrator-bubble-box {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Nascondiamo il cursore lampeggiante perché il testo è tutto scritto */
body.review-mode .cursor {
    display: none !important;
}

/* Prevent website CSS from breaking the Treemap labels */
#s4-data-table .chart-wrapper iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}

/* Ensure Plotly text isn't shrunk by global font settings */
#s4-data-table text {
    font-family: inherit !important;
    letter-spacing: normal !important;
}
