/* fizkult-ta.ru — v2. Главная и шаблон внутренней страницы.
   Мир прежний: Unbounded + Manrope, синий и красный. Пересобраны иерархия,
   контраст, состояния и ритм. Старый css/site.css остаётся для непеределанных страниц. */

:root {
  /* Чернила и акценты. Все пары проверены на WCAG AA по светлым подложкам. */
  --ink: #16304f;           /* 13.4:1 на белом */
  --muted: #4c5d73;         /* 6.7:1  на белом */
  --blue: #245179;          /* 8.3:1  на белом */
  --red: #a63c50;           /* 6.2:1  на белом */
  --red-strong: #9e3247;    /* 7.0:1  — для мелкого текста */

  /* Поверхности */
  --paper: #ffffff;
  --tint: #eff4f9;
  --tint-warm: #faf2f4;
  --line: #dbe2ea;
  --line-strong: #c3d0de;

  /* Тёмная глава (игра) */
  --night: #12293d;
  --night-2: #1b3a4f;
  --sand: #f4e9d8;
  --amber: #ffd27a;

  /* Тени: смещение + мягкое размытие, тонированные в синий */
  --shadow-1: 0 2px 4px rgba(22, 48, 79, .05), 0 8px 20px rgba(22, 48, 79, .07);
  --shadow-2: 0 4px 8px rgba(22, 48, 79, .07), 0 16px 36px rgba(22, 48, 79, .10);
  --shadow-night: 0 10px 20px rgba(9, 21, 33, .25), 0 30px 60px rgba(9, 21, 33, .30);

  --display: "Unbounded", Georgia, serif;
  --body: "Manrope", system-ui, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --page: 1200px;
  --radius: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(.16, 1, .3, 1);   /* экспоненциальный выход */
  --fast: 180ms;
}

/* ---------- База ---------- */

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

html {
  scroll-padding-top: 88px;
  caret-color: var(--blue);
  scrollbar-color: var(--line-strong) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #cfe0ef; color: var(--ink); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--paper); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a9bcd0; }

img, svg { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }
a:not([class]) {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease);
}
a:not([class]):hover { color: var(--red-strong); }

/* Ссылки, которые являются интерфейсом, а не текстом: подчёркивание и цвет
   задаёт сам компонент. Иначе базовое правило выше красит всю навигацию. */
.menu nav a, .rail a, .pager a, .direction a, .crumbs span, .site-header a,
.toc a, .doc-list a, .docs__link a, .step__link a, .act__links a,
.slot a, .law a, .tree a, .listing__row > a {
  color: inherit;
  text-decoration: none;
}

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

/* Цифры в данных — табличные, чтобы столбцы не плясали */
.tnum, .indicator__id, .readiness__count, .fact__value { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute;
  overflow-wrap: break-word;
  top: 0;
  left: var(--gutter);
  max-width: calc(100% - 2 * var(--gutter));
  /* Прячем сдвигом, а не координатой: при top: -120px правый край ссылки
     продолжал участвовать в переполнении, и увеличение текста до 200 %
     давало горизонтальную прокрутку на каждой странице. */
  transform: translateY(-200%);
  z-index: 60;
  padding: 14px 20px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 10px 10px;
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.shell { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Типографика ---------- */

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.08;
  text-wrap: balance;
  /* «Профессиональное» шире колонки при 320 px: разрешаем перенос
     по слогам, иначе grid-дорожка раздувается по min-content. */
  hyphens: auto;
  overflow-wrap: break-word;
}

h3, h4 { font-weight: 800; line-height: 1.25; text-wrap: balance; }

.t-display { font-size: clamp(31px, 4.4vw, 50px); }
.t-section { font-size: clamp(26px, 3.2vw, 40px); }
.t-page    { font-size: clamp(30px, 4.2vw, 50px); }

p { text-wrap: pretty; }

.lead {
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- Иконки ---------- */

.icon {
  width: 24px; height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 18px; height: 18px; stroke-width: 2; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wordmark {
  /* Логотип — ссылка на главную, и это цель нажатия: 37 px было мало. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(19px, 2vw, 23px);
  letter-spacing: -.04em;
  white-space: nowrap;
  margin-right: auto;
}
.wordmark b { font-weight: 800; }
.wordmark i { font-style: normal; color: var(--red); }
/* Знак отвечает на курсор, как и в прежней версии: весь логотип уходит
   в акцентный красный. Общее правило a:hover здесь больше не действует —
   оно красило заодно и навигацию, поэтому реакцию задаём адресно. */
.wordmark { transition: color var(--fast) var(--ease); }
.wordmark:hover { color: var(--red); }

.header-tools { display: flex; align-items: center; gap: 10px; }

/* Кнопка спецверсии: заметная и контрастная, но без двойного кольца */
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font: 700 14px/1 var(--body);
  cursor: pointer;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.a11y-btn:hover { background: var(--tint); }
.a11y-btn:active { transform: translateY(1px); }
.a11y-btn[aria-busy="true"] { opacity: .65; cursor: progress; }

.menu { position: relative; }
.menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { border-color: var(--ink); background: var(--tint); }
.menu[open] summary { background: var(--ink); color: #fff; border-color: var(--ink); }

.menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(330px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70dvh, 560px);
  overflow: auto;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.menu nav a {
  /* Пункт меню — цель нажатия. 42 px не дотягивали до нормы. */
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 15px;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.menu nav a:hover { background: var(--tint); color: var(--blue); }
.menu nav a[aria-current] { background: var(--ink); color: #fff; }
.menu nav .sub { padding-left: 30px; font-weight: 600; font-size: 14px; color: var(--muted); }
.menu nav .sub:hover { color: var(--blue); }
/* Текущий пункт остаётся белым на тёмном и при наведении: иначе синий текст
   на синей подложке даёт 1.6:1. */
.menu nav a[aria-current],
.menu nav a[aria-current]:hover { background: var(--ink); color: #fff; }
.menu nav hr { height: 1px; margin: 8px 4px; border: 0; background: var(--line); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: 800 15px/1 var(--body);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-1); }
.btn--primary:hover { background: #0f2440; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); box-shadow: var(--shadow-1); }

.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); background: var(--tint); }

.btn--amber { background: var(--amber); color: #14283a; box-shadow: var(--shadow-night); }
.btn--amber:hover { background: #ffdd96; transform: translateY(-1px); }
.btn--amber:active { transform: translateY(0); }
.btn--amber:focus-visible { outline-color: var(--amber); }

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

.hero { padding-block: clamp(40px, 5.5vw, 76px) clamp(40px, 5vw, 72px); }

.hero h1 { margin-bottom: clamp(30px, 3.6vw, 48px); }
.hero h1 em { font-style: normal; color: var(--blue); display: block; }

.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.hero__name {
  font-weight: 800;
  font-size: clamp(17px, 1.5vw, 19px);
  margin-bottom: 10px;
}

.hero__doors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* Паспорт педагога — строка определений, а не витрина цифр */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact__value { font-weight: 800; font-size: 17px; }
.fact__label { font-size: 14px; color: var(--muted); }

.hero__aside { min-width: 0; }
.portrait {
  position: relative;
  margin: 0;
  padding-bottom: 8px;
}
.portrait img {
  width: 100%;
  aspect-ratio: 1 / 1.04;
  object-fit: cover;
  object-position: center 22%;
  border-radius: var(--radius-lg);
}
/* Подпись наезжает на нижний край фотографии — единственное место,
   где слои перекрываются, и оно же даёт глубину первому экрану. */
.portrait + .quote {
  position: relative;
  margin: -56px 18px 0;
  padding: 20px 22px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.quote__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.quote__author {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  color: var(--ink);
}
.quote__author span { display: block; font-weight: 600; color: var(--muted); }

/* ---------- Карта портфолио ---------- */

.map { padding-block: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); }
/* Глава игры идёт перед картой портфолио и сама отделяет её тёмным фоном:
   волосяная линия под тёмным блоком выглядит случайной. */
.game + .map { border-top: 0; }

.map__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 40px;
  align-items: end;
  margin-bottom: 40px;
}
.map__head h2 { margin-bottom: 16px; }

.readiness {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.readiness__count { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -.03em; white-space: nowrap; }
.readiness__label { font-size: 14px; color: var(--muted); max-width: 22ch; }
/* На /portfolio/ счётчик стоит отдельным блоком, а не в паре с заголовком
   карты, как на главной: тянуть его на всю ширину незачем. */
.readiness--solo { width: fit-content; max-width: 100%; margin-bottom: 18px; }
.readiness--solo .readiness__label { max-width: 34ch; }

.directions { display: grid; gap: 10px; }

.direction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 20px 36px;
  align-items: center;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.direction { position: relative; }
.direction:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); background: #fcfdfe; }
/* Карточка подсвечивалась целиком, а кликался только заголовок. Растягиваем
   зону нажатия по всей карточке и поднимаем чипы над ней. */
.direction__link::after { content: ""; position: absolute; inset: 0; }
.direction .chips { position: relative; z-index: 1; }

.direction__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(19px, 1.7vw, 23px);
  /* Межстрочное расстояние объявляем сами: базовое h1,h2 даёт 1.08, а h3,h4 —
     1.25, и один и тот же компонент рендерился по-разному в зависимости от
     уровня заголовка. На главной карта идёт под h2 и заголовки направлений
     h3, на /portfolio/ — h2. Токен title: 1.25. */
  line-height: 1.25;
  letter-spacing: -.03em;
}
.direction a.direction__link { transition: color var(--fast) var(--ease); }
.direction:hover .direction__link { color: var(--blue); }
/* Именно .direction p перебивал .direction__title: 0-1-1 против 0-1-0,
   и заголовок направления молча рендерился как серый текст 15 px.
   Описание получает собственный класс — веса становятся равными. */
.direction__desc { margin-top: 8px; font-size: 15px; color: var(--muted); max-width: 52ch; }
.direction__rule { margin-top: 10px; font-size: 14px; color: var(--ink); font-weight: 700; max-width: 52ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              color var(--fast) var(--ease);
}
.chip:hover { border-color: var(--blue); background: var(--tint); color: var(--blue); }
/* Точка несёт информацию, поэтому её контраст к фону обязан быть не ниже
   3:1 как у элемента интерфейса. На --line-strong выходило 1.57:1. */
.chip__dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
}
.chip--ready .chip__dot { background: var(--blue); border-color: var(--blue); }

.map__note { margin-top: 22px; font-size: 14px; color: var(--muted); max-width: 70ch; }

/* Аттестация — другая форма, не шестая плитка */
.attestation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 28px 44px;
  align-items: center;
  margin-top: 34px;
  padding: clamp(28px, 3.4vw, 40px);
  border-radius: var(--radius-lg);
  background-color: var(--tint);
  background-image: linear-gradient(140deg, var(--tint) 0%, var(--tint-warm) 100%);
  border: 1px solid var(--line);
}
.attestation-panel h2,
.attestation-panel h3 {
  /* Панель живёт и как h3 (на главной, под h2 карты), и как h2 (на своей
     странице, под h1). Объявляем всё явно, включая межстрочное. */
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 12px;
}
.attestation-panel p { color: var(--muted); font-size: 16px; max-width: 46ch; }
.attestation-panel__aside { display: grid; gap: 12px; }
.law {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.law .icon { color: var(--blue); margin-top: 1px; }
.law b { display: block; font-weight: 800; }
/* Ссылка внутри карточки закона — самостоятельная цель нажатия. */
.law a { display: inline-block; padding-block: 12px; font-size: 14px; font-weight: 800; color: var(--blue); }
.law span { color: var(--muted); }

/* ---------- Глава «Игра» ---------- */

.game {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--sand);
  background-color: var(--night);
  background-image:
    radial-gradient(110% 80% at 78% 12%, rgba(255, 210, 122, .22) 0%, rgba(255, 210, 122, 0) 58%),
    linear-gradient(150deg, var(--night) 0%, var(--night-2) 58%, #2a4256 100%);
}
.game__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 28px;
  align-items: end;
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(44px, 5vw, 72px) var(--gutter) 0;
}
.game__copy { padding-bottom: clamp(44px, 5vw, 72px); }
.game h2 { color: #fff; font-size: clamp(28px, 3.6vw, 46px); max-width: 14ch; }
.game__lead { margin-top: 18px; font-size: 17px; line-height: 1.6; color: var(--sand); max-width: 44ch; }
.game__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 30px; }
.game__hint { font-size: 14px; font-weight: 700; color: #e8c9a0; }
.game__mascot { margin: 0; justify-self: end; width: min(300px, 34vw); }
.game__mascot img { filter: drop-shadow(0 22px 32px rgba(6, 16, 26, .55)); }

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

.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 40px;
  max-width: var(--page);
  margin-inline: auto;
  padding: 44px var(--gutter);
  font-size: 15px;
}
.site-footer b { display: block; font-weight: 800; margin-bottom: 6px; }
.site-footer p, .site-footer li { color: var(--muted); }
.site-footer li + li { margin-top: 2px; }
.site-footer li a { display: inline-block; padding-block: 11px; }
/* Почта в подвале — такая же цель нажатия, как ссылки списка: было 21 px. */
.site-footer p a { display: inline-block; padding-block: 11px; }
/* Название школы переносится по словам и никогда не разрывает «школа № 9»:
   между этими словами стоят неразрывные пробелы, переносов по слогам нет. */
.school-link {
  /* У ссылки появился класс, а значит базовое правило a:not([class]) её
     больше не красит: цвет и подчёркивание задаём сами. */
  hyphens: manual;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.school-link:hover { color: var(--ink); }

.site-footer small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

/* ---------- Внутренняя страница ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-block: 26px 0;
  font-size: 14px;
  color: var(--muted);
}
.crumbs a { display: inline-block; padding-block: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--blue); }
.crumbs .icon { color: var(--line-strong); }

.page-head { padding-block: clamp(28px, 3.4vw, 44px) clamp(32px, 4vw, 48px); }
.page-head h1 { margin-bottom: 20px; }

.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.page-head__meta b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }

.indicators { display: grid; gap: 12px; }

.indicator {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 300px);
  gap: 18px 28px;
  align-items: start;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 100px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.indicator:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }

.indicator__id {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.03em;
  color: var(--red);
  min-width: 3ch;
}
.indicator h2 { font-family: var(--body); font-size: 20px; font-weight: 800; letter-spacing: normal; line-height: 1.3; }
.indicator__desc { margin-top: 8px; font-size: 15px; color: var(--muted); max-width: 54ch; }

.tag {
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--tint);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
}

.slot {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 20px;
  background: var(--tint);
  border-radius: 12px;
}
.slot b { font-weight: 800; font-size: 15px; }
.slot__status { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); }
.slot__status .icon { color: var(--muted); }
.slot a { display: inline-block; padding-block: 11px; font-weight: 800; font-size: 14px; }

/* Рейка направлений */
.rail { padding-block: clamp(40px, 5vw, 64px) 0; }
.rail h2 { font-family: var(--body); font-size: 17px; font-weight: 800; letter-spacing: normal; margin-bottom: 16px; }
.rail ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.rail a {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.rail a:hover { border-color: var(--blue); background: var(--tint); }
.rail a[aria-current],
.rail a[aria-current]:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.rail small { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail a[aria-current] small { color: #b9cadb; }

/* Переход к соседним направлениям */
.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding-block: clamp(36px, 4vw, 56px) clamp(48px, 6vw, 80px);
}
.pager a {
  display: grid;
  gap: 6px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.pager a:hover { border-color: var(--ink); background: var(--tint); }
.pager span { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pager b { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
.pager .next { text-align: right; }
.pager .next span { justify-content: flex-end; }

/* ---------- Один авторский момент движения ---------- */
/* Базовое состояние — видимое. Класс js-enter ставит скрипт, поэтому без JS
   содержимое видно сразу и ничего не мигает. */

.js-enter { opacity: 0; transform: translateY(14px); }
.js-enter.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  transition-delay: var(--stagger, 0ms);
}

/* ---------- Адаптив ---------- */

@media (max-width: 1080px) {
  .direction { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .attestation-panel { grid-template-columns: minmax(0, 1fr); }
  .indicator { grid-template-columns: auto minmax(0, 1fr); }
  .indicator .slot { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .hero__body { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 460px; }
  .map__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .game__inner { grid-template-columns: minmax(0, 1fr); }
  .game__copy { padding-bottom: 20px; }
  .game__mascot { justify-self: center; width: min(240px, 56vw); }
  .game h2, .game__lead { max-width: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header__inner { min-height: 68px; gap: 10px; }
  .a11y-btn span:not(.visually-hidden) { display: none; }
  .a11y-btn { padding: 0; width: 48px; min-height: 48px; justify-content: center; }
  .menu summary span {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .menu summary { padding: 0 14px; }
  .hero__doors .btn { width: 100%; }
  .facts { gap: 14px 24px; }
  .direction, .indicator { padding: 20px; }
  .indicator { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pager .next, .pager .next span { text-align: left; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  /* Гасим именно движение. Сплошное обнуление всех переходов заодно убивало
     плавную смену цвета у кнопок и ссылок — а это обратная связь, а не анимация. */
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-property: color, background-color, border-color, outline-color, box-shadow !important;
    scroll-behavior: auto !important;
  }
  .js-enter { opacity: 1; transform: none; }
}


/* ---------- Пасхалка в подвале ----------
   Прежде спортивный инвентарь жил отдельной полосой под подвалом, со своим
   заголовком и подписью. Теперь он падает за текстом подвала и ложится
   вдоль его нижнего края. Физика и разметка прежние, поменялись место,
   слой и прозрачность. */

.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Идентификатор нужен, чтобы уверенно перебить прежние правила площадки
   из /sports-footer/style.css: там тот же вес селектора. */
#sports-playground {
  position: absolute;
  inset: 0;
  margin: 0;
  background: none;
  border: 0;
  z-index: 0;
  pointer-events: none;
}
#sports-playground .sports-arena {
  position: absolute;
  inset: 0;
  height: auto;
  touch-action: auto;
}
#sports-playground .sports-items { pointer-events: none; }
#sports-playground .sports-piece { opacity: 1; pointer-events: auto; }

.site-footer__inner {
  position: relative;
  z-index: 1;
  /* Пустые места подвала пропускают курсор к предметам, текст и ссылки
     остаются кликабельными и выделяемыми. */
  pointer-events: none;
}
.site-footer__inner > div,
.site-footer__inner small { pointer-events: auto; }
/* Предметы лежат в полную силу, поэтому текст подвала носит белый ореол.
   На чистой бумаге его не видно, а поверх мяча он возвращает букве фон. */
.site-footer__inner b,
.site-footer__inner p,
.site-footer__inner li,
.site-footer__inner a,
.site-footer small {
  text-shadow:
    0 0 4px #fff, 0 0 4px #fff, 0 0 9px #fff, 0 0 14px #fff,
    1px 0 3px #fff, -1px 0 3px #fff, 0 1px 3px #fff, 0 -1px 3px #fff;
}
.site-footer small { position: relative; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  /* Движение выключено, предметы просто лежат внизу — как и было. */
  #sports-playground .sports-piece { opacity: .8; }
}

/* ---------- Раскатка системы на остальные страницы ----------
   Ни одного селектора вида «.блок p» или «.блок span»: такое правило имеет
   вес 0-1-1 и молча перебивает собственный класс элемента 0-1-0. Один раз это
   уже стёрло иерархию на карточке направления. Исключение — .note p, внутри
   заметки других абзацев нет. */

/* Обо мне */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 28px clamp(28px, 4vw, 56px);
  align-items: start;
}
.about__text { min-width: 0; max-width: 62ch; overflow-wrap: break-word; hyphens: auto; }
.about__text p + p { margin-top: 14px; }

.spec { margin-top: 30px; border-top: 1px solid var(--line); }
.spec > div {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 4px 28px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.spec dt { font-size: 14px; color: var(--muted); }
.spec dd { font-weight: 800; overflow-wrap: break-word; hyphens: auto; }
/* Тот же список, но значение — фраза, а не короткий факт: жирным целое
   предложение читать тяжело. */
.spec--text dd { font-weight: 400; max-width: 70ch; }
.block .about__text { margin-top: 18px; }

/* Содержание раздела */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              color var(--fast) var(--ease);
}
.toc a:hover { border-color: var(--blue); background: var(--tint); color: var(--blue); }

/* Раздел внутренней страницы */
.block { padding-block: clamp(40px, 5vw, 68px) 0; }
.block > h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.04em;
  hyphens: auto;
  overflow-wrap: break-word;
}
.block > .lead { margin-top: 14px; max-width: 68ch; }

/* Нормативные акты */
.acts {
  display: grid;
  /* Актов четыре. При трёх колонках четвёртый оставался один в ряду. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 12px;
  margin-top: 28px;
}
.act {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.act:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.act--primary { background: var(--tint); }
.act__kind { font-size: 14px; font-weight: 800; color: var(--muted); }
.act h3 { margin-top: 8px; font-family: var(--body); font-size: 18px; font-weight: 800; line-height: 1.35; letter-spacing: normal; }
.act__text { margin-top: 10px; font-size: 15px; color: var(--muted); }
.act__note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.act__links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.act__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 11px;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue);
}
.act__links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Показатели: пять направлений */
.steps { display: grid; gap: 10px; margin-top: 28px; }
.steps > li {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 14px 32px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.steps > li:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.step__id { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step__id b { color: var(--ink); font-weight: 800; }
.step__id span { display: block; margin-top: 4px; }
.steps h3 { font-family: var(--body); font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: normal; }
.step__text { margin-top: 8px; font-size: 15px; color: var(--muted); max-width: 62ch; }
.step__link { margin-top: 2px; }
.step__link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 11px;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue);
}
.step__link a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Каталог документов */
.docs { margin-top: 32px; }
.docs h2, .docs h3 { font-family: var(--body); font-size: 17px; font-weight: 800; letter-spacing: normal; line-height: 1.35; }

.docs--top { margin-top: clamp(40px, 4.4vw, 60px); }
/* Тот же вес, что у .docs h2 (0-1-1), поэтому правило обязано идти ниже. */
.docs--top > h2 {
  font-family: var(--display);
  font-size: clamp(21px, 2.1vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  hyphens: auto;
  overflow-wrap: break-word;
}
.docs--top .docs__desc { margin-top: 8px; }
.docs--top .doc-list { margin-top: 12px; }
.docs__desc { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 68ch; }
.docs__link { margin-top: 2px; }
.docs__link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 11px;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue);
}
.docs__link a:hover { text-decoration: underline; text-underline-offset: 4px; }

.doc-list { display: grid; gap: 8px; margin-top: 14px; max-width: 860px; }
.doc-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 18px;
  min-height: 56px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.doc-list a:hover { border-color: var(--line-strong); background: var(--tint); box-shadow: var(--shadow-1); }
.doc-list b { font-weight: 800; font-size: 15px; color: var(--red-strong); font-variant-numeric: tabular-nums; }
.doc-list__name { font-weight: 700; font-size: 15px; }

/* Состояние материала: точка плюс слово, никогда только цвет */
.state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.state__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; }
.state--ready .state__dot { background: var(--blue); border-color: var(--blue); }

/* Пустой раздел документов */
.empty {
  padding: clamp(28px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--tint);
}
/* При увеличении текста до 200 % строка не помещалась в 320 px: у flex-ряда
   минимум — самое длинное слово, перенос надо разрешить явно. */
.empty__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 800; overflow-wrap: break-word; }
.empty__status .icon { color: var(--muted); }
/* Без min-width: 0 flex-элемент не сжимается уже самого длинного слова:
   overflow-wrap: break-word на минимальный размер не влияет. */
.empty__status-text { min-width: 0; }
.empty__note { margin-top: 10px; max-width: 62ch; font-size: 16px; color: var(--muted); }
.empty__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Заметка на полях */
.note {
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
}
.note b { display: block; font-weight: 800; font-size: 15px; }
.note p { margin-top: 8px; font-size: 15px; color: var(--muted); max-width: 72ch; }

@media (max-width: 860px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about .portrait { max-width: 420px; }
  .spec > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .steps > li { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

@media (max-width: 620px) {
  .act, .steps > li { padding: 20px; }
  .doc-list a { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; }
  .doc-list .state { grid-column: 1 / -1; }
  .empty__actions .btn { width: 100%; }
}

/* ---------- Хвост страницы без пейджера ----------
   На страницах ошибок кнопки упирались в линию подвала: 0 px против 80 px
   на остальных страницах. */
.page-tail { padding-block: 0 clamp(48px, 6vw, 80px); }

/* ---------- Режим высокой контрастности ----------
   Точка состояния рисуется рамкой и заливкой currentColor: в forced-colors
   системная палитра снимает и то и другое, и «опубликовано» переставало
   отличаться от «готовится». Слово рядом остаётся в любом случае. */
@media (forced-colors: active) {
  .chip__dot, .state__dot { border-color: CanvasText; }
  .chip--ready .chip__dot, .state--ready .state__dot { background: CanvasText; }
  .btn--primary, .rail a[aria-current] { border: 1.5px solid CanvasText; }
}

/* ---------- Печать ----------
   Эксперт печатает страницу показателя. Браузер по умолчанию не печатает
   заливки, поэтому белый текст на «чернилах» исчезал с листа: подпись
   главной кнопки и отметка текущего направления в рейке пропадали. */
@media print {
  .site-header, .a11y-btn, .menu, .skip-link, .pager, .toc,
  #sports-playground, .game { display: none !important; }

  html { scroll-padding-top: 0; }
  body { font-size: 12pt; }

  .btn--primary,
  .rail a[aria-current] {
    color: var(--ink) !important;
    background: transparent !important;
    border: 1.5px solid var(--ink) !important;
    box-shadow: none !important;
  }

  .indicator, .act, .steps > li, .doc-list a, .direction,
  .empty, .note, .attestation-panel { break-inside: avoid; }

  h1, h2, h3 { break-after: avoid; }

  /* Адрес нормативного акта на бумаге не пропадает. */
  .act__links a[href^="http"]::after,
  .law a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    font-weight: 400;
    word-break: break-all;
  }
}

@page { margin: 16mm; }

/* ---------- Диск ----------
   Дерево слева, содержимое папки справа — как в проводнике. На узком экране
   дерево уходит под содержимое: сначала то, за чем пришли, потом навигация. */

.disk {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 28px clamp(24px, 3vw, 40px);
  align-items: start;
  padding-bottom: clamp(8px, 1vw, 16px);
}
.disk__main { min-width: 0; }

/* Дерево папок */
.tree {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  min-width: 0;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.tree h2 {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: normal;
  color: var(--muted);
  padding: 0 10px 10px;
}
.tree ul ul { margin-left: 16px; padding-left: 12px; border-left: 1px solid var(--line); }
.tree a,
.tree summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.tree ul ul a { font-size: 15px; }
.tree a:hover,
.tree summary:hover { background: var(--tint); color: var(--blue); }
.tree a[aria-current] { background: var(--ink); color: #fff; }
.tree a[aria-current] .icon { color: #fff; }
.tree .icon { flex: none; color: var(--blue); }
.tree a > span,
.tree summary > a { min-width: 0; overflow-wrap: break-word; }
.tree small {
  margin-left: auto;
  padding-left: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tree a[aria-current] small { color: #b9cadb; }
.tree__root { font-weight: 800; }

/* Ветвь направления: сворачивается нативно, без скрипта. Стрелка
   поворачивается, имя папки внутри остаётся обычной ссылкой. */
.tree__branch > summary { cursor: pointer; list-style: none; }
.tree__branch > summary::-webkit-details-marker { display: none; }
.tree__branch > summary > a {
  /* Ссылка обязана занимать всю высоту строки: цель нажатия — 48 px,
     а не 21 px по высоте текста. */
  flex: 1;
  align-self: stretch;
  min-height: 44px;
  padding: 0;
  gap: 0;
  border-radius: 0;
  background: none;
  font: inherit;
}
.tree__branch > summary > a[aria-current] {
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.tree__branch > summary:hover > a { color: var(--blue); }
.tree__chev { transition: transform var(--fast) var(--ease); }
.tree__branch[open] > summary .tree__chev { transform: rotate(90deg); }

/* Поиск по папке — появляется только со скриптом */
.finder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 16px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
}
.finder:focus-within { border-color: var(--blue); }
.finder .icon { flex: none; color: var(--muted); }
.finder input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 12px 0;
  font: 400 16px/1.4 var(--body);
  color: var(--ink);
  background: transparent;
}
.finder input:focus { outline: none; }
.finder__count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Список содержимого папки */
.listing { display: grid; gap: 8px; }
.listing__row > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 18px;
  min-height: 60px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.listing__row > a:hover { border-color: var(--line-strong); background: var(--tint); box-shadow: var(--shadow-1); }
.listing__row .icon { flex: none; color: var(--blue); }
.listing__name { font-weight: 800; font-size: 17px; }
.listing__meta { grid-column: 2; grid-row: 2; font-size: 15px; color: var(--muted); }
.listing__size {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.listing__go { color: var(--muted); grid-column: 4; grid-row: 1 / span 2; }
.listing__row[hidden] { display: none; }

/* Показатель с опубликованными материалами */
.slot__status--ready { color: var(--ink); font-weight: 700; }
.slot__status--ready .icon { color: var(--blue); }

@media (max-width: 1080px) {
  .disk { grid-template-columns: minmax(0, 1fr); }
  /* Сначала содержимое папки, дерево — под ним. */
  .disk__main { order: -1; }
  .tree { position: static; max-height: none; }
}

@media (max-width: 620px) {
  .listing__row > a { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; }
  .listing__size { grid-column: 2; grid-row: 3; }
  .listing__go { display: none; }
}

@media print {
  .tree, .finder { display: none !important; }
  .disk { grid-template-columns: minmax(0, 1fr); }
  .listing__row { break-inside: avoid; }
  .listing__row > a[href$=".pdf"]::after,
  .listing__row > a[href$=".jpg"]::after { content: none; }
}
