/* Colors & Variables */
:root {
    --bg-dark: #0f0f1b;
    --bg-darker: #080811;
    --neon-blue: #00f3ff;
    --neon-purple: #b026ff;
    --neon-green: #39ff14;
    --text-main: #e0e0f0;
    --text-muted: #8b8bad;
    
    --font-heading: 'VT323', monospace;
    --font-body: 'Inter', sans-serif;
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Prevent layout shifting from overlay scrollbars */
    overflow-y: scroll; 
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Accessibility Focus Outline */
:focus-visible {
    outline: 2px dashed var(--neon-blue);
    outline-offset: 4px;
}

.pixel-text {
    font-family: var(--font-heading);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: normal;
}

/* --- New: Subtle heading CRT flicker --- */
.flicker-text {
    animation: textFlicker 4s infinite;
}

@keyframes textFlicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.8;
        text-shadow: none;
    }
}

/* --- New: Scanline Overlay Toggle --- */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px;
    opacity: 0; /* Off by default */
    transition: opacity 0.3s ease;
}

.scanlines.active {
    opacity: 1;
}

/* UI Toggles container */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Switch Toggle (CRT) */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    width: 36px;
    height: 20px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    border: 1px solid var(--neon-purple);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-main);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background-color: rgba(176, 38, 255, 0.3);
}

.toggle-switch input:focus-visible + .slider {
    outline: 2px dashed var(--neon-blue);
    outline-offset: 2px;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(16px);
    background-color: var(--neon-purple);
    box-shadow: 0 0 5px var(--neon-purple);
}

.toggle-label {
    font-family: var(--font-heading);
    color: var(--neon-purple);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Animated Starfield Background */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90px 40px, #aeb6ff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: drift 100s linear infinite;
    opacity: 0.25;
    will-change: background-position;
}

@keyframes drift {
    0% { background-position: 0 0; }
    100% { background-position: -200px -200px; }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: rgba(8, 8, 17, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    z-index: 100;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--neon-blue);
    text-decoration: none;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent; 
}

.nav-link:hover {
    color: var(--neon-purple);
}

.nav-link.active {
    color: var(--neon-green);
    border-bottom: 2px solid var(--neon-green);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--neon-blue);
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Layout */
main {
    padding-top: 80px; 
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    min-height: 80vh;
    padding: 6rem 2rem 4rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Progress Bar Row */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 3rem;
    color: var(--neon-blue);
    margin-bottom: 0;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.progress-container {
    width: 200px;
    text-align: right;
}

.progress-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--neon-green);
    display: block;
    margin-bottom: 5px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(57, 255, 20, 0.3);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    transition: width 0.5s ease-out;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-primary {
    background: transparent;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.btn-primary:hover, .btn-primary:focus-visible {
    background: var(--neon-blue);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--neon-purple);
    border: 2px solid var(--neon-purple);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
    background: var(--neon-purple);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.6);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
}

.btn-outline {
    background: transparent;
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.btn-outline:hover, .btn-outline:focus-visible {
    background: rgba(57, 255, 20, 0.1);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

/* Complete Level Button */
.btn-complete {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-complete:hover, .btn-complete:focus-visible {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-complete.completed-state {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Search and Filters */
.docs-filters {
    margin-bottom: 1.5rem;
}

.retro-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
    transition: border-color 0.3s;
}

.retro-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

.docs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover, .tag-btn:focus-visible {
    border-color: var(--neon-blue);
    color: var(--text-main);
}

.tag-btn[aria-pressed="true"] {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

/* Hero Section */
.hero {
    text-align: center;
    align-items: center;
}

.hero h1 {
    font-size: 5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0px var(--neon-purple), -2px -2px 0px var(--neon-blue);
}

.hero .subtitle {
    font-size: 1.3rem;
    color: var(--neon-blue);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero .description {
    max-width: 600px;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Docs Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    background: rgba(15, 15, 27, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2.5rem;
}

.docs-sidebar ul {
    list-style: none;
}

.docs-sidebar li {
    padding: 1rem 1.2rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filter hidden state */
.docs-sidebar li.hidden {
    display: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    display: inline-block;
}

.docs-sidebar li.completed .status-dot {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 5px var(--neon-green);
}

.docs-sidebar li:hover, .docs-sidebar li:focus-visible {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.2);
}

.docs-sidebar li.active {
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
    background: rgba(0, 243, 255, 0.05);
}

/* Doc Content Areas */
.docs-content {
    min-height: 400px;
}

.doc-pane {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.doc-pane h3 {
    font-size: 2.2rem;
    color: var(--text-main);
}

.doc-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.doc-pane h4 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--neon-purple); /* Changed from blue to differ from headings */
    font-size: 1.2rem;
}

.doc-pane ul {
    margin-left: 1.5rem;
    color: var(--text-muted);
}

.doc-pane li {
    margin-bottom: 0.5rem;
}

/* Code Blocks Terminal Setup */
.retro-terminal {
    background: #0a0a0f;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 4px 25px rgba(0,0,0,0.4);
    position: relative;
}

.terminal-header {
    background: #1a1a24;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.term-title {
    margin-left: 1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #888;
}

.copy-btn {
    margin-left: auto;
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    border-radius: 4px;
    transition: all 0.2s;
}

.copy-btn:hover, .copy-btn:focus-visible {
    background: var(--neon-blue);
    color: var(--bg-dark);
}

.copy-btn.copied {
    background: var(--neon-green);
    color: var(--bg-dark);
    border-color: var(--neon-green);
}

.retro-terminal pre {
    padding: 1.5rem;
    overflow-x: auto;
}

.retro-terminal code {
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    color: var(--neon-green);
    text-shadow: 0 0 2px rgba(57, 255, 20, 0.4);
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 8px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    outline: none;
    display: flex;
    flex-direction: column;
}

.blog-card:hover, .blog-card:focus-within {
    transform: translateY(-5px);
    border-color: var(--neon-purple);
}

.card-meta {
    font-family: var(--font-heading);
    color: var(--neon-purple);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.blog-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.blog-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* push button to bottom */
}

/* About Section */
.about-card {
    background: rgba(0, 243, 255, 0.05);
    border-left: 4px solid var(--neon-blue);
    padding: 2.5rem;
    border-radius: 0 8px 8px 0;
    max-width: 800px;
}

.about-card p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

/* Blog Modal (Enhanced) */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.blog-modal-layout {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-content {
    background: var(--bg-darker);
    border: 2px solid var(--neon-purple);
    padding: 3rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 0 35px rgba(176, 38, 255, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-body-content {
    overflow-y: auto;
    padding-right: 1rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.modal-body-content p {
    margin-bottom: 1rem;
}

.modal-controls {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}

.close-modal {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 2.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    background: transparent;
    border: none;
}

.close-modal:hover, .close-modal:focus-visible {
    color: var(--text-main);
    outline: none; 
}

#modal-title {
    color: var(--neon-purple);
    font-size: 2.5rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(8, 8, 17, 0.9);
    border: 2px solid var(--neon-purple);
    color: var(--neon-purple);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.2s ease, background 0.2s ease;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover, .back-to-top:focus-visible {
    background: var(--neon-purple);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.6);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar ul {
        display: flex;
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .docs-sidebar li {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .docs-sidebar li.active {
        border-left-color: transparent;
        border-bottom-color: var(--neon-blue);
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero h1 { font-size: 3.5rem; }
    
    /* Hamburger Menu Overrides */
    .mobile-menu-toggle { display: flex; }
    
    .nav-controls { gap: 1rem; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(8, 8, 17, 0.98);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    
    .nav-links.open {
        max-height: 350px;
        border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    }
    
    .nav-link {
        padding: 1rem 5%;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        display: block;
        width: 100%;
    }

    .nav-link.active {
        background: rgba(0, 243, 255, 0.05);
        border-left: 4px solid var(--neon-green);
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding-left: calc(5% - 4px);
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}




/* --- ESTIL/* --- ESTILOS CSS COMPLETOS Y CORREGIDOS CON SPRINT Y DINOSAURIO --- */
        
body {
    background-color: #111;
    margin: 0;
    padding: 0;
    overflow: hidden; 
}

.marketing-arcade-scene {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* --- PÓCIMA PIXEL ART ESTÁTICA --- */
.pixel-potion {
    width: 4px;  
    height: 4px; 
    background: transparent;
    position: fixed; 
    z-index: 999; 
    top: calc(45% + 15px); 
    right: 50px; 
    opacity: 1; 
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.7)); 
    animation: consumePotion 9s linear forwards;
    box-shadow:
        0px 0px #8b4513, 4px 0px #8b4513,
        -4px 4px #aaa, 0px 4px #ccc, 4px 4px #ccc, 8px 4px #aaa,
        -8px 8px #0ff, -4px 8px #0ff, 0px 8px #0ff, 4px 8px #0ff, 8px 8px #0ff, 12px 8px #0ff,
        -8px 12px #0ff, -4px 12px #0ff, 0px 12px #0ff, 4px 12px #0ff, 8px 12px #0ff, 12px 12px #0ff,
        -4px 16px #aaa, 0px 16px #aaa, 4px 16px #aaa, 8px 16px #aaa;
}

/* --- LOADER CHARACTER (Contenedor Móvil) --- */
.loader-character {
    position: fixed;
    top: 45%; 
    z-index: 1000;
    pointer-events: none; 
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8)); 
    animation: chaseSequence 9s linear forwards;
    opacity: 1;
}

/* --- EINSTEIN --- */
.pixel-einstein-detailed {
    width: 4px;  
    height: 4px; 
    background: transparent;
    position: absolute; 
    top: 0;
    
    /* Vinculamos la nueva animación "einsteinTransformation" */
    animation: moveEinstein 9s linear forwards, einsteinTransformation 9s linear forwards;
    
    /* El dibujo base (antes de la animación) será el Vagón */
    box-shadow:
        16px 4px #fff, 20px 4px #fff, 24px 4px #fff, 28px 4px #fff,
        8px 8px #fff, 12px 8px #fff, 16px 8px #fff, 20px 8px #fff, 24px 8px #fff, 28px 8px #fff, 32px 8px #fff,
        0px 12px #fff, 4px 12px #fff, 8px 12px #fff, 12px 12px #fff, 16px 12px #fff, 20px 12px #fff, 24px 12px #fcdcb4, 28px 12px #fcdcb4, 32px 12px #fcdcb4,
        4px 16px #fff, 8px 16px #fff, 12px 16px #fff, 16px 16px #fcdcb4, 20px 16px #fcdcb4, 
        24px 16px #000, 28px 16px #fcdcb4, 32px 16px #fcdcb4,
        4px 20px #fff, 8px 20px #fff, 12px 20px #fff, 16px 20px #fcdcb4, 
        20px 20px #fff, 24px 20px #fff, 28px 20px #fff, 32px 20px #fff, 36px 20px #fff,
        12px 24px #8b4513, 16px 24px #8b4513, 20px 24px #8b4513, 24px 24px #8b4513, 28px 24px #8b4513,
        12px 28px #8b4513, 16px 28px #8b4513, 20px 28px #8b4513, 24px 28px #8b4513, 
        28px 28px #fcdcb4, 32px 28px #aaa, 36px 28px #aaa, 
        12px 32px #8b4513, 16px 32px #8b4513, 20px 32px #8b4513, 24px 32px #8b4513, 40px 32px #aaa, 
        4px 36px #ff003c, 8px 36px #ff003c, 12px 36px #ff003c, 16px 36px #ff003c, 20px 36px #ff003c, 24px 36px #ff003c, 28px 36px #ff003c, 32px 36px #ff003c, 36px 36px #ff003c, 40px 36px #ff003c, 44px 36px #ff003c,
        8px 40px #ff003c, 12px 40px #ff003c, 16px 40px #ff003c, 20px 40px #ff003c, 24px 40px #ff003c, 28px 40px #ff003c, 32px 40px #ff003c, 36px 40px #ff003c, 40px 40px #ff003c,
        12px 44px #000, 16px 44px #000, 28px 44px #000, 32px 44px #000,
        12px 48px #000, 16px 48px #000, 28px 48px #000, 32px 48px #000;
}

/* --- PAC-MAN --- */
.pixel-pacman {
    width: 4px;  
    height: 4px;
    background: transparent;
    position: absolute; 
    top: 10px;         
    animation: movePacman 9s linear forwards, chomp 0.4s infinite;
}


/* ========================================= */
/* --- KEYFRAMES (LA MAGIA DE LA ESCENA) --- */
/* ========================================= */

@keyframes consumePotion {
    0%, 40% { opacity: 1; } 
    45%, 100% { opacity: 0; } 
}

/* --- LA GRAN TRANSFORMACIÓN: Vagón a Dinosaurio --- */
@keyframes einsteinTransformation {
    /* 0% -> 44%: Pelo blanco + Vagón Rojo (Huyendo) */
    0%, 44% {
        box-shadow: 
        16px 4px #fff, 20px 4px #fff, 24px 4px #fff, 28px 4px #fff,
        8px 8px #fff, 12px 8px #fff, 16px 8px #fff, 20px 8px #fff, 24px 8px #fff, 28px 8px #fff, 32px 8px #fff,
        0px 12px #fff, 4px 12px #fff, 8px 12px #fff, 12px 12px #fff, 16px 12px #fff, 20px 12px #fff, 24px 12px #fcdcb4, 28px 12px #fcdcb4, 32px 12px #fcdcb4,
        4px 16px #fff, 8px 16px #fff, 12px 16px #fff, 16px 16px #fcdcb4, 20px 16px #fcdcb4, 
        24px 16px #000, 28px 16px #fcdcb4, 32px 16px #fcdcb4,
        4px 20px #fff, 8px 20px #fff, 12px 20px #fff, 16px 20px #fcdcb4, 
        20px 20px #fff, 24px 20px #fff, 28px 20px #fff, 32px 20px #fff, 36px 20px #fff,
        12px 24px #8b4513, 16px 24px #8b4513, 20px 24px #8b4513, 24px 24px #8b4513, 28px 24px #8b4513,
        12px 28px #8b4513, 16px 28px #8b4513, 20px 28px #8b4513, 24px 28px #8b4513, 
        28px 28px #fcdcb4, 32px 28px #aaa, 36px 28px #aaa, 
        12px 32px #8b4513, 16px 32px #8b4513, 20px 32px #8b4513, 24px 32px #8b4513, 40px 32px #aaa, 
        4px 36px #ff003c, 8px 36px #ff003c, 12px 36px #ff003c, 16px 36px #ff003c, 20px 36px #ff003c, 24px 36px #ff003c, 28px 36px #ff003c, 32px 36px #ff003c, 36px 36px #ff003c, 40px 36px #ff003c, 44px 36px #ff003c,
        8px 40px #ff003c, 12px 40px #ff003c, 16px 40px #ff003c, 20px 40px #ff003c, 24px 40px #ff003c, 28px 40px #ff003c, 32px 40px #ff003c, 36px 40px #ff003c, 40px 40px #ff003c,
        12px 44px #000, 16px 44px #000, 28px 44px #000, 32px 44px #000,
        12px 48px #000, 16px 48px #000, 28px 48px #000, 32px 48px #000;
    }
    
    /* 45% -> 100%: ¡Toma la pócima! Pelo Amarillo + Dinosaurio Verde (Persiguiendo) */
    45%, 100% {
        box-shadow: 
        /* --- PELO AMARILLO --- */
        16px 4px #ff0, 20px 4px #ff0, 24px 4px #ff0, 28px 4px #ff0,
        8px 8px #ff0, 12px 8px #ff0, 16px 8px #ff0, 20px 8px #ff0, 24px 8px #ff0, 28px 8px #ff0, 32px 8px #ff0,
        0px 12px #ff0, 4px 12px #ff0, 8px 12px #ff0, 12px 12px #ff0, 16px 12px #ff0, 20px 12px #ff0, 24px 12px #fcdcb4, 28px 12px #fcdcb4, 32px 12px #fcdcb4,
        /* --- CARA Y OJO --- */
        4px 16px #ff0, 8px 16px #ff0, 12px 16px #ff0, 16px 16px #fcdcb4, 20px 16px #fcdcb4, 
        24px 16px #000, 28px 16px #fcdcb4, 32px 16px #fcdcb4,
        /* --- BIGOTE --- */
        4px 20px #fff, 8px 20px #fff, 12px 20px #fff, 16px 20px #fcdcb4, 
        20px 20px #fff, 24px 20px #fff, 28px 20px #fff, 32px 20px #fff, 36px 20px #fff,
        
        /* --- CABEZA DEL DINOSAURIO (Verde con ojo blanco/negro) --- */
        44px 20px #28a745, 48px 20px #28a745, 52px 20px #28a745,
        12px 24px #8b4513, 16px 24px #8b4513, 20px 24px #8b4513, 24px 24px #8b4513, 28px 24px #8b4513,
        40px 24px #28a745, 44px 24px #28a745, 48px 24px #fff, 52px 24px #000, 56px 24px #28a745,
        
        /* --- ABRIGO MARRÓN, MANO Y HOCICO DEL DINOSAURIO --- */
        12px 28px #8b4513, 16px 28px #8b4513, 20px 28px #8b4513, 24px 28px #8b4513, 
        28px 28px #fcdcb4, /* Mano de Einstein sosteniendo las riendas */
        36px 28px #28a745, 40px 28px #28a745, 44px 28px #28a745, 48px 28px #28a745, 52px 28px #28a745, 56px 28px #28a745, 60px 28px #28a745,
        
        /* --- CUELLO DEL DINOSAURIO Y BASE DEL ABRIGO --- */
        12px 32px #8b4513, 16px 32px #8b4513, 20px 32px #8b4513, 24px 32px #8b4513, 
        32px 32px #28a745, 36px 32px #28a745, 40px 32px #28a745, 44px 32px #28a745, 48px 32px #ff0, 52px 32px #ff0, 56px 32px #28a745,
        
        /* --- SILLA DE MONTAR ROJA Y CUERPO VERDE --- */
        0px 36px #28a745, 4px 36px #28a745, 8px 36px #28a745, 12px 36px #28a745, 16px 36px #c00, 20px 36px #c00, 24px 36px #c00, 28px 36px #28a745, 32px 36px #28a745, 36px 36px #28a745, 40px 36px #28a745, 44px 36px #28a745, 48px 36px #28a745, 52px 36px #28a745,
        
        /* --- BARRIGA AMARILLA Y COLA --- */
        0px 40px #28a745, 4px 40px #28a745, 8px 40px #28a745, 12px 40px #ff0, 16px 40px #ff0, 20px 40px #ff0, 24px 40px #ff0, 28px 40px #28a745, 32px 40px #28a745, 36px 40px #28a745,
        
        /* --- PIERNAS DEL DINOSAURIO --- */
        12px 44px #28a745, 16px 44px #28a745, 28px 44px #28a745, 32px 44px #28a745,
        
        /* --- BOTITAS ROJAS --- */
        16px 48px #d9534f, 20px 48px #d9534f, 32px 48px #d9534f, 36px 48px #d9534f;
    }
}

@keyframes chaseSequence {
    0% { left: -150px; transform: scaleX(1); opacity: 0; }
    5% { opacity: 1; }
    40% { left: calc(100vw - 120px); transform: scaleX(1); }
    45%, 50% { left: calc(100vw - 120px); transform: scaleX(1); }
    51%, 54% { left: 100vw; transform: scaleX(-1); }
    55% { left: 100vw; transform: scaleX(-1); }
    95% { opacity: 1; }
    100% { left: -150px; transform: scaleX(-1); opacity: 0; }
}

@keyframes moveEinstein {
    0%, 50% { left: 0px; }
    51%, 100% { left: -80px; }
}

/* El acelerón rápido de Pac-Man se mantiene */
@keyframes movePacman {
    0%, 10% { left: -450px; }
    40%, 50% { left: -35px; } 
    51%, 100% { left: 0px; }
}

@keyframes chomp {
    0%, 49% {
        box-shadow: 12px 0px #ff0, 16px 0px #ff0, 20px 0px #ff0, 8px 4px #ff0, 12px 4px #ff0, 16px 4px #ff0, 20px 4px #ff0, 24px 4px #ff0, 4px 8px #ff0, 8px 8px #ff0, 12px 8px #000, 16px 8px #ff0, 20px 8px #ff0, 24px 8px #ff0, 28px 8px #ff0, 4px 12px #ff0, 8px 12px #ff0, 12px 12px #ff0, 16px 12px #ff0, 20px 12px #ff0, 0px 16px #ff0, 4px 16px #ff0, 8px 16px #ff0, 12px 16px #ff0, 4px 20px #ff0, 8px 20px #ff0, 12px 20px #ff0, 16px 20px #ff0, 20px 20px #ff0, 4px 24px #ff0, 8px 24px #ff0, 12px 24px #ff0, 16px 24px #ff0, 20px 24px #ff0, 24px 24px #ff0, 28px 24px #ff0, 8px 28px #ff0, 12px 28px #ff0, 16px 28px #ff0, 20px 28px #ff0, 24px 28px #ff0, 12px 32px #ff0, 16px 32px #ff0, 20px 32px #ff0;
    }
    50%, 100% {
        box-shadow: 12px 0px #ff0, 16px 0px #ff0, 20px 0px #ff0, 8px 4px #ff0, 12px 4px #ff0, 16px 4px #ff0, 20px 4px #ff0, 24px 4px #ff0, 4px 8px #ff0, 8px 8px #ff0, 12px 8px #000, 16px 8px #ff0, 20px 8px #ff0, 24px 8px #ff0, 28px 8px #ff0, 4px 12px #ff0, 8px 12px #ff0, 12px 12px #ff0, 16px 12px #ff0, 20px 12px #ff0, 24px 12px #ff0, 28px 12px #ff0, 0px 16px #ff0, 4px 16px #ff0, 8px 16px #ff0, 12px 16px #ff0, 16px 16px #ff0, 20px 16px #ff0, 24px 16px #ff0, 28px 16px #ff0, 4px 20px #ff0, 8px 20px #ff0, 12px 20px #ff0, 16px 20px #ff0, 20px 20px #ff0, 24px 20px #ff0, 28px 20px #ff0, 4px 24px #ff0, 8px 24px #ff0, 12px 24px #ff0, 16px 24px #ff0, 20px 24px #ff0, 24px 24px #ff0, 28px 24px #ff0, 8px 28px #ff0, 12px 28px #ff0, 16px 28px #ff0, 20px 28px #ff0, 24px 28px #ff0, 12px 32px #ff0, 16px 32px #ff0, 20px 32px #ff0;
    }
}

/* Phase 2: Content Upgrades & Fixes */

/* Badges for Editorial Plan */
.badge-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 2px;
    background: rgba(0, 255, 204, 0.1);
    font-family: 'VT323', monospace;
    text-transform: uppercase;
}

.badge-world {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    background: rgba(176, 38, 255, 0.1);
}

.badge-diff {
    border-color: #f39c12;
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.badge-time {
    border-color: var(--text-muted);
    color: var(--text-muted);
    background: rgba(170, 170, 170, 0.1);
}

/* Global Search Overlay */
#global-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 8, 17, 0.95);
    z-index: 9999; /* Ensure top level */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    backdrop-filter: blur(10px);
}

#global-search-overlay.hidden {
    display: none;
}

.search-overlay-content {
    background: var(--bg-dark);
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 20px var(--neon-purple);
    width: 600px;
    max-width: 90%;
    padding: 2rem;
    position: relative;
    border-radius: 4px;
}

.search-overlay-content h2 {
    color: var(--neon-cyan);
    margin-bottom: 1rem;
    text-align: center;
}

#global-search-input {
    width: 100%;
    padding: 1rem;
    background: #111;
    border: 1px solid var(--neon-cyan);
    color: var(--text-light);
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#global-search-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.search-results-list {
    list-style: none;
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
}

.search-results-list li {
    padding: 1rem;
    border-bottom: 1px dashed var(--text-muted);
    cursor: pointer;
}

.search-results-list li:hover {
    background: rgba(0, 255, 204, 0.1);
}

.search-results-list li h4 {
    margin: 0;
    color: var(--neon-cyan);
    font-size: 1.2rem;
}

.search-results-list li p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Ensure Arcade Scene Overlay Doesn't Block Clicks */
.marketing-arcade-scene {
    pointer-events: none;
    z-index: 10;
}

/* Prefers Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
    #starfield, 
    .starfield-layer {
        animation: none !important;
    }
    
    .scanlines {
        animation: none !important;
        opacity: 0.1; /* Static mild scanline */
    }
    
    .flicker-text {
        animation: none !important;
    }
    
    .pixel-potion {
        animation: none !important;
    }
}