/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100vw;
}

:root {
    --primary-color: #1a3a5f;
    --accent-color: #ff6b35;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    position: relative;
}

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

.logos {
    display: flex;
    padding-right: 55px;
}

.logo {
    max-height: 30px;
    margin: 0 3px;
}

.white-link {
    color: var(--white);
    margin: 20px 40px;
}

.black-link {
    color: var(--text-color);
}

.container {
    max-width: 100%;
    padding-left: max(20px, calc((100% - 1200px) / 2));
    padding-right: max(20px, calc((100% - 1200px) / 2));
    box-sizing: border-box;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.header-contact {
    grid-column: 3;
    justify-self: end;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: 1rem;
    gap: 0.75rem;
}

.header-contact a.header-link {
    white-space: nowrap;
    margin-right: 0.5rem;
}

.header-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.header-link:hover {
    color: var(--accent-color);
}

.header-separator {
    margin: 0 0.75rem;
    color: var(--text-light);
    opacity: 0.6;
    user-select: none;
}

.phone-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.phone-link:hover {
    color: var(--accent-color);
}

.burger-menu {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a6f 100%);
    margin-top: 70px;
    padding: 40px 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('Images/hero.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.4;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 58, 95, 0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 2rem;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.responsive-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* видео заполнит контейнер, обрезая края */
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    margin: 30px 0px;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* Services Section */
.services {
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow);
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* Advantages Section */
.advantages {
    background: var(--bg-light);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.advantage-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.advantage-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.advantage-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
}

.advantage-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.advantage-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.advantage-item p {
    color: var(--text-light);
}

/* About Section */
.about {
    background: var(--bg-light);
    min-height: 700px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    opacity: 0;
    transform: translateX(-30px);
}

.about-text.visible {
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

.about-description {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.about-image {
    opacity: 0;
    transform: translateX(30px);
}

.about-image.visible {
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--shadow);
}

/* Portfolio Section */
.portfolio {
    background: var(--white);
}

.portfoliogray {
    background: var(--bg-light);
}

.carousel-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto 130px auto;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 4/3;
    width: 100%;
    opacity: 0.85;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.carousel-item:hover {
    opacity: 1;
    transform: scale(1.35);
    z-index: 2;
    box-shadow: 5px 15px 30px rgba(0, 0, 0, 1);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-caption {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.carousel-item:hover .image-caption {
    opacity: 1;
}

/* Contacts Section */
.contacts {
    background: var(--white);
}

.contacts-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-form-wrapper {
    opacity: 0;
    transform: translateX(-30px);
}

.contact-form-wrapper.visible {
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.contact-info {
    opacity: 0;
    transform: translateX(30px);
}

.contact-info.visible {
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: var(--text-light);
}

.contact-item a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.developer-link {
    color: var(--white);
    text-decoration: underline;
    opacity: 0.9;
    font-size: 0.9rem;
    transition: var(--transition);
}

.developer-link:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-contact {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--white);
    opacity: 0.9;
}

.footer-contact a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-contact a:hover {
    color: var(--accent-color);
}

.footer-contact span {
    opacity: 0.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: var(--white);
        box-shadow: 0 5px 10px var(--shadow);
        transition: var(--transition);
    }

    .nav.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
    }

    .header-contact {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-content,
    .contacts-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        justify-content: center;
    }

    .services-grid,
    .advantages-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .about-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    section {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.875rem 2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .about-stats {
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .carousel-track {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .container {
        padding: 0 15px;
    }

    section {
        padding: 3rem 0;
    }

    .carousel-track {
        grid-template-columns: 1fr;
    }

    .carousel-item {
        opacity: 1;
    }

    .carousel-item:hover {
        transform: scale(1);
    }
}

@media (max-width: 968px) {
    .carousel-track {
        grid-template-columns: repeat(2, 1fr);
        /* На планшетах 2 колонки */
        gap: 1rem;
    }
}

@media (max-width: 500px) {
    .carousel-track {
        grid-template-columns: 1fr;
        /* На телефонах 1 колонка */
        width: 100%;
        overflow-x: hidden;
    }

    .carousel-item {
        opacity: 1;
        /* Убираем полупрозрачность для лучшей читаемости */
    }

    .carousel-item:hover {
        transform: scale(1);
        /* Отключаем увеличение при наведении на телефонах */
    }
}

/* Для мобильных устройств */
@media (max-width: 500px) {
    .header-contact {
        gap: 0.5rem;
        /* Уменьшенное расстояние на очень маленьких экранах */
        flex-wrap: wrap;
        /* Разрешаем перенос элементов */
        justify-content: flex-end;
    }

    .header-contact a.header-link {
        margin-right: 0;
    }
}

/* Модальное окно контактов */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-color);
    text-decoration: none;
}

.modal-contacts {
    margin-top: 1rem;
}

.modal-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-light);
}

.modal-contact:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-contact img {
    width: 24px;
    height: 24px;
}

.modal-contact a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.modal-contact a:hover {
    color: var(--accent-color);
}

.document-wrapper {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 45px 55px;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    line-height: 1.5;
    color: #1e1e1e;
}

/* Основные стили для текста — как в старом добром Word или текстовом файле */
.document-wrapper p {
    margin: 0 0 1em 0;
    text-align: left;
    font-size: 16px;
    word-break: break-word;
}

/* Заголовки не использовались в исходном тексте, но если бы были — зададим аккуратно */
.document-wrapper h1,
h2,
h3 {
    font-weight: normal;
    font-size: 1.2em;
    margin: 1.2em 0 0.5em;
}

/* Стилизация списков для наглядности, но сохраняем простоту маркеров */
.document-wrapper ul,
ol {
    margin: 0.5em 0 1em 0;
    padding-left: 30px;
}

.document-wrapper li {
    margin-bottom: 0.4em;
    font-size: 16px;
}

/* Делаем отступы для блоков перечислений, как в исходном тексте (после двоеточий) */
.section-list {
    margin: 0.25em 0 0.75em 1.2em;
}

.section-list p {
    margin: 0.25em 0;
}

/* Для сохранения жесткости форматирования иногда вставлены переносы */
.note {
    margin-top: 1.2em;
    font-style: normal;
}

/* Аккуратно выделим технические аббревиатуры (не полужирным, а лишь слегка) */
.document-wrapper abbr,
.acronym {
    letter-spacing: 0.02em;
}

/* Имитация небольшого увеличения интервала между крупными смысловыми блоками */
.block-spacer {
    margin-top: 1.8em;
}

/* для подписи/контактов */
.signature-block {
    margin-top: 2em;
    font-style: normal;
}

/* чтобы длинные слова не ломали верстку */
.long-word {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.document-wrapper hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 25px 0 15px;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu.active {
    display: block;
    opacity: 1;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active .mobile-menu-content {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--bg-light);
}

.mobile-menu-header h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-menu-close:hover {
    color: var(--accent-color);
}

.mobile-menu-contacts {
    padding: 1.5rem;
}

.mobile-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-contact:hover {
    background-color: var(--bg-light);
}

.mobile-contact img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mobile-contact span {
    font-size: 1rem;
    word-break: break-word;
}

/* Обновляем стили для бургер-меню */
.burger-menu {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 968px) {
    .burger-menu {
        display: flex;
    }

    .header-contact {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-menu-content {
        width: 90%;
    }
    
    .mobile-contact {
        padding: 0.75rem;
    }
    
    .mobile-contact span {
        font-size: 0.95rem;
    }
}