:root {
    --card-width: 300px;
    --card-height: 400px;
    --card-transition-duration: 800ms;
    --card-transition-easing: cubic-bezier(0.05, 0.43, 0.25, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a1a;
    overflow: hidden;
    perspective: 1000px;
    cursor: none;
}

#gallery {
    display: flex;
    gap: 32px;
    padding: 32px;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform var(--card-transition-duration) var(--card-transition-easing);
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card.flipped .card-content {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.card-title {
    position: absolute;
    bottom: 24px;
    left: 24px;
    color: white;
    font-size: 24px;
    font-weight: 500;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
}

.card-back h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.card-back p {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.9;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 24px;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.1),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
}

.card:hover::before {
    opacity: 1;
}

#cursor {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, transform 0.1s;
    z-index: 9999;
}

#cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s;
}

#cursor.clickable {
    width: 24px;
    height: 24px;
}

#cursor.clickable::after {
    transform: translate(-50%, -50%) scale(1.5);
}
