/* Общий каркас обоих лендингов: то, что у них ОДИНАКОВО и должно оставаться
 * одинаковым — зерно, шапка, полоса прогресса, типографика героя и секций,
 * подсказка скролла, подвал.
 *
 * Здесь же живут все нативные scroll-driven анимации общей хромы. Правило:
 * если правка нужна обоим сайтам — она сюда; если только одному — в его
 * sites/<x>/site.css. Дублировать эти блоки в лендингах нельзя, иначе они
 * разъедутся при первой же правке.
 */

/* Зерно: снимает полосы на градиентах, даёт чёрному фактуру. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 40;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 10px 18px;
  border-radius: var(--r-xs);
  font-weight: 600;
}

.skip:focus { left: 16px; }

/* --- шапка --------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: 16px;
}

/* Стекло — отдельным слоем, чтобы проявлять его по скроллу: наверху шапка
   лежит прямо на герое, ниже — отделяется от контента. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
}

@supports (animation-timeline: scroll()) {
  .nav::before {
    animation: nav-glass linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 120px;
  }

  @keyframes nav-glass {
    to { opacity: 1; }
  }
}

/* Нет таймлайнов — стекло просто есть всегда. */
@supports not (animation-timeline: scroll()) {
  .nav::before { opacity: 1; }
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* Знак: карта с «искрой» бонуса в углу — тот же образ, что в приложении. */
.brand-mark {
  width: 26px;
  height: 18px;
  border: 1.5px solid var(--brass);
  border-radius: 5px;
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: '';
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bonus);
  box-shadow: 0 0 0 3px var(--bg);
}

.btn-sm { padding: 11px 18px; font-size: 11px; }

/* --- полоса прогресса ---------------------------------------------------- */

.rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  z-index: 15;
  background: var(--line-soft);
  pointer-events: none;
}

.rail-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--brass), var(--bonus));
  transform: scaleY(0);
  transform-origin: top;
}

@supports (animation-timeline: scroll()) {
  .rail-fill {
    animation: rail linear both;
    animation-timeline: scroll(root block);
  }

  @keyframes rail {
    to { transform: scaleY(1); }
  }
}

/* Полоса имеет смысл только как индикатор прогресса — без таймлайна убираем. */
@supports not (animation-timeline: scroll()) {
  .rail { display: none; }
}

/* --- герой (общий каркас; раскладка — у каждого лендинга своя) ------------ */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: 40px 96px;
  margin-top: -66px; /* шапка лежит на герое */
  overflow: hidden;
}

/* Фон под шейдером: он же единственный фон при reduced-motion и без WebGL. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(100% 80% at 72% 44%, rgba(217, 186, 133, 0.13), transparent 62%),
    radial-gradient(120% 90% at 10% 88%, rgba(57, 112, 143, 0.2), transparent 60%),
    var(--bg);
}

#hero-gl {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1200ms var(--ease);
}

#hero-gl.is-live { opacity: 1; }

.hero-in {
  display: grid;
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
  width: 100%;
  padding-top: 66px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 30px;
  opacity: 0;
  animation: rise 700ms var(--ease) 120ms forwards;
}

/* Заголовок набирается построчно. Каждая строка — свой span, поэтому перенос
   управляемый и не зависит от ширины гарнитуры (Unbounded очень широкий). */
.hero-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.4vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  display: grid;
  gap: 2px;
}

.hero-h1 .l {
  display: block;
  opacity: 0;
  animation: rise 800ms var(--ease) forwards;
}

.hero-h1 .l1 { animation-delay: 200ms; }
.hero-h1 .l2 { animation-delay: 290ms; color: var(--text-3); }
.hero-h1 .l3 { animation-delay: 460ms; }
.hero-h1 .l4 { animation-delay: 560ms; }

/* Латунью — только слово, несущее мысль. Одно на страницу. */
.hero-h1 em,
h2 em {
  font-style: normal;
  color: var(--brass);
}

.hero-h1 em {
  position: relative;
}

.hero-h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.06em;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 700ms var(--ease) 1000ms forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

@keyframes underline {
  to { transform: scaleX(1); }
}

.hero-sub {
  max-width: 40ch;
  margin-top: 30px;
  font-size: clamp(17px, 1.4vw, 21px);
  color: var(--text-2);
  opacity: 0;
  animation: rise 800ms var(--ease) 720ms forwards;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
  opacity: 0;
  animation: rise 800ms var(--ease) 840ms forwards;
}

/* --- подсказка скролла --------------------------------------------------- */

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0;
  opacity: 0;
  animation: rise 800ms var(--ease) 1500ms forwards;
}

.sh-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
  transform-origin: right;
  animation: sh 2.2s var(--ease) infinite;
}

@keyframes sh {
  0%, 100% { transform: scaleX(0.3); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* Подсказка гаснет, как только скролл начался — своё дело она сделала. */
@supports (animation-timeline: scroll()) {
  .scroll-hint {
    animation: rise 800ms var(--ease) 1500ms forwards, hint-out linear both;
    animation-timeline: auto, scroll(root block);
    animation-range: normal, 0 90px;
  }

  @keyframes hint-out {
    to { opacity: 0; }
  }
}

/* --- секции -------------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
  position: relative;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
}

.sec-h2 { margin-bottom: 56px; }

.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--text-2);
  max-width: 52ch;
  margin: 22px 0 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 26px;
}

.eyebrow::before {
  content: attr(data-num);
  color: var(--brass);
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --- подвал -------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 48px 40px;
  background: var(--surface);
}

.foot-in {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px 40px;
  align-items: center;
}

.foot-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-2);
}

.foot-links a:hover { color: var(--brass); }

.legal {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.6;
  max-width: 90ch;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  margin: 0;
}

/* --- адаптив общей хромы ------------------------------------------------- */

@media (max-width: 1000px) {
  .hero { padding-block: 30px 80px; }
  .scroll-hint { display: none; }
  .rail { display: none; }
  .foot-in { grid-template-columns: 1fr; align-items: start; }
}

/* Движение выключено — вся хрома сразу на месте. */
@media (prefers-reduced-motion: reduce) {
  .tag,
  .hero-h1 .l,
  .hero-sub,
  .hero-cta,
  .scroll-hint { opacity: 1; animation: none; }

  .hero-h1 em::after { transform: scaleX(1); animation: none; }

  .nav::before { opacity: 1; }
}
