/*
 * Стили лендинга.
 *
 * Палитра — та же, что в мобилке (`apps/mobile/src/theme/colors.ts`):
 * страница и приложение должны читаться как одна система, поэтому значения
 * скопированы буквально, а не подобраны на глаз. Если меняется токен в
 * мобилке — меняется и здесь.
 *
 * Шрифты системные: своих файлов нет намеренно. Веб-шрифт с CDN — это
 * лишний запрос и мигание текста на медленном мобильном интернете, ради
 * страницы с одной кнопкой это не окупается.
 */

/* ── Токены ───────────────────────────────────────────────────────── */

:root {
  /* Общие для обеих тем (sharedColors в мобилке) */
  --accent: #ff6b35;
  --accent-contrast: #ffffff;
  --success: #2e9b4f;

  /* Светлая тема (lightBase) */
  --bg: #fffbf6;
  --surface: #ffffff;
  --surface-2: #fbf1e7;
  --text-primary: #22190f;
  --text-secondary: #8c8074;
  --text-tertiary: #b7ada2;
  --border: rgba(30, 20, 10, 0.08);
  --skeleton: #efe5d8;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow-card: 0 4px 16px rgba(30, 20, 10, 0.06);
  --shadow-btn: 0 6px 18px rgba(255, 107, 53, 0.32);
  --maxw: 1080px;
}

/* Тёмная тема — по системной настройке (darkBase). Переопределяются только
   темозависимые токены, акцент и статусы общие. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120e;
    --surface: #211c17;
    --surface-2: #2b2420;
    --text-primary: #f6efe7;
    --text-secondary: #a79c90;
    --text-tertiary: #756a5f;
    --border: rgba(255, 255, 255, 0.08);
    --skeleton: #332c25;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

/* ── База ─────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

/* Размеры тянутся за шириной экрана: страницу открывают и с телефона,
   и с ноутбука, а брейкпоинтов ради одного заголовка не хочется. */
h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  font-weight: 800;
}

h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  margin-bottom: 24px;
}

h3 {
  font-size: 19px;
  font-weight: 700;
}

p {
  margin: 0 0 12px;
}

.muted {
  color: var(--text-secondary);
}

/* Ссылки в тексте: акцентом и с подчёркиванием. Без явного правила браузер
   красит их своим синим и посещённые — фиолетовым, что выпадает из палитры.
   Кнопки (.btn) перекрывают это правило своими стилями. */
a:not(.btn):not(.logo) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:not(.btn):not(.logo):hover {
  text-decoration-thickness: 2px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 720px;
}

/* Видна только при переходе с клавиатуры */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 16px;
  z-index: 10;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ── Кнопки ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 22px;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
  box-shadow: var(--shadow-btn);
}

/* ── Шапка ────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 19px;
}

.logo-mark {
  font-size: 22px;
}

/* ── Обложка ──────────────────────────────────────────────────────── */

.hero {
  padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 7vw, 88px);
  background:
    radial-gradient(
      1000px 420px at 78% -8%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 70%
    ),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 42ch;
  margin-bottom: 28px;
}

.hero-actions {
  scroll-margin-top: 80px; /* чтобы якорь не уезжал под липкую шапку */
}

/* Рамка телефона — чистый CSS, картинка внутри подставится позже */
.hero-phone {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(280px, 72vw);
  aspect-ratio: 9 / 19.5;
  padding: 10px;
  border-radius: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface-2);
  /* Скриншот снят ровно в пропорции рамки, но cover страхует от искажения,
     если следующий кадр снимут в другом размере. */
  object-fit: cover;
  display: block;
}

/* Заглушка вместо скриншота: видно, что место занято намеренно */
.placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  background: repeating-linear-gradient(
    45deg,
    var(--surface-2),
    var(--surface-2) 10px,
    var(--skeleton) 10px,
    var(--skeleton) 20px
  );
  border: 1px dashed var(--text-tertiary);
}

/* ── Секции ───────────────────────────────────────────────────────── */

.section {
  padding: clamp(40px, 6vw, 80px) 0;
}

.section-muted {
  background: var(--surface-2);
}

.section-lead {
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── Карточки преимуществ ─────────────────────────────────────────── */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.card-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 16px;
}

/* ── Лента скриншотов ─────────────────────────────────────────────── */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  /* На телефоне лента листается вбок с прилипанием к карточке */
  scroll-snap-type: x mandatory;
}

.shot {
  margin: 0;
  scroll-snap-align: start;
}

.shot .phone-screen {
  aspect-ratio: 9 / 19.5;
  height: auto;
  border-radius: var(--radius);
}

.shot figcaption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Шаги установки ───────────────────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 64px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.steps p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

/* Требования к телефону — строка над шагами */
.requirements {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Скриншот внутри шага: показываем узкой полосой, а не во всю ширину —
   на экране Android важен один диалог, а не весь интерфейс телефона. */
.step-shot {
  margin-top: 12px;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
}

/* ── Частые проблемы ──────────────────────────────────────────────── */

.faq-title {
  margin: 32px 0 12px;
  font-size: 21px;
}

.faq {
  margin: 0 0 28px;
  display: grid;
  gap: 14px;
}

.faq dt {
  font-weight: 700;
  margin-bottom: 2px;
}

.faq dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Подвал ───────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-logo {
  font-weight: 800;
  margin: 0 0 4px;
}

.footer-inner p {
  margin: 0;
  font-size: 15px;
}

.footer-contacts {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 15px;
}

.footer-heading {
  font-weight: 700;
  margin: 0 0 6px;
}

/* Контакт — строка «иконка + значение». Подчёркивание снято: в подвале
   две подчёркнутые ссылки подряд читаются как мусор; связь остаётся
   понятной по иконке, а подчёркивание возвращается на наведение. */
.contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0; /* палец попадает в ссылку на телефоне */
}

/* Селектор повторяет форму общего правила для ссылок (`a:not(.btn):not(.logo)`),
   иначе то правило перебивает по специфичности и красит всю строку акцентом —
   вместе с оранжевой иконкой получается слишком крикливо. Акцент оставлен
   только иконке. */
a.contact:not(.btn):not(.logo) {
  color: var(--text-primary);
  text-decoration: none;
}

a.contact:not(.btn):not(.logo):hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--accent);
}

/* ── Узкие экраны ─────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  /* Телефон уходит под текст: на узком экране сначала должно читаться,
     что это, и только потом картинка. */
  .hero-phone {
    order: 2;
  }

  .btn-lg {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}
