
/* ========================================
   FREAKTOON — ESTILOS GENERALES
======================================== */

:root {
    color-scheme: dark;

    --fondo: #101018;
    --fondo-secundario: #181824;
    --superficie: #202031;
    --superficie-hover: #29293d;

    --texto: #f6f3ff;
    --texto-secundario: #aaa7c0;

    --morado: #a855f7;
    --morado-claro: #c084fc;
    --magenta: #f052b5;
    --cian: #55d6ff;

    --borde: rgba(255, 255, 255, 0.09);

    --radio: 14px;
    --ancho-maximo: 1240px;
}

/* ========================================
   REINICIO Y BASE
======================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            ellipse at 15% 0%,
            rgba(168, 85, 247, 0.09),
            transparent 35%
        ),
        var(--fondo);

    color: var(--texto);
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

::selection {
    color: white;
    background: var(--morado);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   ENCABEZADO
======================================== */

.encabezado {
    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    width: 100%;
    padding: 16px max(24px, calc((100% - var(--ancho-maximo)) / 2));

    background: rgba(16, 16, 24, 0.88);
    border-bottom: 1px solid var(--borde);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.logo {
    flex-shrink: 0;

    font-size: 1.55rem;
    font-weight: 950;
    letter-spacing: -1.5px;
    line-height: 1;
}

.logo span {
    color: var(--morado-claro);
}

.logo:hover span {
    color: var(--magenta);
    transition: color 180ms ease;
}

.buscador {
    position: relative;
    width: min(100%, 350px);
}

.buscador input {
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;

    color: var(--texto);
    background: var(--superficie);

    border: 1px solid var(--borde);
    border-radius: 999px;
    outline: none;

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.buscador input::placeholder {
    color: var(--texto-secundario);
}

.buscador input:focus {
    background: var(--superficie-hover);
    border-color: var(--morado);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */

.contenedor {
    width: min(
        calc(100% - 48px),
        var(--ancho-maximo)
    );

    margin: 0 auto;
}

/* ========================================
   PRESENTACIÓN
======================================== */

.introduccion {
    position: relative;
    overflow: hidden;

    padding: 70px 0 56px;
}

.introduccion::after {
    content: "";
    position: absolute;
    top: 25px;
    right: 4%;

    width: 180px;
    height: 180px;

    background: var(--morado);
    opacity: 0.12;
    filter: blur(100px);
    pointer-events: none;
}

.etiqueta {
    margin: 0 0 12px;

    color: var(--morado-claro);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.introduccion h1 {
    max-width: 760px;
    margin: 0;

    font-size: clamp(2.3rem, 5.5vw, 4.5rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -2px;

    text-wrap: balance;
}

.introduccion > p:last-child {
    max-width: 580px;
    margin: 20px 0 0;

    color: var(--texto-secundario);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

/* ========================================
   CATÁLOGO
======================================== */

.catalogo {
    padding: 12px 0 80px;
}

.titulo-catalogo {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 28px;
}

.titulo-catalogo .etiqueta {
    margin-bottom: 4px;
}

.titulo-catalogo h2 {
    margin: 0;

    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 850;
    letter-spacing: -0.8px;
}

#contador {
    flex-shrink: 0;
    padding: 6px 12px;

    color: var(--texto-secundario);
    background: var(--superficie);

    border: 1px solid var(--borde);
    border-radius: 999px;

    font-size: 0.82rem;
}

/* ========================================
   REJILLA DE OBRAS
======================================== */

.rejilla {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 22px;
}

.obra {
    min-width: 0;
    animation: aparecer 450ms ease both;
}

.obra[hidden] {
    display: none;
}

.enlace-obra {
    display: block;
    height: 100%;
}

.marco-portada {
    position: relative;
    overflow: hidden;
    isolation: isolate;

    aspect-ratio: 3 / 4;

    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radio);

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);

    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.marco-portada::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(
        180deg,
        transparent 65%,
        rgba(12, 10, 22, 0.15)
    );

    pointer-events: none;
}

.marco-portada img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 400ms ease;
}

.enlace-obra:hover .marco-portada {
    transform: translateY(-6px);
    border-color: rgba(192, 132, 252, 0.7);

    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.32),
        0 0 22px rgba(168, 85, 247, 0.13);
}

.enlace-obra:hover .marco-portada img {
    transform: scale(1.045);
}

.obra h3 {
    margin: 13px 0 0;

    color: var(--texto);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.4;

    overflow-wrap: anywhere;

    transition: color 180ms ease;
}

.enlace-obra:hover h3 {
    color: var(--morado-claro);
}

/* Portada de respaldo si no hay imagen */

.portada-vacia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    height: 100%;
    padding: 18px;

    text-align: center;

    background:
        radial-gradient(
            circle at 80% 20%,
            rgba(240, 82, 181, 0.26),
            transparent 40%
        ),
        linear-gradient(
            145deg,
            #29203f,
            #171725 70%
        );
}

.portada-vacia span:first-child {
    color: var(--morado-claro);
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -1px;
}

.portada-vacia span:last-child {
    color: var(--texto-secundario);
    font-size: 0.8rem;
}

/* ========================================
   SIN RESULTADOS
======================================== */

#sin-resultados {
    margin: 30px 0;
    padding: 36px 20px;

    color: var(--texto-secundario);
    background: var(--fondo-secundario);

    border: 1px dashed rgba(192, 132, 252, 0.35);
    border-radius: var(--radio);

    text-align: center;
}

#sin-resultados[hidden] {
    display: none;
}

/* ========================================
   PIE DE PÁGINA
======================================== */

.pie {
    padding: 28px 24px;

    color: var(--texto-secundario);
    background: var(--fondo-secundario);

    border-top: 1px solid var(--borde);
    text-align: center;
}

.pie p {
    margin: 0;
    font-size: 0.85rem;
}

/* ========================================
   ANIMACIONES
======================================== */

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ========================================
   TABLET
======================================== */

@media (max-width: 1000px) {
    .rejilla {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 26px 18px;
    }

    .introduccion {
        padding-top: 58px;
    }
}

/* ========================================
   MÓVILES
======================================== */

@media (max-width: 650px) {
    .encabezado {
        gap: 14px;
        padding: 14px 18px;
    }

    .logo {
        font-size: 1.25rem;
        letter-spacing: -1px;
    }

    .buscador {
        width: min(58%, 300px);
    }

    .buscador input {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .contenedor {
        width: calc(100% - 36px);
    }

    .introduccion {
        padding: 48px 0 38px;
    }

    .introduccion h1 {
        font-size: clamp(2.1rem, 9vw, 3.2rem);
        letter-spacing: -1.4px;
    }

    .introduccion > p:last-child {
        margin-top: 15px;
        font-size: 0.98rem;
    }

    .catalogo {
        padding-bottom: 55px;
    }

    .titulo-catalogo {
        margin-bottom: 20px;
    }

    .rejilla {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 14px;
    }

    .marco-portada {
        border-radius: 10px;
    }

    .obra h3 {
        margin-top: 10px;
        font-size: 0.9rem;
    }

    #contador {
        padding: 5px 9px;
        font-size: 0.75rem;
    }
}

/* ========================================
   PANTALLAS MUY PEQUEÑAS
======================================== */

@media (max-width: 360px) {
    .encabezado {
        flex-wrap: wrap;
    }

    .buscador {
        width: 100%;
    }

    .contenedor {
        width: calc(100% - 28px);
    }

    .rejilla {
        gap: 20px 10px;
    }
}

/* ========================================
   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;
    }
}
