/* ═══════════════════════════════════════════════════════════════
   SELENIA · seleniacard.ru
   Книга арканов — не лендинг. Никаких SaaS-паттернов.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0612;
  --bg-soft: #14091f;
  --bg-paper: #100819;
  --ink: #f0e6d2;
  --ink-soft: #b8a98a;
  --ink-dim: #6e6353;
  --ink-faint: #443a2a;
  --gold: #d4af37;
  --gold-soft: #b8941f;
  --gold-glow: #f4d77a;
  --line: rgba(212, 175, 55, 0.22);
  --line-soft: rgba(212, 175, 55, 0.08);

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --serif-uni: 'Cormorant Unicase', 'Cormorant Garamond', serif;
  --serif-sc: 'Cormorant SC', 'Cormorant Garamond', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --max-text: 640px;
  --max-page: 1100px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --indent: 1.5em;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body { min-height: 100vh; position: relative; }
::selection { background: var(--gold); color: var(--bg); }
a { color: inherit; text-decoration: none; }
strong { font-weight: 500; color: var(--ink); }
em { font-style: italic; }

/* ═════════ ФОНОВЫЕ СЛОИ — старая бумага под пергаментом ═════════ */

/* Глубокая виньетка по углам — будто страница тёмной книги */
.bg-paper {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%),
    radial-gradient(ellipse at top left, rgba(20, 9, 31, 0.6), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(20, 9, 31, 0.5), transparent 50%);
}

.bg-grain {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='240' height='240' filter='url(%23n)' opacity='0.7'/></svg>");
}

.bg-stars {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  overflow: hidden;
}
.bg-stars span {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold-glow);
  border-radius: 50%;
  opacity: 0.4;
  animation: twinkle 4s infinite alternate;
}
.bg-stars span:nth-child(1)  { top: 5%;  left: 8%;  animation-delay: 0s; }
.bg-stars span:nth-child(2)  { top: 12%; left: 78%; animation-delay: .8s; width: 3px; height: 3px; }
.bg-stars span:nth-child(3)  { top: 18%; left: 45%; animation-delay: 1.5s; }
.bg-stars span:nth-child(4)  { top: 25%; left: 6%;  animation-delay: 2.2s; }
.bg-stars span:nth-child(5)  { top: 32%; left: 92%; animation-delay: .3s; width: 1px; height: 1px; }
.bg-stars span:nth-child(6)  { top: 38%; left: 30%; animation-delay: 1.1s; }
.bg-stars span:nth-child(7)  { top: 44%; left: 65%; animation-delay: 1.9s; }
.bg-stars span:nth-child(8)  { top: 50%; left: 12%; animation-delay: 2.6s; width: 3px; height: 3px; }
.bg-stars span:nth-child(9)  { top: 56%; left: 88%; animation-delay: .5s; }
.bg-stars span:nth-child(10) { top: 62%; left: 50%; animation-delay: 1.3s; }
.bg-stars span:nth-child(11) { top: 68%; left: 3%;  animation-delay: 2s; }
.bg-stars span:nth-child(12) { top: 72%; left: 70%; animation-delay: .7s; width: 2px; height: 2px; }
.bg-stars span:nth-child(13) { top: 78%; left: 35%; animation-delay: 1.5s; }
.bg-stars span:nth-child(14) { top: 84%; left: 82%; animation-delay: 2.3s; }
.bg-stars span:nth-child(15) { top: 90%; left: 15%; animation-delay: .4s; }
.bg-stars span:nth-child(16) { top: 8%;  left: 55%; animation-delay: 1.2s; }
.bg-stars span:nth-child(17) { top: 15%; left: 22%; animation-delay: 2.5s; }
.bg-stars span:nth-child(18) { top: 28%; left: 62%; animation-delay: .9s; width: 1px; height: 1px; }
.bg-stars span:nth-child(19) { top: 40%; left: 48%; animation-delay: 1.7s; }
.bg-stars span:nth-child(20) { top: 52%; left: 5%;  animation-delay: 2.4s; }
.bg-stars span:nth-child(21) { top: 60%; left: 95%; animation-delay: .2s; width: 3px; height: 3px; }
.bg-stars span:nth-child(22) { top: 76%; left: 42%; animation-delay: 1s; }
.bg-stars span:nth-child(23) { top: 86%; left: 60%; animation-delay: 1.8s; }
.bg-stars span:nth-child(24) { top: 20%; left: 88%; animation-delay: 2.7s; }
.bg-stars span:nth-child(25) { top: 92%; left: 50%; animation-delay: .6s; }

@keyframes twinkle {
  0% { opacity: 0.15; transform: scale(0.7); }
  100% { opacity: 0.85; transform: scale(1.3); }
}

.bg-moon {
  position: fixed;
  top: -25%; right: -15%;
  width: 70vmax; height: 70vmax;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(212, 175, 55, 0.07) 0%,
    rgba(212, 175, 55, 0.03) 30%,
    transparent 60%
  );
  filter: blur(50px);
  animation: moon-drift 80s ease-in-out infinite alternate;
}
@keyframes moon-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10vmax, 8vmax) scale(1.15); }
}

/* ═════════ КАСТОМНЫЙ КУРСОР ═════════ */

.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--gold-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: width 0.3s var(--ease), height 0.3s var(--ease);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px var(--gold), 0 0 32px rgba(212, 175, 55, 0.4);
}
.cursor.cursor--hover {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--gold);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.3);
}
@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ═════════ МАЛЕНЬКАЯ МАРКА ВМЕСТО ХЕДЕРА ═════════ */

.mark {
  position: fixed;
  top: 28px; right: 32px;
  z-index: 50;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif-sc);
  font-size: 14px;
  letter-spacing: 0.32em;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.3s;
}
.mark:hover { opacity: 1; }

@media (max-width: 720px) {
  .mark { top: 20px; right: 20px; font-size: 12px; }
}

/* ═════════ ВЕРТИКАЛЬНЫЙ ИНДЕКС (оглавление слева) ═════════ */

.index {
  position: fixed;
  left: 32px; top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex; flex-direction: column;
  gap: 18px;
  padding: 28px 18px;
  border-left: 1px solid var(--line);
}
.index__item {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 16px;
  margin-left: -19px;
  border-left: 2px solid transparent;
  transition: all 0.4s var(--ease);
  opacity: 0.6;
}
.index__item:hover { opacity: 1; }
.index__item.active {
  opacity: 1;
  border-left-color: var(--gold);
}
.index__num {
  font-family: var(--serif-sc);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.index__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.index__item.active .index__title { color: var(--ink); }

@media (max-width: 980px) {
  .index {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    padding: 12px 16px;
    border-left: none;
    border-top: 1px solid var(--line);
    background: rgba(10, 6, 18, 0.92);
    backdrop-filter: blur(16px);
  }
  .index__item {
    flex-direction: row; align-items: center; gap: 6px;
    border-left: none; border-bottom: 2px solid transparent;
    padding: 4px 2px; margin: 0;
  }
  .index__item.active { border-bottom-color: var(--gold); border-left-color: transparent; }
  .index__title { display: none; }
  .index__num { font-size: 11px; letter-spacing: 0.18em; }
}

/* ═════════ КНИГА И СТРАНИЦЫ ═════════ */

.book {
  position: relative;
  z-index: 2;
}

.page {
  position: relative;
  max-width: var(--max-page);
  margin: 0 auto;
  padding: clamp(100px, 14vw, 180px) clamp(24px, 6vw, 80px);
}

/* Номер страницы (фолио) */
.folio {
  font-family: var(--serif-sc);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0.75;
  margin-bottom: 64px;
  text-align: center;
}
.folio__roman {
  display: inline-block;
  margin-right: 8px;
  font-size: 13px;
  color: var(--gold-glow);
  letter-spacing: 0.3em;
}

/* ═════════ БУКВИЦА (DROP CAP) ═════════ */

.dropcap {
  font-family: var(--serif-uni);
  font-weight: 500;
  float: left;
  font-size: clamp(96px, 14vw, 180px);
  line-height: 0.85;
  margin-right: 16px;
  margin-top: 8px;
  margin-bottom: -8px;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}
.dropcap--small {
  font-size: clamp(64px, 10vw, 128px);
  margin-top: 4px;
  line-height: 0.85;
}

/* ═════════ ПРОЛОГ ═════════ */

.page--prolog {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(auto, 720px) 1fr;
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    ".      folio   ."
    ".      h1      margin"
    ".      body    margin"
    ".      card    .";
  gap: 32px 48px;
  align-content: center;
  padding-top: clamp(120px, 16vh, 200px);
  padding-bottom: clamp(80px, 10vh, 140px);
}
.page--prolog .folio { grid-area: folio; margin-bottom: 0; }

.prolog__h1 {
  grid-area: h1;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.prolog__h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.prolog__h1-rest { display: inline; }

.prolog__body {
  grid-area: body;
  font-family: var(--serif);
  font-size: clamp(20px, 1.75vw, 23px);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 56ch;
}
.prolog__body p { margin-bottom: 1.1em; }
.prolog__body p:first-child { text-indent: 0; }
.prolog__body p + p { text-indent: var(--indent); }
.prolog__lead {
  font-style: italic;
  font-size: clamp(23px, 2.1vw, 28px) !important;
  color: var(--ink) !important;
  margin-bottom: 1.4em !important;
}
.prolog__lead em { color: var(--gold); }

/* HERO CARD */
.prolog__card {
  grid-area: card;
  justify-self: center;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-card {
  width: clamp(220px, 26vw, 300px);
  aspect-ratio: 5/8;
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  filter: drop-shadow(0 30px 60px rgba(212,175,55,0.18)) drop-shadow(0 0 80px rgba(212,175,55,0.12));
  animation: card-breath 6s ease-in-out infinite;
}
.hero-card__back, .hero-card__front {
  position: absolute; inset: 0;
  border-radius: 8px;
  overflow: hidden;
}
.hero-card__back {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  z-index: 1;
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease);
}
.hero-card__back svg { width: 100%; height: 100%; }
.hero-card__front {
  z-index: 2;
  background: var(--bg-soft);
  border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.7s var(--ease) 0.1s, transform 0.9s var(--ease);
  pointer-events: none;
}
.hero-card__front img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.hero-card.flipped .hero-card__front { opacity: 1; transform: scale(1); }
.hero-card.flipped .hero-card__back { opacity: 0; transform: scale(1.04); }
.hero-card.flipped { animation: none; box-shadow: 0 0 100px rgba(212,175,55,0.28); }
@keyframes card-breath {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

.prolog__card-cap {
  margin-top: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  transition: opacity 0.4s, color 0.4s;
}
.prolog__card-cap .caret { color: var(--gold); margin-right: 4px; }
.hero-card.flipped + .prolog__card-cap { color: var(--gold-glow); }

/* МАРГИНАЛИЯ (заметка на полях) */
.margin {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 180px;
  padding-left: 16px;
  border-left: 1px solid var(--line-soft);
}
.margin--prolog { grid-area: margin; align-self: end; margin-bottom: 32px; }
.margin--chap1, .margin--chap3 {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  top: 30%;
  width: 160px;
}

@media (max-width: 1100px) {
  .page--prolog {
    grid-template-columns: 1fr;
    grid-template-areas:
      "folio"
      "h1"
      "body"
      "card"
      "margin";
    text-align: left;
    padding-left: clamp(20px, 5vw, 60px);
    padding-right: clamp(20px, 5vw, 60px);
  }
  .page--prolog .folio { text-align: center; }
  .margin--prolog { max-width: 100%; margin-top: 24px; }
  .margin--chap1, .margin--chap3 {
    position: static;
    width: auto;
    max-width: 100%;
    margin-top: 32px;
  }
}

/* ═════════ ВИНЬЕТКИ-РАЗДЕЛИТЕЛИ ═════════ */

.vignette {
  display: flex; justify-content: center;
  padding: 32px 24px;
  color: var(--gold);
  max-width: 600px;
  margin: 0 auto;
}
.vignette svg { width: 100%; max-width: 400px; height: auto; }

/* ═════════ ОБЩИЕ СТИЛИ ГЛАВ ═════════ */

.chap__h {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 56px;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
}
.chap__h em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.chap__h-rest { display: inline; }

/* ═════════ ГЛАВА I — две колонки текста ═════════ */

.chap1__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  max-width: 980px;
  margin: 0 auto;
}
.chap1__col p {
  font-family: var(--serif);
  font-size: clamp(20px, 1.7vw, 23px);
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 1.1em;
}
.chap1__col p + p { text-indent: var(--indent); }
.chap1__col em { color: var(--ink); }

.chap1__col--right .emph {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(25px, 2.5vw, 34px) !important;
  line-height: 1.4;
  color: var(--gold) !important;
  margin-bottom: 1.4em !important;
  text-indent: 0 !important;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.chap1__col--right .emph em { color: var(--gold-glow); }

.signature {
  font-style: italic;
  color: var(--ink-dim);
  font-size: 14px !important;
  margin-top: 1.5em;
  text-indent: 0 !important;
}

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

/* ═════════ ГЛАВА II — арканы ═════════ */

.chap2__intro {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 auto 64px;
  text-align: center;
}
.chap2__intro em { color: var(--gold); }

.arcana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 26px 22px;
  padding: 20px 8px;
  perspective: 1400px;
}

.card-tile {
  position: relative;
  aspect-ratio: 5/8;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  transition: transform 0.6s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s var(--ease);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(212,175,55,0.04);
  will-change: transform;
  transform-origin: center 100%;
}
/* Шахматный лёгкий tilt — расклад, а не таблица */
.card-tile:nth-child(6n+1) { transform: rotate(-2.2deg) translateY(0); }
.card-tile:nth-child(6n+2) { transform: rotate(1.4deg) translateY(8px); }
.card-tile:nth-child(6n+3) { transform: rotate(-0.8deg) translateY(-4px); }
.card-tile:nth-child(6n+4) { transform: rotate(2.0deg) translateY(6px); }
.card-tile:nth-child(6n+5) { transform: rotate(-1.6deg) translateY(-2px); }
.card-tile:nth-child(6n)   { transform: rotate(1.0deg) translateY(4px); }

.card-tile:hover {
  border-color: var(--gold);
  transform: rotate(0deg) translateY(-14px) scale(1.06) !important;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.6),
    0 0 0 1px var(--gold),
    0 0 50px rgba(212,175,55,0.35);
  z-index: 10;
}
.card-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.78) saturate(0.92);
  transition: filter 0.5s var(--ease);
}
.card-tile:hover img { filter: brightness(1.05) saturate(1.15); }

.card-tile__num {
  position: absolute;
  top: 8px; left: 10px;
  font-family: var(--serif-sc);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  opacity: 0.85;
  background: rgba(10, 6, 18, 0.55);
  padding: 3px 7px;
  border-radius: 2px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212,175,55,0.2);
}
.card-tile__name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 12px 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s var(--ease);
  text-shadow: 0 1px 6px rgba(0,0,0,0.95);
  background: linear-gradient(to top, rgba(10,6,18,0.85) 30%, transparent);
  text-align: center;
}
.card-tile:hover .card-tile__name { opacity: 1; transform: translateY(0); }
.card-tile__placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  opacity: 0.45;
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg) 100%);
  text-align: center; padding: 8px;
}

/* ═════════ ГЛАВА III — ритуал ═════════ */

.ritual {
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.ritual::before {
  content: '';
  position: absolute;
  left: 22px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, var(--line) 10%, var(--line) 90%, transparent 100%);
}
.ritual__step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  padding: 28px 0;
  position: relative;
}
.ritual__step + .ritual__step {
  border-top: 1px solid var(--line-soft);
}
.ritual__num {
  font-family: var(--serif-sc);
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold);
  background: var(--bg);
  position: relative;
  z-index: 2;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 4px;
}
.ritual__step h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(25px, 2.6vw, 33px);
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.25;
}
.ritual__step h3 em { color: var(--gold); font-style: normal; }
.ritual__step p {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.ritual__step p em { color: var(--ink); }

/* ═════════ ЭПИЛОГ ═════════ */

.page--epilog {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(80px, 12vh, 140px);
  padding-bottom: clamp(60px, 8vh, 100px);
}
.page--epilog .folio { margin-bottom: 40px; }

.epilog__seal {
  width: 120px; height: 120px;
  margin-bottom: 48px;
  filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.2));
  animation: seal-glow 6s ease-in-out infinite alternate;
}
@keyframes seal-glow {
  from { filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.15)); }
  to { filter: drop-shadow(0 0 32px rgba(212, 175, 55, 0.35)); }
}

.epilog__h {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 32px;
}
.epilog__h em {
  font-style: italic;
  color: var(--gold);
}

.epilog__lead {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 24px);
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 48px;
  max-width: 480px;
}

.epilog__cta {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif-sc);
  font-size: 13px;
  letter-spacing: 0.28em;
  padding: 18px 38px;
  color: var(--bg);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  transition: all 0.4s var(--ease);
  text-transform: uppercase;
}
.epilog__cta:hover {
  background: var(--gold-glow);
  border-color: var(--gold-glow);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(212, 175, 55, 0.3);
}

.epilog__foot {
  margin-top: 36px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-dim);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.epilog__foot a { color: var(--gold); transition: color 0.3s; }
.epilog__foot a:hover { color: var(--gold-glow); }
.epilog__sep { color: var(--ink-faint); }

.epilog__colophon {
  margin-top: clamp(80px, 12vh, 140px);
  max-width: 540px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-faint);
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
}
.epilog__colophon em { color: var(--ink-dim); font-style: normal; letter-spacing: 0.05em; }
.logo-sc {
  font-family: var(--serif-sc);
  font-style: normal;
  letter-spacing: 0.4em;
  color: var(--gold);
}

/* ═════════ МОДАЛКА КАРТЫ — как страница из книги ═════════ */

.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal[aria-hidden="false"] { display: flex; animation: modal-in 0.4s var(--ease); }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 3, 10, 0.94);
  backdrop-filter: blur(10px);
}
.modal__sheet {
  position: relative;
  max-width: 640px; width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 56px 56px 44px;
  text-align: center;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(212, 175, 55, 0.12),
    inset 0 0 100px rgba(20, 9, 31, 0.6);
  animation: sheet-in 0.5s var(--ease);
}
@keyframes sheet-in {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal__close {
  position: absolute; top: 14px; right: 20px;
  background: transparent; border: none;
  color: var(--ink-soft);
  font-size: 38px;
  font-family: var(--serif);
  font-weight: 300;
  cursor: pointer;
  width: 44px; height: 44px;
  line-height: 1;
  transition: color 0.3s;
  z-index: 2;
}
.modal__close:hover { color: var(--gold); }

.modal__folio {
  font-family: var(--serif-sc);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 28px;
}
.modal__img {
  width: clamp(260px, 38vw, 340px);
  aspect-ratio: 5/8;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gold);
  margin-bottom: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 40px rgba(212,175,55,0.15);
}
.modal__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 48px);
  color: var(--gold);
  margin-bottom: 20px;
  line-height: 1.1;
}
.modal__desc {
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto; margin-right: auto;
}
.modal__cta {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
  padding: 12px 0;
  border-bottom: 1px solid var(--gold);
  transition: all 0.3s var(--ease);
}
.modal__cta:hover { color: var(--gold-glow); border-color: var(--gold-glow); letter-spacing: 0.02em; }
.modal__cta em { font-style: normal; color: var(--ink); }

/* ═════════ ОТСТУПЫ ОТ ИНДЕКСА ═════════ */

@media (min-width: 981px) {
  .book {
    padding-left: 60px; /* отступ от sticky index слева */
  }
}
@media (max-width: 980px) {
  .book {
    padding-bottom: 80px; /* отступ от bottom index */
  }
}

/* ═════════ REVEAL ON SCROLL ═════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ═════════ reduce-motion ═════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═════════ LEGAL FOOTER (18+, политика — для модерации Директа) ═════════ */
.legal {
  border-top: 1px solid var(--line-soft);
  padding: 28px 24px 36px;
  background: rgba(8, 5, 16, 0.85);
}
.legal__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-family: var(--serif-sc, var(--serif));
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(212, 175, 55, 0.55);
  text-align: center;
}
.legal__age {
  border: 1px solid rgba(212,175,55,0.4);
  padding: 3px 9px;
  border-radius: 2px;
  color: var(--gold);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.legal__note {
  font-style: italic;
  color: rgba(232, 226, 213, 0.5);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}
.legal__sep { color: rgba(212,175,55,0.3); }
.legal__link {
  color: rgba(212,175,55,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  transition: color 0.3s var(--ease);
}
.legal__link:hover { color: var(--gold); }
@media (max-width: 600px) {
  .legal__inner { font-size: 11px; gap: 8px; }
  .legal__sep { display: none; }
}
