.projects {
    padding: 90px 20px 100px;
    background: #ffffff;
    border-radius: 50px;
    overflow: hidden;
}

.projects__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    padding: 0 20px;
    margin-bottom: 60px;
}

.projects__title {
    position: relative;
    text-transform: uppercase;
}

.projects__title h1 {
    width: max-content;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1B1B1B;
}

.projects__title span {
    position: absolute;
    top: -95px;
    left: -40px;
    font-family: 'Jost';
    color: rgba(27, 27, 27, 0.03);
    font-size: 150px;
    pointer-events: none;
}

.projects__filters {
    width: 100%;
    max-width: 950px;
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-right: -40px;
    overflow-x: auto;
    scrollbar-width: none;
}

.projects__filter-list {
    display: flex;
    align-items: center;
    color: rgba(27, 27, 27, 0.5);
    text-transform: uppercase;
    list-style: none;
    margin: 0;
    padding: 0;
    padding-right: 40px;
    cursor: pointer;
    white-space: nowrap;
}

.projects__filter-list li:not(:last-child):after {
    content: '/';
    color: rgba(27, 27, 27, 0.5);
    margin: 0 10px;
}

.projects__filters  span {
    transition: all .3s ease-in-out;
}

.projects__filter:hover, .projects__filter--active {
    color: rgba(27, 27, 27, 1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
}

.projects-grid__item:nth-child(8n+1)  { grid-column: 1 / 3; }  /* 2 колонки */
.projects-grid__item:nth-child(8n+2)  { grid-column: 3 / 4; }  /* 1 колонка */
.projects-grid__item:nth-child(8n+3)  { grid-column: 4 / 5; }  /* 1 колонка */
.projects-grid__item:nth-child(8n+4)  { grid-column: 1 / 3; }  /* 2 колонки */
.projects-grid__item:nth-child(8n+5)  { grid-column: 3 / 5; }  /* 2 колонки */
.projects-grid__item:nth-child(8n+6)  { grid-column: 1 / 2; }  /* 1 колонка */
.projects-grid__item:nth-child(8n+7)  { grid-column: 2 / 4; }  /* 2 колонки */
.projects-grid__item:nth-child(8n+8)  { grid-column: 4 / 5; }  /* 1 колонка */

.projects-grid__link {
    width: 100%;
    height: 100%;
    min-height: 500px;
    position: relative;
    display: block;
    background: var(--bg-color, #19191A);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
}

.projects-grid__link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            120deg,
            rgba(255,255,255,0.1),
            rgba(255,255,255,0)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.projects-grid__image {
    object-fit: contain;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}

.projects-grid__image--desktop {
    top: 0;
    width: 80%;
    height: 80%;
}

.projects-grid__image--mobile {
    width: 80%;
    object-fit: contain;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
}

.projects-grid__item:hover .projects-grid__image {
    transform: scale(1.05);
}

.projects-grid__item:hover .projects-grid__link::after {
    opacity: 1;
}

.projects-grid__title {
    position: absolute;
    top: 20px;
    left: 25px;
    font-size: 14px;
    font-weight: 400;
    max-width: 80%;
    color: #FFFFFF;
    z-index: 2;
    text-transform: uppercase;
}

.projects-grid__badge {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    z-index: 2;
    padding: 8px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
}

.projects-grid__tags {
    position: absolute;
    bottom: 25px;
    left: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
    margin: 0;
    padding: 0;
    list-style: none;
}

.projects-grid__tag {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 400;
    padding: 8px;
    border-radius: 4px;
    text-transform: uppercase;
    cursor: default;
}

.projects__button-container {
    margin-top: 60px;
    text-align: center;
    padding: 0 20px;
}

.projects__button {
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    width: 201px;
    height:48px;
    font-size: 14px;
    background: conic-gradient(from 80deg at 0.02% 100%, #1B1B1B 0deg, #303030 360deg), #F0F0F0;
    transition: opacity 0.3s ease;
    color: #FFFFFF;
    justify-content: center;
    text-transform: uppercase;
}

@media (max-width: 1600px) {
    .projects-grid__badge {
        font-size: 12px;
        min-width: 46px;
        height: 34px;
        padding: 5px 10px;
    }

    .projects-grid__tags {
        left: 20px;
    }

    .projects-grid__tag {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 1500px) {
    .projects-grid__tag {
        font-size: 10px;
    }
}

@media (max-width: 1200px) {
    .projects-grid__link {
        min-height: 400px;
    }
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .projects-grid__item:nth-child(8n+1),
    .projects-grid__item:nth-child(8n+2),
    .projects-grid__item:nth-child(8n+3),
    .projects-grid__item:nth-child(8n+4),
    .projects-grid__item:nth-child(8n+5),
    .projects-grid__item:nth-child(8n+6),
    .projects-grid__item:nth-child(8n+7),
    .projects-grid__item:nth-child(8n+8) {
        grid-column: span 1;
    }

    .projects-grid__link {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .projects {
        padding: 70px 15px;
        border-radius: 30px;
    }

    .projects__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        padding: 0;
        margin-bottom: 40px;
    }

    .projects__title h1 {
        font-size: 18px;
        font-weight: 500;
    }

    .projects__title span {
        top: -30px;
        left: -10px;
        font-size: 60px;
    }

    .projects__filters {
        margin-right: -30px;
    }

    .projects__filter-list {
        padding-right: 30px;
    }

    .projects-grid {
        grid-template-columns: repeat(1, 1fr);
        padding: 0;
    }

    .projects-grid__link {
        min-height: 350px;
    }

    .projects__button-container {
        margin-top: 40px;
    }

    .projects__button {
        width: 150px;
        height: 45px;
        font-size: 12px;
    }
}