/* --- RESET Y VARIABLES GLOBALES --- */
:root {
    --primary-red: #D90429;
    --dark-bg: #0D0D0D;
    --light-text: #F5F5F5;
    --grey-text: #8D99AE;
    --section-padding: 7rem 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Gestionado por JS para máxima compatibilidad */
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    overflow-x: hidden;
}

/* --- ESTILOS GENERALES Y DE UTILIDAD --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: var(--section-padding);
    position: relative;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    color: var(--light-text);
    letter-spacing: -1px;
}

h2 {
    font-size: clamp(3rem, 10vw, 6rem);
    line-height: 1;
    margin-bottom: 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
    font-size: clamp(2.5rem, 8vw, 4rem);
}

.meta-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: var(--grey-text);
    font-weight: 700;
}

/* --- ANIMACIONES DE SCROLL --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ENCABEZADO Y NAVEGACIÓN --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    padding: 1.5rem 2rem;
    transition: background-color 0.4s ease;
}

header.scrolled {
    background-color: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    height: 45px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1%;
}
.logo:hover img {
    transform: scale(1.1);
}
.logo.active img {
    transform: scale(1.1);
    //box-shadow: 0 0 15px 2px var(--primary-red);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav a {
    color: var(--grey-text);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    padding-bottom: 5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: width 0.4s ease;
}

nav a:hover {
    color: var(--light-text);
}

nav a.active {
    color: var(--light-text);
}

nav a.active::after {
    width: 100%;
}

.menu-icon { display: none; }

/* --- SECCIÓN HERO --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('../imgs/colage3.png') no-repeat center center/cover;
}

.hero-content {
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(4rem, 15vw, 9rem);
    line-height: 0.9;
    color: var(--light-text);
}

.hero-content .highlight {
    color: var(--primary-red);
}

.hero-content p {
    max-width: 550px;
    font-size: 1.1rem;
    margin-top: 2rem;
    line-height: 1.6;
    color: var(--grey-text);
}

.hero-buttons {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    border: 2px solid var(--primary-red);
    cursor: pointer;
}

.btn-main {
    background-color: var(--primary-red);
    color: var(--light-text);
}
.btn-main:hover {
    background-color: transparent;
    color: var(--primary-red);
    transform: translateY(-3px);
}

.btn-outline {
    background-color: transparent;
    color: var(--light-text);
}
.btn-outline:hover {
    background-color: var(--primary-red);
    color: var(--light-text);
    transform: translateY(-3px);
}

/* --- ESTILOS PARA LA SECCIÓN HERO (REDISENO CON VIDEO DE FONDO) --- */

#hero {
    height: 100vh; /* Ocupa el 100% de la altura de la pantalla */
    width: 100%;
    position: relative; /* Contexto para posicionar elementos hijos */
    display: flex; /* Para centrar el contenido */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Asegura que nada se desborde */
    padding: 0; /* Eliminamos el padding anterior */
}

/* Capa de superposición oscura y con desenfoque */
#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 13, 13, 0.5); /* Color oscuro semitransparente */
    backdrop-filter: blur(3px); /* El efecto de desenfoque */
    -webkit-backdrop-filter: blur(3px); /* Para compatibilidad con Safari */
    z-index: 1; /* Se coloca sobre el video pero debajo del contenido */
}

/* Estilos para el video de fondo */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centrado perfecto */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0; /* Detrás de todo */
    
    /* La propiedad clave: asegura que el video cubra todo el espacio sin deformarse */
    object-fit: cover; 
}

/* Contenedor del contenido (botones) */
#hero .hero-content {
    position: relative; /* Para asegurar que se renderice correctamente */
    z-index: 2; /* Se coloca por encima de la capa de superposición */
    text-align: center;
}

/* Estilos para los botones (sin cambios mayores) */
#hero .hero-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

/* Ajuste para los botones en móviles */
@media (max-width: 768px) {
    #hero .hero-buttons {
        flex-direction: column;
        align-items: center; /* Asegura que se centren al apilarse */
    }
}




/* --- SECCIÓN NOSOTROS --- */
#nosotros {
    background-color: var(--dark-bg);
}
.nosotros-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 5rem;
    align-items: center;
}
.nosotros-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 10px;
}
.nosotros-points .point {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 2rem;
}
.nosotros-points .point:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.point-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}
.point-header span {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-red);
}
.point-header h3 {
    font-size: 2rem;
}
.point p, .point ul {
    color: var(--grey-text);
    line-height: 1.7;
}
.point ul {
    list-style: none;
    padding-left: 0;
}
.point ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.point ul li::before {
    content: '■';
    position: absolute;
    left: 0;
    color: var(--primary-red);
    font-size: 1rem;
}

/* --- SECCIÓN IMPACTO --- */
#impacto {
    background-color: #1a1a1a;
}
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
}
.impact-item svg {
    width: 50px;
    height: 50px;
    fill: var(--primary-red);
    margin-bottom: 1rem;
}
.impact-item .number {
    font-family: 'Anton', sans-serif;
    font-size: 4rem;
    color: var(--light-text);
}
.impact-item p {
    color: var(--grey-text);
    font-weight: 700;
}

/* --- SECCIÓN TALENTO --- */
#talento {
    background-color: var(--primary-red);
}
#talento .section-header h2, #talento .meta-text {
    color: var(--dark-bg);
}
#talento .section-header {
    border-bottom-color: rgba(0,0,0,0.3);
}
.talent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.talent-card {
    background-color: var(--dark-bg);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease;
}
.talent-card:hover {
    transform: scale(1.05);
}
.talent-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: top;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
}
.talent-card:hover img {
    filter: grayscale(0%);
}
.talent-card p {
    padding: 1.5rem 1rem;
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: var(--light-text);
}

/* --- ESTILOS PARA LA SECCIÓN DE PORTAFOLIO (REDISENO 2x2 Y TÍTULO VISIBLE) --- */

/* La cuadrícula que contiene los items */
#portafolio .portfolio-grid {
    display: grid;
    /* CAMBIO: Usamos repeat(2, 1fr) para forzar una cuadrícula de 2 columnas. */
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Contenedor principal de cada item del portafolio */
#portafolio .portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#portafolio .portfolio-item:hover {
    transform: translateY(-5px);
}

/* La imagen dentro del item */
#portafolio .portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease-in-out;
}

#portafolio .portfolio-item:hover img {
    transform: scale(1.05);
}

/* La superposición con la información */
#portafolio .portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    color: var(--light-text);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    
    /* CAMBIO: Eliminamos el transform y la opacidad para que sea visible por defecto. */
    /* La transición ahora afectará a los elementos internos. */
    transition: all 0.4s ease-in-out;
}

/* Estilos para el título (siempre visible) */
#portafolio .portfolio-info h3 {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: #FFFFFF;
    margin: 0; /* Ajustamos el margen ya que el párrafo está oculto */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* NUEVO: Ocultamos el párrafo de descripción por defecto */
#portafolio .portfolio-info p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    
    /* Propiedades para ocultarlo con animación */
    opacity: 0;
    max-height: 0; /* Colapsa su altura */
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}

/* NUEVO: Mostramos el párrafo al pasar el cursor sobre el item */
#portafolio .portfolio-item:hover .portfolio-info p {
    opacity: 1;
    max-height: 5em; /* Le damos altura suficiente para que se muestre */
    margin-top: 0.25rem; /* Añadimos un pequeño espacio sobre él */
}

/* NUEVO: Hacemos la cuadrícula de una sola columna en móviles para mejor legibilidad */
@media (max-width: 768px) {
    #portafolio .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* --- MODAL DE VIDEO --- */
.video-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.video-modal.active { opacity: 1; visibility: visible; }
.modal-content { position: relative; width: 90%; max-width: 900px; padding-top: 56.25%; }
.modal-content video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.close-modal { position: absolute; top: 20px; right: 30px; font-size: 2.5rem; color: var(--light-text); cursor: pointer; }

/* --- SECCIÓN CLIENTES (MARQUEE) --- */
#clientes {
    padding: 4rem 0;
    background-color: #1a1a1a;
}
.client-marquee {
    width: 100%;
    overflow: hidden;
    display: flex;
}
.client-track {
    display: flex;
    animation: marquee 40s linear infinite;
}
.client-logo {
    flex-shrink: 0;
    width: 200px;
    text-align: center;
    margin: 0 2rem;
}
.client-logo img {
    max-width: 120px;
    max-height: 40px;
    filter: grayscale(100%) brightness(1.5);
    opacity: 0.8;
    transition: all 0.3s ease;
}
.client-logo img:hover {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: scale(1.1);
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --- FOOTER Y CONTACTO --- */
footer {
    padding: var(--section-padding);
    text-align: center;
}
.contact-content h2 {
    font-size: clamp(3rem, 12vw, 8rem);
    line-height: 1;
}
.contact-content .highlight {
    color: var(--primary-red);
}
.contact-email {
    display: inline-block;
    margin: 2rem 0 3rem 0;
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--light-text);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-red);
    transition: color 0.3s ease;
}
.contact-email:hover {
    color: var(--primary-red);
}
.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.social-icons a { margin: 0 1rem; }
.social-icons svg { 
    height: 30px; 
    width: 30px;
    fill: var(--grey-text);
    transition: fill 0.3s ease, transform 0.3s ease;
}
.social-icons a:hover svg { 
    fill: var(--light-text);
    transform: scale(1.2);
}
.copyright {
    margin-top: 5rem;
    color: var(--grey-text);
    font-size: 0.9rem;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .nosotros-container { grid-template-columns: 1fr; }
    .nosotros-image { height: 400px; margin-bottom: 3rem; }
    .portfolio-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    section { padding: 5rem 0; }
    .container { padding: 0 1rem; }
    .hero-buttons { flex-direction: column; align-items: flex-start; }
    
    nav ul {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh;
        background-color: var(--dark-bg); flex-direction: column;
        justify-content: center; align-items: center; gap: 2.5rem;
        transition: right 0.5s ease-in-out;
    }
    nav ul.active { right: 0; }
    .menu-icon {
        display: block; z-index: 1001; cursor: pointer;
        position: relative; width: 25px; height: 20px;
    }
    .menu-icon .bar {
        width: 100%; height: 3px; background-color: var(--light-text);
        position: absolute; left: 0; transition: all 0.3s ease;
    }
    .bar1 { top: 0; }
    .bar2 { top: 50%; transform: translateY(-50%); }
    .bar3 { bottom: 0; }
    .menu-icon.active .bar1 { top: 50%; transform: translateY(-50%) rotate(45deg); }
    .menu-icon.active .bar2 { opacity: 0; }
    .menu-icon.active .bar3 { bottom: 50%; transform: translateY(50%) rotate(-45deg); }
}


/* --- ESTILOS ADICIONALES PARA LA SECCIÓN DE TALENTO (VERSIÓN MEJORADA) --- */

/* Contenedor del botón "Ver más" */
.ver-mas-container {
    text-align: center;
    margin-top: 3rem;
}

/* NUEVO: Grid para los talentos cargados (3 columnas en web) */
.talent-grid-full {
    display: grid;
    /* En pantallas grandes, crea columnas de mínimo 350px. Esto resultará en 3 columnas en la mayoría de los casos. */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* MODIFICADO: Estilos para la tarjeta de talento detallada */
.talent-card-full {
    background-color: var(--dark-bg);
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    /* Ya no necesita ocupar toda la fila, se adaptará al grid padre */
}

.talent-card-full img {
    width: 100%;
    height: 300px; /* Altura ajustada para mejor proporción en columnas */
    object-fit: cover;
    object-position: top;
}

.talent-card-full .talent-card-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Asegura que el contenedor de info crezca para alinear los botones si las descripciones varían */
}

.talent-card-full .talent-card-info h3 {
    font-family: 'Anton', sans-serif;
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.talent-card-full .talent-card-info .talent-desc {
    color: var(--grey-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Permite que la descripción ocupe el espacio disponible */
}

.talent-card-full .talent-card-info .talent-activities-title {
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.talent-card-full .talent-card-info ul {
    list-style: none;
    padding-left: 0;
    color: var(--grey-text);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* --- ESTILOS PARA LAS ACTIVIDADES COMO TAGS --- */

/* Ajustamos el contenedor UL para que el espaciado (gap) sea ideal para los tags */
.talent-card-full .talent-card-info ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    /* Un gap uniforme se ve mejor para los tags */
    gap: 0.5rem; 
}

/* Estilo principal para cada tag (el LI) */
.talent-card-full .talent-card-info ul li {
    /* Eliminamos el padding-left y la posición relativa que ya no se necesitan */
    
    background-color: var(--primary-red); /* Fondo rojo como se solicitó */
    color: var(--light-text); /* Texto claro para un buen contraste */
    
    /* Padding interno para dar espacio al texto dentro del tag */
    padding: 0.3em 0.8em; 
    
    border-radius: 5px; /* Bordes redondeados para el look de "tag" */
    
    font-size: 0.85rem; /* Un tamaño ligeramente más pequeño suele verse mejor para los tags */
    font-weight: 500; /* Hacemos el texto un poco más grueso */
    line-height: 1.4;
    text-transform: capitalize; /* Opcional: Pone en mayúscula la primera letra de cada tag */
}

/* Título para la sección de Speakers (ahora se inyecta en el nuevo grid) */
.speakers-section-title {
    grid-column: 1 / -1; /* Ocupa todo el ancho del grid */
    text-align: center;
    margin: 3rem 0 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 3rem;
}

.speakers-section-title h3 {
    font-size: 2.5rem;
    color: var(--light-text);
}

/* Estilos para las tarjetas de teaser iniciales (sin cambios) */
.talent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.talent-card .talent-card-info {
    padding: 1.5rem 1rem;
    text-align: center;
}
.talent-card .talent-card-info h3 {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: var(--light-text);
    margin: 0;
}

/* --- ESTILOS PARA EL EFECTO FLIP CARD DE TALENTOS INICIALES --- */

/* El contenedor principal de la tarjeta necesita perspectiva para el efecto 3D. */
.talent-card {
    perspective: 1000px;
    background-color: transparent; /* El fondo lo tendrán las caras internas */
    cursor: pointer;
    height: 430px; /* <--- CORRECCIÓN: Se añade una altura fija a la tarjeta. */
                     /* Ajústala si es necesario para tu diseño. */
}

/* Este contenedor interno es el que realmente girará. */
.talent-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s;
    transform-style: preserve-3d;
}

/* Cuando se añade la clase .is-flipped, el contenedor interno gira. */
.talent-card-inner.is-flipped {
    transform: rotateY(180deg);
}

/* Las caras frontal y trasera se posicionan absolutamente dentro del contenedor. */
.talent-card-front,
.talent-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Para Safari */
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    display: flex; /* Usamos flex para centrar contenido más fácil */
    flex-direction: column;
}

/* La cara frontal contiene la imagen y el nombre. */
.talent-card-front {
    background-color: var(--dark-bg);
}

/* --- ESTILOS PARA EL CONTENIDO DE LA CARA FRONTAL --- */
/* Asegúrate de que tu HTML para la cara frontal tenga esta estructura */
.talent-card-front img {
    width: 100%;
    height: 320px; /* Altura de la imagen */
    object-fit: cover;
    object-position: top;
}
.talent-card-front .talent-card-info {
    padding: 1.5rem 1rem;
    text-align: center;
    flex-grow: 1; /* Ocupa el espacio restante */
    display: flex;
    align-items: center;
    justify-content: center;
}
.talent-card-front .talent-card-info h3 {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: var(--light-text);
    margin: 0;
}


/* La cara trasera, inicialmente oculta, contendrá los detalles. */
.talent-card-back {
    background-color: #1a1a1a;
    color: var(--light-text);
    transform: rotateY(180deg); /* La giramos de antemano. */
    padding: 1.5rem;
    justify-content: center;
}

.talent-card-back h3 {
    font-family: 'Anton', sans-serif;
    color: var(--primary-red);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.talent-card-back .talent-desc-back {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--grey-text);
    text-align: center;
    margin-bottom: 1rem;
}

.talent-card-back .talent-activities-title-back {
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

.talent-card-back ul {
    list-style: none;
    padding: 0;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--grey-text);
}