/*
 * Сайт проекта «Разбор обращений» — оформление.
 *
 * Токены цвета и часть решений (гарнитура, радиусы, шкала контраста)
 * взяты из консоли (services/web/app/globals.css), чтобы сайт и продукт
 * читались одним и тем же. Различие в назначении: консоль — плотный
 * рабочий инструмент, сайт — редкие крупные блоки для человека, который
 * ещё ничего не решил. Отсюда меньше деталей и больше пустого места,
 * а не другой стиль.
 *
 * Гарнитура — только системная. Внешние шрифты и библиотеки не
 * загружаются: комплекс работает с чужими персональными данными, и
 * страница о нём не должна отправлять браузер посетителя к третьим
 * лицам за шрифтом.
 *
 * Сдержанность здесь — решение, а не отсутствие решения: раздел 5
 * strategy/32-vkus-i-oblik.md прямо оставляет цвет, гарнитуру и движение
 * открытыми вопросами. Не выдумываю яркого ответа на них — держусь
 * палитры, которая уже есть в продукте.
 */

:root {
  color-scheme: light;

  --ink: #101418;
  --ink-muted: #5b6672;
  --ink-faint: #66707c;

  --surface: #ffffff;
  --surface-sunken: #f5f7f9;
  --surface-raised: #ffffff;
  --line: #e2e7ec;
  --line-strong: #cbd3db;

  --accent: #1c5fd0;
  --accent-soft: #eaf1fd;
  --on-accent: #ffffff;

  --ok: #17794a;
  --ok-soft: #e6f4ec;

  --radius: 8px;
  --radius-lg: 14px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --ink: #e8edf2;
    --ink-muted: #9aa5b1;
    --ink-faint: #8a949f;

    --surface: #14181c;
    --surface-sunken: #0e1114;
    --surface-raised: #1a1f24;
    --line: #262c33;
    --line-strong: #363d45;

    --accent: #5b9bff;
    --accent-soft: #16233a;
    --on-accent: #0b0f13;

    --ok: #4ec98a;
    --ok-soft: #12261c;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Переход к содержимому — первая цель обхода с клавиатуры. Скрыт
   визуально и появляется по фокусу, а не убран вовсе. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
}

/* ── Каркас ──────────────────────────────────────────────────────────── */

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

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type {
  border-bottom: none;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 36px;
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 17px;
}

/* ── Первый экран ────────────────────────────────────────────────────── */

.hero {
  padding-top: 56px;
}

.hero .eyebrow {
  margin-top: 0;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 5vw, 48px);
  max-width: 18ch;
}

.hero-lede {
  margin: 0 0 30px;
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--ink-muted);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

/* Подпись под кнопками первого экрана: что именно будет за «Попробовать».
   Отступ кнопок съедается — подпись относится к ним, а не к числам ниже. */
.hero-actions + .hero-note {
  margin-top: -30px;
}

.hero-note {
  margin: 0 0 44px;
  max-width: 56ch;
  font-size: 14.5px;
  color: var(--ink-faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-sunken);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

/* Числа первого экрана: величина крупно, без единиц измерения в самой
   цифре — расшифровка идёт под ней. Тот же приём, что в консоли
   (services/web/app/globals.css, .login-figures) и в разборе образцов
   заказчика (strategy/32-vkus-i-oblik.md §3.3): число вместо
   прилагательного. */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  max-width: 760px;
}

.figures dt {
  font-size: 30px;
  font-weight: 660;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.figures dd {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-faint);
}

/* ── Путь обращения: диаграмма из разметки, без картинки ────────────────
   Каждый шаг — обычный пункт списка: без CSS он читается как нумерованный
   перечень и остаётся полезным. С CSS между пунктами появляется стрелка,
   и перечень превращается в схему пути — ровно то, что просит раздел 3.5
   strategy/32-vkus-i-oblik.md: «показать, а не описать». */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 0;
}

.flow li {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  min-width: 0;
}

.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -21px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: var(--surface);
  border-top: 2px solid var(--line-strong);
  border-right: 2px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
}

.flow li:nth-child(3n)::after {
  display: none;
}

.flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.flow strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.flow span {
  display: block;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.flow li.is-branch {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 760px) {
  .flow {
    grid-template-columns: 1fr;
  }

  .flow li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -21px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .flow li:nth-child(3n)::after {
    display: block;
  }

  .flow li:last-child::after {
    display: none;
  }
}

/* ── Карточки ────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-value {
  font-size: 30px;
  font-weight: 660;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.card p + p {
  margin-top: 10px;
}

/* Отличия — список, а не карточки: это причины поверить, их лучше
   читать подряд, а не сравнивать по клеткам. */
.reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.reasons li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
}

.reasons .mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.reasons strong {
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
}

.reasons p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

/* ── Теневой режим ───────────────────────────────────────────────────── */

.shadow-section {
  background: var(--surface-sunken);
}

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

.shadow-body p {
  font-size: 16px;
}

.shadow-report {
  margin: 28px 0;
  padding: 20px 22px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14.5px;
}

.shadow-report h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.shadow-report ul {
  margin: 0;
  padding-left: 20px;
}

.shadow-report li {
  margin-bottom: 6px;
}

.shadow-report li:last-child {
  margin-bottom: 0;
}

.note {
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* ── О проекте / обязательное по гранту ─────────────────────────────── */

.grant-support {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 32px 0;
}

.grant-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

/* Логотип — <object> с файлом из site/logos/. Пока файла нет, браузер
   показывает вложенную текстовую заготовку (.logo-badge): положить файл —
   и логотип появится без правки разметки (site/README.md, «Перед первой
   публикацией»). Высота одна у логотипа и у заготовки — блок не прыгает,
   когда одно сменяет другое. */
.grant-logos .logo {
  display: block;
  height: 72px;
  max-width: 100%;
}

.logo-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 72px;
  min-width: 190px;
  max-width: 320px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-muted);
}

.logo-badge b {
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.grant-text {
  margin: 0;
  max-width: var(--measure);
  font-size: 15px;
  color: var(--ink);
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 24px 0;
}

.meta-table th,
.meta-table td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.meta-table th {
  width: 40%;
  font-weight: 600;
  color: var(--ink-muted);
}

.contact-block {
  margin-top: 28px;
}

.contact-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

/* ── Страница политики: длинный текст для чтения ──────────────────────── */

.doc .wrap > * {
  max-width: var(--measure);
}

.doc .wrap > .table-scroll {
  max-width: none;
}

.doc h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 38px);
}

.doc-lede {
  font-size: 18px;
  color: var(--ink-muted);
}

.doc h2 {
  margin: 40px 0 12px;
  font-size: 22px;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 17px;
}

.doc-list {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.doc-list li {
  margin-bottom: 10px;
}

/* Таблица целей на узком экране прокручивается сама, а не растягивает
   страницу вбок. */
.table-scroll {
  overflow-x: auto;
}

.doc-table {
  min-width: 560px;
}

.doc-table thead th {
  width: auto;
  color: var(--ink);
}

.doc-table tbody td:first-child {
  font-weight: 600;
}

/* ── Подвал ──────────────────────────────────────────────────────────── */

.site-footer {
  padding: 32px 0 48px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-faint);
}

.site-footer a {
  color: var(--ink-faint);
}

/* ── Узкий экран ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  section {
    padding: 44px 0;
  }

  .wrap {
    padding: 0 18px;
  }

  .hero {
    padding-top: 40px;
  }

  .section-head h2 {
    font-size: 24px;
  }
}

/* ── Уважение к настройке «меньше движения» ─────────────────────────────
   На странице нет декоративной анимации, но правило оставлено на случай,
   если она появится позже, — не наоборот. */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}

@media (forced-colors: active) {
  .card,
  .flow li,
  .logo-badge,
  .grant-support {
    border-color: CanvasText;
  }
}
