/* =========================================================
   AUTOMATIZACIÓN — ALCANCE
========================================================= */

.dmxAutomation {
    position: relative;
    isolation: isolate;

    padding:
        clamp(5rem, 8vw, 8rem)
        0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f7fbff 0%,
            #ffffff 100%
        );
}

.dmxAutomation::before {
    content: "";

    position: absolute;
    top: -18rem;
    right: -12rem;
    z-index: -1;

    width: 36rem;
    height: 36rem;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(47, 126, 255, 0.1) 0%,
            rgba(47, 126, 255, 0) 72%
        );

    pointer-events: none;
}

.dmxAutomation::after {
    content: "";

    position: absolute;
    bottom: -18rem;
    left: -10rem;
    z-index: -1;

    width: 32rem;
    height: 32rem;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(34, 211, 177, 0.09) 0%,
            rgba(34, 211, 177, 0) 72%
        );

    pointer-events: none;
}

.dmxAutomation .container {
    position: relative;
    z-index: 2;
}


/* =========================================================
   ENCABEZADO
========================================================= */

.dmxAutomationHeader {
    max-width: 48rem;
    margin:
        0 auto
        clamp(3rem, 5vw, 4.5rem);

    text-align: center;
}

.dmxAutomationEyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;

    margin-bottom: 1.25rem;
}

.dmxAutomationEyebrow span {
    width: 2.8rem;
    height: 2px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #2f7eff 0%,
            #25d6b3 100%
        );
}

.dmxAutomationEyebrow small {
    color: #2576d8;

    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.dmxAutomationHeader h2 {
    margin: 0;

    color: #0f172a;

    font-size:
        clamp(
            2.45rem,
            4.8vw,
            4.35rem
        );

    font-weight: 780;
    line-height: 1;
    letter-spacing: -0.052em;
}

.dmxAutomationHeader h2 span {
    display: block;

    color: transparent;

    background:
        linear-gradient(
            100deg,
            #2476e6 0%,
            #3b9df1 48%,
            #1dc7a6 100%
        );

    background-clip: text;
    -webkit-background-clip: text;
}

.dmxAutomationHeader p {
    max-width: 41rem;
    margin:
        1.4rem auto
        0;

    color: #64748b;

    font-size:
        clamp(
            1rem,
            1.2vw,
            1.08rem
        );

    line-height: 1.75;
}


/* =========================================================
   GRID
========================================================= */

.dmxAutomationGrid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 1.25rem;
}


/* =========================================================
   TARJETAS
========================================================= */

.dmxAutomationCard {
    --dmx-automation-rotate-x: 0deg;
    --dmx-automation-rotate-y: 0deg;
    --dmx-automation-pointer-x: 50%;
    --dmx-automation-pointer-y: 50%;

    position: relative;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    min-height: 12rem;
    padding: 1.5rem;

    border:
        1px solid
        rgba(15, 23, 42, 0.08);

    border-radius: 1.35rem;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fbfdff 100%
        );

    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.045);

    opacity: 0;

    transform:
        perspective(1000px)
        translateY(1.6rem)
        rotateX(var(--dmx-automation-rotate-x))
        rotateY(var(--dmx-automation-rotate-y));

    transform-style: preserve-3d;

    transition:
        opacity 650ms ease,
        transform 750ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 300ms ease,
        box-shadow 300ms ease,
        background 300ms ease;
}

.dmxAutomationCard::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 0;

    border-radius: inherit;

    background:
        radial-gradient(
            circle 12rem at
            var(--dmx-automation-pointer-x)
            var(--dmx-automation-pointer-y),
            rgba(47, 126, 255, 0.1),
            transparent 68%
        );

    opacity: 0;

    transition: opacity 300ms ease;

    pointer-events: none;
}

.dmxAutomationCard::after {
    content: "";

    position: absolute;
    top: 0;
    left: 1.5rem;
    z-index: 2;

    width: 3.5rem;
    height: 2px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #2f7eff,
            #25d6b3
        );

    opacity: 0.55;

    transition:
        width 320ms ease,
        opacity 320ms ease;
}

.dmxAutomationCard > * {
    position: relative;
    z-index: 2;
}

.dmxAutomationCard.is-visible {
    opacity: 1;

    transform:
        perspective(1000px)
        translateY(0)
        rotateX(var(--dmx-automation-rotate-x))
        rotateY(var(--dmx-automation-rotate-y));
}

.dmxAutomationCard.is-pointer-active {
    transition:
        opacity 650ms ease,
        transform 120ms ease-out,
        border-color 300ms ease,
        box-shadow 300ms ease,
        background 300ms ease;
}

.dmxAutomationCard.is-pointer-active::before,
.dmxAutomationCard:hover::before {
    opacity: 1;
}

.dmxAutomationCard:hover {
    border-color:
        rgba(
            47,
            126,
            255,
            0.16
        );

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f8fcff 100%
        );

    box-shadow:
        0 26px 55px rgba(15, 23, 42, 0.085);
}

.dmxAutomationCard:hover::after {
    width: 5.5rem;
    opacity: 1;
}


/* =========================================================
   ICONOS
========================================================= */

.dmxAutomationIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1.2rem;

    border:
        1px solid
        rgba(47, 126, 255, 0.11);

    border-radius: 0.95rem;

    color: #2576d8;

    background:
        linear-gradient(
            145deg,
            rgba(47, 126, 255, 0.08),
            rgba(37, 214, 179, 0.07)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65);

    transition:
        transform 320ms ease,
        color 300ms ease,
        border-color 300ms ease,
        background 300ms ease,
        box-shadow 300ms ease;
}

.dmxAutomationIcon svg {
    width: 1.4rem;
    height: 1.4rem;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dmxAutomationCard:hover .dmxAutomationIcon {
    color: #159d82;

    border-color:
        rgba(
            37,
            214,
            179,
            0.2
        );

    background:
        linear-gradient(
            145deg,
            rgba(37, 214, 179, 0.12),
            rgba(47, 126, 255, 0.08)
        );

    box-shadow:
        0 12px 24px rgba(35, 170, 150, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);

    transform:
        translateY(-2px)
        rotate(-2deg);
}


/* =========================================================
   CONTENIDO
========================================================= */

.dmxAutomationCard h3 {
    margin:
        0
        0
        0.6rem;

    color: #0f172a;

    font-size: 1.18rem;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.dmxAutomationCard p {
    margin: 0;

    color: #64748b;

    font-size: 0.94rem;
    line-height: 1.62;
}


/* =========================================================
   CIERRE
========================================================= */

.dmxAutomationBottom {
    display: flex;
    justify-content: center;

    margin-top:
        clamp(
            2.5rem,
            5vw,
            4rem
        );

    opacity: 0;

    transform: translateY(1.5rem);

    transition:
        opacity 650ms ease,
        transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dmxAutomationBottom.is-visible {
    opacity: 1;

    transform: translateY(0);
}

.dmxAutomationBottom p {
    max-width: 48rem;
    margin: 0;
    padding:
        1.3rem
        1.5rem;

    border:
        1px solid
        rgba(15, 23, 42, 0.07);

    border-radius: 1rem;

    color: #475569;

    background:
        rgba(
            255,
            255,
            255,
            0.76
        );

    box-shadow:
        0 14px 34px rgba(15, 23, 42, 0.045);

    font-size: 0.98rem;
    line-height: 1.7;
    text-align: center;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* =========================================================
   REVELADO DEL ENCABEZADO
========================================================= */

.dmxAutomationHeader {
    opacity: 0;

    transform: translateY(1.5rem);

    transition:
        opacity 650ms ease,
        transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dmxAutomationHeader.is-visible {
    opacity: 1;

    transform: translateY(0);
}


/* =========================================================
   RETRASOS
========================================================= */

.dmxAutomationCard:nth-child(2) {
    transition-delay: 70ms;
}

.dmxAutomationCard:nth-child(3) {
    transition-delay: 140ms;
}

.dmxAutomationCard:nth-child(4) {
    transition-delay: 70ms;
}

.dmxAutomationCard:nth-child(5) {
    transition-delay: 140ms;
}

.dmxAutomationCard:nth-child(6) {
    transition-delay: 210ms;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {

    .dmxAutomationGrid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 680px) {

    .dmxAutomation {
        padding:
            clamp(4.5rem, 15vw, 6rem)
            0;
    }

    .dmxAutomationHeader {
        margin-bottom: 2.6rem;
    }

    .dmxAutomationHeader h2 {
        font-size:
            clamp(
                2.3rem,
                11vw,
                3.5rem
            );
    }

    .dmxAutomationGrid {
        grid-template-columns: 1fr;
    }

    .dmxAutomationCard {
        min-height: auto;
        padding: 1.35rem;
    }

    .dmxAutomationCard.is-visible {
        transform: translateY(0);
    }

    .dmxAutomationBottom p {
        padding: 1.1rem;

        text-align: left;
    }

}


/* =========================================================
   FALLBACK SIN BLUR
========================================================= */

@supports not (backdrop-filter: blur(1rem)) {

    .dmxAutomationBottom p {
        background: #ffffff;
    }

}


/* =========================================================
   MOVIMIENTO REDUCIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .dmxAutomationHeader,
    .dmxAutomationCard,
    .dmxAutomationBottom {
        opacity: 1;

        transform: none;

        transition: none;
    }

    .dmxAutomationCard,
    .dmxAutomationIcon,
    .dmxAutomationCard::before,
    .dmxAutomationCard::after {
        transition: none;
    }

}