@font-face {
    font-family: "IBM Plex Sans";
    src: url('fonts/IBMPlexSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url('fonts/IBMPlexMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --font-family: "IBM Plex Sans", Arial, Tahoma, Verdana, serif;
    --font-family-extra: "IBM Plex Mono", Arial, Tahoma, Verdana, serif;

    --font-weight-regular: 400;
    --font-weight-bold: 700;

    --font-size-small: 18px;
    --font-size-regular: 20px;

    --font-size-header-large: 6vmin;
    --font-size-header-medium: calc((100vw - 240px) * 0.068);
    --font-size-header-small: 32px;

    --color-dark: #1C1C1C;
    --color-black: #000;

    --font-color-light: #fff;
    --font-color-primary: #1A7AFF;
    --font-color-primary-active: #006BFF;

    --background-color: var(--color-dark);
    --background-color-alpha: #1C1C1CA8;
    --background-color-alpha-hover: #1C1C1CBF;
    --background-color-primary: #1A7AFF;

    --background-color-light: #fff;
    --background-color-light-alpha: #00000014;
    --background-color-dark-alpha: #ffffff14;

    --nav-height: 60px;
}

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

html,
body {
    height: 100%;
    width: 100%;

    font-family: var(--font-family);
    font-size: var(--font-size-regular);
    font-weight: var(--font-weight-regular);
    background-color: var(--background-color);

    scroll-behavior: smooth;
    overflow: hidden;
    overscroll-behavior-y: contain;
}

a {
    outline: none;
    cursor: pointer;
    text-decoration: none;
}

a:active {
    text-decoration: none;
}

img {
    border: none
}

li {
    list-style: none;
}

h2 {
    font-family: var(--font-family-extra);
    font-weight: var(--font-weight-bold);
}

/* Webkit */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: inherit;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.header {
    position: fixed;
    top: 8px;

    height: var(--nav-height);
    width: 100%;

    padding: 0 90px;
}

.nav {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 100%;
    padding: 0 16px;

    background-color: var(--background-color-alpha);
    border-radius: 8px;
    backdrop-filter: blur(16px);
}

.nav ul {
    display: flex;
    flex-wrap: wrap;
    height: 100%;
}

.nav li {
    font-size: var(--font-size-regular);
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.nav li a {
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--font-color-light);
    text-decoration: none;

    height: 100%;
}

.nav li a:hover {
    color: var(--font-color-primary);
}

.nav li a:active {
    color: var(--font-color-primary-active);
    text-decoration: none;
}

.nav-logo {
    height: 24px;
    user-select: none;
}

.toggle-button {
    cursor: pointer;

    display: none;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: column;

    width: 30px;
    height: 30px;
    margin: 0 16px;

    outline: none;
    border: none;
    background-color: transparent;
}

.toggle-button__row {
    width: 100%;
    height: 2px;
    border-radius: 1px;
    background-color: var(--font-color-light);
}

.section {
    width: 100%;
    padding: 96px 120px;
    height: 100vh; /* fallback для старых браузеров */
}

@supports (height: 100svh) {
    .section {
        height: 100svh;
    }
}

.section--lg {
    display: block;
}

.section--sm {
    display: none;
}

.section-columns {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.section-column-1-3-lg {
    width: 33.3%;
}

.section-column-2-3-lg {
    width: 66.6%;
}

.section-flex {
    display: flex;
}

.section-flex.section-flex--left {
    justify-content: start;
}

.section-flex.section-flex--right {
    justify-content: end;
    align-items: end;
}

.section-flex.section-flex--center {
    justify-content: center;
}

.section-title {
    flex-direction: column;
    align-items: start;
}

.section-title h2 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-header-large);
}

.section-title h4 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-header-small);
}

.section-info {
    width: 33.3%;
    padding-right: 16px;
    display: flex;
    flex-direction: column;
}

.section-info h3 {
    color: var(--font-color-primary);
    font-family: var(--font-family-extra);
    font-size: var(--font-size-header-small);
}

.section-block-link,
.section-block-button {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 24px 0;
    width: 100%;
}

.section-block-link li a {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px;
    border-radius: 8px;

    background-color: var(--background-color-light-alpha);
    color: var(--color-dark);
}

.section-block-link li a svg {
    fill: var(--color-dark);
}

.section-block-link li a:hover {
    color: var(--font-color-light);
    background-color: var(--font-color-primary);
}

.section-block-link li a:hover svg {
    fill: var(--font-color-light)
}

.section-block-link li a:active {
    background-color: var(--font-color-primary-active);
}

.section-block-button button {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;

    outline: none;
    border: none;

    padding: 16px;
    border-radius: 8px;

    background-color: var(--background-color-dark-alpha);
    color: var(--font-color-light);
    fill: var(--font-color-light);

    font-family: var(--font-family);
    font-size: var(--font-size-regular);
    font-weight: var(--font-weight-regular);
}

.section-block-button button:hover {
    background-color: var(--font-color-primary);
}

.section-block-button button:active {
    background-color: var(--font-color-primary-active);
}

.carousel {
    width: 100%;
}

.carousel-content {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.carousel-card {
    display: flex;
    flex-direction: column;
    gap: 8px;

    min-width: calc((100vw - 288px) * 0.333);
    max-width: calc((100vw - 288px) * 0.333);
}

.carousel-card img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.carousel-card h3 {
    color: var(--font-color-primary);
    font-family: var(--font-family-extra);
    font-size: var(--font-size-header-small);
}

.carousel-navigation {
    position: relative;
    top: 50%;
    left: -70px;
    width: calc(100% + 140px);
    display: flex;
    justify-content: space-between;
    z-index: 999;
    transform: translateY(-50%);
}

.carousel-navigation button {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    outline: none;
    border: none;

    height: 40px;
    width: 40px;
    border-radius: 50%;

    background-color: var(--background-color-dark-alpha);
}

.carousel-navigation button svg {
    fill: var(--background-color);
    width: 24px;
    height: 24px;
}

.carousel-navigation button:hover {
    background-color: var(--background-color-primary);
}

.carousel-navigation button:active {
    background-color: var(--font-color-primary-active);
}

.carousel-navigation button:hover svg {
    fill: var(--background-color-light);
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;

    z-index: 10;

    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-wrapper {
    padding: 60px;
    height: 100%;
}

.modal-content {
    position: relative;
    height: 100%;
    width: 100%;

    background-color: var(--background-color);
    color: var(--font-color-light);

    padding: 40px;

    overflow-y: auto;
}

.modal-button--close {
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 15px;
    right: 15px;

    background-color: var(--background-color-dark-alpha);
    fill: var(--font-color-l);
    outline: none;
    border: none;

    height: 40px;
    width: 40px;
    border-radius: 50%;

    z-index: 12;
}

.modal-button--close:hover,
.modal-button--close:focus {
    fill: var(--font-color-primary-active);
    text-decoration: none;
    cursor: pointer;
}

/* Specific css classes on BEM */

.about__image-container {
    height: 70%;
    width: 100%;
    margin: 0 auto;
}

.about__image {
    object-fit: cover;
}

.about__header,
.about__footer {
    height: 15%;
}

.vacancy__content {
    width: 66.6%;
    margin-left: auto;
}

.vacancy h2 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: 80px;
    margin-bottom: 40px;
}

.vacancy h3 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: 40px;
    margin: 20px 0;
}

.vacancy p {
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    line-height: 20px;
}


#main {
    display: flex;
    flex-direction: column;
    justify-content: end;
}

#main p {
    color: var(--font-color-light);
    font-size: var(--font-size-header-small);
    margin-bottom: 3vmin;
}

#main h2 {
    color: var(--font-color-primary);

    font-family: var(--font-family-extra);
    font-size: calc((100vw - 240px) * 0.238);
    line-height: 78%;
}

#about {
    color: var(--font-color-light);
}

#about-2 {
    display: flex;
    align-items: center;
    background-color: var(--font-color-primary-active);
    color: var(--font-color-light);
}

#about-2 h2 {
    font-family: var(--font-family-extra);
    font-size: calc((100vw - 240px) * 0.58);
    line-height: 78%;
}

#about-2 h3 {
    font-size: var(--font-size-header-medium);
    font-weight: var(--font-weight-regular);
}

#about-2 h4 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-header-small);
}

#about-2 span {
    font-size: 3vmin;
}

#about-2 .section-wrapper {
    display: flex;
}

#about-2 .section-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: end;
    margin-left: 24px;
}

#projects {
    background-color: var(--background-color-light);
}

#career {
    color: var(--font-color-light);
}

#career-2 {
    color: var(--font-color-light);
}

#contacts {
    display: flex;
    align-items: end;
    justify-content: end;
    background-color: var(--background-color-light);
}

#contacts h2 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-header-medium);
    line-height: 110%;
}

#contacts .mail {
    display: block;
    margin-top: 24px;
    font-family: var(--font-family);
    font-size: var(--font-size-header-small);
    color: var(--color-dark);
}

#contacts .mail:hover {
    color: var(--font-color-primary);
}

#contacts .mail:active {
    color: var(--font-color-primary-active);
}

#contacts .section-text {
    margin-top: 24px;
}

/* tablet and mobile styles */
@media only screen and (max-width: 768px) {

    :root {
        --font-size-small: 16px;
        --font-size-regular: 16px;

        --font-size-header-large: 32px;
        --font-size-header-small: 24px;
    }

    .toggle-button {
        display: flex;
    }

    .header {
        padding: 0 8px;
    }

    .nav.nav--close ul,
    .nav ul {
        display: none;
    }

    .nav.nav--open {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .nav.nav--open ul {
        position: absolute;
        top: var(--nav-height);
        left: 0;

        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;

        width: 100%;
    }

    .nav.nav--open li {
        width: 100%;

        background-color: var(--background-color-alpha);
        backdrop-filter: blur(16px);
    }

    .nav.nav--open li:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .nav.nav--open li:hover {
        background-color: var(--background-color-alpha-hover);
    }

    .nav.nav--open li a {
        padding: 16px;
        height: 100%;
    }

    .section {
        padding: 88px 24px;
        height: 100vh;
        padding-bottom: 40px;
    }

    @supports (height: 100svh) {
        .section {
            height: 100svh;
        }
    }

    .section--lg {
        display: none;
    }

    .section--sm {
        display: block;
    }

    .section-title {
        gap: 8px;
    }

    .section-title h2 {
        line-height: 110%;
    }

    .section-column-1-3-lg,
    .section-column-2-3-lg {
        width: 100%;
    }

    .section-block-link {
        padding: 16px 0;
    }

    .section-block-link li a,
    .section-block-button button {
        padding: 12px;
        font-size: var(--font-size-small);
    }

    .carousel {
        height: 100%;
        align-content: center;
    }

    .carousel-navigation {
        left: 0;
        width: 100%;
        top: 30%
    }

    .carousel-card {
        min-width: 100%;
        max-width: 100%;
    }

    .carousel-card h3 {
        font-size: var(--font-size-header-large);
    }

    .carousel-card span {
        font-size: var(--font-size-regular);
    }

    .modal-button--close {
        top: 30px;
        right: 50px;
    }

    .modal-wrapper {
        padding: 20px;
    }

    .modal-content {
        padding: 16px 16px 32px 16px;
    }

    /* Specific css */
    .about__image-container {
        height: 30%;
    }

    .about__header,
    .about__footer {
        height: 30%;
    }

    .about__image {
        max-height: 200px;
    }

    .about__header {
        flex-direction: column;
        gap: 16px;
    }

    .projects__footer,
    .career__footer {
        flex-direction: column;
        gap: 16px;
    }

    .projects__footer .section-info,
    .career__footer .section-info {
        width: 100%;
    }

    .section-info h3 {
        line-height: 100%;
    }

    .vacancy__content {
        width: 100%;
        margin-left: auto;
    }

    .vacancy h2 {
        font-size: 40px;
        margin-bottom: 20px;
        padding-right: 56px;
    }

    .vacancy h3 {
        font-size: 24px;
        margin: 15px 0;
    }

    .vacancy p {
        font-family: var(--font-family);
        font-size: var(--font-size-small);
    }

    #main p {
        color: var(--font-color-light);
        font-size: var(--font-size-header-small);
        margin-bottom: 50px;
    }

    #main h2 {
        font-size: calc((100vw - 48px) * 0.39);
    }

    #about-2 h2 {
        font-size: calc((100vw - 48px) * 0.84);
    }

    #about-2 h3 {
        font-size: calc((100vw - 48px) * 0.235);
    }

    #about-2 h4 {
        font-size: calc((100vw - 48px) * 0.125);
    }

    #about-2 span {
        font-size: 5vmin;
    }

    #about-2 .section-wrapper {
        flex-direction: column;
    }

    #about-2 .section-text-wrapper {
        margin-left: 0;
    }

    #contacts h2 {
        font-size: 48px;
    }

    #contacts .mail {
        font-size: 28px;
    }
}

@media only screen and (max-height: 759px) {
    #projects p {
        display: none;
    }
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    :root {
        --font-size-header-small: 26px;
    }

    .header {
        padding: 0 64px;
    }

    .section {
        padding: 96px 96px;
    }

    .about__image-container {
        height: 50%;
    }

    .about__header,
    .about__footer {
        height: 15%;
    }

    .carousel {
        height: 100%;
        align-content: center;
    }

    .carousel-navigation {
        left: 0;
        width: 100%;
        top: 30%;
        left: -70px;
        width: calc(100% + 140px);
    }

    .carousel-card {
        min-width: calc((100vw - 288px) * 0.55);
        max-width: calc((100vw - 288px) * 0.55);
    }

}

/* For UHD and QHD screen */
@media only screen and (min-width: 2560px) {
    :root {
        --font-size-header-medium: calc((100vw - 600px) * 0.068);
    }

    .header {
        padding: 0 270px;
    }

    .section {
        padding: 120px 300px;
    }

    .carousel-card {
        min-width: calc((100vw - 648px) * 0.333);
        max-width: calc((100vw - 648px) * 0.333);
    }

    #main h2 {
        font-size: calc((100vw - 600px) * 0.238);
    }

    #about-2 h2 {
        font-size: calc((100vw - 600px) * 0.58);
    }
}

/* Адаптивность для мобильных устройств */
/* @media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 15px;
    }

    .close-btn {
        font-size: 24px;
    }
} */

/* ==============================
   Секция #news
   ============================== */

#news {
    color: var(--font-color-light);
}

#news h2 {
    color: var(--font-color-light);
}

.news-card {
    color: var(--font-color-light);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.news-card:hover {
    transform: translateY(-4px);
}

.news-card__image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 ratio = 2/3 × 100% */
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card__image img,
.news-card__no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card__no-image {
    background: linear-gradient(135deg, #1a2a3a 0%, var(--font-color-primary-active) 100%);
}

.news-card__date {
    display: block;
    font-size: var(--font-size-small);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.news-card h3 {
    color: var(--font-color-primary);
    font-family: var(--font-family-extra);
    font-size: var(--font-size-header-small);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card span {
    color: var(--font-color-light);
    font-size: var(--font-size-small);
}

.news-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-regular);
}

/* ==============================
   Страница отдельной записи
   ============================== */

body.single-post,
body.single {
    overflow: unset;
    height: auto;
}

html:has(body.single) {
    overflow: unset;
    height: auto;
}

.single-post {
    padding: 96px 120px 80px;
    width: 66.6%;
    margin: auto;
    color: var(--font-color-light);
}

.single-post__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.single-post__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--font-color-light);
    font-size: var(--font-size-small);
    padding: 10px 16px;
    border-radius: 8px;
    background-color: var(--background-color-dark-alpha);
    fill: var(--font-color-light);
    transition: background-color 0.2s ease;
    align-self: flex-start;
}

.single-post__back:hover {
    background-color: var(--font-color-primary);
    color: var(--font-color-light);
}

.single-post__back svg {
    fill: inherit;
    flex-shrink: 0;
}

.single-post__date {
    display: block;
    font-size: var(--font-size-small);
    color: rgba(255, 255, 255, 0.5);
}

.single-post__title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-header-large);
    line-height: 120%;
    color: var(--font-color-light);
}

.single-post__thumbnail {
    border-radius: 8px;
    overflow: hidden;
}

.single-post__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.single-post__content {
    font-size: var(--font-size-regular);
    line-height: 160%;
    color: var(--font-color-light);
}

.single-post__content p {
    margin-bottom: 20px;
}

.single-post__content h2,
.single-post__content h3,
.single-post__content h4 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    margin: 32px 0 12px;
    color: var(--font-color-light);
}

.single-post__content a {
    color: var(--font-color-primary);
}

.single-post__content a:hover {
    color: var(--font-color-primary-active);
}

.single-post__content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.single-post__content ul,
.single-post__content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.single-post__content li {
    list-style: disc;
    margin-bottom: 8px;
}

.single-post__content ol li {
    list-style: decimal;
}

/* Адаптив страницы записи */
@media only screen and (max-width: 768px) {
    .single-post {
        padding: 88px 24px 60px;
        width: 100%;
    }

    .single-post__title {
        font-size: var(--font-size-header-small);
    }
}
