@font-face {
    font-family: 'EurostileExtended';
    src: url('../fonts/eurostileextended.ttf') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EurostileExtendeBold';
    src: url('../fonts/eurostileextended_bold.ttf') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --main-blue: #2b3a8b;
    --text-color: #333;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
    font-family: 'EurostileExtended', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--main-blue);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

/* Menu Button & Dropdown */
.menu-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.menu-text {
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
}

.hamburger-icon {
    width: 25px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: 0.3s;
}

.menu-btn.active .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
}

.menu-btn.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: var(--main-blue);
}

/* Hero */
.hero {
    background-image: url(../img/hero_bg.jpg);
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px 0;
}

.main-logo-img {
    width: 120px;
}

.hero h1 {
    color: var(--main-blue);
    font-size: 1.6rem;
    margin: 0;
}

/* Quote */
.quote {
    display: flex;
    align-items: center;
    gap: 40px;
}

.quote p {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
    text-align: justify;
}

.quote img {
    width: 35%;
    border-radius: 4px;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-title h2 {
    color: var(--main-blue);
    margin-top: 0;
}

.about-text p {
    text-align: justify;
}

.profile-card {
    border: 1px solid var(--border-color);
    padding: 15px;
    width: 260px;
    margin-top: 20px;
}

.profile-card img {
    width: 100%;
}

.spanNameCompany {
    text-transform: uppercase;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    align-items: center;
}

.project-card {
    height: 380px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    color: white;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
}

.project-card h3 {
    position: relative;
    z-index: 2;
    font-size: 1rem;
    margin: 0;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* Footer */
.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 40px;
}

.footer-info h2 {
    color: var(--main-blue);
    margin-bottom: 10px;
}

.contact {
    text-align: right;
}

.contact a {
    color: var(--main-blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

/* --- ADAPTIVE --- */

@media (max-width: 992px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .quote p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .quote {
        flex-direction: column;
        text-align: center;
    }

    .quote img {
        width: 70%;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .contact {
        text-align: center;
    }

    .dropdown-menu {
        right: 50%;
        transform: translateX(50%) translateY(10px);
        width: 90vw;
    }

    .menu-btn.active .dropdown-menu {
        transform: translateX(50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.3rem;
    }

    .main-logo-img {
        width: 80px;
    }

    .project-card {
        height: 300px;
    }
}

/* --- АДАПТИРОВАННЫЕ СТИЛИ МОДАЛЬНОГО ОКНА --- */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);

    /* Центрирование без margin: auto */
    justify-content: center;
    align-items: center;
    padding: 15px;
    /* Важно: отступ от краев экрана на мобильных */
}

/* Принудительное включение flex при отображении через JS */
.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border-radius: 15px;

    /* Адаптивная ширина */
    width: 100%;
    max-width: 600px;
    /* На ПК будет 600px, на телефонах - 100% */

    /* Борьба с вертикальным вылетом */
    max-height: 90vh;
    /* Не выше 90% высоты экрана */
    overflow-y: auto;
    /* Внутренняя прокрутка, если текст длинный */

    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

/* Исправляем картинку, чтобы она не ломала верстку */
#modalImg {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 15px;
}

/* Кнопка закрытия */
.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Адаптация текста */
#modalTitle {
    font-size: 1.4rem;
    color: var(--main-blue);
    margin-top: 10px;
    line-height: 1.2;
}

#modalDescription {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    text-align: justify;
    /* Разбивает длинные слова, если они есть */
}

/* Дополнительные правки для маленьких экранов */
@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
        padding-top: 40px;
        /* Чтобы крестик не перекрывал заголовок */
    }

    #modalTitle {
        font-size: 1.1rem;
    }
}