/* =========================================
   VARIABLES GLOBALES Y RESET
   ========================================= */
:root {
    --color-bg: #f4f4f4;
    --color-text: #0a0a0a;
    --color-white: #ffffff;
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; 
}

/* =========================================
   TEXTOS DE ESQUINA (ESCRITORIO)
   ========================================= */
.corner-nav {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    pointer-events: none; 
    z-index: 100;
    font-family: var(--font-mono); 
    font-size: 11px;
    letter-spacing: 1px; 
    text-transform: uppercase;
    color: var(--color-text);
    mix-blend-mode: normal; 
}

.corner-text { 
    position: absolute; 
    padding: 25px; 
    pointer-events: auto; 
}
.nav-tl { top: 0; left: 0; }
.nav-tc { top: 0; left: 50%; transform: translateX(-50%); }
.nav-tr { top: 0; right: 0; }
.nav-bl { bottom: 0; left: 0; }
.nav-br { bottom: 0; right: 0; }

/* =========================================
   MARQUEE DE FONDO
   ========================================= */
.hero-marquee {
    position: fixed; 
    top: 50%; 
    left: 0; 
    width: 100vw;
    transform: translateY(-50%);
    z-index: -1; 
    pointer-events: none;
}
.marquee-track {
    display: flex; 
    width: max-content;
    animation: scroll-left 18s linear infinite; 
}
.marquee-item {
    font-size: 38vw; 
    font-weight: 900; 
    font-family: var(--font-heading);
    color: var(--color-text); 
    text-transform: uppercase;
    line-height: 0.8; 
    white-space: nowrap; 
    display: flex; 
    align-items: center; 
    padding-right: 6vw; 
}
.bullet {
    display: inline-block; 
    margin-left: 6vw; 
    transform: scale(0.50) translateY(-5%); 
    transform-origin: center; 
}
@keyframes scroll-left {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* =========================================
   CONTENEDOR DE SLIDES PRINCIPAL (INDEX)
   ========================================= */
.slider-container {
    display: flex;
    overflow-x: auto; 
    overflow-y: hidden;
    height: 100vh;
    width: 100vw;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative; 
    z-index: 2; 
    transform: translateZ(0); 
    /* Se eliminó overscroll-behavior-x para reactivar el sensor táctil en móviles */
}
.slider-container::-webkit-scrollbar { 
    display: none; 
}

.slide-item {
    flex: 0 0 100vw; 
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center; 
    scroll-snap-stop: always; /* 🛑 Frena la inercia nativa de Android de una en una */
    position: relative;
    z-index: 2;
}
.image-wrapper {
    position: relative;
    width: 35vw;
    min-width: 300px;
    aspect-ratio: 3/4;
    cursor: none;
}
.gallery__img, .gallery__video {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

.slide-info {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    width: 35vw; 
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text);
    z-index: 10;
}

/* 🎯 CONFIGURACIÓN DE BOTONES CON FLECHA INTEGRADA */
.slide-nav-btn { 
    display: inline-flex;
    flex-direction: column;
    position: relative;
    padding-top: 14px; 
    transition: color 0.3s ease; 
}

.prev-slide { align-items: flex-start; }
.next-slide { align-items: flex-end; }

.slide-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 1px;
    background-color: currentColor; 
    transition: background-color 0.3s ease;
}

.slide-nav-btn::after {
    content: '';
    position: absolute;
    top: -3px; 
    width: 6px;
    height: 6px;
    border-top: 1px solid currentColor;
    border-left: 1px solid currentColor;
    transition: border-color 0.3s ease;
}

.prev-slide::after {
    left: 0;
    transform: rotate(-45deg);
}

.next-slide::after {
    right: 0;
    transform: rotate(135deg);
}

.slide-nav-btn:hover { 
    color: #ff00ff; 
}

/* =========================================
   PÁGINA DE PROYECTO (SPLIT SCREEN - ESCRITORIO)
   ========================================= */
.project-page {
    background-color: var(--color-white); 
    overflow: hidden; 
}
.project-nav {
    color: var(--color-text);
    mix-blend-mode: normal; 
}
.back-link {
    text-decoration: none; 
    color: var(--color-text); 
    transition: color 0.3s;
}
.back-link:hover { 
    color: #ff00ff; 
}

.split-layout {
    display: flex; 
    width: 100vw; 
    height: 100vh; 
    padding-top: 60px; 
}

.split-left {
    width: 50%; 
    height: 100%; 
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    padding: 2rem 4rem; 
    position: relative;
}

.thumbnails-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); 
    gap: 15px; 
    overflow-y: auto; 
    max-height: 60vh; 
    padding-bottom: 2rem; 
    align-content: start;
    -webkit-overflow-scrolling: touch;
}
.thumbnails-column::-webkit-scrollbar { 
    display: none; 
}

.thumb-wrapper {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.thumb-wrapper:hover, .thumb-wrapper.active {
    opacity: 1;
}

.project-thumb-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    margin-bottom: 6px; 
}

.thumb-number {
    font-family: var(--font-mono); 
    font-size: 11px;
    color: var(--color-text);
    letter-spacing: 1px;
    font-variant-numeric: slashed-zero;
    font-feature-settings: "zero" 1; 
    text-align: right; 
}

.project-huge-title {
    font-size: 5vw; 
    line-height: 0.75; 
    font-family: var(--font-heading);
    text-transform: uppercase; 
    letter-spacing: -3px; 
    margin-bottom: 2rem;
    color: var(--color-text);
}

.split-right {
    width: 50%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background-color: #f9f9f9; 
    padding: 2rem;
}

/* 🎯 ESTRUCTURA DE CARRUSEL PARA PROYECTOS (ESCRITORIO) */
.main-image-container {
    width: 100%; 
    height: 85vh; 
    display: flex; 
    overflow: hidden; 
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.project-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always; /* 🛑 Evita que el usuario se salte fotos con un swipe fuerte */
}

.main-project-img, .main-project-video {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.08); 
}

/* =========================================
   SLIDES DE TRANSICIÓN (PORTADILLAS EDITORIALES)
   ========================================= */
.transition-slide {
    background-color: transparent; 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-align: center;
    cursor: pointer; 
}

.transition-slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 2rem;
}

.transition-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ff00ff; 
    font-weight: bold;
}

.transition-title {
    font-family: var(--font-heading);
    font-size: 4vw; 
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -2px;
    color: var(--color-text);
}

/* =========================================
   MEDIA QUERIES (MÓVILES EXCLUSIVO)
   ========================================= */
@media (max-width: 768px) {
    .image-wrapper { width: 85vw; }
    .slide-info { width: 85vw; bottom: 30px; } 
    
    .corner-nav { 
        display: block; 
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 75px; 
        background-color: var(--color-white); 
        mix-blend-mode: normal; 
        z-index: 1000;
        pointer-events: auto; 
        font-weight: 400;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .corner-nav .back-link,
    .corner-nav .corner-text {
        color: var(--color-text) !important; 
    }
    
    .corner-text {
        padding: 15px 15px; 
        font-size: 8.5px; 
        white-space: nowrap; 
    }
    
    .nav-tc { top: 32px; }
    .nav-bl, .nav-br { display: none; }
    
    .split-layout { 
        flex-direction: column; 
        padding-top: 75px; 
        height: 100vh; 
        overflow: hidden; 
    }
    
    .split-left { display: contents; }
    
    .project-huge-title { 
        display: none !important; 
    }
    
    .split-right { 
        order: 1; 
        width: 100%; 
        flex: 1; 
        height: 0; 
        padding: 10px 1rem;
    }
    
    .main-image-container { 
        width: 100%; 
        height: 100%; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        display: flex;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        /* Se eliminó overscroll-behavior-x para reactivar el sensor táctil en proyectos */
    }
    
    .main-image-container::-webkit-scrollbar {
        display: none;
    }
    
    .thumbnails-column {
        order: 2;
        padding: 0 1rem 20px 1rem; 
        width: 100%;
        max-height: none; 
        overflow: hidden; 
        grid-template-columns: repeat(5, 1fr); 
        gap: 10px; 
    }
    
    /* Indicador de [ VER ] en la galería móvil */
    .gallery__item {
        position: relative;
    }

    .gallery__item::after {
        content: '[ VER ]';
        position: absolute;
        bottom: 10px;
        right: 10px;
        font-family: var(--font-mono);
        font-size: 9px;
        color: var(--color-white);
        background-color: rgba(10, 10, 10, 0.5); 
        padding: 4px 8px;
        pointer-events: none; 
        opacity: 0.8;
        z-index: 5;
    }
    
    /* Escala correcta para títulos de portadillas en celular */
    .transition-title {
        font-size: 9vw; 
    }
}

/* =========================================
   CURSOR GENERAL
   ========================================= */
body, a, button, .gallery__item, .thumb-wrapper { cursor: none !important; }
#cursor-canvas { 
    position: fixed; 
    top: 0; left: 0; width: 100vw; height: 100vh; 
    pointer-events: none; 
    z-index: 9999; 
}

@media (max-width: 768px) {
    #cursor-canvas { display: none; }
    body, a, button, .gallery__item, .thumb-wrapper { cursor: auto !important; }
}