/* Tilted Card - Vanilla JavaScript Implementation */

.tilted-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.tilted-card-figure {
    position: relative;
    width: 100%;
    height: 300px;
    perspective: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tilted-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.tilted-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    will-change: transform;
    transform: translateZ(0);
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    display: block;
    z-index: 1;
}

.tilted-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tilted-card-figure:hover .tilted-card-overlay {
    opacity: 1;
}

.tilted-card-overlay-content {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tilted-card-caption {
    pointer-events: none;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    font-size: 11px;
    color: #1a1a1a;
    opacity: 0;
    z-index: 3;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translate(-50%, -100%) translateY(-8px);
    transition: opacity 0.2s ease;
}

.tilted-card-figure:hover .tilted-card-caption {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .tilted-card-container {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 16px;
    }
    
    .tilted-card-figure {
        height: 250px;
    }
    
    .tilted-card-caption {
        display: none;
    }
}

