/* Сайт ПАРА: одна линия метро через всю страницу. Те же цвета и шрифты, что в приложении (app/src/theme/tokens.ts). */
@font-face {
  font-family: "Unbounded";
  src: url("/site/fonts/unbounded-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded";
  src: url("/site/fonts/unbounded-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/site/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/site/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --wrap: 1280px;
  /* общий левый край шапки и первого экрана: внутри колонки 1280 px с полями --gutter */
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  --night: #000000;
  --surface: #16171b;
  --blue: #0036ff;
  --line: #6a8cff;
  --light: #f2f3f5;
  --mist: #a5abb8;
  --faint: #6c7280;
  --now: #3dd68c;
  --rail: rgba(242, 243, 245, 0.16);
  /* поле страницы; в альбомной ориентации не заходит под вырез экрана */
  --gutter: max(clamp(20px, 5vw, 64px), env(safe-area-inset-left), env(safe-area-inset-right));
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --display: "Unbounded", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* без задержки двойного касания; синий прямоугольник Android при касании заменён своим откликом (scale, яркость) */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--light);
  font: 400 17px/1.6 var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
}
/* без «висячего» слова в последней строке абзаца */
p,
li {
  text-wrap: pretty;
}
a {
  color: inherit;
}
/* кольцо — только с клавиатуры; повторяет скругление элемента, форму ему не меняет */
:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- живые волны: холст под всей страницей, гаснет после первого экрана ---------- */
#waves {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
html.gl #waves {
  opacity: 1;
}
/* без WebGL — статичная фирменная волна */
html:not(.gl) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000 url("/site/img/waves-tall.webp") center / cover no-repeat;
  opacity: 0.85;
}
@media (min-aspect-ratio: 1/1) {
  html:not(.gl) body::before {
    background-image: url("/site/img/waves-wide.webp");
  }
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

/* ---------- шапка ---------- */
.top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) var(--edge) 0;
}
.mark {
  display: block;
  border-radius: 6px;
  transition: opacity 0.15s var(--ease-out);
}
.mark:active {
  opacity: 0.6;
}
.mark img {
  width: 112px;
  height: auto;
}
.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.12s var(--ease-out), background-color 0.2s var(--ease-out), border-color 0.2s;
}
.top-link:active {
  transform: scale(0.96);
}
@media (hover: hover) {
  .top-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(106, 140, 255, 0.6);
  }
}

/* ---------- первый экран ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px var(--edge) 40px;
}
.hero-title {
  font: 800 clamp(42px, 10.6vw, 132px) / 0.98 var(--display);
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  max-width: 11ch;
  text-wrap: balance;
}
/* разбивка на буквы (site.js): слово не переносится внутри, буквы живут в своих коробках для анимации */
.hero-title .w {
  display: inline-block;
  white-space: nowrap;
}
.hero-title .c {
  display: inline-block;
}
/* слой на букву — только пока идёт вступление: потом браузер их отпускает */
.intro .hero-title .c {
  will-change: transform, opacity;
}
.hero-lead {
  max-width: 34rem;
  margin: 0 0 32px;
  color: #d6d9e0;
  font-size: clamp(17px, 2vw, 20px);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 34rem;
}
/* на телефоне кнопки встают одна под другой одинаковой ширины, на широком экране — рядом по содержимому */
.hero-actions .btn {
  flex: 1 1 220px;
}
@media (min-width: 700px) {
  .hero-actions .btn {
    flex: 0 0 auto;
  }
}
.hero-now {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 56px;
  color: var(--mist);
  font-size: 14px;
}
.hero-now time {
  font-variant-numeric: tabular-nums;
  color: var(--light);
  font-weight: 600;
}
/* бусина «сейчас» — как на шкале дня в приложении; ореол дышит масштабом и прозрачностью (без перерисовки тени) */
.bead {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--now);
}
.bead::after {
  content: "";
  position: absolute;
  inset: -8.5px;
  border-radius: 50%;
  background: rgba(61, 214, 140, 0.18);
  z-index: -1;
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: scale(1.3);
    opacity: 0.45;
  }
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  font: 600 16px/1 var(--text);
  text-decoration: none;
  transition: transform 0.12s var(--ease-out), background-color 0.2s var(--ease-out), border-color 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-ghost,
.btn-line {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (hover: hover) {
  .btn-primary:hover {
    background: #1a4bff;
  }
  .btn-ghost:hover,
  .btn-line:hover {
    border-color: rgba(106, 140, 255, 0.6);
  }
}

/* ---------- линия со станциями ---------- */
.line-section {
  padding: 96px var(--gutter) 64px;
  max-width: var(--wrap);
  margin: 0 auto;
}
/* на широком экране заголовок стоит слева, пока справа едет линия со станциями */
@media (min-width: 1000px) {
  .line-section {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 72px;
    align-items: start;
    padding-top: 160px;
  }
  .line-head {
    position: sticky;
    top: 120px;
  }
}
.line-head {
  margin: 0 0 56px;
}
h2 {
  font: 800 clamp(30px, 5.6vw, 60px) / 1.05 var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.line-head p {
  max-width: 36rem;
  margin: 0;
  color: var(--mist);
}

/* геометрия как у шкалы дня: линия 2 px, станция 14 px с чёрной «прокладкой», бусина 16 px. Линия идёт от центра
   первой станции до центра последней (конечной) — site.js меряет и задаёт --rail-top и --rail-h. */
.line {
  --x: 7px; /* центр линии от левого края */
  --h3: clamp(24px, 4vw, 34px);
  --stop-y: calc(var(--h3) * 0.575); /* центр станции = середина строки заголовка */
  position: relative;
  padding-left: 44px;
}
.rail {
  position: absolute;
  left: calc(var(--x) - 1px);
  top: var(--rail-top, var(--stop-y));
  width: 2px;
  height: var(--rail-h, calc(100% - var(--stop-y)));
  overflow: visible;
}
.rail line {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.rail-track {
  stroke: var(--rail);
}
.rail-fill {
  stroke: var(--line);
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
html:not(.motion) .rail-fill {
  stroke-dashoffset: 0;
}
.train {
  position: absolute;
  left: calc(var(--x) - 8px);
  top: -8px;
  /* до начала прокрутки поезд стоит на первой станции */
  transform: translateY(var(--rail-top, var(--stop-y)));
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 0 0 8px rgba(106, 140, 255, 0.16), 0 0 24px rgba(0, 54, 255, 0.55);
  z-index: 2;
  will-change: transform;
}
html:not(.motion) .train {
  display: none;
}

.station {
  position: relative;
  padding-bottom: 64px;
}
.station:last-child {
  padding-bottom: 8px;
}
.stop {
  position: absolute;
  left: calc(var(--x) - 44px - 7px);
  top: calc(var(--stop-y) - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--night);
  background: var(--night);
  box-shadow: inset 0 0 0 1.5px var(--mist);
  transition: background-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.station h3 {
  font: 800 var(--h3) / 1.15 var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--mist);
  transition: color 0.5s var(--ease-out);
}
.station > p {
  margin: 0 0 20px;
  max-width: 34rem;
  color: var(--mist);
}
.station b {
  color: var(--light);
  font-weight: 600;
}
/* поезд доехал до станции: она «загорается», как пройденная станция в приложении */
.station.reached .stop,
html:not(.motion) .stop {
  background: var(--line);
  box-shadow: inset 0 0 0 0 transparent;
}
.station.reached h3,
html:not(.motion) .station h3 {
  color: var(--light);
}
.apk-meta {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 15px;
}
.apk-meta:empty {
  display: none;
}
.steps {
  list-style: none;
  counter-reset: s;
  padding: 0;
  margin: 24px 0 0;
  max-width: 32rem;
}
.steps li {
  counter-increment: s;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  color: #d6d9e0;
  font-size: 15px;
  line-height: 1.5;
}
.steps li::before {
  content: counter(s);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 54, 255, 0.55);
  color: #fff;
  font: 600 13px/26px var(--text);
  text-align: center;
}
.apk-old {
  margin: 8px 0 0;
  max-width: 32rem;
  color: var(--mist);
  font-size: 15px;
  line-height: 1.5;
}
.apk-old[hidden] {
  display: none;
}
.apk-old a {
  color: var(--light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- что внутри: сцена ---------- */
.inside {
  padding: 96px var(--gutter) 64px;
  max-width: 1120px;
  margin: 0 auto;
}
.inside h2 {
  margin-bottom: 40px;
}
/* без скрипта: телефон, под ним подписи столбцом */
.stage {
  display: grid;
  gap: 32px;
  justify-items: center;
}
.phone {
  --pw: min(64vw, 280px);
  position: relative;
  width: var(--pw);
  aspect-ratio: 600 / 1299;
  border-radius: calc(var(--pw) * 0.15);
  padding: calc(var(--pw) * 0.034);
  background: linear-gradient(160deg, #2a2d35, #0c0d10 40%, #1b1d22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 120px rgba(0, 54, 255, 0.28), 0 30px 60px rgba(0, 0, 0, 0.8);
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--pw) * 0.118);
  overflow: hidden;
  background: #000;
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
}
.phone-screen img.on {
  opacity: 1;
  transform: none;
}
.features {
  width: 100%;
  max-width: 34rem;
}
.ticks {
  display: none;
}
.feature-list {
  display: grid;
  gap: 28px;
}
.feature h3 {
  font: 800 clamp(22px, 3.4vw, 30px) / 1.15 var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.feature p {
  margin: 0;
  color: var(--mist);
  text-wrap: pretty;
}

/* со скриптом: сцена стоит на месте (sticky), прокрутка внутри .story перелистывает экраны (site.js ставит .live) */
.story.live {
  height: calc(100vh + 150vh);
  height: calc(100svh + 150svh);
}
.story.live .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  align-content: center;
  gap: 20px;
  padding: 16px 0;
}
/* на телефоне подписи стоят в одной клетке друг на друге: высота блока = самой длинной, ничего не прыгает */
.story.live .feature-list {
  grid-template-areas: "one";
}
.story.live .feature {
  grid-area: one;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
}
.story.live .feature.on {
  opacity: 1;
  transform: none;
}
/* телефон по высоте свободного места: подпись (~180 px) и поля всегда влезают, телефон не обрезается */
.story.live .phone {
  --pw: min(64vw, 280px, calc((100vh - 270px) * 0.462));
  --pw: min(64vw, 280px, calc((100svh - 270px) * 0.462));
}
/* три станции — где вы в рассказе: пройденные и текущая залиты, следующие — кольца, как на линии выше */
.story.live .ticks {
  position: relative;
  display: flex;
  width: max-content;
  gap: 28px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
/* перегон между станциями; пройденная часть заливается синим (--p от 0 до 1 ставит site.js) */
.story.live .ticks::before,
.story.live .ticks::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--rail);
}
.story.live .ticks::after {
  background: var(--line);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 0.45s var(--ease-out);
}
.ticks li {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--night);
  box-shadow: inset 0 0 0 1.5px var(--mist);
  transition: background-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.ticks li.done {
  background: var(--line);
  box-shadow: inset 0 0 0 0 transparent;
}
@media (min-width: 900px) {
  .stage {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    column-gap: 96px;
  }
  .phone {
    --pw: 300px;
    justify-self: end;
  }
  .story.live .phone {
    --pw: min(300px, calc((100vh - 96px) * 0.462));
    --pw: min(300px, calc((100svh - 96px) * 0.462));
  }
  .feature-list {
    gap: 40px;
  }
  /* на компьютере видны все три подписи: текущая — яркая, остальные приглушены */
  .story.live .feature-list {
    grid-template-areas: none;
  }
  .story.live .feature {
    grid-area: auto;
    opacity: 0.32;
    transform: none;
  }
  .story.live .feature.on {
    opacity: 1;
  }
}

/* ---------- пожертвования ---------- */
.support {
  padding: 32px var(--gutter) 96px;
  max-width: 1120px;
  margin: 0 auto;
}
.support[hidden] {
  display: none;
}
.support h2 {
  margin-bottom: 20px;
}
.support-text {
  max-width: 36rem;
  margin: 0 0 32px;
  color: var(--mist);
}
.support-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  max-width: 36rem;
  padding: 28px;
  border: 1px solid var(--rail);
  border-radius: 20px;
  background: var(--surface);
}
.support-kind {
  color: var(--faint);
  font-size: 15px;
}
.support-number {
  font: 800 clamp(24px, 6vw, 36px) / 1.1 var(--display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.support-about {
  color: var(--mist);
}
.support-about:empty {
  display: none;
}
.support-card .btn {
  margin-top: 16px;
}
.support-card[hidden],
.pay[hidden] {
  display: none;
}

/* оплата: суммы кнопками, своя сумма, пожелание */
.pay {
  display: grid;
  gap: 20px;
  max-width: 36rem;
  padding: 28px;
  border: 1px solid var(--rail);
  border-radius: 20px;
  background: var(--surface);
}
.pay-amounts {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.pay-amounts legend {
  padding: 0;
  margin-bottom: 14px;
  color: var(--faint);
  font-size: 15px;
}
.pay-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}
.pay-chip {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--light);
  font: 600 16px/1 var(--text);
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), background-color 0.2s var(--ease-out), border-color 0.2s;
}
.pay-chip:active {
  transform: scale(0.97);
}
.pay-chip[aria-pressed="true"] {
  border-color: var(--line);
  background: rgba(0, 54, 255, 0.28);
}
.pay-field {
  display: grid;
  gap: 8px;
  color: var(--mist);
  font-size: 15px;
}
.pay-field input,
.pay-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: var(--night);
  color: var(--light);
  font: 500 17px/1.4 var(--text);
  resize: vertical;
}
.pay-field input:focus-visible,
.pay-field textarea:focus-visible,
.pay-chip:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}
.pay .btn {
  width: 100%;
  border: 0;
  cursor: pointer;
}
.pay .btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.pay-legal {
  margin: 0;
  color: var(--faint);
  font-size: 14px;
}
.pay-legal[hidden] {
  display: none;
}
.pay-legal a,
.foot a {
  color: var(--mist);
}
.pay-note {
  margin: 0;
  min-height: 1.4em;
  color: var(--mist);
  font-size: 15px;
}
@media (hover: hover) {
  .pay-chip:hover {
    border-color: rgba(106, 140, 255, 0.6);
  }
}

/* ---------- подвал ---------- */
.foot {
  padding: 56px var(--gutter) max(48px, env(safe-area-inset-bottom));
  max-width: 980px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--faint);
  font-size: 15px;
}
.foot img {
  margin-bottom: 18px;
  opacity: 0.7;
}
.foot p {
  margin: 0 0 6px;
}

/* ---------- уменьшение движения: всё на месте сразу ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .bead::after {
    animation: none;
  }
  .btn,
  .pay-chip,
  .top-link,
  .phone-screen img,
  .feature,
  .ticks li,
  .story.live .ticks::after,
  .stop,
  .station h3,
  #waves {
    transition: none;
  }
}
