﻿/* =========================================================================
   Дизайн-система сайта. Один файл, без сборки.
   Порядок: токены → сброс → типографика → атомы → компоненты → секции → адаптив.
   ========================================================================= */

/* --- 1. Токены ---------------------------------------------------------- */
/*
   Тема переключается тремя способами и в таком приоритете:
   1) :root — светлая по умолчанию;
   2) системная настройка, если пользователь ничего не выбирал руками;
   3) явный выбор через data-theme — он всегда сильнее системного.

   Тёмные значения приходится дублировать в двух селекторах: CSS не умеет
   применять один блок к нескольким условиям без препроцессора.
*/
:root {
  /* Поверхности */
  --bg:            #ffffff;
  --bg-soft:       #f6f7f9;
  --bg-sunk:       #eaedf2;

  /* Фон карточек и панелей. На светлой теме совпадает с фоном страницы —
     карточки держатся на границах. На тёмной он светлее фона: в тёмном
     интерфейсе поднятая поверхность обязана быть светлее, иначе карточка
     читается как дырка, а не как объект поверх страницы. */
  --surface:       #ffffff;

  /* Инвертированная поверхность: тёмные плашки на светлой теме и наоборот.
     Раньше здесь стоял --text, из-за чего в тёмной теме эти блоки
     превращались в светлые прямоугольники со светлым текстом. */
  --invert-bg:     #14181f;
  --invert-text:   #ffffff;
  --invert-dim:    rgba(255, 255, 255, .72);
  --invert-faint:  rgba(255, 255, 255, .14);

  /* Полупрозрачная подложка липкой шапки */
  --header-bg:     rgba(255, 255, 255, .88);

  /* Текст */
  --text:          #14181f;
  --text-2:        #4b5462;
  --text-3:        #79828f;

  /* Линии */
  --border:        #e4e7ec;
  --border-strong: #d2d8e0;

  /* Акцент */
  --accent:        #1f5fd1;
  --accent-hover:  #1a4fae;
  --accent-soft:   #eef3fd;
  --accent-line:   #cfe0fb;
  /* Текст поверх акцентной заливки. В тёмной теме акцент светлеет,
     и белые буквы на нём перестают читаться — отсюда отдельный токен. */
  --on-accent:     #ffffff;

  /* Статусы */
  --ok:            #0f7a52;
  --ok-soft:       #e7f5ee;
  --ok-line:       #c5e7d6;
  --warn:          #9a6207;
  --warn-soft:     #fdf3e2;
  --warn-line:     #f0dcb4;
  --danger:        #b3261e;
  --danger-hover:  #8c1d18;
  --danger-soft:   #fdecea;
  --danger-line:   #f5c6c2;
  --info-soft:     #eef1f7;

  /* Насыщенность цветных плашек рубрик. В тёмной теме та же формула
     с другими числами — поэтому вынесено в токены, а не зашито в hsl(). */
  --hue-icon-l:    46%;
  --hue-icon-s:    68%;
  --hue-bg-l:      95%;
  --hue-bg-s:      88%;
  --hue-line-a:    .28;

  /* Скругления */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Тени: используются только на наведении, статика держится на границах */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow:    0 8px 24px -8px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);

  /* Раскладка */
  --container: 1180px;
  --gutter: 24px;

  /* Шрифты. Inter подхватывается, если установлен в системе;
     на этапе продакшена подключим локальные .woff2 — без Google Fonts. */
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --tr: 160ms cubic-bezier(.4, 0, .2, 1);
  --tr-slow: 420ms cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0f1115;
    --bg-soft:       #15181e;
    --bg-sunk:       #1e222b;
    --surface:       #171b22;

    --invert-bg:     #1c2129;
    --invert-text:   #f2f4f7;
    --invert-dim:    rgba(242, 244, 247, .68);
    --invert-faint:  rgba(242, 244, 247, .12);

    --header-bg:     rgba(15, 17, 21, .86);

    --text:          #e9ecf1;
    --text-2:        #a7b0bd;
    --text-3:        #79828f;

    --border:        #262b34;
    --border-strong: #363d49;

    --accent:        #5f95ff;
    --accent-hover:  #85b0ff;
    --accent-soft:   #16213a;
    --accent-line:   #2b3d63;
    --on-accent:     #0b1220;

    --ok:            #4ec98d;
    --ok-soft:       #12241c;
    --ok-line:       #1f4534;
    --warn:          #e0a13a;
    --warn-soft:     #241d10;
    --warn-line:     #4a3a1c;
    --danger:        #ff7b72;
    --danger-hover:  #ff9d96;
    --danger-soft:   #2a1614;
    --danger-line:   #4d2320;
    --info-soft:     #1b1f27;

    --hue-icon-l:    68%;
    --hue-icon-s:    62%;
    --hue-bg-l:      16%;
    --hue-bg-s:      38%;
    --hue-line-a:    .34;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 10px 28px -10px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .5);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:            #0f1115;
  --bg-soft:       #15181e;
  --bg-sunk:       #1e222b;
  --surface:       #171b22;

  --invert-bg:     #1c2129;
  --invert-text:   #f2f4f7;
  --invert-dim:    rgba(242, 244, 247, .68);
  --invert-faint:  rgba(242, 244, 247, .12);

  --header-bg:     rgba(15, 17, 21, .86);

  --text:          #e9ecf1;
  --text-2:        #a7b0bd;
  --text-3:        #79828f;

  --border:        #262b34;
  --border-strong: #363d49;

  --accent:        #5f95ff;
  --accent-hover:  #85b0ff;
  --accent-soft:   #16213a;
  --accent-line:   #2b3d63;
  --on-accent:     #0b1220;

  --ok:            #4ec98d;
  --ok-soft:       #12241c;
  --ok-line:       #1f4534;
  --warn:          #e0a13a;
  --warn-soft:     #241d10;
  --warn-line:     #4a3a1c;
  --danger:        #ff7b72;
  --danger-hover:  #ff9d96;
  --danger-soft:   #2a1614;
  --danger-line:   #4d2320;
  --info-soft:     #1b1f27;

  --hue-icon-l:    68%;
  --hue-icon-s:    62%;
  --hue-bg-l:      16%;
  --hue-bg-s:      38%;
  --hue-line-a:    .34;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 10px 28px -10px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .5);

  color-scheme: dark;
}

/* --- 2. Сброс ----------------------------------------------------------- */
*, *::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-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; }

/* --- 3. Типографика ----------------------------------------------------- */
h1, h2, h3 { line-height: 1.18; letter-spacing: -.02em; font-weight: 640; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 820px; }

/* --- 4. Иконки ---------------------------------------------------------- */
.icon { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.icon--xs { width: 16px; height: 16px; }
.icon--lg { width: 32px; height: 32px; }

/* --- 5. Кнопки ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px; font-weight: 560; white-space: nowrap;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr);
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--text-3); background: var(--bg-soft); }
.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--lg { padding: 14px 26px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn:active { transform: translateY(1px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 560; font-size: 15px; white-space: nowrap;
}
.link-arrow .icon { transition: transform var(--tr); }
.link-arrow:hover .icon { transform: translateX(3px); }

.link-muted { color: var(--text-3); font-size: 14px; border-bottom: 1px solid var(--border-strong); }
.link-muted:hover { color: var(--text); }

/* --- 6. Метки, чипы, бейджи --------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  background: var(--info-soft); color: var(--text-2);
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 540; line-height: 1.4;
}
.chip--filter { background: var(--surface); border-color: var(--border); color: var(--text-2); transition: all var(--tr); }
.chip--filter:hover { border-color: var(--border-strong); color: var(--text); }
.chip--filter.is-active { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 580; letter-spacing: .01em;
}
.badge--free { background: var(--ok-soft); color: var(--ok); }
.badge--paid { background: var(--bg-sunk); color: var(--text-2); }

.kind {
  display: inline-flex; padding: 4px 10px; border-radius: var(--r-xs);
  font-size: 12.5px; font-weight: 580;
}
.kind--law  { background: var(--accent-soft); color: var(--accent); }
.kind--case { background: var(--warn-soft);   color: var(--warn); }
.kind--note { background: var(--info-soft);   color: var(--text-2); }

.meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 14px;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag {
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--text-3);
  font-size: 13.5px; transition: all var(--tr);
}
.tag:hover { background: var(--accent-soft); color: var(--accent); }

/* --- 7. Шапка ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 28px;
  height: 68px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo__mark { color: var(--accent); display: inline-flex; }
.logo__text { font-size: 17px; font-weight: 640; letter-spacing: -.02em; }
.logo-wrap { margin-bottom: 24px; }

/* Монограмма прочерчивается при наведении. Работает на штриховых
   долях от pathLength="100", поэтому не зависит от размера знака. */
.logo__glyph { stroke-dasharray: 100; stroke-dashoffset: 0; }
.logo:hover .logo__glyph { animation: trace 720ms cubic-bezier(.4, 0, .2, 1); }
@keyframes trace {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

/* Латинское название набирается чуть свободнее: в кириллице межбуквенное
   расстояние по умолчанию читается нормально, латиница в этом кегле сжимается. */
.logo__text { letter-spacing: -.01em; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.site-nav__link {
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 15px; color: var(--text-2);
  transition: background var(--tr), color var(--tr);
}
.site-nav__link:hover { background: var(--bg-soft); color: var(--text); }
.site-nav__link.is-active { color: var(--text); font-weight: 560; background: var(--bg-soft); }
.site-nav__link--mobile { display: none; }

.site-header__actions { display: flex; align-items: center; gap: 10px; flex: none; }
/* Телефон в шапке: заметный, но не спорящий с кнопкой обращения —
   поэтому обычным текстом, а не третьей кнопкой в ряд. */
.site-header__phone {
  font-size: 15px; font-weight: 560; letter-spacing: -.01em;
  color: var(--text); white-space: nowrap;
}
.site-header__phone:hover { color: var(--accent); }

.burger {
  display: none; width: 40px; height: 40px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer;
}
.burger span { display: block; width: 18px; height: 1.8px; background: var(--text); border-radius: 2px; transition: transform var(--tr), opacity var(--tr); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.8px) rotate(-45deg); }

/* --- 8. Секции ---------------------------------------------------------- */
.section { padding: 84px 0; }
.section--tight { padding: 48px 0 84px; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--border); }

/* Тёмная секция — чтобы страница не читалась одним длинным светлым
   полотном. Внутри переопределяем не цвета каждого элемента, а сами
   переменные: разметка секции от этого не зависит. */
.section--dark {
  --text: var(--invert-text);
  --text-2: rgba(255, 255, 255, .72);
  --text-3: rgba(255, 255, 255, .55);
  --border: rgba(255, 255, 255, .14);
  --surface: rgba(255, 255, 255, .05);
  background: var(--invert-bg); color: var(--invert-text);
}
/* Кружок с номером залит --invert-bg, то есть на тёмном фоне он исчезает:
   на тёмной секции заливаем его акцентом. */
.section--dark .steps__item { border-top-color: rgba(255, 255, 255, .28); }
.section--dark .steps__num { background: var(--accent); color: #fff; }

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 36px;
}
.section__title { font-size: clamp(24px, 1.2rem + 1.1vw, 32px); }
.section__lead { margin-top: 10px; color: var(--text-2); max-width: 62ch; font-size: 16px; }

.page-head {
  padding: 44px 0 40px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.page-head--article { padding-bottom: 36px; }
/* Шапка каталога: заголовок слева, поиск справа в одной строке.
   Во всю ширину она давала пустую полосу над содержимым. */
.page-head--split { padding: 36px 0 32px; }
.page-head__row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
}
.page-head__text { min-width: 0; }
.page-head--split .page-head__title { font-size: clamp(28px, 1.4rem + 1.4vw, 38px); }
.page-head--split .page-head__lead { margin-top: 10px; font-size: 16px; max-width: 58ch; }
/* Фильтры под строкой с заголовком и поиском, а не внутри неё. */
.page-head__row + .chips { margin-top: 20px; }
.search--head { margin-top: 0; width: min(420px, 42vw); flex: none; }
/* Рисунок в шапке раздела — вместо поиска, когда искать в разделе нечего. */
.page-head__art { width: 180px; flex: none; margin-bottom: -8px; }
.page-head__title { font-size: clamp(30px, 1.6rem + 2vw, 46px); margin-top: 12px; max-width: 22ch; }
.page-head__lead { margin-top: 16px; color: var(--text-2); max-width: 68ch; font-size: 17px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-3); }
.breadcrumbs a { color: var(--text-3); }
.breadcrumbs a:hover { color: var(--accent); }

/* --- 9. Первый экран ---------------------------------------------------- */
.hero { padding: 72px 0 76px; border-bottom: 1px solid var(--border); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* Поиск по базе переехал из первого экрана внутрь блока про базу:
   в шапке он обещал, что сайт — про готовые ответы. */
.search--inline { margin: 0 0 26px; max-width: 580px; }
.hero__note { margin-top: 18px; font-size: 15.5px; color: var(--text-2); max-width: 54ch; }
.hero__title { font-size: clamp(34px, 1.8rem + 2.8vw, 56px); margin-top: 14px; max-width: 16ch; }
.hero__lead { margin-top: 20px; font-size: 19px; color: var(--text-2); max-width: 58ch; }

.hero__hints { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; font-size: 14px; color: var(--text-3); }
.hero__hints a { color: var(--text-2); border-bottom: 1px dashed var(--border-strong); }
.hero__hints a:hover { color: var(--accent); border-color: var(--accent-line); }

/* Стопка карточек справа от заголовка: показывает продукт вместо
   абстрактной иллюстрации. Две задние карточки — пустые плашки. */
.hero__preview { position: relative; padding-top: 8px; }
/* Карточка наезжает на нижнюю часть рисунка: так первый экран собирается
   в одну сцену, а не в две картинки рядом. */
.hero__preview .illus--docs { max-width: 440px; margin: -24px -16px -28px auto; }
.q-stack { position: relative; z-index: 2; animation: floaty 9s ease-in-out infinite alternate; }
@keyframes floaty {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.q-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: transform var(--tr-slow), border-color var(--tr-slow), box-shadow var(--tr-slow);
}
.q-card--back-1, .q-card--back-2 { position: absolute; inset: 0; }
.q-card--back-2 { z-index: 0; transform: translateY(20px) scale(.94); opacity: .45; }
.q-card--back-1 { z-index: 1; transform: translateY(10px) scale(.97); opacity: .7; }
.q-card--front  { position: relative; z-index: 2; box-shadow: var(--shadow); }

.q-stack:hover .q-card--back-2 { transform: translateY(26px) scale(.93); }
.q-stack:hover .q-card--back-1 { transform: translateY(14px) scale(.965); }
.q-stack:hover .q-card--front  { transform: translateY(-3px); border-color: var(--accent-line); }

.q-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-card__cat { font-size: 13px; color: var(--text-3); }
.q-card__question { font-size: 18px; font-weight: 600; line-height: 1.34; letter-spacing: -.015em; }
.q-card__lead {
  font-size: 14.5px; color: var(--text-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.q-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--border);
}

/* Полоса под первым экраном. Раньше здесь стояли цифры «сколько ответов
   в базе» и «сколько отраслей» — снято намеренно: размер базы не аргумент,
   а на старте цифры играют против сайта. Осталась одна строка по существу. */
.stats-strip { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.stats-strip__inner {
  display: flex; align-items: center; gap: 40px; flex-wrap: wrap;
  padding-block: 22px;
}
.stats-strip__note {
  max-width: 60ch;
  font-size: 14px; color: var(--text-3);
}

/* --- 10. Поиск ---------------------------------------------------------- */
.search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin-top: 28px; padding: 7px 7px 7px 44px;
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  max-width: 620px;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search__icon { position: absolute; left: 14px; color: var(--text-3); }
.search__input {
  flex: 1; min-width: 0;
  padding: 8px 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text);
}
.search__input:focus { outline: none; }
.search__input::placeholder { color: var(--text-3); }

/* --- 11. Сетки ---------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid--cats    { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3       { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- 12. Карточки ------------------------------------------------------- */
.cat-card, .answer-card, .news-card, .service-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}
.cat-card:hover, .answer-card:hover, .news-card:hover, .service-card:hover {
  border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px);
}

/* Карточка рубрики. Каждая рубрика получает свой оттенок через --hue,
   который приходит инлайном из шаблона: цвет закреплён за слагом и не
   скачет при добавлении новых рубрик. */
.cat-card {
  position: relative; padding: 22px; overflow: hidden;
  --hue: 214;
}
/* Полоска сверху «наливается» цветом при наведении */
.cat-card::before {
  content: ""; position: absolute; inset: 0 auto auto 0;
  height: 2px; width: 100%;
  background: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--tr-slow);
}
/* Мягкое световое пятно из-под иконки */
.cat-card::after {
  content: ""; position: absolute; inset: -40% 40% 40% -40%;
  background: radial-gradient(circle at 30% 30%,
              hsl(var(--hue) 80% 55% / .16), transparent 70%);
  opacity: 0; transition: opacity var(--tr-slow);
  pointer-events: none;
}
.cat-card:hover::before { transform: scaleX(1); }
.cat-card:hover::after  { opacity: 1; }

/* Плашка с иконкой — единственное цветное пятно в карточке рубрики,
   поэтому она крупная: мелкий значок в углу не работал. */
.cat-card__icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; margin-bottom: 18px;
  background: hsl(var(--hue) var(--hue-bg-s) var(--hue-bg-l));
  color: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
  border-radius: 16px;
  transition: transform var(--tr-slow), box-shadow var(--tr-slow);
}
.cat-card__icon .icon { width: 26px; height: 26px; }
.cat-card:hover .cat-card__icon {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 18px -6px hsl(var(--hue) 70% 45% / var(--hue-line-a));
}
.cat-card__title { position: relative; font-size: 17px; }
.cat-card__short { position: relative; margin-top: 8px; font-size: 14.5px; color: var(--text-2); flex: 1; }

/* --- Иллюстрации --------------------------------------------------------- */
/* Линия рисуется цветом текста, поэтому картинка одинаково живёт
   в светлой и тёмной теме; акценты берут фирменный цвет. */
.illus { width: 100%; height: auto; display: block; color: var(--text-3); }
.illus__sheet {
  fill: var(--surface); stroke: currentColor; stroke-width: 1.5; opacity: .5;
}
.illus__paper { fill: var(--surface); stroke: currentColor; stroke-width: 1.8; }
.illus__line { stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .55; }
.illus__line--thick { stroke-width: 3.5; opacity: .8; }
.illus__glass { fill: var(--bg); stroke: currentColor; stroke-width: 3; opacity: .85; }
.illus__accent { fill: var(--accent); }
.illus__accent-soft { fill: var(--accent-soft); }
.illus__check { stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.illus__sign-line {
  stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; fill: none; opacity: .85;
}
.illus__spark { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.illus__dot { fill: var(--accent); opacity: .55; }

.illus--empty { max-width: 220px; margin: 0 auto 8px; }
.illus--sm { max-width: 200px; }

/* --- Боковая панель рубрик ---------------------------------------------- */
/* Список рубрик стоит слева на всю высоту экрана и прокручивается сам,
   не утягивая за собой страницу: рубрик тринадцать, и строкой сверху они
   читались как мелкая россыпь. */
.side-layout {
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 36px; align-items: start;
}
.cat-panel {
  position: sticky; top: 88px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 112px);
}
.cat-panel__title {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 620;
}
.cat-list {
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; padding-right: 4px;
}
.cat-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; line-height: 1.35; color: var(--text-2);
  transition: background var(--tr), color var(--tr);
}
.cat-list__item::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); transition: transform var(--tr);
}
.cat-list__item--hue::before { background: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l)); }
.cat-list__item:hover { background: var(--bg-soft); color: var(--text); }
.cat-list__item:hover::before { transform: scale(1.35); }
.cat-list__item.is-active { background: var(--invert-bg); color: var(--invert-text); }
.cat-list__item.is-active::before { background: currentColor; }

/* Те же оттенки — на фильтрах каталога и на бейдже рубрики в карточке ответа */
.chip--hue {
  background: hsl(var(--hue) var(--hue-bg-s) var(--hue-bg-l));
  color: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
}
.chip--filter.chip--hue { background: var(--surface); color: var(--text-2); }
.chip--filter.chip--hue::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
  transition: transform var(--tr);
}
.chip--filter.chip--hue:hover::before { transform: scale(1.35); }
/* Активный фильтр заливается своим оттенком. Текст берётся как очень тёмный
   тон того же оттенка — он читается и на светлой, и на тёмной теме, потому
   что сама заливка в обеих остаётся светлой. */
.chip--filter.chip--hue.is-active {
  background: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
  border-color: hsl(var(--hue) var(--hue-icon-s) var(--hue-icon-l));
  color: hsl(var(--hue) 90% 12%);
}
.chip--filter.chip--hue.is-active::before { background: currentColor; }

.answer-card { padding: 24px; }
.answer-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.answer-card__question { font-size: 19px; line-height: 1.32; }
.answer-card__lead {
  margin-top: 10px; font-size: 15px; color: var(--text-2); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.answer-card__meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
}

.news-card { padding: 24px; }
.news-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.news-card__top--flat { justify-content: flex-start; gap: 16px; margin-bottom: 16px; }
.news-card__date { font-size: 13.5px; color: var(--text-3); }
.news-card__title { font-size: 18px; line-height: 1.34; }
.news-card__summary {
  margin-top: 10px; font-size: 15px; color: var(--text-2); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .link-arrow { margin-top: 18px; }

.news-feature {
  display: block; padding: 36px;
  background: var(--invert-bg); color: var(--invert-text);
  border-radius: var(--r-lg); margin-bottom: 20px;
  transition: transform var(--tr);
}
.news-feature:hover { transform: translateY(-2px); }
.news-feature__body { max-width: 72ch; }
.news-feature .news-card__date { color: var(--invert-dim); }
.news-feature .kind { background: var(--invert-faint); color: var(--invert-text); }
.news-feature__title { font-size: clamp(24px, 1.3rem + 1.2vw, 34px); }
.news-feature__summary { margin-top: 14px; font-size: 17px; color: var(--invert-dim); }
.news-feature .link-arrow { margin-top: 22px; color: var(--invert-text); }
.news-grid { margin-top: 20px; }

.service-card { padding: 26px; }
.service-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-sm);
}
.service-card__title { font-size: 19px; }
.service-card__summary { margin-top: 10px; font-size: 15px; color: var(--text-2); flex: 1; }
.service-card__foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
}
.service-card__price { font-size: 17px; font-weight: 620; }
.service-card__term { font-size: 13.5px; color: var(--text-3); }

/* --- 13. Шаги ----------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps__item { padding-top: 22px; border-top: 2px solid var(--invert-bg); }
.steps__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-bottom: 14px;
  background: var(--invert-bg); color: var(--invert-text); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 620;
}
.steps__title { font-size: 17px; }
.steps__text { margin-top: 8px; font-size: 15px; color: var(--text-2); }

/* --- 14. Статья и её колонки -------------------------------------------- */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px;
  padding: 48px 0 72px; align-items: start;
}
.article-layout--form { gap: 40px; }

.article { max-width: 720px; font-size: 17.5px; }
.article > p { margin-top: 20px; color: var(--text); line-height: 1.72; }
.article > p:first-child { margin-top: 0; font-size: 19px; color: var(--text); }
.article h2 { font-size: 24px; margin-top: 44px; }
.article h3 { font-size: 19px; margin-top: 32px; }

.article-head__title { font-size: clamp(28px, 1.5rem + 1.8vw, 42px); margin-top: 14px; max-width: 26ch; }
.article-head__summary { margin-top: 16px; font-size: 18px; color: var(--text-2); max-width: 66ch; }
.article-head__meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.article-head > .badge { margin-bottom: 4px; }

.check-list { display: grid; gap: 12px; margin-top: 20px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; color: var(--text-2); }
.check-list .icon { color: var(--ok); margin-top: 5px; }

.sources {
  margin-top: 44px; padding: 22px 24px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r);
}
.sources__title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 620; }
.sources__list { display: grid; gap: 8px; margin-top: 14px; }
.sources__list li { position: relative; padding-left: 18px; font-size: 15.5px; color: var(--text-2); }
.sources__list li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-line);
}

.disclaimer {
  margin-top: 28px; padding: 16px 20px;
  border-left: 3px solid var(--border-strong);
  font-size: 14.5px; color: var(--text-3); line-height: 1.6;
}

/* --- Врезки внутри разбора ---------------------------------------------- */
/* Короткий вывод в начале: человек пришёл за ответом, а не за разбегом. */
.takeaway {
  padding: 22px 26px; border-radius: var(--r);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
}
.takeaway__label {
  display: block; margin-bottom: 10px;
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 650; color: var(--accent-hover);
}
.takeaway p { margin-top: 10px; font-size: 18px; line-height: 1.65; color: var(--text); }
.takeaway p:first-of-type { margin-top: 0; }

/* Цитата нормы: отбита полосой и знаком §, чтобы её не путали
   с нашим текстом. */
.norm {
  position: relative; margin-top: 24px; padding: 18px 22px 18px 52px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 3px solid var(--accent-line);
  font-size: 16px; line-height: 1.6; color: var(--text-2);
}
.norm::before {
  content: "§"; position: absolute; left: 20px; top: 16px;
  font-size: 19px; font-weight: 650; color: var(--accent); opacity: .8;
}

/* Абзацы корпуса начинаются с жирного зачина — даём им воздух, чтобы
   разбор читался как несколько блоков, а не как сплошная стена. */
.paywalled-content > p:has(> strong:first-child) { margin-top: 32px; }
.paywalled-content > p:first-child { margin-top: 24px; }

/* --- 15. Пейволл -------------------------------------------------------- */
.paywall { position: relative; margin-top: 24px; }
.paywall__fade {
  display: grid; gap: 14px; padding-top: 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
}
.skeleton { display: block; height: 13px; border-radius: var(--r-xs); background: var(--bg-sunk); }

.paywall__card {
  position: relative; margin-top: -18px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-align: center;
}
.paywall__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-pill);
}
.paywall__title { font-size: 24px; }
.paywall__text { margin-top: 12px; color: var(--text-2); font-size: 16px; max-width: 48ch; margin-inline: auto; }

.paywall__options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; text-align: left; }
.paywall-option {
  display: block; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--tr), background var(--tr);
}
.paywall-option:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.paywall-option--accent { border-color: var(--accent); background: var(--accent-soft); }
.paywall-option--accent:hover { background: var(--accent-soft); border-color: var(--accent-hover); }
.paywall-option__label { display: block; font-size: 14px; color: var(--text-2); }
.paywall-option__price { display: block; margin-top: 6px; font-size: 24px; font-weight: 660; letter-spacing: -.02em; }
.paywall-option__period { font-size: 15px; font-weight: 500; color: var(--text-3); }
.paywall-option__note { display: block; margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
/* Отбивка сверху: строка предлагает другой товар, а не следующий тариф. */
.paywall__alt {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 15px; color: var(--text-2);
}
.paywall__alt a { font-weight: 560; }
.paywall__foot { margin-top: 18px; font-size: 13.5px; color: var(--text-3); }

/* --- 16. Боковая колонка ------------------------------------------------ */
.article-aside { display: grid; gap: 16px; }
.aside-card {
  padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
}
.aside-card--sticky { position: sticky; top: 88px; }
/* Акцентная карточка: консультация — то, ради чего страница существует,
   и в общем ряду серых блоков она не видна. */
.aside-card--accent { border-color: var(--accent); background: var(--accent-soft); }
.aside-card__eyebrow { font-size: 13px; color: var(--text-3); }
.aside-card__title { font-size: 19px; margin-top: 10px; }
.aside-card__title--sm { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-top: 0; margin-bottom: 12px; }
.aside-card__text { margin-top: 10px; font-size: 15px; color: var(--text-2); }
.aside-card__or { margin: 10px 0; text-align: center; font-size: 13.5px; color: var(--text-3); }
.aside-card .btn { margin-top: 16px; }
.aside-card .btn + .aside-card__or + .btn { margin-top: 0; }
.aside-card .link-arrow { margin-top: 14px; }

.aside-price { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.aside-price__value { font-size: 30px; font-weight: 660; letter-spacing: -.03em; }
.aside-price__label { font-size: 14px; color: var(--text-3); }

.aside-list { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.aside-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); }
.aside-list .icon { color: var(--ok); margin-top: 3px; }

.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; margin-bottom: 4px;
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-pill);
}

.contact-list { display: grid; gap: 12px; }
.contact-list li { display: flex; gap: 10px; align-items: center; font-size: 15.5px; }
.contact-list .icon { color: var(--text-3); }
.contact-list a:hover { color: var(--accent); }

/* --- 17. Каталог -------------------------------------------------------- */
.results-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 24px;
}
.results-bar__count { font-size: 15px; color: var(--text-2); }

.empty {
  padding: 64px 32px; text-align: center;
  background: var(--bg-soft); border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
}
.empty--page { background: none; border: 0; padding: 96px 0; }
.empty__icon { color: var(--text-3); margin-bottom: 16px; }
.empty__title { font-size: 26px; margin-top: 8px; }
.empty__text { margin: 12px auto 24px; color: var(--text-2); max-width: 52ch; }
.empty__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- 18. Тарифы --------------------------------------------------------- */
/* Тарифов может быть и три, и четыре — раскладка подстраивается сама,
   иначе четвёртый уезжает во вторую строку в одиночестве. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; align-items: start; }
/* Двум карточкам во всю ширину страницы просторно до неприличия. */
.plans--two { max-width: 720px; }
.plan {
  position: relative; padding: 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.plan--highlight { border-color: var(--accent); box-shadow: var(--shadow); }
.plan__flag {
  position: absolute; top: -12px; left: 30px;
  padding: 4px 12px; background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 580;
}
.plan__title { font-size: 21px; }
.plan__subtitle { margin-top: 6px; font-size: 14.5px; color: var(--text-3); }
.plan__price { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
.plan__value { font-size: 38px; font-weight: 680; letter-spacing: -.035em; }
.plan__period { font-size: 15px; color: var(--text-3); }
.plan__note { margin-top: 6px; font-size: 13.5px; color: var(--text-3); }
.plan .btn { margin-top: 22px; }
.plan__features { display: grid; gap: 11px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.plan__features li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text-2); }
.plan__features .icon { color: var(--ok); margin-top: 4px; }
.plans__foot { margin-top: 24px; font-size: 14px; color: var(--text-3); max-width: 68ch; }

/* --- 19. FAQ ------------------------------------------------------------ */
.faq { display: grid; gap: 10px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 560;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__chevron { color: var(--text-3); transform: rotate(90deg); transition: transform var(--tr); }
.faq__item[open] .faq__chevron { transform: rotate(-90deg); }
.faq__a { padding: 0 22px 20px; color: var(--text-2); font-size: 16px; }

/* --- 20. Формы ---------------------------------------------------------- */
.form-card { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.form { display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form__note { font-size: 13.5px; color: var(--text-3); }

.field { display: grid; gap: 7px; }
.field__label { font-size: 14.5px; font-weight: 540; }
.field__req { color: var(--accent); margin-left: 2px; }
.field__hint { font-size: 13px; color: var(--text-3); }

.input {
  width: 100%; padding: 12px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font: inherit; font-size: 16px;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input--area { resize: vertical; min-height: 140px; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 19px) 22px, calc(100% - 14px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }

.checkbox { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.checkbox a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* --- 21. Подписка на дайджест ------------------------------------------- */
.subscribe {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px 40px;
  padding: 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  align-items: center;
}
.subscribe__title { font-size: 24px; }
.subscribe__text { margin-top: 8px; color: var(--text-2); font-size: 16px; }
.subscribe__form { display: flex; gap: 10px; }
.subscribe__note { grid-column: 1 / -1; font-size: 13px; color: var(--text-3); }
.subscribe__note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* --- 22. Финальный призыв ----------------------------------------------- */
.cta { padding: 0 0 84px; }
.cta__box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center;
  padding: 44px;
  background: var(--invert-bg); color: var(--invert-text); border-radius: var(--r-lg);
}
.cta__title { font-size: clamp(24px, 1.3rem + 1.1vw, 32px); }
.cta__lead { margin-top: 12px; color: var(--invert-dim); max-width: 60ch; font-size: 16.5px; }
.cta__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
/* Рисунок на тёмном: переопределяем переменные, из которых он берёт
   заливки, иначе бумага останется белым пятном. */
.cta__box {
  --surface: rgba(255, 255, 255, .07);
  --bg: transparent;
  --accent-soft: rgba(255, 255, 255, .14);
}
/* Цвет задаётся самому svg: у .illus есть собственное правило color,
   и наследование от родителя его не перебьёт. */
.cta__art { width: 190px; justify-self: end; }
.cta__art .illus { color: rgba(255, 255, 255, .5); }
.cta__art .illus__dot, .cta__art .illus__spark { stroke: #fff; fill: #fff; opacity: .5; }
.cta .btn--ghost { background: transparent; color: var(--invert-text); border-color: var(--invert-faint); }
.cta .btn--ghost:hover { background: var(--invert-faint); border-color: var(--invert-dim); }

/* --- 23. Подвал --------------------------------------------------------- */
.site-footer { padding: 56px 0 32px; background: var(--bg-soft); border-top: 1px solid var(--border); }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.site-footer__tagline { margin-top: 14px; font-size: 15px; color: var(--text-2); max-width: 40ch; }
.site-footer__col { display: grid; gap: 10px; align-content: start; }
.site-footer__col a { font-size: 15px; color: var(--text-2); }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 620; margin-bottom: 2px; }
.site-footer__note { font-size: 14px; color: var(--text-3); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-3);
}
.site-footer__disclaimer { max-width: 70ch; }
/* Реквизиты идут отдельной строкой во всю ширину: в ряду с копирайтом
   они переносятся посреди номера ОГРНИП. */
.site-footer__requisites { flex-basis: 100%; order: 3; }
.site-footer__disclaimer { order: 4; }

/* --- 24. Вход ----------------------------------------------------------- */
.auth-section { padding: 64px 0 96px; background: var(--bg-soft); min-height: 70vh; }
.auth-card {
  max-width: 460px; margin-inline: auto; padding: 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.logo--auth { margin-bottom: 24px; }
.auth-card__title { font-size: 26px; }
.auth-card__lead { margin: 10px 0 24px; color: var(--text-2); font-size: 15.5px; }
.auth-card__note { margin-top: 20px; font-size: 13px; color: var(--text-3); }
.auth-card__note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.auth-alt { margin-top: 18px; text-align: center; }
.auth-alt-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.input--code { font-size: 26px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.dev-code { font-size: 22px; font-weight: 680; letter-spacing: .18em; display: block; margin-top: 6px; }

.link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 14.5px; text-align: left;
}
.link-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.link-button--muted { color: var(--text-3); }
.link-button--muted:hover { color: var(--text); }
.link-button--danger { color: var(--danger); }
.link-button--danger:hover { color: var(--danger-hover); }

/* --- 25. Уведомления ---------------------------------------------------- */
.alert {
  padding: 14px 18px; border-radius: var(--r-sm);
  font-size: 15px; line-height: 1.5; margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert--page { margin: 24px 0 0; }
.alert--ok    { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok-line); }
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert--info  { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-line); }
.alert--dev   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.alert--warn  { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.alert a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.hint { margin-top: 20px; font-size: 14px; color: var(--text-3); max-width: 72ch; }
.hint--warn { color: var(--warn); }

/* --- 25а. Длинные документы ---------------------------------------------
   Оферта и политика — сплошной текст без карточек: единственное место,
   где вёрстка должна уйти с дороги и оставить читаемую колонку. */
.prose { max-width: 72ch; }
.prose h2 {
  margin-top: 36px; margin-bottom: 12px;
  font-size: 19px; letter-spacing: -.015em;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 14px; line-height: 1.65; color: var(--text-2); }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; line-height: 1.6; color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 620; }
/* Незаполненные места видны сразу — иначе черновик однажды уедет в продакшн. */
.prose mark {
  background: var(--warn-soft); color: var(--warn);
  padding: 1px 5px; border-radius: 4px;
  font-size: .95em;
}

.page-head__meta { margin-top: 10px; font-size: 14px; color: var(--text-3); }

/* --- 25б. Календарь отчётности ------------------------------------------ */
.deadlines { list-style: none; margin: 20px 0 0; padding: 0; }
.deadline {
  display: grid; grid-template-columns: 140px 1fr; gap: 18px;
  padding: 18px 0; border-top: 1px solid var(--border);
}
.deadline:last-child { border-bottom: 1px solid var(--border); }
.deadline__date {
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* Платежи приглушены: сдать обычно нужно раньше, чем заплатить,
   и в списке взгляд должен цепляться за отчётность. */
.deadline--pay .deadline__date { color: var(--text-2); font-weight: 500; }
.deadline__shift {
  display: block; margin-top: 4px;
  font-size: 12px; font-weight: 500; color: var(--warn);
}
.deadline__title { font-size: 16px; }
.deadline__who { margin-top: 4px; font-size: 14px; color: var(--text-3); }
.deadline__note { margin-top: 8px; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.deadline__body .link-arrow { margin-top: 10px; font-size: 14px; }

.deadline-group__title {
  margin: 32px 0 4px; font-size: 17px;
}
.deadline-group__title:first-of-type { margin-top: 24px; }
.rules { list-style: none; margin: 0; padding: 0; }
.rule { padding: 16px 0; border-top: 1px solid var(--border); }
.rule__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rule__title { font-size: 15.5px; }
.rule__kind {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-hover);
}
.rule__kind--pay { background: var(--bg-soft); color: var(--text-3); }
.rule__when { margin-top: 6px; font-size: 14.5px; color: var(--text); }
.rule__who { margin-top: 3px; font-size: 14px; color: var(--text-3); }
.rule__note { margin-top: 8px; font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* --- 25б-5. Разъяснения ведомств ----------------------------------------- */
.clarif-note { margin-bottom: 24px; }

.clar-card {
  display: flex; flex-direction: column;
  padding: 22px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); transition: border-color var(--tr), transform var(--tr);
}
a.clar-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.clar-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clar-card__agency {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.clar-card__question { margin-top: 12px; font-size: 16.5px; line-height: 1.4; }
.clar-card__answer {
  margin-top: 10px; font-size: 14.5px; color: var(--text-2); line-height: 1.55;
  flex: 1;
  /* Обрезаем превью: в карточке нужен намёк на ответ, а не весь текст. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.clar-card__meta {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; font-size: 13.5px; color: var(--text-3);
}

.clar-question { margin-top: 8px; }
.clar-question p { margin-bottom: 10px; line-height: 1.65; max-width: 72ch; }
.clar-question .clar-question__note { margin-top: 4px; font-size: 13.5px; color: var(--text-3); }

.clar-answer { margin-top: 28px; }
/* Цитата ведомства отбита рамкой: читателю должно быть видно, где кончается
   чужой текст и начинается наш. */
.clar-quote {
  margin: 12px 0 0; padding: 20px 24px;
  border-left: 3px solid var(--accent-line);
  background: var(--bg-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.clar-quote p { margin-bottom: 12px; line-height: 1.65; color: var(--text-2); }
.clar-quote p:last-child { margin-bottom: 0; }
.clar-source { margin-top: 12px; font-size: 13.5px; color: var(--text-3); word-break: break-all; }

.clar-comment { margin-top: 32px; }
.clar-comment p { margin-bottom: 12px; line-height: 1.65; max-width: 72ch; }

/* --- 25б-4. Страница оплаты ---------------------------------------------- */
.pay-card {
  padding: 32px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); text-align: center;
}
.pay-card__what { font-size: 16px; color: var(--text-2); line-height: 1.5; }
.pay-card__sum {
  margin-top: 12px; font-size: 40px; font-weight: 680;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.pay-card__note { margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
.pay-card .btn { margin-top: 24px; }
.pay-card__foot {
  margin-top: 16px; font-size: 13.5px; color: var(--text-3);
  line-height: 1.55; max-width: 46ch; margin-inline: auto;
}

/* --- 25б-3. Обращения в админке ------------------------------------------ */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg {
  padding: 20px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
/* Обработанное приглушаем, но не прячем: к нему возвращаются. */
.msg--done { opacity: .6; }
.msg__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.msg__from { font-size: 16px; }
.msg__contacts { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.msg__meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 13.5px; flex-wrap: wrap;
}
.msg__text {
  margin-top: 14px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; max-width: 80ch;
}
.msg__foot { margin-top: 12px; font-size: 13px; }

/* Ловушка для ботов в публичных формах.
   Не display:none и не hidden: часть ботов такие поля пропускает. Уводим
   за пределы экрана — для скрипта поле обычное, для человека невидимое. */
.trap {
  position: absolute; left: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}

/* --- 25б-2. Шаблоны документов ------------------------------------------- */
.tpl-card {
  display: flex; flex-direction: column;
  padding: 22px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); transition: border-color var(--tr), transform var(--tr);
}
a.tpl-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.tpl-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tpl-card__kind {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.tpl-card__title { margin-top: 12px; font-size: 17px; line-height: 1.35; }
.tpl-card__summary { margin-top: 8px; font-size: 14.5px; color: var(--text-2); line-height: 1.55; flex: 1; }
.tpl-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; font-size: 14px;
}

.tpl-head__badges { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.tpl-section__title { font-size: 19px; }
.tpl-section__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
}
.tpl-preview { margin-top: 8px; }
.tpl-preview p { margin-bottom: 12px; color: var(--text-2); line-height: 1.65; max-width: 72ch; }

.tpl-body { margin-top: 32px; }
/* Текст документа набран как документ: моноширинный, с рамкой, чтобы взгляд
   отделял его от объяснений вокруг и было понятно, что копировать. */
.tpl-text {
  padding: 24px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 14px; line-height: 1.7;
}
.tpl-text p { margin-bottom: 14px; white-space: pre-wrap; }
.tpl-text p:last-child { margin-bottom: 0; }

.tpl-notes { margin-top: 32px; }
.tpl-notes p { margin-bottom: 12px; color: var(--text-2); line-height: 1.65; max-width: 72ch; }

/* --- 25в. Калькуляторы --------------------------------------------------- */
.calc { margin-top: 8px; }
.calc__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px; margin-bottom: 20px;
}
.calc__hint, .calc__disclaimer {
  margin-top: 20px; font-size: 14px; color: var(--text-3);
  line-height: 1.55; max-width: 72ch;
}
.calc__disclaimer { margin-top: 8px; }
.calc .link-arrow { margin-top: 16px; }

.calc-result {
  margin-top: 28px; padding: 24px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.calc-result__value {
  font-size: 34px; font-weight: 680; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.calc-result__value--warn { color: var(--warn); font-size: 26px; }
.calc-result__amount {
  margin-top: 4px; font-size: 20px; font-weight: 600;
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.calc-result__note { margin-top: 6px; font-size: 15px; color: var(--text-2); line-height: 1.55; }

.calc-result__rows { margin-top: 18px; }
.calc-result__rows > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-top: 1px solid var(--border);
  font-size: 14.5px;
}
.calc-result__rows dt { color: var(--text-3); }
.calc-result__rows dd { font-variant-numeric: tabular-nums; }
.calc-result__rows .is-warn { color: var(--warn); font-weight: 600; }

.calc-result__how {
  margin-top: 16px; font-size: 14px; color: var(--text-2); line-height: 1.6;
}

@media (max-width: 640px) {
  .calc__grid { grid-template-columns: 1fr; }
  .calc-result__value { font-size: 28px; }
}

@media (max-width: 560px) {
  .deadline { grid-template-columns: 1fr; gap: 8px; }
}
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-flex; padding: 3px 9px; border-radius: var(--r-xs);
  background: var(--bg-sunk); color: var(--text-2);
  font-size: 12.5px; font-weight: 540; white-space: nowrap;
}
.pill--ok   { background: var(--ok-soft);     color: var(--ok); }
.pill--warn { background: var(--warn-soft);   color: var(--warn); }
.pill--info { background: var(--accent-soft); color: var(--accent); }

.badge--open  { background: var(--accent-soft); color: var(--accent); }
.badge--draft { background: var(--warn-soft);   color: var(--warn); }

/* --- 26. Кабинет и админка --------------------------------------------- */
.page-head--account, .page-head--admin { padding-bottom: 0; }
.page-head--admin { background: var(--invert-bg); border-bottom-color: var(--invert-bg); }
.page-head--admin .page-head__title { color: var(--invert-text); }
.page-head--admin .link-muted { color: var(--invert-dim); border-color: var(--invert-faint); }
.page-head--admin .link-muted:hover { color: var(--invert-text); }

.admin-bar { display: flex; align-items: center; gap: 16px; }
.admin-badge {
  display: inline-flex; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--invert-faint); color: var(--invert-text); font-size: 12.5px; font-weight: 580;
}

.account-tabs { display: flex; gap: 4px; margin-top: 26px; overflow-x: auto; }
.account-tab {
  padding: 12px 16px; border-bottom: 2px solid transparent;
  color: var(--text-2); font-size: 15px; white-space: nowrap;
  transition: color var(--tr), border-color var(--tr);
}
.account-tab:hover { color: var(--text); }
.account-tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 560; }
.account-tab--admin { color: var(--accent); }
.page-head--admin .account-tab { color: var(--invert-dim); }
.page-head--admin .account-tab:hover { color: var(--invert-text); }
.page-head--admin .account-tab.is-active { color: var(--invert-text); border-bottom-color: var(--invert-text); }

.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.account-grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-side { display: grid; gap: 16px; }
.account-main { display: grid; gap: 20px; }

.account-block {
  padding: 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
}
.account-block--dev { border-style: dashed; border-color: var(--warn-line); background: var(--warn-soft); }
.account-block__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.account-block__title { font-size: 19px; }
.account-block__text { margin: 10px 0 18px; color: var(--text-2); font-size: 15.5px; max-width: 68ch; }
.account-block .form { margin-top: 18px; }
.account-empty { color: var(--text-3); font-size: 15px; }
.account-empty a { color: var(--accent); }
.account-email { font-size: 16px; font-weight: 560; word-break: break-all; }
.logout-form { margin-top: 16px; text-align: center; }
.danger-form { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--border-strong); display: grid; gap: 12px; max-width: 320px; }

.sub-status {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 26px; border-radius: var(--r); border: 1px solid var(--border);
}
.sub-status--active { background: var(--ok-soft); border-color: var(--ok-line); }
.sub-status--none { background: var(--bg-soft); }
.sub-status__label { display: block; font-size: 13.5px; color: var(--text-2); }
.sub-status__value { display: block; font-size: 20px; font-weight: 620; margin-top: 2px; }
.sub-status__right { text-align: right; }
.sub-status__until { display: block; font-size: 15px; font-weight: 560; }
.sub-status__days { display: block; font-size: 13.5px; color: var(--text-2); }

.plan-compact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.plan-compact { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.plan-compact--accent { border-color: var(--accent); background: var(--accent-soft); }
.plan-compact__title { display: block; font-size: 14px; color: var(--text-2); }
.plan-compact__price { display: block; margin-top: 4px; font-size: 22px; font-weight: 660; letter-spacing: -.02em; }
.plan-compact__period { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.plan-compact__note { display: block; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.dev-grant { display: flex; gap: 10px; flex-wrap: wrap; }

.purchase-list { display: grid; gap: 2px; }
.purchase-item {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.purchase-item:last-child { border-bottom: 0; padding-bottom: 0; }
.purchase-item__title { font-size: 16px; font-weight: 540; }
.purchase-item__title:hover { color: var(--accent); }
.purchase-item__meta { display: block; margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
.purchase-item__price { font-size: 15px; font-weight: 580; white-space: nowrap; }

.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.meta-list dt { color: var(--text-3); }
.meta-list dd { margin: 0; text-align: right; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.stat-tile__value { display: block; font-size: 32px; font-weight: 660; letter-spacing: -.03em; }
.stat-tile__label { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.stat-tile__extra { display: block; margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* Подзаголовок внутри страницы админки: таблиц на странице статистики
   несколько, и их надо чем-то разделять. */
.section__title--sm { font-size: 20px; margin: 36px 0 12px; }
.section__title--sm + .hint { margin: -6px 0 12px; }

.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-toolbar--right { justify-content: flex-end; }
.search--admin { margin-top: 0; flex: 1; min-width: 320px; max-width: none; }
.input--inline { width: auto; padding: 8px 12px; font-size: 14px; border-color: var(--border); }

.admin-list { display: grid; gap: 2px; }
.admin-list__item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.admin-list__item:last-child { border-bottom: 0; }
.admin-list__title { font-size: 15.5px; font-weight: 540; }
.admin-list__title:hover { color: var(--accent); }
.admin-list__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; }
.admin-list__empty { padding: 12px 0; color: var(--text-3); font-size: 15px; }

/* --- 27. Таблицы -------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; padding: 14px 16px; font-size: 12.5px; font-weight: 620;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }
.table__link { font-weight: 540; }
.table__link:hover { color: var(--accent); }
.table__sub { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.table__actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.table__actions--wide { gap: 12px; flex-wrap: wrap; }
.table--admin td:first-child { max-width: 460px; }

/* --- 28. Редактор ------------------------------------------------------- */
.editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.editor__main { display: grid; gap: 22px; }
.editor__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor__side .aside-card { display: grid; gap: 14px; }
.editor__side .aside-card .btn { margin-top: 4px; }
.input--title { font-size: 20px; font-weight: 560; line-height: 1.35; resize: vertical; }
.input--tall { min-height: 260px; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* --- 29. Движение ------------------------------------------------------- */
/*
   Три приёма, все выключаются в prefers-reduced-motion в конце файла:
   плавающие линии на фоне первого экрана, подчёркивание заголовка и
   появление блоков при прокрутке.
*/

/* Декоративные линии первого экрана. Лежат в SVG под контентом, дрейфуют
   очень медленно и с малой амплитудой — движение должно ощущаться,
   а не отвлекать от чтения. */
.hero { position: relative; overflow: hidden; }
.hero__lines {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  color: var(--accent);
  opacity: .5;
}
:root[data-theme="dark"] .hero__lines { opacity: .38; }
.hero__inner { position: relative; z-index: 1; }

.hero__lines path { animation: drift 26s ease-in-out infinite alternate; }
.hero__lines path:nth-child(2) { animation-duration: 34s; animation-delay: -6s; }
.hero__lines path:nth-child(3) { animation-duration: 42s; animation-delay: -14s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scaleY(1); }
  to   { transform: translate3d(-26px, 14px, 0) scaleY(1.06); }
}

/* Подчёркивание под заголовком: протягивается один раз при загрузке. */
.hero__title { position: relative; }
.hero__underline {
  display: block; height: 3px; width: 148px; margin-top: 22px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform-origin: left;
  animation: draw 900ms cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes draw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Появление блоков при прокрутке. Класс reveal ставится в разметке,
   is-visible — из site.js через IntersectionObserver. Без JS элементы
   просто видны: базовое состояние задаётся только при наличии .js-on. */
.js-on .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--tr-slow), transform var(--tr-slow);
}
.js-on .reveal.is-visible { opacity: 1; transform: none; }
/* Карточки внутри сетки всплывают по очереди */
.js-on .reveal--stagger > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--tr-slow), transform var(--tr-slow);
}
.js-on .reveal--stagger.is-visible > * { opacity: 1; transform: none; }
.js-on .reveal--stagger.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(5) { transition-delay: 220ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(6) { transition-delay: 260ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(7) { transition-delay: 300ms; }
.js-on .reveal--stagger.is-visible > *:nth-child(8) { transition-delay: 340ms; }

/* Переключатель темы */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-soft); }
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}

/* --- 30. Адаптив -------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid--cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .steps--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor__grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
}

@media (max-width: 940px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav__link { padding: 12px 14px; font-size: 16px; }
  .site-nav__link--mobile { display: block; }
  .burger { display: inline-flex; }
  .site-header__login { display: none; }
  /* Телефон уезжает вместе с подписями: он остаётся в подвале,
     в контактах и в меню, которое открывает бургер. */
  .site-header__phone { display: none; }
  /* В шапке остаётся только иконка кабинета: на узком экране подпись,
     переключатель темы, кнопка обращения и бургер вместе не помещаются. */
  .site-header__account { padding-inline: 10px; font-size: 0; gap: 0; }
  .site-header__account .icon { width: 18px; height: 18px; }
  .site-header__inner { position: relative; }

  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__preview { max-width: 440px; }
  .hero__preview .illus--docs { max-width: 320px; margin: 0 auto -56px; }
  .stats-strip__note { margin-left: 0; }

  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .article { max-width: none; }
  .aside-card--sticky { position: static; }
  .article-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .account-grid, .account-grid--even, .editor__grid { grid-template-columns: 1fr; }
  .account-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor__side .aside-card--sticky { position: static; }

  .cta__box { grid-template-columns: 1fr; }
  .cta__art, .page-head__art { display: none; }

  /* Поиск под заголовком: рядом он на узком экране уже не помещается. */
  .page-head__row { flex-direction: column; align-items: stretch; gap: 20px; }
  .search--head { width: auto; }

  /* На узком экране панель рубрик ложится над результатами и листается
     вбок: держать её колонкой не на чем.
     minmax(0, 1fr) и min-width обязательны: иначе колонка растягивается
     под всю ленту рубрик и распирает страницу вширь. */
  .side-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cat-panel { position: static; max-height: none; min-width: 0; }
  .cat-list {
    flex-direction: row; overflow-x: auto; padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .cat-list__item { flex: none; scroll-snap-align: start; border: 1px solid var(--border); }
  .cat-list__item.is-active { border-color: var(--invert-bg); }

  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 780px) {
  body { font-size: 16px; }
  .section { padding: 56px 0; }
  .section--tight { padding: 32px 0 56px; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .grid--cats, .grid--answers, .grid--3, .plans, .steps, .steps--4 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 52px; }
  .hero__preview { max-width: none; }
  .stats-strip__inner { gap: 20px 28px; }

  .search { flex-wrap: wrap; padding-left: 40px; }
  .search .btn { width: 100%; }

  .paywall__options { grid-template-columns: 1fr; }
  .paywall__card { padding: 24px 20px; }

  .article-aside { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .form-card { padding: 22px; }

  .subscribe { grid-template-columns: 1fr; padding: 26px; }
  .subscribe__form { flex-direction: column; }

  .cta { padding-bottom: 56px; }
  .cta__box { grid-template-columns: 1fr; padding: 28px; }
  .cta__actions .btn { flex: 1; }

  .news-feature { padding: 26px; }
  .site-footer__grid { grid-template-columns: 1fr; }

  .auth-card { padding: 24px; }
  .auth-section { padding: 32px 0 56px; }
  .account-side, .stat-row, .plan-compact-row, .editor__row { grid-template-columns: 1fr; }
  .account-block { padding: 20px; }
  .sub-status { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sub-status__right { text-align: left; }
  .search--admin { min-width: 0; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .table__actions { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* Анимации появления не должны оставить блоки невидимыми, если
     переходы отключены — возвращаем нормальное состояние принудительно. */
  .js-on .reveal,
  .js-on .reveal--stagger > * { opacity: 1 !important; transform: none !important; }
  .hero__lines { animation: none; }
}
