/* ==== MODULE CONTRACT: site-css ====
 * PURPOSE:   Задавать визуальный слой сайта через токены, раскладку и адаптивные состояния, сохраняя палитру старого сайта.
 * SCOPE:     токены :root, базовая типографика, сетки страниц, компоненты (шапка, карточки, бейджи, таблицы, фильтры), таблица построек с липкими шапкой и колонкой, числовые матрицы товаров и цен с тепловой раскраской, брейкпоинты 980/900/640px.
 * NON-GOALS: Не нести контент и игровые данные, не подключать внешние шрифты и CSS-фреймворки, не вводить состояния, которых нет в разметке.
 * INVARIANTS:палитра — олива + янтарь + бумага; скрытие ходов работает только при классе js на html, без JS контент виден; один h1 на страницу не ломается стилями.
 * DEPENDS:   templates:HtmlHooks
 * EXPOSES:   style.css
 * ERRORS:    нет
 * TESTS:     T-BUILD-006
 * ==== END MODULE CONTRACT: site-css ==== */

:root {
  --ink: #23241f;
  --ink-soft: #565749;
  --ink-mute: #7c7d6f;
  --olive: #3f4137;
  --olive-deep: #2b2d26;
  --olive-soft: #4c4f43;
  --amber: #fdc073;
  --amber-deep: #d99a4e;
  --paper: #eceae0;
  --paper-2: #f5f3e9;
  --card: #fffdf6;
  --line: #d9d5c5;
  --line-soft: #e6e2d4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -18px rgba(35, 36, 31, 0.45);
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --page: 1140px;
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, #f7f4e7 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #e4e6d8 0%, transparent 55%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: #7a5423;
  text-decoration-color: rgba(122, 84, 35, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  color: #a26b1f;
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0 0 0.9em;
}

code {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.86em;
  background: rgba(63, 65, 55, 0.08);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

::selection {
  background: rgba(253, 192, 115, 0.45);
}

/* --------------------------------------------------------------------------
   Утилиты
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--amber);
  color: var(--olive-deep);
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0 0 0.7em;
}

.muted {
  color: var(--ink-mute);
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(43, 45, 38, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(253, 192, 115, 0.18);
  color: var(--paper-2);
}

.topbar__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--paper-2);
  line-height: 1.1;
  margin-right: auto;
}

.brand__title {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}

.brand__sub {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(245, 243, 233, 0.55);
}

.mainmenu ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mainmenu a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(245, 243, 233, 0.78);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.18s ease, color 0.18s ease;
}

.mainmenu a:hover {
  color: var(--amber);
  background: rgba(253, 192, 115, 0.1);
}

.mainmenu a.is-active {
  color: var(--olive-deep);
  background: var(--amber);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  border: 1px solid rgba(253, 192, 115, 0.4);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  background: var(--amber);
  content: "";
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bar {
  top: 18px;
}

.nav-toggle__bar::before {
  top: -6px;
}

.nav-toggle__bar::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Каркас страницы
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.page-head {
  padding: 18px 0 8px;
}

.page-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.35em;
}

.page-head--tight {
  padding-bottom: 0;
}

.page-foot-note {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------------
   Герой
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--olive-deep);
  color: var(--paper-2);
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  box-shadow: var(--shadow);
}

.hero__media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 62%;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.72;
  filter: saturate(0.9) contrast(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(43, 45, 38, 0.98) 18%, rgba(43, 45, 38, 0.82) 46%, rgba(43, 45, 38, 0.25) 78%),
    linear-gradient(0deg, rgba(43, 45, 38, 0.9) 0%, transparent 45%);
}

.hero__body {
  padding: clamp(28px, 5vw, 56px);
  max-width: 640px;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 5.6rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-transform: uppercase;
  color: #fdfaf0;
  margin: 0 0 0.1em;
}

.hero__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--amber);
  margin: 0 0 1em;
}

.hero__lead {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(245, 243, 233, 0.85);
  max-width: 46ch;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  max-width: 430px;
  list-style: none;
  margin: 1.4em 0;
  padding: 0;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  list-style: none;
  margin: 1.4em 0;
  padding: 0;
}

.hero__facts li {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 243, 233, 0.6);
}

.hero__facts span {
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--amber);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.6em 0 0;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--solid {
  background: var(--amber);
  color: var(--olive-deep);
}

.btn--solid:hover {
  background: #ffd08f;
  color: var(--olive-deep);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: rgba(253, 192, 115, 0.5);
  color: var(--amber);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(253, 192, 115, 0.12);
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   Секции
   -------------------------------------------------------------------------- */

.section {
  margin-top: 52px;
}

.section--band {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 40px);
}

.section--dark {
  background: var(--olive);
  color: var(--paper-2);
  border-radius: 22px;
  padding: clamp(26px, 4vw, 44px);
}

.section--dark .kicker {
  color: var(--amber);
}

.section--dark h2 {
  color: #fdfaf0;
}

.section--dark p {
  color: rgba(245, 243, 233, 0.82);
}

.section--dark code {
  background: rgba(253, 192, 115, 0.14);
  color: var(--amber);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section__head h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.section__year {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  vertical-align: middle;
  margin-left: 10px;
}

.section__lead {
  font-family: var(--serif);
  color: var(--ink-soft);
  max-width: 72ch;
  margin-bottom: 22px;
}

.section__note {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.link-more {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #8a5a1c;
  border-bottom: 1px solid rgba(138, 90, 28, 0.35);
  padding-bottom: 2px;
}

.link-more:hover {
  border-bottom-color: currentColor;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.split h2 {
  margin-bottom: 0.4em;
}

/* --------------------------------------------------------------------------
   Карточки событий
   -------------------------------------------------------------------------- */

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

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.card h3 {
  font-size: 1.12rem;
  margin: 0.55em 0 0.4em;
}

.event-card p {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Бейджи типов событий
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  align-self: start;
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--politics { background: #eceef2; color: #3d4757; }
.badge--war { background: #f7e4e0; color: #8f2f20; }
.badge--diplomacy { background: #e3eef6; color: #245b7d; }
.badge--dynasty { background: #f4ecdc; color: #7a5a1f; }
.badge--religion { background: #efe7f7; color: #5b3b8a; }
.badge--disaster { background: #ececec; color: #4a4a4a; }
.badge--economy { background: #e6f0e2; color: #3d6b2f; }
.badge--city { background: #f2e8e0; color: #7d4c22; }
.badge--culture { background: #f6e8ef; color: #7c3f5e; }
.badge--migration { background: #f8e9da; color: #8a4b16; }

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

.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: strip;
}

.strip a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.strip a:hover {
  border-color: var(--amber-deep);
  transform: translateY(-2px);
}

.strip__year {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: #8a5a1c;
  line-height: 1;
}

.strip strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.strip__meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------------
   Народы на главной
   -------------------------------------------------------------------------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.people a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  height: 100%;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.people a:hover {
  border-color: var(--ethnos);
  background: #fff;
}

.people__dot {
  grid-row: span 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ethnos);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}

.people__name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.people em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------------
   Шаги
   -------------------------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(253, 192, 115, 0.07);
  border: 1px solid rgba(253, 192, 115, 0.18);
}

.steps span {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--amber);
  line-height: 1;
}

.steps h3 {
  font-size: 1rem;
  margin-bottom: 0.2em;
}

.steps p {
  font-size: 0.9rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Галерея
   -------------------------------------------------------------------------- */

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

.gallery--preview {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.shot {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shot[hidden] {
  display: none;
}

.shot > a {
  display: block;
  background: #efede2;
  padding: 10px;
}

.shot img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.shot > a:hover img {
  opacity: 0.92;
}

.shot figcaption {
  padding: 16px 20px 20px;
}

.shot h2,
.shot h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3em;
}

.shot figcaption p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 0.4em;
}

.shot__meta {
  font-size: 0.76rem !important;
  color: var(--ink-mute) !important;
}

.shot--wide {
  max-width: 760px;
  margin: 0 auto;
}

.shot--table {
  max-width: 440px;
  margin: 0 auto;
}

/* Таблицы высокие: показываем их целиком, иначе мелкий текст не прочитать */
.shot--table img {
  max-height: none;
}

/* Таблицы, собранные из чисел: место, название и значение */
.shot--data {
  max-width: 520px;
  margin: 0 auto;
}

.matrix-table {
  margin: 0 14px 8px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.matrix-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.matrix-table th,
.matrix-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--olive);
  color: var(--paper);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.matrix-table tbody th {
  position: sticky;
  left: 0;
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}

.matrix-table tbody tr:last-child th,
.matrix-table tbody tr:last-child td {
  border-bottom: 0;
}

.matrix-table thead th.matrix-table__num,
.matrix-table td.matrix-table__num {
  text-align: right;
}

.heat-0 {
  background: #fdfbf4;
}

.heat-1 {
  background: #f7f0db;
}

.heat-2 {
  background: #f1e3bc;
}

.heat-3 {
  background: #e8d097;
}

.heat-4 {
  background: #ddb96f;
}

.heat-5 {
  background: #cda04d;
}

.matrix-table__source {
  margin: 0 14px 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.matrix-table__source summary {
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.matrix-table__source img {
  margin-top: 10px;
  max-width: 360px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.table-legend {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--amber-deep);
  background: rgba(253, 192, 115, 0.14);
  color: var(--ink-soft);
  font-size: 0.88rem;
  max-width: 80ch;
}

.rank-table {
  padding: 0 14px 16px;
}

.rank-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.rank-table th,
.rank-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: baseline;
}

.rank-table thead th {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--line);
}

.rank-table thead th:last-child {
  text-align: right;
}

.rank-table tbody th {
  width: 2.6em;
  padding-right: 4px;
  text-align: right;
  font-weight: 600;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.rank-table tbody td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-table tbody tr:last-child th,
.rank-table tbody tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   Этносы
   -------------------------------------------------------------------------- */

.ethnos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.ethnos {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  overflow: hidden;
}

.ethnos::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--ethnos);
}

.ethnos__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ethnos__swatch {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ethnos);
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.04);
}

.ethnos h2 {
  font-size: 1.5rem;
  margin-bottom: 0.1em;
}

.ethnos__epithet {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.98rem;
}

.ethnos__analog {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  padding: 10px 12px;
  background: rgba(63, 65, 55, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.ethnos__analog span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.ethnos__text {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 0.85em;
}

.ethnos__text strong {
  color: var(--ink);
  font-weight: 600;
}

.ethnos__status {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.ethnos__status span {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

/* --------------------------------------------------------------------------
   Мир: география, законы, летопись
   -------------------------------------------------------------------------- */

.prose {
  max-width: 74ch;
  margin-top: 22px;
}

.prose p {
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

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

.region {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.region h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3em;
}

.region p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.laws {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.law {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 22px;
}

.law h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}

.law p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.law__effect {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(111, 174, 63, 0.12);
  color: #34561f;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
}

.law__effect span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4c7a2f;
  margin-bottom: 2px;
}

.timeline {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber-deep), var(--line));
}

.epoch {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 22px;
  padding-bottom: 42px;
}

.epoch:last-child {
  padding-bottom: 0;
}

.epoch__marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--amber);
  font-family: var(--serif);
  font-size: 1.05rem;
  box-shadow: 0 0 0 6px var(--paper);
}

.epoch__years {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 0.3em;
}

.epoch__body > h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  margin-bottom: 0.7em;
}

.epoch__block {
  max-width: 76ch;
  margin-bottom: 16px;
}

.epoch__block h4 {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.4em;
}

.epoch__block p {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0;
}

.battle {
  max-width: 76ch;
  margin: 20px 0 22px;
  padding: 18px 22px;
  border-left: 4px solid #b0362a;
  background: #fbf0ee;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.battle__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f2f20;
  margin-bottom: 0.3em;
}

.battle h4 {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

.battle p {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: #4a3a36;
  margin-bottom: 0.5em;
}

.battle__result span {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8f2f20;
}

.heroes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.hero-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.hero-card__people {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 0.3em;
}

.hero-card h4 {
  font-size: 1.08rem;
  margin-bottom: 0.35em;
}

.hero-card p:last-child {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.epoch__outro {
  max-width: 76ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  padding-top: 6px;
}

/* --------------------------------------------------------------------------
   Ходы: табы, фильтры, события
   -------------------------------------------------------------------------- */

.turn-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 22px 0 6px;
  scrollbar-width: thin;
}

.turn-tab {
  flex: 1 0 180px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper-2);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.turn-tab:hover {
  border-color: var(--amber-deep);
  transform: translateY(-1px);
}

.turn-tab.is-active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--paper-2);
}

.turn-tab__num {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.turn-tab.is-active .turn-tab__num {
  color: var(--amber);
}

.turn-tab__year {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.1;
}

.turn-tab__title {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.turn-tab.is-active .turn-tab__title {
  color: rgba(245, 243, 233, 0.75);
}

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
}

.search[hidden] {
  display: none;
}

.search__input {
  flex: 1 1 320px;
  max-width: 540px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search__input::placeholder {
  color: var(--ink-mute);
}

.search__input:focus {
  outline: none;
  border-color: var(--amber-deep);
  box-shadow: 0 0 0 3px rgba(253, 192, 115, 0.35);
}

.search__hint {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 26px;
}

.filters[hidden] {
  display: none;
}

.filters__label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 4px;
}

.filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--amber-deep);
}

.chip.is-active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--paper-2);
}

.chip__count {
  margin-left: 6px;
  opacity: 0.6;
}

.turn {
  padding-top: 10px;
}

html.js .turn.is-hidden {
  display: none;
}

.turn,
.epoch,
.shot,
.ethnos {
  scroll-margin-top: 96px;
}

.turn__head {
  max-width: 78ch;
  margin-bottom: 24px;
}

.turn__kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 0.35em;
}

.turn__title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin-bottom: 0.35em;
}

.turn__lead {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.turn__layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}

.turn__layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.turn__layout--single .events {
  max-width: 840px;
}

.turn__map {
  margin: 0;
  position: sticky;
  top: 92px;
}

.turn__map a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
}

.turn__map img {
  width: 100%;
  border-radius: 10px;
}

.turn__map figcaption {
  font-size: 0.8rem;
  color: var(--ink-mute);
  padding: 8px 4px 0;
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.event {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
  align-items: start;
}

.event:first-child {
  border-top: none;
  padding-top: 0;
}

.event__body h3 {
  font-size: 1.18rem;
  margin-bottom: 0.35em;
}

.event__body p {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

.event.is-filtered {
  display: none;
}

.turn__note {
  margin-top: 26px;
  font-size: 0.88rem;
  color: var(--ink-mute);
  font-style: italic;
}

.turn-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.turn-nav__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.turn-nav__link:hover {
  border-color: var(--amber-deep);
  transform: translateY(-1px);
  color: var(--ink);
}

.turn-nav__link--next {
  margin-left: auto;
  text-align: right;
}

.turn-nav__dir {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.turn-nav strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
}

.bars {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  max-width: 760px;
}

.bars li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 42px;
  gap: 14px;
  align-items: center;
  font-size: 0.86rem;
}

.bars__label {
  color: var(--ink-soft);
}

.bars__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(63, 65, 55, 0.09);
  overflow: hidden;
}

.bars__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
}

.bars__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Рассадка, лог, ссылки
   -------------------------------------------------------------------------- */

.stat-row {
  margin: 4px 0 26px;
}

.stat-row li {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  min-width: 130px;
}

.stat-row span {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.notes {
  max-width: 74ch;
}

.notes p {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-soft);
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.log {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.log li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  padding: 10px 0 10px 22px;
  position: relative;
}

.log li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-deep);
  box-shadow: 0 0 0 4px var(--paper);
}

.log time {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.log span {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
}

.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.link-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 22px;
}

.link-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4em;
}

.link-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.link-card h2 a:hover {
  color: #8a5a1c;
}

.link-card p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin-bottom: 0.5em;
}

.link-card__url {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.74rem !important;
  color: var(--ink-mute) !important;
  word-break: break-all;
  margin: 0 !important;
}

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

.footer {
  background: var(--olive-deep);
  color: rgba(245, 243, 233, 0.72);
  margin-top: 40px;
}

.footer__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.86rem;
}

.footer__brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--amber);
  margin-bottom: 0.3em;
}

.footer__note {
  max-width: 52ch;
  margin: 0;
}

.footer__meta {
  text-align: right;
}

.footer__meta p {
  margin: 0 0 0.4em;
}

.footer a {
  color: rgba(253, 192, 115, 0.9);
  text-decoration: none;
}

.footer a:hover {
  color: var(--amber);
  text-decoration: underline;
}

.footer code {
  background: rgba(253, 192, 115, 0.12);
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.notfound {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
}

.notfound h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.35em;
}

/* --------------------------------------------------------------------------
   Постройки
   -------------------------------------------------------------------------- */

.catalog-note {
  max-width: 88ch;
  margin: 0 0 8px;
  padding: 12px 16px;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(253, 192, 115, 0.14);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cat-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.cat-nav__link:hover {
  border-color: var(--amber-deep);
  color: #8a5a1c;
}

.cat-nav__count {
  font-size: 0.68rem;
  color: var(--ink-mute);
}

.changes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.change {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 96px;
}

.change:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.change__num {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber);
  color: var(--olive-deep);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
}

.change__body h3 {
  font-size: 1.06rem;
  margin-bottom: 0.3em;
}

.change__body p {
  max-width: 78ch;
  margin-bottom: 0.4em;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.change__body .change__links {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.bldg-table {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: 0 6px 18px -16px rgba(35, 36, 31, 0.35);
  scrollbar-width: thin;
}

.bldg-table__table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.bldg-table__table caption {
  padding: 12px 16px 0;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.bldg-table__table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 9px 12px;
  text-align: left;
  vertical-align: bottom;
  background: var(--olive);
  color: var(--paper);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--olive-deep);
}

.bldg-table__table thead th[data-sort] {
  cursor: pointer;
}

.bldg-table__table thead th[data-sort]::after {
  content: "↕";
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--amber);
  opacity: 0.55;
}

.bldg-table__table thead th[aria-sort="ascending"]::after {
  content: "↑";
  opacity: 1;
}

.bldg-table__table thead th[aria-sort="descending"]::after {
  content: "↓";
  opacity: 1;
}

.bldg-table__table thead th:first-child,
.bldg-table__table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
}

.bldg-table__table thead th:first-child {
  z-index: 4;
  background: var(--olive);
}

.bldg-table__table tbody th,
.bldg-table__table tbody td {
  padding: 9px 12px;
  border-top: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
}

.bldg-table__table tbody tr:hover th,
.bldg-table__table tbody tr:hover td {
  background: #fdf8ea;
}

.bldg-table__table tbody tr[hidden] {
  display: none;
}

.bldg__name {
  min-width: 150px;
  max-width: 230px;
  font-weight: 600;
}

.bldg__title {
  display: block;
}

.bldg__flag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(217, 154, 78, 0.45);
  border-radius: 999px;
  background: rgba(253, 192, 115, 0.35);
  color: #7a4a12;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.bldg__flag:hover {
  background: var(--amber);
  color: var(--olive-deep);
}

.bldg__req,
.bldg__base {
  min-width: 130px;
  max-width: 240px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.bldg-table__table thead th.bldg-table__num {
  text-align: right;
}

.bldg__num {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.cost-cheap {
  background: #e2f3e7;
}

.cost-mid {
  background: #fff3cd;
}

.cost-expensive {
  background: #fce8e9;
}

.income-negative {
  background: #fce8e9;
  color: #8a2b1f;
}

.income-low {
  background: #fff8e3;
}

.income-mid {
  background: #e6f2dc;
}

.income-high {
  background: #cdeac1;
}

.bldg__more {
  width: 1%;
  white-space: nowrap;
}

.bldg__more summary {
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.bldg__more dl {
  width: max-content;
  max-width: 320px;
  margin: 8px 0 0;
  text-align: left;
  white-space: normal;
  font-size: 0.8rem;
}

.bldg__more dt {
  margin-top: 6px;
  color: var(--ink-mute);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bldg__more dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .bldg-table__table {
    min-width: 760px;
    font-size: 0.82rem;
  }

  .bldg-table__table thead th,
  .bldg-table__table tbody th,
  .bldg-table__table tbody td {
    padding: 7px 9px;
  }
}

.section[id] {
  scroll-margin-top: 96px;
}

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

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

  .turn__layout {
    grid-template-columns: 1fr;
  }

  .turn__map {
    position: static;
    max-width: 460px;
  }

  .hero__media {
    width: 100%;
  }

  .hero__media img {
    opacity: 0.42;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(43, 45, 38, 0.97) 25%, rgba(43, 45, 38, 0.78) 65%, rgba(43, 45, 38, 0.55) 100%);
  }
}

@media (max-width: 900px) {
  .topbar__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .mainmenu {
    display: none;
    width: 100%;
  }

  .mainmenu.is-open {
    display: block;
  }

  html:not(.js) .mainmenu {
    display: block;
  }

  html:not(.js) .nav-toggle {
    display: none;
  }

  .mainmenu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 4px;
    border-top: 1px solid rgba(253, 192, 115, 0.18);
  }

  .mainmenu a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .ethnos-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 28px 16px 56px;
  }

  .event {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .turn-nav__link {
    width: 100%;
  }

  .turn-nav__link--next {
    margin-left: 0;
    text-align: left;
  }

  .bars li {
    grid-template-columns: 108px minmax(0, 1fr) 34px;
    gap: 10px;
  }

  .log li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .footer__meta {
    text-align: left;
  }

  .hero__facts {
    gap: 10px 20px;
  }

  .hero__facts span {
    font-size: 1.3rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .topbar,
  .footer,
  .turn-tabs,
  .filters,
  .search,
  .turn-nav,
  .hero__actions {
    display: none;
  }

  html.js .turn.is-hidden {
    display: block;
  }

  .event-card p {
    -webkit-line-clamp: unset;
  }

  body {
    background: #fff;
  }
}
