/* ==========================================================================
   Markad Publicidad Estudio — Cuadrícula de servicios
   ========================================================================== */


/* --------------------------------------------------------------------------
   Sección
   -------------------------------------------------------------------------- */

.mk-services-grid {
    position: relative;
    overflow: hidden;
    color: var(--mk-text-primary);
    background: var(--mk-white);
}


/* --------------------------------------------------------------------------
   Contenedor
   -------------------------------------------------------------------------- */

.mk-services-grid__container {
    padding-block: clamp(88px, 9vw, 140px);
}


/* ==========================================================================
   Encabezado
   ========================================================================== */

.mk-services-grid__header {
    width: min(820px, 100%);
    margin-inline: auto;
    text-align: center;
}


/* --------------------------------------------------------------------------
   Etiqueta
   -------------------------------------------------------------------------- */

.mk-services-grid__eyebrow {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 7px 17px;
    border: 1px solid rgba(16, 26, 69, 0.13);
    border-radius: var(--mk-border-radius-pill);
    color: var(--mk-magenta-700);
    background: var(--mk-white);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    box-shadow:
        0 8px 24px
        rgba(8, 13, 38, 0.05);
}


/* --------------------------------------------------------------------------
   Título
   -------------------------------------------------------------------------- */

.mk-services-grid__title {
    max-width: 820px;
    margin: 0 auto;
    color: var(--mk-indigo-950);
    font-family: var(--mk-font-heading);
    font-size: clamp(2.2rem, 4vw, 3.7rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.038em;
    text-wrap: balance;
}


/* --------------------------------------------------------------------------
   Descripción
   -------------------------------------------------------------------------- */

.mk-services-grid__description {
    max-width: 720px;
    margin: 24px auto 0;
    color: var(--mk-text-secondary);
    font-size: 1.04375rem;
    line-height: 1.7;
    text-wrap: balance;
}


/* ==========================================================================
   Cuadrícula
   ========================================================================== */

.mk-services-grid__items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(20px, 2vw, 28px);
    margin-top: clamp(54px, 6vw, 82px);
    perspective: 1400px;
    perspective-origin: center;
}


/* ==========================================================================
   Tarjeta
   ========================================================================== */

.mk-services-card {
    position: relative;
    min-width: 0;
    min-height: 100%;
    transform-style: preserve-3d;
}


/* --------------------------------------------------------------------------
   Superficie
   -------------------------------------------------------------------------- */

.mk-services-card__surface {
    --mk-card-rotate-x: 0deg;
    --mk-card-rotate-y: 0deg;
    --mk-card-shift-x: 0px;
    --mk-card-shift-y: 0px;

    position: relative;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    padding: clamp(28px, 2.5vw, 38px);
    border: 1px solid rgba(16, 26, 69, 0.1);
    border-radius: 20px;
    background: var(--mk-white);
    box-shadow:
        0 12px 34px
        rgba(8, 13, 38, 0.055);
    transform:
        translate3d(
            var(--mk-card-shift-x),
            var(--mk-card-shift-y),
            0
        )
        rotateX(var(--mk-card-rotate-x))
        rotateY(var(--mk-card-rotate-y));
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
    transition:
        border-color 320ms ease,
        box-shadow 320ms ease,
        transform 220ms ease;
}


/* --------------------------------------------------------------------------
   Línea superior
   -------------------------------------------------------------------------- */

.mk-services-card__surface::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--mk-magenta-600);
    content: "";
    transform: translateX(-50%);
    transition: width 360ms ease;
}


/* --------------------------------------------------------------------------
   Resplandor que sigue el puntero
   -------------------------------------------------------------------------- */

.mk-services-card__glow {
    position: absolute;
    top: var(--mk-glow-y, 50%);
    left: var(--mk-glow-x, 50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(189, 57, 220, 0.09);
    filter: blur(34px);
    opacity: 0;
    pointer-events: none;
    transform:
        translate3d(-50%, -50%, 1px);
    transition: opacity 320ms ease;
}

.mk-services-card:hover .mk-services-card__surface {
    box-shadow: 0 12px 34px rgba(8, 13, 38, 0.055);
}


/* ==========================================================================
   Capas interiores
   ========================================================================== */

.mk-services-card__icon,
.mk-services-card__title,
.mk-services-card__features,
.mk-services-card__description {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    transition:
        color 300ms ease,
        transform 320ms cubic-bezier(
            0.22,
            1,
            0.36,
            1
        );
}


/* --------------------------------------------------------------------------
   Icono
   -------------------------------------------------------------------------- */

.mk-services-card__icon {
    display: inline-flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 1px solid rgba(163, 44, 204, 0.13);
    border-radius: 17px;
    color: var(--mk-magenta-700);
    background: rgba(163, 44, 204, 0.055);
    transform: translateZ(0);
    box-shadow:
        0 8px 22px
        rgba(8, 13, 38, 0.045);
}

.mk-services-card__icon svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* --------------------------------------------------------------------------
   Título de la tarjeta
   -------------------------------------------------------------------------- */

.mk-services-card__title {
    margin: 0;
    color: var(--mk-indigo-950);
    font-family: var(--mk-font-heading);
    font-size: clamp(1.25rem, 1.55vw, 1.48rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.025em;
    text-wrap: balance;
    transform: translateZ(0);
}


/* --------------------------------------------------------------------------
   Características
   -------------------------------------------------------------------------- */

.mk-services-card__features {
    display: grid;
    gap: 11px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    transform: translateZ(0);
}

.mk-services-card__features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--mk-text-secondary);
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.5;
}

.mk-services-card__feature-icon {
    flex: 0 0 auto;
    color: var(--mk-magenta-600);
    font-weight: 800;
    transition:
        color 300ms ease,
        transform 300ms ease;
}


/* --------------------------------------------------------------------------
   Descripción
   -------------------------------------------------------------------------- */

.mk-services-card__description {
    margin: 25px 0 0;
    color: var(--mk-text-secondary);
    font-size: 0.98rem;
    line-height: 1.68;
    transform: translateZ(0);
}


/* ==========================================================================
   Entrada en cascada
   ========================================================================== */

/*
| Las tarjetas solamente se ocultan cuando JavaScript confirma que
| IntersectionObserver está disponible. Así permanecen visibles si JS falla.
*/

.has-services-motion
.mk-services-card {
    opacity: 0;
    transform:
        translate3d(0, 24px, 0)
        scale(0.985);
    transition:
        opacity 650ms ease,
        transform 720ms cubic-bezier(
            0.22,
            1,
            0.36,
            1
        );
    transition-delay: var(--mk-card-delay, 0ms);
}

.has-services-motion
.mk-services-card.is-visible {
    opacity: 1;
    transform:
        translate3d(0, 0, 0)
        scale(1);
}


/* ==========================================================================
   Hover tridimensional
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {

    .mk-services-card:hover {
        z-index: 3;
    }

    .mk-services-card:hover
    .mk-services-card__surface {
        border-color: rgba(163, 44, 204, 0.32);
        box-shadow:
            0 30px 58px
            rgba(8, 13, 38, 0.13),
            0 12px 28px
            rgba(163, 44, 204, 0.08);
    }

    .mk-services-card:hover
    .mk-services-card__surface::before {
        width: 56%;
    }

    .mk-services-card:hover
    .mk-services-card__glow {
        opacity: 1;
    }

    .mk-services-card:hover
    .mk-services-card__icon {
        color: var(--mk-white);
        background: var(--mk-magenta-700);
        transform: translateZ(34px);
        box-shadow:
            0 18px 30px
            rgba(163, 44, 204, 0.22);
    }

    .mk-services-card:hover
    .mk-services-card__title {
        color: var(--mk-indigo-900);
        transform: translateZ(25px);
    }

    .mk-services-card:hover
    .mk-services-card__features {
        transform: translateZ(17px);
    }

    .mk-services-card:hover
    .mk-services-card__description {
        transform: translateZ(10px);
    }

    .mk-services-card:hover
    .mk-services-card__feature-icon {
        color: var(--mk-magenta-700);
        transform: translateX(3px);
    }

}


/* --------------------------------------------------------------------------
   Foco accesible
   -------------------------------------------------------------------------- */

.mk-services-card:focus-within
.mk-services-card__surface {
    border-color: var(--mk-magenta-600);
    box-shadow:
        0 0 0 4px
        rgba(163, 44, 204, 0.12),
        0 24px 48px
        rgba(8, 13, 38, 0.1);
}


/* ==========================================================================
   Pantallas medianas
   ========================================================================== */

@media (max-width: 1180px) {

    .mk-services-grid__items {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mk-services-card__surface {
        min-height: 420px;
    }

}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 760px) {

    .mk-services-grid__container {
        padding-block: 78px;
    }

    .mk-services-grid__description {
        margin-top: 20px;
    }

    .mk-services-grid__items {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 48px;
    }

    .mk-services-card__surface {
        min-height: auto;
        padding: 30px;
    }

}


/* ==========================================================================
   Móvil
   ========================================================================== */

@media (max-width: 520px) {

    .mk-services-grid__container {
        padding-block: 64px;
    }

    .mk-services-grid__eyebrow {
        min-height: 34px;
        margin-bottom: 17px;
        padding: 7px 14px;
        font-size: 0.72rem;
    }

    .mk-services-grid__title {
        font-size: clamp(2rem, 9vw, 2.75rem);
    }

    .mk-services-grid__description {
        font-size: 1rem;
    }

    .mk-services-grid__items {
        margin-top: 42px;
    }

    .mk-services-card__surface {
        padding: 27px 24px 29px;
        border-radius: 17px;
    }

    .mk-services-card__icon {
        width: 54px;
        height: 54px;
        margin-bottom: 22px;
    }

    .mk-services-card__title {
        font-size: 1.3rem;
    }

    .mk-services-card__features {
        margin-top: 21px;
    }

    .mk-services-card__description {
        margin-top: 22px;
    }

}


/* ==========================================================================
   Movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .has-services-motion
    .mk-services-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .mk-services-card__surface,
    .mk-services-card__icon,
    .mk-services-card__title,
    .mk-services-card__features,
    .mk-services-card__description,
    .mk-services-card__feature-icon,
    .mk-services-card__glow {
        transition: none;
    }

}

/* Quitar el resplandor que sigue al mouse */
.mk-services-card__glow {
    display: none;
}