#how-works {
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--wp--preset--color--footer-background);

    &::before {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        top: 60%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background: color-mix(in srgb, var(--wp--preset--color--primary) 40%, transparent);
        z-index: 0;
        filter: blur(150px);
    }

    & .radar-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        overflow: hidden;

        & .radar-grid {
            position: absolute;
            inset: -50%;
            background-image:
                linear-gradient(rgba(30, 144, 255, 0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(30, 144, 255, 0.05) 1px, transparent 1px);
            background-size: 100px 100px;
            background-position: center center;
        }

        & .radar-axis {
            position: absolute;
            background: rgba(30, 144, 255, 0.3);
            z-index: 1;
        }

        & .radar-axis-x {
            top: 50%;
            left: 0;
            width: 100%;
            height: 1px;
            transform: translateY(-50%);
        }

        & .radar-axis-y {
            left: 50%;
            top: 0;
            height: 100%;
            width: 1px;
            transform: translateX(-50%);
        }

        & .radar-circle {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            border: 1px solid rgba(30, 144, 255, 0.25);
            border-radius: 50%;
            z-index: 1;
        }

        & .radar-circle-1 {
            width: 150px;
            height: 150px;
            background: radial-gradient(circle, rgba(30, 144, 255, 0.1) 0%, transparent 70%);
            box-shadow: 0 0 20px rgba(30, 144, 255, 0.2);

            &::before {
                content: '';
                position: absolute;
                inset: 35px;
                border: 2px solid rgba(30, 144, 255, 0.6);
                border-radius: 50%;
                background: rgba(30, 144, 255, 0.15);
                box-shadow: 0 0 15px rgba(30, 144, 255, 0.6);
            }
        }

        & .radar-circle-2 {
            width: 350px;
            height: 350px;
            border-style: dashed;
            opacity: 0.7;
        }

        & .radar-circle-3 {
            width: 600px;
            height: 600px;
        }

        & .radar-circle-4 {
            width: 900px;
            height: 900px;
            border-style: dotted;
            opacity: 0.5;
        }

        & .radar-beam {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 500px;
            height: 500px;
            margin-top: -250px;
            margin-left: -250px;
            border-radius: 50%;
            background: conic-gradient(from 0deg, rgba(30, 144, 255, 0) 0deg, rgba(30, 144, 255, 0) 300deg, rgba(30, 144, 255, 0.4) 360deg);
            animation: radar-sweep 5s linear infinite;
            opacity: .3;
            z-index: 2;

            &::after {
                content: '';
                position: absolute;
                top: 0;
                left: 50%;
                width: 2px;
                height: 50%;
                background: rgba(30, 144, 255, 0.8);
                transform-origin: bottom center;
                transform: translateX(-50%);
                box-shadow: 0 0 12px rgba(30, 144, 255, 1);
            }
        }

        & .radar-blip {
            position: absolute;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            z-index: 3;

            &::before,
            &::after {
                content: '';
                position: absolute;
                inset: -6px;
                border: 1px solid inherit;
                border-radius: 50%;
                animation: radar-blip-pulse 2s ease-out infinite;
                border-color: inherit;
            }

            &::after {
                animation-delay: 1s;
            }
        }

        & .blip-1 {
            top: 30%;
            left: 60%;
            background: #ff3333;
            border-color: #ff3333;
            box-shadow: 0 0 10px #ff3333;
            animation: blip-move-1 25s ease-in-out infinite alternate;
        }

        & .blip-2 {
            top: 65%;
            left: 35%;
            background: #ff8800;
            border-color: #ff8800;
            box-shadow: 0 0 10px #ff8800;
            animation: blip-move-2 30s ease-in-out infinite alternate;
        }

        & .blip-3 {
            top: 75%;
            left: 55%;
            background: #00ff00;
            border-color: #00ff00;
            box-shadow: 0 0 10px #00ff00;
            animation: blip-move-3 28s ease-in-out infinite alternate;
        }

        & .blip-4 {
            top: 40%;
            left: 25%;
            background: #ffcc00;
            border-color: #ffcc00;
            box-shadow: 0 0 10px #ffcc00;
            animation: blip-move-4 35s ease-in-out infinite alternate;
        }

        & .blip-5 {
            top: 45%;
            left: 75%;
            background: #00aaff;
            border-color: #00aaff;
            box-shadow: 0 0 10px #00aaff;
            animation: blip-move-5 32s ease-in-out infinite alternate;
        }
    }

    & .content {
        position: relative;
        z-index: 1;

        & .span-pretext {
            color: var(--wp--preset--color--secondary);
        }

        & .title-section {
            margin-bottom: 2rem;
            color: var(--wp--preset--color--base);
        }

        & .how-works--cards-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
            gap: 1rem;

            & .how-it-works--card {
                position: relative;
                z-index: 1;
                padding: 2rem;
                color: var(--wp--preset--color--base);
                display: grid;
                grid-template-rows: auto 1fr;
                gap: 2rem;
                backdrop-filter: blur(7px);
                transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s ease, box-shadow 0.3s ease;
                border: 1px solid rgba(255, 255, 255, 0.06);
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);

                /* Asignación de colores únicos ciberpunk por tarjeta */
                &:nth-of-type(4n+1) {
                    background: color-mix(in srgb, var(--wp--preset--color--footer-background) 50%, transparent);
                }

                &:nth-of-type(4n+2) {
                    background: color-mix(in srgb, var(--wp--preset--color--contrast) 50%, transparent);
                }

                &:nth-of-type(4n+3) {
                    background: color-mix(in srgb, var(--wp--preset--color--primary) 50%, transparent);
                }

                &:nth-of-type(4n+4) {
                    background: color-mix(in srgb, var(--wp--preset--color--base) 40%, transparent);
                }

                /* Elevar contenido sobre los brillos base */
                &>* {
                    position: relative;
                    z-index: 2;
                }

                /* Resplandor interno dinámico (Mouse tracking) */
                &::before {
                    content: "";
                    position: absolute;
                    inset: 0;
                    background: radial-gradient(600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.15), transparent 50%);
                    opacity: 0;
                    transition: opacity 0.4s ease;
                    pointer-events: none;
                    z-index: -1;
                    border-radius: inherit;
                    corner-shape: inherit;
                }

                /* Borde dinámico animado que sigue al ratón */
                &::after {
                    content: "";
                    position: absolute;
                    inset: -1px;
                    background: radial-gradient(400px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.85), transparent 50%);
                    opacity: 0;
                    transition: opacity 0.4s ease;
                    pointer-events: none;
                    z-index: 1;
                    border-radius: inherit;
                    corner-shape: inherit;
                    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
                    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
                    -webkit-mask-composite: xor;
                    mask-composite: exclude;
                    padding: 1px;
                }

                &:hover {
                    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
                    border-color: rgba(255, 255, 255, 0.3);
                }

                &:hover::before,
                &:hover::after {
                    opacity: 1;
                }

                & .how-it-works--card-content {
                    & img {
                        margin-inline: auto;
                        margin-bottom: 2rem;
                        filter: invert(1);
                        width: 64px;
                    }

                    & h3 {
                        text-align: left;
                    }

                    & p {
                        text-align: left;
                        opacity: .6;
                    }

                    & ul {
                        margin-top: 1rem;
                        text-align: left;
                        padding-left: 1rem;
                    }
                }

                & .btn-more-info {
                    align-self: end;
                    margin-right: auto;
                    background-color: transparent;
                    border: none;
                    color: var(--wp--preset--color--base);
                    font-family: var(--wp--preset--font-family--manrope);
                    display: flex;
                    align-items: center;
                    gap: .5rem;

                    & svg {
                        width: 16px;
                        height: 16px;
                    }

                    &:hover {
                        cursor: pointer;
                    }
                }
            }
        }
    }
}


/* Full-screen modal for #how-works--complete */
#how-works--complete.how-works-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#how-works--complete.how-works-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.how-works-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 26, 0.65);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
}

.how-works-modal-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100dvh;
    max-height: 750px;
    background: var(--wp--preset--color--footer-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
    color: #f3f4f6;
    overflow: hidden;

    /* Resplandor interno dinámico */
    &::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.15), transparent 50%);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
        z-index: -1;
        border-radius: inherit;
        corner-shape: inherit;
    }

    /* Borde dinámico animado que sigue al ratón */
    &::after {
        content: "";
        position: absolute;
        inset: -1px;
        background: radial-gradient(400px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.85), transparent 50%);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
        z-index: 1;
        border-radius: inherit;
        corner-shape: inherit;
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        padding: 1px;
    }

    &:hover::before,
    &:hover::after {
        opacity: 1;
    }
}

#how-works--complete.how-works-modal.is-active .how-works-modal-container {
    transform: translateY(0) scale(1);
}

.how-works-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.how-works-modal-close:hover {
    color: #f3f4f6;
    transform: rotate(90deg);
}

.how-works-modal-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 1rem;
    margin-top: 1rem;

    &::-webkit-scrollbar {
        width: 6px;
    }

    &::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.03);
        border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }
}

.how-works-modal-content .modal-title {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.how-works-modal-content .modal-wysiwyg {
    font-size: 1.15rem;
    line-height: 1.75;
    color: #d1d5db;
}

.how-works-modal-content .modal-wysiwyg p {
    margin-bottom: 1.5rem;
}

.how-works-modal-content .modal-wysiwyg h2,
.how-works-modal-content .modal-wysiwyg h3 {
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.how-works-modal-content .modal-wysiwyg strong {
    color: #fff;
}

/* Animación Cyberpunk de Procesamiento de Soluciones */
@keyframes circuitDrift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -200px 200px;
    }
}

@keyframes cyberLaserSweep {
    0% {
        background-position: center -300px;
    }

    15% {
        background-position: center 160%;
    }

    /* Barrido rápido inicial */
    100% {
        background-position: center 160%;
    }

    /* Pausa antes del siguiente ciclo */
}

/* Animaciones de Flujo de Paquetes de Luz (Circuitería Activa) */
@keyframes runPacketHorizontal {
    0% {
        left: -250px;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    35% {
        left: 110%;
        opacity: 1;
    }

    40% {
        left: 120%;
        opacity: 0;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

@keyframes runPacketVertical {
    0% {
        top: -250px;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    35% {
        top: 110%;
        opacity: 1;
    }

    40% {
        top: 120%;
        opacity: 0;
    }

    100% {
        top: 120%;
        opacity: 0;
    }
}

/* Pulsación Vital del Núcleo del Microchip */
@keyframes chipCoreBeat {
    0% {
        opacity: 0.7;
        transform: scale(0.92);
        box-shadow: 0 0 10px rgba(0, 217, 255, 0.7), 0 0 20px rgba(0, 217, 255, 0.3);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(0, 217, 255, 1), 0 0 40px rgba(0, 217, 255, 0.6);
    }
}

/* Radar Animations */
@keyframes radar-sweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes radar-blip-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

@keyframes blip-move-1 {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(30px, -40px);
    }

    66% {
        transform: translate(-20px, 15px);
    }

    100% {
        transform: translate(10px, 20px);
    }
}

@keyframes blip-move-2 {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(-40px, 20px);
    }

    66% {
        transform: translate(20px, -30px);
    }

    100% {
        transform: translate(-10px, -15px);
    }
}

@keyframes blip-move-3 {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(25px, 35px);
    }

    66% {
        transform: translate(-30px, -20px);
    }

    100% {
        transform: translate(-15px, 25px);
    }
}

@keyframes blip-move-4 {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(-20px, -30px);
    }

    66% {
        transform: translate(35px, 20px);
    }

    100% {
        transform: translate(15px, -25px);
    }
}

@keyframes blip-move-5 {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(40px, 10px);
    }

    66% {
        transform: translate(-10px, -40px);
    }

    100% {
        transform: translate(-25px, 15px);
    }
}