/* =========================================================
   Спецпроект «Силуэт каждого века»

   ДВА РЕЖИМА (выбираются автоматически, см. <head> в index.html):
   • embed   — шапка на сайте журнала (во iframe). Холст 1440 × 790,
               тянется по ширине, пропорция всегда как в макете.
   • landing — отдельный лендинг. Заполняет окно браузера любого
               размера; фото растягиваются на весь экран, а кнопки,
               тексты и отступы масштабируются так, чтобы всё влезало.

   Размеры пишем как calc(N * var(--px)), где N — значение
   из Figma-макета 1440. (Лендинг 1920 × 1080 в Figma — это тот же
   макет ×4/3, поэтому отдельные цифры для него не нужны.)

   Элементы привязаны к краям экрана (сверху / снизу / слева /
   справа / от центра), а не к координатам холста — поэтому
   на любых пропорциях окна ничего не съезжает.
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: #0e0d0c; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* =========================================================
   МАСШТАБ И РЕЖИМЫ
   ========================================================= */

/* --- embed (по умолчанию) --- */
.sp {
  container-type: inline-size;
  width: 100%;
}

.stage {
  --px: calc(100cqw / 1440);
  --line: max(1px, calc(1 * var(--px)));

  --cream: rgba(237, 230, 218, 1);
  --ink:   rgba(14, 13, 12, 1);

  position: relative;
  width: 100%;
  height: calc(790 * var(--px));
  overflow: hidden;
  font-family: 'Onest', system-ui, sans-serif;
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* --- landing: на всё окно браузера ---
   Масштаб берётся по ширине или по высоте — что «теснее».
   1440 × 810 — это 1920 × 1080 из Figma в единицах макета 1440. */
html[data-mode="landing"],
html[data-mode="landing"] body {
  height: 100%;
  overflow: hidden;
}
html[data-mode="landing"] .sp {
  container-type: size;
  height: 100vh;
  height: 100dvh;
}
html[data-mode="landing"] .stage {
  --px: min(100cqw / 1440, 100cqh / 810);
  height: 100%;
}

/* --- embed: шапка-фичер на чужой странице (iframe) ---
   Блок во всю ширину страницы, высоту задаёт сайт-хозяин (обычно ~790px).
   Как и лендинг, подстраиваемся под любой размер окошка: масштаб — по
   ширине или по высоте, что «теснее»; фоны и видео растягиваются на всю
   ширину, кнопки прижаты к краям, текст не обрезается.
   Холст макета — 1440 × 790. */
html[data-mode="embed"],
html[data-mode="embed"] body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
html[data-mode="embed"] .sp {
  container-type: size;
  height: 100vh;
}
html[data-mode="embed"] .stage {
  --px: min(100cqw / 1440, 100cqh / 790);
  height: 100%;
}

/* =========================================================
   ОБЩЕЕ
   ========================================================= */

.screen,
.menu {
  position: absolute;
  inset: 0;
}

/* Экраны (первый экран, силуэт) переключаются плавным затуханием */
.screen {
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease, visibility 0s;
}

/* Кнопка «Карта силуэтов» — общая для всех экранов */
.map-btn {
  position: absolute;
  z-index: 5;
  top:   calc(32 * var(--px));
  right: calc(40 * var(--px));
  width:  calc(219 * var(--px));
  height: calc(48 * var(--px));
  padding: 0 calc(20 * var(--px)) 0 calc(24 * var(--px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--px));

  border-radius: 999px;
  border: var(--line) solid rgba(237, 230, 218, 0.2);
  background: rgba(14, 13, 12, 0.88);
  -webkit-backdrop-filter: blur(calc(16 * var(--px)));
          backdrop-filter: blur(calc(16 * var(--px)));

  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  transition: background .25s ease;
}
.map-btn:hover { background: rgba(14, 13, 12, 1); }

.map-btn__burger {
  flex: none;
  width:  calc(20 * var(--px));
  height: calc(14.5 * var(--px));
  fill: currentColor;
}

/* Стеклянные плашки («Grazia · Спецпроект», «A · Практика»…) */
.glass {
  position: absolute;
  height: calc(35 * var(--px));
  padding: 0 calc(14 * var(--px));
  display: flex;
  align-items: center;

  border-radius: 999px;
  border: var(--line) solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 13, 12, 0.32);
  -webkit-backdrop-filter: blur(calc(10 * var(--px)));
          backdrop-filter: blur(calc(10 * var(--px)));

  font-size: calc(12 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* Нижняя тёмная панель (первый экран и экраны силуэтов) */
.bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(88 * var(--px));
  padding: 0 calc(40 * var(--px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* центр всегда ровно посередине */
  align-items: center;
  background: rgba(14, 13, 12, 0.9);
}
.bar__left,
.bar__center {
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}
.bar__left   { font-size: calc(13 * var(--px)); justify-self: start; }
/* нижняя панель главной (Figma 1920: «Спецпроект» 16px, центр 20px) */
.hero .hero__rubric { font-size: calc(12 * var(--px)); letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.85); }
.hero .hero__nav    { font-size: calc(15 * var(--px)); }
.bar__center { font-size: calc(14 * var(--px)); justify-self: center; }

/* Светлая кнопка-«пилюля» («Начать ↓», «Следующий силуэт →») */
.pill {
  justify-self: end;
  height: calc(48 * var(--px));
  padding: 0 calc(24 * var(--px)) 0 calc(28 * var(--px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--cream);
  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition: background .25s ease;
}
.pill:hover { background: #fff; }

/* =========================================================
   ПЕРВЫЙ ЭКРАН
   ========================================================= */

.hero__bg {
  position: absolute;
  inset: 0;
  background: #5e5646 url('img/hero.webp') center / cover no-repeat;
}
.hero__bg::after {                /* «затемнение для текста» из макета */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* Логотип Grazia (Figma 1920: 139 × 44, отступ 52 сверху и слева) —
   по высоте на одной линии с кнопкой «Карта силуэтов» */
.hero__logo {
  position: absolute;
  top:  calc(39 * var(--px));
  left: calc(39 * var(--px));
  width:  calc(104.25 * var(--px));
  height: calc(33 * var(--px));
  object-fit: contain;
  object-position: left center;
  opacity: 0.8;
  user-select: none;
  -webkit-user-drag: none;
}

/* Заголовок и подписи привязаны к низу: при высоком окне
   лишнее место уходит наверх, на фото */
.hero__kicker {
  position: absolute;
  left:   calc(39 * var(--px));
  bottom: calc(450 * var(--px));
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.75);
  white-space: nowrap;
}

.hero__title {
  position: absolute;
  left:   calc(33 * var(--px));
  bottom: calc(153 * var(--px));
  font-size: calc(150 * var(--px));
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
}
.hero__title span { display: block; white-space: nowrap; }

.hero__lead {
  position: absolute;
  right:  calc(59.5 * var(--px));
  bottom: calc(387 * var(--px));
  width:  calc(559.5 * var(--px));
  font-size: calc(17.25 * var(--px));
  font-weight: 400;
  line-height: calc(24 * var(--px));
  color: rgba(237, 230, 218, 0.9);
  display: flex;
  flex-direction: column;
  gap: calc(24 * var(--px));         /* между абзацами — пустая строка, как в макете */
}

/* =========================================================
   ЭКРАН СИЛУЭТА
   ========================================================= */

.chapter { background: #0E0D0C; }

.chapter__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  transition: opacity .35s ease;
}
.chapter__half--a { left: 0;   background-color: #2a2724; width: calc(50% + 1px); } /* +1px — без шва между половинами */
.chapter__half--b { left: 50%; background-color: #33100E; }

/* --- Фото --- */
.chapter__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  transition: filter .7s ease, transform .9s ease;
}

/* Видео вместо фото: та же раскладка «cover», кадр — через object-position */
.chapter__video {
  object-fit: cover;
  background: transparent;
}
.chapter__video[hidden] { display: none; }

/* --- Затемнение поверх фото (в макете rgba(14,13,12,.55)) --- */
.chapter__veil {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.55);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;              /* затемнение не перекрывает ссылки в тексте */
}

/* --- Текст --- */
.chapter__text {
  position: absolute;
  top: 49%;                            /* блок текста — по центру по высоте (в макете центр на 530 из 1080) */
  left: calc(90 * var(--px));
  width: calc(555 * var(--px));
  opacity: 0;
  transform: translateY(calc(-50% + 16 * var(--px)));
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.chapter__kicker {
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.75);
}

.chapter__title {
  margin-top: calc(12 * var(--px));
  font-size: var(--title-fs, calc(87 * var(--px)));
  font-weight: 500;
  line-height: var(--title-lh, calc(81 * var(--px)));
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: pre-line;               /* \n в заголовке — перенос строки */
}

.chapter__body {
  margin-top: calc(33 * var(--px));
  width: calc(492 * var(--px));
  display: flex;
  flex-direction: column;
  gap: calc(21 * var(--px));
  font-size: calc(15 * var(--px));
  font-weight: 400;
  line-height: calc(24 * var(--px));
  color: rgba(237, 230, 218, 0.9);
}

.chapter__fact {
  margin-top: calc(33 * var(--px));
  display: flex;
  gap: calc(12 * var(--px));
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
}
.chapter__fact-label { color: rgba(237, 230, 218, 0.6); white-space: nowrap; }

.chapter__body.is-strong { font-weight: 500; }
.chapter__body.is-interview {          /* «Интервью» в историях: 21px / 156% в макете */
  font-size: calc(15.75 * var(--px));
  line-height: 1.56;
  gap: calc(24.5 * var(--px));         /* пустая строка между абзацами */
  max-height: calc(545 * var(--px));   /* длинный текст листается (макет 6_2: окно 727px) */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.chapter__body.is-interview::-webkit-scrollbar { display: none; }
.chapter__half.is-open .chapter__text:has(.is-scrollable) { pointer-events: auto; }
.chapter__title.is-nowrap { white-space: pre; }   /* строки — ровно как в тексте (\n), без лишних переносов */

/* Полоса прокрутки длинного интервью (макет: 4px, справа от текста) */
.chapter__scroll {
  position: absolute;
  left: calc(648 * var(--px));
  width: calc(3 * var(--px));
  border-radius: calc(2 * var(--px));
  background: rgba(237, 230, 218, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.chapter__scroll-thumb {
  position: absolute;
  left: 0; right: 0;
  border-radius: inherit;
  background: rgba(237, 230, 218, 0.8);
}
.chapter__half.is-open .chapter__scroll.is-on {
  opacity: 1;
  transition: opacity .6s ease .15s;
}

/* Фичер-шапка на компьютере: когда сайт растягивает окно в ширину, правая половина
   становится шире макета, и текст «прилипал» к середине экрана. Ставим блок текста
   по центру правой половины: макетная колонка 720 (= половина 1440) — посередине,
   внутри неё отступы как в макете. Когда пропорции как в макете — ничего не меняется. */
html[data-mode="embed"] .chapter__half--b .chapter__text {
  left: calc(50% - 360 * var(--px) + 90 * var(--px));
}
html[data-mode="embed"] .chapter__half--b .chapter__scroll {
  left: calc(50% - 360 * var(--px) + 648 * var(--px));
}
.chapter__body p { white-space: pre-line; }
/* ссылки в тексте: цвет текста, тонкое подчёркивание; кликаются, когда текст открыт */
.chapter__body a,
.m-p a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(237, 230, 218, 0.55);
  transition: text-decoration-color .2s ease, color .2s ease;
}
.chapter__body a:hover,
.m-p a:hover { color: var(--cream); text-decoration-color: currentColor; }
.chapter__half.is-open .chapter__body a { pointer-events: auto; }
.chapter__text [hidden] { display: none !important; }
.chapter__text > :not([hidden]):first-child,
.chapter__kicker[hidden] + .chapter__title[hidden] + .chapter__body { margin-top: 0; }

/* --- Истории: свои цвета и размер заголовка (макет «История 05») --- */
.chapter--story .chapter__half--a { background-color: #C8BFAF; }
.chapter--story .chapter__half--b { background-color: #BAB1A3; }

.chapter--story .chapter__title {
  --title-fs: calc(75 * var(--px));
  --title-lh: calc(72 * var(--px));
}

.chapter--light .bar { background: rgba(255, 253, 250, 0.7); }
.chapter--light .bar__left   { color: rgba(14, 13, 12, 0.7); }
.chapter--light .bar__center { color: #0E0D0C; }
.chapter--light .pill        { background: #0E0D0C; color: #E8DECC; }
.chapter--light .pill:hover  { background: #000; }

.bar, .bar__left, .bar__center, .pill {
  transition: background .35s ease, color .35s ease, opacity .35s ease;
}

/* --- Наведение: фото уходит в блюр, проявляется текст --- */
.chapter__half.is-open .chapter__img {
  filter: blur(calc(16 * var(--px)));
  transform: scale(1.08);           /* чтобы размытые края не «светились» */
}
.chapter__half.is-open .chapter__veil { opacity: 1; }
.chapter__half.is-open .chapter__text {
  opacity: 1;
  transform: translateY(-50%);
  transition: opacity .6s ease .15s, transform .6s ease .15s;
}

.chapter__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--line);
  background: rgba(237, 230, 218, 0.35);
  display: none;          /* линия-разделитель из макета выключена; вернуть — удалить эту строку */
  transition: opacity .35s ease;
}
.chapter.is-switching .chapter__divider { opacity: 0; }   /* если вернуть — гаснет вместе с видео */

.chapter__tag    { top: calc(38 * var(--px)); }
.chapter__tag--a { left: calc(40 * var(--px)); }
.chapter__tag--b { left: calc(50% + 40 * var(--px)); }

/* при смене силуэта картинки и подписи коротко гаснут */
.chapter .bar__left,
.chapter .bar__center { transition: opacity .35s ease; }

.chapter.is-switching .chapter__half,
.chapter.is-switching .bar__left,
.chapter.is-switching .bar__center { opacity: 0; }

/* Курсор-кружок с номером силуэта.
   Системный курсор на экранах силуэтов прячем, вместо него — кружок. */
.stage.has-cursor .chapter,
.stage.has-cursor .chapter *,
.stage.has-cursor .map-btn { cursor: none; }

.cursor {                         /* точка под мышью — двигается */
  position: absolute;
  z-index: 20;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;            /* не мешает кликам */
  opacity: 0;
  will-change: transform;
  transition: opacity .25s ease;
}
.cursor.is-visible { opacity: 1; }

.cursor__dot {                    /* сам кружок — центрирован на точке */
  position: absolute;
  left: calc(-16 * var(--px));
  top:  calc(-16 * var(--px));
  width:  calc(32 * var(--px));
  height: calc(32 * var(--px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: max(1px, calc(2 * var(--px))) solid var(--cream);
  background: rgba(237, 230, 218, 0.4);
  font-size: calc(11 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
  transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
}
.cursor.is-hover .cursor__dot { transform: scale(1.35); }   /* над кнопками чуть больше */
.cursor.is-on-light .cursor__dot {                           /* над светлыми кнопками — тёмный */
  border-color: var(--ink);
  background: rgba(14, 13, 12, 0.25);
  color: var(--ink);
}

/* =========================================================
   МЕНЮ «КАРТА СИЛУЭТОВ»
   ========================================================= */

.menu {
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .45s ease, visibility 0s;
}

/* --- Фон --- */
.menu__veil {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.62);
  -webkit-backdrop-filter: blur(calc(15 * var(--px)));
          backdrop-filter: blur(calc(15 * var(--px)));
}

.menu__bgs {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.menu__bg {
  position: absolute;
  inset: calc(-4 * var(--px));       /* запас, чтобы размытые края не светились */
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(calc(1.5 * var(--px))); /* лёгкая мягкость, как на макетах */
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .6s ease, transform 1.2s ease;
}
.menu__bg.is-active {
  opacity: 1;
  transform: scale(1);
}

.menu__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(278.86deg, rgba(0, 0, 0, 0.15) 23.15%, rgba(0, 0, 0, 0.6) 92.98%);
  pointer-events: none;
}

/* --- Шапка главы (привязана к верху) --- */
.menu__head { transition: opacity .2s ease; }
.menu__head.is-switching { opacity: 0; }

.menu__kicker {
  position: absolute;
  top:  calc(33 * var(--px));
  left: calc(39 * var(--px));
  font-size: calc(11 * var(--px));
  font-weight: 500;
  line-height: calc(14 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.75);
  white-space: nowrap;
}

/* заголовок и описание идут друг под другом: если заголовок в 2 строки,
   описание сдвигается ниже (как у «Наташа Гасанханова» в макете) */
.menu__titles {
  position: absolute;
  top:  calc(76.5 * var(--px));
  left: calc(39 * var(--px));
  display: flex;
  flex-direction: column;
  gap: calc(7.5 * var(--px));
}

.menu__title {
  font-size: calc(75 * var(--px));
  font-weight: 500;
  line-height: calc(72 * var(--px));
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: pre;
}

.menu__desc {
  width: calc(459 * var(--px));
  font-size: calc(15 * var(--px));
  font-weight: 400;
  line-height: calc(24 * var(--px));
  color: rgba(237, 230, 218, 0.8);
}

/* --- Кнопка «Закрыть» --- */
.menu__close {
  position: absolute;
  top:   calc(32 * var(--px));
  right: calc(40 * var(--px));
  height: calc(48 * var(--px));
  padding: 0 calc(20 * var(--px)) 0 calc(24 * var(--px));
  display: flex;
  align-items: center;
  gap: calc(12 * var(--px));

  border-radius: 999px;
  border: var(--line) solid rgba(237, 230, 218, 0.2);
  background: rgba(14, 13, 12, 0.88);
  -webkit-backdrop-filter: blur(calc(8 * var(--px)));
          backdrop-filter: blur(calc(8 * var(--px)));

  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  transition: background .25s ease;
}
.menu__close:hover { background: rgba(14, 13, 12, 1); }

/* --- Карточки: 7 в ряд (силуэты · подводка · истории), привязаны к низу --- */
.menu__picker {
  position: absolute;
  left:   calc(39 * var(--px));
  right:  calc(39 * var(--px));
  bottom: calc(156 * var(--px));
  display: flex;
  justify-content: space-between;
  gap: calc(24 * var(--px));
}

.menu__slot {
  display: flex;
  flex-direction: column;
  gap: calc(9 * var(--px));
}

.menu__label {
  min-height: calc(15 * var(--px));     /* у карточек без подписи — пустое место той же высоты */
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}

.card {
  position: relative;
  flex: none;
  width:  calc(174 * var(--px));
  height: calc(261 * var(--px));
  padding: 0 calc(15 * var(--px)) calc(15 * var(--px));
  display: flex;
  align-items: flex-end;
  overflow: hidden;

  border: max(1px, calc(2.25 * var(--px))) solid rgba(237, 230, 218, 0.4);
  border-radius: calc(3 * var(--px));
  background: #2a2724 center / cover no-repeat;
  background-clip: padding-box;     /* фото не заходит под полупрозрачную рамку — рамка одинаковая со всех сторон */
  text-align: left;
  transition: border-color .3s ease;
}

.card::before {                     /* затемнение неактивных карточек */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  transition: background .3s ease;
}
.card:hover::before { background: rgba(0, 0, 0, 0.2); }
/* у 03 и 04 в макете затемнение сильнее — светлые фото */
.menu__slot:nth-child(3) .card::before,
.menu__slot:nth-child(4) .card::before { background: rgba(0, 0, 0, 0.5); }
.menu__slot .card:hover::before { background: rgba(0, 0, 0, 0.2); }
.menu__slot .card.is-active::before { background: rgba(0, 0, 0, 0); }

/* карточка без картинки (подводка) — стеклянная */
.card--empty {
  background: rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(calc(9 * var(--px)));
          backdrop-filter: blur(calc(9 * var(--px)));
}
.card--empty::before { display: none; }

.card__label {
  position: relative;
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.8);   /* длинные названия переносятся на 2 строки */
  margin-right: calc(-3 * var(--px)); /* запас, чтобы «03 · Героиновый шик» влезал в строку, как в макете */
  transition: color .3s ease;
}

.card.is-active { border-color: var(--cream); }
.card.is-active::before { background: rgba(0, 0, 0, 0); }
.card.is-active .card__label { color: var(--cream); }

.card:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* --- Нижняя панель меню --- */
.menu__bar {
  position: absolute;
  left:   calc(39 * var(--px));
  right:  calc(39 * var(--px));
  bottom: calc(21 * var(--px));
  height: calc(48 * var(--px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.icon-btn {
  flex: none;
  width:  calc(48 * var(--px));
  height: calc(48 * var(--px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--line) solid rgba(237, 230, 218, 0.4);
  background: rgba(14, 13, 12, 0.4);
  font-size: calc(16 * var(--px));
  font-weight: 500;
  line-height: 1;
  color: var(--cream);
  transition: background .25s ease, opacity .25s ease;
}
button.icon-btn:hover,
.menu__back:hover .icon-btn { background: rgba(14, 13, 12, 0.8); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn:disabled:hover { background: rgba(14, 13, 12, 0.4); }

.menu__caption {
  font-size: calc(11 * var(--px));
  font-weight: 500;
  line-height: calc(14 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.75);
  white-space: nowrap;
}

.menu__back {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: calc(12 * var(--px));
}

.menu__pager {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: calc(12 * var(--px));
}

.menu__go {
  justify-self: center;
  width:  calc(142 * var(--px));
  height: calc(48 * var(--px));
  padding: 0 calc(24 * var(--px)) 0 calc(28 * var(--px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #FFFAF1;
  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition: background .25s ease, opacity .25s ease;
}
.menu__go:hover { background: #fff; }
.menu__go:disabled { opacity: 0.45; cursor: default; }
.menu__go:disabled:hover { background: #FFFAF1; }

@media (prefers-reduced-motion: reduce) {
  .screen, .menu, .menu__bg, .menu__head, .card, .card::before,
  .chapter__half, .chapter__img, .chapter__veil, .chapter__text, .cursor, .cursor__dot { transition: none !important; }
}

/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ (экран уже 768px)
   Макет Figma 390 × 664. Размеры — calc(N * var(--m)),
   N — значение из Figma. Масштаб считается от ширины экрана
   (и от высоты, если телефон «короткий»), поэтому на любом
   телефоне пропорции как в макете.
   ========================================================= */

.m { display: none; }

@media (max-width: 767px) {
  .stage { display: none; }
  .m     { display: block; }
  /* на телефоне прокручивается только лента внутри — сама страница стоит на месте */
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
}

.m {
  --cream: rgba(237, 230, 218, 1);
  --ink:   rgba(14, 13, 12, 1);
  /* масштаб — по ширине экрана (макет 390). На полноэкранной мобилке это то же,
     что и раньше; а в невысоком фичере-шапке (на сайте журнала — 420px)
     текст не мельчает: уменьшаем, только если окошко ниже 420px. */
  --m: min(100cqw / 390, 100cqh / 420);
  --mline: max(1px, calc(1 * var(--m)));

  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  container-type: size;
  overflow: hidden;
  background: #000;
  font-family: 'Onest', system-ui, sans-serif;
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Лента: свайп = один слайд ---------- */
.m-feed {
  position: absolute;
  inset: 0;
  overflow: hidden;                        /* листание — свайпом (mobile.js), по одному экрану */
  overscroll-behavior: none;
  scrollbar-width: none;
}
.m-feed { transition: opacity .38s ease; }
.m-feed.is-jumping { opacity: 0; }        /* переход «в начало» */
.m-feed::-webkit-scrollbar { display: none; }


.m-slide {
  position: relative;
  height: 100cqh;
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--m));
  padding: calc(12 * var(--m)) calc(16 * var(--m)) calc(20 * var(--m));
  overflow: hidden;
  isolation: isolate;
  background: #000;           /* пока кадр не загрузился — чистый чёрный */
}
.m-slide > * { position: relative; z-index: 1; flex: none; }
.m-slide > .m-bg,
.m-slide > .m-shade,
.m-slide > .m-media__half { position: absolute; z-index: 0; }

.m-spacer { flex: 1 1 0 !important; }

/* ---------- Фоны ---------- */
.m-bg {
  inset: 0;
  background-color: #000;
  background-size: cover;
  background-repeat: no-repeat;
}
.m-bg.is-blur {
  inset: calc(-30 * var(--m));             /* запас, чтобы размытые края не светились */
  filter: blur(calc(12 * var(--m)));
}
.m-bg.is-blur--strong { filter: blur(calc(16 * var(--m))); }

.m-shade { inset: 0; pointer-events: none; }
.m-shade--hero  { background: rgba(14, 13, 12, 0.3); }
.m-shade--cover { background: rgba(14, 13, 12, 0.45); }
.m-shade--text  { background: rgba(14, 13, 12, 0.62); }
.m-shade--media {                            /* лёгкое затемнение сверху и снизу — под подписи */
  background: linear-gradient(to bottom,
    rgba(14, 13, 12, 0.35) 0%, rgba(14, 13, 12, 0) 16%,
    rgba(14, 13, 12, 0) 72%, rgba(14, 13, 12, 0.55) 100%);
}

/* ---------- Общая шапка: плашка + бургер (не свайпается) ---------- */
.m-topbar {
  position: absolute;
  z-index: 10;                           /* над лентой, под меню */
  top: calc(12 * var(--m));
  left: calc(16 * var(--m));
  right: calc(16 * var(--m));
  height: calc(44 * var(--m));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(12 * var(--m));
  pointer-events: none;                  /* свайпы проходят сквозь пустое место шапки */
}
.m-topbar > * { pointer-events: auto; }
.m-topbar .m-glass { transition: opacity .22s ease; }
.m-topbar__left {
  pointer-events: none !important;     /* плашка и логотип не мешают свайпам */
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  height: calc(44 * var(--m));
  display: flex;
  align-items: flex-start;
}
.m-topbar__right {
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(12 * var(--m));
}
/* на главной — логотип Grazia вместо плашки, без кнопки звука (как в макете) */
.m-logo {
  position: absolute;
  left: 0;
  top: calc(10.5 * var(--m));
  height: calc(23 * var(--m));
  width: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.m-topbar.is-home .m-logo { opacity: 0.8; }
.m-topbar .m-sound { transition: opacity .3s ease, visibility .3s; }
.m-topbar.is-home .m-sound { opacity: 0; visibility: hidden; }

/* кнопка звука (44px) — слева от меню */
.m-sound {
  flex: none;
  width:  calc(44 * var(--m));
  height: calc(44 * var(--m));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--mline) solid rgba(237, 230, 218, 0.2);
  background: rgba(14, 13, 12, 0.88);
  -webkit-backdrop-filter: blur(calc(10 * var(--m)));
          backdrop-filter: blur(calc(10 * var(--m)));
  color: var(--cream);
}
.m-sound svg {
  width:  calc(24 * var(--m));
  height: calc(24 * var(--m));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-sound .sound-btn__on { display: none; }
.m-sound.is-on .sound-btn__on  { display: block; }
.m-sound.is-on .sound-btn__off { display: none; }
.m-menu__head .m-sound { margin-left: auto; margin-right: calc(12 * var(--m)); }

/* в самих кадрах на месте шапки — пустая строка той же высоты */
.m-top-space { height: calc(44 * var(--m)); }

.m-glass {
  height: calc(32 * var(--m));
  min-width: 0;
  padding: 0 calc(12 * var(--m));
  display: flex;
  align-items: center;
  border-radius: 999px;
  border: var(--mline) solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 13, 12, 0.32);
  -webkit-backdrop-filter: blur(calc(10 * var(--m)));
          backdrop-filter: blur(calc(10 * var(--m)));
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-burger {
  flex: none;
  width:  calc(44 * var(--m));
  height: calc(44 * var(--m));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(5 * var(--m));
  border-radius: 50%;
  border: var(--mline) solid rgba(237, 230, 218, 0.2);
  background: rgba(14, 13, 12, 0.88);
}
.m-burger i {
  display: block;
  width: calc(18 * var(--m));
  height: max(1px, calc(1.5 * var(--m)));
  background: var(--cream);
}

/* ---------- Подсказка «листайте» ---------- */
.m-hint {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(6 * var(--m));
}
.m-hint__line {
  width: 1px;
  height: calc(24 * var(--m));
  background: rgba(237, 230, 218, 0.7);
  transform-origin: top;
  animation: m-hint-line 2.4s ease-in-out infinite;
}
@keyframes m-hint-line {
  0%   { transform: scaleY(0);  opacity: 0; }
  35%  { transform: scaleY(1);  opacity: 1; }
  70%  { transform: scaleY(1);  opacity: 0.6; }
  100% { transform: scaleY(1);  opacity: 0; }
}
.m-hint__text {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(237, 230, 218, 0.75);
}

.m-arrow {
  width:  calc(44 * var(--m));
  height: calc(44 * var(--m));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--mline) solid rgba(237, 230, 218, 0.35);
  background: rgba(14, 13, 12, 0.45);
  -webkit-backdrop-filter: blur(calc(8 * var(--m)));
          backdrop-filter: blur(calc(8 * var(--m)));
  animation: m-arrow 2.4s ease-in-out infinite;
}
.m-arrow svg {
  width: calc(16 * var(--m));
  height: calc(16 * var(--m));
  fill: none;
  stroke: var(--cream);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes m-arrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(calc(4 * var(--m))); }
}

/* ---------- Главная ---------- */
.m-hero__bg {
  inset: 0;
  background: #000 url('img/m/hero.webp') center / cover no-repeat;   /* облегчённый вертикальный кадр для телефона */
}
.m-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}
.m-hero__content {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--m));
}
.m-hero__title {
  font-size: calc(42 * var(--m));
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
}
.m-hero__lead {
  font-size: calc(16 * var(--m));
  font-weight: 400;
  line-height: 1.5;
  color: rgba(237, 230, 218, 0.9);
  display: flex;
  flex-direction: column;
  gap: calc(24 * var(--m));             /* пустая строка между абзацами, как в макете */
}

/* ---------- Видео / фото: A сверху, B снизу ---------- */
.m-media__half {
  left: 0;
  right: 0;
  overflow: hidden;
  background: #000;
}
.m-media__half--a { top: 0;   height: 50%; }
.m-media__half--b { top: 50%; bottom: 0; background: #000; }

.m-video,
.m-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ---------- Эпизод главы ----------
   .m-ep = два экрана: кадр с видео (прилипает к верху) + панель текста,
   которая при свайпе наезжает на него снизу. */
.m-ep { position: relative; }

.m-slide.m-ep__stage {
  position: sticky;                      /* кадр с видео стоит на месте, текст наезжает на него */
  top: 0;
  z-index: 0;
}

.m-glass.is-fading,
.m-glass.is-hidden { opacity: 0; }
.m-topbar .m-glass.is-hidden { transition: opacity .3s ease; }

/* панель текста: наезжает на видео и размывает их под собой */
.m-slide.m-ep__panel {
  z-index: 2;
  background: rgba(14, 13, 12, 0.62);
  -webkit-backdrop-filter: blur(calc(16 * var(--m)));
          backdrop-filter: blur(calc(16 * var(--m)));
}

/* ---------- Текст главы ----------
   Слайд всегда ровно в экран. Если текст длиннее — он прокручивается
   внутри, а когда дочитан, следующий свайп листает ленту дальше. */
.m-text__body {
  flex: 1 1 0 !important;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: auto;              /* дочитали — свайп переходит к ленте */
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--m));
  padding: calc(24 * var(--m)) 0 calc(8 * var(--m));
}
.m-text__body::-webkit-scrollbar { display: none; }
.m-text__body > * { flex: none; }
/* если текст не влезает — мягко растворяем край, чтобы было видно, что есть продолжение */
.m-text__body.is-scrollable {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40 * var(--m)), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 40 * var(--m)), transparent);
}
.m-text__body.is-scrollable.is-end { -webkit-mask-image: none; mask-image: none; }
.m-kicker,
.m-label,
.m-fact {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.m-kicker { color: rgba(237, 230, 218, 0.75); }
.m-label  { color: rgba(237, 230, 218, 0.55); }
.m-text__title {
  font-size: calc(32 * var(--m));
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
}
.m-p {
  font-size: calc(15 * var(--m));
  font-weight: 400;
  line-height: 1.56;
  color: rgba(237, 230, 218, 0.9);
}
.m-p.is-strong { font-weight: 500; }
.m-p + .m-p { margin-top: calc(11.4 * var(--m)); }   /* + gap 12 = пустая строка между абзацами */
.m-p { white-space: pre-line; }
.m-fact {
  display: flex;
  gap: calc(12 * var(--m));
  color: var(--cream);
}
.m-fact__label { color: rgba(237, 230, 218, 0.6); white-space: nowrap; }

/* ---------- Невысокое окошко (~420px) ----------
   Фичер-шапка на сайте журнала: подводка на главной не влезает — она листается
   (как текст в главах: сначала дочитываем, потом свайп ведёт к «Лотосовой ножке»).
   Короткий экран вне фичера (телефон боком): как раньше — первый абзац, обрезанный. */
@container (max-height: 600px) {
  html:not([data-mode="embed"]) .m-hero__lead p + p { display: none; }
  html:not([data-mode="embed"]) .m-hero__lead p {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  html[data-mode="embed"] .m-hero__content {
    flex: 0 1 auto;
    min-height: 0;
  }
  html[data-mode="embed"] .m-hero__lead {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-width: none;
    padding-right: calc(8 * var(--m));   /* место под полосу прокрутки */
  }
  html[data-mode="embed"] .m-hero__lead::-webkit-scrollbar { display: none; }
}

/* ---------- Истории героинь: фото на весь экран + имя над текстом ---------- */
.m-media__full { top: 0; bottom: 0; }
/* кадр видео / фото: на лендинге — --pos, в фичере-шапке — --fpos (если задан) */
.m-video { object-position: var(--pos, center); }
.m-img   { background-position: var(--pos, center); }
html[data-mode="embed"] .m-video { object-position: var(--fpos, var(--pos, center)); }
html[data-mode="embed"] .m-img   { background-position: var(--fpos, var(--pos, center)); }

/* видео поверх своего первого кадра (картинка-подложка); оба слоя — ровно по рамке */
.m-media__half .m-video__still,
.m-media__half .m-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.m-media__half.is-playing .m-video__still { visibility: hidden; }
.m-story__title {
  font-size: calc(38 * var(--m));
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-align: left;                 /* по левому краю, как заголовки силуэтов */
  color: var(--cream);
}

/* полоса прокрутки длинного текста (макет: 2px у правого края) */
.m-slide > .m-scroll {
  position: absolute;
  z-index: 2;
  right: calc(6 * var(--m));
  width: max(1px, calc(2 * var(--m)));
  border-radius: 1px;
  background: rgba(237, 230, 218, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.m-scroll.is-on { opacity: 1; }
.m-scroll i {
  position: absolute;
  left: 0; right: 0; top: 0;
  border-radius: inherit;
  background: rgba(237, 230, 218, 0.8);
}

/* ---------- Кредитсы «Над проектом работали» (мобильный лендинг) ---------- */
.m-credits {
  display: flex;
  flex-direction: column;
  gap: calc(32 * var(--m));
  padding: calc(40 * var(--m)) calc(16 * var(--m)) calc(42 * var(--m));
  background: #EDE6DA;
  color: #0E0D0C;
}
html[data-mode="embed"] .m-credits { display: none; }    /* в фичере-шапке — без кредитсов */
.m-credits__title {
  margin: 0;
  font-size: calc(20 * var(--m));
  font-weight: 500;
  line-height: calc(24 * var(--m));
  text-transform: uppercase;
}
.m-credits__list {
  display: flex;
  flex-direction: column;
  gap: calc(20 * var(--m));
}
.m-credit {
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--m));
}
.m-credit__role {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(16 * var(--m));
  text-transform: uppercase;
  color: rgba(14, 13, 12, 0.5);
}
.m-credit__name {
  font-size: calc(16 * var(--m));
  font-weight: 500;
  line-height: calc(20 * var(--m));
  text-transform: uppercase;
}

/* ---------- Меню: шторка сверху ---------- */
.m-menu {
  position: absolute;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  transition: visibility 0s linear .45s;
}
.m-menu.is-open {
  visibility: visible;
  transition: visibility 0s;
}
.m-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.55);
  -webkit-backdrop-filter: blur(calc(6 * var(--m)));
          backdrop-filter: blur(calc(6 * var(--m)));
  opacity: 0;
  transition: opacity .35s ease;
}
.m-menu.is-open .m-menu__backdrop { opacity: 1; }

.m-menu__sheet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-height: calc(100% - 24 * var(--m));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--m));
  padding: calc(12 * var(--m)) calc(16 * var(--m)) calc(20 * var(--m));
  border-radius: 0 0 calc(24 * var(--m)) calc(24 * var(--m));
  background: rgba(23, 22, 20, 0.97);
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.m-menu.is-open .m-menu__sheet { transform: none; }

.m-menu__head {
  flex: none;
  height: calc(44 * var(--m));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-menu__title {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.6);
}
.m-close {
  width:  calc(44 * var(--m));
  height: calc(44 * var(--m));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--mline) solid rgba(237, 230, 218, 0.25);
  background: rgba(14, 13, 12, 0.6);
  font-size: calc(16 * var(--m));
  font-weight: 500;
  line-height: 1;
  color: var(--cream);
}

.m-menu__list {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--m));
}
.m-group {
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--m));
}
.m-group__label {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 218, 0.5);
}

.m-row {
  width: 100%;
  height: calc(62 * var(--m));
  display: flex;
  align-items: center;
  gap: calc(12 * var(--m));
  text-align: left;
}
.m-thumb {
  position: relative;
  flex: none;
  width:  calc(49.6 * var(--m));
  height: calc(62 * var(--m));
  border-radius: calc(4.96 * var(--m));
  background: #2a2724 center / cover no-repeat;
  background-clip: padding-box;
  overflow: hidden;
}
.m-thumb {                                   /* затемнение неактивных — фильтром, без отдельного слоя:
                                                слой съезжал на долю пикселя и давал полосу справа */
  filter: brightness(0.58);
}
.m-thumb.is-empty { background: #5C574F; filter: none; }

.m-row__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(2 * var(--m));
}
.m-row__num {
  font-size: calc(11 * var(--m));
  font-weight: 500;
  line-height: calc(14 * var(--m));
  letter-spacing: 0.08em;
  color: rgba(237, 230, 218, 0.55);
}
.m-row__title {
  font-size: calc(16 * var(--m));
  font-weight: 500;
  line-height: calc(20 * var(--m));
  color: rgba(237, 230, 218, 0.85);
}

/* текущая глава */
.m-row.is-active .m-thumb {
  border: max(1px, calc(1.86 * var(--m))) solid var(--cream);
}
.m-row.is-active .m-thumb { filter: none; }
.m-row.is-active .m-row__num,
.m-row.is-active .m-row__title { color: var(--cream); }
.m-row.is-active .m-row__num::before { content: '• '; }

@media (prefers-reduced-motion: reduce) {
  .m-hint__line, .m-arrow { animation: none; }
  .m-menu, .m-menu__sheet, .m-menu__backdrop { transition: none; }
}


/* =========================================================
   ИСТОРИИ: «Назад», звук (макет «История 05–07»)
   ========================================================= */

/* «← Назад» на нижней панели — вместо счётчика слева */
.back-btn { display: none; }
.chapter--backbtn .bar__left { display: none; }
.chapter--backbtn .back-btn {
  justify-self: start;
  height: calc(48 * var(--px));
  padding: 0 calc(24 * var(--px)) 0 calc(18 * var(--px));
  display: flex;
  align-items: center;
  gap: calc(9 * var(--px));
  border-radius: 999px;
  border: var(--line) solid rgba(237, 230, 218, 0.2);
  background: rgba(61, 55, 49, 0.88);
  -webkit-backdrop-filter: blur(calc(7.5 * var(--px)));
          backdrop-filter: blur(calc(7.5 * var(--px)));
  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  transition: background .25s ease;
}
.chapter--backbtn .back-btn:hover { background: rgba(40, 36, 32, 0.95); }
.back-btn svg {
  width:  calc(18 * var(--px));
  height: calc(18 * var(--px));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* счётчик «История 01 / 03» по центру — без лишнего трекинга, как в макете */
.chapter--backbtn .bar__center { font-size: calc(15 * var(--px)); }

/* кнопка «В начало ↺» — светлый текст на тёмной пилюле */
.chapter--light .pill { color: #E8DECC; }

/* Кнопка звука: 64px в макете 1920 → 48, слева от «Карты силуэтов» */
.sound-btn {
  position: absolute;
  z-index: 5;
  top:   calc(32 * var(--px));
  right: calc(270 * var(--px));       /* слева от «Карты силуэтов» */
  width:  calc(48 * var(--px));
  height: calc(48 * var(--px));
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--line) solid rgba(237, 230, 218, 0.2);
  background: rgba(14, 13, 12, 0.88);
  -webkit-backdrop-filter: blur(calc(7.5 * var(--px)));
          backdrop-filter: blur(calc(7.5 * var(--px)));
  color: var(--cream);
  transition: background .25s ease, opacity .3s ease, right .3s ease;
}
.sound-btn:hover { background: rgba(14, 13, 12, 1); }
.stage[data-screen="chapter"] .sound-btn,
.stage:has(.menu.is-open) .sound-btn { display: flex; }
.stage:has(.menu.is-open) .sound-btn { z-index: 15; right: calc(192 * var(--px)); }   /* в меню — слева от «Закрыть» */
.sound-btn svg {
  width:  calc(18 * var(--px));
  height: calc(18 * var(--px));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound-btn__on { display: none; }
.sound-btn.is-on .sound-btn__on  { display: block; }
.sound-btn.is-on .sound-btn__off { display: none; }
.stage.has-cursor .sound-btn { cursor: none; }

/* Плашки над половинами: видны 3 с при входе, затем гаснут (300 мс);
   при наведении на половину её плашка появляется снова */
.chapter__tag {
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.chapter__tag.is-shown { opacity: 1; }

/* =========================================================
   Листание глав колесом / тачпадом — только в лендинге.
   Тянем вниз — экран с «натяжкой» уезжает влево, справа проступает блюр
   с названием следующей главы; дотянули — перелистывается. Вверх — наоборот.
   ========================================================= */
.chapter__half,
.chapter__divider,
.chapter__tag {
  translate: var(--pull, 0px) 0;
}
.chapter__half { transition: opacity .35s ease, translate .6s cubic-bezier(.3, 1.45, .45, 1); }
.chapter__tag  { transition: opacity .3s ease,  translate .6s cubic-bezier(.3, 1.45, .45, 1); }

.chapter.is-pulling .chapter__half,
.chapter.is-pulling .chapter__tag { transition: opacity .35s ease; }   /* сдвиг ведёт пружина в script.js */

/* уход: дотягиваем и гасим */
.chapter.is-flip-out .chapter__half,
.chapter.is-flip-out .chapter__tag {
  opacity: 0;
  transition: opacity .42s cubic-bezier(.4, 0, .2, 1), translate .42s cubic-bezier(.4, 0, .6, 1);
}
/* новая глава встаёт с другой стороны без анимации… */
.chapter.is-flip-set .chapter__half,
.chapter.is-flip-set .chapter__tag { opacity: 0; transition: none; }
/* …и мягко въезжает на место */
.chapter.is-flip-in .chapter__half,
.chapter.is-flip-in .chapter__tag { transition: opacity .7s cubic-bezier(.25, .1, .25, 1), translate .9s cubic-bezier(.16, 1, .3, 1); }

.chapter__peek {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(14, 13, 12, 0.28);
  -webkit-backdrop-filter: blur(calc(18 * var(--px)));
  backdrop-filter: blur(calc(18 * var(--px)));
  transition: width .6s cubic-bezier(.3, 1.45, .45, 1), opacity .45s ease;
}
.chapter__peek--next { right: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 45%); mask-image: linear-gradient(to right, transparent, #000 45%); }
.chapter__peek--prev { left: 0;  -webkit-mask-image: linear-gradient(to left,  transparent, #000 45%); mask-image: linear-gradient(to left,  transparent, #000 45%); }
.chapter.is-pulling .chapter__peek { transition: none; }
.chapter.is-flip-out .chapter__peek { transition: width .42s cubic-bezier(.4, 0, .6, 1), opacity .42s ease; }

.chapter__peek-label {
  position: absolute;
  top: 46%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: calc(10.5 * var(--px));
  font-weight: 500;
  line-height: calc(15 * var(--px));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: var(--label-o, 0);
}
.chapter.is-flip-out .chapter__peek-label { transition: opacity .2s ease; }
.chapter__peek--next .chapter__peek-label { right: calc(32 * var(--px)); text-align: right; }
.chapter__peek--prev .chapter__peek-label { left:  calc(32 * var(--px)); }
.chapter__peek-label small {
  display: block;
  margin-bottom: calc(6 * var(--px));
  font-size: inherit;
  color: rgba(237, 230, 218, 0.6);
}
@media (prefers-reduced-motion: reduce) {
  .chapter__half, .chapter__tag, .chapter__peek { transition: none !important; }
}


/* =========================================================
   КРЕДИТСЫ «Над проектом работали» — лендинг на компьютере
   Лежат сразу под экраном; на последней истории прокрутка вниз
   сдвигает весь спецпроект вверх на их высоту. Макет: 1920 × 306.
   ========================================================= */
.credits { display: none; }
html[data-mode="landing"] .credits {
  --px: min(100vw / 1440, 100dvh / 810);         /* тот же масштаб, что у экрана */
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(261 * var(--px));                   /* 348 в макете 1920 */
  background: #EDE6DA;
  color: #0E0D0C;
  font-family: 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-mode="landing"] .sp {
  position: relative;
  transition: transform .8s cubic-bezier(.65, 0, .35, 1);
}
html[data-mode="landing"].is-credits .sp {
  transform: translateY(calc(-261 * min(100vw / 1440, 100dvh / 810)));
}
.credits__inner {
  height: 100%;
  padding: calc(45 * var(--px)) calc(39 * var(--px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(16.5 * var(--px));
}
.credits__title {
  width: 100%;
  max-width: calc(1291.5 * var(--px));
  margin: 0;
  font-size: calc(21.75 * var(--px));
  font-weight: 500;
  line-height: calc(27 * var(--px));
  text-transform: uppercase;
}
.credits__table {
  width: 100%;
  max-width: calc(1291.5 * var(--px));
  display: flex;
  justify-content: space-between;
  gap: calc(90 * var(--px));
}
.credits__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}
.credits__row {
  display: flex;
  align-items: flex-start;
  gap: calc(24 * var(--px));
  padding: calc(6.75 * var(--px)) 0;
  border-bottom: max(1px, calc(0.75 * var(--px))) solid rgba(0, 0, 0, 0.12);
}
.credits__row:nth-child(n + 3) { border-bottom: 0; }   /* по макету линии — только под первыми двумя строками */
.credits__role {
  flex: none;
  width: calc(210 * var(--px));
  font-size: calc(9 * var(--px));
  font-weight: 500;
  line-height: calc(18 * var(--px));
  text-transform: uppercase;
  color: rgba(14, 13, 12, 0.5);
}
.credits__name {
  flex: 1 1 auto;
  font-size: calc(15 * var(--px));
  font-weight: 500;
  line-height: calc(18 * var(--px));
  text-transform: uppercase;
  color: #0E0D0C;
}
@media (max-width: 767px) { html[data-mode="landing"] .credits { display: none; } }
html.is-credits .cursor { opacity: 0 !important; }      /* кружок-курсор не висит над кредитсами */
