/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* viewport dinámico para mobile */
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* === TOP BAR === */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 48px;
    padding-top: max(28px, env(safe-area-inset-top));
    padding-left: max(48px, env(safe-area-inset-left));
    padding-right: max(48px, env(safe-area-inset-right));
    pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.site-logo {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: auto;
    z-index: 11;
    pointer-events: auto;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}
.brand {
    font-family: 'Anton', sans-serif;
    font-size: 18px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.counter {
    font-family: 'Anton', sans-serif;
    font-size: 14px;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.7);
}
#current-num { color: #fff; }

/* === HERO === */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.bg-stack { position: absolute; inset: 0; z-index: 0; }
.bg-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #0a0a0a;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.1s cubic-bezier(.65,.05,.36,1),
                transform 2.2s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}
.bg-slide.is-active { opacity: 1; transform: scale(1); }
.bg-slide.is-active[data-media="video"] {
    background-image: none !important;
}
.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    z-index: 1;
}
.bg-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.95) 100%),
        linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.overlay-stack {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.foreground-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translate3d(28px,0,0) scale(.985);
    transition: opacity .45s ease, transform .7s cubic-bezier(.22,.61,.36,1);
}
.foreground-item.is-active {
    opacity: 1;
    transform: translate3d(0,0,0) scale(1);
}
.foreground-img {
    position: absolute;
    right: clamp(70px, 15vw, 260px);
    top: 50%;
    width: min(34vw, 520px);
    max-height: 72vh;
    object-fit: contain;
    transform: translateY(-48%);
    filter: drop-shadow(0 32px 42px rgba(0,0,0,.45));
    animation: foregroundFloat 5.5s ease-in-out infinite;
}
.foreground-item.is-active .foreground-img {
    animation: foregroundFloat 5.5s ease-in-out infinite, glitchShift 3.8s steps(2,end) infinite;
}
.foreground-img::selection { background: transparent; }
@keyframes foregroundFloat {
    0%,100% { transform: translateY(-48%) translateX(0); }
    50% { transform: translateY(-51%) translateX(4px); }
}
@keyframes glitchShift {
    0%, 84%, 100% { clip-path: inset(0 0 0 0); filter: drop-shadow(0 32px 42px rgba(0,0,0,.45)); }
    85% { clip-path: inset(12% 0 69% 0); filter: drop-shadow(8px 0 0 rgba(255,0,84,.42)) drop-shadow(-8px 0 0 rgba(0,229,255,.35)) drop-shadow(0 32px 42px rgba(0,0,0,.45)); }
    88% { clip-path: inset(55% 0 21% 0); transform: translateY(-48%) translateX(-8px); }
    91% { clip-path: inset(7% 0 77% 0); transform: translateY(-50%) translateX(7px); }
    94% { clip-path: inset(0 0 0 0); transform: translateY(-48%) translateX(0); }
}

/* === CONTENIDO SLIDE === */
.slide-content {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: none;
}
.content-inner {
    width: 100%;
    padding: 0 48px;
    display: flex;
    align-items: center;
    gap: 48px;
    pointer-events: auto;
    max-width: 1400px;
    margin: 0 auto;
}

.big-number {
    font-family: 'Anton', sans-serif;
    font-size: clamp(180px, 22vw, 320px);
    line-height: 0.85;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.15));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
    user-select: none;
}

.text-block {
    flex: 1;
    max-width: 560px;
    padding-bottom: 40px;
}
.cat-tag {
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin: 0 0 18px;
    font-weight: 500;
    position: relative;
    padding-left: 36px;
}
.cat-tag::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.5);
}
.title {
    font-family: 'Anton', sans-serif;
    font-size: clamp(48px, 6.5vw, 96px);
    line-height: 0.95;
    margin: 0 0 24px;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}
.meta {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.82);
    margin-bottom: 32px;
}
.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    transition: gap 0.4s ease, border-color 0.3s ease;
    cursor: pointer;
}
.btn-view:hover, .btn-view:active { gap: 20px; border-bottom-color: #fff; }
.btn-view svg { transition: transform 0.4s ease; }
.btn-view:hover svg, .btn-view:active svg { transform: translateX(4px); }

/* === FLECHAS === */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.nav-arrow:hover, .nav-arrow:active { opacity: 1; }
.nav-prev { left: 12px; }
.nav-next { right: 12px; }

/* === THUMBNAILS === */
.thumbs-wrap {
    position: absolute;
    bottom: 80px;
    bottom: max(80px, calc(60px + env(safe-area-inset-bottom)));
    left: 0;
    right: 0;
    z-index: 4;
    padding: 0 48px;
}
.thumbs-swiper { width: 100%; overflow: visible; }
.thumbs-swiper .swiper-wrapper { align-items: flex-end; }
.thumb {
    width: 150px !important;
    height: 95px !important;
    cursor: pointer;
    flex-shrink: 0;
}
.thumb-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 2px;
    transition: transform 0.5s cubic-bezier(.22,.61,.36,1), filter 0.5s ease;
    filter: grayscale(0.3) brightness(0.65);
}
.thumb:hover .thumb-inner { transform: translateY(-6px); filter: grayscale(0) brightness(0.9); }
.thumb.is-active .thumb-inner {
    transform: scale(1.15);
    filter: grayscale(0) brightness(1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.thumb-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #222;
    transition: transform 0.8s ease;
}
.thumb:hover .thumb-img { transform: scale(1.08); }
.thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px 10px;
    color: #fff;
}
.thumb-num {
    font-family: 'Anton', sans-serif;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.7);
    line-height: 1;
}
.thumb-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 4px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === FOOTER === */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 24px 48px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
}
.hint { font-size: 10px; }

/* === EMPTY === */
.empty-state {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.empty-state h2 {
    font-family: 'Anton', sans-serif;
    font-size: clamp(36px, 8vw, 64px);
    margin: 0 0 16px;
    letter-spacing: 0.02em;
}
.empty-state a { color: #fff; border-bottom: 1px solid #fff; }

/* ============================================================
   MOBILE — rediseño completo del layout
   ============================================================ */
@media (max-width: 900px) {
    .topbar { padding: 16px 20px; padding-top: max(16px, env(safe-area-inset-top)); }
    .brand { font-size: 14px; }
    .counter { font-size: 12px; }
    .site-logo { width: 44px; top: max(10px, env(safe-area-inset-top)); }

    .bg-stack,
    .bg-slide,
    .bg-video {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }
    .bg-slide {
        background-position: center center;
    }
    .bg-slide.is-active[data-media="video"] {
        background-image: none !important;
    }
    .bg-video {
        object-fit: cover;
        object-position: center center;
    }
    .bg-vignette {
        background:
            linear-gradient(180deg, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.18) 24%, rgba(0,0,0,0.22) 46%, rgba(0,0,0,0.94) 100%),
            linear-gradient(90deg, rgba(0,0,0,0.48) 0%, rgba(0,0,0,0.12) 58%, rgba(0,0,0,0.34) 100%);
    }
    .overlay-stack {
        z-index: 1;
    }
    .foreground-img {
        right: -6vw;
        top: 45%;
        width: min(58vw, 320px);
        max-height: 48vh;
        opacity: .92;
        transform: translateY(-50%);
        filter: drop-shadow(0 24px 28px rgba(0,0,0,.5));
    }

    .content-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
        gap: 0;
        justify-content: center;
        height: 100%;
    }

    /* En mobile el número grande va como watermark detrás del título */
    .big-number {
        font-size: 32vw;
        line-height: 0.85;
        position: absolute;
        top: 12vh;
        left: 18px;
        opacity: 0.18;
        z-index: 1;
        pointer-events: none;
    }
    .text-block {
        position: relative;
        z-index: 2;
        padding-bottom: 0;
        margin-top: 16vh;
        max-width: 100%;
        text-shadow: 0 2px 18px rgba(0,0,0,0.55);
    }
    .cat-tag { font-size: 10px; letter-spacing: 0.25em; margin-bottom: 14px; padding-left: 28px; }
    .cat-tag::before { width: 18px; }
    .title { font-size: 38px; margin-bottom: 16px; }
    .meta { font-size: 13px; line-height: 1.65; margin-bottom: 22px; }
    .btn-view { font-size: 11px; letter-spacing: 0.22em; }

    .nav-arrow { display: none; }

    .thumbs-wrap {
        bottom: 56px;
        bottom: max(56px, calc(40px + env(safe-area-inset-bottom)));
        padding: 0 20px;
    }
    .thumb { width: 78px !important; height: 54px !important; }
    .thumb-title { font-size: 8.5px; letter-spacing: 0.03em; }
    .thumb-num { font-size: 11px; }

    .footer {
        padding: 14px 20px;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        flex-direction: column;
        gap: 2px;
        font-size: 9px;
    }
    .hint { display: none; }
}

/* Pantallas chicas tipo iPhone SE */
@media (max-width: 380px) {
    .title { font-size: 32px; }
    .meta { font-size: 12px; }
    .thumb { width: 64px !important; height: 44px !important; }
    .text-block { margin-top: 16vh; }
    .big-number { top: 11vh; }
    .site-logo { width: 38px; }
    .foreground-img {
        width: 54vw;
        top: 42%;
        right: -12vw;
        opacity: .86;
    }
}

/* Accesibilidad: usuarios con reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bg-slide { transition: opacity 0.3s ease, transform 0.3s ease; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.2s !important; }
}
