/* Древнетюркское письмо: системного «Noto Sans Old Turkic» нет ни в macOS,
   ни в iOS, поэтому сабсет блока U+10C00–10C4F раздаём со своего домена.
   Лицензия шрифта — OFL, текст лежит рядом: assets/fonts/OFL.txt */
@font-face {
  font-family: "Noto Sans Old Turkic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/noto-sans-old-turkic.woff2") format("woff2");
  unicode-range: U+10C00-10C4F;
}
:root {
  --night: #111513;
  --paper: #e9e2d3;
  --stone: #b7ad98;
  --red: #a9412b;
  --sky: #83aeb3;
  --line: #424944;
  --gold: #d3af69;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}
a {
  color: inherit;
}
.top,
footer {
  height: 58px;
  padding: 0 3vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.14em;
}
.top a,
footer a {
  text-decoration: none;
  min-height: 24px;
  padding-block: 7px;
}
main > section {
  padding: 90px max(5vw, 22px);
  border-bottom: 1px solid var(--line);
}
h1,
h2 {
  font-family: Georgia, serif;
  letter-spacing: -0.055em;
  line-height: 0.84;
  margin: 20px 0;
}
h2 {
  font-size: clamp(44px, 8vw, 118px);
}
h3 {
  font:
    27px Georgia,
    serif;
}
.num,
.kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
} /* minmax(0,…) у текстовой колонки: иначе длинное «ЗАГОВОРИВШАЯ» раздувает
   первую дорожку и портрет схлопывается до нескольких десятков пикселей.
   Второй дорожке дан жёсткий минимум 220 px — ниже фотография не читается. */
.hero {
  min-height: calc(100svh - 58px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  gap: 5vw;
  align-items: center;
  background: radial-gradient(circle at 76% 42%, #344a46, transparent 25%);
}
/* При полях секции 10vw и gap 5vw текстовая дорожка занимает около 54,8vw.
   В Linux/Android Georgia обычно нет: запасной bold serif даёт ширину
   «ЗАГОВОРИВШАЯ» 9,66em (против ≈9em у Georgia в Windows/macOS). Поэтому
   ограничиваем кегль 5,5vw: даже более широкая метрика остаётся в колонке. */
.hero h1 {
  font-size: min(clamp(52px, 6.2vw, 124px), 5.5vw);
}
.hero em {
  color: var(--red);
  font-weight: 400;
}
.lead,
.big {
  max-width: 800px;
  font:
    clamp(18px, 2vw, 27px)/1.5 Georgia,
    serif;
}
.down {
  display: inline-block;
  margin-top: 24px;
  padding-block: 4px;
  text-underline-offset: 6px;
}
.hero figure {
  margin: 0;
}
.hero img {
  width: 100%;
  height: min(72vh, 780px);
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.08);
}
figcaption,
.caption {
  font-size: 12px;
  line-height: 1.5;
  color: #aaa79d;
  margin-top: 8px;
}
.thesis,
.mapsec,
.alphabet,
.myth,
.sources {
  background: var(--paper);
  color: var(--night);
}
/* Тот же тон, что --gold и подписи, но по светлоте под бумажный фон:
   на #e9e2d3 исходные #d3af69 и #aaa79d давали 1,6 и 1,9 вместо 4,5. */
.thesis .num,
.mapsec .num,
.alphabet .num,
.myth .num,
.sources .num {
  color: #75521a;
}
.mapsec .caption,
.mapsec figcaption {
  color: #585549;
}
.layer-tabs,
.view-tabs,
.map-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 30px 0;
}
.layer-tabs button,
.view-tabs button,
.map-controls button,
.letters button {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 13px 16px;
  cursor: pointer;
  min-height: 44px;
}
.layer-tabs button[aria-selected="true"],
.view-tabs button[aria-selected="true"],
.map-controls button.active {
  background: var(--night);
  color: var(--paper);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.thesis article {
  max-width: 900px;
  padding: 30px;
  border-left: 6px solid var(--red);
  background: #d9d0bf;
  font:
    21px/1.6 Georgia,
    serif;
}
.events {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.events article {
  border: 1px solid var(--line);
  padding: 26px;
  margin: 0 -1px -1px 0;
}
.events time {
  font:
    52px Georgia,
    serif;
  color: var(--sky);
}
.events p,
.ideas p,
.source-grid p {
  line-height: 1.6;
}
.mapsec header {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 5vw;
}
.mapsec header > p {
  font:
    19px/1.6 Georgia,
    serif;
  align-self: end;
}
.mapwrap {
  margin-top: 40px;
}
.mapwrap svg {
  width: 100%;
  height: auto;
  background: #d5ccb9;
  border: 1px solid #8b826f;
} /* Атрибут hidden в SVG не действует: слои эпох гасим классом. */
.era:not(.is-on) {
  display: none;
}
.land {
  fill: #c5b99f;
}
.core {
  fill: #a9412bcc;
  stroke: #742818;
  stroke-width: 2;
}
.reach {
  fill: #83aeb388;
  stroke: #517d82;
  stroke-dasharray: 8;
}
.route {
  fill: none;
  stroke: #6e382c;
  stroke-width: 3;
  stroke-dasharray: 9;
}
.china {
  stroke: #3f696d;
}
.mapwrap text {
  font: 12px Arial;
  letter-spacing: 0.1em;
}
.stone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stone-grid figure {
  margin: 0;
}
.stone-grid img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  filter: saturate(0.75);
}
.stone-grid figcaption {
  color: #c5c1b7;
  font-size: 14px;
}
.stones aside {
  margin-top: 38px;
  max-width: 900px;
  padding: 24px;
  border: 1px solid var(--gold);
  font:
    18px/1.55 Georgia,
    serif;
}
.reader {
  background: #222622;
}
.inscription {
  min-height: 190px;
  padding: 35px;
  border: 1px solid #787064;
  background: #b8aa90;
  color: #211b14;
  font:
    clamp(36px, 7vw, 90px)/1.4 "Noto Sans Old Turkic",
    "Segoe UI Historic",
    sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inscription button {
  font: inherit;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 3px;
}
.inscription button:hover,
.inscription button.active {
  background: #872f20;
  color: white;
}
.gloss,
.variant,
.letter-info {
  padding: 20px;
  border-left: 4px solid var(--red);
  font:
    17px/1.55 Georgia,
    serif;
}
.letters {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}
.letters button {
  font:
    32px "Noto Sans Old Turkic",
    "Segoe UI Historic",
    sans-serif;
}
.letter-info {
  background: #d9d0bf;
  margin-top: 20px;
}
.ideas > div,
.compare,
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.ideas article,
.compare article,
.source-grid article {
  padding: 28px;
  border: 1px solid var(--line);
  margin: 0 -1px -1px 0;
}
.discovery {
  background: #344a46;
}
.place-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 35px;
}
.place-list span {
  padding: 22px;
  border: 1px solid #829490;
  line-height: 1.6;
}
.compare article:nth-child(3) {
  background: #d9d0bf;
}
.source-grid {
  grid-template-columns: 1fr 1fr;
}
.source-grid a {
  display: inline-block;
  padding-block: 7px;
}
.provenance {
  padding: 25px;
  background: #d9d0bf;
  line-height: 1.6;
}
.provenance a {
  display: inline-block;
  padding-block: 4px;
}
footer {
  border-bottom: 0;
}
@media (max-width: 800px) {
  main > section {
    padding: 64px 20px;
  }
  .top span,
  footer span {
    display: none;
  } /* minmax(0,1fr): иначе неразрывное «ЗАГОВОРИВШАЯ» задаёт дорожке min-content
   и в Firefox/WebKit колонка становится шире экрана. */
  .hero,
  .mapsec header {
    grid-template-columns: minmax(0, 1fr);
  } /* Кегль на узких экранах подобран так, чтобы самое длинное слово («ЗАГОВОРИВШАЯ»
   в h1, «ДОКАЗАТЕЛЬСТВА» в h2) уместилось в строку целиком: Firefox и WebKit
   не переносят слова капителью и рвут их посреди без дефиса. */
  h2 {
    font-size: 7.9vw;
  }
  .hero {
    padding-top: 55px;
  }
  .hero h1 {
    font-size: 8.8vw;
  }
  .hero img {
    height: 50vh;
  }
  .events,
  .stone-grid,
  .ideas > div,
  .compare,
  .source-grid,
  .place-list {
    grid-template-columns: 1fr;
  }
  .events time {
    font-size: 42px;
  }
  .stone-grid img {
    height: 420px;
  }
  .letters {
    grid-template-columns: repeat(4, 1fr);
  }
  .inscription {
    min-height: 160px;
    padding: 18px;
    font-size: 11vw;
  }
}
@media (max-width: 520px) {
  h1,
  h2,
  h3 {
    overflow-wrap: break-word;
    hyphens: auto;
  }
  /* Рунные кнопки во flex-строке сжимались до 21–23 px; сохраняем минимум
     тач-цели, а уже разрешённый перенос строки принимает лишние знаки. */
  .inscription button {
    min-width: 24px;
    flex-shrink: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
