/* =========================================================
   Главная страница
   Компьютер (≥1101px): страница помещается в один экран.
   Раскладка компактная, остаток подгоняет main.js: уменьшается
   только контент (.main), шапка и меню не меняются. Текст не
   становится мельче ~12px — ниже этого допускается прокрутка.
   ========================================================= */

/* ---------- Приветствие ---------- */
.hero {
  display: flex;
  background: var(--gray-1700);
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgb(var(--hero-fade)) 0%, rgba(var(--hero-fade), .3) 100%),
    url(../img/ui/pattern-logo.svg) -40px -60px / 293px 290px repeat;
  pointer-events: none;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgb(var(--hero-fade)) 0%, rgba(var(--hero-fade), .55) 100%);
}
.hero__photo { position: relative; flex: none; align-self: center; padding: 24px 28px 24px 24px; }
.hero__photo img {
  width: 184px; height: 184px;
  object-fit: cover;
}
.hero__body {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: 24px 24px 24px 0;
}
.hero__text { display: flex; flex-direction: column; gap: 4px; }
.hero__hello { font-size: calc(16px * var(--fs-s, 1)); line-height: 24px; font-weight: 500; color: var(--gray-500); }
.hero__latin { margin-left: 6px; color: var(--gray-500); font-weight: 400; }
.hero__title { font-size: 36px; line-height: 48px; font-weight: 700; color: var(--text-light); }
.hero__title-line { white-space: nowrap; }
.hero__name { white-space: nowrap; }
.hero__lead { margin-top: 6px; font-size: 18px; line-height: 26px; color: var(--gray-400); }
.hero__buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* Правая часть приветствия: цифры аудитории и соцсети */
.hero__side {
  position: relative; flex: none;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 24px 28px 24px 24px;
  border-left: 1px solid var(--line-2);
}
.hero__stats { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.hero__stat { display: flex; flex-direction: column-reverse; }
.hero__stat dd { margin: 0; font-size: 26px; line-height: 32px; font-weight: 700; }
.hero__stat dt { font-size: calc(13px * var(--fs-s, 1)); line-height: 18px; color: var(--gray-500); }
.hero__socials { display: flex; gap: 12px; }
.hero__stat-note { color: var(--gray-500); }

/* ---------- Направления ---------- */
.directions { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 24px; }
.directions .block-head__title { flex: none; }
.directions__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dir {
  display: grid; grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px; row-gap: 8px; align-items: center;
  padding: 16px;
  background: var(--gray-1500);
  border-radius: var(--radius-m);
}
.dir__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-m); }
.dir__icon--crypto { background: rgba(0, 149, 250, .14); color: var(--primary); }
.dir__icon--music { background: rgba(0, 149, 250, .10); color: var(--blue-600); }
.dir__icon--life { background: rgba(71, 203, 146, .14); color: var(--green); }
.dir__title { font-size: 18px; line-height: 24px; font-weight: 600; color: var(--text-light); }
.dir__text, .dir__links { grid-column: 1 / -1; }
.dir__text { color: var(--gray-400); font-size: calc(14px * var(--fs-s, 1)); line-height: 20px; }
.dir__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.dir__links .btn--link { font-size: calc(14px * var(--fs-s, 1)); line-height: 20px; min-height: 24px; }

/* ---------- Книга ---------- */
.book {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 0 0, rgba(0, 149, 250, .10), transparent 60%),
    var(--gray-1600);
}
.book__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: calc(14px * var(--fs-s, 1)); line-height: 20px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--tertiary-content);
}
.book__cover {
  display: block;
  width: 156px; height: auto; aspect-ratio: 480 / 662;
  object-fit: cover;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .5);
}
.book__title { font-size: 20px; line-height: 28px; font-weight: 600; }
.book__text { color: var(--gray-400); font-size: calc(14px * var(--fs-s, 1)); line-height: 20px; }
.book__actions { display: flex; gap: 12px; }
.book__actions .btn { flex: 1; }
.book__audio { align-self: flex-start; font-size: calc(14px * var(--fs-s, 1)); line-height: 20px; color: var(--primary); }
.book__audio:hover { color: var(--link-hover); }

/* ---------- Партнёры ---------- */
.partners { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px 24px; }
.partners__page { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; }
.partner {
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
  padding: 6px 16px 6px 6px;
  background: var(--gray-1500);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-m);
  font-weight: 500; color: var(--gray-300);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
a.partner:hover { background: var(--gray-1100); color: var(--text-light); }
.partner__logo { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }

/* =========================================================
   Адаптив главной
   ========================================================= */
@media (max-width: 1500px) {
  .hero__title { font-size: 32px; line-height: 42px; }
}
@media (max-width: 1280px) {
  .hero__photo { padding: 24px 20px; }
  .hero__photo img { width: 152px; height: 152px; border-width: 6px; }
  .hero__title { font-size: 28px; line-height: 38px; }
  .hero__buttons .btn { padding: 12px 22px; }
  .hero__side { padding: 20px 20px 20px 18px; }
  .hero__stat dd { font-size: 22px; line-height: 28px; }
}
@media (max-width: 1100.98px) {
  /* Книга на всю ширину: обложка слева, текст справа; партнёры под ней */
  .book { grid-column: 1 / -1; display: grid; grid-template-columns: 168px minmax(0, 1fr); column-gap: 28px; row-gap: 12px; align-items: start; }
  .book__cover { grid-row: 1 / span 5; grid-column: 1; }
  .book > :not(.book__cover) { grid-column: 2; }
  .book__actions { max-width: 360px; }
  .partners { grid-column: 1 / -1; }
  .partners__page { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) and (max-width: 1100.98px) {
  .directions .dir__video { grid-template-columns: minmax(0, 1fr); } /* превью над текстом: в узкой колонке иначе обрезается подпись */
}
@media (max-width: 900px) {
  /* Цифры и соцсети уходят под текст приветствия */
  .hero { flex-wrap: wrap; }
  .hero__body { flex-basis: calc(100% - 200px); }
  .hero__title-line { white-space: normal; }
  .hero__side { flex-basis: 100%; flex-direction: row; align-items: center; justify-content: space-between; border-left: 0; border-top: 1px solid var(--line-2); padding: 16px 24px; }
  .hero__stats { flex-direction: row; gap: 28px; }
}
@media (max-width: 767.98px) {
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero__photo { padding: 24px 0 8px; }
  .hero__photo img { width: 160px; height: 160px; }
  .hero__body { padding: 0 16px 20px; width: 100%; }
  .hero__hello { font-size: 14px; line-height: 20px; }
  .hero__title { font-size: 28px; line-height: 38px; }
  .hero__lead { font-size: 16px; line-height: 24px; }
  .hero__buttons { flex-direction: column; }
  .hero__buttons .btn { width: 100%; }
  .hero__side { width: 100%; flex-direction: column; gap: 16px; padding: 16px; }
  .hero__stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero__stat dd { font-size: 20px; line-height: 26px; }
  .hero__stat dt { font-size: 12px; line-height: 16px; }
  .hero__socials { justify-content: center; }

  .directions { padding: 20px 16px; gap: 16px; }
  .directions__list { grid-template-columns: 1fr; gap: 12px; }


  .book { display: flex; padding: 20px 16px; align-items: stretch; }
  .book__cover { width: min(60%, 200px); align-self: center; }
  .book__actions { flex-wrap: wrap; }
  .book__actions .btn { flex: 1 1 140px; }
  .book__eyebrow, .book__cover { align-self: flex-start; }
  .book__cover { align-self: center; }

  .partners { padding: 20px 16px; }
  .partners__page { grid-template-columns: 1fr; }
}

.dir__title a, .book__title a { color: inherit; }
.dir__title a:hover, .book__title a:hover { color: var(--link-hover); }

/* =========================================================
   Компьютер (≥1101px): компактные блоки по размеру содержимого.
   Ничего не растягивается на высоту окна — свободное место внизу допустимо.
   Стоит в конце файла, чтобы перекрывать общие адаптивные правила.
   ========================================================= */
@media (min-width: 1101px) {
  body[data-page="home"] .app { grid-template-rows: var(--header-h) auto; align-content: start; }
  body[data-page="home"] .footer { display: none; }
  body[data-page="home"] .layout-2col { align-items: start; }
  /* Разметка идёт в порядке чтения (приветствие, книга, направления, партнёры);
     на компьютере книга и партнёры встают в правую колонку */
  .layout-2col > .hero { grid-column: 1; grid-row: 1; }
  .layout-2col > .book { grid-column: 2; grid-row: 1; }
  .layout-2col > .directions { grid-column: 1; grid-row: 2; }
  .layout-2col > .partners { grid-column: 2; grid-row: 2; }
  /* правая колонка тянется на высоту ряда: края карточек на одной линии с левыми и одинаковы в RU и EN */
  .layout-2col > .book { align-self: stretch; }
  .layout-2col > .partners { align-self: start; }

  /* Приветствие */
  .hero__photo { padding: 24px 24px 24px 28px; }
  .hero__photo img { width: 160px; height: 160px; border-width: 6px; }
  .hero__body { gap: 16px; padding: 24px 24px 24px 0; }
  .hero__title { font-size: 34px; line-height: 44px; }
  .hero__lead { margin-top: 6px; font-size: calc(16px * var(--fs-s, 1)); line-height: 24px; max-width: 56ch; }
  .hero__side { gap: 16px; padding: 24px 28px 24px 24px; }
  .hero__stats { gap: 10px; }
  .hero__stat dd { font-size: 24px; line-height: 30px; }

  /* Направления: компактные карточки, ссылки сразу под текстом */
  .directions { gap: 16px; padding: 22px 24px 24px; }
  .directions .block-head__title { font-size: calc(20px * var(--fs-h, 1)); line-height: 28px; }
  .directions__list { gap: 16px; }
  .dir { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-items: center; align-content: start; column-gap: 12px; row-gap: 8px; padding: 18px; }
  .dir__text { align-self: start; }
  .dir__links { align-self: end; }
  .dir__icon { width: 40px; height: 40px; margin: 0; }
  .dir__title { font-size: calc(18px * var(--fs-h, 1)); line-height: 24px; }
  .dir__text { font-size: calc(14px * var(--fs-s, 1)); line-height: 21px; }
  .dir__links { margin-top: 2px; padding-top: 0; }

  /* Книга: обложка слева, текст справа — компактно */
  .book { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 18px; row-gap: 8px; align-items: start; padding: 22px; }
  .book__eyebrow { grid-column: 1 / -1; }
  .book__cover { grid-column: 1; grid-row: 2 / span 3; width: 112px; }
  .book > .book__title, .book > .book__text, .book > .book__actions { grid-column: 2; }
  .book__title { font-size: calc(19px * var(--fs-h, 1)); line-height: 26px; }
  .book__actions { flex-direction: column; gap: 8px; }
  .book__actions .btn { width: 100%; }
  .partners { padding: 20px 22px 22px; }
}
@media (min-width: 1101px) and (max-width: 1500px) {
  .hero__title { font-size: 30px; line-height: 40px; }
  .hero__photo img { width: 144px; height: 144px; }
}
@media (min-width: 1101px) and (max-width: 1279.98px) {
  /* Узкий ноутбук: вторая строка заголовка переносится и не наезжает на цифры */
  .hero__title { font-size: 27px; line-height: 36px; }
  .hero__title-line { white-space: normal; }
  .hero__photo img { width: 128px; height: 128px; }
}
@media (min-width: 1101px) and (max-width: 1366px) {
  .book { grid-template-columns: 88px minmax(0, 1fr); }
  .book__cover { width: 88px; grid-row: 2 / span 2; }
  .book > .book__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}

/* цифры в ряд (≤900): числа на одной высоте, подписи под ними */
@media (max-width: 900px) { .hero__stat { justify-content: flex-end; } }
@media (max-width: 767.98px) { .hero__stat dt { overflow-wrap: break-word; hyphens: manual; } }

/* =========================================================
   Приветствие: реальное фото квадратом, имя и одна строка
   ========================================================= */
.hero__photo img { border-radius: 14px; border: 0; box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 0 1px var(--line-2); object-fit: cover; }
.hero__body { justify-content: center; }
.hero__title { font-size: 44px; line-height: 52px; }
.hero__lead { margin-top: 6px; font-size: calc(18px * var(--fs-h, 1)); line-height: 26px; color: var(--gray-300); max-width: none; }
@media (min-width: 1101px) {
  .hero__title { font-size: 42px; line-height: 50px; }
  .hero__lead { font-size: calc(18px * var(--fs-h, 1)); line-height: 26px; }
}
@media (max-width: 767.98px) {
  .hero__photo img { border-radius: 12px; }
  .hero__title { font-size: 32px; line-height: 40px; }
  .hero__lead { font-size: 17px; line-height: 24px; }
}

/* Направления: круглая аватарка канала вместо значка */
.dir__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gray-1100); }
@media (min-width: 1101px) { .dir__avatar { width: 40px; height: 40px; } }

/* Последнее видео канала внутри карточки направления (заполняет tools/update_latest_video.py) */
.dir__video {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 8px; margin-top: 2px;
  border-radius: var(--radius-s);
  background: var(--gray-1600);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .2s var(--ease);
}
.dir__video:hover { background: var(--gray-1100); }
.dir__video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.dir__video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir__video-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: flex; padding: 4px; border-radius: 32px; background: var(--primary-surface); color: var(--on-accent); }
.dir__video-play .icon { width: 14px; height: 14px; }
.dir__video-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dir__video-label { font-size: calc(12px * var(--fs-s, 1)); line-height: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--tertiary-content); }
.dir__video-title { font-size: calc(14px * var(--fs-s, 1)); line-height: 19px; color: var(--gray-200); min-height: calc(2 * 19px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 768px) {
  /* Три карточки делят общие строки (subgrid): заголовок, текст, видео и ссылки
     стоят на одной линии при любой длине текста, блоки видео — одной высоты */
  .directions__list { grid-template-rows: repeat(4, auto); }
  .dir { grid-row: span 4; grid-template-rows: subgrid; row-gap: 8px; align-items: start; }
  .dir__avatar, .dir__title { align-self: center; }
  .dir__video { align-self: stretch; }
  .dir__links { align-self: end; }
}
/* подпись «Последнее видео · дата» не рвётся внутри даты */
.dir__video-label time { white-space: nowrap; }

/* EN: пометка о том, что видео, каналы и книга на русском */
.hero__note { font-size: calc(13px * var(--fs-s, 1)); line-height: 18px; color: var(--gray-500); }
@media (max-width: 479.98px) { .book__actions { flex-direction: column; } .book__actions .btn { flex: none; } }

/* Партнёры: название и одна строка о том, что это за компания */
.partner__text { display: flex; flex-direction: column; min-width: 0; }
.partner__name { line-height: 20px; }
.partner__desc { font-size: calc(12px * var(--fs-s, 1)); line-height: 16px; font-weight: 400; color: var(--gray-500); }

/* =========================================================
   Один каркас для RU и EN на компьютере: размеры блоков не зависят
   от длины текста, поэтому при смене языка ничего не прыгает
   ========================================================= */
@media (min-width: 1101px) {
  /* правая часть приветствия фиксированной ширины, подписи переносятся внутри */
  .hero__side { flex: 0 0 clamp(250px, 30%, 340px); }
  /* текст карточки направлений всегда занимает место под 3 строки, ссылки — столбиком */
  .dir__text { min-height: 3lh; }
  .dir__links { flex-direction: column; align-items: flex-start; gap: 2px; }
  /* пометка о языке на EN не сдвигает содержимое приветствия */
  .hero__body { position: relative; }
  .hero__note { position: absolute; left: 0; right: 24px; bottom: 10px; }
}

/* дата последнего видео — отдельной строкой под подписью */
.dir__video-date { display: block; font-size: calc(12px * var(--fs-s, 1)); line-height: 16px; color: var(--gray-500); }
/* подписи к цифрам резервируют одинаковое число строк в RU и EN
   (русские и английские подписи переносятся по-разному) */
@media (min-width: 1101px) { .hero__stat:last-child dt { min-height: 2lh; } }
@media (min-width: 1101px) and (max-width: 1440px) { .hero__stat dt { min-height: 2lh; } }
@media (min-width: 1101px) and (max-width: 1199px) { .hero__stat:last-child dt { min-height: 3lh; } }
/* кнопки приветствия одной ширины в RU и EN */
@media (min-width: 1101px) {
  .hero__buttons .btn:first-child { min-width: 190px; }
  .hero__buttons .btn:nth-child(2) { min-width: 160px; }
}

/* Плитки партнёров: как остальные плитки — радиус 12, название в стиле заголовков плиток, логотип крупнее */
.partner { padding: 8px 16px 8px 8px; }
.partner__logo { width: 52px; height: 52px; border-radius: 10px; }
.partner__name { font-weight: 600; color: var(--text-light); }

@media (min-width: 1101px) {
  /* кнопки книги в узкой правой колонке — столбиком в обоих языках */
  .book > .book__actions { flex-direction: column; }
  .book > .book__actions .btn { flex: none; }
}
@media (min-width: 1101px) and (max-width: 1199px) {
  .dir__video-label { white-space: nowrap; letter-spacing: .02em; }
  .hero__lead { min-height: 2lh; }
}
/* Планшет в альбомной ориентации: правая часть приветствия тоже фиксированной ширины */
@media (min-width: 901px) and (max-width: 1100.98px) {
  .hero__side { flex: 0 0 330px; }
  .hero__stat dt { min-height: 2lh; }
}
/* Телефон: цифры аудитории строками «число — подпись», без разрывов слов */
@media (max-width: 479.98px) {
  .hero__stats { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hero__stat { flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 10px; text-align: left; }
  .hero__stat dt { overflow-wrap: normal; }
}
/* Низкое окно ноутбука (1366×768 с панелями браузера): компактнее отступы —
   главная помещается в экран, каркас RU и EN остаётся общим */
@media (min-width: 1101px) and (max-height: 760px) {
  .layout-2col { gap: 14px; }
  .hero__photo { padding-top: 14px; padding-bottom: 14px; }
  .hero__body { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
  .hero__side { padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  .hero__stats { gap: 6px; }
  .directions { padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  .directions__list { gap: 12px; }
  .dir { padding: 12px; row-gap: 6px; }
  .book { padding: 16px 20px; gap: 8px; }
  .partners { padding-top: 14px; padding-bottom: 16px; gap: 10px; }
}
/* описание книги в узкой правой колонке резервирует одинаковое число строк в RU и EN */
@media (min-width: 1101px) and (max-width: 1366px) { .book__text { min-height: 6lh; } }
/* планшет: текст направлений и ссылки — одинаковый каркас в обоих языках */
@media (min-width: 768px) and (max-width: 1100.98px) {
  .dir__text { min-height: 4lh; }
  .dir__links { flex-direction: column; align-items: flex-start; gap: 2px; }
}
/* планшет в альбомной ориентации: пометка о языке на EN тоже не сдвигает приветствие */
@media (min-width: 901px) and (max-width: 1100.98px) {
  .hero__body { position: relative; }
  .hero__note { position: absolute; left: 0; right: 24px; bottom: 10px; }
}
@media (min-width: 901px) and (max-width: 1100.98px) { .hero__lead { min-height: 2lh; } }

/* Арт-дирекция: крупнее фото (лицо — первым), меньше синего на первом экране */
@media (min-width: 1280px) {
  .hero__photo img { width: 200px; height: 200px; }
  .hero__photo { padding-right: 32px; }
}
.hero__socials .icon-btn--secondary { color: var(--gray-300); border-color: var(--card-line); }
@media (hover: hover) { .hero__socials .icon-btn--secondary:hover { color: var(--primary); border-color: var(--primary); } }
.dir__video-label { color: var(--gray-500); }
.dir__video-play { background: rgba(1, 4, 6, .6); color: #fff; }
.dir__video-thumb { background: var(--gray-1100); } /* пока превью не загрузилось */
.footer__about:hover { color: var(--link-hover); }

/* Компактный режим: резерв описания книги меньше (иначе дыра под текстом и скачок RU/EN) */
@media (min-width: 1101px) and (max-height: 760px) { .book__text { min-height: 4lh; } }
/* Широкий монитор: компактный режим включается раньше, чтобы подгонка не мельчила всё на 10% */
@media (min-width: 1800px) and (max-height: 840px) {
  .layout-2col { gap: 14px; }
  .hero__photo, .hero__body, .hero__side { padding-top: 14px; padding-bottom: 14px; }
  .directions { padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  .directions__list { gap: 12px; }
  .dir { padding: 12px; row-gap: 6px; }
  .book { padding: 16px 20px; gap: 8px; }
  .book__text { min-height: 4lh; }
}
/* третья подпись к цифрам: резерв 3 строки до 1279 (RU переносится на 3) */
@media (min-width: 1200px) and (max-width: 1279px) { .hero__stat:last-child dt { min-height: 3lh; } }
/* планшет: резерв текста направлений — 3 строки (шире), 4 — на узком */
@media (min-width: 901px) and (max-width: 1100.98px) { .dir__text { min-height: 3lh; } }
/* сенсорный ноутбук: кнопки книги чуть плотнее */
@media (min-width: 1101px) and (pointer: coarse) { .book > .book__actions { gap: 6px; } }
/* телефон: числа аудитории общей колонкой, подписи с одного края */
@media (max-width: 479.98px) {
  .hero__stats { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-auto-flow: dense; column-gap: 10px; row-gap: 6px; align-items: baseline; }
  .hero__stat { display: contents; }
  .hero__stat dd { grid-column: 1; }
  .hero__stat dt { grid-column: 2; text-align: left; }
}
@media (min-width: 1101px) {
  /* приветствие тянется на высоту ряда — нижний край совпадает с книгой */
  .layout-2col > .hero { align-self: stretch; }
}
/* с крупным фото подзаголовок на узких ноутбуках переносится — резерв 2 строки в обоих языках */
@media (min-width: 1101px) and (max-width: 1500px) { .hero__lead { min-height: 2lh; } }
/* на 1101–1279 русский текст направлений бывает в 4 строки */
@media (min-width: 1101px) and (max-width: 1279px) { .dir__text { min-height: 4lh; } }
@media (min-width: 1101px) and (max-width: 1279px) { .dir__video-label { white-space: nowrap; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; } }
@media (min-width: 1280px) and (max-width: 1366px) { .hero__stat:last-child dt { min-height: 3lh; } }
@media (min-width: 1101px) and (max-width: 1199px) { .dir__video-label { letter-spacing: 0; } }
@media (min-width: 1101px) and (max-width: 1199px) {
  .directions .dir__video { grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
  .dir__video-date, .dir__video-label { white-space: nowrap; }
}

/* Главная на компьютере занимает весь экран: приветствие и книга наверху,
   направления и партнёры у низа окна, свободное место — посередине
   (высоту сетки задаёт main.js). Боковое меню — до низа. */
@media (min-width: 1101px) {
  body[data-page="home"] .layout-2col { grid-template-rows: auto 1fr; }
  .layout-2col > .directions, .layout-2col > .partners { align-self: end; }
  /* высота бокового меню — общая для всех страниц (base.css) */
}

/* Подвал главной — внутри сетки: на телефоне и планшете в конце страницы,
   на компьютере в правой колонке под партнёрами, у низа окна */
.layout-2col > .footer--home { grid-column: 1 / -1; }
@media (min-width: 1101px) {
  body[data-page="home"] .layout-2col > .footer--home { display: flex; }
  body[data-page="home"] .layout-2col { grid-template-rows: auto auto 1fr; }
  .layout-2col > .directions { grid-column: 1; grid-row: 2 / 4; align-self: end; }
  .layout-2col > .partners { grid-column: 2; grid-row: 2; align-self: start; }
  .layout-2col > .footer--home { grid-column: 2; grid-row: 3; align-self: end; gap: 6px; padding: 14px 4px 0; }
  .footer--home .footer__row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer--home .footer__nav { padding-bottom: 4px; }
}
/* подвал главной одной высоты в RU и EN (русские строки длиннее) */
@media (min-width: 1101px) and (max-width: 1799px) { .layout-2col > .footer--home { min-height: 226px; justify-content: flex-end; } }
.layout-2col > .footer--home.is-hidden { display: none !important; }

/* Колонка главной ровно до низа бокового меню (оно задаёт высоту ряда), сетка заполняет её */
@media (min-width: 1101px) {
  body[data-page="home"] .main { display: flex; flex-direction: column; }
  body[data-page="home"] .main > .layout-2col { flex: 1 0 auto; }
  body[data-page="home"] .main.is-measuring { align-self: start; }
  body[data-page="home"] .main.is-measuring > .layout-2col { flex: none; }
}
/* Карточка книги: содержимое не «разъезжается» по высоте ряда, описание ровно N строк
   в RU и EN — обложка и кнопки стоят одинаково при смене языка */
@media (min-width: 1101px) {
  body[data-page="home"] .book { align-content: center; }
  body[data-page="home"] .book__text { min-height: 4lh; max-height: 4lh; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (min-width: 1101px) and (max-width: 1366px) {
  body[data-page="home"] .book__text { min-height: 6lh; max-height: 6lh; -webkit-line-clamp: 6; }
}
