:root {
  --head: #eaf2f8;
  --primary: #2c3e50;
  --secondary: #3498db;
  --third: #3f5973;
  --accent: #fa6900;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --text: #333;
  --text-light: #7f8c8d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Приоритетная загрузка шрифтов */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: local('Montserrat Regular'), local('Montserrat-Regular'),
       url('/fonts/montserrat-regular.woff2') format('woff2');
  font-display: swap; /* Не блокирует отрисовку текста */
}


body {
  font-family: "Montserrat", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: #f9f9f9;
}

a {
  text-decoration: none;
  color: var(--secondary);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--head), var(--dark));
  color: white;
  padding: 5px 0; /* Уменьшили вертикальный padding */
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  height: 70px; /* Жёстко фиксируем высоту */
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px; /* 70px (header) - 5px (padding-top) - 5px (padding-bottom) */
}

/* Логотип */
.logo {
  display: flex;
  align-items: center;
  order: 1; /* Первый элемент */
}

.logo img {
  height: 50px;
  width: auto;
  max-width: 280px;
  loading: lazy; /* Ленивая загрузка */
}

/* Блок партнеров */
.official-partners {
  display: flex;
  align-items: center;
  margin: 0 auto;
  order: 2; /* Второй элемент */
  flex-grow: 1;
  justify-content: center;
}

.partner-logo {
  height: 50px;
  width: auto;
  max-width: 180px;
  transition: transform 0.3s ease;
 loading: lazy; /* Ленивая загрузка */
}

.partner-logo:hover {
  transform: scale(1.1);
}

.partners-logos {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Навигация */
nav {
  order: 3; /* Третий элемент */
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: white;
  font-weight: 500;
}

/* Кнопка меню */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  order: 4; /* Последний элемент */
}

/* Мобильное меню */
.mobile-menu {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background-color: var(--primary);
  padding: 20px;
  transform: translateY(-150%);
  transition: transform 0.3s ease;
  z-index: 999;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu ul li {
  margin-bottom: 15px;
}

.mobile-menu ul li a {
  color: white;
  font-size: 1.1rem;
}

/* Адаптация для мобильных */
@media (max-width: 992px) {
  .official-partners {
    display: none;
  }
  
  nav ul {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .header-container {
    justify-content: space-between;
  }
}


html, body {
  overflow-x: hidden; /* Гарантируем отсутствие горизонтального скролла */
  width: 100%;
}


/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: white;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 100px 0; /* Отступы сверху и снизу */
  box-sizing: border-box;
  text-align: center;
}

/* Маленький placeholder с сеточкой */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    /* Темная сеточка - SVG паттерн */
    url('data:image/svg+xml;utf8,<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h8v1H0zM0 0h1v8H0z" fill="rgba(0,0,0,1)"/></svg>'),
    /* Затемнение */
    linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    /* Фоновое изображение */
    url("../images/background-small.webp");
  background-position: center;
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: auto, cover, cover;
  z-index: -1;
}

/* Полноразмерное изображение с сеточкой */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    /* Темная сеточка - SVG паттерн */
    url('data:image/svg+xml;utf8,<svg width="4" height="4" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h4v1H0zM0 0h1v4H0z" fill="rgba(0,0,0,1)"/></svg>'),
    /* Затемнение */
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    /* Фоновое изображение */
    url("../images/background.webp");
  background-position: center;
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: auto, cover, cover;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero.loaded::after {
  opacity: 1;
}


.hero-content {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  padding: 130px 10px 10px; /* 40px сверху, 20px по бокам, 20px снизу */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 10vw, 2.5rem);
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.3;
  text-align: center;
  width: 100%;
  word-break: break-word; /* Важно! Разрешаем перенос длинных слов */
  overflow-wrap: anywhere; /* Экстренный перенос при необходимости */
  hyphens: auto; /* Перенос слов с дефисами (поддерживается не везде) */
  padding: 5px 25px; /* Минимальные боковые отступы */
  box-sizing: border-box;
}
.hero p {
  font-size: clamp(1rem, 5vw, 1.2rem);
  margin-bottom: 2.5rem;
  color: white;
  text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.6;
}

.btn {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.btn:hover, .btn:focus, .btn:active {
  background-color: #e55b00;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  color: white;
}

.btn:visited {
  color: white !important; /* Важно для посещённых ссылок */
}

@media (max-width: 615px) {
  .hero h1 {
  font-size: 1rem;
  line-height: 1.1;
  padding: 0 max(5px, env(safe-area-inset-left)); /* Учитываем безопасные зоны */
  margin: 0 auto;
  width: min(100%, 605px); /* Ограничение максимальной ширины */
}
  
  .hero-content {
    padding: 65px 0px;
    width: 95%; /* Увеличиваем занимаемое пространство */
  }
}



/* Services Section */
.services {
  padding: 80px 0;
  background-color: white;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--primary);
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.section-title h2:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--accent);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%; /* Чтобы карточки были одинаковой высоты */
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-img {
  position: relative;
  overflow: hidden;
  /* Фиксированное соотношение 4:3 */
  padding-top: 75%; /* 3/4 * 100% = 75% (для 4:3) */
}

.service-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Обрезка с сохранением пропорций */
  transition: transform 0.5s ease;
}

.service-card:hover .service-img img {
  transform: scale(1.1); /* Эффект увеличения */
}

.service-content {
  padding: 20px;
  flex-grow: 1; /* Растягиваем контент для одинаковых карточек */
}

.service-content h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--primary);
}

/* About Section */
.about {
  padding: 80px 0;
  background-color: var(--light);
}

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

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.about-text p {
  margin-bottom: 15px;
}

.about-img {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* Map Section */
.map {
  padding: 60px 0;
  background-color: white;
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

#yandex-map {
  width: 100%;
  height: 100%;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Contact Section */
.contact {
  padding: 20px 0;
  background: linear-gradient(180deg, var(--third), var(--dark));
  color: white;
}

.contact-grid {
  padding: 50px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 5px;
}

.contact-info h3:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--accent);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
}

.contact-icon {
  margin-right: 15px;
  color: var(--accent);
}


/* Footer */
footer {
  background-color: var(--dark);
  color: white;
  padding: 40px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.footer-logo {
  margin-bottom: 30px;
}

.footer-logo img {
  height: 35px;
}

.footer-links h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 10px;
}

.footer-links h4:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: #bdc3c7;
}

.footer-links ul li a:hover {
  color: white;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #bdc3c7;
  font-size: 0.9rem;
}


/* Responsive Styles */
@media (max-width: 992px) {
  .about-content {
    grid-template-columns: 1fr;
  }

  .about-img {
    order: -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  nav ul {
    display: none;
  }

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

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

@media (max-width: 576px) {
  .hero {
    min-height: 500px;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .map-container {
    height: 300px;
  }
}

/* Стили для видео-контейнера */
.about-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 соотношение */
}

.video-poster,
#about-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Чтобы изображение/видео заполняло контейнер */
}
.video-poster {
  z-index: 1; /* Картинка над видео (если видео загрузится) */
  transition: opacity 0.3s;
}

#about-video {
  display: none;
  z-index: 2; /* Когда видео активно - оно поверх */
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(42, 93, 139, 0.8); /* Полупрозрачный морской синий */
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 3;
}

.video-play-btn svg {
  color: white;
  margin-left: 5px; /* Смещение треугольника play */
}

.video-play-btn:hover {
  background: rgba(42, 93, 139, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .video-play-btn {
    width: 60px;
    height: 60px;
  }

  .video-play-btn svg {
    width: 48px;
    height: 48px;
  }
}
