/* ============================================================
   RESPONSIVE
   Брейкпоинты: 1280, 1023, 767, 479
   ============================================================ */

/* ====== Большой ноутбук: 1279px ====== */
@media (max-width: 1279px) {
  :root { --container: 1180px; }
  .hero { min-height: 80vh; }
  .hero__inner { gap: 48px; }
  .footer__top { gap: 36px; }
}

/* ====== Tablet & Below: 1023px ====== */
@media (max-width: 1023px) {
  .header__nav { display: none; }
  .header__cta { display: none; }
  /* Бургер на мобильной версии не нужен – внизу есть sticky-cta с Позвонить/WhatsApp */
  .header__burger { display: none; }

  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { max-width: 480px; margin: 0 auto; aspect-ratio: 4 / 3; }
  .hero__photo--main { width: 70%; left: 4%; }
  .hero__photo--accent { width: 44%; right: 2%; bottom: 8%; }

  .comfort__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .why__grid { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .team__track .team-card { flex: 0 0 calc((100% - 24px) / 2); }
  .words__track .review-card { flex: 0 0 calc((100% - 24px) / 2); }

  .pause__inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .pause__photo { margin: 0 auto; }
  .pause__quote, .pause__author { text-align: center; }

  .lab__grid { grid-template-columns: 1fr; gap: 48px; }
  .lab__photo { max-width: 480px; margin: 0 auto; }
  .lab__text { max-width: 100%; }

  .story-card__body { grid-template-columns: 1fr; gap: 24px; }
  .story-card__heading { max-width: 100%; }

  .works__grid { grid-template-columns: repeat(2, 1fr); }

  .contacts__grid { grid-template-columns: 1fr; }
  .contacts__map { min-height: 360px; }

  .stories__player { grid-template-columns: 1fr; gap: 16px; height: auto; }
  .stories__featured { aspect-ratio: 16 / 9; }
  .stories__playlist { max-height: 420px; }

  .footer__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
}

/* ====== Mobile: 767px ====== */
@media (max-width: 767px) {
  /* На мобильном шапка не sticky – плывёт с контентом, чтобы не закрывать вертикальное пространство */
  .header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body { padding-bottom: 56px; } /* точно под sticky-cta (как на референсе) */

  /* Hero */
  .hero { min-height: auto; padding-top: 24px !important; padding-bottom: 32px !important; }
  .hero__title { font-size: clamp(28px, 8vw, 44px); }
  .hero__subtitle { font-size: 15px; }
  .hero__visual { aspect-ratio: 4 / 3; max-width: 100%; }
  .hero__actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .hero__microcopy { justify-content: center; }
  .hero__proof { padding-top: 18px; }

  /* Comfort */
  .comfort__header { margin-bottom: 40px; }
  .comfort__grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .comfort__card { padding: 24px 18px 20px; gap: 12px; }
  .comfort__num { font-size: 44px; top: 12px; right: 14px; }
  .comfort__icon { width: 56px; height: 56px; }
  .comfort__icon svg { width: 32px; height: 32px; }
  .comfort__name { font-size: 16px; }
  .comfort__desc { font-size: 13px; }
  .comfort__blob { filter: blur(60px); opacity: 0.4; }
  .comfort__blob--1 { width: 320px; height: 320px; }
  .comfort__blob--2 { width: 360px; height: 360px; }

  /* Why */
  .why__grid { grid-template-columns: 1fr; gap: 0; }
  .why__card { padding: 22px 18px; border-bottom: 1px solid var(--line); }
  .why__card:last-child { border-bottom: none; }
  .why__card::after { display: none; }
  .why__num { font-size: 56px; }

  /* Services – уменьшаем воздух на мобильном */
  .services__grid { grid-template-columns: 1fr; gap: 12px; }
  .service-card { min-height: 240px; }
  .service-card__inner { padding: 22px; gap: 10px; }
  .service-card__name { font-size: 20px; }
  .service-card__desc { font-size: 13px; max-width: 100%; }
  .service-card__footer { margin-top: 8px; padding-top: 14px; }
  .service-card__art { width: 70%; }

  /* Team */
  .team__track .team-card { flex: 0 0 100%; }
  .team__btn { width: 44px; height: 44px; }
  .team__counter { font-size: 18px; min-width: 70px; }

  /* Story */
  .story-card { padding: 24px; }
  .story-card__heading { font-size: clamp(20px, 5vw, 26px); margin-bottom: 20px; }
  .story-card__quote { margin: 20px 0; padding: 18px 0; }
  .story-card__quote p { font-size: clamp(15px, 4vw, 18px); }
  .story-card__quote-mark { width: 26px; }
  .story-card__text { font-size: 14px; }
  .story-card__meta { padding: 16px; }

  /* Works – горизонтальный слайдер на мобильном */
  .ba { aspect-ratio: 4 / 3; }
  .ba__circle { width: 48px; height: 48px; }
  .ba__circle--sm { width: 36px; height: 36px; }
  .works__grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--space-pad-x);
    margin-left: calc(var(--space-pad-x) * -1);
    margin-right: calc(var(--space-pad-x) * -1);
    padding: 0 var(--space-pad-x);
    gap: 16px;
    max-width: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 0;
  }
  .works__grid::-webkit-scrollbar { display: none; }
  .work {
    flex: 0 0 calc(100% - var(--space-pad-x) * 2);
    scroll-snap-align: start;
  }
  .works__controls { display: flex; }

  /* Words */
  .words__track .review-card { flex: 0 0 100%; min-height: 280px; }
  .words__btn { width: 44px; height: 44px; }
  .words__counter { font-size: 18px; min-width: 70px; }

  /* Pause */
  .pause__photo { width: 200px; height: 200px; }
  .pause__quote { font-size: clamp(18px, 5vw, 24px); }

  /* Lab */
  .lab__tools { grid-template-columns: 1fr; }
  .lab__title { font-size: clamp(28px, 7vw, 36px); }

  /* Stories – видео по ширине секции, плейлист высокий */
  .stories__player { gap: 14px; }
  .stories__featured {
    aspect-ratio: 16 / 9;
    width: 100%;
    margin: 0;
  }
  .stories__feat-content { left: 20px; right: 20px; bottom: 20px; }
  .stories__feat-eyebrow { font-size: 11px; padding: 4px 10px; }
  .stories__feat-name { font-size: 22px; }
  .stories__feat-topic { font-size: 13px; }
  .stories__feat-play { width: 56px; height: 56px; }
  .stories__feat-play svg { width: 24px; height: 24px; }
  .stories__playlist { max-height: 640px; }
  .stories__playlist-head { padding: 16px 16px 12px; }
  .stories__item { padding: 14px 18px; min-height: 56px; }

  /* Money */
  .money__partners {
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 32px;
  }
  .money__partner {
    padding: 10px 14px;
    font-size: 14px;
    justify-content: flex-start;
  }

  /* FAQ */
  .faq__item summary { padding: 18px 16px; gap: 16px; }
  .faq__item summary span:first-child { font-size: 15px; }
  .faq__icon { width: 32px; height: 32px; flex-shrink: 0; }
  .faq__content { padding: 0 16px 18px; font-size: 14px; }

  /* Booking */
  .booking { padding-bottom: 100px !important; }
  .booking__inner { padding: 32px 20px; }
  .form__radios { grid-template-columns: 1fr 1fr; }

  /* На мобильном – sticky-bar внизу с двумя кнопками. Плавающие fab прячем,
     чтобы не дублировались */
  .sticky-cta { display: flex; }
  .fab--whatsapp,
  .fab--whatsapp.is-visible { display: none; }
  .fab--top { bottom: 80px; left: 16px; }

  /* Footer – две компактные колонки на мобильном */
  .footer { padding: 48px 0 24px; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 24px 32px; margin-bottom: 32px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col { padding-top: 0; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px var(--space-pad-x) 0; }
  .footer__legal { flex-wrap: wrap; gap: 14px; font-size: 12px; }

  /* Contacts */
  .contacts__info { padding: 0; }
  .contacts__map { min-height: 320px; }

  /* Form success */
  .form__success { padding: 32px 24px; margin-top: 32px; }
}

/* ====== Small mobile: 479px ====== */
@media (max-width: 479px) {
  :root { --space-pad-x: 20px; }

  .header__inner { gap: 12px; padding: 0 16px; }
  .header__logo-img { height: 36px; }
  .header__icon-btn { width: 38px; height: 38px; }

  /* Hero ещё компактнее */
  .hero__badges { gap: 8px; }
  .hero__badges .badge { font-size: 11px; padding: 6px 10px; }

  /* Сетки в одну колонку */
  .why__grid { grid-template-columns: 1fr; gap: 0; }
  .comfort__grid { grid-template-columns: 1fr; }

  /* Story-card теснее */
  .story-card { padding: 20px 16px; }
  .story-card__heading { font-size: 20px; }

  /* Stories более компактный плеер */
  .stories__feat-name { font-size: 18px; }
  .stories__playlist { max-height: 460px; } /* видно 5 видео сразу */

  /* Cookie */
  .cookie {
    left: 12px;
    right: 12px;
    bottom: 80px;
    padding: 16px;
  }
  .cookie__actions { flex-direction: column-reverse; gap: 8px; }
  .cookie__actions .btn { width: 100%; }

  /* Form */
  .form { gap: 14px; }
  .form__radios { grid-template-columns: 1fr; }
  .form__row input,
  .form__row select { font-size: 16px; } /* предотвращает zoom на iOS при focus */
}

/* ====== Wide screens ====== */
@media (min-width: 1536px) {
  main > section,
  .header__inner,
  .footer__top,
  .footer__bottom {
    max-width: 1400px;
  }
}

/* ====== Print ====== */
@media print {
  .header, .fab, .cookie, .sticky-cta { display: none !important; }
  body { color: #000; background: #fff; }
  .reveal, .reveal-stagger { opacity: 1 !important; transform: none !important; }
}

/* ====== Reduced motion safety ====== */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero__photo, .stories__feat-poster, .lab__photo img {
    transition: none !important;
  }
}
