/* --- ESTILOS GENERALES --- */
body {
    background-color: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
}

/* --- EFECTO LÁMPARA DE LAVA --- */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #0a0a0a;
    filter: blur(12px) contrast(30); 
    z-index: 0;
}

/* EXCEPCIÓN PARA FORMULA STUDENT (Estelas nítidas) */
#canvas-container.no-filter {
    filter: none !important;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: radial-gradient(circle at center, transparent 20%, #0a0a0a 90%);
}

.hero-content {
    position: relative;
    z-index: 10;
    mix-blend-mode: normal; 
}

/* --- ANIMACIONES SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay escalonado para elementos grid */
.reveal.delay-100 { transition-delay: 100ms; }
.reveal.delay-200 { transition-delay: 200ms; }
.reveal.delay-300 { transition-delay: 300ms; }

/* --- UTILIDADES VISUALES --- */
.text-outline {
    -webkit-text-stroke: 1px #ffffff; 
    color: transparent;
}

/* --- ESTILOS DE TARJETAS PRO --- */
.glass-panel {
    background: #111; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease;
    overflow: hidden; 
    position: relative;
    /* CORRECCIÓN: Evita bordes pixelados/rajados durante la animación */
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Hover effects */
.project-card:hover, .achievement-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    z-index: 20;
}

/* --- TIMELINE DECORATIVA (Formula Student) --- */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.5), transparent);
    transform: translateX(-50%);
    z-index: 0;
}

/* --- LOGICA DE IMAGEN Y GIF (CAPAS) --- */
.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #000; 
}

.project-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.5s ease, transform 0.7s ease;
    opacity: 1;
    z-index: 1;
    
    /* CORRECCIÓN CRUCIAL: Mantiene el Pixel Art nítido y evita borrosidad */
    image-rendering: pixelated; 
    /* Fix para evitar parpadeos en transformaciones */
    backface-visibility: hidden;
}

.project-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45%; 
    object-fit: contain; 
    object-position: center;
    background-color: #000; 
    opacity: 0; 
    transition: opacity 0.5s ease;
    z-index: 2; 
    /* También aplicamos pixelated por si acaso */
    image-rendering: pixelated;
}

/* CLASE ESPECIAL PARA VIDEOS DE VFX (Alta Calidad) */
.vfx-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto !important; /* Reset pixelated for smooth video */
}

/* --- INTERACCIÓN HOVER --- */
.project-card:hover .project-img {
    opacity: 0; 
    transform: scale(1.05); 
}

.project-card:hover .project-gif {
    opacity: 1;
}

/* --- DESCRIPCIÓN OVERLAY --- */
.project-desc-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140%;
    
    transform: translateY(102%); 
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(212, 175, 55, 0.2); 
    
    padding: 1.5rem;
    z-index: 30;
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    
    overflow-y: auto; 
}

.project-card:hover .project-desc-overlay {
    transform: translateY(0);
}

.card-content-initial {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    transition: opacity 0.3s ease;
    pointer-events: none; 
}

.project-card:hover .card-content-initial {
    opacity: 0; 
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #D4AF37; }