*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    background: #eaeaea
}

.container{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 600px;
    background: #f5f5f5;
    box-shadow: 0 30px 50px #dbdbdb;
}

.container .slide .item{
    width: 200px;
    height: 300px;
    position: absolute;
    top: 50%;
    transform: translate(0, -50%);
    border-radius: 20px;
    box-shadow: 0 30px 50px #505050;
    background-position: 50% 50%;
    background-size: cover;
    display: inline-block;
    transition: 0.5s;
}

.slide .item:nth-child(1),
.slide .item:nth-child(2){
    top: 0;
    left: 0;
    transform: translate(0, 0);
    border-radius: 0;
    width: 100%;
    height: 100%;
}

.slide .item:nth-child(3){
    left: 50% ;
} 

.slide .item:nth-child(4){
    left: calc(50% + 220px);
} 

.slide .item:nth-child(5){
    left: calc(50% + 440px);
    opacity: 0;
} 

/*here n = 0, 1, 2, 3,...*/
.slide .item:nth-child(n + 6){
    left: calc(50% + 110px);
    opacity: 0;
} 

.item .content{
    position: absolute;
    top: 65%;
    left: 100px;
    width: 300px;
    text-align: left;
    color: #ffffff;
    transform: translate(0, -50%);
    font-family: "Outfit", sans-serif;
    display: none;
}

.slide .item:nth-child(2) .content{
    display: block;
}

.content .name{
    font-size: 40px;
    text-transform: uppercase;
    font-weight: bold;
    opacity: 0;
    animation: animate 1s ease-in-out 1 forwards ;
}

.content .desc{
    margin-top: 10px;
    margin-bottom: 20px;
    opacity: 0;
    animation: animate 1s ease-in-out 0.6s 1 forwards;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.652);
}

/* Infinite slider animation */
.slide {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
}

.item {
    flex: 0 0 auto;
    transition: all 0.5s ease;
}

@keyframes animate {
    from{
        opacity: 0;
        transform: translate(0, 100px);
        filter: blur(33px);
    }
    to{
        opacity: 1;
        transform: translate(0);
        filter: blur(0);
    }
}

.button{
    width: 100%;
    text-align: center;
    position: absolute;
    bottom: 20px;
}

.button button{
    width: 40px;
    height: 35px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin: 0 5px;
    border: 1px solid #000;
    transition: 0.3s;
}

.button button:hover{
    background: #606060;
    color: #fff;
}

.button.back {
    background-color: #002769;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    bottom: 8px;

    position: absolute;   
    left: 50%;              
    transform: translateX(-50%);
    width: fit-content;
}

.button.back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000c4d 0%, #065c84 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.button.back:hover::before {
    opacity: 1;
}

.button.back::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.button.back:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.button.back.pulse {
    animation: pulse 2s infinite;
}

@media only screen and (max-width: 900px) {

.container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 400px;
    background: #f5f5f5;
    box-shadow: 0 30px 50px #dbdbdb;
    max-width: 95vw;
    max-height: 95vh;
}

@media (max-width: 900px) {
    .container {
        width: 500px;
        height: 400px;
    }
    
    .slide .item {
        width: 150px;
        height: 225px;
    }
    
.slide .item:nth-child(n+3) {
    width: 160px; 
    height: 240px;
    transform: translate(0, -50%) scale(0.8);
    opacity: 0.85;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    margin-right: 15px;
}

.button {
    z-index: 100; 
}

    .slide .item:nth-child(n+6) {
        display: none ;
    }
    
    .slide .item:nth-child(5) {
        display: none;
    }
    
    .slide .item:nth-child(3) {
        left: 60%;
        display: none;
    }
    .slide .item:nth-child(4) {
        left: calc(60% + 150px);
        display: none;
    }
}
    .item .content {
        left: 50px;
        width: 200px;
        top: 60%;
    }
    
    .content .name {
        font-size: 30px;
    }
    
    .content .desc {
        font-size: 10px;
    }

    
}

