/* Первый экран Рождества (фрейм макета X9D9hl / qYEeB).

   Высота на десктопе фиксированная, как в макете (780px), содержимое
   разложено абсолютными координатами x/y из макета относительно секции.
   На телефоне у секции своя вертикальная раскладка (как в qYEeB) - блоки
   идут обычным потоком сверху вниз (пометка → окно → текст), поэтому
   разметка в tpl написана в телефонном порядке, а десктопу позиции
   назначает этот файл через position:absolute.

   Цвета - токены палитры праздника из tokens.css ([data-holiday="christmas"]),
   альфа-варианты (как в макете, например #E9C46A38) собраны через
   color-mix от того же токена, а не захардкожены отдельным цветом. */

.ch-hero {
  position: relative;
  overflow: hidden;
  height: 780px;
}

/* ─── Фон: кадр/видео, подложка, тёплый свет ─────────────────── */

.ch-hero__bg {
  position: absolute;
  inset: 0;
}

.ch-hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Подложка - готовый токен: ровно линейный градиент макета. */
.ch-hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.ch-hero__glow {
  position: absolute;
  left: 700px;
  top: -240px;
  width: 1000px;
  height: 1000px;
  border-radius: 50%;
  /* closest-side обязателен: иначе браузер тянет радиальный градиент до
     дальнего угла квадрата, и тёплое пятно становится шире и ярче, чем в
     макете (см. docs/prazdniki.md, причина 4). */
  background: radial-gradient(
    circle closest-side,
    color-mix(in srgb, var(--accent) 22%, transparent) 0%,
    color-mix(in srgb, var(--accent) 4%, transparent) 50%,
    color-mix(in srgb, var(--accent) 0%, transparent) 100%
  );
}

/* ─── Окно с датой праздника ──────────────────────────────────── */

.ch-hero__window {
  position: absolute;
  left: 900px;
  top: 120px;
  z-index: 1;
  overflow: hidden;
  width: 440px;
  height: 520px;
  background: var(--window-bg);
  border-radius: 16px;
  /* Обводка внутренняя - иначе окно было бы 444x524 вместо 440x520. */
  box-shadow: inset 0 0 0 2px var(--line-h);
}

/* Свет в окне и переплёт рамы - псевдоэлементы, не самостоятельные теги:
   это чистая декорация поверх плоского фона окна, подстановок в ней нет. */
.ch-hero__window::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 60px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(
    circle closest-side,
    color-mix(in srgb, var(--accent) 30%, transparent) 0%,
    color-mix(in srgb, var(--accent) 0%, transparent) 100%
  );
}

.ch-hero__window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--line-h), var(--line-h)) 219px 0 / 2px 100% no-repeat,
    linear-gradient(var(--line-h), var(--line-h)) 0 259px / 100% 2px no-repeat;
}

/* В данных макета у "Дата"/"Месяц" нет width/textGrowth - блок по ширине
   прилегает к тексту и стоит левым краем в x:0, а не растянут на всё
   окно с центрированием (проверено по месту "25" в эталоне - она у
   левого края окна, не по центру). */
.ch-hero__window-day,
.ch-hero__window-month {
  position: absolute;
  left: 0;
  font-family: var(--font-head);
}

.ch-hero__window-day {
  top: 150px;
  font-weight: 800;
  font-size: 150px;
  line-height: 204px;   /* 150 x 1.36, без неё браузерный line-height
    "normal" у Manrope даёт лишний отступ сверху и цифра съезжает вниз */
  letter-spacing: -6px;
  color: var(--accent-text);
}

.ch-hero__window-month {
  top: 330px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 17px;   /* 14 x 1.21 */
  letter-spacing: 8px;
  color: var(--text);
}

/* ─── Декор: венок и носок ─────────────────────────────────────── */

/* На десктопе у венка и носка разные независимые координаты - обёртка не
   должна участвовать в раскладке. */
.ch-hero__decor { display: contents; }

.ch-hero__wreath {
  position: absolute;
  left: 1214px;
  top: 60px;
  z-index: 1;
  width: 160px;
  height: 160px;
  opacity: .95;
}

.ch-hero__stocking {
  position: absolute;
  left: 820px;
  top: 600px;
  z-index: 1;
  width: 160px;
  height: 160px;
  opacity: .9;
}

/* ─── Текстовая колонка ──────────────────────────────────────── */

.ch-hero__content {
  position: absolute;
  left: 72px;
  top: 92px;
  z-index: 1;
  width: 720px;
  display: flex;
  flex-direction: column;
}

.ch-hero__h1 {
  margin: 44px 0 0;
  width: 100%;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 76px;
  line-height: 78px;   /* 76 x 1.02 = 77.52 */
  letter-spacing: -2.8px;
  color: var(--text);
}

.ch-hero__lead {
  margin: 26px 0 0;
  max-width: 620px;
  font-family: var(--font-body);
  font-size: 19px;
  /* 19 x 1,75 = 33,25; в макете строка нарисована целой - 33. */
  line-height: 33px;
  color: var(--text-2);
}

.ch-hero__facts {
  margin: 36px 0 0;
  display: flex;
  align-items: center;
}

.ch-hero__fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 26px;
}

.ch-hero__fact-v {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  line-height: 27px;   /* 20 x 1.36 */
  letter-spacing: -.4px;
  color: var(--text);
}

.ch-hero__fact-s {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 15px;   /* 12 x 1.21 */
  color: var(--text-3);
}

.ch-hero__sep {
  width: 1px;
  height: 34px;
  background: var(--line-h);
}

.ch-hero__action {
  margin: 36px 0 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.ch-hero__btn {
  display: inline-flex;
  padding: 19px 32px;
  background: var(--magenta);
  color: var(--text);
  border-radius: 6px;   /* в данных макета 6, а не общий токен --r-btn (4) */
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 18px;   /* 15 x 1.21 */
  text-decoration: none;
  white-space: nowrap;
}

.ch-hero__btn-note {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 16px;   /* 13 x 1.21 */
  color: var(--text-3);
}

/* ─── Телефон: обычный поток сверху вниз, как в макете qYEeB ──── */

@media (max-width: 860px) {
  .ch-hero {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 44px 20px;
  }

  .ch-hero__window {
    /* position: relative, а не static - окно всё равно остаётся в
       обычном потоке (смещения нет), но static рвёт контекст
       позиционирования: ::before/::after с position:absolute искали бы
       ближайшего спозиционированного предка и уезжали на весь .ch-hero
       (свет и переплёт растягивались на всю секцию вместо окна). left/top
       900/120 из десктопного правила static игнорировал молча, а
       relative уже честно считает их смещением - обнуляем явно. */
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    height: 300px;
  }

  .ch-hero__window::before {
    left: -20px;
    top: 20px;
    width: 400px;
    height: 400px;
  }

  .ch-hero__window::after {
    background:
      linear-gradient(var(--line-h), var(--line-h)) 174px 0 / 2px 100% no-repeat,
      linear-gradient(var(--line-h), var(--line-h)) 0 150px / 100% 2px no-repeat;
  }

  .ch-hero__window-day {
    top: 70px;
    font-size: 110px;
    line-height: 150px;   /* 110 x 1.36 */
    letter-spacing: -4px;
  }

  .ch-hero__window-month {
    top: 210px;
    font-size: 12px;
    line-height: 15px;   /* 12 x 1.21 = 14.52 */
    letter-spacing: 6px;
  }

  /* В макете мобильного первого экрана декора нет (qYEeB) - только на
     десктопе, где рядом с окном достаточно воздуха. */
  .ch-hero__decor { display: none; }

  .ch-hero__glow {
    left: -120px;
    top: -160px;
    width: 600px;
    height: 600px;
  }

  .ch-hero__content {
    position: static;
    width: 100%;
  }

  .ch-hero__h1 {
    margin-top: 4px;
    font-size: 33px;
    line-height: 35px;   /* 33 x 1.06 = 34.98 */
    letter-spacing: -1px;
  }

  .ch-hero__lead {
    margin-top: 4px;
    max-width: 100%;
    font-size: 18px;
    line-height: 32px;   /* 18 x 1,75 = 31,5, в макете строка целая - 32 */
  }

  .ch-hero__facts {
    margin-top: 4px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  /* Высота строки подобрана так, чтобы сумма блока совпала с измеренной в
     макете (42px): 25 + 4 (gap) + 13 = 42, а не чистое 18 x 1.36 = 24,48. */
  .ch-hero__fact-v { font-size: 18px; line-height: 25px; letter-spacing: -.3px; }
  .ch-hero__fact-s { font-size: 11px; line-height: 13px; }

  .ch-hero__sep { display: none; }

  .ch-hero__action {
    margin-top: 4px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ch-hero__btn { font-size: 14px; line-height: 17px; }        /* 14 x 1.21 */
  .ch-hero__btn-note { font-size: 12px; line-height: 15px; }   /* 12 x 1.21 */
}
