/* =========================================================
   Revius — общие стили (главная + страницы документов)
   Брейкпоинты:  десктоп >1024px · планшет 641–1024px · мобилка ≤640px
   ========================================================= */

:root {
  --font: "Wix Madefor Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --white: #ffffff;
  --text-60: rgba(255, 255, 255, 0.6);
  --text-50: rgba(255, 255, 255, 0.5);
  --text-40: rgba(255, 255, 255, 0.4);
  --text-80: rgba(255, 255, 255, 0.8);
  --brand: #2885fa;
  --bg-fallback: #0c3a8f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Фон — фиксированный слой, перекрывает весь экран при скролле */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-fallback) url("assets/bg.jpg") center / cover no-repeat;
}

a {
  color: inherit;
}

img {
  display: block;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   ХЕДЕР
   ========================================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 40px;
  transition: background-color 0.25s ease, backdrop-filter 0.25s ease;
}

.header.is-scrolled {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header__logo {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__logo img {
  height: 26px;
  width: auto;
  display: block;
}

.header__link {
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  color: var(--white);
  transition: opacity 0.2s ease;
}

.header__link:hover {
  opacity: 0.7;
}

.header__link--right {
  justify-self: end;
  text-align: right;
}

/* =========================================================
   ГЛАВНЫЙ ЭКРАН (hero)
   ========================================================= */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 104px 20px 40px;
}

.hero__icon {
  width: 196px;
  height: 196px;
  filter: drop-shadow(0 14px 38px rgba(40, 133, 250, 0.4));
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s backwards,
             glow 5s ease-in-out 1s infinite;
}

.hero__title {
  margin: 16px 0 0;
  max-width: none;
  white-space: nowrap;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s backwards;
}

.hero__subtitle {
  margin: 18px 0 0;
  max-width: none;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-50);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s backwards;
}

.btn-download {
  margin-top: 32px;
  display: inline-block;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  color: #000;
  background: var(--white);
  border: none;
  border-radius: 999px;
  padding: 16px 48px;
  cursor: pointer;
  transition: background 0.2s ease;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s backwards;
}

.btn-download:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* =========================================================
   БЕЙДЖИ App Store / Google Play
   ========================================================= */
.store-badges {
  display: flex;
  gap: 12px;
  margin-top: 48px;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s backwards;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 172px;
  height: 54px;
  padding: 0 22px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.badge img {
  height: 27px;
  width: auto;
}

.badge:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Готовые SVG-кнопки (фон + рамка + лого внутри файла).
   При ховере меняется только прозрачность фона — он просвечивает
   сквозь полупрозрачную подложку самого SVG. Размер не меняется. */
.badge--svg {
  min-width: 0;
  height: auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 13px;
  overflow: hidden;
  transition: background-color 0.2s ease;
}

.badge--svg img {
  height: 54px;
  width: auto;
}

.badge--svg:hover {
  transform: none;
  background-color: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   ФУТЕР
   ========================================================= */
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 40px;
}

.footer__link {
  text-decoration: none;
  color: var(--white);
  transition: opacity 0.2s ease;
}

.footer__link:hover {
  opacity: 0.7;
}

.footer__doc {
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
}

.footer__doc--left {
  justify-self: start;
}

.footer__doc--right {
  justify-self: end;
  text-align: right;
}

.footer__copy {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-50);
}

/* видно только на мобилке */
.footer__mobile-actions {
  display: none;
}

/* =========================================================
   СТРАНИЦЫ ДОКУМЕНТОВ
   ========================================================= */
.doc {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 40px 60px;
}

.doc__title {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
}

.doc__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-80);
}

.doc__meta {
  margin: -8px 0 32px;
  font-size: 15px;
  opacity: 0.6;
}

.doc__body p {
  margin: 0 0 16px;
}

.doc__body h2 {
  margin: 40px 0 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.doc__body h3 {
  margin: 28px 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.doc__body ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc__body li {
  margin: 0 0 8px;
}

.doc__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === Светлая тема: страницы документов (privacy / terms) === */
.page-doc::before {
  background: #ffffff;
}

.page-doc,
.page-doc .header__link,
.page-doc .footer__link,
.page-doc .footer__doc,
.page-doc .footer__copy,
.page-doc .doc__title,
.page-doc .doc__body {
  color: #0f0f0f;
}

.page-doc :focus-visible {
  outline-color: rgba(15, 15, 15, 0.5);
}

/* =========================================================
   ПОПАП «Скачать» (десктоп/планшет)
   ========================================================= */
.popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup.is-open {
  display: flex;
}

.popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.25s ease;
}

.popup__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pop 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}

.popup__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(470px, calc(100vw - 40px));
  padding: 40px;
  background: var(--white);
  border-radius: 64px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.popup__brand {
  display: block;
  height: 32px;
  width: auto;
}

.popup__qr {
  width: 228px;
  height: 228px;
  margin: 24px 0;
}

.popup__hint {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 500;
  color: #0f0f0f;
}

.store-badges--popup {
  margin-top: 0;
  gap: 8px;
  animation: none;
}

.store-badges--popup .badge img {
  height: 56px;
}

.popup__close {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.popup__close img {
  width: 20px;
  height: 20px;
}

.popup__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   АНИМАЦИИ
   ========================================================= */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 14px 38px rgba(40, 133, 250, 0.35)); }
  50%      { filter: drop-shadow(0 18px 50px rgba(75, 160, 255, 0.55)); }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================================================
   ПЛАНШЕТ  (641–1024px)
   ========================================================= */
@media (max-width: 1024px) {
  .hero__icon {
    width: 160px;
    height: 160px;
  }

  .hero__title {
    font-size: 42px;
    white-space: normal;
    max-width: 90%;
  }

  .hero__subtitle {
    font-size: 16px;
    white-space: normal;
    max-width: 85%;
  }
}

/* =========================================================
   МОБИЛКА  (≤640px)
   ========================================================= */
@media (max-width: 640px) {
  /* Хедер — только логотип по центру */
  .header {
    grid-template-columns: 1fr;
    padding: 18px 20px;
  }

  .header__logo {
    grid-column: 1;
  }

  .header__link {
    display: none;
  }

  /* Hero */
  .hero {
    padding: 96px 20px 32px;
  }

  .hero__icon {
    width: 200px;
    height: 200px;
  }

  .hero__title {
    font-size: 32px;
    max-width: 90%;
  }

  .hero__subtitle {
    font-size: 15px;
    max-width: 85%;
  }

  .btn-download {
    padding: 18px 80px;
  }

  /* Бейджи на странице скрыты */
  .hero .store-badges {
    display: none;
  }

  /* Футер — колонка по центру */
  .footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 30px;
    text-align: center;
  }

  .footer__mobile-actions {
    display: flex;
    gap: 24px;
    order: 1;
  }

  .footer__mobile-actions .footer__link {
    font-size: 16px;
    color: var(--white);
  }

  .footer__doc--left {
    order: 2;
  }

  .footer__doc--right {
    order: 3;
    justify-self: center;
    text-align: center;
  }

  .footer__copy {
    order: 4;
    font-size: 13px;
  }

  /* Документы */
  .doc {
    padding: 100px 20px 48px;
  }

  .doc__title {
    font-size: 26px;
  }
}

/* Уважение к настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
