/* Статический сайт без сборки, без внешних шрифтов, скриптов и аналитики. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #e4e1d8;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --accent-soft: #e5f1ed;
  --warn-soft: #fbf1dc;
  --radius: 14px;
  --measure: 40rem;
  --wide: 62rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1b1f23;
    --text: #e8e9e6;
    --muted: #9aa3ad;
    --line: #2b3137;
    --accent: #5ec4a8;
    --accent-ink: #0d1f19;
    --accent-soft: #1b2b27;
    --warn-soft: #2d2718;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  hyphens: manual;
}

/* ---------- Языки: показывается только активный блок ---------- */
html[data-lang="ru"] [data-l]:not([data-l="ru"]),
html[data-lang="tr"] [data-l]:not([data-l="tr"]),
html[data-lang="en"] [data-l]:not([data-l="en"]) { display: none; }

/* ---------- Каркас ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem;
}

.narrow { max-width: var(--measure); }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 750; }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Шапка ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand span span { color: var(--accent); }

.langs { display: flex; gap: 0.25rem; }
.langs button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  min-width: 2.6rem;
  min-height: 2.25rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
}
.langs button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  border-radius: 999px;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

/* ---------- Герой ---------- */
.hero { padding-top: 2.5rem; padding-bottom: 3rem; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 36rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1.5rem 0 0.9rem; }

/* ---------- Секции ---------- */
section { padding: 2.5rem 0; border-top: 1px solid var(--line); }
section > .wrap > p.intro { color: var(--muted); max-width: var(--measure); }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
}
.card p:last-child, .card ul:last-child { margin-bottom: 0.75rem; }
.card .num {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

.price { font-size: 1.6rem; font-weight: 750; margin: 0 0 0.5rem; }

.ph {
  background: var(--warn-soft);
  padding: 0 0.25em;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  overflow-wrap: anywhere;
}

/* ---------- Герой с примером диалога ---------- */
@media (min-width: 56rem) {
  .hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center; }
}

.chat {
  margin: 2rem 0 0;
  max-width: 26rem;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0.9rem;
  font-size: 0.93rem;
  line-height: 1.45;
}
@media (min-width: 56rem) { .chat { margin: 0; justify-self: end; } }
.chat > div { display: flex; flex-direction: column; gap: 0.5rem; }
/* display:flex выше перебил бы скрытие неактивного языка — повторяем правило с большим весом */
html[data-lang="ru"] .chat > [data-l]:not([data-l="ru"]),
html[data-lang="tr"] .chat > [data-l]:not([data-l="tr"]),
html[data-lang="en"] .chat > [data-l]:not([data-l="en"]) { display: none; }

.chat .who { margin: 0.35rem 0 0; text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.msg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.msg.out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.msg.in { align-self: flex-start; max-width: 94%; border-bottom-left-radius: 4px; }
.msg p { margin: 0; flex-basis: 100%; }
.msg .tr { font-weight: 650; }
.voice {
  display: inline-block;
  width: 7.5rem;
  height: 1.1rem;
  background: currentColor;
  opacity: 0.55;
  /* «волна» голосового из полосок, без картинок */
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 6px);
  mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 6px);
  clip-path: polygon(0 40%, 8% 40%, 8% 15%, 18% 15%, 18% 30%, 28% 30%, 28% 0, 40% 0, 40% 35%, 52% 35%, 52% 10%, 64% 10%, 64% 45%, 76% 45%, 76% 20%, 88% 20%, 88% 38%, 100% 38%, 100% 62%, 88% 62%, 88% 80%, 76% 80%, 76% 55%, 64% 55%, 64% 90%, 52% 90%, 52% 65%, 40% 65%, 40% 100%, 28% 100%, 28% 70%, 18% 70%, 18% 85%, 8% 85%, 8% 60%, 0 60%);
}
.dur { font-size: 0.78rem; opacity: 0.8; }
.chat figcaption { text-align: center; font-size: 0.75rem; color: var(--muted); }

/* ---------- Языки бота ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 2rem; }
.chips li { margin: 0; padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.93rem; }

/* ---------- Тарифы и вопросы ---------- */
.price .per { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.fineprint { margin-top: 1.25rem; max-width: var(--measure); color: var(--muted); font-size: 0.93rem; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.1rem; margin-bottom: 0.6rem; }
summary { cursor: pointer; padding: 0.85rem 0; font-weight: 650; }
details[open] summary { padding-bottom: 0.5rem; }
details p { margin-bottom: 0.9rem; }
.center { text-align: center; }

/* ---------- Подвал ---------- */
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.92rem; }
footer p { margin-bottom: 0.5rem; }

/* ---------- Политика (длинный текст) ---------- */
.doc { padding-top: 1rem; padding-bottom: 3rem; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.doc h2 { margin-top: 2rem; font-size: 1.3rem; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.25em; font-size: 0.97rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 650; background: var(--accent-soft); }
.tablewrap { overflow-x: auto; }
/* на узком экране строка таблицы — карточка, подпись колонки берётся из data-th */
@media (max-width: 40rem) {
  .doc table, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { display: none; }
  .doc tr { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 0.7rem; padding: 0.5rem 0.2rem; }
  .doc td { border: 0; padding: 0.25rem 0.7rem; }
  .doc td:first-child { font-weight: 650; }
  .doc td + td::before { content: attr(data-th); display: block; font-size: 0.75rem; font-weight: 650; color: var(--muted); }
}
.note { background: var(--warn-soft); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.95rem; }

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

@media print {
  .langs, .cta, .top .langs { display: none; }
  body { background: #fff; color: #000; }
}
