@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    scrollbar-width: thin;
    scrollbar-color: #8C2041 #FEFBF2;
}

/* Personalización del Scrollbar General (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #FEFBF2;
    border-left: 1px solid rgba(140, 32, 65, 0.08);
}

::-webkit-scrollbar-thumb {
    background: #8C2041;
    border-radius: 5px;
    border: 2px solid #FEFBF2;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B1831;
}

/* ================================= */
/* GLOBAL Y RETÍCULA ARQUITECTÓNICA  */
/* ================================= */
body {
    font-family: 'Rubik', sans-serif;
    background-color: #FEFBF2;
    background-image: 
        linear-gradient(rgba(140, 32, 65, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 32, 65, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    color: #6B1831;
    line-height: 1.6;
}

/* ================================= */
/* HERO (PORTADA EDITORIAL)          */
/* ================================= */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden; 
}

.hero-container-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 5;
    pointer-events: none;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(140,32,65,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140,32,65,.08) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0;
    transform-origin: center center;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 5;
    width: 45%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    pointer-events: auto;
}

.hero h1.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(9rem, 11.5vw, 14.5rem);
    line-height: 0.85;
    letter-spacing: 0.02em;
    font-weight: normal;
    margin-bottom: 30px;
    color: #8C2041;
    text-align: left;
}

.hero-subtitle {
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em; 
    text-align: left;
    line-height: 1.8;
    color: #6B1831;
    margin-bottom: 40px;   
    max-width: 38rem;
    margin-left: 0;
    margin-right: 0;
}

.hero-btn {
    display: inline-block;
    padding: 18px 45px;
    background: transparent;
    color: #8C2041;
    border: 1px solid #8C2041;
    border-radius: 0px; 
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: 'Rubik', sans-serif;
    text-transform: uppercase;
}

.hero-btn:hover {
    transform: translateY(-4px);
    background-color: #8C2041;
    color: #FEFBF2;
    box-shadow: 0 15px 25px rgba(140, 32, 65, 0.15); 
}

#contenedor-torre-3d {
    position: absolute;
    top: 0;
    left: 58%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    pointer-events: none; /* No obstruye clics en elementos inferiores del Hero */
}

/* ================================= */
/* ESTRUCTURA INTERNA DE SECCIONES   */
/* ================================= */
.seccion-juego, .galeria, .contenedor-principal {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; 
}

.seccion-juego {
    display: flex;         
    align-items: center;   
    justify-content: space-between; 
    gap: 80px;          
}

.seccion-juego.inversa {
    flex-direction: row-reverse;
}

.bloque-informacion { flex: 1; text-align: left; }
.bloque-imagen { flex: 1; display: flex; justify-content: center; }

.bloque-imagen img {
    max-width: 100%;       
    height: auto;
    border-radius: 0px; 
    box-shadow: 15px 15px 0px rgba(140, 32, 65, 0.05); 
}

.titulo-seccion, .galeria h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px; 
    text-align: left; 
    color: #6B1831;
    letter-spacing: 0.05em; 
    text-transform: uppercase;
    margin-bottom: 25px;
    border-bottom: 2px solid #F5BEBF; 
    padding-bottom: 10px;
    display: inline-block;
}

.cuerpo-texto {
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.8;
    color: #8C2041; 
    text-align: justify; 
}

/* ================================= */
/* GALERÍA                           */
/* ================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 40px; 
}

.grid img {
    width: 100%;
    height: 200px;      
    object-fit: cover;  
    border-radius: 0px; 
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid img:hover { transform: scale(1.05); }

.lightbox {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9);
    justify-content: center; align-items: center; z-index: 999;
}

.lightbox img { max-width: 90%; max-height: 85%; border-radius: 0px; }
.cerrar { position: absolute; top: 20px; right: 40px; color: white; font-size: 3rem; cursor: pointer; }

/* ================================= */
/* CARRUSEL                          */
/* ================================= */
#fotos { scroll-margin-top: 150px; }
.carrusel-container { overflow: hidden; width: 100%; position: relative; }
.carrusel-track { display: flex; transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); }
.carrusel-track img {
    min-width: 33.33%; height: 400px; padding: 10px;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease; 
    cursor: pointer; position: relative; 
    opacity: 0.5;
    transform: scale(0.9);
}
.carrusel-track img:hover { 
    opacity: 0.75; 
}
.carrusel-track img.active {
    opacity: 1;
    transform: scale(1.06);
    z-index: 5;
}
.carrusel-track img.active:hover {
    transform: scale(1.08);
}

.btn-carrusel {
    position: absolute; top: 50%; transform: translateY(-50%); background-color: #FEFBF2;
    color: #8C2041; border: 1px solid #8C2041; width: 50px; height: 50px;
    border-radius: 0px; font-size: 20px; cursor: pointer; z-index: 10;
    display: flex; justify-content: center; align-items: center; transition: all 0.3s ease;
}

.btn-carrusel.prev { left: 40px; }
.btn-carrusel.next { right: 40px; }
.btn-carrusel:hover { background-color: #8C2041; color: #FEFBF2; }

/* Puntos indicadores del carrusel */
.carrusel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    padding: 10px 0;
}
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid #8C2041;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.dot:hover {
    background-color: rgba(140, 32, 65, 0.35);
}
.dot.active {
    background-color: #8C2041;
    transform: scale(1.25);
}

.foto1 { object-fit: contain; object-position: center; background-color: transparent; }
.foto2 { object-fit: contain; background-color: transparent; }
.foto3 { object-fit: contain; padding: 20px; background-color: transparent; }
.foto4 { object-fit: cover; object-position: top; background-color: transparent; }
.foto5 { object-fit: cover; background-color: transparent; }

/* ================================= */
/* MODOS DE JUEGO (TARJETAS)         */
/* ================================= */
.grid-modos { display: flex; gap: 40px; justify-content: space-between; }
.tarjeta-modo {
    background-color: transparent; border-top: 2px solid #8C2041; border-radius: 0px;
    padding: 30px 0; flex: 1; box-shadow: none; transition: transform 0.4s ease;
}
.tarjeta-modo:hover { transform: translateY(-5px); }
.tarjeta-modo h2 { font-family: 'Bebas Neue', sans-serif; color: #8C2041; font-size: 36px; letter-spacing: 0.05em; margin-bottom: 15px; }
.tarjeta-modo p { font-family: 'Rubik', sans-serif; font-size: 17px; color: #6B1831; text-align: justify; line-height: 1.7; }


/* ================================================= */
/* SECCIÓN FUNDAMENTO (DISEÑO EDITORIAL ASIMÉTRICO) */
/* ================================================= */
.seccion-fundamento {
    background-color: #8C2041; 
    padding: 120px 20px; 
    width: 100%; 
    color: #FEFBF2;
}

.seccion-fundamento .contenedor-principal {
    margin-top: 0 !important; 
    margin-bottom: 0 !important;
    max-width: 1200px;
}

/* Encabezado Editorial */
.fundamento-header-editorial {
    margin-bottom: 70px;
    text-align: left;
}

.fundamento-tagline {
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #F5BEBF;
    display: block;
    margin-bottom: 10px;
}

.fundamento-titulo-editorial {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3.5rem, 6.5vw, 6.5rem);
    font-weight: normal;
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: #FEFBF2;
    margin: 0;
}

.fundamento-linea-decorativa {
    width: 80px;
    height: 3px;
    background-color: #D4A257;
    margin-top: 25px;
}

/* Bloque de Entrada / Lead Section (Full width) */
.fundamento-intro-editorial {
    display: block;
    margin-bottom: 80px;
}

.fundamento-lead-text p {
    font-family: 'Rubik', sans-serif;
    font-size: 1.3rem;
    line-height: 1.9;
    color: #FEFBF2;
    text-align: left;
    margin: 0;
    font-weight: 400;
}

.fundamento-visual-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Elemento visual interactivo geométrico */
.fundamento-geometric-visual {
    width: 280px;
    height: 280px;
    border: 1px dashed rgba(254, 251, 242, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: crosshair;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.geometric-inner {
    width: 85%;
    height: 85%;
    border: 1px solid rgba(254, 251, 242, 0.15);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(254, 251, 242, 0.02);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.visual-symbol {
    font-size: 4rem;
    color: #F5BEBF;
    line-height: 1;
    margin-bottom: 12px;
    transition: transform 0.8s ease;
}

.visual-label {
    font-family: 'Rubik', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(254, 251, 242, 0.6);
    text-align: center;
    max-width: 160px;
}

.fundamento-geometric-visual:hover {
    border-color: #D4A257;
    transform: scale(1.05) rotate(15deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.fundamento-geometric-visual:hover .geometric-inner {
    border-color: #F5BEBF;
    background-color: rgba(254, 251, 242, 0.05);
}

.fundamento-geometric-visual:hover .visual-symbol {
    transform: rotate(180deg) scale(1.1);
    color: #FEFBF2;
}

/* Grilla Editorial Asimétrica */
.fundamento-grid-editorial {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

/* Tarjeta Editorial */
.fundamento-card {
    background-color: rgba(254, 251, 242, 0.03);
    border: 1px solid rgba(254, 251, 242, 0.08);
    padding: 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-number {
    position: absolute;
    bottom: -20px;
    right: 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 9rem;
    font-weight: normal;
    color: rgba(254, 251, 242, 0.03);
    line-height: 1;
    z-index: 1;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    color: #D4A257; /* Dorado */
    margin-bottom: 20px;
    font-weight: normal;
}

.card-text {
    font-family: 'Rubik', sans-serif;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(254, 251, 242, 0.85);
    text-align: left;
    margin: 0;
}

/* Tarjeta de Ancho Completo (wide card) */
.card-wide {
    grid-column: span 2;
    background-color: rgba(254, 251, 242, 0.05);
}

/* Hover Effects on Cards */
.fundamento-card:hover {
    transform: translateY(-8px);
    border-color: rgba(254, 251, 242, 0.25);
    background-color: rgba(254, 251, 242, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.fundamento-card:hover .card-number {
    color: rgba(254, 251, 242, 0.08);
    transform: translateY(-10px);
}

/* Ajustes de Grilla Responsiva */
@media(max-width: 900px) {
    .fundamento-intro-editorial {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .fundamento-visual-container {
        order: -1; /* Muestra el círculo geométrico arriba del párrafo de lead */
    }
    .fundamento-grid-editorial {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .card-wide {
        grid-column: span 1;
    }
    .fundamento-card {
        padding: 30px;
    }
    .card-number {
        font-size: 7rem;
        bottom: -10px;
        right: 15px;
    }
}


/* ================================= */
/* PORTAL DE TRANSICIÓN FINAL        */
/* ================================= */
.portal-transicion {
  height: 600vh; 
  background-color: #8C2041; 
  position: relative;
  margin-top: 0; 
  width: 100%;
}

.portal-sticky {
  position: sticky; top: 0; height: 100vh; 
  display: flex; justify-content: center; align-items: center; overflow: hidden;
}

.portal-circulo-wrapper { 
  position: relative; 
  width: min(600px, 85vw); 
  height: min(600px, 85vw); 
}
.portal-svg { width: 100%; height: 100%; overflow: visible !important; }
.portal-svg polygon, .portal-svg path { fill: none; stroke-width: 3.5; stroke-linejoin: round; }
.figura-fondo { stroke: rgba(254, 251, 242, 0.12); }
.figura-progreso { 
  stroke: #FEFBF2; 
  stroke-dasharray: 100; 
  stroke-dashoffset: 100; 
  filter: drop-shadow(0 0 2px #FEFBF2) 
          drop-shadow(0 0 8px rgba(254, 251, 242, 0.9)) 
          drop-shadow(0 0 20px rgba(254, 251, 242, 0.55)); 
}

.portal-enlace {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; align-items: center; text-align: center;
  color: #FEFBF2; font-family: 'Rubik', sans-serif; font-size: 24px;
  letter-spacing: 2px; font-weight: bold; opacity: 0; transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ================================= */
/* MENÚ DE NAVEGACIÓN FLOTANTE       */
/* ================================= */
body.no-scroll {
    overflow: hidden;
}

.franja-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    padding: 0 4vw; display: flex; justify-content: flex-end; align-items: center;
    background: #FEFBF2; backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(140, 32, 65, 0.1); 
    z-index: 1000; opacity: 0; transform: translateY(-20px); transition: all 0.5s ease;
}

.franja-nav.is-visible { opacity: 1; transform: translateY(0); }
.nav-list { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-link {
    text-decoration: none; color: #a89c9f; font-size: 0.85rem;
    font-weight: bold; letter-spacing: 1px; text-transform: uppercase;
    transition: color 0.3s ease; font-family: 'Rubik', sans-serif;
}
.nav-link:hover { color: #8C2041; }
.nav-link.active-nav { color: #8C2041; border-bottom: 2px solid #8C2041; padding-bottom: 5px; }

/* Botón Hamburguesa */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 18px;
    padding: 0;
    z-index: 1005;
}

.hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: #8C2041;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: left center;
}

/* Media query para tabletas (carrusel de 2 imágenes) */
@media (max-width: 1024px) {
    .carrusel-track img {
        min-width: 50%;
        height: 350px;
    }
}

/* ================================= */
/* RESPONSIVE (MÓVILES)              */
/* ================================= */
@media(max-width: 768px) {
    .hero {
        flex-direction: column;
        justify-content: center;
        padding-top: 100px;
        height: auto;
        min-height: 100vh;
    }
    .hero-container-inner {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .hero-content {
        width: 100%;
        align-items: center;
        text-align: center;
        padding-bottom: 0;
    }
    .hero h1.hero-title {
        font-size: clamp(4.5rem, 12vw, 7.5rem);
        text-align: center;
        margin-bottom: 20px;
    }
    .hero p.hero-subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
        text-align: center;
        margin: 0 auto 30px auto;
    }
    #contenedor-torre-3d {
        position: relative;
        left: 0;
        transform: none;
        width: 100%;
        height: 60vh;
        margin-top: 10px;
        pointer-events: auto;
    }
    
    .seccion-juego, .seccion-juego.inversa { flex-direction: column; text-align: center; gap: 40px; }
    .bloque-informacion, .cuerpo-texto, .titulo-seccion { text-align: center; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .grid-modos { flex-direction: column; }

    /* Ajuste del carrusel a 1 imagen por vista */
    .carrusel-track img {
        min-width: 100%;
        height: 300px;
    }

    /* Mostrar botón hamburguesa */
    .nav-toggle {
        display: flex;
    }

    /* Menú lateral desplegable */
    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75vw;
        height: 100vh;
        background-color: #FEFBF2;
        box-shadow: -10px 0 30px rgba(140, 32, 65, 0.15);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 35px;
        transition: right 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 999;
        padding: 20px;
    }

    .nav-list.is-open {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    /* Animación del botón hamburguesa */
    .nav-toggle.is-active .hamburger-bar:nth-child(1) {
        transform: rotate(45deg) translate(2px, -2px);
    }
    .nav-toggle.is-active .hamburger-bar:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    .nav-toggle.is-active .hamburger-bar:nth-child(3) {
        transform: rotate(-45deg) translate(2px, 2px);
    }
}

/* TABLERO DE CONTROL DE SALTOS (SCROLL-MARGIN) */
#que-es { scroll-margin-top: 140px; }
#galeria { scroll-margin-top: 160px; }
#preparacion { scroll-margin-top: 120px; }
#modos { scroll-margin-top: 150px; }
#fundamento { scroll-margin-top: 0; }

/* TABLERO DE MÁRGENES INDIVIDUALES */
#que-es { margin-top: 250px; margin-bottom: 150px; }
#galeria { margin-top: 150px; margin-bottom: 150px; }
#preparacion { margin-top: 150px; margin-bottom: 150px; }
.carrusel-container { margin-top: 150px; margin-bottom: 150px; }
#modos { margin-top: 150px; margin-bottom: 250px; }
.seccion-fundamento { margin-top: 150px; margin-bottom: 0px; }

.hero-title, .hero-subtitle, .hero-btn { position: relative; z-index: 5; }

/* TENSIÓN ESTRUCTURAL (HERO) */
.z-tension { display: inline-block; transform-origin: bottom right; will-change: transform; }
.inestable-tension { display: inline-block; transform-origin: bottom right; will-change: transform; }

/* CONTENEDOR 3D INTERACTIVO GALERÍA */
.item-3d {
    width: 100%; height: 200px; background-color: #FEFBF2; 
    cursor: grab; position: relative; overflow: hidden;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid rgba(140, 32, 65, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.item-3d:hover {
    border-color: rgba(140, 32, 65, 0.35);
    box-shadow: 0 8px 24px rgba(140, 32, 65, 0.08);
}
.item-3d:active { cursor: grabbing; }
.item-3d canvas { display: block; width: 100% !important; height: 100% !important; outline: none; }

/* Indicador de interactividad */
.item-3d::after {
    content: attr(data-info);
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(140, 32, 65, 0.85);
    color: #FEFBF2;
    padding: 5px 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
}
.item-3d:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ================================= */
/* FOOTER DE CRÉDITOS Y DERECHOS     */
/* ================================= */
#creditos {
    scroll-margin-top: 80px;
}

.footer-creditos {
    background-color: #FEFBF2; /* Fondo crema oficial */
    background-image: 
        linear-gradient(rgba(140, 32, 65, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 32, 65, 0.04) 1px, transparent 1px);
    background-size: 20px 20px; /* Grilla delicada */
    padding: 70px 4vw;
    width: 100%;
    color: #6B1831; /* Original dark wine/brown text */
    border-top: 2px solid #8C2041; /* Original wine red top border */
}

.footer-creditos .contenedor-principal {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-simple-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
}

.footer-col-texto {
    flex: 1.3;
}

.footer-texto-simple {
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #6B1831;
    text-align: left;
    margin: 0;
    letter-spacing: 0.02em;
}

.footer-texto-simple strong {
    color: #8C2041; /* Wine red for strong elements */
    font-weight: 700;
}

.footer-texto-simple a {
    color: #8C2041; /* Wine red for links */
    text-decoration: underline;
    transition: color 0.3s ease;
}

.footer-texto-simple a:hover {
    color: #D4A257; /* Gold accent on hover */
}

.footer-col-logos {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: auto;
    gap: 25px;
}

.logo-pucv-img {
    height: 80px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
    /* Convert white PNG outline to black */
    filter: brightness(0);
}

.logo-ead-img {
    height: 52px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    /* Apply SVG filter to turn white text black while preserving red brackets */
    filter: url(#blacken-white);
}

/* Responsive Grid */
@media(max-width: 768px) {
    .footer-simple-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 35px;
    }
    
    .footer-col-logos {
        align-items: flex-start;
        width: 100%;
        margin-left: 0;
        gap: 20px;
    }

    .logo-pucv-img {
        height: 68px;
    }

    .logo-ead-img {
        height: 45px;
    }
}

/* ================================= */
/* OVERLAY DE CARGA DE LA EXPERIENCIA*/
/* ================================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: #FEFBF2; /* Cremoso oficial */
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ANIMACIÓN DE LAS PIEZAS DE LA TORRE */
.tower-loader {
    position: relative;
    width: 120px;
    height: 160px;
    margin-bottom: 30px;
}

/* Pieza 1: Base */
.loader-base {
    position: absolute;
    bottom: 0;
    left: 30px; /* Centered for 60px width */
    width: 60px; /* Smaller base */
    height: 20px;
    background-color: #EDE9DD; /* Cremita oficial */
    border: 1px solid rgba(140, 32, 65, 0.15); /* Subtle outline for contrast against cream background */
    border-radius: 4px;
    opacity: 0;
    transform: translateY(50px);
    animation: loadBase 2.8s infinite ease-in-out;
}

/* Pieza 2: Pilar */
.loader-pilar {
    position: absolute;
    bottom: 20px;
    left: 52px;
    width: 16px;
    height: 80px;
    background-color: #D7C49E; /* Color madera clara del pilar 3D */
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-100px);
    animation: loadPilar 2.8s infinite ease-in-out;
}

/* Pieza 3: Plataforma superior */
.loader-top {
    position: absolute;
    bottom: 100px;
    left: 10px; /* Centered for 100px width */
    width: 100px; /* Larger platform */
    height: 15px;
    background-color: #F5BEBF; /* Rosada oficial */
    border-radius: 3px;
    opacity: 0;
    transform: translateY(-150px);
    animation: loadTop 2.8s infinite ease-in-out;
}

/* Keyframes secuenciales */
@keyframes loadBase {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    15% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

@keyframes loadPilar {
    0%, 15% {
        opacity: 0;
        transform: translateY(-100px);
    }
    35% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

@keyframes loadTop {
    0%, 35% {
        opacity: 0;
        transform: translateY(-150px);
    }
    55% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

/* TEXTO CARGANDO */
.loading-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 0.1em;
    color: #8C2041;
    margin-bottom: 8px;
    animation: pulseText 1.5s infinite ease-in-out;
}

.loading-subtitle {
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    font-style: italic;
    color: #6B1831;
    opacity: 0.55;
    letter-spacing: 0.05em;
    line-height: 1.6;
    text-align: center;
    margin-top: 10px;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ================================= */
/* AJUSTES PARA PANTALLAS GRANDES (TV/4K) */
/* ================================= */
@media (min-width: 1500px) {
    html {
        font-size: 19px; /* Escala proporcionalmente todo el diseño en rem */
    }
}

@media (min-width: 2000px) {
    html {
        font-size: 23px; /* Escala proporcional para televisores de gran formato o 4K */
    }
}

/* ================================================= */
/* OPTIMIZACIONES DE RENDIMIENTO Y REDUCCIÓN DE PARPADEO */
/* ================================================= */
.scroll-section,
.bloque-imagen img,
.tarjeta-carrusel img,
.item-3d,
.item-3d canvas,
#contenedor-torre-3d canvas {
    /* Forzar creación de capa de composición en la GPU (Hardware Acceleration) */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    
    /* Prevenir parpadeos WebKit al renderizar transformaciones tridimensionales */
    -webkit-font-smoothing: antialiased;
    
    /* Declarar intenciones de animación para evitar renderizados y repintados repentinos */
    will-change: transform;
}

/* Evitar parpadeos en los GIFs al cambiar de visibilidad en transiciones */
.bloque-imagen img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
}
