/*MAIN BacK*/

main {
    font-family: 'Montserrat';
    color: #FFF;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.desc {
    background-color: #000;
    background-image: url(../img/orig.jpg);
    background-size: cover;
    background-position: center;
    padding: 192px 431px;
    position: relative;
    box-sizing: border-box;
    min-height: calc(100vh - 100px);
}

.desc::before {
    content: '';
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.desc-items {
    position: relative;
    /* min-width: 300px; */
    max-width: 700px;
}

.desc-items-header {
    font-family: 'Jost';
    font-weight: 700;
    font-size: 64px;
    line-height: 92px;
    color: #FFF;
    margin: 0 0 44px;
}

.desc-items-text {
    font-weight: 500px;
    font-size: 32px;
    line-height: 39px;
    margin: 0 0 96px;
}

.best {
    background-color: #EBEBEB;
    padding: 85px 0 0 0;
    min-height: calc(100vh - 96px);
    box-sizing: border-box;
}

.best-wrp {
    margin: 0 auto;
    width: 90vw;
}

.best-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.best-header {
    font-family: 'Jost';
    font-weight: 700;
    font-size: 64px;
    line-height: 92px;
    color: #000;
}

.best-project {
    display: flex;
    justify-content: space-between;
    min-width: 300px;
    max-width: 1790px;
    padding: 100px 0 100px;
    flex-wrap: wrap;
    gap: 35px;
}

.best-project-item {
    text-decoration: none;
    background-color: #151515;
    width: 320px;
    min-height: 420px;
    color: #CCC;
    display: flex;
    justify-content: center;
    align-items: end;
    padding-bottom: 35px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition:
        transform 0.3s ease,
        background-color 0.3s ease,
        /* фон */
        box-shadow 0.3s ease,
        /* тень */
        color 0.3s ease;
    /* текст */
}

.best-project-item a {
    text-decoration: none;
    color: #CCC;
    font-weight: 500;
}

.best-project-item:hover a {
    color: #4b35ff;
}

/* 2. Лёгкая подсветка фона + тень */
.best-project-item:hover {
    background-color: #222;
    /* чуть светлее #151515 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    /* “приподнимаем” карточку тенями */
}

/* 3. Перецвет текста */
.best-project-item:hover {
    color: #4b35ff;
    /* акцентный розово-фиолетовый */
}

/* 4. Анимированная «underline» под текстом */
.best-project-item::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    width: 0;
    height: 3px;
    background: #4b35ff;
    transition: width 0.3s ease, left 0.3s ease;
}

.best-project-item:hover::after {
    width: 60%;
    left: 20%;
}

/* Лёгкий градиент-оверлей */
.best-project-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(75, 53, 255, 0.2), transparent);
    /*background: linear-gradient(135deg, #4B35FF33,transparent);*/
    opacity: 0;
    transition: opacity 0.3s ease;
}

.best-project-item:hover::before {
    opacity: 1;
}

.best-project-item:active {
    transform: scale(0.95);
}

/*! ADAPTIVE */


@media (max-width: 1540px) {
    .best-wrp {
        width: 60vw;
    }

    .best-header {
        font-size: 50px;
    }

    .best-project-item {
        align-self: center;
    }

    .desc {
        padding: 96px 215px;
    }

    .desc-items-header {
        font-size: 48px;
        line-height: 64px;
    }

    .desc-items-text {
        font-size: 24px;
    }
}

@media (max-width: 1300px) {
    .best-flex {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 1130px) {
    .best-wrp {
        width: 80vw;
    }

    .best-header {
        white-space: nowrap;
        margin-bottom: 10%;
    }

    .best-project {
        padding: 10% 0;
    }

    .desc {
        text-align: center;
    }

    .desc-items {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 850px) {
    .best-wrp {
        width: 50vw;
    }

    .best-project {
        justify-content: center;
    }
}

@media (max-width:640px) {

    .best-wrp {
        width: 90vw;
    }

    .best-header {
        font-size: 10vw;
        line-height: 10vw;
        text-align: center;
    }

    .desc {
        padding: 48px 25px;
        box-sizing: border-box;
    }

    .desc-items-header {
        font-size: 30px;
        line-height: 48px;
    }

    .desc-items-text {
        font-size: 20px;
    }

    .desc .ruby-button {
        justify-self: center;
        font-size: 5vw;
    }

    .ruby-button-big {
        width: 50vw;
    }
}