/* Hvatun — лэндинг /hvatun.html. Язык взят из самой игры: шрифт Golos Text лежит
   в её бандле, синий #0088ff — кнопка Start, красный — варежка первого уровня,
   светлый снежный фон один сверху донизу. Разметку собирает _tools/hvatun/page.py,
   поведение — hvatun.js, медиа — hvatun-landing/media (pack.py из съёмки). */

:root {
  --ink: #14222b;
  --ink-2: #4a5963;
  --line: #d7dfe4;
  --snow: #f2f5f7;
  --blue: #0088ff;   /* кнопка Start в игре */
  --red: #b3372b;    /* варежка первого уровня */
  --gutter: clamp(20px, 4vw, 64px);
  --wrap: 1240px;
}
* { box-sizing: border-box; }
html { background: var(--snow); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--snow); color: var(--ink);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
figure { margin: 0; }   /* у figure своё поле слева в 40 px — оно ломает общий левый край */
a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ── шапка ────────────────────────────────────────────────────────────── */
.top { padding: 18px 0; }
.top__in { display: flex; align-items: center; gap: 16px; }
.top__brand { margin-right: auto; }
.music {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 14px 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px; line-height: 1;
}
.music svg { width: 19px; height: 19px; }
.music .music__wave { opacity: .25; }
.music[aria-pressed="true"] { border-color: var(--ink); }
.music[aria-pressed="true"] .music__wave { opacity: 1; animation: wave 1.6s ease-in-out infinite; }
.music[aria-pressed="true"] .music__wave--2 { animation-delay: .25s; }
@keyframes wave { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
@media (max-width: 520px) { .music span { display: none; } .music { padding: 8px 11px; } }
.top__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.top__brand img { border-radius: 7px; }
.top__home { color: var(--ink-2); text-decoration: none; font-size: 16px; }
.top__home:hover { color: var(--ink); }

/* ── общие типы ───────────────────────────────────────────────────────── */
.h1 {
  font-weight: 900; letter-spacing: -.045em; line-height: .86;
  font-size: clamp(46px, 8.9vw, 128px);
  /* боковой пробел литеры K уводил самый крупный текст на 5 px правее общего
     левого края страницы — выбираем его назад, он растёт вместе с кеглем */
  margin: 10px 0 0 -.04em;
}
.h1 em { font-style: normal; color: var(--red); }
.h2 {
  font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  font-size: clamp(30px, 3.9vw, 54px); margin: 0 0 18px; max-width: 18ch;
}
.h3 { font-weight: 700; font-size: 19px; line-height: 1.3; margin: 18px 0 8px; letter-spacing: -.01em; }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; margin: 0 0 26px; }
.lead--ink { color: var(--ink); }
.note { color: var(--ink-2); max-width: 54ch; margin: 14px 0 0; font-size: 16px; }
section { padding: clamp(56px, 8vw, 128px) 0; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px; text-decoration: none;
  font-size: 18px; font-weight: 600; color: #fff; background: var(--blue);
}
.btn:hover { filter: brightness(1.06); }
.btn svg { width: 22px; height: 22px; margin-top: -3px; }
.meta { margin: 14px 0 0; font-size: 16px; color: var(--ink-2); }

/* ── рамка телефона: размеры от ширины колонки (cqw), чтобы радиусы и кнопки
      держали пропорции и на 170 px ──────────────────────────────────────── */
.figure { container-type: inline-size; }
.phone {
  --w: 100cqw; position: relative; width: 100%;
  padding: calc(var(--w) * .028);
  background: #1b1c1f; border-radius: calc(var(--w) * .176);
  box-shadow: 0 0 0 1px #3a3b3f inset, 0 18px 40px -28px rgba(20, 34, 43, .35);
}
.phone::before, .phone::after { content: ""; position: absolute; background: #17181a; }
.phone::before {   /* громкость и кнопка «тише» слева */
  left: calc(var(--w) * -.006); top: calc(var(--w) * .36);
  width: calc(var(--w) * .008); height: calc(var(--w) * .07);
  border-radius: calc(var(--w) * .004) 0 0 calc(var(--w) * .004);
  box-shadow: 0 calc(var(--w) * .115) 0 0 #17181a;
}
.phone::after {    /* боковая кнопка справа */
  right: calc(var(--w) * -.006); top: calc(var(--w) * .52);
  width: calc(var(--w) * .008); height: calc(var(--w) * .2);
  border-radius: 0 calc(var(--w) * .004) calc(var(--w) * .004) 0;
}
.phone__screen {
  position: relative; aspect-ratio: 402 / 874; overflow: hidden; background: #0b1218;
  border-radius: calc(var(--w) * .148);
}
.phone__screen > img, .phone__screen > video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── герой ────────────────────────────────────────────────────────────── */
.hero { padding-top: clamp(8px, 1vw, 24px); padding-bottom: clamp(48px, 6vw, 96px); }
/* Кадр стоит в сетке, а не «поверх»: так он не наезжает на следующий раздел,
   но поднят вверх и повёрнут — плакатная композиция сохраняется. */
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr) min(34%, 404px);
  gap: clamp(20px, 3vw, 56px); align-items: start; }
.h1 { grid-column: 1 / -1; grid-row: 1; }          /* заголовок во всю ширину */
.hero__foot { grid-column: 1; grid-row: 2; margin-top: 26px; }
.hero__foot .lead { max-width: 34ch; }
/* Кадр поднят в полосу последней строки заголовка — там, где «freeze.» уже
   кончилось. В сетке он остаётся, поэтому на следующий раздел не наезжает. */
.hero__drops { grid-column: 2; grid-row: 2; z-index: 1; margin-top: clamp(-360px, -23vw, -150px); }
.hero__drop { transform: rotate(-3.5deg); }

/* В одну колонку текст со значком App Store идёт сразу под заголовком, а кадр —
   за ним: иначе на телефоне значок уезжал за первый экран, под телефон. */
@media (max-width: 1099px) {
  .hero__in { grid-template-columns: 1fr; }
  .h1 { grid-row: auto; } .hero__foot { grid-row: auto; grid-column: 1; }
  .hero__drops { grid-column: 1; grid-row: auto; order: 1; margin-top: 30px; width: min(64%, 360px); }
  .hero__drop { transform: rotate(-2deg); }
}
@media (max-width: 560px) {
  .hero__drops { width: min(78%, 300px); }
}

/* ── фильм ────────────────────────────────────────────────────────────── */
/* Слева запись Юры 1.0 со звуком, справа тот же лес в 1.5: раздел и заполнен,
   и показывает, что изменилось за год. */
.film__row { display: grid; grid-template-columns: 1.12fr 1fr; gap: clamp(24px, 3.5vw, 48px); align-items: start; }
.film__box { border-radius: 14px; overflow: hidden; background: #0b1218; }
.film__box video { display: block; width: 100%; height: auto; }
.film__then .note, .film__now .note { max-width: 40ch; margin-top: 16px; }
.note--lead { color: var(--ink); font-size: 19px; line-height: 1.45; }
.film__now .figure { max-width: 100%; }
@media (max-width: 820px) {
  .film__row { grid-template-columns: 1fr; gap: 36px; }
  .film__box, .film__now .figure { max-width: 420px; }
}

/* ── четыре шага ──────────────────────────────────────────────────────── */
.steps__row {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(232px, 21vw, 302px);
  gap: clamp(18px, 2.2vw, 32px); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin;
  /* лента обрывается ровно по правому краю страницы: слово, разрезанное
     пополам, читается как поломка, а не как приглашение листать дальше */
}
.step { scroll-snap-align: start; }
/* заголовки шагов бывают в одну и в две строки: общая сетка строк держит
   картинки, заголовки и абзацы на одних линиях, а низ ряда — ровным */
.step { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
/* заголовок шага занимает две строки у всех: иначе у однострочных отступ до
   текста вырастает вдвое против двухстрочных, и ряд читается вразнобой */
.step .h3 { min-height: 2.6em; }
.step p { margin: 0; color: var(--ink-2); font-size: 16px; }
.steps__row { grid-auto-rows: auto; }
.steps__hint { margin: 16px 0 0; font-size: 16px; color: var(--ink-2); }
@media (max-width: 520px) { .steps__row { grid-auto-columns: 74vw; } }

/* ── миры: живая деталь ───────────────────────────────────────────────── */
/* Доли колонок подобраны так, что большой кадр с подписью ровно равен по
   высоте двум рядам переключателей: 0.378 к 0.622 при зазоре 48 px.
   Иначе под одной из колонок остаётся дыра в треть экрана. */
.worlds__top { display: grid; grid-template-columns: 0.378fr 0.622fr; gap: 48px; align-items: start; }
.worlds__left { display: flex; flex-direction: column; gap: 20px; }
.turn { position: relative; }
.turn .phone__screen { cursor: grab; touch-action: pan-y; }
.turn .phone__screen:active { cursor: grabbing; }
.turn__hint {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--ink);
  color: #fff; font-size: 16px; font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(11, 18, 24, .8);
  transition: opacity .25s; pointer-events: none;
}
.turn__hint svg { width: 30px; height: 24px; }
/* Рука ходит между стрелками — так в мануалах показывают, что предмет тянут. */
.turn__grip { animation: grip 2.6s ease-in-out infinite; }
@keyframes grip {
  0%, 100% { transform: translateX(-3.5px) }
  50% { transform: translateX(3.5px) }
}
.turn.is-held .turn__hint { opacity: 0; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; }
/* Выбранный мир — в полную силу, остальные притушены: рамка снаружи сдвигала бы
   соседей на несколько пикселей, а ряд должен стоять. */
.pick {
  display: block; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--ink-2); transition: transform .18s, color .18s;
}
.pick:hover { transform: translateY(-2px); color: var(--ink); }
.pick .figure { container-type: inline-size; }
/* Выбранный мир помечен номером под кадром, а не плашкой поверх экрана: на
   экране уже есть часы и счёт, и плашка садилась ровно на них. */
.pick__n {
  display: block; margin-top: 10px; font-size: 16px; font-weight: 600; line-height: 1.2;
  text-align: center; color: inherit;
}
.pick[aria-pressed="true"] { color: var(--red); }
.pick[aria-pressed="true"] .pick__n { font-weight: 800; }
.pick { opacity: .72; }
.pick:hover, .pick[aria-pressed="true"] { opacity: 1; }
.worlds__caption { font-size: clamp(17px, 1.35vw, 20px); color: var(--ink); max-width: 30ch; margin: 0; }
@media (max-width: 860px) {
  .worlds__top { grid-template-columns: 1fr; gap: 24px; }
  .turn { max-width: 330px; }
  .worlds__caption { min-height: 0; margin-bottom: 4px; }
}

/* ── текстовый раздел ─────────────────────────────────────────────────── */
.limits__cols { columns: 2; column-gap: clamp(18px, 2.2vw, 36px); }
.limits__cols p { break-inside: avoid; margin: 0 0 20px; color: var(--ink-2); max-width: 46ch; }
.limits__cols p:first-child { color: var(--ink); font-size: 19px; }
@media (max-width: 760px) { .limits__cols { columns: 1; } }

/* ── конец ────────────────────────────────────────────────────────────── */
.end { padding-bottom: clamp(56px, 7vw, 112px); }
.end__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 48px); align-items: end; }
.end__row .meta { margin: 0; font-size: clamp(17px, 1.35vw, 20px); color: var(--ink); max-width: 34ch; }
@media (max-width: 760px) { .end__row { grid-template-columns: 1fr; align-items: start; } .end__row .meta { margin-top: 18px; } }
.end__icon { border-radius: 16px; display: block; margin: 0 0 22px; }

.foot { padding: 0 0 40px; font-size: 16px; color: var(--ink-2); }
.foot__row { border-top: 1px solid var(--line); padding-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Снег идёт по всей странице, поверх фона и под содержимым; ловится курсором.
   Холст не перехватывает клики — мышь слушает сама страница. */
.snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body > *:not(.snow) { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .snow { display: none; }
}
