/* ============================================================
   STYLE.CSS — Chemidova Landing Page
   Структура:
   1.  Переменные и сброс
   2.  Типографика
   3.  Анимация fade-in
   4.  Навигация
   5.  Hero
   6.  Кнопки
   7.  О себе / Stats
   8.  Услуги
   9.  Портфолио
   10. FAQ
   11. CTA
   12. Футер
   13. Попапы (Оферта / Политика)
   14. Cookie-баннер
   15. Кнопка Наверх
   16. Страница 404
   17. Мобильная версия
   ============================================================ */

/* ── 1. ПЕРЕМЕННЫЕ И СБРОС ─────────────────────────────── */
:root {
  --black: #111111;
  --beige: #F9F6F0;
  --gold:  #C6A87C;
  --white: #ffffff;
  --gray:  #444444;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--beige);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }


/* ── 2. ТИПОГРАФИКА ────────────────────────────────────── */
.section-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.32em;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 20px;
}


/* ── 3. АНИМАЦИЯ FADE-IN ───────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ── 4. НАВИГАЦИЯ ──────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 30px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: padding 0.4s, background 0.4s, border-color 0.4s;
}

.header.scrolled {
  background: rgba(249, 246, 240, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 5%;
  border-bottom: 1px solid rgba(198, 168, 124, 0.15);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
}

.nav-link {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 600;
  opacity: 0.7;
  color: var(--black);
  transition: opacity 0.3s, color 0.3s;
}
.nav-link:hover { opacity: 1; color: var(--gold); }


/* ── 5. HERO ───────────────────────────────────────────── */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 5%;
  background: var(--beige);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0; right: 0;
  width: 55%; height: 100%;
  z-index: 1;
  background: #2a2520; /* Плейсхолдер до загрузки */
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Градиент для плавного перехода фона в картинку */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--beige) 40%, transparent 80%);
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 700px;
}

.hero-subtitle {
  display: block;
  font-size: 13px;
  letter-spacing: 0.38em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 80px);
  margin-bottom: 30px;
  line-height: 1.05;
}
.hero h1 i { color: var(--gold); font-style: italic; font-weight: 400; }

.hero p {
  font-size: 18px;
  max-width: 85%;
  color: var(--gray);
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }


/* ── 6. КНОПКИ ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 20px 40px;
  border: 1px solid var(--black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--black);
  background: transparent;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
.btn:hover { background: var(--black); color: var(--beige); }

.btn-gold { border-color: var(--gold); color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: var(--white); }

.btn-large {
  display: inline-block;
  padding: 22px 52px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.3s, color 0.3s;
  cursor: pointer;
  background: transparent;
  text-decoration: none;
}
.btn-large:hover { background: var(--gold); color: var(--white); }

.gold-line {
  width: 50px; height: 1px;
  background: var(--gold);
  margin: 0 auto 30px;
}


/* ── 7. О СЕБЕ / STATS ─────────────────────────────────── */
.about {
  padding: 120px 5%;
  text-align: center;
  background: var(--white);
}
.about h2 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 30px; }
.about p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 20px;
  color: var(--gray);
  line-height: 1.85;
}

.stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 60px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  border-top: 1px solid rgba(198, 168, 124, 0.2);
  border-bottom: 1px solid rgba(198, 168, 124, 0.2);
  padding: 40px 0;
  flex-wrap: wrap;
}
.stat-item {
  flex: 1;
  min-width: 160px;
  text-align: center;
  padding: 0 28px;
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  color: var(--black);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.stat-text {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #888;
  line-height: 1.5;
}
.stat-sep {
  width: 1px;
  height: 52px;
  background: rgba(198, 168, 124, 0.3);
  flex-shrink: 0;
}


/* ── 8. УСЛУГИ ─────────────────────────────────────────── */
.services {
  padding: 100px 5%;
  background: var(--black);
  color: var(--beige);
}
.center-head {
  text-align: center;
  margin-bottom: 72px;
}
.center-head h2 { font-size: clamp(32px, 4vw, 42px); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}
.service-card {
  border-left: 1px solid rgba(198, 168, 124, 0.3);
  padding-left: 30px;
}
.s-num {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  color: var(--gold);
  margin-bottom: 18px;
  font-weight: 700;
  line-height: 1;
}
.service-card h3 {
  font-size: 22px;
  margin-bottom: 18px;
  color: var(--beige);
}
.service-card ul { margin-top: 0; }
.service-card li {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 10px;
  padding-left: 14px;
  position: relative;
}
.service-card li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 10px;
  top: 2px;
}


/* ── 9. ПОРТФОЛИО ──────────────────────────────────────── */
.portfolio { padding: 120px 5%; }
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  max-width: 1200px;
  margin: 0 auto;
}
.p-item {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  cursor: pointer;
  background: #2a2520;
}
.p-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1), filter 0.6s;
  filter: grayscale(15%);
}
.p-item:hover img { transform: scale(1.1); filter: grayscale(0%); }

.p-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82), transparent 60%);
  opacity: 0;
  transition: opacity 0.45s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
}
.p-item:hover .p-overlay { opacity: 1; }

.p-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--white);
  font-weight: 700;
  transform: translateY(8px);
  transition: transform 0.4s;
}
.p-item:hover .p-title { transform: translateY(0); }

.p-cat {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-top: 8px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s 0.06s, transform 0.4s 0.06s;
}
.p-item:hover .p-cat { opacity: 1; transform: translateY(0); }

/* Расширение для сетки портфолио */
.p-item-wide {
  grid-column: 1 / -1; /* Жестко принуждаем занять всю строку от края до края */
  aspect-ratio: 16 / 9; /* Горизонтальные пропорции */
}

/* На мобилках все равно возвращаем в одну колонку */
@media (max-width: 900px) {
  .p-item-wide {
    grid-column: span 1;
    aspect-ratio: 3 / 2;
  }
}

/* ── 10. FAQ ───────────────────────────────────────────── */
.faq { padding: 100px 5%; background: var(--white); }
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
details {
  border-bottom: 1px solid #eee;
  padding: 0;
  overflow: hidden;
}
details:first-of-type { border-top: 1px solid #eee; }

summary {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 26px 0;
  gap: 16px;
  transition: color 0.3s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--gold); }
summary span {
  color: var(--gold);
  font-size: 22px;
  font-weight: 300;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.3s;
}
details[open] summary span { transform: rotate(45deg); }

.faq-ans {
  padding: 4px 0 26px;
  font-size: 15px;
  color: #666;
  line-height: 1.8;
  max-width: 94%;
}


/* ── 11. CTA ───────────────────────────────────────────── */
.cta {
  padding: 150px 5%;
  background: var(--black);
  color: var(--beige);
  text-align: center;
}
.cta h2 {
  font-size: clamp(32px, 5vw, 60px);
  margin-bottom: 52px;
  line-height: 1.15;
}
.cta h2 i { color: var(--gold); font-style: italic; }

.cta-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cta-copy-btn {
  background: none;
  border: none;
  color: rgba(249, 246, 240, 0.3);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px solid rgba(198, 168, 124, 0.2);
  transition: color 0.3s, border-color 0.3s;
  display: block;
  margin: 0 auto;
}
.cta-copy-btn:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}


/* ── 12. ФУТЕР ─────────────────────────────────────────── */
.footer {
  padding: 52px 5% 36px;
  background: var(--beige);
  border-top: 1px solid rgba(198, 168, 124, 0.2);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #666;
}
.f-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 20px;
}
.f-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.f-links a,
.f-modal-btn {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--black);
  opacity: 0.6;
  background: none;
  border: none;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: opacity 0.3s, color 0.3s, border-color 0.3s;
  text-decoration: underline;
}
.f-links a:hover,
.f-modal-btn:hover {
  opacity: 1;
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-decoration: none;
}
.f-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 8px;
}
.f-note { font-style: italic; opacity: 0.8; }


/* ── 13. ПОПАПЫ ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.72);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 12px 12px 0 0;
  padding: 52px 56px 48px;
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 168, 124, 0.3) transparent;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: rgba(198, 168, 124, 0.3); border-radius: 2px; }

.modal-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, color 0.3s;
}
.modal-close:hover { border-color: var(--gold); color: var(--gold); }

.modal-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 14px;
}
.modal h2 { font-size: 28px; margin-bottom: 8px; }
.modal-date { font-size: 12px; color: #888; margin-bottom: 36px; }
.modal hr { border: none; border-top: 1px solid #eee; margin: 24px 0; }
.modal h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  margin: 24px 0 10px;
  color: var(--black);
}
.modal p, .modal li {
  font-size: 14px;
  line-height: 1.85;
  color: var(--gray);
  margin-bottom: 8px;
}
.modal ul { padding-left: 18px; list-style: disc; }
.modal ul li { margin-bottom: 5px; }
.modal a { color: var(--gold); border-bottom: 1px solid rgba(198, 168, 124, 0.3); }

.modal-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #999;
  line-height: 1.7;
  font-style: italic;
}


/* ── 14. COOKIE-БАННЕР ─────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--black);
  color: var(--beige);
  padding: 18px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 300;
  border-top: 1px solid rgba(198, 168, 124, 0.2);
  transform: translateY(0);
  transition: transform 0.4s;
}
.cookie-banner.hidden { transform: translateY(110%); }

.cookie-text {
  font-size: 12px;
  color: rgba(249, 246, 240, 0.55);
  line-height: 1.6;
  max-width: 680px;
}
.cookie-btn {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px 24px;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s;
}
.cookie-btn:hover { background: var(--gold); color: var(--white); }


/* ── 15. КНОПКА НАВЕРХ ─────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: transparent;
  border: 1px solid rgba(198, 168, 124, 0.4);
  color: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
  box-shadow: 0 5px 15px rgba(198, 168, 124, 0.2);
}


/* ── 16. СТРАНИЦА 404 ──────────────────────────────────── */
.page-404 {
  justify-content: center;
  text-align: center;
  background: var(--beige);
}
.page-404::before { display: none; }
.page-404 .hero-content { margin: 0 auto; }
.page-404 p { margin-left: auto; margin-right: auto; }


/* ── 17. МОБИЛЬНАЯ ВЕРСИЯ ──────────────────────────────── */
@media (max-width: 900px) {
  /* Hero */
  .hero-bg {
    width: 100%; height: 60vh;
    top: auto; bottom: 0;
    opacity: 0.95; /* Сделаем фото чуть ярче */
  }
  
  /* ИСПРАВЛЕНИЕ: Градиент идет сверху вниз! Защищает текст, открывает фото */
  .hero::before {
    background: linear-gradient(to bottom, var(--beige) 40%, transparent 100%);
  }
  
  .hero p { max-width: 100%; font-size: 16px; }
  
  .hero-btns { 
    gap: 12px; 
    position: relative; 
    z-index: 10; /* Поднимаем кнопки над фото */
  }

  /* Услуги */
  .services-grid { grid-template-columns: 1fr; gap: 36px; }

  /* Портфолио */
  .portfolio-grid { grid-template-columns: 1fr; }
  
  /* p-item мы НЕ трогаем, он идеально берет свои 4/5 из десктопа.
     Подгоняем только широкое фото под экран телефона */
  .p-item-wide {
    grid-column: 1 / -1;
    aspect-ratio: 3 / 2; 
  }

  /* Stats */
  .stats { flex-direction: column; padding: 32px 5%; }
  .stat-item { padding: 18px 0; width: 100%; }
  .stat-sep { width: 44px; height: 1px; }
  .stat-num { font-size: 40px; }

  /* FAQ */
  summary { font-size: 17px; }

  /* CTA */
  .cta-btns { flex-direction: column; align-items: center; }
  .btn-large { width: 100%; max-width: 360px; text-align: center; }

  /* Футер */
  .f-top { flex-direction: column; align-items: flex-start; }
  .f-bottom { flex-direction: column; gap: 10px; }

  /* Cookie */
  .cookie-banner { flex-direction: column; align-items: flex-start; gap: 14px; }

  /* Модалки */
  .modal { padding: 40px 24px 36px; border-radius: 16px 16px 0 0; max-height: 92vh; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 36px; }
  .hero-btns { flex-direction: column; width: 100%; gap: 14px; }
  
  /* ИСПРАВЛЕНИЕ КНОПОК: Эффект матового стекла + Крупный шрифт */
  .btn { 
    width: 100%; 
    text-align: center; 
    padding: 18px 20px; 
    
    /* Делаем шрифт крупнее и увереннее */
    font-size: 13px; 
    font-weight: 700;
    letter-spacing: 0.15em; 
    
    /* Светлое стекло для кнопки "Портфолио" */
    background: rgba(249, 246, 240, 0.35); /* 35% заливки */
    backdrop-filter: blur(10px); /* Магическое размытие фона */
    -webkit-backdrop-filter: blur(10px); /* Для iPhone */
    border: 1px solid rgba(17, 17, 17, 0.2); /* Еле заметная рамка */
    color: var(--black);
  }
  
  .btn-gold {
    /* Темное стекло для кнопки "Связаться" */
    background: rgba(17, 17, 17, 0.45); /* 45% темной заливки */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(198, 168, 124, 0.5); /* Полупрозрачное золото */
    color: var(--gold); 
    /* Тонкая тень под текстом, чтобы золото 100% читалось на любом фоне */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); 
  }

  .f-links { flex-direction: column; align-items: flex-start; gap: 12px; }
}