/* Services Tilted Card Effect */
.services-section {
    padding: 6rem 0;
    position: relative;
    /* overflow: hidden; - Removed to handle shadows */
}

.container-fluid {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
}

.tilted-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 16/9;
    /* Replaces fixed height 600px */
    gap: 1.5rem;
    perspective: 1200px;
    /* IMPORTANT for 3D effect */
}

/* The Tilted Item Container */
.tilted-item {
    position: relative;
    flex: 1;
    /* Default flex value */
    margin: 0 5px;
    /* Slight gap */
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    /* Slightly less rounded */
    overflow: hidden;
    cursor: pointer;

    /* Initial Skew State */
    transform: skewX(-10deg);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    /* Shadow follows skew */
    filter: brightness(0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Hover State - Expand and Straighten */
.tilted-item:hover,
.tilted-item.active {
    flex: 3;
    /* Expand width significantly */
    transform: skewX(0);
    /* Straighten up completely */
    filter: brightness(1);
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border-color: var(--primary-color);
    margin: 0 15px;
    /* Add space around active item */
}

.tilted-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.9) 100%);
    transform: skewX(6deg);
    /* Counter skew background?? No, skew wrapper handles it. */
    /* Actually background-image is on wrapper, so overlay just fills it */
}

/* Content Container inside the item */
.tilted-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);

    /* Counter-Skew: Must act opposite to parent's initial skew */
    transform: skewX(10deg);
    transition: transform 0.5s ease;
}

/* When parent straightens (skewX 0), content must also straighten (skewX 0) */
.tilted-item:hover .tilted-content {
    transform: skewX(0);
}

/* Tag style matching image */
.tilted-tag {
    display: inline-block;
    background-color: var(--primary-color);
    /* Neon Green in ref, Orange here */
    color: white;
    /* Black text usually looks better on neon, white on orange */
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
}

.tilted-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Ghost Number */
.tilted-num {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 5rem;
    line-height: 1;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    transform: skewX(10deg);
    /* Counter skew */
    transition: all 0.5s ease;
}

.tilted-item:hover .tilted-num {
    transform: skewX(0);
    color: rgba(255, 255, 255, 0.15);
    right: 30px;
}


/* Mobile Responsive */
@media (max-width: 900px) {
    .tilted-wrapper {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .tilted-item {
        width: 100%;
        height: 350px;
        transform: none;
        /* No skew on mobile */
        filter: brightness(0.8);
        flex: none;
    }

    .tilted-content,
    .tilted-num {
        transform: none;
        /* No counter-skew */
    }

    .tilted-item:hover,
    .tilted-item.active {
        transform: none;
        flex: none;
        /* No expansion on mobile */
        margin: 0;
        /* Reset margins */
        box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
        /* Reset shadow */
        border-color: rgba(255, 255, 255, 0.1);
        /* Reset border */
    }

    .tilted-item:hover .tilted-content,
    .tilted-item:hover .tilted-num,
    .tilted-item.active .tilted-content,
    .tilted-item.active .tilted-num {
        transform: none;
    }
}