:root {
  --ink: #17132B;
  --ink-soft: #55506E;
  --paper: #F6F5FB;
  --tint: #ECE9F8;
  --line: #D9D5EC;
  --violet: #6D5CFF;
  --violet-deep: #4B3BD6;
  --mint: #12805C;
  --night: #14112A;
  --bubble: #231E47;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

a { color: var(--violet-deep); }
a:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }

/* Шапка */
.top { border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }

.btn {
  display: inline-block;
  background: var(--violet);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 15px 26px;
  border-radius: 14px;
}
.btn:hover { background: var(--violet-deep); }
.btn-small { padding: 9px 16px; border-radius: 10px; font-size: 0.95rem; }
.link { font-weight: 500; }

/* Первый экран */
.hero { padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.lead { margin-top: 24px; font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }

.chat {
  margin: 0;
  background: var(--night);
  color: #EDEBFA;
  border-radius: 28px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #2B2552; }
.chat-head b { display: block; font-weight: 600; }
.chat-head span { font-size: 0.8rem; color: #9C96C4; }
.msg { background: var(--bubble); border-radius: 6px 18px 18px 18px; padding: 12px 14px 8px; max-width: 88%; }
.msg b { display: block; margin-bottom: 4px; font-weight: 600; }
.msg time { display: block; text-align: right; font-size: 0.72rem; color: #9C96C4; margin-top: 4px; }
.msg-user { background: var(--violet); align-self: flex-end; border-radius: 18px 6px 18px 18px; }
.msg-user time { color: #DAD5FF; }
.chat figcaption { font-size: 0.8rem; color: #9C96C4; padding-top: 4px; }

/* Разделы */
.block { padding: 80px 0; }
.block-tint { background: var(--tint); }
.section-lead { margin-top: 16px; color: var(--ink-soft); max-width: 40em; }

/* Таблицы */
.grid { width: 100%; border-collapse: collapse; margin-top: 40px; text-align: left; }
.grid caption { text-align: left; font-size: 1.3rem; font-weight: 600; padding-bottom: 12px; }
.grid thead th { font-size: 0.85rem; font-weight: 500; color: var(--ink-soft); padding: 10px 16px 10px 0; border-bottom: 2px solid var(--ink); }
.grid tbody th, .grid td { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody th { font-weight: 600; width: 26%; }
.grid td:last-child { width: 24%; padding-right: 0; font-weight: 500; }
.grid .free { color: var(--mint); font-weight: 600; }
.grid-prices td:nth-child(2) { font-weight: 600; white-space: nowrap; width: 16%; }
.grid-prices td:last-child { width: auto; font-weight: 400; color: var(--ink-soft); }

/* Шаги */
.steps { list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: step; color: var(--ink-soft); }
.steps li::before { content: counter(step); display: block; font-size: 3rem; font-weight: 700; line-height: 1; color: var(--violet); margin-bottom: 14px; }
.steps b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; }

/* Внутренние страницы */
.doc { padding: 40px 0 72px; }
.doc-wrap { max-width: 860px; }
.crumbs { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 20px; }
.crumbs a { color: var(--ink-soft); }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.doc .lead { max-width: none; }
.doc h2 { font-size: 1.5rem; margin-top: 56px; }
.doc p { margin-top: 16px; }
.doc ul, .doc ol { margin: 16px 0 0; padding-left: 1.3em; }
.doc li { margin-top: 8px; }
.doc .grid { margin-top: 24px; }
.doc .grid tbody th { width: 28%; }
.doc .grid td:last-child { width: auto; font-weight: 400; }
.doc code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; background: var(--tint); padding: 1px 6px; border-radius: 5px; }
.doc-date { margin-top: 48px; font-size: 0.9rem; color: var(--ink-soft); }
.kb-list { list-style: none; padding-left: 0; }
.doc .kb-list li { margin-top: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.kb-list a { font-weight: 600; font-size: 1.1rem; }
.kb-list span { display: block; margin-top: 4px; color: var(--ink-soft); }

/* Подвал */

.foot { padding: 32px 0 40px; font-size: 0.9rem; color: var(--ink-soft); }
.foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 860px) {
  .nav { display: none; }
  .btn-small { margin-left: auto; }
  .hero { padding: 40px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .block { padding: 56px 0; }
  .wrap { padding: 0 16px; }

  .grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .grid, .grid tbody, .grid tr, .grid tbody th, .grid td { display: block; width: auto; }
  .grid tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .grid tbody th, .grid td, .grid td:last-child, .grid-prices td:nth-child(2) { border: 0; padding: 0 0 6px; width: auto; }
  .doc .grid tbody th { width: auto; }
}

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