@import url('design-tokens.css');
/* «Живой гербарий» — общие токены и компоненты лендинга (/) и страницы
   стримеров (/streamers). Файл лежит в public/ и отдаётся под стабильным
   именем /site/tokens.css: preview.html собирается без Vite и подключает его
   напрямую. Тёмная тема — единственная: она часть бренда, а не режим. */

:root {
  /* Раскладка лендинга; цвета, шрифты и форма — в общих токенах
     (src/frontend/design/tokens.css, отдаётся как /site/design-tokens.css). */
  --maxw: 1240px;
  --gutter: 40px;
  --spine: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Зерно бумаги: шум поверх всего, не ловит клики. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--bone);
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--gold); }
p, figure { margin: 0; }

a { color: inherit; text-decoration: none; }
a.link {
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s;
  border-bottom: 1px solid var(--gold-soft);
}
a.link:hover { background-size: 100% 1px; color: var(--gold-2); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Моно-подпись: номера таблиц, «№ 17 · одуванчик», колонтитулы. */
.mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--bone-2); }
.faint { color: var(--bone-3); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  font: 600 15px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn--gold { background: var(--gold); color: var(--gold-ink); }
.btn--gold:hover { background: var(--gold-2); box-shadow: 0 10px 30px -12px rgba(214, 179, 106, 0.55); transform: translateY(-1px); }
.btn--line { background: transparent; color: var(--bone); border-color: var(--gold-soft); }
.btn--line:hover { border-color: var(--gold); color: var(--gold-2); }
.btn--sm { min-height: 38px; padding: 0 18px; font-size: 14px; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Колонтитул-шапка ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--gold-faint);
}
.masthead__in { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { width: 28px; height: 28px; color: var(--gold); flex: none; }
.brand__name { font: 600 24px/1 var(--serif); letter-spacing: -0.01em; }
.masthead nav { display: flex; gap: 22px; margin-left: auto; }
.masthead nav a { font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-2); transition: color 0.2s; }
.masthead nav a:hover { color: var(--gold); }
/* Текущий раздел (nav.js): золотая черта под пунктом. */
.masthead nav a[aria-current] { color: var(--gold-2); box-shadow: inset 0 -1px 0 var(--gold); padding-bottom: 6px; margin-bottom: -7px; }
.masthead nav .masthead__cta { display: none; }
/* Кнопка мобильного меню — только на узком экране. */
.masthead__menu {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.masthead__menu-icon,
.masthead__menu-icon::before,
.masthead__menu-icon::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.masthead__menu-icon { position: relative; }
.masthead__menu-icon::before, .masthead__menu-icon::after { content: ''; position: absolute; left: 0; }
.masthead__menu-icon::before { top: -5px; }
.masthead__menu-icon::after { top: 5px; }
.masthead__menu[aria-expanded="true"] .masthead__menu-icon { background: transparent; }
.masthead__menu[aria-expanded="true"] .masthead__menu-icon::before { transform: translateY(5px) rotate(45deg); }
.masthead__menu[aria-expanded="true"] .masthead__menu-icon::after { transform: translateY(-5px) rotate(-45deg); }
/* Якоря не заезжают под липкую шапку. */
section[id], [id].chapter { scroll-margin-top: 84px; }

/* ---------- Таблица-гравюра ---------- */
.plate {
  position: relative;
  background: var(--plate);
  border: 1px solid var(--gold-soft);
  padding: 14px;
}
/* Уголки-скобы, как у ботанической таблицы. */
.plate::before,
.plate::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold);
  pointer-events: none;
}
.plate::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.plate::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.plate__cap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gold-faint);
}
.plate__legend { font: italic 500 18px/1.3 var(--serif); color: var(--bone-2); }

/* ---------- Колофон ---------- */
.colophon { border-top: 1px solid var(--gold-faint); padding: 64px 0 48px; color: var(--bone-3); font-size: 14px; }
.colophon__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.colophon h3 { font-size: 30px; margin-bottom: 10px; }
.colophon nav { display: grid; gap: 10px; }
.colophon .mono { color: var(--bone-3); }

/* ---------- Появление при прокрутке ---------- */
/* Прячем только когда скрипт есть (html.js ставит строка в <head>): без JS
   раньше все главы лендинга оставались невидимыми (08.10.2026). */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  :root { --gutter: 16px; --spine: 0px; }
  /* Меню на телефоне — выпадающий лист под шапкой (nav.js), а не пустота:
     до 07.10.2026 пункты просто прятались. */
  .masthead__menu { display: inline-flex; }
  .masthead__in > .btn--gold { display: none; }
  .masthead nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    /* Сплошной фон: полупрозрачный пропускал заголовок страницы сквозь пункты. */
    background: var(--ink);
    border-bottom: 1px solid var(--gold-faint);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.8);
  }
  .masthead nav[data-open] { display: flex; }
  .masthead nav a { padding: 16px 0; border-bottom: 1px solid var(--gold-faint); font-size: 13px; }
  .masthead nav a[aria-current] { box-shadow: none; margin: 0; padding-bottom: 16px; }
  .masthead nav .masthead__cta { display: inline-flex; margin-top: 18px; border-bottom: 0; justify-content: center; padding: 0 22px; color: var(--gold-ink); font: 600 15px/1 var(--sans); letter-spacing: 0; text-transform: none; }
  .colophon__grid { grid-template-columns: 1fr; gap: 28px; }
}
