/* =========================================
   1. ПЕРЕМЕННЫЕ И БАЗА
   ========================================= */
:root {
  --bg: #fbfaf8;
  --text: #171412;
  --muted: #726a63;
  --line: rgba(31, 24, 20, 0.08);
  --accent: #171412;
  --content-width: 96%; /* Сайт занимает почти весь экран */
  --swup-fade-theme-duration: 0.4s;
}

* { box-sizing: border-box; }
html { 
  /* scroll-behavior: smooth;  */
  /* 1. Чтобы плавающая шапка не закрывала заголовки при клике в меню */
  scroll-padding-top: 100px; 
  /* 2. Убираем уродливое серое выделение при клике пальцем на телефоне */
  -webkit-tap-highlight-color: transparent; 
}

h1, h2, h3 {
  letter-spacing: -0.03em; /* Чуть плотнее буквы — выглядит более стильно */
}

.eyebrow {
  letter-spacing: 0.2em; /* Наоборот, раздвигаем маленькие надписи для «элитарности» */
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: auto; border-radius: 0; }
a { text-decoration: none; color: inherit; }

/* Оболочка */
.site-shell {
  width: var(--content-width);
  max-width: 1800px;
  margin: 0 auto;
  padding: 10px 0 60px;
}

/* =========================================
   2. ШАПКА
   ========================================= */
.topbar {
  position: sticky;
  top: 15px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  
  /* Эффект стекла */
  background: rgba(255, 255, 255, 0.6); 
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  border-radius: 100px;
  margin-bottom: 40px;
}

.brand { font-size: 1.3rem; font-weight: 800; }
.topnav { display: flex; gap: 20px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.topnav a:hover { color: var(--text); }

/* Базовые стили бургера (Скрыт на ПК) */
.burger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 101;
}
.burger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}


/* =========================================
   ИДЕАЛЬНЫЙ БЛОК СРАВНЕНИЯ (ПК + МОБ)
   ========================================= */
/* Общие отступы секции */
.comparison-section {
  width: 100%;
  margin-bottom: 80px;
}

/* Контейнер карусели */
.comparison-swiper {
  max-width: 1100px;
  width: 90%;
  margin: 0 auto;
  padding-bottom: 40px; /* Место под точки */
  position: relative;
}

/* Базовая коробка для слайдера */
.comparison-container {
  width: 100%;
  max-width: 900px; /* Было 1100, стало 900 — будет аккуратнее */
  margin: 0 auto;
  aspect-ratio: 3 / 2; 
  background: #f0f0f0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  
   display: flex;
  align-items: center;
  justify-content: center;
}

/* КОНТРОЛЬ ПОРТРЕТОВ: если есть этот класс, блок будет узким */
.comparison-container.is-portrait {
  max-width: 650px; /* Ограничиваем ширину, чтобы портрет не был гигантским */
  margin: 0 auto;
  aspect-ratio: 4 / 5; /* СТРОГО 4 к 5 */
  background: #f0f0f0;
  border-radius: 0 !important; /* Острые углы */
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

img-comparison-slider {
  /* width: 100%;
  height: 100%;
  outline: none; */
  width: 100%;
  height: 100%;
  outline: none;
  --divider-width: 2px;
  --handle-size: 35px;
}

img-comparison-slider img {
 width: 100% !important;
  height: 100% !important;
  object-fit: fill !important; 
  object-position: center !important;
  display: block;
  
  /* ДОБАВЛЯЕМ ЭТИ СТРОКИ: */
  transform: translateZ(0); /* Принудительное ускорение GPU */
  backface-visibility: hidden; /* Убирает микро-мерцания */
  -webkit-perspective: 1000;
  will-change: clip-path; /* Подсказывает браузеру, что область будет меняться */
  image-rendering: -webkit-optimize-contrast; /* Немного стабилизирует резкость при движении */
}

/* СТИЛЬ СТРЕЛОК */
.swiper-button-next,
.swiper-button-prev {
  color: var(--text) !important; /* Черный цвет вместо синего */
  background: rgba(255, 255, 255, 0.5); /* Эффект стекла */
  backdrop-filter: blur(8px);
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  top: calc(50% + 5px) !important; 
}

.swiper-button-prev { left: 10px !important; }
.swiper-button-next { right: 10px !important; }

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 14px !important;
  font-weight: 900;
}

.comparison-swiper .swiper-pagination {
  bottom: 5px !important; /* Четко внизу под фото */
}

.swiper-pagination-bullet {
  background: #ccc !important;
  width: 6px !important;
  height: 6px !important;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background: var(--accent) !important;
  width: 16px !important;
  border-radius: 4px !important;
}


/* Делаем сами иконки стрелок меньше */
.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 14px !important; /* Маленький аккуратный размер */
  font-weight: 900;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

/* СТИЛЬ ТОЧЕК (ПАГИНАЦИЯ) */
.swiper-pagination-bullet {
  background: #d0d0d0 !important; /* Серые неактивные точки */
  opacity: 1 !important;
  width: 6px !important;
  height: 6px !important;
  transition: all 0.3s ease;
}

/* Активная точка — в цвет твоего бренда */
.swiper-pagination-bullet-active {
  background: var(--accent) !important; /* Твой черный цвет */
  width: 18px !important; /* Делаем активную точку длиннее (стильно) */
  border-radius: 4px !important;
}




/* =========================================
   3. ГЛАВНЫЙ БЛОК (ПРОФИЛЬ)
   ========================================= */
.hero {
  display: grid;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  margin-bottom: 40px;
  gap: 30px;
}

.hero-copy { display: grid; gap: 15px; }
.eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1; margin: 0; font-weight: 800; }
.hero-lead p { font-size: 1rem; margin: 0; }
.hero-text { font-size: 0.9rem; color: var(--muted); }
.section-spacing {
    margin-top: 1rem; /* Настройте число под себя (px, rem или vh) */
}

/* Фиксированный портрет профиля */
.hero-visual { width: 100%; max-width: 240px; justify-self: end; }
.hero-visual img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }

/* Кнопки */
.hero-actions { display: flex; gap: 10px; margin-top: 10px; }
.button { padding: 12px 24px; border-radius: 16px; font-weight: 600; font-size: 0.85rem; border: 1px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: 0.3s; }
.button-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.button-primary:hover { background: #2e2722; border-color: #2e2722; }

/* =========================================
   4. ГАЛЕРЕИ (ИДЕАЛЬНАЯ СЕТКА)
   ========================================= */
.section-intro { margin-bottom: 20px; }

.gallery-grid-featured, 
.gallery-grid-story {
  display: grid;
  width: 100%;
  gap: 4px; /* ТОТ САМЫЙ ТОНКИЙ ШОВ. Если хочешь шире - ставь 8px */
}

.gallery-card {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f1efeb; /* Темный фон на долю секунды, пока грузится фото */
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Это правило нужно, чтобы тег <a> (для клика) занимал всё место и сетка не ехала */
.gallery-card a {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important; /* Острые углы */
  /* Плавный переход: чуть быстрее и с породистой кривой */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform; /* Подсказка браузеру для плавной работы */
}

.gallery-card:hover img {
  /* Еле заметный зум (на 3%) */
  transform: scale(1.01); 
}

/* =========================================
   5. ПОЛНЫЕ СЕРИИ (СПИСОК НА ГЛАВНОЙ)
   ========================================= */
.series-list { display: grid; gap: 20px; }

.series-card {
  display: grid;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 24px;
  align-items: center;
  gap: 30px;
  transition: 0.3s;
}
.series-card:hover { background: rgba(255, 255, 255, 0.8); }

.series-cover { border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #f1efeb;}
.series-cover img { width: 100%; height: 100%; object-fit: cover;  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
.series-card:hover .series-cover img { transform: scale(1.01); }

.series-copy h3 { font-size: 1.5rem; margin: 10px 0; }
.series-meta { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; margin-bottom: 15px;}

/* Шапка внутри самой свадьбы */
.series-hero { margin-bottom: 20px; padding: 20px 0; }

/* =========================================
   6. ФУТЕР (КОНТАКТЫ)
   ========================================= */
.contact-block {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 32px;
  margin-top: 80px;
}
.contact-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}


/* Начальное состояние для всех анимируемых элементов */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Состояние после появления */
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}


/* =========================================
   ФОРМА ОБРАТНОЙ СВЯЗИ
   ========================================= */
/* Центрируем всё и ограничиваем ширину, чтобы не расплывалось */
.contact-container {
  max-width: 600px; /* Оптимальная ширина для формы */
  margin: 0 auto;
  text-align: center;
}

/* Сетка кнопок: 4 в ряд */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px; /* Прижимаем к форме */
}

/* Сами карточки мессенджеров */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 16px; /* Единый радиус */
  transition: all 0.3s ease;
}

.contact-card span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-card:hover {
  background: #000;
  transform: translateY(-3px);
}

/* Форма — делаем её единым целым с кнопками */
.contact-form {
  display: grid;
  gap: 10px;
  width: 100%;
}

.form-group input, 
.form-group textarea {
  width: 100%;
  padding: 18px 20px;
  background: #f8f8f8; /* Очень легкий серый фон */
  border: 1px solid var(--line);
  border-radius: 12px; /* Тот же радиус, что у кнопок */
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
  background: #fff;
  border-color: var(--accent);
}

/* Кнопка отправить — на всю ширину */
.form-submit {
  width: 100%;
  height: 55px;
  border-radius: 12px !important; /* Тот же радиус */
  margin-top: 5px;
  justify-content: center;
}

/* Адаптив: на мобилках кнопки 2х2 */
@media (max-width: 639px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-container {
    padding: 0 10px;
  }
}

/* =========================================
   7. АДАПТИВНОСТЬ
   ========================================= */

/* =========================================
   7. АДАПТИВНОСТЬ
   ========================================= */

/* --- МОБИЛКИ (до 768px) --- */
@media (max-width: 768px) {
  /* Сделали 92% вместо 98%, чтобы контент не прилипал вплотную к краям телефона */
  :root { --content-width: 92%; }
  
  /* Главный экран */
  .hero { 
    grid-template-columns: 1fr; 
    text-align: center; 
    padding: 30px 20px; /* Чуть увеличили отступы внутри блока */
  }
  
  /* Сделали фото профиля крупнее (было 180px, стало 260px) */
  .hero-visual { 
    justify-self: center; 
    order: -1; 
    max-width: 260px; 
    width: 100%; 
  }
  .hero-actions { justify-content: center; }

  /* 
     ГАЛЕРЕЯ: ФОТО В 1 РЯД (КОЛОНКУ)
     Изменили repeat(2, 1fr) на 1fr 
  */
  .gallery-grid-featured, 
  .gallery-grid-story {
    grid-template-columns: 1fr; 
    gap: 8px; /* Чуть увеличили зазор, так как фото стали большими */
  }

  /* Карточки серий ("Иван и Мария" и т.д.) - делаем их крупнее и просторнее */
  .series-card { 
    grid-template-columns: 1fr; 
    gap: 20px; 
    padding: 20px; 
  }
  
  /* Изменяем пропорции обложки серии, чтобы она не была слишком узкой на телефоне */
  .series-cover { 
    aspect-ratio: 4 / 3; 
  }

  /* Скрываем навигацию ПК */
  /* --- Мобильная шапка и бургер --- */

  .burger-btn {
    display: block; /* Показываем бургер на мобилке */
  }

  /* Скрытое выпадающее меню */
  /* Скрытое выпадающее меню */
  /* --- Мобильная шапка --- */
  .topbar {
    position: sticky;
    top: 15px;
    z-index: 100;
    flex-direction: row; 
    justify-content: space-between;
    padding: 12px 20px;
    
    /* 1. ОБНУЛЯЕМ стекло у самой шапки, чтобы не было конфликта */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* 2. СОЗДАЕМ подложку и вешаем стекло на неё */
  .topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1; /* Прячем под логотип и кнопку */
    border-radius: 100px;
    
    /* Тот самый эффект стекла */
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  }

  /* 3. Скрытое выпадающее меню (тут оставляем стекло как было) */
  .topnav { 
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
    
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-radius: 24px;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }
  
  .topnav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px); 
  }

  /* Класс, который JS добавит при клике (Открытое меню) */
  .topnav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px); /* Немного отступает вниз от шапки */
  }

  /* Анимация бургера в крестик */
  .burger-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .burger-btn.is-active span:nth-child(2) {
    opacity: 0;
  }
  .burger-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Настройки слайдера до/после для телефона */
  .comparison-container, .comparison-container.is-portrait {
    max-width: 100%;
    aspect-ratio: 4 / 5; /* Вертикальный формат для удобства */
  }
  .swiper-button-next,
  .swiper-button-prev {
    width: 36px !important;
    height: 36px !important;
  }
  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 12px !important;
  }
}

/* --- КОНТАКТЫ ДЛЯ УЗКИХ ЭКРАНОВ --- */
@media (max-width: 639px) {
  /* Кнопки мессенджеров встанут квадратом 2x2, чтобы было удобно нажимать пальцем */
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .contact-container {
    padding: 0 5px;
  }
}

/* --- ПК --- */
@media (min-width: 769px) {
  .hero { grid-template-columns: 1fr 240px; }

  /* 3 КОЛОНКИ НА ПК */
  .gallery-grid-featured, .gallery-grid-story {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; 
  }

  .series-card { grid-template-columns: 1fr 1fr; }
}

/* --- ОГРОМНЫЕ ЭКРАНЫ --- */
@media (min-width: 1400px) {
  .gallery-grid-featured, .gallery-grid-story {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}


/* =========================================
   8. АНИМАЦИИ SWUP
   ========================================= */
.transition-fade { transition: opacity 0.3s ease, transform 0.3s ease; opacity: 1; transform: translateY(0); }
html.is-animating .transition-fade { opacity: 0; transform: translateY(10px); }

@media (max-width: 768px) {
  .comparison-container, .comparison-container.is-portrait {
    max-width: 100%;
    aspect-ratio: 4 / 5; /* На мобилке всё в квадрат для удобства */
  }
   .swiper-button-next,
  .swiper-button-prev {
    width: 36px !important;
    height: 36px !important;
  }
  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 12px !important;
  }
}

/* Обертка для кнопки "Раскрыть все", центрируем её */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  width: 100%;
}

/* =========================================
   ИЗМЕНЕНИЯ СЕТКИ (Всегда 4 в ряд на ПК)
   ========================================= */

/* --- Мобилка (до 768px): 1 ФОТО В РЯД --- */
@media (max-width: 768px) {
  .gallery-grid-featured, 
  .gallery-grid-story {
    grid-template-columns: 1fr; 
    gap: 8px; 
  }
}

/* --- ПК (от 769px и выше): СТРОГО 4 ФОТО В РЯД --- */
@media (min-width: 769px) {
  .gallery-grid-featured, 
  .gallery-grid-story {
    grid-template-columns: repeat(4, 1fr) !important; /* Всегда 4 колонки */
    gap: 6px; 
  }
}


/* База для мобилок (оставляем 3:4) */
.hero-visual {
  width: 100%;
  max-width: 260px; /* Чуть увеличим и на мобилке для баланса */
  justify-self: center;
}

.hero-visual img {
  aspect-ratio: 3 / 4; 
  object-fit: cover;
  border-radius: 12;
}

/* Настройки для ПК (от 769px) */
@media (min-width: 769px) {
  .hero {
    /* Меняем пропорции колонок: текст / фото */
    grid-template-columns: 1fr 400px !important; 
    align-items: center; /* Центрируем текст по вертикали относительно фото */
    gap: 50px;
  }

  .hero-visual {
    max-width: 400px; /* Увеличиваем размер авы */
  }

  .hero-visual img {
    aspect-ratio: 1 / 1; /* На ПК — строго квадрат */
  }
}



/* =========================================
   1. ИСПРАВЛЕНИЕ СКРОЛЛА (ГИБРИДНЫЙ ВАРИАНТ)
   ========================================= */

/* Возвращаем плавный скролл для обычного использования сайта */
html { 
  scroll-behavior: smooth; 
  scroll-padding-top: 100px; 
  -webkit-tap-highlight-color: transparent; 
}

/* ОТКЛЮЧАЕМ плавный скролл при переходах Swup (в момент смены страниц).
   Класс .is-changing Swup вешает сам. Теперь переход страниц будет мгновенным! */
html.is-changing {
  scroll-behavior: auto !important;
}


/* =========================================
   2. ОПТИМИЗАЦИЯ АНИМАЦИИ (УБИРАЕМ LAGS)
   ========================================= */

/* Заменяем transition: all на конкретные свойства. 
   Теперь видеокарта анимирует только прозрачность и сдвиг, не нагружая систему */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity; /* Прямое указание видеокарте подготовиться к плавной анимации */
}

/* Состояние после появления */
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}


/* Элегантное проявление фото при загрузке */
@keyframes imageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gallery-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  
  /* ДОБАВЛЯЕМ ЭТУ СТРОКУ: */
  animation: imageFadeIn 0.5s ease-in-out; /* Фото будет плавно проявляться за 0.5 сек в момент подгрузки */
}