.item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
}

.item img {
    -o-object-fit: cover;
       object-fit: cover;
    aspect-ratio: 16/9;
    overflow: hidden;
    outline: 1px solid var(--content-color-outline);
}

.item h2 {
    position: absolute;
    width: 100%;
    margin: 0px;
    bottom: 10px;

    font-size: 22px;
    font-family: poppins-extra-light;
    font-weight: normal;
    text-align: center;
    background-color: var(--content-color-main);

    -webkit-clip-path: inset(-1% 50%);

            clip-path: inset(-1% 50%);
    opacity: 0;
    transition-duration: var(--transition-duration-short);
}

#top-projects-heading {
    margin-top: 25px;
    margin-bottom: 25px;
}

#top-projects {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    margin-bottom: 100px;
}

#top-projects>.item img {
    width: 896px;
}

#top-projects .more-top-projects {
    gap: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#top-projects .more-top-projects .item img {
    width: auto;
    height: 144px;
}

#top-projects .more-top-projects .item h2 {
    font-size: 18px;
}

#other-projects-heading {
    margin-top: 25px;
    margin-bottom: 25px;
}

#other-projects {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 75px 50px;
    margin-bottom: 150px;
}

#other-projects .item {
    width: 384px;
    height: auto;
    aspect-ratio: 16/9;
}

#other-projects .item h2 {
    text-overflow: ellipsis;
}

#other-projects .item img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
}

@media (hover: hover) {
    .item:hover h2 {
        -webkit-clip-path: inset(-1% -1%);
                clip-path: inset(-1% -1%);
        opacity: 1;
    }
}

@media not (hover: hover) {
    .item h2 {
        -webkit-clip-path: none;
                clip-path: none;
        opacity: 1;
    }
}

@media (max-width: 1280px) {
    main {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (width < 1280px) {
    .item {
        margin-bottom: 22px;
    }

    .item h2 {
        bottom: auto;
        font-size: 22px;
        top: calc(100% + 1px);
        padding: 2px 0px 2px 0px;
        outline: 1px solid var(--content-color-outline);
    }

    #top-projects-heading {
        margin-top: 0px;
    }

    #top-projects {
        flex-direction: column;
        gap: 80px;
    }

    #top-projects>.item {
        margin-bottom: 36px;
    }

    #top-projects>.item img {
        width: 100%;
    }

    #top-projects>.item h2 {
        padding: 5px 0px 5px 0px;
        font-size: 26px;
    }

    #top-projects .more-top-projects {
        flex-direction: row;
    }

    #top-projects .more-top-projects .item h2{
        font-size: 22px;
    }

    #other-projects {
        gap: 100px;
    }
}

@media (width < 1024px) {
    #top-projects .more-top-projects {
        flex-wrap: wrap;
        justify-content: center;
        gap: 50px 50px;
    }

    #top-projects .more-top-projects .item img {
        width: 384px;
        height: auto;
    }
}

@media (max-width: 768px) {
    #other-projects {
        gap: 75px 50px;
        justify-content: space-around;
    }

    #other-projects .item {
        width: 256px;
    }
}

@media (width < 768px) {
    .item h2 {
        font-size: 18px;
    }

    #top-projects>.item h2 {
        padding: 5px 0px 5px 0px;
        font-size: 20px;
    }

    #top-projects .more-top-projects .item h2{
        font-size: 20px;
    }
}

@media (max-width: 425px) {
    #top-projects {
        gap: 60px;
    }

    #top-projects .more-top-projects {
        gap: 60px;
    }

    #top-projects .more-top-projects .item img {
        width: 100%;
    }

    #other-projects-heading {
        margin-top: 0px
    }

    #other-projects {
        gap: 60px;
        margin-bottom: 100px;
    }

    #other-projects .item {
        width: 100%;
    }
}

@media (max-width: 375px) {
    #top-projects-heading {
        margin-bottom: 10px;
    }

    #top-projects {
        margin-bottom: 50px;
    }

    #top-projects {
        gap: 40px;
    }

    #top-projects .more-top-projects {
        gap: 40px;
    }

    #other-projects-heading {
        margin-bottom: 10px;
    }

    #other-projects {
        gap: 40px;
        margin-bottom: 80px;
    }
}