/* ============================================================
   ЩЩ — мессенджер. Лендинг.
   Стили: тёмная тема по умолчанию, светлая — по системе/переключателю.
   Без внешних зависимостей: системные шрифты, inline SVG.
   ============================================================ */

/* ---------- Токены ---------- */
:root {
  --bg: #08090c;
  --bg-soft: #0b0d12;
  --surface: #11141b;
  --surface-2: #171b24;
  --surface-3: #1d222d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f9;
  --text-soft: #c9cfda;
  --muted: #98a1b2;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --accent-ink: #120a24;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-line: rgba(167, 139, 250, 0.35);
  --ok: #4ade80;
  --warn: #e8b04b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 100px -40px rgba(0, 0, 0, 0.85);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --container: 1160px;
  --header-h: 68px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --surface-3: #e9ebf3;
  --line: rgba(14, 18, 32, 0.09);
  --line-strong: rgba(14, 18, 32, 0.16);
  --text: #12141c;
  --text-soft: #2b3040;
  --muted: #5c6475;
  --accent: #6d28d9;
  --accent-strong: #5b21b6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(109, 40, 217, 0.09);
  --accent-line: rgba(109, 40, 217, 0.28);
  --ok: #15803d;
  --warn: #a9701c;
  --shadow-sm: 0 1px 2px rgba(16, 22, 40, 0.06);
  --shadow-md: 0 18px 40px -24px rgba(16, 22, 40, 0.28);
  --shadow-lg: 0 40px 100px -48px rgba(16, 22, 40, 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-soft: #eef0f6;
    --surface: #ffffff;
    --surface-2: #f4f5fa;
    --surface-3: #e9ebf3;
    --line: rgba(14, 18, 32, 0.09);
    --line-strong: rgba(14, 18, 32, 0.16);
    --text: #12141c;
    --text-soft: #2b3040;
    --muted: #5c6475;
    --accent: #6d28d9;
    --accent-strong: #5b21b6;
    --accent-ink: #ffffff;
    --accent-soft: rgba(109, 40, 217, 0.09);
    --accent-line: rgba(109, 40, 217, 0.28);
    --ok: #15803d;
    --warn: #a9701c;
    --shadow-sm: 0 1px 2px rgba(16, 22, 40, 0.06);
    --shadow-md: 0 18px 40px -24px rgba(16, 22, 40, 0.28);
    --shadow-lg: 0 40px 100px -48px rgba(16, 22, 40, 0.35);
    color-scheme: light;
  }
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

/* Иконки в спрайте нарисованы штрихами: без этих правил <use> заливал бы
   контуры чёрным (а «гамбургер» и стрелки вообще исчезали). Элементы, которым
   нужна заливка, задают её атрибутом fill="currentColor" — он сильнее
   наследования. */
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
img { height: auto; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
figure { margin: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 18px -8px var(--accent-strong);
  flex: none;
}

.brand-name { font-size: 17px; line-height: 1.1; }
.brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-moon { display: none; }
:root[data-theme="light"] .icon-btn .icon-sun { display: none; }
:root[data-theme="light"] .icon-btn .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-btn .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .icon-btn .icon-moon { display: block; }
}

.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.15s ease,
    border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  box-shadow: 0 14px 34px -16px var(--accent-strong), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover { box-shadow: 0 18px 40px -16px var(--accent-strong), inset 0 1px 0 rgba(255, 255, 255, 0.2); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-2); }

.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }

.header-cta { display: inline-flex; }
.menu-toggle { display: none; }

/* мобильное меню */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 49;
  display: none;
  padding: 12px 20px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { color: var(--text); }

/* ---------- Секции ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section-line { border-top: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.section-title { font-size: clamp(28px, 3.6vw, 40px); }
.section-lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 17.5px);
  line-height: 1.65;
  max-width: 62ch;
}
.section-head--center .section-lead { margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 104px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -280px;
  right: -160px;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: -320px;
  left: -220px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}

.hero h1 {
  font-size: clamp(38px, 6.2vw, 64px);
  letter-spacing: -0.045em;
  line-height: 1.02;
}
.hero h1 .accent {
  color: var(--accent);
  background: linear-gradient(120deg, var(--accent) 10%, #7dd3fc 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  margin-top: 22px;
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.65;
}

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 15px; height: 15px; opacity: 0.8; }

/* магазины */
.stores { margin-top: 34px; }
.stores-label {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stores-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 480px;
}
.store-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 82px;
  padding: 26px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: not-allowed;
  opacity: 0.72;
  filter: saturate(0.4);
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.store-btn svg { width: 19px; height: 19px; }
.store-btn:hover,
.store-btn:focus-visible { opacity: 0.9; border-color: var(--line-strong); }
.store-btn[aria-disabled="true"] { pointer-events: auto; }
.store-btn .soon {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* визуал hero: телефоны */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
}

.phone {
  position: relative;
  border-radius: 2.6rem;
  background: #05060a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.phone img { width: 100%; height: auto; }

.phone--main {
  width: min(300px, 62%);
  transform: rotate(2.5deg);
  z-index: 2;
}
.phone--back {
  position: absolute;
  width: min(250px, 52%);
  right: 0;
  top: 8%;
  transform: rotate(-6deg) translateY(6%);
  opacity: 0.85;
  z-index: 1;
  filter: saturate(0.9) brightness(0.92);
}

.hero-float {
  position: absolute;
  z-index: 3;
  left: -4%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 250px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}
.hero-float .ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.hero-float .ico svg { width: 17px; height: 17px; }
.hero-float strong { display: block; font-size: 13px; line-height: 1.3; }
.hero-float span { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }

/* ---------- Возможности ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.feature-icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: 16.5px; letter-spacing: -0.02em; }
.feature p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ---------- Проблема → решение ---------- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.solution {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.solution:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* верхняя полоса: сама боль, дословно */
.solution-pain {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.solution-pain__mark { color: var(--warn); flex: none; margin-top: 1px; }
.solution-pain__mark svg { width: 16px; height: 16px; }

.solution-fix {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
}
.solution-fix h3 { font-size: 16.5px; letter-spacing: -0.02em; }
.solution-fix > p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

.solution-points { display: grid; gap: 7px; margin-top: 4px; }
.solution-points li {
  position: relative;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.solution-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 9px;
  height: 5px;
  border-left: 1.7px solid var(--accent);
  border-bottom: 1.7px solid var(--accent);
  transform: rotate(-45deg);
}

/* компактная полоса «ещё решает» */
.extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.extra {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.extra__ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.extra__ico svg { width: 17px; height: 17px; }
.extra__body strong { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.extra__body span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ---------- Скриншоты ---------- */
.shots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
}

.shot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
  border-radius: var(--radius-lg);
}
.shot-frame {
  position: relative;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 2.1rem;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.shot-frame img {
  width: 100%;
  border-radius: 1.55rem;
  display: block;
}
.shot:hover .shot-frame,
.shot:focus-visible .shot-frame {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}
.shot-zoom {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line-strong);
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
}
.shot-zoom svg { width: 16px; height: 16px; }
.shot:hover .shot-zoom,
.shot:focus-visible .shot-zoom { opacity: 1; transform: translateY(0); }

.shot-caption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 4px 0;
  font-size: 14px;
  font-weight: 600;
}
.shot-caption span { color: var(--muted); font-weight: 400; font-size: 13px; }

/* лайтбокс */
.lightbox {
  width: min(92vw, 460px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(4, 5, 9, 0.82); backdrop-filter: blur(6px); }
.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 64px);
  object-fit: contain;
  background: #05060a;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.lightbox-bar p { font-size: 13.5px; color: var(--muted); }
.lightbox-close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--line-strong); }

/* ---------- Темы ---------- */
.themes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.accents { margin-top: 26px; }
.accents-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.accent-row { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-dot {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--dot);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: transform 0.15s ease, outline-color 0.15s ease;
  outline: 2px solid transparent;
  outline-offset: 3px;
}
.accent-dot:hover { transform: scale(1.08); }
.accent-dot[aria-pressed="true"] { outline-color: var(--dot); }

.themes-visual { display: flex; justify-content: center; }
.themes-visual .phone { width: min(320px, 100%); transform: rotate(-2deg); }

.note {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.note svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }

/* ---------- Установка ---------- */
.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.steps { display: grid; gap: 12px; }
.step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.step-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.step h3 { font-size: 16.5px; }
.step p { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.step code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.spec-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
}
.spec-card h3 { font-size: 16px; }
.spec-list { margin-top: 18px; display: grid; gap: 14px; }
.spec-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.spec-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.spec-list dt, .spec-list .k { color: var(--muted); }
.spec-list .v { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- Скачивание ---------- */
.download-band {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
}
.download-band::before {
  content: "Щ";
  position: absolute;
  right: 4%;
  top: -34%;
  font-size: 300px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}
.download-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.download-band h2 { font-size: clamp(26px, 3.4vw, 38px); }
.download-band p { margin-top: 12px; max-width: 48ch; color: var(--muted); font-size: 15.5px; }
.download-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.download-actions .btn { width: 100%; }
.checksum {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.checksum .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.checksum code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.copy-btn {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- FAQ ---------- */
.faq { max-width: 880px; margin-inline: auto; display: grid; gap: 10px; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.faq-item[open] { border-color: var(--accent-line); background: var(--surface-2); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 22px;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
.faq-mark {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 0.25s ease, border-color 0.2s ease;
}
.faq-mark::before,
.faq-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 1.4px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease;
}
.faq-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
/* Открытый вопрос: «+» превращается в «−», а не крутится целиком. */
.faq-item[open] .faq-mark { border-color: var(--accent); color: var(--accent); }
.faq-item[open] .faq-mark::after { opacity: 0; transform: translate(-50%, -50%) rotate(0deg); }
.faq-body {
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}
.faq-body p + p { margin-top: 10px; }
.faq-body a { color: var(--accent); }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding-block: clamp(40px, 5vw, 64px) 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.footer-brand p {
  margin-top: 16px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.footer-col h3 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-col ul { display: grid; gap: 9px; }
.footer-col a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.footer-col a:hover { color: var(--text); text-decoration: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-bottom .made { display: inline-flex; align-items: center; gap: 7px; }
.footer-bottom svg { width: 14px; height: 14px; }

/* ---------- Тосты ---------- */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* ---------- Правовые страницы ---------- */
.doc-header {
  padding-block: clamp(36px, 5vw, 60px) clamp(22px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: none; }
.breadcrumbs .sep { opacity: 0.5; }

.doc-header h1 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.04em;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.doc-meta strong { color: var(--text-soft); font-weight: 600; }

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-block: clamp(32px, 4vw, 52px) clamp(56px, 7vw, 88px);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.doc-toc h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-toc ol { display: grid; gap: 2px; counter-reset: toc; }
.doc-toc li { counter-increment: toc; }
.doc-toc a {
  display: block;
  padding: 6px 8px 6px 30px;
  position: relative;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
}
.doc-toc a::before {
  content: counter(toc) ".";
  position: absolute;
  left: 8px;
  top: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
.doc-toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.prose { max-width: 78ch; color: var(--text-soft); font-size: 15.5px; line-height: 1.75; }
.prose > * + * { margin-top: 16px; }
.prose h2 {
  margin-top: 40px;
  padding-top: 4px;
  font-size: clamp(21px, 2.2vw, 25px);
  color: var(--text);
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 {
  margin-top: 26px;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.015em;
}
.prose p { color: var(--text-soft); }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { display: grid; gap: 8px; padding-left: 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--accent); }
.prose code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.prose blockquote {
  margin: 20px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 14.5px;
}
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { color: var(--text); font-weight: 600; background: var(--surface); white-space: nowrap; }
.prose td code, .prose th code { white-space: nowrap; overflow-wrap: normal; }
.prose tr:last-child td { border-bottom: 0; }
.prose td { color: var(--muted); }
.prose .doc-note {
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 14px;
}
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

/* ---------- Инструкции для разработчиков (bots.html, mini-apps.html) ---------- */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.doc-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none;
}
.doc-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--accent);
}
.doc-card__icon svg { width: 20px; height: 20px; }
.doc-card h3 { color: var(--text); font-size: 16px; letter-spacing: -0.02em; }
.doc-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.doc-card__more {
  margin-top: auto;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}

.prose .endpoint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.prose .endpoint b {
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.prose .code {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.prose .code__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.prose .code__title {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.prose .code__copy {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.prose .code__copy:hover { color: var(--text); border-color: var(--line-strong); }
.prose .code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 2;
}
.prose .code pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: inherit;
  overflow-wrap: normal;
}

.prose .callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.prose .callout svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }
.prose .callout--warn { border-left-color: var(--warn); }
.prose .callout--warn svg { color: var(--warn); }

.prose .checklist { list-style: none; padding-left: 0; }
.prose .checklist li {
  position: relative;
  padding-left: 26px;
}
.prose .checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1080px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .doc-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
  .header-cta { display: none; }

  .solutions-grid { grid-template-columns: minmax(0, 1fr); }
  .extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-visual { min-height: 480px; order: -1; }
  .phone--main { width: min(270px, 58%); }
  .phone--back { width: min(225px, 48%); right: 6%; }
  .hero-float { left: 2%; bottom: 6%; }
  .hero-lead { max-width: 60ch; }

  .themes { grid-template-columns: minmax(0, 1fr); }
  .themes-visual { order: -1; }

  .install-grid { grid-template-columns: minmax(0, 1fr); }
  .download-grid { grid-template-columns: minmax(0, 1fr); }

  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; }
  .doc-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --header-h: 62px; }
  .features-grid { grid-template-columns: minmax(0, 1fr); }
  .solution-pain,
  .solution-fix { padding-inline: 16px; }
  .extras { grid-template-columns: minmax(0, 1fr); }
  .shots-grid { grid-template-columns: minmax(0, 1fr); max-width: 420px; margin-inline: auto; }
  .store-grid, .stores-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .brand-sub { display: none; }
  .hero-visual { min-height: 420px; }
  .phone--main { width: min(230px, 60%); }
  .phone--back { width: min(190px, 48%); right: 2%; top: 4%; }
  .hero-float { left: 0; bottom: 2%; max-width: 210px; padding: 9px 12px; }
  .hero-float .ico { width: 30px; height: 30px; }
  .doc-toc ol { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: clamp(48px, 12vw, 72px); }
  .hero-actions .btn { width: 100%; }
  .hero-actions { gap: 10px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: clamp(34px, 11vw, 44px); }
  .stores-grid { gap: 6px; }
  .store-btn { min-height: 66px; font-size: 11.5px; }
  .store-btn svg { width: 18px; height: 18px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Доступность: движение ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Печать ---------- */
@media print {
  .site-header, .site-footer, .hero-visual, .stores, .hero-actions,
  .download-actions, .toast, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
}
