* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e8e8e8;
}

.container {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    cursor: pointer;

}

.container .box {
    position: relative;
    width: 275px;
    height: 275px;
    overflow: hidden;
    transition: 0.5s;
    margin: 25px;
}

.container .box:hover {
    transform: scale(1.25);
    box-shadow: 0 25px 40px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.container .box .img-box {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.container .box .img-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #222, transparent);
    z-index: 1;
    opacity: 0;
    transition: 0.5s;
}

.container .box:hover .img-box::before {
    opacity: 1;
}

.container .box .img-box img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container .box .text-box {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    z-index: 2;
}

.container .box .text-box h2 {
    font-size: 20px;
    margin-bottom: 10px;
    transform: translateY(200px);
    transition: 0.5s;
}

.container .box:hover .text-box h2 {
    transform: translateY(0);
    transition-delay: 0.3s;
}

.container .box .text-box p {
    font-size: 13px;
    line-height: 20px;
    transform: translateY(200px);
    transition: 0.5s;
}

.container .box:hover .text-box p {
    transform: translateY(0);
    transition-delay: 0.4s;
}