html, body {
    margin: 0; 
    padding: 0; 
    width: 100%; 
    height: 100vh;
    background-color: #fdfdfd;
    background-image: 
        linear-gradient(#e5e5e5 1px, transparent 1px),
        linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
    background-size: 30px 30px;
    color: #333;
    font-family: 'Kalam', cursive;
    overflow: hidden;
}

.showcase-wrapper {
    display: flex; 
    width: 800vw; 
    height: 100vh;
    overflow-x: scroll; 
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.showcase-wrapper::-webkit-scrollbar { display: none; }

section {
    width: 100vw; 
    height: 100vh; /* Ajustado a 100vh para que la pantalla mande */
    flex-shrink: 0;
    scroll-snap-align: start; 
    display: flex;
    align-items: flex-start; /* Evita que el contenido se corte arriba */
    justify-content: center;
    padding-top: 90px; 
    padding-bottom: 80px;
    overflow-y: auto; /* El scroll vertical ahora es natural en la sección */
    scrollbar-width: none;
}
section::-webkit-scrollbar { display: none; }

.content-scroll {
    width: 100%;
    max-width: 1140px; /* Fija el ancho máximo estándar de Bootstrap */
    margin: 0 auto; /* Centra el contenedor en pantallas grandes */
    padding: 15px 30px;
    display: flex; 
    flex-direction: column;
    justify-content: flex-start;
}
/* ==========================================================================
   DARK MODE (MODO OSCURO GLOBAL)
   ========================================================================== */

/* Transición suave para el cambio de tema */
body, header, .note-card, .formula-box, .css-graphic-box, .header-btn, .control-btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Fondo y Texto Base */
body.dark-mode {
    background-color: #121212;
    background-image: 
        linear-gradient(#222 1px, transparent 1px),
        linear-gradient(90deg, #222 1px, transparent 1px);
    color: #e2e8f0;
}

body.dark-mode p, body.dark-mode li { color: #cbd5e1; }
body.dark-mode strong { color: #fff; }

/* 2. Encabezado (Header) y Botones */
body.dark-mode header.rainbow-header {
    background: rgba(18, 18, 18, 0.98);
    border-bottom-color: #333;
}

/* Magia CSS: Reemplazo del logo a la versión clara/negativa */
body.dark-mode header.rainbow-header img {
    content: url("../images/logo/logo-dark 2.png");
}

body.dark-mode .header-btn {
    background: #1e1e1e;
    color: #e2e8f0;
    border-color: #555;
    box-shadow: 2px 2px 0px #000;
}
body.dark-mode .header-btn:hover {
    box-shadow: 4px 4px 0px #000;
    color: #fff;
    background: #2a2a2a;
}
body.dark-mode .header-btn.primary {
    background: #005f92;
    border-color: #003f62;
    color: #fff;
}

/* 3. Tarjetas, Fórmulas y Contenedores */
body.dark-mode .note-card,
body.dark-mode .sc-card,
body.dark-mode .css-graphic-box {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
}

body.dark-mode .formula-box {
    background: #1a1a1a;
    border-color: #444;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}
body.dark-mode .formula-box:hover {
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
    border-color: #555;
}

/* 4. Navegación Inferior y Controles Laterales */
body.dark-mode .nav-item { color: #555; }
body.dark-mode .nav-item.active { color: #fff; }
body.dark-mode .control-btn {
    background: #1e1e1e;
    border-color: #555;
    color: #fff;
    box-shadow: 3px 3px 0px #000;
}
body.dark-mode .control-btn:hover {
    background: #333;
    box-shadow: 4px 4px 0px #000;
}

/* 5. Atajos de Teclado (KBD) */
body.dark-mode .kbd-key {
    background: #2d3748;
    color: #f1f5f9;
    border-color: #475569;
    border-bottom-color: #1e293b;
    box-shadow: inset 1px 1px 0px rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5);
}

/* 6. Adaptación de Gráficos CSS y Referencias visuales */
/* Evita que los documentos falsos o lienzos simulados cieguen al usuario */
body.dark-mode .ui-canvas,
body.dark-mode .tm-box,
body.dark-mode .doc-sheet,
body.dark-mode .biz-card,
body.dark-mode .brand-page,
body.dark-mode .pl-page,
body.dark-mode .am-body,
body.dark-mode .dummy-handle,
body.dark-mode .subtle-reference-wrapper {
    background-color: #222;
    border-color: #444;
}

body.dark-mode .subtle-reference-wrapper:hover {
    background-color: #2a2a2a;
    border-color: #666;
}
body.dark-mode .subtle-reference-img { border-color: #111; }

/* 7. Ribbon (Menú estilo Office en las Prácticas) */
body.dark-mode .ribbon-menu { background: #1e1e1e; border-color: #444; }
body.dark-mode .ribbon-tab { background: #2a2a2a; border-color: #444; color: #94a3b8; }
body.dark-mode .ribbon-tab.active, 
body.dark-mode .ribbon-tab span.active { background: #1e1e1e; color: #fff; }
body.dark-mode .ribbon-tools { background: #1e1e1e; }
body.dark-mode .ribbon-btn { color: #cbd5e1; border-color: #555; }
/* ==========================================================================
   TIPOGRAFÍA Y PALETA DE COLORES UTILITY
   ========================================================================== */
h2, h4, p, li, span { font-family: 'Kalam', cursive; }
h2 { font-weight: 700; font-size: 37px; line-height: 1.1; margin-bottom: 15px; }
h4 { font-weight: 700; font-size: 24px; margin-bottom: 10px; line-height: 1.2; display: flex; align-items: center; gap: 12px;}

/* FUENTE DE DESCRIPCIONES AUMENTADA A 20PX */
p, li { font-size: 20px; line-height: 1.4; color: #444; margin-bottom: 12px; }
strong { font-weight: 700; color: #111; }

.t-rojo { color: #e63946; } 
.t-azul { color: #0077b6; }
.t-naranja { color: #fca311; } 
.t-purpura { color: #7209b7; }
.t-verde { color: #217346; } 
.t-cyan { color: #00b4d8; }
.t-magenta { color: #d946ef; } 
.t-lima { color: #84cc16; }

/* ==========================================================================
   COMPONENTES UI (TARJETAS, CAJAS Y ATAJOS)
   ========================================================================== */
.note-card { 
    padding: 30px 35px; 
    box-shadow: 8px 8px 0px rgba(0,0,0,0.05);
    border: 2px solid #02b4d8; 
    position: relative; 
    z-index: 2; 
    margin-bottom: 20px; 
    border-radius: 12px;
}

.tape-top {
    position: absolute; 
    top: -15px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 120px; 
    height: 30px; 
    opacity: 0.8; 
    z-index: 5;
}

.formula-box {
    background: #fdfdfd; 
    border: 2px dashed #bbb; 
    padding: 20px; 
    border-radius: 12px;
    margin-bottom: 15px; 
    transition: 0.3s; 
    box-shadow: 4px 4px 0px rgba(0,0,0,0.02);
}
.formula-box:hover { 
    transform: translate(-2px, -2px); 
    box-shadow: 6px 6px 0px rgba(0,0,0,0.05); 
    border-style: solid; 
}

.title-icon { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 10px; 
}

/* Comandos 3D */
.kbd-key {
    display: inline-block; 
    padding: 3px 12px;
    font-family: -apple-system, system-ui, sans-serif;
    font-weight: 900; 
    color: #222; 
    background: #f4f4f5; 
    border: 2px solid #cbd5e1; 
    border-bottom: 4px solid #94a3b8; 
    border-radius: 8px;
    margin: 0 4px; 
    font-size: 15px; 
    transform: translateY(-2px);
    box-shadow: inset 1px 1px 0px rgba(255,255,255,1), 0 2px 0 rgba(0,0,0,0.1);
}

.shortcuts-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
    width: 100%; 
    padding-bottom: 20px;
}
.sc-card { 
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-left: 6px solid #d946ef; 
    padding: 15px 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* ==========================================================================
   NAVEGACIÓN (HEADER, SLIDERS Y BOTTOM NAV)
   ========================================================================== */
header.rainbow-header {
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    background: rgba(255,255,255,0.98);
    border-bottom: 2px dashed #ccc;
}

.header-btn {
    font-family: 'Kalam', cursive;
    font-weight: 700; font-size: 16px;
    border: 2px solid #333; background: #fff; color: #333;
    padding: 5px 15px; border-radius: 8px; text-decoration: none;
    box-shadow: 2px 2px 0px #333; transition: 0.2s;
    white-space: nowrap;
}
.header-btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0px #333; color: #000; }
.header-btn.primary { background: #0077b6; color: #fff; border-color: #005f92; }

.bottom-nav { position: fixed; bottom: 20px; left: 5%; z-index: 100; display: flex; gap: 15px; flex-wrap: wrap; max-width: 80%;}
.nav-item { font-size: 14px; font-weight: 700; text-transform: uppercase; color: #aaa; cursor: pointer; font-family: -apple-system, sans-serif;}
.nav-item.active { color: #000; border-bottom: 3px solid #00b4d8; padding-bottom: 2px;}

.slide-controls { position: fixed; bottom: 20px; right: 5%; z-index: 100; display: flex; gap: 15px;}
.control-btn { background: #fff; border: 2px solid #333; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 3px 3px 0px #333; transition: 0.2s;}

/* ==========================================================================
   CONTENEDORES DE SIMULADORES CSS (ESTÁNDAR)
   ========================================================================== */
.css-graphic-box {
    background: #ff121200; padding: 25px; border: 3px solid #333; border-radius: 12px;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.05); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sketch-caption {
    position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center;
    font-weight: 900; font-size: 12px; color: #aaa; text-transform: uppercase;
    font-family: sans-serif; letter-spacing: 2px;
}


/* ==========================================================================
   MEDIA QUERIES (ADAPTACIÓN MÓVIL)
   ========================================================================== */
@media (max-width: 768px) { 
    .bottom-nav { display: none; } 
    .shortcuts-grid { grid-template-columns: 1fr; } 
    
    /* ADAPTACIÓN DEL ENCABEZADO */
    header.rainbow-header .container {
        flex-direction: column !important; /* Apila logo y botones */
        gap: 12px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
    
    /* Envuelve los botones si no caben */
    header.rainbow-header .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Reduce el título para que no rompa la pantalla */
    header.rainbow-header span {
        font-size: 18px !important; 
        text-align: center;
    }
    
    /* Ajusta botones para dedos/móvil */
    .header-btn {
        font-size: 13px;
        padding: 6px 10px;
    }

    /* ADAPTACIÓN DE LAS SECCIONES Y CONTENIDO */
    section {
        padding-top: 150px; /* Compensa el nuevo alto del header apilado */
    }
    .content-scroll {
        padding: 5px 15px; /* Menos márgenes laterales en móvil */
    }

    /* ADAPTACIÓN DE GRÁFICOS GRANDES */
    .bauhaus-grid, .vr-container {
        flex-direction: column;
        gap: 20px;
    }
}