/* ===== COMMON STYLES ===== */
a.link {
    text-decoration: none;
    transition: opacity .25s ease;
}
a.link:hover {
    opacity: .7;
}

/* ===== HEADER ===== */
.header-top {
    color: black;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 80px;                /* Фиксированная высота (можно оставить для шапки) */
    width: 100%;
    background: rgb(253, 253, 253, 96%);
    position: fixed;
    top: 0;
    z-index: 1001;
}

/* Модальное окно портфолио */
.portfolio-modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 30%;                   /* Было 30% — оставим, это уже процент */
    height: 45%;                  /* Было 45% — процент */
    margin-left: 60%;              /* Процент */
    margin-top: 3%;                /* Процент */
    background-color: rgb(255, 255, 255, 90%);
    border-radius: 20px;           /* Скругление в px оставим */
}

/* Кнопка меню */
.menu-button {
    border: 0;
    background: none;
    cursor: pointer;
    pointer-events: all;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: none;
    flex-basis: content;
    align-items: center;
    margin-right: -12px;           /* Отрицательный margin в px оставим */
    margin-left: 8px;              /* Можно заменить на 0.5%? Но оставим px для точности */
    padding-left: 100px;           /* Большой отступ – заменим на процент? Лучше оставить для десктопа, но в медиа-запросах подкорректируем */
}

.menu-button .menu-button-icon {
    position: relative;
    width: 30px;                   /* Фиксированный размер иконки */
    height: 15px;
    margin-top: 14px;
}

.menu-button .menu-button-icon::before {
    transition: color 0.3s;
    color: red;
}

.menu-button .menu-button-icon span,
.menu-button .menu-button-icon span::before,
.menu-button .menu-button-icon span::after {
    content: "";
    display: block;
    position: absolute;
    height: 1px;                   /* Толщина линий в px */
    background: #000000;
}

.menu-button .menu-button-icon span {
    right: 0;
    left: 0;
    transition: background 0.3s;
}

.menu-button .menu-button-icon span::before,
.menu-button .menu-button-icon span::after {
    left: 0;
    width: 100%;
}

.menu-button .menu-button-icon span::before {
    top: -7px;                     /* Смещение в px */
    transition: background 0.3s, transform 0.3s, top 0.3s 0.3s;
}

.menu-button .menu-button-icon span::after {
    bottom: -7px;                  /* Смещение в px */
    transition: background 0.3s, transform 0.3s, bottom 0.3s 0.3s;
}

.menu-button .menu-button-label {
    margin-right: 12px;             /* px оставим */
    font-size: 16px;                /* Размер шрифта в px */
    letter-spacing: 0.8px;
}

.menu-button.active .menu-button-icon::before {
    color: red;
}

.menu-button.active .menu-button-icon span,
.menu-button.active .menu-button-icon span::before,
.menu-button.active .menu-button-icon span::after {
    background: #000000;
}

.menu-button.active .menu-button-icon span {
    background: 0 0;
}

.menu-button.active .menu-button-icon span::before {
    top: 0;
    transform: rotate(45deg);
    transition: top 0.3s, transform 0.3s 0.3s;
}

.menu-button.active .menu-button-icon span::after {
    bottom: 0;
    transform: rotate(-45deg);
    transition: bottom 0.3s, transform 0.3s 0.3s;
}

.menu-button.active .menu-button-label {
    display: none;
}

/* Гамбургер (альтернативная кнопка) */
.hamburger {
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;                   /* Фиксированный размер */
    height: 30px;
}

.line {
    background-color: #000000;
    height: 2px;                   /* Толщина линии */
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger.active .line1 {
    transform: translateY(18px) rotate(45deg); /* Смещение в px */
}

.hamburger.active .line2 {
    opacity: 0;
}

.hamburger.active .line3 {
    transform: translateY(-10px) rotate(-45deg);
}

/* Выпадающее меню */
.dropdown {
    font-family: "Courier New", monospace;
    display: none;
    position: absolute;
    background-color: white;
    list-style-type: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
}

.menu-element:hover .dropdown {
    display: block;
}

.dropdown li {
    padding: 7px;                  /* px – оставим */
}

.dropdown li a {
    text-decoration: none;
    color: black;
}

.dropdown li a:hover {
    color: #bda753;
}

/* ===== BASE ===== */
body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: #fff;
}

/* ===== PHOTO GRID ===== */
.photo-grid {
    column-count: 3;
    column-gap: 16px;               /* px – заменим на проценты? Лучше оставить px для сетки */
    padding: 20px;                   /* px – переведём в проценты? padding: 2%? Но для сетки лучше px, чтобы не сжималось слишком. Оставим. */
}

.photo-grid img {
    width: 100%;                     /* Уже хорошо */
    margin-bottom: 16px;             /* px – оставим */
    border-radius: 8px;              /* px – оставим */
    display: block;
    break-inside: avoid;
}

@media (max-width: 768px) {
    .photo-grid {
        column-count: 2;
        column-gap: 16px;             /* Можно уменьшить, но оставим */
        padding: 20px;                 /* Оставим */
    }
}

/* ===== PORTFOLIO MODAL ===== */
.portfolio-modal.show {
    opacity: 1;
    visibility: visible;
}

.portfolio-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: "Courier New", monospace;
}

.portfolio-item {
    margin: 10px 0;                  /* px – оставим */
    font-size: 18px;                 /* px – оставим */
}

.portfolio-item a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.portfolio-item a:hover {
    color: #4e4323;
}

.sub-list {
    list-style: none;
    padding-left: 20px;               /* px – оставим */
    display: none;
}

.portfolio-item:hover .sub-list {
    display: block;
}

.sub-item {
    margin: 5px 0;                    /* px – оставим */
}

.sub-item a {
    color: #555;
}

.menu-element__link {
    color: #000000;
    font-family: "Courier New", monospace;
    white-space: nowrap;
}

/* ===== LOGO ===== */
.logo {
    font-size: 26px;                  /* px – оставим как базовый */
    font-family: "Courier New", monospace;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.5em;                /* em – относительная единица, хорошо */
    margin-right: 2vh;                  /* vh – оставим, можно заменить на % от ширины? Но vh относительно высоты, можно оставить */
    margin-left: 1vh;                   /* аналогично */
    color: #000000;
}

/* ===== MENU ===== */
.menu {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.menu-element {
    margin-right: 1vh;                 /* vh – оставим */
}

.menu-element:last-child {
    margin-right: 0;
}

.menu-element a.link.active,
.menu-element a.link:hover {
    color: #bda753;
}

/* ===== ABOUT ME ===== */
.about-me {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;                     /* px – оставим для больших экранов, но можно заменить на % */
    border-radius: 8px;
    font-family: "Courier New", monospace;
}

.left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 200px;                  /* px – оставим */
}

.about-me__images {
    max-width: 100%;
    height: auto;
}

.right {
    margin-top: 10%;                    /* Уже % */
    flex: 2;
    padding-left: 20px;                  /* px – оставим? Можно заменить на 2% */
    margin-left: auto;
    display: block;
}

.about-me__title {
    font-size: 24px;                     /* px */
    margin-bottom: 10px;                  /* px */
}

.about-me__description {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.about-me__description2 {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.gray {
    color: #4b7aac;
}

.about-me__extra {
    list-style-type: none;
    padding: 0;
}

.about-me__extra-elements {
    margin-bottom: 5px;                   /* px */
}

.bold {
    font-weight: bold;
}

/* Медиа-запрос для адаптивности на мобильных */
@media (max-width: 768px) {
    .header-top {
        justify-content: left;
    }

    .about-me {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        font-size: 24px;                   /* px – можно уменьшить */
        margin-right: 1vh;                  /* оставим */
        margin-left: 1vh;
    }

    .right {
        padding-left: 0;
        text-align: left;
    }

    .navigation {
        margin-left: 15%;                   /* % */
    }

    .menu-element {
        display: none;
    }

    .menu-elementPortfolio {
        display: block;
    }

    .portfolio-modal {
        width: 100%;
        height: 100%;
        margin-left: 0;
        margin-top: 0;
        border-radius: 0;
    }

    .menu-button {
        display: flex;
        padding-left: 5%;                   /* Заменяем 100px на % для мобильных */
        margin-left: 2%;                    /* Добавляем отступ */
    }
}

/* ===== WORKS SECTION ===== */
.works {
    font-family: "Courier New", monospace;
}

.work-cases {
    text-align: center;
}

.portfolio {
    padding: 20px;                          /* px */
    background-color: #f9f9f9;
}

.portfolio-container {
    display: flex;
}

.portfolio-item {
    background: white;
    border-radius: 5px;                     /* px */
    margin: 10px;                            /* px */
    padding: 15px;                           /* px */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.portfolio-item img {
    max-width: 100%;
    border-radius: 5px;
}

.portfolio-item h3 {
    margin-top: 10px;
}

.portfolio-item a {
    color: #bda753;
    font-family: "Courier New", monospace;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .portfolio-container {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        scroll-snap-type: x mandatory;
        scroll-snap-align: start;
    }

    .portfolio-item {
        min-width: 250px;                    /* px */
    }
}

/* ===== FOOTER ===== */
footer {
    background-color: #ffffff;
    color: #333;
    padding: 20px;                           /* px – можно заменить на 2% */
    text-align: center;
    width: 100%;
}

.socials {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;                      /* px */
}

.social-element {
    display: inline-block;
    margin: 0 15px;                           /* px */
    height: 30px;                              /* px */
    width: 30px;                               /* px */
}

.social-element__link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.social-element__link:hover {
    color: #bda753;
}

.footer-about {
    margin-top: 10px;                          /* px */
    font-size: 14px;                           /* px */
}

@media (max-width: 768px) {
    .social-element {
        margin: 0 10px;                          /* px */
    }

    .footer-about {
        font-size: 12px;                          /* px */
    }
}

/* ===== BODY SCROLL ===== */
body {
    margin: 0;
    padding: 0;
    height: 2000px; /* Для демонстрации прокрутки – фиксированная высота, можно убрать */
}
body.no-scroll {
    overflow: hidden;
}

/* ===== FLOATING BUTTON ===== */
.floating-button {
    position: fixed;
    bottom: 20px;                               /* px */
    right: 20px;                                /* px */
    background-color: #bda753;
    color: white;
    border: none;
    border-radius: 50%;
    padding: 10px 15px;                          /* px */
    font-size: 16px;                             /* px */
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    height: 50px;                                /* px */
    width: 50px;                                 /* px */
}

.floating-button:hover {
    background-color: #4e4323;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    color: #000000;
    margin: 20% auto;                           /* % */
    padding: 20px;                               /* px */
    border-radius: 5px;
    width: 80%;                                  /* % */
    max-width: 500px;                            /* px */
    text-align: center;
}

.modal-content__img img {
    width: 100px;                                 /* px */
    height: 100px;                                /* px */
    border-radius: 50%;
    object-fit: cover;
    margin-left: 40%;                             /* % */
}

.modal-content h2 {
    line-height: 0.9;
}

.modal-content p {
    padding-bottom: 20px;                          /* px */
}

.modal-floating-button {
    display: flex;
    align-items: center;
    background-color: #d1d1d1;
    color: #000000;
    border: none;
    border-radius: 5px;
    padding: 10px 50%;                             /* % (но большой отступ) – можно заменить на 10px 20%? */
    cursor: pointer;
    text-decoration: none;
    width: 100%;
}

.modal-floating-button span {
    margin-left: 10px;                              /* px */
}

.socials {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.link {
    margin: 0 10px;                                 /* px */
}

.modal-floating-button {
    display: flex;
    align-items: center;
    background-color: #a3b8d1;
    color: #000000;
    border: none;
    border-radius: 5px;
    padding: 10px 35%;                              /* % */
    cursor: pointer;
    text-decoration: none;
    margin-top: 5px;
}

.modal-floating-button img {
    width: 20px;                                     /* px */
    height: 20px;                                    /* px */
    margin-right: 10px;                              /* px */
}

.modal-floating-button span {
    margin-left: 10px;
}

.modal-social-element__link {
    text-decoration: none;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 50% auto;                             /* % */
    }
    .modal-content__img img {
        margin-left: 33%;                              /* % */
    }
    .modal-floating-button {
        padding: 10px 25%;                             /* % */
    }
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* ===== PHOTO GRID (с отступами) ===== */
.photo-grid {
    column-count: 3;
    column-gap: 15px;                               /* px */
    margin-left: 300px;                              /* px – для больших экранов, заменим на %? */
    margin-right: 300px;                             /* px */
}
.photo-grid-1 {
    column-count: 1;
    column-gap: 15px;                               /* px */
    margin-left: 300px;                              /* px – для больших экранов, заменим на %? */
    margin-right: 300px;                             /* px */
}
.photo-grid img {
    width: 100%;
    margin-bottom: 15px;                             /* px */
    display: block;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.photo-grid-1 img {
    width: 100%;
    margin-bottom: 15px;                             /* px */
    display: block;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.photo-grid img:hover {
    transform: scale(1.07);
}
.photo-grid-1 img:hover {
    transform: scale(1.07);
}
/* Модальное окно галереи */
.modal23 {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal23 img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.close, .prev, .next {
    position: absolute;
    font-size: 32px;                                 /* px */
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    user-select: none;
}

.close {
    top: 20px;                                       /* px */
    right: 30px;                                      /* px */
}

.prev, .next {
    top: 50%;
    transform: translateY(-50%);
}

.prev {
    left: 30px;                                      /* px */
}

.next {
    right: 30px;                                     /* px */
}

@media (max-width: 768px) {
    .photo-grid {
        column-count: 3;
        margin-left: 0;                               /* Убираем большие отступы на мобильных */
        margin-right: 0;
        column-gap: 5px;                              /* px */
    }
    .photo-grid img {
        margin-bottom: 5px;
    }
}
@media (max-width: 768px) {
    .photo-grid-1 {
        column-count: 3;
        margin-left: 0;                               /* Убираем большие отступы на мобильных */
        margin-right: 0;
        column-gap: 5px;                              /* px */
    }
    .photo-grid-1 img {
        margin-bottom: 5px;
    }
}
@media (max-width: 500px) {
    .photo-grid {
        column-count: 3;
        margin-left: 0;
        margin-right: 0;
        column-gap: 5px;
    }
    .photo-grid img {
        margin-bottom: 5px;
    }
}
@media (max-width: 500px) {
    .photo-grid-1 {
        column-count: 3;
        margin-left: 0;
        margin-right: 0;
        column-gap: 5px;
    }
    .photo-grid-1 img {
        margin-bottom: 5px;
    }
}
.header_index {
    height: 110vh;                                    /* vh – оставим */
    background: url(../Images/Logo.JPG) no-repeat center;
    background-size: cover;
}

.header {
    height: 3vh;                                      /* vh – оставим */
    background-size: cover;
}
/* Сдвигаем кнопку ближе к левому краю на маленьких экранах */
@media (max-width: 480px) {
    .menu-button {
        margin-left: 0 !important;      /* Убираем отступ слева */
        padding-left: 5px !important;   /* Минимальный отступ от края */
    }
}

@media (max-width: 375px) {
    .menu-button {
        margin-left: 0 !important;
        padding-left: 2px !important;   /* Еще ближе для совсем маленьких */
    }
}