/* --- VARIABLES --- */
:root {
    --bg: #ffffff;
    --text: #111111;
    --accent: #0000FF; /* Azul RENDER */
    --neon: #00ffd5;   /* Turquesa Neón */
    --gray: #999;
}

/* --- SELECCIÓN NEÓN --- */
::selection { background: var(--neon); color: #000; }
::-moz-selection { background: var(--neon); color: #000; }

/* --- BASES --- */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Space Mono', monospace;
    margin: 0; padding: 0;
    line-height: 1.6; 
    overflow-x: hidden;
    min-height: 100vh;      
    display: flex;          
    flex-direction: column; 
}

/* --- MARQUESINA INFINITA --- */
.marquee-container {
    background: var(--text); color: var(--bg);
    overflow: hidden; white-space: nowrap;
    padding: 8px 0;
    font-family: 'Space Mono', monospace; font-size: 0.8rem;
    text-transform: uppercase; border-bottom: 2px solid var(--accent);
}
.marquee-content {
    display: inline-block;
    /* Animación lenta y lineal para bucle infinito */
    animation: marquee 60s linear infinite; 
}
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50%, 0); } /* Se mueve hasta la mitad del texto duplicado */
}

/* --- HEADER --- */
header {
    padding: 1rem 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 2px solid var(--text); 
    position: relative !important; /* Fix: Scrollea con la página */
    top: 0;
    background: rgba(255,255,255,0.98); 
    z-index: 100; 
    backdrop-filter: blur(5px);
}
.logo {
    font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 1.8rem;
    letter-spacing: -1px; cursor: pointer; user-select: none; flex-shrink: 0;
    margin-right: 15px;
}
.blink { animation: blinker 1s linear infinite; color: var(--accent); }
@keyframes blinker { 50% { opacity: 0; } }

/* --- NAV (CORRECCIÓN MÓVIL: SCROLL HORIZONTAL) --- */
nav {
    display: flex; 
    align-items: center; 
    overflow-x: auto; /* Permite deslizar si no entra */
    white-space: nowrap;
    padding-bottom: 5px; 
    
    /* Ocultar barra de scroll pero mantener funcionalidad */
    scrollbar-width: none; 
    -ms-overflow-style: none;
    
    flex-grow: 1; 
    justify-content: flex-end;
    
    /* Scroll suave en iOS */
    -webkit-overflow-scrolling: touch; 
}
nav::-webkit-scrollbar { display: none; }

/* Ajuste móvil: alineado a la izquierda para invitar a deslizar */
@media (max-width: 768px) {
    nav { justify-content: flex-start; padding-left: 10px; }
    header { padding: 1rem 15px; } 
}

nav button {
    background: none; border: none; font-family: 'Space Mono', monospace;
    font-weight: 700; font-size: 0.85rem; margin-left: 1.5rem; cursor: pointer;
    text-transform: uppercase; color: var(--gray); transition: all 0.3s;
    flex-shrink: 0; /* Evita que los botones se aplasten */
}
nav button:hover, nav button.active { color: var(--accent); text-decoration: underline; }

/* --- LAYOUT --- */
.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 40px 20px;
    flex: 1;      
    width: 100%;  
    box-sizing: border-box;
}

/* --- HERO --- */
.hero { margin-bottom: 60px; border-bottom: 1px solid #eee; padding-bottom: 40px; }
.hero-link { 
    text-decoration: none; color: inherit; display: grid; 
    grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; 
}
.hero-img { 
    width: 100%; filter: grayscale(100%); transition: all 0.5s; 
    border: 1px solid #000; box-shadow: 6px 6px 0 var(--accent); 
}
.hero-link:hover .hero-img { 
    filter: grayscale(0%); transform: translate(-3px, -3px); 
    box-shadow: 10px 10px 0 var(--accent); 
}
.hero-title { 
    font-family: 'Archivo', sans-serif; font-size: 3rem; 
    line-height: 0.95; margin: 10px 0; text-transform: uppercase; 
}

/* --- GRID --- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px 40px; }
.card { text-decoration: none; color: var(--text); display: block; cursor: pointer; }
.card-img-container {
    width: 100%; height: 220px; overflow: hidden; margin-bottom: 15px; border: 1px solid #ddd;
}
.card-img {
    width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%);
    transition: transform 0.5s, filter 0.5s;
}
.card:hover .card-img { filter: grayscale(0%); transform: scale(1.05); }
.card:hover .card-title { color: var(--accent); }
.card-meta { 
    font-size: 0.7rem; color: var(--accent); font-weight: 700; 
    margin-bottom: 5px; display: block; letter-spacing: 1px;
}
.card-title { 
    font-family: 'Archivo', sans-serif; font-size: 1.5rem; margin: 0 0 10px 0; 
    line-height: 1.1; text-transform: uppercase; 
}
.card-bajada { font-size: 0.85rem; color: #555; line-height: 1.5; margin: 0; }

/* --- GRÁFICOS (CONTENEDOR SEGURO) --- */
.graphic-wrapper {
    margin: 40px -20px; background: #fdfdfd; 
    border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; position: relative;
    overflow: visible !important; /* Permite ver tooltips o textos que sobresalgan */
}

.graphic-scroll {
    width: 100%; overflow-x: auto; overflow-y: hidden; text-align: center;
    -webkit-overflow-scrolling: touch;
}
.ai2html { margin: 0 auto; position: relative; }

/* --- EQUIPO --- */
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 40px 30px; margin-top: 30px;
}
.team-card { text-align: center; background: transparent; transition: transform 0.3s ease; }
.team-card:hover { transform: translateY(-5px); }
.team-img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(100%);
    border: 1px solid var(--text); transition: all 0.3s ease;
}
.team-card:hover .team-img { filter: grayscale(0%); box-shadow: 6px 6px 0 var(--accent); }
.team-name {
    font-family: 'Archivo', sans-serif; font-size: 0.95rem; margin: 12px 0 5px 0;
    text-transform: uppercase; line-height: 1.1;
}
.team-role {
    font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--gray);
    text-transform: uppercase; margin-bottom: 8px;
}
.team-link {
    display: inline-block; font-family: 'Space Mono', monospace; font-size: 0.65rem;
    color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent); font-weight: 700;
}
.team-link:hover { background: var(--accent); color: white; }

/* --- ABOUT & MODAL --- */
.about-overlay, .custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(5px);
    z-index: 2000; display: none; justify-content: center; align-items: center; flex-direction: column;
    padding: 15px; opacity: 0; transition: opacity 0.3s ease;
}
.custom-modal-overlay { background: rgba(0, 0, 0, 0.4); z-index: 15000; backdrop-filter: blur(2px); }
.about-overlay.active, .custom-modal-overlay.active { display: flex; opacity: 1; }

.about-content {
    max-width: 500px; width: 90%; text-align: center; border: 2px solid var(--text);
    padding: 30px; background: #fff; box-shadow: 15px 15px 0 var(--accent);
    position: relative; max-height: 85vh; overflow-y: auto;
}
.custom-modal-box {
    background: #fff; border: 2px solid var(--accent); box-shadow: 8px 8px 0 var(--text);
    padding: 30px; max-width: 400px; width: 85%; text-align: center;
}
.about-title { font-family: 'Archivo', sans-serif; font-size: 2.2rem; margin: 0 0 15px 0; line-height: 1; text-transform: uppercase; }
.about-text { font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; }
.custom-modal-title { font-family: 'Archivo', sans-serif; font-size: 1.2rem; color: var(--accent); margin-bottom: 15px; text-transform: uppercase; }
.custom-modal-text { font-family: 'Space Mono', monospace; font-size: 0.9rem; color: var(--text); margin-bottom: 25px; }

.donation-section { margin: 15px 0; padding: 15px; background: #f4f4f4; border: 1px solid var(--text); text-align: left; }
.donate-btn {
    display: block; background: var(--accent); color: #fff; text-decoration: none; padding: 10px 15px;
    font-family: 'Space Mono', monospace; font-weight: 700; text-transform: uppercase; margin-top: 10px;
    border: 2px solid var(--accent); transition: all 0.3s; text-align: center; font-size: 0.9rem;
}
.donate-btn:hover { background: transparent; color: var(--accent); }
.close-btn {
    background: var(--text); color: #fff; border: none; padding: 10px 30px;
    font-family: 'Space Mono', monospace; font-weight: 700; cursor: pointer;
    text-transform: uppercase; font-size: 0.9rem; transition: all 0.2s; margin-top: 10px;
}
.close-btn:hover { background: var(--accent); }

/* --- FOOTER --- */
footer {
    margin-top: 60px; padding: 30px 5%; border-top: 2px solid var(--text);
    display: flex; justify-content: space-between; font-size: 0.75rem; background: #f9f9f9;
}
@media (max-width: 768px) {
    .hero-link { grid-template-columns: 1fr; gap: 20px; }
    .grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-title { font-size: 2.2rem; }
    .container { padding: 20px 15px; }
    .team-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    footer { flex-direction: column; gap: 10px; text-align: center; }
}