/* Helpun — лэндинг.
   Язык самого приложения: тёплая светлая бумага с зерном (в приложении —
   AppBackground.swift, noisy_back_warm поверх systemBackground при 45%,
   здесь та же картинка), крупный светлый Merriweather для заголовков ровно
   там, где приложение само его ставит (TaskInputView, PaywallViewNew —
   .custom("Merriweather", size: 32).weight(.light)), Golos Text для всего
   остального. Акцент — тёплый коричневый #876652, тот же AppTheme.primary.
   Разделов без времени в поле: у Helpun нет "экрана будильника", единственная
   метка на полях — номер шага, когда он есть. Прокрутку страница не
   перехватывает. */

:root {
  --paper: #faf7f3;
  --card: #fff;
  --ink: #2e2b29;
  --ink-2: rgb(46 43 41 / 66%);
  --ink-3: rgb(46 43 41 / 44%);
  --line: rgb(46 43 41 / 12%);
  --brown: #876652;
  --brown-dark: #6b503f;
  --orange: #ff9500;
  --red: #ff3b30;
  --pad: clamp(20px, 4.4vw, 72px);
  --max: 1180px;
  --rail: clamp(0px, 7vw, 108px);
  --serif: "Merriweather", Georgia, serif;
  --sans: "Golos Text", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .15, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; color: var(--ink); background: var(--paper) url("/helpun-landing/brand/grain.png") repeat;
  background-size: 209px 209px; font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
figure { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--orange); color: #fff; }

.wrap { max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.h1 { margin: 0; font: 300 clamp(34px, 4.6vw, 64px)/1.08 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.h2 { margin: 0; font: 300 clamp(26px, 3vw, 42px)/1.12 var(--serif); letter-spacing: -.005em; text-wrap: balance; max-width: 20ch; }
.lead { margin: 0; max-width: 47ch; font: 400 clamp(17px, 1.3vw, 19px)/1.55 var(--sans); color: var(--ink-2); text-wrap: pretty; }
.note { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); max-width: 62ch; }
.why { margin: 26px 0 0; padding-left: 16px; border-left: 3px solid var(--brown); max-width: 60ch; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.why b { font-weight: 600; }

/* ── Разделы ───────────────────────────────────────────────────────────── */
.sec { padding: clamp(60px, 7vw, 112px) 0 0; }
.sec__in { position: relative; padding-left: var(--rail); }
.step-no {
  position: absolute; left: 0; top: .12em; width: var(--rail); padding-right: 16px;
  font: 500 clamp(15px, 1.2vw, 17px)/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.head { display: grid; gap: 16px 56px; margin-bottom: clamp(24px, 3vw, 40px); }
@media (min-width: 900px) { .head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }
@media (max-width: 719px) {
  .sec__in { padding-left: 0; }
  .step-no { position: static; width: auto; margin-bottom: 8px; }
}

/* ── Кнопки ────────────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink);
  font: 500 16px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:hover { border-color: rgb(46 43 41 / 28%); }
.btn:active { transform: scale(.96); }
.btn--ink { background: var(--brown); color: #fff; border-color: var(--brown); font-weight: 600; }
.btn--ink:hover { background: var(--brown-dark); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn__icon { width: 18px; height: 18px; flex: none; }
.btn:focus-visible, .top a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  height: 66px; padding: 0 max(var(--pad), calc((100vw - var(--max)) / 2));
  background: rgb(250 247 243 / 88%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top__brand { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1 var(--sans); letter-spacing: -.02em; text-decoration: none; }
.top__brand img { border-radius: 9px; }
.top__home { font: 500 15px/1 var(--sans); text-decoration: none; padding: 11px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.top__home:hover { border-color: rgb(46 43 41 / 28%); }

/* ── Телефон ──────────────────────────────────────────────────────────────
   Рамка считается от ширины корпуса, а не в процентах от коробки: процент в
   border-radius берёт x от ширины, y от высоты и даёт эллипс, поэтому дуги
   корпуса и экрана расходились. Здесь обе дуги — длины от одной и той же
   --w, и внешняя ровно на толщину рамки больше внутренней, то есть они
   концентричны. Пропорции с живого аппарата: экран 402 × 874 pt, скругление
   экрана 62 pt (15.4 % ширины), рамка около 4 pt (1 %). */
.phone {
  --w: min(300px, 72vw);
  width: var(--w); padding: calc(var(--w) * 0.011);
  border-radius: calc(var(--w) * 0.165);
  background: #16130f; box-shadow: 0 24px 48px rgb(46 43 41 / 18%), inset 0 0 0 1px rgb(255 255 255 / 7%);
}
.phone__screen { position: relative; border-radius: calc(var(--w) * 0.154); overflow: hidden; background: #000; }
.phone__screen > img, .phone__screen > video { width: 100%; height: auto; display: block; }
.shot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; align-content: start; }
.shot figcaption { font-size: 14px; line-height: 1.45; color: var(--ink-3); max-width: 34ch; text-align: center; }
/* кадр без корпуса: этот снимок сделан на другом аппарате и обрезан по
   высоте, поэтому корпус с «островом» на нём был бы враньём */
.shot--bare img { width: var(--w, min(232px, 60vw)); border-radius: 18px; box-shadow: 0 18px 40px rgb(46 43 41 / 16%); }

/* ── Первый экран ──────────────────────────────────────────────────────── */
.hero { padding: clamp(24px, 3vw, 40px) 0 0; }
.hero__in { position: relative; padding-left: var(--rail); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero__note { grid-column: 1 / -1; margin: 0; }
@media (min-width: 900px) { .hero__in { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); } }
@media (max-width: 719px) { .hero__in { padding-left: 0; } }
.hero__copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: center; }
.hero__phone { justify-self: center; }
.hero__phone .phone { --w: min(292px, 72vw); }
.end .phone { --w: min(208px, 56vw); }

/* ── Ряды экранов ──────────────────────────────────────────────────────── */
.row { display: grid; gap: clamp(18px, 2.4vw, 32px); align-items: start; }
.row--two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 900px; }
.row--three { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ── Текст и телефон в одну полосу: у каждого раздела своя сторона ───────
   (01/04 — телефон справа, 02/05 — слева), так текст и экран делят одну
   высоту, а не расходятся в разные углы. */
.split { display: grid; gap: clamp(20px, 3vw, 40px); margin-top: clamp(20px, 2.4vw, 32px); align-items: start; }
.split__copy { display: grid; gap: 18px; align-content: start; }
.split__copy .lead { max-width: none; }
.split > .shot { width: 100%; max-width: 300px; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
  .split--reverse { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .split--reverse > .shot { order: -1; }
  .split > .shot { justify-self: end; }
}

/* пара экранов в ряд: слева застывший кадр, справа тот же экран в движении —
   чтобы не ждать, пока ролик доедет до нужного места */
.pair { display: grid; gap: clamp(18px, 2.4vw, 32px); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 660px; margin-top: clamp(20px, 2.4vw, 30px); align-items: start; }
.pair .phone { --w: min(280px, 68vw); }
.split--under { margin-top: clamp(22px, 2.6vw, 34px); }
@media (min-width: 860px) { .split--under { grid-template-columns: minmax(0, 1fr); } }

/* ── Кредиты: карточки цифр, как в CreditManager ─────────────────────────── */
.credits { display: grid; gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.credit-card { padding: 22px 22px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.credit-card b { display: block; font: 300 clamp(30px, 3vw, 40px)/1 var(--serif); margin-bottom: 6px; }
.credit-card span { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.credit-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font: 700 17px/1 var(--sans); box-shadow: 0 2px 6px rgb(46 43 41 / 10%);
}
.credit-badge i { width: 22px; height: 22px; border-radius: 50%; flex: none; transition: background .3s; }
.credit-badge[data-level="plenty"] i { background: var(--brown); }
.credit-badge[data-level="low"] i { background: var(--orange); }
.credit-badge[data-level="empty"] i { background: var(--red); }

/* ── "Mark it done": конфетти, перенесённое из Confetti.swift ────────────── */
.demo {
  position: relative; overflow: hidden; display: grid; gap: clamp(18px, 2.4vw, 28px); align-items: center;
  padding: clamp(20px, 2.6vw, 28px); border-radius: 18px; background: var(--paper); border: 1px solid var(--line);
}
.demo__row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--card); }
.demo__row + .demo__row { margin-top: 10px; }
.demo__symbol { width: 30px; height: 30px; border-radius: 9px; background: var(--brown); flex: none; }
.demo__text { flex: 1; font-size: 16px; }
.demo__almost, .demo__done {
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font: 500 15px/1 var(--sans); cursor: pointer; transition: transform .15s var(--ease); white-space: nowrap;
}
.demo__done { background: var(--brown); color: #fff; border-color: var(--brown); font-weight: 600; }
.demo__almost:active, .demo__done:active { transform: scale(.94); }
/* галочка завершения: появляется на время дождя, как экран Done в приложении */
.demo__tick {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 17px; opacity: 0; transform: scale(.6); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.demo.is-done .demo__tick { opacity: 1; transform: scale(1); }
.confetti-piece { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform, opacity; }

/* ── Две вещи разом: экран и текст к нему стоят рядом, парами ────────────
   Без плашек: подложка у текста ничего не значила, только отодвигала его от
   экрана, к которому он относится. Пары зеркальны — экран/текст, текст/экран,
   так между ними остаётся середина, а не шов. */
.bento2 { display: grid; gap: clamp(28px, 3.4vw, 46px); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  margin-top: clamp(24px, 2.8vw, 38px); }
/* колонка экрана — auto, колонка текста — 1fr: тогда при нехватке места
   ужимается текст, а не наезжает телефон */
.bento2__pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 1.8vw, 26px); align-items: center; }
.bento2__pair--flip { grid-template-columns: minmax(0, 1fr) auto; }
.bento2__pair--flip .shot { justify-self: end; }
.bento2__fact { display: grid; gap: 8px; align-content: center; }
.bento2__fact h3 { margin: 0; font: 600 17px/1.35 var(--sans); }
.bento2__fact p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.bento2 .phone { --w: min(196px, 44vw); }
@media (max-width: 479px) {
  .bento2__pair, .bento2__pair--flip { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .bento2__pair--flip .shot { order: 0; }
  .bento2 .phone { --w: min(220px, 62vw); }
}

/* ── Ключевые возможности ─────────────────────────────────────────────── */
.features { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature { padding: 20px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.feature h3 { margin: 0 0 6px; font: 600 16px/1.3 var(--sans); }
.feature p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* ── Конец ─────────────────────────────────────────────────────────────── */
.end { padding: clamp(72px, 8vw, 128px) 0 clamp(52px, 6vw, 92px); }
.end__in { position: relative; padding-left: var(--rail); display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; justify-items: start; }
.end__mark { border-radius: 22px; box-shadow: 0 10px 24px rgb(46 43 41 / 12%); }
@media (max-width: 719px) { .end__in { padding-left: 0; } }
.foot { border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: 14px; color: var(--ink-3); }
.foot__row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .btn, .demo__almost, .demo__done { transition: none; }
}
