:root {
    --bg-base: #151312;
    --bg-soft: #22201e;
    --text-main: #f4efe6;
    --text-soft: #cfbfa8;
    --card: #1b1918;
    --line: #3a322a;
    --accent: #ff8a3d;
    --accent-2: #ffd166;
    --accent-3: #6fe7dd;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

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

body {
    min-height: 100vh;
    font-family: "Instrument Sans", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 138, 61, 0.12), transparent 35%),
        radial-gradient(circle at 10% 25%, rgba(111, 231, 221, 0.1), transparent 30%),
        linear-gradient(155deg, #121110 0%, #1b1715 45%, #211a17 100%);
    padding: 1.5rem clamp(1rem, 2vw, 2rem) 2rem;
}

.bg-aurora {
    position: fixed;
    inset: -10% -20% auto;
    height: 35vh;
    background: conic-gradient(from 90deg, rgba(255, 138, 61, 0.35), rgba(255, 209, 102, 0.18), rgba(111, 231, 221, 0.22), rgba(255, 138, 61, 0.35));
    filter: blur(80px);
    pointer-events: none;
    z-index: -2;
    animation: drift 12s ease-in-out infinite alternate;
}

.bg-grain {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.65px, transparent 0.65px);
    background-size: 4px 4px;
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
}

.hero-header {
    width: min(1200px, 100%);
    margin: 0 auto 1.8rem;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.2rem;
    background: linear-gradient(120deg, rgba(33, 28, 24, 0.95), rgba(20, 19, 18, 0.9));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.brand {
    padding: 1.7rem 1.8rem;
    position: relative;
}

.brand::after {
    content: "";
    position: absolute;
    right: 1.2rem;
    top: 1.2rem;
    width: 4.5rem;
    aspect-ratio: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 209, 102, 0.35);
}

.brand-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-2);
    margin-bottom: 0.55rem;
}

.brand h1 {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    letter-spacing: 0.03em;
    line-height: 0.9;
}

.brand-copy {
    margin-top: 0.75rem;
    max-width: 45ch;
    color: var(--text-soft);
    line-height: 1.45;
}

.control-panel {
    border-left: 1px solid var(--line);
    padding: 1.2rem;
    display: grid;
    align-content: center;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(36, 31, 27, 0.6), rgba(24, 22, 20, 0.6));
}

.search-wrap {
    display: grid;
    gap: 0.45rem;
}

.search-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
}

#search-bar {
    width: 100%;
    border: 1px solid #4e443b;
    background: rgba(17, 17, 17, 0.65);
    color: var(--text-main);
    border-radius: 0.8rem;
    font-size: 0.98rem;
    padding: 0.75rem 0.95rem;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

#search-bar:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.18);
}

#search-bar::placeholder {
    color: #978875;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.button-sections {
    border: 1px solid #514539;
    border-radius: 999px;
    background: rgba(29, 26, 23, 0.9);
    color: #e8dcc8;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.62rem 0.45rem;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button-sections:hover {
    transform: translateY(-2px);
    border-color: var(--accent-2);
}

.button-sections.is-active {
    border-color: var(--accent);
    background: linear-gradient(100deg, rgba(255, 138, 61, 0.2), rgba(255, 209, 102, 0.14));
}

.grid-shell {
    width: min(1200px, 100%);
    margin: 0 auto;
}

.grid-headline {
    margin: 0.5rem 0 1rem;
}

.grid-headline h2 {
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.06em;
    font-size: 1.9rem;
}

.grid-headline p {
    color: var(--text-soft);
}

.contenedor {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    animation: appear 450ms ease;
}

.contenedor .pelicula {
    background: linear-gradient(180deg, rgba(33, 29, 26, 0.85), rgba(20, 18, 17, 0.9));
    border: 1px solid #3b342d;
    border-radius: 0.9rem;
    padding: 0.55rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.contenedor .pelicula:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.35);
}

.contenedor .pelicula .poster {
    width: 100%;
    border-radius: 0.65rem;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 180ms ease, filter 180ms ease;
}

.contenedor .pelicula .poster:hover {
    transform: scale(1.02);
    filter: saturate(1.08) contrast(1.04);
}

.contenedor .pelicula .titulo {
    margin-top: 0.65rem;
    font-size: 0.92rem;
    line-height: 1.35;
    color: #efe5d7;
    min-height: 2.5em;
}

.paginacion {
    position: static;
    width: min(1200px, 100%);
    margin: 1.4rem auto 0;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.45rem;
    border: 1px solid #4a3f34;
    border-radius: 999px;
    background: rgba(19, 17, 16, 0.88);
    backdrop-filter: blur(6px);
    z-index: 1;
}

.paginacion button {
    border: 1px solid #524638;
    background: #2a2521;
    color: #f0e6d7;
    border-radius: 999px;
    min-width: 8rem;
    height: 2.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}

.paginacion button:hover {
    background: #3c332c;
    border-color: var(--accent);
}

.alerta {
    display: none;
    place-items: center;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
}

.alert_text_container {
    width: min(28rem, 92vw);
    background: #f5efe6;
    border-radius: 1rem;
    padding: 1rem;
}

.alert_text_container .text_alert {
    color: #211b17;
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.button_close_alert {
    width: 100%;
    height: 2.7rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff8a3d, #ffd166);
    color: #151312;
    font-weight: 700;
    cursor: pointer;
}

@keyframes drift {
    from {
        transform: translateX(-2%) translateY(-4%);
    }

    to {
        transform: translateX(3%) translateY(3%);
    }
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1000px) {
    .hero-header {
        grid-template-columns: 1fr;
    }

    .control-panel {
        border-left: none;
        border-top: 1px solid var(--line);
    }

    .contenedor {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        padding: 1rem 0.85rem 1.2rem;
    }

    .brand {
        padding: 1.2rem;
    }

    .brand h1 {
        font-size: clamp(2.1rem, 15vw, 3.1rem);
    }

    .contenedor {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .buttons {
        grid-template-columns: 1fr;
    }

    .paginacion {
        width: 100%;
        margin-top: 1rem;
    }

    .paginacion button {
        min-width: 0;
        flex: 1;
    }
}
