@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --site-header-h: 45px;
    --font-title: 'Bebas Neue', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}


.services {
    padding: 80px 5%;
    overflow-x: clip;
}

.services__header h2 {
    font-size: clamp(38px, 4.5vw, 56px);
    margin-bottom: 40px;
    font-family: var(--font-title);
}

.services__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.service-card {
    display: block;
    position: relative;
    height: 520px;
    border-radius: 28px;
    overflow: hidden;
    background: #000;
    grid-column: auto;
    color: inherit;
    text-decoration: none;
    transform: translateZ(0);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms ease;
}

@media (min-width: 641px) {
    .services__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1025px) {
    .services__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .service-card {
        grid-column: span 4;
    }

    /* Cuando hay 5 cards: centra las 2 últimas en la segunda fila */
    .services__grid > .service-card:nth-child(4):nth-last-child(2) {
        grid-column: 3 / span 4;
    }

    .services__grid > .service-card:nth-child(5):nth-last-child(1) {
        grid-column: 7 / span 4;
    }
}

.service-card video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.02) contrast(1.02);
    pointer-events: none;
    transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 420ms ease;
}

.service-card video::-webkit-media-controls,
.service-card video::-webkit-media-controls-enclosure,
.service-card video::-webkit-media-controls-panel {
    display: none !important;
}

.service-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.48));
    z-index: 1;
    transition: opacity 280ms ease;
}
.service-card__overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.18);
}

.service-card__content {
    position: absolute;
    bottom: 28px;
    left: 28px;
    right: 28px;
    z-index: 2;
    transform: translateY(0);
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.service-card__content h3 {
    color: #fff;
    font-size: clamp(32px, 4.6vw, 52px);
    margin-bottom: 16px;
    letter-spacing: 2px;
    font-family: var(--font-title);
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.service-card__tagline {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    line-height: 1.5;
    max-width: 34ch;
    text-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.btn-card {
    display: inline-block;
    border: 2px solid #ffcc0a;
    background: linear-gradient(180deg, #141947 0%, #07091d 100%);
    color: #a78e2a;
    padding: 12px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease,
        filter 220ms ease;
}

.btn-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-120%);
    transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.btn-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.btn-card:active {
    transform: translateY(0) scale(0.98);
}

.services__footer {
    margin-top: 56px;
    text-align: center;
}

.btn-main {
    display: inline-block;
    padding: 16px 36px;
    border-radius: 999px;
    border: 2px solid #111;
    text-decoration: none;
    color: #111;
    font-size: 20px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.75);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease,
        border-color 220ms ease, background 220ms ease;
}

.btn-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.btn-main:focus-visible {
    outline: 2px solid #111;
    outline-offset: 4px;
}

.btn-main:active {
    transform: translateY(0) scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
    .service-card:hover,
    .service-card:focus-within {
        transform: translateY(-6px) scale(1.01);
        box-shadow: 0 22px 52px rgba(0, 0, 0, 0.26);
    }

    .service-card:hover video,
    .service-card:focus-within video {
        transform: scale(1.08);
        filter: saturate(1.08) contrast(1.06);
    }

    .service-card:hover .service-card__overlay,
    .service-card:focus-within .service-card__overlay {
        opacity: 0.85;
    }

    .service-card:hover .service-card__content,
    .service-card:focus-within .service-card__content {
        transform: translateY(-6px);
    }

    .btn-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
        filter: brightness(1.02);
    }

    .btn-card:hover::after {
        transform: translateX(120%);
    }

    .btn-main:hover {
        transform: translateY(-2px);
        border-color: rgba(17, 17, 17, 0.65);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
    }

    .btn-main:hover::after {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card video,
    .service-card__overlay,
    .service-card__content,
    .btn-card,
    .btn-card::after,
    .btn-main,
    .btn-main::after {
        transition: none !important;
    }
}
@media (max-width: 900px) {
    .services {
        padding: 64px 16px;
    }

    .service-card {
        height: 440px;
    }

    .service-card__content {
        left: 18px;
        right: 18px;
        bottom: 18px;
    }

    .service-card__content h3 {
        margin-bottom: 12px;
    }
}

@media (max-width: 640px) {
    .service-card {
        height: 420px;
    }

    .services__header h2 {
        font-size: 42px;
    }
}
