/* ==========================================================================
   1. RESET Y CONFIGURACIÓN BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #050505;
    --text-color: #7a5fa0;
    --font-main: "Helvetica Neue", "Helvetica", Arial, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: bold;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. CURSOR Y REPRODUCTOR AUDIO
   ========================================================================== */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background-color: var(--text-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: transform 0.1s ease-out;
}

@media (hover: none) and (pointer: coarse) {
    #custom-cursor {
        display: none;
    }
}

.audio-btn {
    position: fixed;
    top: max(1.2rem, env(safe-area-inset-top));
    right: clamp(1rem, 4vw, 3rem);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background: var(--text-color);
    color: #000000;
}

/* ==========================================================================
   3. ANIMACIONES DE ENTRADA
   ========================================================================== */
@keyframes zoomInLogo {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUpContent {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. ESTRUCTURA DE PANTALLAS Y FONDOS
   ========================================================================== */
.screen-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s ease;
    z-index: 1;
    overflow-y: auto;
}

.screen-section.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.bg-media {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
}

/* ==========================================================================
   5. LANDING SCREEN (HERO)
   ========================================================================== */
#landing-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 10;
}

.hero-logo {
    max-width: clamp(200px, 40vw, 480px);
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    animation: zoomInLogo 1.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-intro {
    font-family: var(--font-main);
    font-weight: bold;
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    color: var(--text-color);
    margin-bottom: 2rem;
    max-width: 580px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    opacity: 0;
    animation: fadeInUpContent 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero-target-link {
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: bold;
    text-decoration: none;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.8rem 2rem;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUpContent 1.5s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

.hero-target-link:hover {
    background: var(--text-color);
    color: #000000;
}

/* ==========================================================================
   6. INICIO SCREEN (CARRUSEL HORIZONTAL INFINITO)
   ========================================================================== */
.cards-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: max(4.2rem, env(safe-area-inset-top));
    padding-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 3.0s ease-in-out, transform 3.0s ease-out;
}

#inicio-screen.active .cards-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.page-main-title {
    font-family: var(--font-main);
    font-weight: bold;
    font-size: clamp(0.95rem, 2vw, 1.6rem);
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: clamp(1rem, 2.5vh, 2rem);
    line-height: 1.3;
    overflow: visible;
    color: var(--text-color);
    text-transform: uppercase;
    padding: 0 1rem;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 2vw, 2rem);
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1.5rem 0.5rem;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.proyecto-card {
    flex: 0 0 clamp(200px, 18vw, 250px);
    height: clamp(320px, 50vh, 410px);
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background-color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    cursor: pointer;
    border: 2px solid var(--text-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    isolation: isolate;
}

.proyecto-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: #ffffff;
    box-shadow: 0 12px 30px rgba(122, 95, 160, 0.4);
}

.card-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
    transition: opacity 0.4s ease, transform 0.5s ease;
    z-index: 1;
}

.proyecto-card:hover .card-media {
    opacity: 0.92;
    transform: scale(1.06);
}

.proyecto-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-main);
    font-weight: bold;
    color: #ffffff;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    letter-spacing: 0.1em;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.95);
    pointer-events: none;
    width: 100%;
    text-transform: uppercase;
}

.nav-arrow {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--text-color);
    color: var(--text-color);
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-arrow:hover {
    background: var(--text-color);
    color: #050505;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(122, 95, 160, 0.6);
}

.prev-arrow {
    margin-right: 0.25rem;
}

.next-arrow {
    margin-left: 0.25rem;
}

/* ==========================================================================
   7. VISTA INTERIOR DE CATEGORÍAS (GALERÍA PURAMENTE VISUAL)
   ========================================================================== */
.back-btn {
    position: fixed;
    top: max(1.2rem, env(safe-area-inset-top));
    left: clamp(1rem, 4vw, 3rem);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--text-color);
    color: #000000;
}

.category-view-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: max(5.5rem, env(safe-area-inset-top));
    padding-bottom: 5rem;
    padding-left: clamp(1.5rem, 5vw, 4rem);
    padding-right: clamp(1.5rem, 5vw, 4rem);
    z-index: 10;
}

.category-page-title {
    font-family: var(--font-main);
    font-weight: bold;
    font-size: clamp(1.4rem, 3.5vw, 2.6rem);
    letter-spacing: 0.12em;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    text-transform: uppercase;
}

.galeria-subheading {
    grid-column: 1 / -1;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid rgba(122, 95, 160, 0.4);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.galeria-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background-color: #111111;
    border: 1px solid rgba(122, 95, 160, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-card:hover {
    transform: translateY(-6px);
    border-color: var(--text-color);
    box-shadow: 0 12px 30px rgba(122, 95, 160, 0.4);
}

.galeria-media {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

/* Contenedor responsivo 16:9 para embeds de YouTube */
.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Tarjeta especial para INFO & CONTACTO */
.info-contacto-card {
    grid-column: 1 / -1;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(15, 15, 15, 0.85);
    border: 2px solid var(--text-color);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.info-contacto-card h3 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.info-contacto-card p {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: normal;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.info-contacto-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.info-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.info-link:hover {
    background: var(--text-color);
    color: #000000;
}

/* ==========================================================================
   8. REGLAS MÓVILES (FORMATO CELULAR)
   ========================================================================== */
@media (max-width: 768px) {
    .cards-wrapper {
        padding-top: max(4.5rem, env(safe-area-inset-top));
        padding-bottom: 1.5rem;
    }

    .carousel-container {
        padding: 0;
    }

    .carousel-track {
        gap: 1.2rem;
        padding: 1.2rem 0.5rem;
    }

    .proyecto-card {
        flex: 0 0 215px;
        height: clamp(300px, 48vh, 370px);
        border-radius: 20px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        background: rgba(5, 5, 5, 0.9);
    }

    .prev-arrow {
        margin-right: -10px;
        z-index: 25;
    }

    .next-arrow {
        margin-left: -10px;
        z-index: 25;
    }

    .galeria-media {
        height: 300px;
    }
}