:root {
  --bg: #080b0d;
  --panel: #101518;
  --ink: #f0eadb;
  --muted: #aaa99f;
  --gold: #d8aa5d;
  --line: #31383a;
  --real: #7fb896;
  --approx: #e5b765;
  --hyp: #d16f63;
  --myth: #a681d1;
  --decor: #75aabd;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, Arial, sans-serif;
  overflow-x: hidden;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
.topbar {
  height: 64px;
  padding: 0 clamp(16px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff20;
  font-size: 11px;
  letter-spacing: 0.14em;
  position: absolute;
  z-index: 10;
  width: 100%;
}
.brand {
  text-decoration: none;
  font-weight: 700;
}
.brand span {
  color: var(--gold);
}
.hero {
  height: 100svh;
  min-height: 620px;
  position: relative;
  display: grid;
  align-items: end;
  /* Вращающаяся карта намеренно больше экрана; clip не даёт её геометрии
     участвовать в scrollWidth, сохраняя видимую область и маркеры героя. */
  overflow: clip;
}
.hero-map {
  position: absolute;
  inset: -18%;
  display: grid;
  place-items: center;
  animation: hero-spin 90s linear infinite;
}
.hero-map img {
  width: min(105vw, 1100px);
  height: auto;
  filter: saturate(0.85) contrast(1.05);
  border-radius: 50%;
  box-shadow: 0 0 100px #ba7d3060;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #050708 0%, #050708cc 35%, transparent 70%),
    linear-gradient(0deg, #080b0d 0%, transparent 45%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  padding: 0 clamp(20px, 7vw, 110px) 11svh;
  max-width: 930px;
}
.eyebrow,
.index,
.credit,
figcaption,
.recon-note {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
h1,
h2 {
  font-family: "PT Serif", Georgia, serif;
  font-weight: 400;
  line-height: 0.89;
  margin: 0.2em 0;
}
h1 {
  font-size: clamp(52px, 9.4vw, 142px);
  letter-spacing: -0.055em;
}
h1 em,
h2 em {
  font-weight: 400;
  color: var(--gold);
}
.hero-copy > p:not(.eyebrow) {
  font-family: "PT Serif", Georgia, serif;
  font-size: clamp(18px, 2vw, 28px);
  max-width: 650px;
  line-height: 1.35;
}
.hero-copy > a,
.primary {
  display: inline-block;
  margin-top: 22px;
  padding: 15px 20px;
  border: 1px solid #ffffff44;
  text-decoration: none;
}
.credit {
  position: absolute;
  right: 4vw;
  bottom: 24px;
  z-index: 2;
  color: #c7c1b4;
}
.lede,
.object,
.biography,
.sources-world,
.ledger,
.digital,
.provenance {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr);
  gap: 4vw;
  padding: clamp(80px, 12vw, 180px) clamp(20px, 7vw, 110px);
  border-top: 1px solid var(--line);
}
h2 {
  font-size: clamp(42px, 7vw, 104px);
  letter-spacing: -0.045em;
}
.lede > div,
.biography > div,
.sources-world > div,
.digital > div,
.provenance > div {
  max-width: 920px;
}
.lede p,
.object > p,
.biography p,
.sources-world p,
.digital p,
.provenance p,
.japan p,
.south p {
  font-family: "PT Serif", Georgia, serif;
  font-size: clamp(18px, 1.65vw, 24px);
  line-height: 1.62;
  color: #d6d0c3;
}
.lede .big {
  font-size: clamp(25px, 2.5vw, 38px);
  line-height: 1.35;
}
.assembly {
  padding: 100px clamp(16px, 4vw, 64px);
  background: #0b1012;
}
.section-head,
.atlas-head {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 4vw;
  margin-bottom: 55px;
}
.section-head > div {
  max-width: 850px;
}
.section-head p:not(.index),
.atlas-head > p {
  color: var(--muted);
  line-height: 1.6;
}
.stage-wrap {
  position: relative;
  max-width: 900px;
  margin: auto;
}
.sheet-stage {
  --stage: 900px;
  aspect-ratio: 1;
  position: relative;
  transition: transform 0.8s;
  border-radius: 50%;
}
.sheet {
  position: absolute;
  background-image: url("assets/monte-composite-800.webp");
  background-repeat: no-repeat;
  background-size: var(--bg-size) var(--bg-size);
  background-position: var(--bg-x) var(--bg-y);
  box-shadow: 0 7px 22px #0008;
  transition:
    left 1.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    top 1.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.6s;
  will-change: transform, left, top;
}
.sheet-stage.assembled .sheet {
  box-shadow: none;
}
@media (min-width: 901px) {
  .sheet {
    background-image: url("assets/monte-composite.webp");
  }
}
.sheet-stage.spinning {
  animation: spin 55s linear infinite;
}
.human {
  position: absolute;
  right: -5%;
  bottom: 5%;
  height: 28%;
  width: 4%;
  background: #050708;
  border-radius: 45% 45% 10% 10%;
  box-shadow: 0 -22px 0 -3px #050708;
}
.human:after {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #050708;
  left: 15%;
  top: -15%;
}
.scale {
  position: absolute;
  right: -7%;
  bottom: 0;
  font-size: 11px;
  letter-spacing: 0.15em;
}
.controls,
.filters,
.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}
.controls button,
.filters button,
.mode-tabs button {
  border: 1px solid #ffffff32;
  background: #111719;
  color: var(--ink);
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
}
.controls button:hover,
.filters button:hover,
.mode-tabs button:hover,
.controls button:focus-visible,
.filters button:focus-visible,
.mode-tabs button:focus-visible {
  border-color: var(--gold);
  outline:3px solid var(--gold);
}
.controls button:disabled {
  color: #777;
  cursor: not-allowed;
}
.filters .active,
.mode-tabs .active {
  background: var(--ink);
  color: var(--bg);
}
.recon-note {
  text-align: center;
  color: #888;
  max-width: 800px;
  margin: 25px auto;
}
.object {
  background: var(--ink);
  color: #101314;
}
.object-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #a7a092;
  margin-bottom: 30px;
}
.object-grid article {
  background: var(--ink);
  padding: 34px;
}
.object-grid b {
  display: block;
  font:
    clamp(40px, 6vw, 90px)/1 "PT Serif",
    serif;
  color: #8b5e2c;
}
.object-grid span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.object > p {
  grid-column: 2;
  color: #282b2b;
  max-width: 920px;
}
.caveat {
  border-left: 4px solid #8b5e2c;
  padding-left: 22px;
}
.projection {
  padding: 120px clamp(20px, 5vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 5vw;
  border-top: 1px solid var(--line);
  align-items: center;
}
.projection > div:first-child > p {
  color: #c6c0b4;
  line-height: 1.6;
}
.projection-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #101719;
  box-shadow: 0 0 70px #b37a2940;
}
.projection-stage img,
.projection-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.projection-stage canvas {
  opacity: 0.55;
}
.compare {
  display: block;
  margin: 28px 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.compare input {
  width: min(260px, 60%);
  vertical-align: middle;
  accent-color: var(--gold);
}
.japan,
.south {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
  border-top: 1px solid var(--line);
}
.japan figure,
.south figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  min-height: 650px;
}
.japan img,
.south img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.japan figcaption,
.south figcaption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  background: #080b0dcc;
  padding: 8px;
}
.japan article,
.south article {
  padding: clamp(50px, 7vw, 110px);
}
.hypothesis {
  padding: 20px;
  border: 1px solid var(--gold);
  background: #d8aa5d0c;
}
.atlas {
  padding: 100px clamp(12px, 3vw, 44px);
  border-top: 1px solid var(--line);
}
.atlas-head {
  padding: 0 4vw;
}
.map-explorer {
  position: relative;
  max-width: 1200px;
  margin: 40px auto;
  aspect-ratio: 1;
  overflow: auto;
  border: 1px solid var(--line);
  background: #050707;
}
.map-explorer > img {
  width: 100%;
  height: auto;
  display: block;
}
#markers {
  position: absolute;
  inset: 0;
}
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #0b0d0e;
  background: var(--approx);
  box-shadow: 0 0 0 3px #fff6;
  cursor: pointer;
}
.marker[data-category="real"] {
  background: var(--real);
}
.marker[data-category="hypothetical"] {
  background: var(--hyp);
}
.marker[data-category="myth"] {
  background: var(--myth);
}
.marker[data-category="decorative"] {
  background: var(--decor);
}
.marker:focus-visible {
  outline: 4px solid white;
  outline-offset: 3px;
}
.marker.hidden {
  display: none;
}
.annotation-card {
  max-width: 800px;
  min-height: 150px;
  margin: 20px auto;
  border-top: 1px solid var(--gold);
  padding: 22px;
  background: var(--panel);
}
.annotation-card h3 {
  font:
    34px "PT Serif",
    serif;
  margin: 0;
}
.annotation-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
}
.annotation-card dt {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.annotation-card dd {
  margin: 0;
}
.sources-world {
  background: #13191a;
}
.south {
  background: #0e1315;
}
.south a {
  color: var(--gold);
  display: inline-block;
  padding-block: 6px;
}
.ledger-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ledger-grid article {
  padding: 35px;
  background: var(--panel);
}
.ledger-grid h3,
.cards h3 {
  font:
    32px "PT Serif",
    serif;
  margin-top: 0;
}
.ledger-grid li {
  margin: 16px 0;
  line-height: 1.55;
}
.survivors {
  padding: 120px clamp(20px, 7vw, 110px);
  border-top: 1px solid var(--line);
}
.survivors > h2 {
  max-width: 900px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 50px;
}
.cards article {
  background: var(--bg);
  padding: 30px;
}
.cards time {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.cards p {
  color: #bbb6aa;
  line-height: 1.6;
}
.digital {
  background: #20150f;
}
.provenance nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.provenance nav a {
  border: 1px solid #ffffff40;
  padding: 12px;
  text-decoration: none;
}
.credit-line {
  color: var(--gold) !important;
}
.provenance code {
  word-break: break-word;
}
footer {
  padding: 32px clamp(20px, 7vw, 110px);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes hero-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-map,
  .sheet-stage.spinning {
    animation: none !important;
  }
  .sheet {
    transition: none;
  }
}
@media (max-width: 760px) {
  .topbar {
    font-size: 9px;
  }
  .topbar > span {
    display: none;
  }
  .hero-map {
    inset: -5% -55%;
  }
  .hero-map img {
    width: 150vw;
  }
  .credit {
    left: 20px;
    right: auto;
    max-width: 80%;
    line-height: 1.5;
  }
  .lede,
  .object,
  .biography,
  .sources-world,
  .ledger,
  .digital,
  .provenance,
  .section-head,
  .atlas-head,
  .projection,
  .japan,
  .south {
    grid-template-columns: 1fr;
  }
  .lede > div,
  .object-grid,
  .object > p,
  .ledger-grid {
    grid-column: 1;
  }
  .object-grid,
  .ledger-grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .sheet-stage {
    width: 100%;
    margin-left: 0;
  }
  .human {
    right: 0;
  }
  .projection-stage {
    min-width: 0;
  }
  .japan figure,
  .south figure {
    min-height: 420px;
  }
  .japan article,
  .south article {
    padding: 60px 22px;
  } /* Композит и слой меток не ужимаем до ширины телефона: при 366 px соседние
   метки (Китай и Япония) сходились ближе 28 px и перекрывали друг друга.
   Фиксированные 520 px разводят их, а сама область прокручивается. */
  .map-explorer {
    width: 100%;
  }
  .map-explorer > img {
    width: 520px;
    max-width: none;
  }
  #markers {
    inset: 0 auto auto 0;
    width: 520px;
    height: 529px;
  }
  .annotation-card dl {
    grid-template-columns: 1fr;
  }
  .cards {
    display: grid;
    grid-template-columns: 1fr;
  }
  .survivors {
    padding-top: 80px;
  }
  footer {
    gap: 20px;
    flex-direction: column;
  }
}
@media (max-width: 420px) {
  h1 {
    hyphens: auto;
  }
  .object-grid article {
    padding: 24px;
  }
  .controls button,
  .filters button {
    flex: 1 1 auto;
  }
  .human,
  .scale {
    display: none;
  }
}

/* Слова КАПИТЕЛЬЮ Firefox и WebKit по слогам не переносят: при
   overflow-wrap:break-word слово рвётся посреди без дефиса («ЧУДОВИЩА/МИ»),
   а Chromium ставит в крупном заголовке дефис. Поэтому на узких экранах
   автоперенос в h1–h3 выключен, а кегль подобран так, чтобы самое длинное
   слово влезало в строку целиком. Значения измерены Playwright на 320,
   360 и 390 px в Chromium, Firefox и WebKit. Десктоп не затронут. */
@media (max-width: 520px) {
  h1,
  h2,
  h3 {
    hyphens: manual;
    -webkit-hyphens: manual;
  }
  /* «ПРОИСХОЖДЕНИЕ» шире мобильной колонки: нулевой минимум сетки не даёт
     ей раздвинуть секцию, а кегль рассчитан по доступным 275 px. */
  .provenance {
    grid-template-columns: minmax(0, 1fr);
  }
  .provenance h2 {
    font-size: min(clamp(42px, 7vw, 104px), 9.5vw);
  }
}

/* На планшете отрицательный right выводил подпись масштаба и фигурку за экран. */
@media (max-width: 900px) {
  .scale,
  .human {
    right: 0;
  }
}


/* Единый клавиатурный фокус: акцент раздела и контрастный внешний контур. */
:focus-visible{outline:3px solid var(--gold);outline-offset:3px;box-shadow:0 0 0 6px #000}
