/*
 * Тема — системная (prefers-color-scheme). Цвета — от акцента приложения #00897B (Material 3,
 * ColorScheme.fromSeed): светлые и тёмные значения токенов ниже.
 */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', system-ui, Roboto,
    'Helvetica Neue', Arial, sans-serif;

  --bg: #f4fbf9;
  --surface: #ffffff;
  --surface-2: #e9f2f0;
  --border: #d5e3e0;
  --text: #161d1c;
  --muted: #56615f;
  --accent: #00897b;
  --accent-strong: #006a60;
  --accent-text: #ffffff;
  --accent-soft: #cce8e3;
  --accent-soft-text: #00201c;
  --warn: #9a5b00;
  --shadow: 0 1px 2px rgb(0 32 28 / 6%), 0 8px 24px rgb(0 32 28 / 8%);
  --phone-shadow: 0 30px 60px rgb(0 32 28 / 22%), 0 6px 16px rgb(0 32 28 / 12%);

  --radius: 16px;
  --radius-lg: 28px;
  --content: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --surface: #161d1c;
    --surface-2: #1d2624;
    --border: #2b3533;
    --text: #dde4e2;
    --muted: #9eaaa7;
    --accent: #4fd8c4;
    --accent-strong: #84f4df;
    --accent-text: #003731;
    --accent-soft: #1e4a44;
    --accent-soft-text: #a7f0e3;
    --warn: #ffb870;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    --phone-shadow: 0 30px 60px rgb(0 0 0 / 50%), 0 6px 16px rgb(0 0 0 / 40%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left));
}

/* Шапка */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 15px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.lang {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }
  .lang {
    margin-left: auto;
  }
}

/* Кнопки */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.button:hover {
  background: var(--surface-2);
}

.button-accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
}

.button-accent:hover {
  background: var(--accent-strong);
}

.button svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.note {
  color: var(--muted);
  font-size: 14px;
}

/* Первый экран */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding-block: 64px 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  margin: 20px 0 32px;
  max-width: 34em;
}

.hero .note {
  margin-top: 16px;
}

.hero-art {
  display: flex;
  justify-content: center;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 40px 56px;
    text-align: center;
  }
  .hero .lead {
    margin-inline: auto;
  }
  .hero .actions {
    justify-content: center;
  }
}

/* Телефон со скриншотом */

.phone {
  width: min(300px, 78vw);
  border-radius: 40px;
  padding: 10px;
  background: #1b1f1e;
  box-shadow: var(--phone-shadow);
  flex: none;
}

/* Скриншот открывается на весь экран (shots.js) */
.phone a {
  display: block;
  cursor: zoom-in;
  border-radius: 31px;
}

.phone a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.phone img {
  border-radius: 31px;
  aspect-ratio: 1080 / 2340;
  width: 100%;
  background: var(--surface-2);
}

/* Разделы */

.section {
  padding: 72px 0;
}

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

.section h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section .intro {
  color: var(--muted);
  font-size: 18px;
  max-width: 40em;
  margin-bottom: 40px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card h3 {
  font-size: 19px;
  margin: 16px 0 8px;
}

.card p {
  color: var(--muted);
}

.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

.icon svg {
  width: 26px;
  height: 26px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  margin-bottom: 16px;
}

.steps h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.steps p {
  color: var(--muted);
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* Галерея скриншотов */

.gallery {
  list-style: none;
  margin: 0;
  padding: 8px var(--gutter) 32px;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: var(--gutter);
}

.gallery li {
  scroll-snap-align: start;
  text-align: center;
}

.gallery .phone {
  width: 216px;
  border-radius: 34px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.gallery .phone img {
  border-radius: 26px;
}

.gallery figcaption {
  margin-top: 16px;
  font-weight: 600;
}

@media (min-width: 1240px) {
  .gallery {
    justify-content: center;
  }
}

/* Приватность и цена */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.split .card {
  padding: 32px;
}

.split .card h2 {
  font-size: 26px;
  margin: 16px 0 12px;
}

.price {
  font-size: 44px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.02em;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Вопросы */

.faq {
  max-width: 820px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  padding: 0 20px 18px;
  color: var(--muted);
}

/* Подвал */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-left: auto;
}

.footer a {
  color: var(--muted);
}

/* Документы: политика и соглашение */

.doc {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 72px;
}

.doc h1 {
  font-size: clamp(30px, 4vw, 40px);
  margin-bottom: 8px;
}

.doc .note {
  margin-bottom: 32px;
}

.doc h2 {
  font-size: 21px;
  margin: 36px 0 12px;
}

.doc p,
.doc li {
  color: var(--text);
}

.doc p + p {
  margin-top: 12px;
}

.doc ul {
  padding-left: 22px;
  margin: 12px 0;
}

.doc li + li {
  margin-top: 6px;
}

/* Ссылки из QR: /join и /login */

.landing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px var(--gutter);
}

.landing-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.landing-card > img {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
}

.landing-card h1 {
  font-size: 26px;
  margin-bottom: 12px;
}

.landing-card .lead {
  color: var(--muted);
  margin-bottom: 24px;
}

.landing-card ol {
  text-align: left;
  margin: 24px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.landing-card li + li {
  margin-top: 6px;
}

.landing-card .button {
  width: 100%;
}

.landing-card .switch {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
}

/* Язык страницы-ссылки выбирает lang.js; без скрипта — русский */
html:not([data-lang='en']) [data-only='en'],
html[data-lang='en'] [data-only='ru'] {
  display: none;
}

.card .note {
  margin-top: 16px;
}
