/* ============================================================
   Artic Chat — сайт-визитка
   Светлая/тёмная тема через data-theme, адаптив, без зависимостей.
   ============================================================ */

/* ---------- Темы ---------- */
:root {
  --accent: #3390ec;
  --accent-strong: #2b7cd3;
  --accent-soft: rgba(51, 144, 236, 0.12);
  --green: #4fae4e;
  --purple: #8774e8;
  --orange: #e8933f;
  --sky: #41b6e6;
  --red: #e0685e;
  --teal: #3fb8a4;
  --pink: #e068a6;
  --indigo: #5c76dd;

  --radius: 6px;
  --radius-lg: 8px;
  --container: 860px;
  --header-h: 48px;
  --shadow-card: 0 1px 2px rgba(16, 35, 47, 0.05);
  --shadow-float: 0 2px 8px rgba(16, 35, 47, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --bg-hero: linear-gradient(180deg, #b6c9e4 0%, #ccd3da 55%, #e9ebed 100%);
  --surface: #ffffff;
  --text: #17212b;
  --text-2: #4d6073;
  --text-3: #8a9bab;
  --border: #e3e8ee;
  --nav-pill: #f0f2f5;
  --header-bg: #ffffff;
  --footer-bg: #f4f6f9;
  --bubble-in: #ffffff;
  --bubble-out: #e7f2d9;
  --code-bg: #f4f6f9;
}

[data-theme="dark"] {
  --bg: #17212b;
  --bg-soft: #1e2c3a;
  --bg-hero: linear-gradient(180deg, #1b2b3d 0%, #19242f 55%, #17212b 100%);
  --surface: #1e2c3a;
  --text: #f4f6f9;
  --text-2: #a9bac8;
  --text-3: #71869a;
  --border: #2b3d4f;
  --nav-pill: #2b3d4f;
  --header-bg: #1e2c3a;
  --footer-bg: #111a23;
  --bubble-in: #1e2c3a;
  --bubble-out: #2b5d43;
  --code-bg: #111a23;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-float: 0 2px 8px rgba(0, 0, 0, 0.32);
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* скроллбар всегда включён: ширина контента одинакова на любой странице —
     шапка не может «прыгнуть» по горизонтали из-за наличия/отсутствия скроллбара
     (работает во всех браузерах, в отличие от scrollbar-gutter) */
  overflow-y: scroll;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.08s ease;
}

body.page-leave {
  opacity: 0;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
.icon-arrow-more {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 3.5 11 8l-4.5 4.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 3.5 11 8l-4.5 4.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* смена языка: текст коротко гаснет, перевод применяется «невидимо» и
   появляется уже в новом месте — разная длина строк не даёт странице «прыгать» */
html.lang-swap body {
  opacity: 0;
  transition-duration: 0.11s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: 760px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, opacity 0.15s;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.btn-white {
  background: #fff;
  color: var(--accent);
  box-shadow: none;
}
.btn-white:hover { background: #f0f6fc; }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-sm { padding: 7px 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.badge-soon {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-live {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(79, 174, 78, 0.15);
  color: var(--green);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  /* в светлой теме границы нет — как на референсе, белая шапка сразу переходит в градиент */
  border-bottom: 1px solid transparent;
}
[data-theme="dark"] .site-header { border-bottom-color: var(--border); }
.header-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none !important;
}
.brand-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  display: block;
}
/* логотип с тёмным словом: в тёмной теме инвертируем, горы hue-rotate возвращает в синие */
[data-theme="dark"] .brand-logo {
  filter: invert(1) hue-rotate(180deg) brightness(1.1);
}

.main-nav {
  display: flex;
  gap: 0;
  margin-left: 18px;
}
.main-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  height: var(--header-h);
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 0;
  text-decoration: none !important;
  position: relative;
  transition: background 0.15s;
}
/* синяя черточка снизу кнопки: у активной — постоянно, при наведении — выезжает */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.main-nav a:hover { background: var(--nav-pill); }
.main-nav a.active { background: var(--nav-pill); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-cta { border-radius: 6px; padding: 7px 14px; }

/* переключатель языка */
.lang-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.lang-toggle:hover { background: var(--nav-pill); }

/* переключатель темы: луна/солнце из png.
   Кнопка строго фиксированного размера (36×36), иконки лежат абсолютно по центру —
   смена иконки (display:none) не меняет геометрию кнопки и ничего не «прыгает» */
.theme-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  padding: 0;
  position: relative;
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--nav-pill); }
.theme-toggle img {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.theme-toggle .ico-moon { width: 17px; height: 19px; }
.theme-toggle .ico-sun { width: 21px; height: 21px; }
[data-theme="light"] .theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
/* солнце чёрное — в тёмной теме делаем его белым */
[data-theme="dark"] .theme-toggle .ico-sun { filter: invert(1); }

/* бургер */
.burger {
  display: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-soft);
  cursor: pointer;
  padding: 9px 8px;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-2);
  transition: transform 0.2s, opacity 0.2s;
}
.burger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Главная: визитка ---------- */
.intro {
  padding: 72px 0 28px;
  text-align: center;
}
.intro-inner { max-width: 560px; }
.intro-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 auto 22px;
}
[data-theme="dark"] .intro-logo {
  filter: invert(1) hue-rotate(180deg) brightness(1.1);
}
.intro-lead {
  margin: 0 auto 26px;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.5;
}
.intro-note {
  margin: 16px 0 0;
  color: var(--text-3);
  font-size: 14px;
}
.intro-note a { font-weight: 600; }

/* ---------- Герой (не используется на главной) ---------- */
.hero {
  background: var(--bg-hero);
  padding: 72px 0 40px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
}
.hero-text h1 {
  font-size: clamp(38px, 5.5vw, 58px);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero-lead {
  font-size: 18px;
  color: var(--text-2);
  max-width: 480px;
  margin-bottom: 28px;
}
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.hero-meta {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
}

/* визуал героя: макет чата */
.hero-visual {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 144, 236, 0.25) 0%, transparent 65%);
  filter: blur(6px);
}
.chat-mock {
  position: relative;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: floaty 7s ease-in-out infinite;
}
.chat-mock-back {
  position: absolute;
  inset: 26px -28px -26px 56px;
  z-index: -1;
  background: var(--surface);
  opacity: 0.55;
  animation: floaty 7s ease-in-out infinite reverse;
}
.chat-mock-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.mock-ava {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a97f, #e8735c);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mock-peer { flex: 1; }
.mock-name { font-weight: 700; font-size: 15px; }
.mock-status { font-size: 12px; color: var(--accent); }
.mock-dots { color: var(--text-3); letter-spacing: 2px; font-weight: 700; }

.chat-mock-body {
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 15% 20%, var(--accent-soft) 0, transparent 34%),
    var(--bg-soft);
  min-height: 300px;
}
.mock-date {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 12px;
  border-radius: 4px;
}
.mock-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  box-shadow: none;
  position: relative;
  opacity: 0;
  animation: pop 0.5s ease forwards;
}
.mock-bubble.in {
  align-self: flex-start;
  background: var(--bubble-in);
  border-bottom-left-radius: 6px;
}
.mock-bubble.out {
  align-self: flex-end;
  background: var(--bubble-out);
  border-bottom-right-radius: 6px;
}
.msg-1 { animation-delay: 0.3s; }
.msg-2 { animation-delay: 1.0s; }
.msg-3 { animation-delay: 1.7s; }
.msg-4 { animation-delay: 2.4s; }
.msg-5 { animation-delay: 3.1s; }
.mock-ticks {
  color: var(--accent);
  font-size: 12px;
  margin-left: 6px;
  font-weight: 700;
}
.mock-bubble.typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.mock-bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.2s infinite;
}
.mock-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.mock-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes blink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}



/* ---------- Секции ---------- */
.section { padding: 48px 0 72px; }
.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.section-sub {
  text-align: center;
  color: var(--text-2);
  font-size: 17px;
  margin-bottom: 44px;
}

/* карточки возможностей */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: none;
  transition: border-color 0.15s;
}
.feature-card:hover { border-color: var(--text-3); }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 15px; }

.feature-ico {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.feature-ico svg { width: 18px; height: 18px; }

.ico-blue   { background: rgba(51, 144, 236, 0.14);  color: var(--accent); }
.ico-green  { background: rgba(79, 174, 78, 0.14);   color: var(--green); }
.ico-purple { background: rgba(135, 116, 232, 0.14); color: var(--purple); }
.ico-orange { background: rgba(232, 147, 63, 0.14);  color: var(--orange); }
.ico-sky    { background: rgba(65, 182, 230, 0.14);  color: var(--sky); }
.ico-red    { background: rgba(224, 104, 94, 0.14);  color: var(--red); }
.ico-teal   { background: rgba(63, 184, 164, 0.14);  color: var(--teal); }
.ico-pink   { background: rgba(224, 104, 166, 0.14); color: var(--pink); }
.ico-indigo { background: rgba(92, 118, 221, 0.14);  color: var(--indigo); }
.ico-dark   { background: var(--bg-soft);            color: var(--text-2); }

/* шаги «как начать» */
.steps-section { background: var(--bg-soft); }
.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: none;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 14.5px; }
.step-arrow {
  display: flex;
  align-items: center;
  color: var(--text-3);
}
.step-arrow svg { width: 26px; height: 26px; }

/* CTA */
.cta-section { padding-top: 40px; }
.cta-banner {
  background: linear-gradient(120deg, #3d9bef 0%, #2f7fd8 55%, #5a7fe0 100%);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: #fff;
  box-shadow: none;
}
.cta-text h2 { font-size: 30px; margin-bottom: 8px; }
.cta-text p { opacity: 0.92; font-size: 17px; max-width: 520px; }

/* ---------- Внутренние страницы ---------- */

/* аккордеон вопросов */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 16.5px;
  position: relative;
  padding-right: 52px;
  transition: background 0.15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--bg-soft); }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid var(--text-3);
  border-bottom: 2.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq-answer { padding: 0 22px 20px; color: var(--text-2); }
.faq-answer p + p { margin-top: 10px; }
.faq-answer b { color: var(--text); }

/* ---------- FAQ в стиле документации (по образцу docs.xrocket.exchange) ---------- */
.docs { padding: 30px 0 6px; }
.docs-layout {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 250px minmax(0, 760px) 210px;
  justify-content: center;
  gap: 40px;
  align-items: start;
}

/* левое дерево разделов */
.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow-y: auto;
  padding-right: 6px;
}
.docs-tree-root {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  padding: 6px 10px;
  text-decoration: none !important;
}
.docs-tree details { margin-top: 4px; }
.docs-tree summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 10px 26px 4px 10px;
  position: relative;
  user-select: none;
}
.docs-tree summary::-webkit-details-marker { display: none; }
.docs-tree summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.docs-tree details[open] summary::after { transform: rotate(45deg); }
.docs-tree details a {
  display: block;
  padding: 5px 10px 5px 18px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
  border-radius: 6px;
  text-decoration: none !important;
  transition: color 0.15s, background 0.15s;
}
.docs-tree details a:hover { color: var(--accent); background: var(--accent-soft); }
.docs-tree details a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* центральная колонка */
.docs-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-3);
  margin-bottom: 12px;
}
.docs-crumb a { color: var(--text-3); text-decoration: none !important; }
.docs-crumb a:hover { color: var(--accent); }
.crumb-sep { font-size: 16px; line-height: 1; color: var(--text-3); }
.docs-content h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.docs-lead { font-size: 17px; color: var(--text-2); margin-bottom: 4px; }
.docs-content h2 {
  font-size: 25px;
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.docs-content .faq-item {
  box-shadow: none;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* выноски в духе admonition из документации */
.admonition {
  border: 1px solid rgba(51, 144, 236, 0.35);
  border-left-width: 4px;
  border-radius: 6px;
  background: rgba(51, 144, 236, 0.08);
  padding: 16px 18px;
  margin: 24px 0;
}
.admonition .adm-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.admonition .adm-head svg { width: 19px; height: 19px; flex: none; }
.admonition p { color: var(--text-2); font-size: 15.5px; }
.admonition.tip {
  border-color: rgba(79, 174, 78, 0.4);
  background: rgba(79, 174, 78, 0.09);
}
.admonition.tip .adm-head { color: var(--green); }

/* пагинация «назад/далее» */
.docs-pagination { display: flex; gap: 16px; margin-top: 46px; }
.pg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 18px;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pg:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  text-decoration: none !important;
}
.pg span { font-size: 12.5px; color: var(--text-3); }
.pg b { color: var(--accent); font-weight: 600; font-size: 15.5px; }
.pg-next { text-align: right; align-items: flex-end; }

/* правое оглавление «на этой странице» */
.docs-toc {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  font-size: 13.5px;
}
.docs-toc .toc-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.docs-toc a {
  display: block;
  color: var(--text-2);
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--border);
  text-decoration: none !important;
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc a:hover { color: var(--accent); }
.docs-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1200px) {
  .docs-toc { display: none; }
  .docs-layout { grid-template-columns: 250px minmax(0, 760px); }
}
@media (max-width: 960px) {
  .docs-sidebar { display: none; }
  .docs-layout { grid-template-columns: minmax(0, 760px); }
  .docs-content h1 { font-size: 30px; }
}

/* ---------- Приложения: статья в стиле telegram.org/apps ---------- */
.apps-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 8px;
}
.apps-doc h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.apps-lead {
  font-size: 17px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.apps-lead strong { color: var(--text); }

/* мини-иллюстрация справа от вступления — как стикер на telegram.org */
.apps-visual {
  float: right;
  width: 220px;
  margin: 2px 0 16px 30px;
}

.apps-doc h2 {
  position: relative;
  font-size: 21px;
  margin: 36px 0 14px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.sec-anchor {
  margin-left: 8px;
  font-weight: 400;
  font-size: 17px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none !important;
}
.apps-doc h2:hover .sec-anchor,
.sec-anchor:focus-visible { opacity: 1; }
.sec-anchor:hover { color: var(--accent); }

/* список платформ: иконка + название + статус */
.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.app-list li { display: flex; align-items: center; gap: 14px; }
.pl-ico {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pl-ico svg { width: 25px; height: 25px; }
.pl-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pl-name { font-weight: 600; font-size: 16.5px; color: var(--text); }
a.pl-name { color: var(--accent); }
a.pl-name:hover { text-decoration: underline; }

.apps-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0 30px;
}
.apps-doc h3 {
  font-size: 24px;
  margin-bottom: 12px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.apps-doc p { color: var(--text-2); }
.apps-doc p + p { margin-top: 12px; }

@media (max-width: 640px) {
  .apps-visual { float: none; width: 100%; max-width: 300px; margin: 0 0 18px; }
  .apps-doc h1 { font-size: 28px; }
}

/* мини-иллюстрация веб-версии */
.mini-chat {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: none;
}
.mini-chat-head {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mini-chat-head span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}
.mini-chat-head span:first-child { background: #e0685e; }
.mini-chat-head span:nth-child(2) { background: #e8b23f; }
.mini-chat-head span:last-child { background: #4fae4e; }
.mini-chat-body { padding: 14px 12px; display: grid; gap: 8px; }
.mini-line {
  height: 12px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.mini-line.right { justify-self: end; background: var(--bubble-out); border-color: transparent; }
.w75 { width: 75%; } .w60 { width: 60%; } .w50 { width: 50%; } .w40 { width: 40%; } .w35 { width: 35%; }

/* ---------- Футер ---------- */
.site-footer {
  margin-top: 40px;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 44px 0 26px;
  color: var(--text-2);
  font-size: 14.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
}
.footer-brand { margin-bottom: 12px; }
.footer-about p { max-width: 320px; }
.footer-col h5 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: var(--text-2);
  padding: 4px 0;
  text-decoration: none !important;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 420px; margin-top: 8px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step-arrow { justify-content: center; transform: rotate(90deg); height: 26px; }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 14px;
    box-shadow: var(--shadow-card);
  }
  .main-nav.open { display: flex; }
  .main-nav a { height: auto; padding: 10px 14px; border-radius: 6px; }
  .burger { display: flex; }
  .header-cta { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 26px;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .section { padding: 52px 0; }
  .chat-mock { width: 290px; }
  .hero-glow { width: 360px; height: 360px; }
}

/* ---------- Главная в стиле telegram.org ---------- */
.tl_page_wrap { padding-top: 10px; }
.tl_main_page_container { max-width: 980px; }
.tl_main_wrap { position: relative; }
.tl_main_head { position: relative; padding-top: 20px; }

.tl_main_side_blog { position: absolute; right: -220px; top: 40px; width: 190px; }
.side_blog_wrap { width: 100%; }
.side_blog_header {
  display: inline-block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  text-decoration: none !important;
}
.side_blog_entries { display: flex; flex-direction: column; gap: 16px; }
.side_blog_entry { text-decoration: none !important; color: var(--text); }
.side_blog_entry:hover .side_blog_title { color: var(--accent); }
.side_blog_date { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.side_blog_title { font-size: 14px; line-height: 1.4; transition: color 0.15s; }

.tl_main_logo_wrap { text-align: center; margin: 56px 0 32px; }
.tl_main_logo { display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; }
.tl_main_logo_img { height: 72px; width: auto; }
[data-theme="dark"] .tl_main_logo_img { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
.tl_main_logo_lead {
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.tl_main_download_mobile {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
  max-width: 780px;
  margin: 0 auto 10px;
}
.tl_main_download_link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.04);
  color: var(--text) !important;
  font-weight: 500;
  font-size: 15.5px;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tl_main_download_link:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(51, 144, 236, 0.12);
  text-decoration: none !important;
}
.tl_main_download_link svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex: none;
}
.tl_main_download_link b { font-weight: 700; }

.tl_main_download_more_btn {
  flex-basis: 100%;
  display: inline-flex;
  justify-content: center;
  margin: 6px 0 8px;
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
}
.tl_main_download_more_btn:hover { text-decoration: underline !important; }

.tl_main_download_desktop_section { text-align: center; margin-bottom: 56px; }
.tl_main_download_desktop_links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}
.tl_main_download_desktop_link {
  color: var(--accent) !important;
  font-size: 15px;
  text-decoration: none !important;
}
.tl_main_download_desktop_link:hover { text-decoration: underline !important; }
.tl_main_download_desktop_link b { font-weight: 700; }

.tl_main_recent_news_wrap { max-width: 860px; margin: 0 auto 70px; }
.tl_main_recent_news_header { margin-bottom: 18px; }
.tl_main_recent_news_header a { color: var(--text); text-decoration: none !important; }
.tl_main_recent_news_header a:hover { color: var(--accent); }

.tl_main_recent_news_cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.dev_blog_card_link_wrap { text-decoration: none !important; color: var(--text); }
.dev_blog_card_wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
  padding: 22px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.dev_blog_card_wrap:hover { border-color: var(--accent); }
.dev_blog_card_title { margin: 0 0 8px; font-size: 18px; }
.dev_blog_card_lead { color: var(--text-2); font-size: 15px; }
.dev_blog_card_date { margin-top: auto; color: var(--text-3); font-size: 13px; }

.tl_main_body_header {
  text-align: center;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
  margin: 60px 0 34px;
}
.tl_main_cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.tl_main_card_cell { height: 100%; }
.tl_main_card_wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  height: 100%;
}
.tl_main_card_wrap:hover { border-color: transparent; }
.tl_main_card_ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.tl_main_card_ico svg { width: 22px; height: 22px; }
.tl_main_card_header { font-size: 18px; margin: 0 0 6px; }
.tl_main_card_lead { color: var(--text-2); font-size: 15px; line-height: 1.5; }

.tl_main_noshare { height: 20px; }

@media (max-width: 1200px) {
  .tl_main_side_blog { display: none; }
}
@media (max-width: 960px) {
  .tl_main_cards { grid-template-columns: repeat(2, 1fr); }
  .tl_main_recent_news_cards { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tl_main_cards { grid-template-columns: 1fr; }
  .tl_main_logo_img { height: 62px; }
  .tl_main_logo_wrap { margin: 48px 0 30px; }
}

/* доступность: уважаем отключённые анимации */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .mock-bubble { opacity: 1; }
}
