/* =========================================================
   VARIABLES
========================================================= */

:root {
    --background: #07040f;
    --background-secondary: #10081d;

    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.68);
    --text-muted: rgba(255, 255, 255, 0.48);

    --purple: #8c5cff;
    --purple-light: #bca4ff;
    --blue: #38a9ff;

    --border: rgba(255, 255, 255, 0.12);
    --header-height: 88px;

    --shadow:
        0 28px 90px rgba(0, 0, 0, 0.58),
        0 0 40px rgba(116, 73, 255, 0.14);

    --transition: 0.28s ease;
}


/* =========================================================
   REINICIO
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 50% 10%,
            rgba(93, 53, 177, 0.2),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            var(--background-secondary) 0%,
            var(--background) 55%,
            #05030a 100%
        );

    overflow-x: hidden;
}

body.menu-open,
body.lightbox-open {
    overflow: hidden;
    overscroll-behavior: none;
}

button,
a,
img {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

img {
    max-width: 100%;
}


/* =========================================================
   FONDO
========================================================= */

.background {
    position: fixed;
    inset: 0;
    z-index: -1;

    overflow: hidden;
    pointer-events: none;
}

.background__stars {
    position: absolute;
    inset: 0;

    opacity: 0.34;

    background-image:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.8) 0 1px,
            transparent 1.5px
        );

    background-size: 38px 38px;

    mask-image:
        linear-gradient(
            to bottom,
            black 0%,
            rgba(0, 0, 0, 0.7) 45%,
            transparent 100%
        );
}

.background__glow {
    position: absolute;

    width: 620px;
    height: 620px;

    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
}

.background__glow--one {
    top: -260px;
    left: -200px;
    background: var(--purple);
}

.background__glow--two {
    top: 20%;
    right: -280px;
    background: var(--blue);
}


/* =========================================================
   CABECERA
========================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    height: var(--header-height);

    padding:
        env(safe-area-inset-top)
        clamp(20px, 5vw, 72px)
        0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    background: rgba(7, 4, 15, 0.74);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;

    color: var(--text);
    text-decoration: none;
}

.brand__moon {
    position: relative;

    display: block;

    width: 29px;
    height: 29px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 30%,
            #ffffff,
            #d8ccff 38%,
            #7951d7 72%,
            #342064 100%
        );

    box-shadow:
        0 0 18px rgba(174, 141, 255, 0.65),
        0 0 40px rgba(112, 71, 215, 0.28);
}

.brand__moon::after {
    content: "";

    position: absolute;
    top: 3px;
    left: 9px;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: rgba(74, 49, 119, 0.18);
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 1px;

    line-height: 1;
}

.brand__text strong {
    font-size: 0.88rem;
    letter-spacing: 0.19em;
}

.brand__text small {
    margin-top: 5px;

    color: var(--text-muted);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}


/* =========================================================
   BOTÓN DEL MENÚ
========================================================= */

.menu-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    width: 48px;
    height: 48px;
    padding: 0;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.menu-button:hover {
    transform: scale(1.06);

    border-color: rgba(180, 150, 255, 0.42);
    background: rgba(140, 92, 255, 0.12);
}

.menu-button span {
    width: 19px;
    height: 1.5px;

    border-radius: 10px;
    background: #ffffff;
}


/* =========================================================
   MENÚ LATERAL
========================================================= */

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1990;

    visibility: hidden;
    opacity: 0;

    background: rgba(0, 0, 0, 0.62);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    transition:
        opacity var(--transition),
        visibility var(--transition);
}

.menu-overlay.is-active {
    visibility: visible;
    opacity: 1;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2000;

    display: flex;
    flex-direction: column;

    width: min(430px, 92vw);
    height: 100dvh;

    padding:
        max(30px, env(safe-area-inset-top))
        34px
        max(30px, env(safe-area-inset-bottom));

    border-left: 1px solid rgba(255, 255, 255, 0.1);

    background:
        linear-gradient(
            160deg,
            rgba(26, 14, 50, 0.98),
            rgba(7, 4, 15, 0.99)
        );

    box-shadow: -30px 0 100px rgba(0, 0, 0, 0.58);

    transform: translateX(105%);

    transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.side-menu.is-active {
    transform: translateX(0);
}

.side-menu__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    padding-bottom: 30px;

    border-bottom: 1px solid var(--border);
}

.side-menu__eyebrow {
    color: var(--purple-light);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.26em;
}

.side-menu h2 {
    margin: 9px 0 0;

    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 600;
}

.side-menu__close {
    width: 44px;
    height: 44px;
    padding: 0;

    border: 1px solid var(--border);
    border-radius: 50%;

    color: #ffffff;
    font-size: 2rem;
    font-weight: 200;
    line-height: 1;

    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.side-menu__nav {
    display: flex;
    flex-direction: column;

    margin-top: 32px;
}

.side-menu__link {
    display: flex;
    align-items: center;
    gap: 18px;

    padding: 21px 4px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    color: #ffffff;
    font-size: 1.15rem;
    text-decoration: none;

    transition:
        color var(--transition),
        padding-left var(--transition);
}

.side-menu__link span {
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.side-menu__link:hover {
    padding-left: 10px;
    color: var(--purple-light);
}

.side-menu__footer {
    margin-top: auto;

    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}


/* =========================================================
   CONTENIDO
========================================================= */

.main-content {
    min-height: calc(100vh - 72px);

    padding:
        calc(var(--header-height) + 34px)
        clamp(14px, 4vw, 54px)
        36px;
}

.poster-section {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
}

.poster-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    width: min(440px, 90vw);
    margin-bottom: 22px;
}

.poster-intro__line {
    flex: 1;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(189, 164, 255, 0.46)
        );
}

.poster-intro__line:last-child {
    background:
        linear-gradient(
            90deg,
            rgba(189, 164, 255, 0.46),
            transparent
        );
}

.poster-intro__text {
    color: var(--text-soft);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    white-space: nowrap;
}


/* =========================================================
   CARTEL PRINCIPAL
========================================================= */

.poster-frame {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    margin: 0;
}

.poster-frame::before {
    content: "";

    position: absolute;
    top: 4%;
    left: 50%;
    z-index: -1;

    width: 84%;
    height: 80%;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(126, 83, 233, 0.25),
            transparent 70%
        );

    filter: blur(55px);
    transform: translateX(-50%);
}

.poster {
    display: block;

    width: auto;
    max-width: min(92vw, 760px);
    max-height: calc(100vh - var(--header-height) - 115px);
    height: auto;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;

    object-fit: contain;

    box-shadow: var(--shadow);

    cursor: zoom-in;

    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.poster:hover {
    transform: translateY(-3px) scale(1.006);

    border-color: rgba(190, 165, 255, 0.44);

    box-shadow:
        0 35px 100px rgba(0, 0, 0, 0.66),
        0 0 52px rgba(128, 82, 255, 0.25);
}

.poster-caption {
    margin-top: 18px;

    color: var(--text-muted);
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.poster-caption__mobile {
    display: none;
}

.poster-error {
    width: min(620px, 90vw);
    padding: 50px 30px;

    border: 1px solid var(--border);
    border-radius: 18px;

    text-align: center;

    background: rgba(16, 10, 30, 0.78);
    box-shadow: var(--shadow);
}

.poster-error h2 {
    margin-top: 0;
}

.poster-error p {
    margin-bottom: 0;

    color: var(--text-soft);
    line-height: 1.7;
}


/* =========================================================
   ANIMACIÓN DE ENTRADA
========================================================= */

@keyframes posterEntrance {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(1.035);
        filter: blur(5px);
    }

    60% {
        opacity: 1;
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes posterIntroEntrance {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes posterCaptionEntrance {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.poster {
    animation:
        posterEntrance
        0.9s
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.poster-intro {
    animation:
        posterIntroEntrance
        0.65s
        ease-out
        0.15s
        both;
}

.poster-caption {
    animation:
        posterCaptionEntrance
        0.6s
        ease-out
        0.55s
        both;
}


/* =========================================================
   VISOR AMPLIADO
========================================================= */

.poster-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: flex;
    flex-direction: column;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(60, 32, 116, 0.2),
            transparent 42%
        ),
        rgba(2, 1, 6, 0.985);

    transition:
        visibility 0.3s ease,
        opacity 0.3s ease;

    touch-action: none;
    overscroll-behavior: none;
}

.poster-lightbox.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.poster-lightbox__toolbar {
    position: relative;
    z-index: 5010;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 68px;

    padding:
        max(10px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        10px
        max(18px, env(safe-area-inset-left));

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    background: rgba(7, 4, 15, 0.88);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.poster-lightbox__title {
    display: flex;
    flex-direction: column;
    gap: 4px;

    min-width: 0;
}

.poster-lightbox__title > span {
    overflow: hidden;

    color: var(--text-soft);
    font-size: 0.75rem;
    letter-spacing: 0.13em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.poster-lightbox__help {
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.poster-lightbox__close {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;

    color: #ffffff;
    font-size: 2rem;
    font-weight: 200;
    line-height: 1;

    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;

    transition:
        transform var(--transition),
        background var(--transition);
}

.poster-lightbox__close:hover {
    transform: scale(1.07);
    background: rgba(140, 92, 255, 0.24);
}

.poster-lightbox__viewport {
    position: relative;

    flex: 1 1 auto;

    width: 100%;
    min-height: 0;

    overflow: hidden;

    touch-action: none;
    cursor: grab;

    user-select: none;
    -webkit-user-select: none;
}

.poster-lightbox__viewport.is-dragging {
    cursor: grabbing;
}

.poster-lightbox__stage {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    transform-origin: center center;
    will-change: transform;

    touch-action: none;
}

.poster-lightbox__image {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;

    object-fit: contain;

    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;

    pointer-events: none;
}

.zoom-indicator {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 5020;

    min-width: 68px;
    padding: 9px 13px;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;

    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: center;

    background: rgba(7, 4, 15, 0.74);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    opacity: 0;
    transform: translateY(8px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

    pointer-events: none;
}

.zoom-indicator.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   PIE
========================================================= */

.site-footer {
    padding:
        24px
        20px
        max(24px, env(safe-area-inset-bottom));

    border-top: 1px solid rgba(255, 255, 255, 0.07);

    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-align: center;

    background: rgba(4, 2, 9, 0.6);
}

.site-footer p {
    margin: 0;
}


/* =========================================================
   TABLET Y MÓVIL
========================================================= */

@media (max-width: 900px) {
    :root {
        --header-height: 76px;
    }

    .site-header {
        padding-right: 18px;
        padding-left: 18px;
    }

    .brand__text strong {
        font-size: 0.78rem;
    }

    .brand__text small {
        font-size: 0.56rem;
    }

    .menu-button {
        width: 44px;
        height: 44px;
    }

    .main-content {
        min-height: auto;

        padding:
            calc(var(--header-height) + 24px)
            10px
            28px;
    }

    .poster-intro {
        margin-bottom: 16px;
    }

    .poster {
        width: auto;
        max-width: calc(100vw - 20px);
        max-height: calc(100svh - var(--header-height) - 94px);

        border-radius: 9px;
        cursor: zoom-in;
    }

    .poster:hover {
        transform: none;
    }

    .poster-caption__desktop {
        display: none;
    }

    .poster-caption__mobile {
        display: inline;
    }

    .poster-lightbox__toolbar {
        min-height: 64px;
    }

    .poster-lightbox__help {
        display: block;
    }

    .zoom-indicator {
        right: 14px;
        bottom: max(14px, env(safe-area-inset-bottom));
    }
}


/* =========================================================
   MÓVILES PEQUEÑOS
========================================================= */

@media (max-width: 480px) {
    .brand {
        gap: 10px;
    }

    .brand__moon {
        width: 26px;
        height: 26px;
    }

    .side-menu {
        width: 100%;
        padding-right: 24px;
        padding-left: 24px;
    }

    .poster-intro {
        width: 95%;
        gap: 10px;
    }

    .poster-intro__text {
        font-size: 0.58rem;
    }

    .poster-lightbox__title > span {
        font-size: 0.67rem;
    }

    .poster-lightbox__help {
        font-size: 0.58rem;
    }

    .poster-lightbox__close {
        width: 42px;
        height: 42px;
    }
}


/* =========================================================
   ACCESIBILIDAD
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .poster,
    .poster-intro,
    .poster-caption {
        animation: none !important;
    }
}

.menu-button:focus-visible,
.side-menu__close:focus-visible,
.poster-lightbox__close:focus-visible,
.side-menu__link:focus-visible,
.brand:focus-visible,
.poster:focus-visible {
    outline: 2px solid var(--purple-light);
    outline-offset: 4px;
}