/* SERVICIOS SECTION - THE "OBSIDIAN PORTAL" */
/* A masterpiece of deep dark UI with neon accents */

.services-section {
    position: relative;
    padding: 150px 0 100px;
    background-color: #020205;
    /* Deepest Void Black */
    z-index: 10;
    overflow: hidden;
    /* Extraordinary Separation: "The Digital Rift" */
    /* This creates a concave separation that pulls the eye down */
    clip-path: polygon(0 0, 50% 100px, 100% 0, 100% 100%, 0 100%);
    margin-top: -80px;
    /* Overlap with previous section */
}

/* Background Atmosphere */
.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, rgba(15, 30, 92, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(86, 186, 231, 0.1) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.services-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
}

.services-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    text-align: center;
    color: #fff;
    margin-bottom: 120px;
    /* Extra space for the floating cards */
    text-transform: uppercase;
    letter-spacing: -2px;
    position: relative;
}

.services-title span {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5);
    position: relative;
}

.services-title span::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    color: var(--cp-cyan);
    -webkit-text-stroke: 0;
    border-right: 2px solid var(--cp-cyan);
    overflow: hidden;
    white-space: nowrap;
    animation: typeFill 4s ease-in-out infinite alternate;
}

@keyframes typeFill {

    0%,
    20% {
        width: 0;
    }

    80%,
    100% {
        width: 100%;
    }
}

/* THE CARDS GRID */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    perspective: 2000px;
}

/* "PORTAL" CARD DESIGN */
.svc-card {
    position: relative;
    height: 500px;
    background: rgba(20, 20, 30, 0.5);
    border-radius: 30px;
    overflow: visible;
    /* Crucial for the floating icon */
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.svc-card:hover {
    transform: translateY(-20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    background: rgba(20, 20, 30, 0.8);
}

/* 1. Image Area (Top) */
.svc-img-box {
    width: 100%;
    height: 65%;
    /* Dominant image area */
    position: relative;
    overflow: hidden;
    border-radius: 30px 30px 100% 30px;
    /* Avant-garde curve */
    border-bottom: 2px solid rgba(86, 186, 231, 0.2);
}

.svc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease, filter 0.8s ease;
    filter: grayscale(100%) contrast(1.2);
}

.svc-card:hover .svc-img {
    transform: scale(1.15) rotate(2deg);
    filter: grayscale(0%) contrast(1.1);
}

/* Overlay gradient on image */
.svc-img-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(2, 2, 5, 0.9) 100%);
    pointer-events: none;
}

/* 2. The "Seal" (Circle Icon) - Floating between sections */
.svc-icon-seal {
    position: absolute;
    top: 60%;
    /* Position at the cut overlap */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #020205;
    /* Match bg to pretend it's cutting through */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.02);
    /* Ripple effect ring */
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* The actual colored circle inside the seal spacer */
.svc-icon-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    background: #1a1a2e;
    /* Default dark state */
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Shine on icon */
.svc-icon-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    transform: scale(0.5);
}

.svc-card:hover .svc-icon-inner::before {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.1s;
}

.svc-card:hover .svc-icon-seal {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.05);
}

/* 3. Title Area (Bottom) */
.svc-info {
    height: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* Push to bottom */
    padding-bottom: 40px;
    text-align: center;
}

.svc-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 10px;
    position: relative;
    transition: all 0.4s ease;
}

.svc-title::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--active-color);
    margin: 10px auto 0;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-card:hover .svc-title::after {
    width: 50px;
}

.svc-card:hover .svc-title {
    color: var(--active-color);
    text-shadow: 0 0 20px var(--active-shadow);
}

/* --- INDIVIDUAL CARD THEMES --- */

/* 1. Offset (White/Silver) */
.svc-offset {
    --active-color: #ffffff;
    --active-shadow: rgba(255, 255, 255, 0.5);
}

.svc-offset:hover .svc-icon-inner {
    background: linear-gradient(135deg, #e0e0e0, #ffffff);
    color: #000;
    border-color: #fff;
}

/* 2. Digital (Blue/Cyan) */
.svc-digital {
    --active-color: #00E5FF;
    --active-shadow: rgba(0, 229, 255, 0.5);
}

.svc-digital:hover .svc-icon-inner {
    background: linear-gradient(135deg, #00E5FF, #0099aa);
    color: #000;
    border-color: #00E5FF;
}

/* 3. Labels (Deep Magenta/Purple) note: User said "Etiquetas en Rollo" - adjusting to standard palette, maybe Magenta? */
.svc-labels {
    --active-color: #FF00E6;
    --active-shadow: rgba(255, 0, 230, 0.5);
}

.svc-labels:hover .svc-icon-inner {
    background: linear-gradient(135deg, #FF00E6, #aa0099);
    color: #fff;
    border-color: #FF00E6;
}

/* 4. Laser (Yellow/Gold) */
.svc-laser {
    --active-color: #FFEA00;
    --active-shadow: rgba(255, 234, 0, 0.5);
}

.svc-laser:hover .svc-icon-inner {
    background: linear-gradient(135deg, #FFEA00, #bba300);
    color: #000;
    border-color: #FFEA00;
}

/* Responsive */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-section {
        clip-path: polygon(0 0, 50% 50px, 100% 0, 100% 100%, 0 100%);
    }

    .svc-card {
        height: 450px;
    }
}