/* Посадочные страницы: тот же язык оформления, что и в приложении,
   но без единого килобайта JavaScript — страница должна открываться мгновенно
   и одинаково хорошо индексироваться. */

:root {
  color-scheme: dark;
  --bg: #0b0b0e;
  --surface: #131317;
  --surface-2: #17171d;
  --border: #26262e;
  --text: #ececf1;
  --dim: #a1a1aa;
  --faint: #6b6b75;
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --ok: #3fb950;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f6f8;
    --surface: #ffffff;
    --surface-2: #fafafb;
    --border: #e3e3e8;
    --text: #18181b;
    --dim: #5d5d68;
    --faint: #8e8e99;
    --accent: #5b4bdb;
    --accent-soft: rgba(91, 75, 219, 0.09);
    --ok: #1a7f37;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

header.top {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  text-decoration: none;
  color: inherit;
  letter-spacing: -0.01em;
}

.mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #4dd4c0);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

nav.formats {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

nav.formats a {
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 8px;
}

nav.formats a:hover {
  background: var(--surface-2);
  color: var(--text);
}

nav.formats a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
}

h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 48px 0 16px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 44px 0 12px;
}

h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}

p {
  color: var(--dim);
  margin: 0 0 14px;
}

.lead {
  font-size: 18px;
  color: var(--text);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 10px;
  margin: 10px 0 6px;
}

.cta:hover {
  filter: brightness(1.08);
}

.cta-note {
  font-size: 13.5px;
  color: var(--faint);
  margin-top: 8px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
}

.card p {
  margin: 0;
  font-size: 14.5px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 16px 0;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  font-weight: 600;
}

td code,
p code,
li code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

ul {
  color: var(--dim);
  padding-left: 22px;
}

li {
  margin-bottom: 7px;
}

.privacy {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  margin: 28px 0;
}

.privacy strong {
  color: var(--text);
}

details {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
}

details p {
  margin: 10px 0 0;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding: 26px 0 40px;
  color: var(--faint);
  font-size: 14px;
}

footer a {
  color: var(--dim);
}

.related {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.related a {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 14.5px;
  background: var(--surface);
}

.related a:hover {
  border-color: var(--accent);
}


/* --- Статьи --------------------------------------------------------------- */

.crumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  color: var(--faint);
  margin-top: 26px;
}

.crumbs a {
  color: var(--dim);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent);
}

.article h1 {
  margin-top: 14px;
}

.article h2 {
  margin-top: 42px;
}

.article > p,
.article li {
  font-size: 16.5px;
}

/* Ссылки внутри текста статьи выделяем, но не трогаем кнопки и навигацию */
.article > p a,
.article li a,
.article td a {
  color: var(--accent);
}

.art-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.art-list li {
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.art-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.art-list a:hover {
  color: var(--accent);
}

.art-note {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.5;
}


/* --- Оглавление, служебные ссылки, карточки-ссылки ------------------------ */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

.top-cta {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 13px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.top-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.meta-line {
  font-size: 13.5px;
  color: var(--faint);
  margin: -6px 0 18px;
}

.meta-line a {
  color: var(--dim);
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px 16px;
  margin: 0 0 8px;
}

.toc-title {
  margin: 0 0 8px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  color: var(--dim);
}

.toc li {
  margin-bottom: 4px;
  font-size: 15px;
}

.toc a {
  color: var(--dim);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 120ms;
}

.card-link:hover {
  border-color: var(--accent);
}

.card-link h3 {
  color: var(--text);
}

/* Заголовки статей получают якорь — на них ссылается оглавление */
.article h2[id] {
  scroll-margin-top: 74px;
}

@media (max-width: 640px) {
  .top-cta {
    display: none;
  }
  nav.formats a {
    padding: 5px 8px;
  }
}
