body {
    font-family: Arial, sans-serif;
    background: #111;
    color: white;
    text-align: center;
    padding: 40px;
}

section {
    margin: 60px 0;
}

/* 3D ROTATION */

.card-container {
    perspective: 1000px;
    display: inline-block;
}

.card {
    width: 200px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.card-container:hover .card {
    transform: rotateY(180deg);
}

.card div {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border-radius: 10px;
}

.front {
    background: crimson;
}

.back {
    background: teal;
    transform: rotateY(180deg);
}


/* TRANSLATE X (100 → 0) */

.slide-in {
    width: 200px;
    padding: 20px;
    background: orange;
    margin: auto;
    transform: translateX(1000px);
    animation: slideIn 2s forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}


/* OPACITY + COLOR KEYFRAME */

.fade-text {
    font-size: 28px;
    animation: fadeColor 3s infinite alternate;
}

@keyframes fadeColor {
    0% {
        opacity: 0.2;
        color: #555;
    }
    100% {
        opacity: 1;
        color: #00ffff;
    }
}


/* HOVER SCALE + SHADOW */

.hover-box {
    width: 200px;
    padding: 20px;
    background: purple;
    margin: auto;
    transition: transform 0.4s, box-shadow 0.4s;
    border-radius: 10px;
}

.hover-box:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(255,255,255,0.3);
}


/* IMAGE HOVER FADE SWAP */

.image-container {
    position: relative;
    width: 200px;
    margin: auto;
}

.image-container img {
    width: 100%;
    display: block;
    transition: opacity 0.6s;
    border-radius: 10px;
}

.image-container img.top {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
}

.image-container:hover img.top {
    opacity: 0;
}
