/* ============================================================
   The Holy Bible — Banner Stacker Champion
   Иллюминированный манускрипт в языке интерфейса Path of Exile
   ============================================================ */

:root {
  --bg: #0b0908;
  --bg-soft: #100d0a;
  --panel: #141009;
  --panel-2: #1a140c;
  --line: #2c2416;
  --line-soft: #221b10;
  --gold: #c8aa6e;
  --gold-bright: #e8d3a2;
  --gold-dim: #8d7550;
  --red: #a92e26;
  --red-deep: #571512;
  --text: #d9cfba;
  --muted: #a2937a;
  --faint: #6f6350;
  --unique: #c1783a;
  --mod-blue: #9c9cf0;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --display: "Cormorant", "Alegreya", Georgia, serif;
  --caps: "Cormorant SC", "Cormorant", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* тонкая пергаментная зернистость + виньетка */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 72% -5%, rgba(200, 170, 110, 0.07), transparent 60%),
    radial-gradient(900px 900px at -10% 100%, rgba(87, 21, 18, 0.10), transparent 55%);
}

::selection { background: rgba(200, 170, 110, 0.28); color: #f4ead2; }

a { color: var(--gold); text-decoration-color: rgba(200, 170, 110, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--gold-bright); }

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

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

/* ---------- индикатор чтения ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-bright));
  z-index: 90;
  box-shadow: 0 0 8px rgba(200, 170, 110, 0.55);
}

/* ---------- каркас ---------- */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  max-width: 1360px;
  margin: 0 auto;
}

/* ---------- левая колонна: оглавление ---------- */
.rail {
  border-right: 1px solid var(--line-soft);
  padding: 2.2rem 1.6rem 2.2rem 2rem;
}

.rail-inner {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 0.6rem 0.4rem 1.4rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rail-brand {
  display: block;
  text-decoration: none;
  margin-bottom: 1.4rem;
}
.rail-brand .rb-title {
  display: block;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  line-height: 1.15;
}
.rail-brand .rb-sub {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

.toc-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 1.2rem 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.toc-label::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }

.toc { display: flex; flex-direction: column; }

.toc-link {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.34rem 0.5rem 0.34rem 0.4rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid transparent;
  border-radius: 0 3px 3px 0;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.toc-link .n {
  font-family: var(--caps);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  text-align: right;
  padding-right: 0.35rem;
  transition: color 0.18s ease;
}
.toc-link:hover { color: var(--gold-bright); background: rgba(200, 170, 110, 0.05); }
.toc-link:hover .n { color: var(--gold); }
.toc-link.active {
  color: var(--gold-bright);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(200, 170, 110, 0.09), transparent 80%);
}
.toc-link.active .n { color: var(--gold); }

.rail-links {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* ---------- мобильная шапка ---------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  background: rgba(11, 9, 8, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .tb-title {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-toggle {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.toc-toggle:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------- основная колонна ---------- */
.main { min-width: 0; padding: 0 3.2rem 4rem; }
.main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---------- фронтиспис (hero) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 3rem;
  align-items: center;
  padding: 4.6rem 0 3.6rem;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.3rem;
}
.hero-eyebrow a { color: var(--gold); text-decoration: none; }
.hero-eyebrow a:hover { text-decoration: underline; }

.hero-title {
  font-family: var(--caps);
  font-weight: 700;
  font-size: clamp(2.7rem, 5.4vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  color: var(--gold-bright);
  text-wrap: balance;
  text-shadow: 0 0 34px rgba(200, 170, 110, 0.22);
}

.hero-sub {
  font-family: var(--display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  color: var(--gold);
  margin-top: 0.55rem;
}

.hero-rule {
  width: 130px;
  border: none;
  border-top: 1px solid var(--gold-dim);
  position: relative;
  margin: 1.5rem 0;
}
.hero-rule::after {
  content: "✦";
  position: absolute;
  top: -0.72em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--gold);
  padding: 0 0.55em;
  font-size: 0.8rem;
}

.hero-note {
  border-left: 2px solid var(--red);
  background: linear-gradient(90deg, rgba(87, 21, 18, 0.22), transparent 85%);
  padding: 0.9rem 1.1rem;
  font-size: 0.98rem;
  color: var(--text);
}
.hero-note .hn-head {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: #e0b08c;
  margin-bottom: 0.4rem;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-decoration: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 3px;
  padding: 0.5rem 0.9rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.chip .c-ico { color: var(--gold-dim); font-size: 0.9em; }
.chip:hover {
  border-color: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  color: var(--gold-bright);
}
.chip--primary {
  border-color: var(--gold-dim);
  background: linear-gradient(180deg, #241b0e, #180f08);
  box-shadow: inset 0 0 0 1px rgba(200, 170, 110, 0.12);
}

.chip--small { padding: 0.34rem 0.66rem; font-size: 0.76rem; }

/* чип-ссылка на симулятор — лёгкий красный акцент, чтобы выделялся */
.chip--sim {
  border-color: var(--red-deep);
  background: linear-gradient(180deg, #2a1410, #1a0d0a);
  color: var(--gold-bright);
}
.chip--sim:hover { border-color: var(--red); box-shadow: 0 6px 18px rgba(87, 21, 18, 0.5); }

/* переключатель языка RU / EN */
.rail-lang { display: flex; gap: 0.4rem; margin: 1.4rem 0 0.2rem; }
.chip--lang {
  min-width: 2.4rem;
  text-align: center;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.chip--lang.is-active {
  color: #14100a;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold-dim);
  cursor: default;
}
.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  vertical-align: middle;
}

/* икона в арочной раме */
.hero-icon { position: relative; justify-self: center; }
.hero-icon .frame {
  position: relative;
  border-radius: 250px 250px 6px 6px;
  padding: 9px;
  background:
    linear-gradient(160deg, #3a2d17, #171008 45%, #2c2110 80%);
  box-shadow:
    0 0 0 1px rgba(200, 170, 110, 0.5),
    0 0 0 5px rgba(20, 14, 8, 0.9),
    0 0 0 6px rgba(200, 170, 110, 0.22),
    0 26px 60px rgba(0, 0, 0, 0.65);
}
.hero-icon img {
  border-radius: 242px 242px 3px 3px;
  width: 100%;
  max-width: 360px;
}
.hero-icon::before {
  content: "";
  position: absolute;
  inset: -13%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 170, 110, 0.16), transparent 72%);
  animation: candle 5.5s ease-in-out infinite;
}
@keyframes candle {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.hero-icon figcaption {
  margin-top: 0.8rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

/* появление hero */
.hero > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero .hero-icon { animation-delay: 0.15s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- главы ---------- */
.chapter { padding: 3.4rem 0 0.8rem; }

.chapter-head { margin-bottom: 1.9rem; }
.chapter-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}
.chapter-eyebrow .num {
  font-family: var(--caps);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--red);
  text-shadow: 0 0 14px rgba(169, 46, 38, 0.4);
}
.chapter-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  color: var(--gold-bright);
  margin-top: 0.5rem;
  text-wrap: balance;
}
.chapter-rule {
  margin-top: 1rem;
  height: 5px;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--line);
}

.chapter p { margin: 0 0 1.15rem; }
.chapter p:last-child { margin-bottom: 0; }

/* буквица первой строки главы */
.lead-p::first-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding: 0.06em 0.12em 0 0;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(200, 170, 110, 0.35);
}

.subhead {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--gold);
  margin: 1.9rem 0 0.9rem;
}

strong { color: var(--gold-bright); font-weight: 700; }
.item { color: var(--unique); font-weight: 700; }
.mod-name { color: var(--gold-bright); font-weight: 700; }

/* ---------- иллюстрации ---------- */
.fig { margin: 1.6rem auto 1.9rem; }
.fig .zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}
.fig img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(15, 11, 7, 0.85), 0 0 0 5px rgba(200, 170, 110, 0.14), 0 14px 34px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.fig .zoom:hover img {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 4px rgba(15, 11, 7, 0.85), 0 0 0 5px rgba(200, 170, 110, 0.3), 0 16px 40px rgba(0, 0, 0, 0.55);
}
.fig figcaption {
  margin-top: 0.55rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* у fig--natural / fig--strip / fig--icon ширина задана инлайном на figure
   (из атрибута width картинки) — так бокс резервируется до загрузки */
.fig--natural { max-width: 100%; }
.fig--tall { max-width: 470px; }
.fig--strip { max-width: 100%; margin: 0.9rem auto 1.2rem; }

/* маленькая пиктограмма без рамки, по центру */
.fig--icon { max-width: 100%; margin: 0.6rem auto 1.2rem; }
.fig--icon img {
  border: none;
  box-shadow: none;
  border-radius: 6px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}
.fig--icon .zoom { cursor: zoom-in; }

.inline-icon {
  display: inline-block;
  vertical-align: middle;
  width: 2em;
  margin: 0 0.25em;
  border-radius: 4px;
}

/* ---------- «кредо» — список баффов ---------- */
.creed {
  margin: 1.7rem 0 1.9rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(200, 170, 110, 0.05), transparent 30%),
    var(--panel);
  padding: 1.5rem 1.7rem;
  position: relative;
}
.creed::before, .creed::after {
  content: "✦";
  position: absolute;
  color: var(--gold-dim);
  font-size: 0.72rem;
}
.creed::before { top: 0.55rem; left: 0.8rem; }
.creed::after { bottom: 0.55rem; right: 0.8rem; }
.creed ul { list-style: none; }
.creed li {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--gold-bright);
  padding: 0.32rem 0 0.32rem 1.6rem;
  position: relative;
}
.creed li + li { border-top: 1px solid var(--line-soft); }
.creed li::before {
  content: "◆";
  position: absolute;
  left: 0.15rem;
  color: var(--red);
  font-size: 0.72em;
  top: 0.85em;
}

/* ---------- заметка-примечание ---------- */
.note {
  margin: 1.4rem 0 1.6rem;
  border-left: 2px solid var(--gold-dim);
  background: linear-gradient(90deg, rgba(200, 170, 110, 0.07), transparent 80%);
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
}
.note p { margin: 0; }

/* ---------- триптих баннеров ---------- */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.7rem 0 1.9rem;
}
.banner-card {
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold-dim);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 60%);
  padding: 1.1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.banner-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dim);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.banner-card img {
  width: 100%;
  max-width: 240px;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.banner-card .bc-text { font-size: 0.98rem; line-height: 1.55; }
.banner-card .bc-text b { color: var(--gold-bright); }

/* ---------- мап-моды ---------- */
.modlist { list-style: none; margin: 1.4rem 0 1.8rem; }
.modlist li {
  position: relative;
  padding: 0.85rem 0.2rem 0.85rem 1.7rem;
  border-top: 1px solid var(--line-soft);
}
.modlist li:last-child { border-bottom: 1px solid var(--line-soft); }
.modlist li::before {
  content: "◆";
  position: absolute;
  left: 0.2rem;
  top: 1.05rem;
  font-size: 0.7em;
  color: var(--gold-dim);
}

/* цитата игрового мода */
.mod-quote {
  margin: 1.4rem auto 1.6rem;
  width: fit-content;
  max-width: 100%;
  text-align: center;
  font-family: var(--sans);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--mod-blue);
  border: 1px solid rgba(156, 156, 240, 0.22);
  border-radius: 4px;
  background: rgba(20, 18, 34, 0.35);
  padding: 1rem 1.6rem;
}

/* ---------- уники ---------- */
.uniques { margin: 1.5rem 0 1.8rem; display: flex; flex-direction: column; }
.unique-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.3rem;
  align-items: center;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-soft);
}
.unique-row:last-child { border-bottom: 1px solid var(--line-soft); }
.unique-row .u-art { display: flex; align-items: center; justify-content: center; }
.unique-row .u-art img {
  max-height: 110px;
  max-width: 96px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
  cursor: zoom-in;
  border: none;
}
.unique-row .u-text { font-size: 1.02rem; }
.unique-row .u-text p { margin: 0; }

/* ---------- фласки ---------- */
.flasks { list-style: none; margin: 1.2rem 0 1.6rem; }
.flasks li {
  padding: 0.7rem 0.2rem 0.7rem 1.7rem;
  border-top: 1px solid var(--line-soft);
  position: relative;
}
.flasks li:last-child { border-bottom: 1px solid var(--line-soft); }
.flasks li::before {
  content: "❖";
  position: absolute;
  left: 0.1rem;
  top: 0.85rem;
  font-size: 0.75em;
  color: var(--gold-dim);
}

/* ---------- крафтовый блок ---------- */
.craft {
  margin: 1.4rem 0 1.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 1.1rem 1.3rem;
}
.craft .craft-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.55rem;
}
.craft p { margin: 0; font-size: 1.01rem; }

/* ---------- шаги (ol) ---------- */
.steps {
  margin: 0.4rem 0 1.15rem;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.35rem 0 0.35rem 2.4rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  font-family: var(--caps);
  font-size: 0.9rem;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: var(--panel);
}

/* ---------- атлас ---------- */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 0.6rem;
}
.atlas-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 1.05rem 1.15rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.atlas-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.atlas-card .a-num {
  font-family: var(--caps);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--red);
}
.atlas-card .a-url {
  display: block;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--gold-bright);
  margin-top: 0.3rem;
  word-break: break-all;
}
.atlas-card .a-hint {
  display: block;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-top: 0.4rem;
}

/* ---------- ресурс-карточка (пустые разделы дока) ---------- */
.resource {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 1.2rem 1.4rem;
  margin-top: 1.2rem;
}
.resource .r-quote {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.resource .r-quote .r-src {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.5rem;
}

/* ---------- ЧАВО ---------- */
.faq { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.faq-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 1.25rem 1.4rem;
}
.faq-card .q {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.28rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.faq-card .q::before { content: "✠"; color: var(--red); font-size: 0.85em; }
.faq-card p { margin: 0 0 0.8rem; }
.faq-card p:last-child { margin-bottom: 0; }

.pantheon { list-style: none; margin: 0.4rem 0 0; }
.pantheon li {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--gold-bright);
  padding: 0.42rem 0 0.42rem 1.5rem;
  position: relative;
}
.pantheon li + li { border-top: 1px solid var(--line-soft); }
.pantheon li::before {
  content: "☩";
  position: absolute;
  left: 0;
  color: var(--gold-dim);
  font-size: 0.85em;
  top: 0.62em;
}

/* ---------- код трейд-макроса ---------- */
.code-scroll { margin-top: 0.6rem; }
.code-scroll pre {
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0e0b07;
  padding: 1rem 1.1rem;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #b6a888;
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.copy-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.copy-btn {
  font-family: var(--sans);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #14100a;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none;
  border-radius: 3px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.copy-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.copy-btn.ok { background: linear-gradient(180deg, #9fc98f, #6f9e60); }
.copy-hint { font-size: 0.95rem; color: var(--muted); font-style: italic; }

/* ---------- футер ---------- */
.footer {
  margin-top: 4.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ---------- memento mori: счетчик смерти сайта ---------- */
.doom {
  position: relative;
  max-width: 480px;
  margin: 0.4rem auto 2.6rem;
  padding: 1.5rem 1.6rem 1.35rem;
  border: 1px solid var(--red-deep);
  border-radius: 5px;
  background:
    radial-gradient(120% 130% at 50% -20%, rgba(87, 21, 18, 0.28), transparent 60%),
    var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(200, 170, 110, 0.12),
    inset 0 0 40px rgba(87, 21, 18, 0.18),
    0 14px 40px rgba(0, 0, 0, 0.5);
  animation: doom-glow 4.5s ease-in-out infinite;
}
@keyframes doom-glow {
  0%, 100% { border-color: var(--red-deep); }
  50% { border-color: rgba(169, 46, 38, 0.75); }
}
.doom::before, .doom::after {
  content: "✝";
  position: absolute;
  top: 0.55rem;
  color: var(--red);
  opacity: 0.75;
  font-size: 0.85rem;
}
.doom::before { left: 0.85rem; }
.doom::after { right: 0.85rem; }

.doom-head {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.doom-grid {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0.9rem 0 0.75rem;
}
.doom-cell { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; }
.doom-cell b {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 2.35rem;
  line-height: 1;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(200, 170, 110, 0.3);
}
.doom-cell i {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.45rem;
}
.doom-sep {
  font-family: var(--caps);
  font-size: 1.7rem;
  color: var(--red);
  opacity: 0.8;
  transform: translateY(-0.35rem);
}

.doom-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: #c98d7e;
}

.doom.dead .doom-grid { display: none; }
.doom.dead .doom-head { color: var(--red); }
.doom-rip {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--gold);
  margin: 0.8rem 0 0.6rem;
}

@media (max-width: 520px) {
  .doom { padding: 1.3rem 0.9rem 1.15rem; }
  .doom-cell { min-width: 2.9rem; }
  .doom-cell b { font-size: 1.85rem; }
  .doom-sep { font-size: 1.35rem; }
}
.footer .f-orn { color: var(--gold-dim); letter-spacing: 0.8em; padding-left: 0.8em; margin-bottom: 1.1rem; }
.footer .f-title {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gold);
}
.footer .f-by {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 0.4rem;
}
.footer .f-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

/* ---------- наверх ---------- */
.to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 70;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  font-family: var(--caps);
  font-size: 1.1rem;
  color: var(--gold);
  background: rgba(20, 16, 9, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------- лайтбокс ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.9rem;
  padding: 3vh 3vw;
  background: rgba(6, 5, 4, 0.93);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}
.lightbox .lb-cap {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  max-width: 80ch;
}
.lightbox .lb-close {
  position: absolute;
  top: 1rem;
  right: 1.3rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.lightbox .lb-close:hover { color: var(--gold-bright); }

/* ---------- скроллбар ---------- */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #241d12; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .rail {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: var(--bg);
    border-right: none;
    padding: 4.2rem 1.6rem 2rem;
    overflow-y: auto;
    display: none;
  }
  body.toc-open .topbar { visibility: hidden; }
  .rail-close {
    position: fixed;
    top: 0.85rem;
    right: 1.1rem;
  }
  body.toc-open { overflow: hidden; }
  body.toc-open .rail { display: block; }
  .rail-inner { position: static; max-height: none; }
  .rail-close {
    display: block;
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
  }
  .main { padding: 0 1.4rem 3rem; }
  .hero { grid-template-columns: 1fr; gap: 2.2rem; padding-top: 2.6rem; }
  .hero-icon { order: -1; }
  .hero-icon img { max-width: 260px; }
  .triptych { grid-template-columns: 1fr; }
  .atlas-grid { grid-template-columns: 1fr; }
  .unique-row { grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; }
}
@media (min-width: 1081px) { .rail-close { display: none; } }

@media (max-width: 520px) {
  body { font-size: 1.02rem; }
  .creed li { font-size: 1.08rem; }
  .hero-title { font-size: 2.5rem; }
}
