/* ═══════════════════════════════════════════════════
   index.css — стили главной страницы
   ai-melissa.space / index.html
   ═══════════════════════════════════════════════════ */

/* ─── BODY (главная — светлый фон) ─── */
body {
  background: var(--warm-white);
  color: var(--charcoal);
}

/* ─── NAV — специфика главной ─── */
.site-nav {
  z-index: 100;
  transition: background 0.3s;
}

/* ─── БУРГЕР-КНОПКА ─── */
.nav-burger {
  display: none; /* видна только на мобильных через медиа-запрос */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  /* Достаточный тач-таргет по WCAG (44×44) */
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 11px;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Бургер → крест при открытом меню */
.site-nav.open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-nav.open .nav-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.site-nav.open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── МОБИЛЬНОЕ МЕНЮ (выезжает под nav) ─── */
.mobile-menu {
  position: fixed;
  top: 64px; /* = высота nav */
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(28, 26, 24, 0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(184, 149, 90, 0.15);
  display: flex;
  flex-direction: column;
  /* Скрыто: через max-height для плавной анимации */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  /* Не мешает кликам, когда закрыто */
  pointer-events: none;
}

.mobile-menu.open {
  max-height: 360px;
  pointer-events: auto;
}

.mobile-link {
  padding: 16px 28px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-link:last-child {
  border-bottom: none;
}

.mobile-link:hover,
.mobile-link:focus {
  color: var(--gold-light);
  background: rgba(184, 149, 90, 0.06);
  outline: none;
}

.mobile-link--gallery {
  color: var(--gold);
  border-top: 1px solid rgba(184, 149, 90, 0.15);
  border-bottom: none;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--gold-light);
}

.nav-gallery-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.25s;
}

.nav-gallery-btn:hover {
  background: var(--gold);
  color: var(--charcoal);
}

/* ─── HERO ─── */
.hero {
  /* FIX: 100dvh корректно учитывает адресную строку iOS Safari.
     Fallback для браузеров без поддержки dvh (< Chrome 108, < Safari 15.4) */
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;

  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero-left {
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px 60px 100px;
  position: relative;
  overflow: hidden;
}

.hero-left::before {
  content: 'M';
  position: absolute;
  top: -60px;
  left: -20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 420px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  pointer-events: none;
}

.hero-tag {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(52px, 6vw, 86px);
  font-weight: 300;
  line-height: 1.05;
  color: var(--warm-white);
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--gold-light);
}

.hero-sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 380px;
  line-height: 1.8;
  margin-bottom: 48px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--gold);
  color: var(--charcoal);
  text-decoration: none;
  padding: 16px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background 0.3s;
  /* FIX: добавлен webkit-вариант для Safari < 15.4 */
  width: -webkit-fit-content;
  width: fit-content;
}

.hero-cta:hover {
  background: var(--gold-light);
}

.hero-right {
  position: relative;
  background: var(--blush);
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: sepia(8%) contrast(1.05);
}

.hero-photo-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(28, 26, 24, 0.15) 0%, transparent 40%),
    linear-gradient(to top, rgba(28, 26, 24, 0.7) 0%, transparent 40%);
}

.hero-quote {
  position: absolute;
  bottom: 40px;
  left: 40px;
  right: 40px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--warm-white);
  line-height: 1.6;
  padding: 16px 20px;
  background: rgba(28, 26, 24, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-left: 2px solid var(--gold);
}

/* ─── SCROLL INDICATOR ─── */
.scroll-hint {
  /* FIX: убран position:absolute с хрупким bottom-значением.
     Используем margin-top: auto внутри flex-колонки — индикатор
     всегда прижат к низу, не зависит от высоты контента. */
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  /* Небольшой отступ снизу вместо padding-bottom на родителе */
  padding-bottom: 40px;
}

.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--gold);
  transform-origin: left;
  animation: expand 2s ease-in-out infinite;
}

@keyframes expand {
  0%, 100% { transform: scaleX(0.3); opacity: 0.4; }
  50%       { transform: scaleX(1);   opacity: 1;   }
}

/* ─── СЕКЦИИ (базовый padding/max-width) ─── */
section {
  padding: 100px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── СТАРТ — 3 шага ─── */
.start-section {
  background: var(--charcoal);
  padding: 100px 0;
}

.start-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
}

.start-inner .section-title { color: var(--warm-white); }
.start-inner .section-label { color: var(--gold); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 60px;
}

.step-card {
  background: rgba(255, 255, 255, 0.04);
  padding: 48px 40px;
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s;
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.step-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 80px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.06);
  line-height: 1;
  position: absolute;
  top: 20px;
  right: 32px;
}

.step-icon {
  font-size: 28px;
  margin-bottom: 20px;
}

.step-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--warm-white);
  margin-bottom: 12px;
}

.step-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
}

.step-example {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(184, 149, 90, 0.12);
  border-left: 2px solid var(--gold);
  font-size: 16px;
  color: var(--gold-light);
  font-style: italic;
  line-height: 1.6;
}

/* ─── СЦЕНАРИИ ─── */
.scenarios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 60px;
}

.scenario {
  background: var(--cream);
  padding: 48px;
  cursor: default;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.scenario::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.scenario:hover::before {
  transform: scaleX(1);
}

.scenario-emoji {
  font-size: 32px;
  margin-bottom: 16px;
}

.scenario-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
}

.scenario-when {
  font-size: 13px;
  color: var(--light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* Чат-пузыри */
.chat-bubble {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.chat-bubble.user {
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.bubble-avatar.mel {
  background: var(--gold);
  color: var(--charcoal);
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
}

.bubble-avatar.usr {
  background: var(--blush);
  font-size: 18px;
}

.bubble-text {
  background: white;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--charcoal);
  max-width: 80%;
  border-radius: 2px;
}

.chat-bubble.user .bubble-text {
  background: var(--charcoal);
  color: rgba(255, 255, 255, 0.85);
}

.scenario-tag {
  margin-top: 20px;
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

/* ─── ВОЗМОЖНОСТИ ─── */
.features-section {
  background: var(--charcoal);
  padding: 100px 0;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
}

.features-inner .section-title { color: var(--warm-white); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 60px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.04);
  padding: 40px;
  transition: background 0.3s;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--warm-white);
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  margin-bottom: 20px;
}

.feature-hints {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-hints li {
  font-size: 14px;
  color: var(--gold-light);
  font-style: italic;
  padding-left: 16px;
  position: relative;
}

.feature-hints li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* ─── ИНТЕРФЕЙС ─── */
.interface-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.iface-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.iface-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.iface-btn {
  font-family: 'Jost', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--charcoal);
  background: var(--cream);
  padding: 6px 12px;
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
}

.iface-why {
  font-size: 16px;
  color: var(--mid);
  line-height: 1.6;
  padding-top: 4px;
}

/* ─── FAQ ─── */
.faq-section {
  background: var(--cream);
  padding: 100px 0;
}

.faq-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 60px;
}

/* FIX: убраны inline style="text-align:center" с HTML-элементов */
.faq-inner .section-label,
.faq-inner .section-title {
  text-align: center;
}

.faq-inner .section-title {
  margin-bottom: 48px;
}

/* ─── FAQ — нативный <details>/<summary> ─── */
/* Убираем браузерный маркер раскрытия */
.faq-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  /* Нет cursor: pointer на контейнере — кликабелен только <summary> */
}

/* Убираем стандартный треугольник во всех браузерах */
.faq-q {
  list-style: none;
  font-size: 18px;
  font-weight: 500;
  color: var(--charcoal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  /* Убираем outline по умолчанию — добавляем кастомный */
  outline: none;
}

/* Firefox */
.faq-q::-moz-list-bullet { display: none; }
/* Chrome / Safari — убираем стрелку details */
.faq-item summary::-webkit-details-marker { display: none; }

.faq-q:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Иконка + / × */
.faq-q::after {
  content: '+';
  font-size: 22px;
  font-weight: 300;
  color: var(--gold);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.3s ease;
  /* Не участвует в выделении текста */
  -webkit-user-select: none;
  user-select: none;
}

.faq-item[open] .faq-q::after {
  transform: rotate(45deg);
}

/* Ответ */
.faq-a {
  font-size: 17px;
  color: var(--mid);
  line-height: 1.8;
  margin-top: 16px;
  /* Плавное появление через анимацию (нет max-height хака — details уже открыт) */
  animation: faqOpen 0.3s ease;
}

@keyframes faqOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.faq-a a {
  color: var(--gold);
  text-decoration: none;
}

.faq-a a:hover {
  color: var(--gold-light);
}

/* ─── FOOTER ─── */
.footer {
  background: var(--charcoal);
  padding: 60px;
  text-align: center;
  border-top: 1px solid rgba(184, 149, 90, 0.2);
}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 8px;
  color: var(--warm-white);
  margin-bottom: 8px;
}

.footer-sub {
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 32px;
}

/* FIX: убран inline style="display:flex;justify-content:center;..." */
.footer-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--charcoal);
  text-decoration: none;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.3s;
}

.footer-link:hover {
  background: var(--gold-light);
}

.footer-gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(184, 149, 90, 0.5);
  color: var(--gold);
  text-decoration: none;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s;
}

.footer-gallery-link:hover {
  border-color: var(--gold);
  background: rgba(184, 149, 90, 0.08);
}

/* ═══════════════════════════════════════════════════
   АДАПТИВ — ПЛАНШЕТ (≤ 900px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .site-nav { padding: 0 24px; }

  /* Скрываем десктопные ссылки, показываем бургер */
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  /* Hero: фото сверху, текст снизу */
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    /* FIX: убраны !important через корректный порядок правил */
    min-height: auto;
    min-height: unset;
  }

  .hero-right {
    order: -1;
    height: auto;
    max-height: none;
  }

  .hero-photo {
    height: auto;
    object-fit: contain;
    object-position: center 10%;
  }

  .hero-quote {
    font-size: 17px;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 12px 16px;
  }

  .hero-left {
    padding: 40px 28px 48px;
    justify-content: flex-start;
  }

  .hero-left::before { display: none; }
  .hero-sub { max-width: 100%; }

  .scroll-hint { padding-bottom: 28px; }

  .start-inner { padding: 0 28px; }
  .steps-grid { grid-template-columns: 1fr; }

  section { padding: 60px 28px; }

  .scenarios-grid { grid-template-columns: 1fr; }
  .scenario { padding: 32px 24px; }

  .features-inner { padding: 0 28px; }
  .features-grid { grid-template-columns: 1fr 1fr; }

  .interface-grid { grid-template-columns: 1fr; gap: 40px; }

  .faq-inner { padding: 0 28px; }

  .footer { padding: 48px 28px; }
  .footer-actions { flex-direction: column; gap: 12px; align-items: center; }
  .footer-link,
  .footer-gallery-link { text-align: center; }

  /* FIX: убраны inline padding 60px на .inline-cta-wrap — теперь в CSS */
  .scenarios-section .inline-cta-wrap,
  #interface .inline-cta-wrap {
    padding: 0 28px 60px;
  }
}

/* ═══════════════════════════════════════════════════
   АДАПТИВ — МОБИЛЬНЫЙ (≤ 600px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .nav-logo { font-size: 18px; letter-spacing: 2px; }
  .nav-gallery-btn { padding: 7px 14px; font-size: 11px; }

  .hero-photo { object-position: center 10%; }
  .hero-quote { font-size: 15px; bottom: 16px; left: 16px; right: 16px; padding: 10px 14px; }
  .hero-left { padding: 32px 20px 40px; }
  /* На мобильных scroll-hint лишний — скролл очевиден, места нет */
  .scroll-hint { display: none; }
  .hero-tag { font-size: 11px; letter-spacing: 2px; margin-bottom: 16px; }
  .hero-title { font-size: clamp(36px, 10vw, 56px); margin-bottom: 16px; }
  .hero-sub { font-size: 16px; margin-bottom: 32px; }
  .hero-cta { padding: 14px 24px; font-size: 13px; }

  .start-section { padding: 60px 0; }
  .start-inner { padding: 0 20px; }
  .step-card { padding: 28px 20px; }
  .step-title { font-size: 17px; }
  .step-text { font-size: 15px; }

  section { padding: 52px 20px; }
  .section-title { font-size: clamp(30px, 8vw, 44px); }

  .scenario { padding: 28px 20px; }
  .scenario-title { font-size: 22px; }
  .bubble-text { font-size: 14px; }

  .features-inner { padding: 0 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 28px 24px; }

  .iface-btn { min-width: 90px; font-size: 12px; }
  .iface-why { font-size: 15px; }

  .faq-inner { padding: 0 20px; }
  .faq-q { font-size: 16px; }
  .faq-a { font-size: 15px; }

  .footer { padding: 40px 20px; }
  .footer-logo { font-size: 28px; letter-spacing: 5px; }

  .scenarios-section .inline-cta-wrap,
  #interface .inline-cta-wrap {
    padding: 0 20px 52px;
  }
}
