/* ===== Header — точные значения из Figma ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  transition: box-shadow var(--transition-fast);
}

.header.is-scrolled {
  box-shadow: 0 4px 20px rgba(48, 13, 24, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo-icon {
  height: 49px;
  width: auto;
  object-fit: contain;
}

.header__nav {
  display: contents;
}

.header__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--bordeaux-dark);
  text-transform: uppercase;
  transition: opacity var(--transition-fast);
}

.header__link:hover {
  opacity: 0.6;
}

.header__right {
  display: contents;
}

.header__social {
  display: flex;
  gap: 12px;
}

.header__social-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.header__social-icon img {
  width: 100%;
  height: 100%;
}

.header__social-icon:hover {
  transform: translateY(-2px);
}

.header__cta {
  height: 56px;
  padding: 0 32px;
  font-size: 13px;
}

/* Гамбургер — скрыт на десктопе */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--bordeaux-dark);
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.44, 0, 0.56, 1), opacity 0.3s ease;
}

.header.is-menu-open .header__hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header.is-menu-open .header__hamburger span:nth-child(2) {
  opacity: 0;
}

.header.is-menu-open .header__hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Адаптив: планшет — нав и соцсети скрыты, кнопка "Записаться" остаётся рядом с гамбургером (точно как в Figma "цвет — 768") ===== */
@media (max-width: 1279px) {
  .header__inner {
    flex-wrap: wrap;
    gap: 20px;
  }

  .header__hamburger {
    display: flex;
    order: 3;
  }

  .header__nav {
    display: none;
  }

  .header__social {
    display: none;
  }

  .header__cta {
    margin-left: auto;
  }

  .header.is-menu-open .header__nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    padding-top: 28px;
  }

  .header.is-menu-open .header__right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 28px;
  }

  .header.is-menu-open .header__social {
    display: flex;
  }

  .header.is-menu-open .header__cta {
    width: 100%;
    margin-left: 0;
  }

  .header__link {
    font-size: 18px;
  }
}

/* ===== Адаптив: мобилка — в шапке остаётся только гамбургер (точно как в Figma "цвет — 375") ===== */
@media (max-width: 767px) {
  .header__inner {
    padding: 20px 12px;
  }

  .header__cta {
    display: none;
  }

  .header.is-menu-open .header__cta {
    display: inline-flex;
  }
}

/* ===== Hero — растянут на весь экран (как на референсе fabrica.media) ===== */
.hero {
  padding: 96px 8px 0;
  background: var(--bg-cream);
}

.hero__wrap {
  padding: 8px 0;
}

.hero__card {
  position: relative;
  width: 100%;
  height: calc(100vh - 112px);
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  background: #595959;
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 30%;
}

.hero__photo-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(116, 27, 54, 0.5) 50%, rgba(93, 22, 42, 0.55) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Progressive blur внизу карточки — как на референсе fabrica.media */
.hero__bottom-blur {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* --blur считает JS: 0 в самом верху страницы, 1 когда первый экран
     почти прокручен, поэтому размытие нарастает по мере скролла */
  --blur: 0;
  height: calc(360px + var(--blur) * 140px);
  pointer-events: none;
  backdrop-filter: blur(calc(28px + var(--blur) * 40px));
  -webkit-backdrop-filter: blur(calc(28px + var(--blur) * 40px));
  mask-image: linear-gradient(to top, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
}

.hero__left {
  position: absolute;
  left: 72px;
  top: 59.77px;
  width: max-content;
  max-width: calc(100% - 96px);
  display: flex;
  flex-direction: column;
  gap: 40px;
  color: var(--white);
}

.hero__title {
  font-size: clamp(36px, 7.4vw, 112px);
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__title-light {
  display: block;
  font-size: clamp(30px, 6.2vw, 94px);
  font-weight: 200;
  white-space: nowrap;
}

.hero__left-bottom {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero__dots {
  display: flex;
  gap: 140px;
  font-size: 14px;
  font-weight: 500;
}

.hero__dots span {
  display: inline-block;
  transform: scale(0.3) rotate(-180deg);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.hero__dots span:nth-child(1) { transition-delay: 0.15s; }
.hero__dots span:nth-child(2) { transition-delay: 0.27s; }
.hero__dots span:nth-child(3) { transition-delay: 0.39s; }

.reveal.is-visible .hero__dots span {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.hero__desc {
  width: 480px;
  color: #D9D9D9;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
}

/* Ключевые слова — капсулы под описанием. Раньше блок висел на абсолютных
   координатах у правого края и на узких экранах оказывался посреди пустоты;
   теперь он привязан к тексту и переносится сам. */
.hero__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  list-style: none;
  padding: 0;
}

.hero__keywords li {
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.hero__badge {
  position: absolute;
  left: 72px;
  bottom: 42px;
  color: #F9F6F3;
  font-size: 16px;
  font-weight: 500;
}

.hero__trainer-block {
  position: absolute;
  right: 120px;
  bottom: 32px;
  width: 374px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.hero__trainer-caption {
  width: 260px;
  color: #D9D9D9;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.hero__trainer-card {
  display: flex;
  align-items: center;
  width: 100%;
}

.hero__trainer-photo-frame {
  width: 110px;
  height: 173px;
  background: var(--white);
  border-radius: 16px;
  padding: 6px;
  flex-shrink: 0;
  margin-right: -1px;
}

.hero__trainer-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  filter: grayscale(100%);
  transition: filter 0.5s cubic-bezier(0.44, 0, 0.56, 1);
}

.hero__trainer-block:hover .hero__trainer-photo {
  filter: grayscale(0%);
}

.hero__trainer-info {
  flex: 1;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px rgba(27, 7, 15, 0.18);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__trainer-role {
  font-size: 12px;
  font-weight: 500;
  color: #666;
  width: 200px;
}

.hero__trainer-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--bordeaux-dark);
}

.hero__trainer-btn {
  height: 56px;
  padding: 0 32px;
  font-size: 12px;
  width: 100%;
}

.hero__trainer-btn-short {
  display: none;
}

/* ===== Desktop small: 1280–1439px — точные координаты из Figma "цвет — 1280" ===== */
@media (max-width: 1439px) {
  .hero__left {
    left: 48px;
  }

  .hero__badge {
    left: 48px;
    bottom: 32px;
  }

  /* карточка тренера вылезала на пару пикселей за правый край */
  .hero__trainer-info { min-width: 0; }

  .hero__trainer-block {
    right: 48px;
  }

  .hero__dots {
    gap: 140px;
  }

  .hero__desc {
    width: 420px;
  }
}

/* ===== Tablet: 768–1279px — как в Figma "цвет — 768" (title сверху, тренер+keywords в ряд, badge снизу), но высота карточки живая — тянется по контенту, а не зафиксирована, чтобы перенос текста не наезжал на соседние блоки ===== */
@media (max-width: 1279px) {
  .hero__card {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    height: auto;
    min-height: 0;
    padding: 48px 24px;
    gap: 40px 24px;
  }

  .hero__left {
    position: static;
    order: 1;
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
  }

  .hero__desc {
    width: 420px;
    max-width: 100%;
  }

  .hero__trainer-block {
    position: static;
    order: 2;
    flex: 0 0 374px;
    width: 374px;
  }

  .hero__badge {
    position: static;
    order: 4;
    flex: 0 0 100%;
  }

  .hero__bottom-blur {
    display: none;
  }
}

/* ===== Mobile: до 767px — точные координаты из Figma "цвет — 375" (блок "женский фитнес" убран, блок тренера остаётся горизонтальным) ===== */
@media (max-width: 767px) {
  .hero {
    padding: 89px 8px 0;
  }

  .hero__card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding: 32px 20px 28px;
    border-radius: 20px;
    gap: 28px;
  }

  .hero__left {
    position: static;
    order: 1;
    width: 100%;
    max-width: none;
    gap: 30px;
  }

  .hero__title {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.1;
  }

  .hero__title-light {
    font-size: clamp(24px, 7.5vw, 34px);
  }

  .hero__desc {
    width: 100%;
    max-width: none;
    font-size: 15px;
    line-height: 1.4;
  }

  /* на телефоне капсулы остаются: четыре факта о студии — самое полезное,
     что можно дать на первом экране, раньше они здесь просто скрывались */
  .hero__keywords {
    gap: 6px;
    margin-top: 16px;
  }

  .hero__keywords li {
    padding: 6px 12px;
    font-size: 12px;
  }

  .hero__badge {
    position: static;
    order: 3;
    font-size: 14px;
  }

  .hero__trainer-block {
    position: static;
    order: 2;
    flex: 0 0 auto;
    width: 100%;
  }

  .hero__trainer-caption {
    font-size: 14px;
  }

  .hero__trainer-btn-full {
    display: none;
  }

  .hero__trainer-btn-short {
    display: inline;
  }
}

/* ===== Первый экран на невысоких окнах =====
   Высота карточки считается от окна, а кегль заголовка — только от ширины.
   На ноутбуке с панелью закладок высоты не хватает, и заголовок с описанием
   наезжают на бейдж и на подпись тренера. Здесь ужимаем по высоте окна. */
@media (min-width: 1280px) and (max-height: 900px) {
  .hero__title { font-size: clamp(34px, 5.6vw, 84px); }
  .hero__title-light { font-size: clamp(28px, 4.7vw, 70px); }
  .hero__left { top: 44px; gap: 26px; }
  .hero__desc { font-size: 15px; line-height: 1.45; }
  .hero__dots { display: none; }
  .hero__badge { bottom: 28px; }
  .hero__keywords { margin-top: 16px; }
  .hero__keywords li { font-size: 13px; padding: 6px 13px; }
}

@media (min-width: 1280px) and (max-height: 760px) {
  .hero__title { font-size: clamp(30px, 4.6vw, 66px); }
  .hero__title-light { font-size: clamp(24px, 3.9vw, 56px); }
  .hero__left { top: 32px; gap: 18px; }
  .hero__desc { font-size: 14px; }
  .hero__keywords { display: none; }
}
