
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1a2a6c 0%, #2a3a8c 50%, #4a4a8c 100%);
    transition: background 0.5s ease;
    padding: 20px;
    color: #333;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #0f1a4a 0%, #1e2b6b 50%, #3a3a7b 100%);
    z-index: -2;
    transition: clip-path 0.5s ease;
    clip-path: circle(250px at center);
}

.container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 400px;
}

.card {
    position: absolute;
    top: calc(50% - 200px); /* Center vertically */
    left: 50%; /* Center horizontally */
    width: 300px;
    height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%) translateY(calc(50px * var(--i))) rotate(40deg) skew(-20deg, -10deg) scale(0.6);
    z-index: calc(-1 * var(--i));
    display: flex;
    justify-content: center;
    align-items: center;
    /* Smooth transition with bounce effect */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:nth-child(2) {
    opacity: 0.8;
}

.card:nth-child(3) {
    opacity: 0.6;
}

.container:hover .card {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1; /* Bring all cards to front */
    opacity: 1; /* Full opacity on hover */
    /* Spread cards horizontally with transformation */
    transform: translateX(calc(-50% + calc(350px * var(--i)))) translateY(-50%) rotate(0deg) skew(0deg, 0deg) scale(1);
}

.card-content {
    padding: 35px;
    color: #2c3e50;
    opacity: 0; /* Initially hidden */
    transition: all 0.5s ease;
    transform: translateY(50px); /* Start position for animation */
}

/* Content reveal animation on hover */
.container:hover .card-content {
    opacity: 1;
    transition-delay: calc(0.2s * var(--j));
    transform: translateY(0px); /* End position */
}

.card-title {
    margin-bottom: 20px;
    font-size: 1.6rem;
    font-weight: 600;
    color: #1a2a6c;
    line-height: 1.3;
}

.card-text {
    line-height: 1.7;
    color: #5d6d7e;
    font-size: 1rem;
}

/* Tablet and mobile styles */
@media (max-width: 991px) {
    /* Remove background effect on smaller screens */
    body::before {
        clip-path: circle(0px at center);
    }

    .container {
        height: initial;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Reset card positioning for mobile */
    .card {
        position: relative;
        top: initial;
        left: initial;
        transform: initial;
        margin: 20px;
        opacity: 1 !important; /* Force full opacity */
    }

    /* Disable hover effects on mobile */
    .container:hover .card {
        position: relative;
        top: initial;
        left: initial;
        transform: initial;
    }

    /* Always show content on mobile */
    .card-content {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .card {
        width: 100%;
        max-width: 350px;
        height: 300px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .card {
        height: 280px;
    }
    
    .card-content {
        padding: 25px;
    }
    
    .card-title {
        font-size: 1.4rem;
    }
}
