/* Лендинг «Здорограф». Палитра и шрифты — те же, что в Mini App, чтобы
   человек, пришедший с сайта, узнал приложение. Без сборщиков и внешних
   библиотек: одна страница, которую должна прочитать и модерация платёжного
   провайдера.

   Главная механика — стопка липких карточек (.stack > .stk): на телефоне
   каждый блок занимает почти весь экран, следующий наезжает сверху, а
   предыдущий уходит на задний план. Ради неё на html/body/.wrap нет никакого
   overflow — предок с overflow становится контейнером прокрутки, и sticky
   перестаёт работать (iOS особенно). */
:root {
  /* Палитра «Здорографа» (brand/README.md): белый фон, синий — действие,
     зелёный — только «в норме / принято», текст #1F1F1F / #5F6368 */
  --bg: #FFFFFF;
  --card: #F8F9FA;
  --ink: #1F1F1F;
  --muted: #5F6368;
  --green: #0B57D0;        /* историческое имя: цвет действия и ссылок */
  --green-soft: #1E8E3E;   /* «в норме / принято» */
  --line: #E3E6EA;
  --accent: #B3261E;
  --blue-tint: #D3E3FD;
  --radius: 24px;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: 'Onest', -apple-system, Roboto, sans-serif; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 40px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 27px; margin: 0 0 14px; }
h3 { font-size: 20px; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* хвостик «@» у Onest опускается ниже базовой линии: без отступа подчёркивание
   под ним читается как точка перед ником */
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ─── шапка ─────────────────────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; gap: 16px;
  padding: 26px 0 10px;
}
header.top .mark { width: 84px; height: auto; flex: 0 0 auto; display: block; }
header.top .name {
  font-family: 'Onest', -apple-system, Roboto, sans-serif; font-size: 30px; line-height: 1.1;
  color: var(--ink); font-weight: 700; letter-spacing: -0.02em;
}
header.top .tag, header.top .sub { color: var(--muted); font-size: 16px; margin-top: 3px; }
header.top .btn { margin-left: auto; }

/* ─── первый экран ──────────────────────────────────────────────────── */
.hero { padding: 26px 0 8px; }
.hero .lead { font-size: 20px; color: var(--ink); max-width: 640px; }
.hero .sub { color: var(--muted); max-width: 640px; }

.btn {
  display: inline-block; background: var(--green); color: #fff;
  text-decoration: none; font-weight: 600;
  padding: 14px 26px; border-radius: 999px;
  box-shadow: var(--shadow); border: 0; cursor: pointer; font-size: 17px;
}
.btn:hover { background: #0842A0; }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--line); box-shadow: none; }
.btn.small { padding: 9px 16px; font-size: 15px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0 6px; }

.disclaimer {
  background: #FCE8E6; border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: 0 12px 12px 0;
  margin: 26px 0; font-size: 16px;
}

section { margin: 46px 0; }
section > .intro { max-width: 640px; color: var(--muted); }

/* ─── стопка карточек ───────────────────────────────────────────────── */
.stack { display: grid; margin: 22px 0 10px; }
.stk {
  position: -webkit-sticky; position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  min-height: 78vh; min-height: 78svh;            /* svh: стабильная высота на iOS */
  /* Зазор между карточками — доля экрана: прилипшая карточка успевает
     показаться целиком, прежде чем следующая начнёт её накрывать. */
  margin: 0 0 20vh; margin-bottom: 20svh;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 22px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 10px 30px rgba(44, 42, 36, .13);
  transform-origin: 50% 0;
  /* --p ставит скрипт: 0 — карточка одна на экране, 1 — её накрыла следующая */
  transform: translateY(calc(var(--p, 0) * -12px)) scale(calc(1 - var(--p, 0) * .06));
  will-change: transform;
}
/* Затухание — вуалью поверх, а не opacity: полупрозрачная карточка показывает
   сквозь себя предыдущую (на десктопе на экране их две), а вуаль тушит
   содержимое, оставляя карточку непрозрачной. */
.stk::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--card); opacity: calc(var(--p, 0) * .6); pointer-events: none;
}
/* Высокие кропы (экран таймера) ограничиваем долей экрана: карточка выше
   окна прилипает верхом, и её подпись остаётся за нижним краем, пока
   следующая карточка не накроет её целиком — текст так и не прочитать. */
.stk img {
  width: auto; max-width: min(100%, 330px); max-height: 44vh; max-height: 44svh;
  margin: 0 auto; display: block; border-radius: 18px;
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(44, 42, 36, .12);
}
.stk img.plain { border: 0; box-shadow: none; border-radius: 14px; }
.stk h3 { font-size: 22px; margin: 0; }
.stk p { font-size: 16px; color: var(--muted); margin: 0; }
.stk .badge {
  align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(111, 140, 110, .16); color: var(--green);
}
.stk .txt { display: flex; flex-direction: column; gap: 8px; }

@media (min-width: 721px) {
  .stack { max-width: 680px; margin-left: auto; margin-right: auto; }
  .stk {
    min-height: min(70vh, 560px);
    display: grid; grid-template-columns: 280px 1fr; align-items: center; column-gap: 28px;
    padding: 26px 28px;
  }
  .stk img { margin: 0; max-height: 62vh; }
}
@media (prefers-reduced-motion: reduce) {
  .stk { transform: none !important; will-change: auto; }
  .stk::after { display: none; }
}

/* ─── кропы экранов на /koshki ──────────────────────────────────────── */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0 6px; align-items: start; }
.shots figure { margin: 0; }
.shots figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.shots img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }

/* ─── для каких болезней ────────────────────────────────────────────── */
.dis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.dis div {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  font-size: 16px;
}
.dis b { display: block; font-family: 'Onest', -apple-system, Roboto, sans-serif; color: var(--green); font-size: 19px; margin-bottom: 4px; }

/* ─── тарифы ────────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.plan {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.plan.paid { border-color: var(--green-soft); }
.plan .kicker { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.plan .price { font-family: 'Onest', -apple-system, Roboto, sans-serif; font-size: 34px; color: var(--green); margin: 6px 0 2px; }
.plan .price small { font-size: 16px; color: var(--muted); font-family: 'Onest', sans-serif; }
.plan .year { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.plan ul { padding-left: 20px; margin: 0 0 14px; }
.plan li { font-size: 16px; }

.limits, .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; font-size: 16px; color: var(--muted);
}

/* ─── шаги и способы оплаты ─────────────────────────────────────────── */
ol.steps { counter-reset: s; list-style: none; padding: 0; }
ol.steps li { counter-increment: s; position: relative; padding-left: 42px; margin-bottom: 14px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.pay-ways { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 14px; }
.pay-ways span {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; color: var(--muted); font-weight: 600;
}

/* ─── статьи ────────────────────────────────────────────────────────── */
ul.articles { list-style: none; padding: 0; margin: 0; }
ul.articles li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 10px; font-size: 17px; }
ul.articles a { color: var(--green); font-weight: 600; text-decoration: none; }
ul.articles a:hover { text-decoration: underline; }

/* ─── реквизиты, документы ──────────────────────────────────────────── */
/* table-layout: fixed — иначе таблица не сжимается у́же своего содержимого
   (email, ИНН) и на телефоне вылезает за край на пиксель-другой */
table.req, table.doc { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
table.req td, table.doc td, table.doc th { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 16px; text-align: left; overflow-wrap: anywhere; }
table.doc th { color: var(--green); font-weight: 600; background: var(--card); }
table.req tr:last-child td, table.doc tr:last-child td { border-bottom: 0; }
table.req td:first-child { color: var(--muted); width: 42%; }

footer {
  border-top: 1px solid var(--line); margin-top: 50px; padding: 20px 0 36px;
  color: var(--muted); font-size: 13px; line-height: 1.55;
}
footer a { margin-right: 14px; }
footer .star { font-size: 12px; margin-top: 10px; }

/* ─── появление при прокрутке (для секций вне стопок) ──────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 720px) {
  h1 { font-size: 30px; }
  header.top { gap: 12px; flex-wrap: wrap; }
  header.top .mark { width: 62px; }
  header.top .name { font-size: 24px; }
  header.top .tag, header.top .sub { font-size: 14px; }
  header.top .btn { display: none; }               /* CTA есть в hero, шапке место дороже */
  h2 { font-size: 23px; }
  .plans { grid-template-columns: 1fr; }
}

/* ─── витрина болезней: что проработано ────────────────────────────────
   Не стопка: болезней четыре, и каждой хватает трёх строк о том, что у неё
   своего. Длинные блоки со скриншотами есть выше — здесь нужен быстрый
   ответ на вопрос «а моя болезнь тут есть?» (Антон, 15-сен-2026). */
.nos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 22px 0 14px; }
.nos article {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.nos .ico { font-size: 26px; line-height: 1; }
.nos h3 {
  font-family: 'Onest', -apple-system, Roboto, sans-serif; color: var(--green);
  font-size: 21px; margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.nos .ready {
  font-family: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: rgba(111, 140, 110, .16); color: var(--green);
}
.nos ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.nos li { position: relative; padding-left: 16px; font-size: 15.5px; line-height: 1.45; }
.nos li::before {
  content: ''; position: absolute; left: 0; top: .6em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--green-soft, var(--green-soft));
}
.nos .other { background: transparent; box-shadow: none; border-style: dashed; }
.nos .other p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.nos .other .hint { color: var(--muted); font-size: 14.5px; }

/* ─── кнопки выбора болезни ────────────────────────────────────────────
   Человек приходит со своей болезнью и не обязан листать чужие: ряд кнопок
   уводит сразу в нужную карточку (Антон, 15-сен-2026). */
.picks { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.pick {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 18px; font-size: 16px; color: var(--green); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease;
}
.pick span { font-size: 19px; line-height: 1; }
.pick:hover { border-color: var(--green-soft); transform: translateY(-1px); }
.nos .more {
  margin-top: auto; padding-top: 4px; font-size: 15px; color: var(--green);
  text-decoration: none; border-bottom: 1px solid rgba(53, 84, 63, .28);
  align-self: flex-start;
}
/* Якоря: карточка не должна прилипать к самому верху окна после перехода */
#d-epi, #d-ckd, #d-dm, #d-thy, #d-other,
#epilepsy, #chronic, #plus, #diseases { scroll-margin-top: 18px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--green-soft); }
