/* Общие настройки */
:root {
    --bg-color: #0f1218;
    --card-bg: #1a1f29;
    --accent-color: #007bff;
    --text-color: #e0e0e0;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Навигация */
.header {
    height: 80px;
    background-color: rgba(15, 18, 24, 0.95);
    border-bottom: 1px solid #2d343e;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center; /* Центрируем содержимое шапки */
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Базовый стиль бургера (скрыт на десктопе) */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white; /* Цвет полосок */
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content h1 span {
    color: var(--accent-color);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* Услуги */
.services {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center; /* Центрируем текст в секции Услуги */
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center; /* Центрируем сетку в секции Услуги */
}

.service-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid #2d343e;
    transition: var(--transition);
    margin: 0 auto; /* Центрируем каждую карточку */
}

.service-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.service-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 15px;
}

/* О нас */
.about {
    padding: 100px 10%;
    background-color: #151921;
    text-align: center;
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Контакты */
.contact {
    padding: 100px 5%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center; /* Центрируем секцию по горизонтали */
    text-align: center; /* Центрируем текст в секции*/
}

.contact-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    justify-content: center; /* Центрируем сетку в секции Контакты */
}

.contact-info h2 {
    margin-bottom: 20px;
}

.contact-info ul {
    list-style: none;
    margin-top: 20px;
}

.contact-info li {
    margin-bottom: 10px;
}

.contact-info i {
    color: var(--accent-color);
    margin-right: 10px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input, .contact-form textarea {
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #2d343e;
    background: var(--card-bg);
    color: white;
    font-family: inherit;
}

/* Футер */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid #2d343e;
}

/* Портфолио */
.portfolio {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center; /* Центрируем текст в секции Услуги */
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center; /* Центрируем сетку в секции Портфолио */
}

.portfolio-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 400px;
    border: 1px solid #2d343e;
    margin: 0 auto; /* Центрируем каждую карточку */
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .card-overlay {
    opacity: 1;
}

.portfolio-card:hover img {
    transform: scale(1.1);
}

.view-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 40px;
    overflow-y: auto;
}

.modal-content {
    max-width: 1200px;
    margin: 0 auto;
}

.close-modal {
    position: fixed;
    right: 30px;
    top: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 2001;
}

.modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.modal-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-content: center; /* Центрируем сетку изображений в модальном окне */
}

.modal-images-grid img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #333;
    transition: transform 0.3s;
}

.modal-images-grid img:hover {
    transform: scale(1.03);
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Скрываем обычное меню */
        flex-direction: column;
        position: absolute;
        top: 70px; /* Подберите под высоту вашей шапки */
        left: 0;
        width: 100%;
        background-color: #151921;
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid #2d343e;
        z-index: 1000;
    }

    /* Класс, который добавляет JS */
    .nav-links.active {
        display: flex !important; 
    }

    .burger {
        display: flex; /* Показываем бургер на мобилках */
    }

    /* Анимация бургера при нажатии (опционально) */
    .burger.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .burger.open span:nth-child(2) {
        opacity: 0;
    }
    .burger.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}