@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800&display=swap");

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    height: 100vh;
    background-color: rgb(0, 0, 27);
    color: white;
    font-family: 'Poppins', sans-serif;
}

#portfolio{
    padding: 40px;
}

.work-list{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 40px;
    margin-top: 50px;
}

.work{
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.work img{
    width: 100%;
    border-radius: 10px;
    display: block;
    transition: transform 0.5s;
}

.layer{
    width: 100%;
    height: 0;
    background: linear-gradient(rgba(0,0,0,0.6), rgb(146, 74, 214));
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    font-size: 14px;
    transition: height 0.5s;
}

.layer h3{
    font-weight: 500;
    margin-bottom: 20px;
}

.layer a{
    margin-top: 20px;
    color: rgb(146, 74, 214);
    text-decoration: none;
    font-size: 18px;
    line-height: 60px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
}

.work:hover img{
    transform: scale(1.1);
}

.work:hover .layer{
    height: 100%;
}


@media only screen and (max-width: 600px) {
    #portfolio {
        padding: 20px;
    }
    
    .work-list {
        grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
        grid-gap: 20px;
        margin-top: 20px;
    }
    
    .layer {
        padding: 0 20px;
        font-size: 12px;
    }

    .work:hover img{
        transform: scale(1.1);
    }
    
    .work:hover .layer{
        height: 100%;
    }
}


@media only screen and (min-width: 601px) and (max-width: 768px) {
    #portfolio {
        padding: 30px;
    }
    
    .work-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 30px;
        margin-top: 30px;
    }
    
    .layer {
        padding: 0 30px;
    }

    .work:hover img{
        transform: scale(1.1);
    }
    
    .work:hover .layer{
        height: 100%;
    }
}
