:root {
    --nx-font: 'Inter', 'Segoe UI', sans-serif;
    --nx-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-kinetic-container {
    width: 100%;
    height: 100vh;
    min-height: 650px;
    background: #000;
    overflow: hidden;
    padding: 20px;
    display: flex;
    align-items: center;
    /* Aislamiento total para evitar que el hover afecte al resto de la página */
    contain: strict;
    isolation: isolate;
}

.nx-kinetic-wrapper {
    display: flex;
    width: 100%;
    height: 85vh;
    gap: 12px;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.nx-k-panel {
    position: relative;
    flex: 1;
    min-width: 70px;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    /* Pre-calculado de flex para evitar saltos */
    will-change: flex;
    transition: flex 0.7s var(--nx-ease), border-color 0.4s ease;
    /* Forzado de capa GPU */
    transform: translateZ(0);
}

.nx-k-panel:hover {
    flex: 5;
    border-color: var(--accent);
}

.nx-k-bg {
    position: absolute;
    /* Inset profundo para que el paralaje nunca muestre bordes vacíos */
    inset: -20%;
    width: 140%;
    height: 140%;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
    /* Escala inicial para que el primer movimiento no sea brusco */
    transform: translate3d(0, 0, 0) scale(1.05);
}

.nx-k-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.25);
    /* Transición de filtro lineal para no cargar el procesador */
    transition: filter 0.6s linear;
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
}

.nx-k-panel:hover .nx-k-bg img {
    filter: grayscale(0%) brightness(0.5);
}

.nx-k-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    color: white;
    box-sizing: border-box;
    pointer-events: none;
    /* Estabilización de texto */
    transform: translateZ(0);
}

.nx-k-title {
    font-size: clamp(1.2rem, 2vw, 2.2rem);
    text-transform: uppercase;
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

.nx-k-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--nx-ease), opacity 0.3s ease;
}

.nx-k-panel:hover .nx-k-body {
    max-height: 250px;
    opacity: 1;
    margin-top: 20px;
    pointer-events: auto;
}

.nx-k-link {
    display: inline-flex;
    align-items: center;
    margin-top: 20px;
    color: #fff;
    background: var(--accent);
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Mobile Fixes */
@media (max-width: 900px) {
    .nx-kinetic-container {
        height: 70rem    !important;
        padding: 10px;
        display: block;
    }

    .nx-kinetic-wrapper {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }

    .nx-k-panel {
        width: 100%;
        height: 140px;
        flex: none;
        transition: height 0.6s var(--nx-ease);
    }

    .nx-k-panel.active {
        height: 400px;
    }

    .nx-k-bg {
        inset: 0;
        width: 100%;
        height: 100%;
        transform: none !important;
    }
}