﻿body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #003366;
}

header {
    position: sticky;
    top: 0;
    background-color: #003366;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

header img {
    height: 70px;
}

nav a {
    color: white;
    margin-left: 20px;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

section {
    padding: 40px 20px;
    max-width: 1000px;
    margin: auto;
    scroll-margin-top: calc(70px + 20px);
}

/* Стили для героя-шапки */
.hero {
    position: relative;
    width: 100vw;
    min-width: 100%;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 400px;
    overflow: hidden; /* Исправленный background с градиентом */
    background: linear-gradient(to bottom, rgba(0, 51, 102, 0.7), rgba(0, 51, 102, 0.3)), url('background.jpg') no-repeat center center / cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 1000px; /* Согласуем с шириной main */
    width: 100%;
    padding: 0 20px;
    margin: 0 auto; /* Центрируем контент внутри hero */
}

/* Плавный переход к следующей секции */
#about {
    background: white;
    padding-top: 40px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Адаптивность для героя */
@media (max-width: 768px) {
    .hero {
        height: 300px;
    }

        .hero h1 {
            font-size: 2rem;
        }
}

@media (max-width: 480px) {
    .hero {
        height: 250px;
    }

        .hero h1 {
            font-size: 1.5rem;
        }

    .hero-subtitle {
        font-size: 1rem;
    }
}

h2 {
    color: #003366;
    border-left: 5px solid #ffcc00;
    padding-left: 10px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-top: 30px;
    align-items: center;
}

.client-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.client-logo {
    max-width: 150px;
    max-height: 80px;
    width: auto;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.client-name {
    margin-top: 15px;
    color: #003366;
    font-weight: bold;
}

/* Эффекты при наведении */
.client-item:hover {
    transform: translateY(-5px);
}

    .client-item:hover .client-logo {
        filter: grayscale(0%);
        opacity: 1;
    }

/* Адаптивность */
@media (max-width: 768px) {
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .clients-grid {
        grid-template-columns: 1fr;
    }
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-item {
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.project-item img {
    max-width: 100%;
    border-radius: 4px;
}

.footer {
  background-color: #002e5b;
  color: white;
  padding: 40px 20px;
}

.footer h3 {
  margin-bottom: 10px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.footer-contacts,
.footer-map {
  flex: 1 1 300px;
}

.footer iframe {
  border: 0;
  width: 100%;
  height: 200px;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
  }

  .footer iframe {
    height: 250px;
  }
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.project-item {
    position: relative;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.project-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 51, 102, 0.9), transparent);
    color: white;
    font-size: 1.2rem;
    z-index: 2;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 51, 102, 0.85);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

    .project-overlay p {
        transform: translateY(20px);
        transition: transform 0.4s ease;
        text-align: center;
    }

/* Эффекты при наведении */
.project-item:hover .project-image {
    transform: scale(1.05);
}

.project-item:hover .project-overlay {
    opacity: 1;
}

    .project-item:hover .project-overlay p {
        transform: translateY(0);
    }

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-item {
        height: 200px;
    }
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    /* Шапка */
    header {
        flex-direction: column;
        padding: 10px;
    }

    nav {
        margin-top: 15px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

        nav a {
            margin-left: 0;
        }

    /* Основной контент */
    section {
        padding: 20px 15px;
    }

    /* Портфолио */
    .project-gallery {
        grid-template-columns: 1fr;
    }

    /* Клиенты */
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Подвал */
    .footer-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    /* Клиенты и портфолио — в одну колонку */
    .clients-grid, .project-gallery {
        grid-template-columns: 1fr;
    }
}