/*
  Прототип колоды «Сокол Сервиса» · claude-01
  ------------------------------------------------------------
  Три режима, все — чистым CSS, без вычислений в скрипте:

  1. Без JS (нет класса .js)         — обычная лента карточек, страница прокручивается.
  2. .js, телефон                     — экран на весь вьюпорт, колода-стопка.
  3. .js, «рамка» (широко и высоко)   — тот же экран внутри нарисованного телефона на столе.

  Ключевой приём: экран (.screen) — size-контейнер. Всё внутри подстраивается
  по @container screen / card, а не по @media. Поэтому мобильный сайт ведёт себя
  одинаково и на телефоне, и внутри рамки — режим меняет только размер контейнера.
*/

@font-face {
  font-family: "Inter";
  src: url("assets/inter-variable-4.1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

:root {
  /* Палитра из docs/design-system.md */
  --forest: #0a321e;
  --forest-2: #14472c;
  --paper: #f6f3ec;
  --sand: #c8a06e;
  --ink: #152b22;
  --muted: #506157;

  --card: #fffdf8;
  --tile: #f2ede3;
  --line: rgba(10, 50, 30, 0.12);
  --desk: #e9e3d6;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-card: 420ms;

  --radius-card: 24px;
  --radius-tile: 16px;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
}

body { margin: 0; min-width: 320px; }

h1, h2, p, ul, figure, blockquote { margin: 0; }
h1, h2 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 1000;
  padding: 8px 14px; border-radius: 999px;
  background: var(--forest); color: var(--paper); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ============================================================
   Общие элементы экрана (во всех режимах)
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  margin-right: auto;
  font-weight: 750; font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none; color: var(--forest);
}
.brand__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--forest); color: var(--paper);
  font-size: 15px; font-weight: 750;
}

.counter { display: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.menu-button {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--forest);
  font-size: 14px; font-weight: 600; text-decoration: none;
  touch-action: manipulation;
}

.cta { padding: 12px 16px 8px; }

.button {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 0 24px;
  border-radius: 999px;
  background: var(--forest); color: var(--paper);
  font-size: 16px; font-weight: 680; text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(10, 50, 30, 0.6);
  touch-action: manipulation;
}
.button:active { transform: translateY(1px); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  padding: 4px 16px 12px;
  color: var(--muted); font-size: 12px; line-height: 16px;
}

/* ---------- Карточка и бенто ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow:
    0 1px 2px rgba(10, 50, 30, 0.06),
    0 10px 30px -10px rgba(10, 50, 30, 0.22);
}

.bento {
  display: flex; flex-direction: column; gap: 10px;
  height: 100%;
  min-width: 0;
  padding: 20px;
}

/* Длинные слова переносятся, а не распирают карточку */
.card, .menu, .footer, .topbar { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.brand__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { min-width: 0; }

.tile {
  min-width: 0; min-height: 0;
  padding: 14px 16px;
  border-radius: var(--radius-tile);
  background: var(--tile);
}

.eyebrow { color: var(--sand); font-size: 12px; font-weight: 650; line-height: 16px; }
.eyebrow--light { color: #e4c99f; }

.title-xl { color: var(--forest); font-size: 40px; font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; }
.title-l  { color: var(--forest); font-size: 30px; font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
.title-m  { color: var(--forest); font-size: 22px; font-weight: 650; line-height: 1.15; letter-spacing: -0.015em; }

.lead { font-size: 18px; line-height: 1.4; }
.body { font-size: 15px; line-height: 1.45; }
.body--light { color: #dfe8e1; }
.caption { color: var(--muted); font-size: 13px; line-height: 1.35; }
.hint { color: var(--muted); font-size: 13px; }

.checklist { display: grid; gap: 8px; padding: 0; list-style: none; font-size: 16px; line-height: 1.35; }
.checklist li {
  position: relative; padding: 10px 12px 10px 40px;
  border-radius: 12px; background: var(--tile);
}
.checklist li::before {
  content: ""; position: absolute; left: 14px; top: 50%;
  width: 14px; height: 8px; margin-top: -6px;
  border-left: 2.5px solid var(--forest); border-bottom: 2.5px solid var(--forest);
  transform: rotate(-45deg);
}

.figure { display: flex; align-items: baseline; gap: 8px; }
.figure__value { font-size: 88px; font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.figure__unit { font-size: 18px; font-weight: 600; }
.figure--s .figure__value { font-size: 40px; }
.figure--s .figure__unit { font-size: 14px; }

.step { display: block; margin-bottom: 6px; color: var(--sand); font-size: 13px; font-weight: 700; }

.price { display: flex; flex-direction: column; gap: 2px; }
.price__value { color: var(--forest); font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.price__period { color: var(--muted); font-size: 16px; }

.quote blockquote p { color: var(--forest); font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.quote blockquote p::before { content: "«"; }
.quote blockquote p::after { content: "»"; }
.quote figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; }

.ghost-button {
  align-self: flex-start;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--forest);
  font-size: 14px; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
}

/* ---------- Раскладки бенто ---------- */

.card--cover .bento { justify-content: flex-start; }
.card--cover .title-xl { margin-top: auto; }

.bento--photo { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.tile--photo { padding: 0; overflow: hidden; }
.tile--photo img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.tile--text { display: grid; gap: 6px; }

.bento--numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1.5fr) minmax(0, 1fr);
}
.tile--accent {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--forest); color: var(--paper);
}
.tile--accent .figure { margin-top: auto; }
.bento--numbers .tile:not(.tile--accent) { display: flex; flex-direction: column; justify-content: space-between; }

.bento--steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
}
.bento--steps .tile--wide { grid-column: 1 / -1; }
.bento--steps .tile:not(:first-child) { display: flex; flex-direction: column; justify-content: flex-end; }

.bento--quote .quotes { flex: 1; display: flex; align-items: center; }

.bento--price .price { margin-top: auto; }

/* ---------- Меню ---------- */

.menu { padding: 16px; }
.menu__head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.menu__title { color: var(--muted); font-size: 13px; font-weight: 600; }
.menu__close { display: none; }

.menu__tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 12px 0; padding: 0; list-style: none;
}
.menu__tiles a {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  height: 100%; min-height: 88px; padding: 14px 16px;
  border-radius: 20px; background: var(--card);
  box-shadow: 0 1px 2px rgba(10, 50, 30, 0.06), 0 6px 18px -10px rgba(10, 50, 30, 0.25);
  color: var(--forest); font-size: 20px; font-weight: 650; line-height: 1.1;
  text-decoration: none;
  touch-action: manipulation;
}
.menu__tiles a[aria-current="true"] { background: var(--forest); color: var(--paper); }
.menu__tiles a[aria-current="true"] .menu__num { color: #e4c99f; }
.menu__num { color: var(--sand); font-size: 12px; font-weight: 700; }
.menu__tile--wide { grid-column: 1 / -1; }
.menu__foot { color: var(--muted); font-size: 12px; text-align: center; }

/* Тизер существует только в режиме колоды */
.teaser { display: none; }

/* Декор стола и стрелки — только в режиме рамки */
.troubles, .desk-arrow { display: none; }

/* ============================================================
   Режим 1. Без JS — лента
   ============================================================ */

html:not(.js) .screen { max-width: 560px; margin: 0 auto; }
html:not(.js) .deck { display: grid; gap: 16px; padding: 8px 16px 16px; }
html:not(.js) .card { container: card / inline-size; scroll-margin-top: 16px; }
html:not(.js) .bento { min-height: 420px; }
html:not(.js) .card--cover .bento { min-height: 480px; }
html:not(.js) .bento--photo { grid-template-rows: 260px auto; }
html:not(.js) .bento--numbers { grid-template-rows: 220px 140px; }
html:not(.js) .cta { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); }
html:not(.js) .menu { border-top: 1px solid var(--line); }

/* ============================================================
   Режим 2. JS, телефон — экран на весь вьюпорт, стопка
   ============================================================ */

.js,
.js body {
  height: 100%;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
}

.js .screen {
  container: screen / size;
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  /* minmax(0, 1fr): длинное неразрывное слово не может раздвинуть экран шире окна */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  overflow: hidden;
  overflow: clip;
  background: var(--paper);
  isolation: isolate;
}

/* Колонка экрана не шире 560 px — на горизонтальном телефоне и в узком окне десктопа */
.js .topbar,
.js .deck,
.js .cta,
.js .footer { width: min(100%, 560px); }

.js .counter { display: inline; }

.js .deck {
  position: relative;
  min-height: 0;
  /* Не обрезаем: улетающая карточка уходит за край экрана, а не обрывается о край колоды.
     Обрезает сам экран (.screen), он же не даёт якорю прокрутить страницу. */
  /* Нижнее поле — место для краёв стопки */
  --deck-pad-x: 16px;
  --deck-pad-top: 2px;
  --deck-pad-bottom: 20px;
}

.js .card {
  container: card / size;
  position: absolute;
  inset: var(--deck-pad-top) var(--deck-pad-x) var(--deck-pad-bottom);
  overflow: hidden;
  transform-origin: 50% 100%;
  touch-action: none;           /* жест забираем только на карточке */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  will-change: transform;
  transition:
    transform var(--t-card) var(--ease),
    opacity 240ms ease,
    visibility 0s linear 0s;
}

/* Затемнение карточек под верхней — глубина стопки */
.js .card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--ink); opacity: 0; pointer-events: none;
  transition: opacity 240ms ease;
}

.js .card[data-pos="top"]   { z-index: 50; transform: none; }
.js .card[data-pos="next1"] { z-index: 40; transform: translateY(8px) scale(0.955); }
.js .card[data-pos="next2"] { z-index: 30; transform: translateY(16px) scale(0.91); }
.js .card[data-pos="rest"]  { z-index: 10; transform: translateY(16px) scale(0.91); opacity: 0; }
.js .card[data-pos="next1"]::after { opacity: 0.03; }
.js .card[data-pos="next2"]::after { opacity: 0.06; }

/* Улетевшие карточки лежат за левым краем экрана, выше стопки — чтобы вернуться поверх */
.js .card[data-pos="prev"] {
  z-index: 60;
  transform: translateX(calc(-100% - 64px)) rotate(-8deg);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform var(--t-card) var(--ease),
    opacity 240ms ease,
    visibility 0s linear var(--t-card);
}

.js .card.is-dragged { transition: none; cursor: grabbing; }
.js .deck.is-instant .card,
.js .deck.is-instant .card::after { transition: none !important; }

/* ---------- Тизер на столе ---------- */

.js .teaser {
  /* Карточка уезжает влево — тизер лежит в правой половине стола, которая открывается */
  display: grid;
  place-items: center end;
  position: absolute;
  inset: var(--deck-pad-top) var(--deck-pad-x) var(--deck-pad-bottom);
  z-index: 0;
  padding: 24px 8px 24px 52%;
  overflow: hidden;   /* тизер никогда не выглядывает из-под карточки */
  text-align: right;
  font-size: clamp(20px, 7cqw, 40px);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
  /* «Продавлено» в поверхности: цвет фона + свет снизу и тень сверху */
  color: #ece6da;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 -1px 0 rgba(21, 43, 34, 0.2);
  opacity: 0;
  transition: opacity 200ms ease;
}
.js .deck[data-at-end] .teaser { opacity: 1; }

/* ---------- Меню на весь экран ---------- */

.js .menu {
  position: absolute; inset: 0; z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 8px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + 16px)
    calc(env(safe-area-inset-left, 0px) + 16px);
  background: var(--paper);
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 260ms var(--ease-out), visibility 0s linear 260ms;
}
.js .screen.is-menu-open .menu {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 200ms ease, transform 260ms var(--ease-out), visibility 0s;
}
.js .menu__head,
.js .menu__tiles,
.js .menu__foot { width: min(100%, 528px); justify-self: center; }
.js .menu__tiles { grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
.js .menu__tiles a { min-height: 0; }
.js .menu__close {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-right: -6px;
  border-radius: 50%; color: var(--forest);
}
.js .menu__close svg,
.desk-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Подстройка под размер экрана — контейнерные запросы
   Одинаково работают на телефоне и в рамке.
   ============================================================ */

/* Невысокий экран: компактнее шапка, кнопка, подвал уходит в меню */
@container screen (max-height: 560px) {
  .topbar { min-height: 48px; padding-block: 4px; }
  .cta { padding-top: 8px; padding-bottom: 8px; }
  .button { min-height: 46px; }
  .footer { display: none; }
}
@container screen (max-height: 420px) {
  .topbar { min-height: 44px; padding-block: 2px; }
  .brand__mark { width: 28px; height: 28px; font-size: 13px; }
  .button { min-height: 42px; font-size: 15px; }
  .cta { padding-top: 6px; padding-bottom: 6px; }
  .js .deck { --deck-pad-bottom: 14px; }
  .js .card[data-pos="next1"] { transform: translateY(6px) scale(0.97); }
  .js .card[data-pos="next2"],
  .js .card[data-pos="rest"]  { transform: translateY(12px) scale(0.94); }
  .menu__tiles a { padding: 10px 14px; font-size: 16px; border-radius: 16px; }
  .menu__tiles { gap: 8px; grid-template-columns: repeat(3, 1fr); margin: 8px 0; }
  .menu__tile--wide { grid-column: auto; }
}

/* Карточка: типографика от её ширины, второстепенное уходит по высоте */
@container card (min-width: 360px) {
  .bento { padding: 24px; gap: 12px; }
  .title-xl { font-size: 46px; }
  .title-l { font-size: 34px; }
  .figure__value { font-size: 104px; }
  .price__value { font-size: 52px; }
  .quote blockquote p { font-size: 27px; }
}
@container card (max-height: 460px) {
  .p3 { display: none !important; }
  .title-xl { font-size: 36px; }
  .figure__value { font-size: 72px; }
  .quote blockquote p { font-size: 22px; }
}
@container card (max-height: 360px) {
  .p2 { display: none !important; }
  /* «0 звонков» ушла — оставшаяся маленькая плитка занимает всю ширину */
  .bento--numbers .tile:not(.tile--accent):not(.p2) { grid-column: 1 / -1; }
  .bento { padding: 16px; gap: 8px; }
  .title-xl { font-size: 32px; }
  .title-l { font-size: 26px; }
  .title-m { font-size: 20px; }
  .lead { font-size: 16px; }
  .figure__value { font-size: 60px; }
  .figure--s .figure__value { font-size: 32px; }
  .price__value { font-size: 40px; }
  .checklist { gap: 6px; font-size: 15px; }
  .checklist li { padding-block: 7px; }
  .tile { padding: 10px 12px; }
}
@container card (max-height: 340px) {
  .eyebrow { display: none; }
  .title-xl { font-size: 28px; }
  .title-l { font-size: 22px; }
  .title-m { font-size: 18px; }
  .figure__value { font-size: 48px; }
  .figure--s .figure__value { font-size: 26px; }
  .quote blockquote p { font-size: 19px; }
  .quote figcaption { margin-top: 6px; }
  .checklist { font-size: 14px; }
  .checklist li { padding: 5px 10px 5px 34px; }
  .checklist li::before { left: 11px; }
}
/* Узкая карточка (телефон 320 px): плитки плотнее, чтобы слова не переносились */
@container card (max-width: 320px) {
  .bento { padding: 16px; }
  .tile { padding: 12px; }
  .bento--steps .body { font-size: 14px; }
}

/* Широкая и низкая карточка (горизонтальный телефон): плитки в ряд */
@container card (max-height: 300px) and (min-width: 440px) {
  .bento--photo { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .bento--numbers { grid-template-columns: 1.4fr 1fr; grid-template-rows: minmax(0, 1fr); } /* p2-плитка здесь уже скрыта */
  .bento--numbers .tile--accent { grid-column: auto; }
  .bento--numbers .tile:not(.tile--accent):not(.p2) { grid-column: auto; }
  .bento--steps { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .bento--steps .tile--wide:last-child { grid-column: auto; }
}

/* ============================================================
   Режим 3. Рамка телефона на столе — широко И высоко
   Низкое широкое окно остаётся в режиме телефона.
   ============================================================ */

@media (min-width: 720px) and (min-height: 640px) {
  .js body { background: var(--desk); }

  .js .desk {
    --bezel: 12px;
    --screen-h: min(calc(100vh - 72px), 860px);
    --screen-w: clamp(320px, calc(var(--screen-h) * 0.5), 400px);
    --side: calc((100vw - var(--screen-w) - 2 * var(--bezel)) / 2);
    position: fixed; inset: 0;
    overflow: hidden;
    overflow: clip;
    background:
      radial-gradient(120% 90% at 50% 45%, #f1ece2 0%, var(--desk) 60%, #e2dbcc 100%);
  }
  @supports (height: 100dvh) {
    .js .desk { --screen-h: min(calc(100dvh - 72px), 860px); }
  }

  .js .device {
    position: absolute; inset: 0; margin: auto;
    width: calc(var(--screen-w) + 2 * var(--bezel));
    height: calc(var(--screen-h) + 2 * var(--bezel));
    padding: var(--bezel);
    border-radius: calc(38px + var(--bezel));
    background: var(--ink);
    box-shadow:
      inset 0 0 0 1.5px rgba(255, 255, 255, 0.08),
      0 2px 4px rgba(21, 43, 34, 0.2),
      0 24px 50px -18px rgba(21, 43, 34, 0.5),
      0 50px 90px -40px rgba(21, 43, 34, 0.35);
    z-index: 5;
  }

  /* Внутри рамки экран — не fixed, а заполняет корпус */
  .js .screen {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 38px;
  }

  .js .menu { border-radius: inherit; padding: 8px 16px 16px; }

  /* Стрелки по бокам рамки */
  .js .desk-arrow {
    display: grid; place-items: center;
    position: absolute; top: 50%; z-index: 6;
    width: 52px; height: 52px; margin-top: -26px;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--card); color: var(--forest);
    box-shadow: 0 4px 14px -6px rgba(21, 43, 34, 0.35);
    cursor: pointer;
    transition: opacity 160ms ease, transform 160ms ease;
  }
  .js .desk-arrow:hover { transform: scale(1.06); }
  .js .desk-arrow[aria-disabled="true"] { opacity: 0.35; cursor: default; transform: none; }
  .js .desk-arrow--prev { left: max(16px, calc(var(--side) - 84px)); }
  .js .desk-arrow--next { right: max(16px, calc(var(--side) - 84px)); }

  /* ---------- Слова-«беды» ---------- */

  .js .troubles {
    display: block;
    position: absolute; inset: 0; z-index: 1;
    margin: 0; padding: 0; list-style: none;
    pointer-events: none;
    user-select: none;
  }
  .js .troubles li {
    /* Каждое слово живёт в полосе стола сбоку от телефона и переносится внутри неё,
       поэтому не вылезает за край окна ни на 720 px, ни на 1920 px.
       --ta двигает слово внутри полосы, --fy — по высоте, --r — наклон, --s — размер. */
    --ta: center; --fy: 50; --r: 0deg; --s: 1; --c: var(--muted);
    --top: calc(var(--fy) * 1vh);
    position: absolute;
    left: var(--left);
    top: var(--top);
    width: calc(var(--side) - 32px);
    color: var(--c);
    font-size: clamp(14px, calc(var(--side) / 8 * var(--s)), calc(40px * var(--s)));
    font-weight: 650;
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-align: var(--ta);
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
    transform: translate(-50%, -50%) rotate(var(--r));
    opacity: 0.9;
  }
  /* Нечётные — слева от телефона, чётные — справа; --left — центр полосы */
  .js .troubles li:nth-child(odd)  { --left: calc(var(--side) / 2); }
  .js .troubles li:nth-child(even) { --left: calc(100vw - var(--side) / 2); }

  .js .troubles li:nth-child(1)  { --ta: right;  --fy: 11; --r: -8deg;  --s: 1.25; --c: var(--forest); }
  .js .troubles li:nth-child(2)  { --ta: left;   --fy: 10; --r: 7deg;   --s: 1.2;  }
  .js .troubles li:nth-child(3)  { --ta: left;   --fy: 26; --r: 5deg;   --s: 1.05; --c: #8a7a62; }
  .js .troubles li:nth-child(4)  { --ta: center; --fy: 25; --r: -10deg; --s: 1.35; --c: var(--forest); }
  .js .troubles li:nth-child(5)  { --ta: center; --fy: 40; --r: -4deg;  --s: 1.15; }
  .js .troubles li:nth-child(6)  { --ta: right;  --fy: 41; --r: 9deg;   --s: 1.2;  --c: #8a7a62; }
  .js .troubles li:nth-child(7)  { --ta: right;  --fy: 55; --r: 6deg;   --s: 1.3;  --c: var(--forest); }
  .js .troubles li:nth-child(8)  { --ta: left;   --fy: 56; --r: -6deg;  --s: 1;    }
  .js .troubles li:nth-child(9)  { --ta: left;   --fy: 71; --r: -11deg; --s: 1.05; --c: #8a7a62; }
  .js .troubles li:nth-child(10) { --ta: center; --fy: 70; --r: 4deg;   --s: .95;  }
  .js .troubles li:nth-child(11) { --ta: center; --fy: 86; --r: 3deg;   --s: 1.1;  }
  .js .troubles li:nth-child(12) { --ta: right;  --fy: 88; --r: -7deg;  --s: 1;    --c: #8a7a62; }
  .js .troubles li:nth-child(13) { --ta: center; --fy: 33; --r: -3deg;  --s: .8;   --c: #9aa39c; }
  .js .troubles li:nth-child(14) { --ta: left;   --fy: 18; --r: 4deg;   --s: .8;   --c: #9aa39c; }
  .js .troubles li:nth-child(15) { --ta: right;  --fy: 63; --r: 10deg;  --s: .9;   --c: #9aa39c; }
  .js .troubles li:nth-child(16) { --ta: right;  --fy: 48; --r: -9deg;  --s: .9;   --c: #9aa39c; }
  .js .troubles li:nth-child(17) { --ta: left;   --fy: 79; --r: -5deg;  --s: .85;  --c: #9aa39c; }
  .js .troubles li:nth-child(18) { --ta: center; --fy: 78; --r: 5deg;   --s: .75;  --c: #9aa39c; }
  .js .troubles li:nth-child(19) { --ta: left;   --fy: 95; --r: 6deg;   --s: .8;   --c: #9aa39c; }
  .js .troubles li:nth-child(20) { --ta: center; --fy: 4;  --r: -4deg;  --s: .8;   --c: #9aa39c; }

  /* ---------- Падение телефона и разлёт слов — один раз ---------- */

  @media (prefers-reduced-motion: no-preference) {
    .js:not(.is-settled) .device {
      animation: device-drop 620ms var(--ease-out) both;
    }
    .js:not(.is-settled) .troubles li {
      animation: trouble-scatter 900ms var(--ease-out) both;
      animation-delay: calc(330ms + var(--s) * 120ms);
    }
  }
}

@keyframes device-drop {
  0%   { transform: translateY(-28px) scale(1.07) rotate(-2.5deg); opacity: 0; }
  55%  { transform: translateY(0) scale(0.985) rotate(0.4deg); opacity: 1; }
  100% { transform: none; }
}

@keyframes trouble-scatter {
  0% {
    opacity: 0;
    transform:
      translate(calc(-50% + 50vw - var(--left)), calc(-50% + 50vh - var(--top)))
      rotate(0deg) scale(0.4);
  }
  100% {
    opacity: 0.9;
    transform: translate(-50%, -50%) rotate(var(--r)) scale(1);
  }
}

/* ============================================================
   Меньше движения
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .js .card,
  .js .card[data-pos="prev"] {
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }
  .js .card[data-pos="top"] { transition: opacity 200ms ease, visibility 0s; }
  .js .card[data-pos="prev"] { transform: none; opacity: 0; }
  .js .card[data-pos="next1"],
  .js .card[data-pos="next2"] { transition: none; }
  .js .menu { transform: none; }
}
