/* ==========================================================================
   REDIT — deco.css
   Дизайн-обогащение новых страниц под язык лендинга:
   атмосфера hero (blooms/зерно/частицы), разделители секций, фирменные
   лейблы с красной линией, glow на карточках, reveal-анимации.
   Подключается на всех страницах после site-chrome.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Атмосфера hero для внутренних страниц.
   Переиспользует .hero__bloom / .hero__grain / .hero__particles из styles.css —
   этот контейнер лишь даёт им контекст позиционирования.
   -------------------------------------------------------------------------- */

.page-hero-atmo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Контент hero — поверх атмосферы */
.svc-hero__inner,
.case-hero__inner,
.article-hero__inner,
.home-hero__grid {
  position: relative;
  z-index: 1;
}

.article-hero {
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Разделительная полоса между секциями (как на лендинге)
   -------------------------------------------------------------------------- */

main > section {
  position: relative;
}

main > section + section::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(233, 4, 8, 0.22) 18%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(233, 4, 8, 0.22) 82%,
    transparent 100%
  );
  opacity: 0.95;
  pointer-events: none;
  z-index: 1;
}

/* У гео-секции свои border-top/bottom — глобальный разделитель не дублируем */
main > section + .geo-section::before,
main > .geo-section + section::before {
  display: none;
}

/* --------------------------------------------------------------------------
   Лейблы секций — красная линия слева, как .section__label на лендинге
   -------------------------------------------------------------------------- */

.home-section__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-section__label::before {
  content: '';
  width: clamp(34px, 6vw, 44px);
  height: 1px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 26, 31, 0.45), var(--red-bright, #ff1a1f));
  box-shadow: 0 0 12px rgba(233, 4, 8, 0.25);
  flex-shrink: 0;
}

/* Центрированные head-блоки (FAQ): линия мешает симметрии — убираем */
.home-section__head[style*="text-align: center"] .home-section__label::before {
  display: none;
}

/* Заголовки — глубокая тень как на лендинге */
.home-section__title,
.svc-hero__title,
.case-hero__title,
.article-hero__title,
.home-hero__title {
  text-shadow: 0 16px 60px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   Карточки: стеклянный блик сверху + glow на hover
   -------------------------------------------------------------------------- */

.diff-card,
.service-card,
.aud-card,
.step-card,
.benefit-card,
.price-card,
.blog-card,
.case-card,
.t-card,
.related-card,
.blog-side-card,
.home-faq__item,
.case-bignum__cell,
.case-step,
.cases-hero-stat,
.svc-fact,
.home-hero__stat-card {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 230, 232, 0.05);
}

.diff-card:hover,
.service-card:hover,
.aud-card:hover,
.step-card:hover,
.benefit-card:hover,
.blog-card:hover,
.case-card:hover,
.t-card:hover,
.related-card:hover {
  box-shadow:
    0 22px 52px -22px rgba(233, 4, 8, 0.4),
    0 6px 24px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 230, 232, 0.09);
}

/* Карточки ЦА и шагов не имели hover-lift — добавляем */
.aud-card,
.step-card,
.case-bignum__cell,
.t-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.aud-card:hover,
.step-card:hover,
.t-card:hover {
  transform: translateY(-3px);
  border-color: rgba(233, 4, 8, 0.32);
}
.case-bignum__cell:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 4, 8, 0.35);
}

/* Декоративный красный отсвет в углу карточек шагов и выгод */
.step-card::after,
.benefit-card::after,
.diff-card::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at top right, rgba(233, 4, 8, 0.12), transparent 70%);
  border-radius: 0 18px 0 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.step-card:hover::after,
.benefit-card:hover::after,
.diff-card:hover::after {
  opacity: 1;
}

/* Тариф «Популярный» — мягкое дыхание glow */
.price-card--featured {
  box-shadow:
    0 24px 64px -28px rgba(233, 4, 8, 0.45),
    inset 0 1px 0 rgba(255, 230, 232, 0.07);
  animation: deco-featured-breathe 5.5s ease-in-out infinite alternate;
}

@keyframes deco-featured-breathe {
  from { box-shadow: 0 24px 64px -28px rgba(233, 4, 8, 0.35), inset 0 1px 0 rgba(255, 230, 232, 0.07); }
  to   { box-shadow: 0 28px 72px -26px rgba(233, 4, 8, 0.55), inset 0 1px 0 rgba(255, 230, 232, 0.1); }
}

/* Финальный CTA — усиленный glow и блик */
.final-cta {
  box-shadow:
    0 32px 80px -32px rgba(233, 4, 8, 0.5),
    inset 0 1px 0 rgba(255, 230, 232, 0.1);
}

/* Hero stat-карточка на главной — лёгкое свечение */
.home-hero__stat-card {
  box-shadow:
    0 28px 64px -30px rgba(233, 4, 8, 0.35),
    inset 0 1px 0 rgba(255, 230, 232, 0.07);
}

/* --------------------------------------------------------------------------
   Полоса цифр: разделители-ячейки подсвечиваются на hover
   -------------------------------------------------------------------------- */

.metrics-strip__cell {
  border-radius: 14px;
  transition: background 0.25s ease;
}
.metrics-strip__cell:hover {
  background: rgba(233, 4, 8, 0.06);
}
.metrics-strip__num {
  text-shadow: 0 8px 32px rgba(233, 4, 8, 0.35);
}

/* --------------------------------------------------------------------------
   Манифест: крупная декоративная кавычка
   -------------------------------------------------------------------------- */

.manifesto__body {
  position: relative;
  padding-top: 8px;
}
.manifesto__body::before {
  content: '«';
  position: absolute;
  top: -54px;
  left: -10px;
  font-family: var(--font-head, 'Montserrat'), system-ui, sans-serif;
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  color: rgba(233, 4, 8, 0.16);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Бейдж в hero внутренних страниц
   -------------------------------------------------------------------------- */

.svc-hero .badge,
.case-hero .badge {
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   РИТМ СЕКЦИЙ: доминанты в сетках (первый/второй план вместо «стен карточек»)
   -------------------------------------------------------------------------- */

@media (min-width: 1001px) {
  /* «Чем отличаемся» (6 карточек): первая — флагман на 2 колонки */
  .differences-grid > .diff-card:first-child {
    grid-column: span 2;
    padding: 32px 30px;
    background: linear-gradient(160deg, rgba(233, 4, 8, 0.1), rgba(255, 255, 255, 0.02));
    border-color: rgba(233, 4, 8, 0.3);
  }
  .differences-grid > .diff-card:first-child .diff-card__title {
    font-size: 22px;
  }
  .differences-grid > .diff-card:first-child .diff-card__text {
    font-size: 15px;
    max-width: 52ch;
  }
  /* 6 карточек: [2+1][3] -> последняя строка из двух растянута */
  .differences-grid > .diff-card:nth-child(5) {
    grid-column: span 2;
  }

  /* «Что мы делаем» (5 услуг): флагман-лидген — на 2 колонки */
  .services-grid-home > .service-card:first-child {
    grid-column: span 2;
    background: linear-gradient(160deg, rgba(233, 4, 8, 0.12), rgba(255, 255, 255, 0.02));
    border-color: rgba(233, 4, 8, 0.35);
  }
  .services-grid-home > .service-card:first-child .service-card__title {
    font-size: 21px;
  }
  .services-grid-home > .service-card:first-child .service-card__benefit {
    font-size: 15px;
  }

  /* «Что вы получаете» на услугах (6-7): первая — шире */
  .benefits-grid > .benefit-card:first-child {
    grid-column: span 2;
    background: linear-gradient(160deg, rgba(233, 4, 8, 0.09), rgba(255, 255, 255, 0.02));
    border-color: rgba(233, 4, 8, 0.28);
  }
  /* 7 пунктов (отдел продаж): последняя тоже шире — ряды 2+1 / 3 / 2+1 закрыты */
  .benefits-grid > .benefit-card:nth-child(7):last-child {
    grid-column: span 2;
  }
}

/* Reveal-вариация: чётные карточки приезжают чуть с другой дистанции,
   доминанты — с лёгким масштабом вместо сдвига (меньше «AOS-конвейера») */
.diff-card.reveal:first-child,
.service-card.reveal:first-child,
.benefit-card.reveal:first-child {
  transform: translate3d(0, 0, 0) scale(0.97);
}
.diff-card.reveal[data-visible='true']:first-child,
.service-card.reveal[data-visible='true']:first-child,
.benefit-card.reveal[data-visible='true']:first-child {
  transform: translate3d(0, 0, 0) scale(1);
}

/* --------------------------------------------------------------------------
   МОБИЛЬНЫЕ ПАТТЕРНЫ (спроектированы, а не «сжаты»)
   -------------------------------------------------------------------------- */

/* Sticky-CTA внизу экрана — главный конверсионный элемент на телефоне */
.mobile-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-cta {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    gap: 10px;
    z-index: 250; /* ниже модалки (300) — при открытой форме бар уходит под backdrop */
    padding: 10px;
    border-radius: 16px;
    background: rgba(12, 12, 13, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(233, 4, 8, 0.3);
    box-shadow:
      0 18px 48px -16px rgba(0, 0, 0, 0.8),
      inset 0 1px 0 rgba(255, 230, 232, 0.06);
  }

  .mobile-cta__btn {
    flex: 1;
    text-align: center;
  }

  .mobile-cta__tg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text, #f5f7fa);
    flex-shrink: 0;
  }

  /* Контент и футер не должны прятаться за бар */
  body {
    padding-bottom: 86px;
  }
}

/* Свайп-ленты: длинные сетки карточек на телефоне -> горизонтальный scroll-snap */
@media (max-width: 700px) {
  .differences-grid,
  .services-grid-home,
  .audience-cards,
  .process-timeline,
  .testimonials,
  .benefits-grid,
  .related-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    margin-inline: calc(-1 * var(--gutter, 14px)) calc(-1 * var(--gutter-r, 14px));
    padding: 4px var(--gutter-r, 14px) 16px var(--gutter, 14px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .differences-grid::-webkit-scrollbar,
  .services-grid-home::-webkit-scrollbar,
  .audience-cards::-webkit-scrollbar,
  .process-timeline::-webkit-scrollbar,
  .testimonials::-webkit-scrollbar,
  .benefits-grid::-webkit-scrollbar,
  .related-strip::-webkit-scrollbar {
    display: none;
  }

  .differences-grid > *,
  .services-grid-home > *,
  .audience-cards > *,
  .process-timeline > *,
  .testimonials > *,
  .benefits-grid > *,
  .related-strip > * {
    flex: 0 0 min(82%, 320px);
    scroll-snap-align: start;
  }
}
