/* Human Remains — читальный зал. Одна тёмная тема: мир комикса. */
/* layout: сцена 1600×900 масштабируется как cover; интерфейс поверх; на телефоне сцена становится шапкой вертикальной ленты */

:root {
  --void: #060503;
  --room: #0e0b08;
  --surface: #15100b;
  --wood: #241a10;
  --paper: #dcd5cb;
  --paper-dim: #8c8378;
  --line: rgba(220, 213, 203, 0.14);
  --ember: #e8893a;
  --flame: #fbc779;
  --luka: #ffb00f;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --bubble: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: dark;
}

/*FONTFACE-START*/
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-cyrillic-400-italic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cormorant-garamond-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/*FONTFACE-END*/

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-variant-numeric: lining-nums;
  background: var(--void);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--flame); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }

/* ══════════════ ПРОЛОГ ══════════════ */
.prologue {
  position: fixed; inset: 0; z-index: 50;
  background: #000;
  display: grid; place-items: center;
  overflow: hidden;
}
.prologue.is-opening { background: transparent; }
.prologue.is-gone { display: none; }
.crack-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel { fill: #050403; transform-box: view-box; transition: transform 1.7s var(--ease-in-out); }
.prologue.is-opening #panel-left { transform: translateX(-102%); }
.prologue.is-opening #panel-right { transform: translateX(102%); }
.crack-line { fill: none; stroke: #efe4cf; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.crack-glow { fill: none; stroke: #ffb55a; stroke-width: 8; vector-effect: non-scaling-stroke; opacity: 0.85; stroke-linejoin: round; stroke-linecap: round; transition: opacity 1.2s var(--ease-out); }
.prologue.is-opening .crack-glow, .prologue.is-opening .crack-line { opacity: 0; }
.prologue-text {
  position: relative; z-index: 2; text-align: center; padding: 0 24px;
  transition: opacity 0.6s var(--ease-out);
}
.prologue.is-opening .prologue-text { opacity: 0; }
.prologue-title {
  margin: 0; font-weight: 400; font-size: clamp(28px, 5vw, 52px);
  letter-spacing: 0.38em; text-transform: uppercase; color: #e9e1d2;
  padding-left: 0.38em;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  text-shadow: 0 0 24px rgba(255, 181, 90, 0.25);
}
.prologue-sub {
  margin: 10px 0 0; font-size: 18px; letter-spacing: 0.06em; color: var(--paper-dim);
  opacity: 0; transition: opacity 0.8s var(--ease-out) 0.2s;
}
.prologue.p2 .prologue-title { opacity: 1; transform: none; }
.prologue.p2 .prologue-sub { opacity: 1; }
.gate { margin-top: 40px; background: #050403; padding: 14px 28px 22px; display: inline-block; opacity: 0; transform: translateY(6px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.prologue.p3 .gate { opacity: 1; transform: none; }
.gate-note { margin: 0 0 14px; color: var(--paper-dim); font-size: 16px; }
.gate-btn {
  background: none; border: 1px solid rgba(220, 213, 203, 0.4); color: var(--paper);
  padding: 12px 30px; font-size: 18px; letter-spacing: 0.04em;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), background-color 0.2s var(--ease-out), transform 0.12s var(--ease-out);
}
.gate-btn:hover { border-color: var(--flame); color: var(--flame); }
.gate-btn:active { transform: scale(0.98); }
.skip {
  position: absolute; right: 22px; bottom: 20px; z-index: 3;
  background: none; border: 0; color: var(--paper-dim); font-size: 15px; letter-spacing: 0.04em;
  opacity: 0; transition: opacity 0.4s var(--ease-out), color 0.2s;
}
.prologue.p2 .skip { opacity: 1; }
.skip:hover { color: var(--paper); }
.prologue.is-opening .skip { opacity: 0; }

/* ══════════════ ИНТЕРФЕЙС ══════════════ */
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 26px 0;
  pointer-events: none;
  opacity: 0; transition: opacity 0.9s var(--ease-out);
}
body.is-open .chrome { opacity: 1; }
.chrome > * { pointer-events: auto; }
.brand {
  font-size: 17px; letter-spacing: 0.3em; text-transform: uppercase; color: #cfc6b6; padding-left: 0.3em;
}
.brand:hover { text-decoration: none; color: var(--flame); }
.menu { display: flex; gap: 22px; align-items: baseline; }
.menu button {
  background: none; border: 0; padding: 6px 2px; color: var(--paper-dim); font-size: 17px; letter-spacing: 0.03em;
  transition: color 0.2s var(--ease-out);
}
.menu button:hover, .menu button.is-active { color: var(--paper); }
.menu .sound { color: var(--paper-dim); font-style: italic; }
.menu .sound[aria-pressed="true"] { color: var(--flame); }

.age-mark {
  position: fixed; left: 26px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  font-size: 14px; letter-spacing: 0.1em; color: var(--paper-dim); opacity: 0; transition: opacity 0.9s var(--ease-out);
}
body.is-open .age-mark { opacity: 0.8; }

/* ══════════════ СЦЕНА ══════════════ */
.room { position: fixed; inset: 0; z-index: 1; }
.stage-wrap { position: absolute; inset: 0; overflow: hidden; background: var(--void); }
.stage {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px;
  transform-origin: 0 0;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--s, 1));
  will-change: transform;
}
.stage.is-zooming { transition: transform 2.6s var(--ease-out); }
.scene { position: absolute; inset: 0; z-index: 0; display: block; }
.fire { position: absolute; left: 700px; top: 470px; width: 200px; height: 272px; z-index: 1; pointer-events: none; }
.glow { position: absolute; pointer-events: none; z-index: 2; mix-blend-mode: screen; }
.glow-fire {
  left: 200px; top: 120px; width: 1200px; height: 1000px;
  background: radial-gradient(ellipse at center, rgba(255, 150, 60, 0.52) 0%, rgba(255, 120, 40, 0.2) 32%, rgba(255, 90, 30, 0.06) 52%, transparent 68%);
}
.glow-lamp {
  left: 1200px; top: 340px; width: 520px; height: 440px;
  background: radial-gradient(ellipse at center, rgba(255, 205, 120, 0.4) 0%, rgba(255, 180, 90, 0.12) 40%, transparent 68%);
}
.rain line { stroke: #c9d3df; stroke-opacity: 0.22; stroke-width: 1; }
.rain { animation: rain 1.1s linear infinite; }
@keyframes rain { from { transform: translateY(-60px); } to { transform: translateY(0); } }

.wall-logo {
  position: absolute; left: 632px; top: 176px; width: 336px; height: 156px; z-index: 3;
  display: grid; place-items: center; pointer-events: none; white-space: nowrap;
  font-size: 23px; letter-spacing: 0.3em; text-transform: uppercase; color: #cfc6b6; padding-left: 0.3em;
  text-shadow: 0 1px 0 #000, 0 0 14px rgba(0, 0, 0, 0.8);
}
.wall-crack { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.wall-crack path { fill: none; stroke: #e6dccb; stroke-width: 1; stroke-opacity: 0.55; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wall-logo span { position: relative; }

/* полка с главами */
.shelf { position: absolute; left: 90px; top: 368px; width: 410px; height: 120px; z-index: 4; }
.spine {
  position: absolute; bottom: 0; width: 32px; height: 112px;
  border: 0; padding: 0; border-radius: 2px 2px 1px 1px;
  background: linear-gradient(90deg, #1b120b, var(--spine, #4a2f22) 30%, var(--spine, #4a2f22) 70%, #15100a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 2px 0 0 rgba(255, 255, 255, 0.06), 1px 0 2px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  color: #e8dfcd; transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
.spine .num {
  margin-top: 10px; font-weight: 600; font-size: 15px; line-height: 1;
  width: 22px; padding: 4px 0 3px; text-align: center; background: #e6dccb; color: #1b120b; border-radius: 1px;
}
.spine .word {
  margin-top: 10px; writing-mode: vertical-rl; text-orientation: mixed; font-size: 11px; letter-spacing: 0.14em;
  color: rgba(232, 223, 205, 0.75); text-transform: uppercase;
}
.spine.is-new { transform: translateY(-9px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 18px rgba(251, 199, 121, 0.35), 1px 0 2px rgba(0, 0, 0, 0.5); }
.spine.is-tg { opacity: 0.85; }
.spine-soon {
  position: absolute; bottom: 0; width: 26px; height: 100px; border: 1px dashed rgba(220, 213, 203, 0.22); border-bottom: 0; border-radius: 2px 2px 0 0;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
  color: rgba(220, 213, 203, 0.4); font-size: 11px; letter-spacing: 0.12em; writing-mode: vertical-rl; text-transform: uppercase;
}
.cap {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  white-space: nowrap; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--flame);
  text-shadow: 0 1px 2px #000; opacity: 0; pointer-events: none;
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.spine .cap { bottom: calc(100% + 14px); }
.spine:hover .cap, .spine:focus-visible .cap, .obj:hover .cap, .obj:focus-visible .cap, .hot:hover .cap, .hot:focus-visible .cap { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (hover: hover) and (pointer: fine) {
  .spine:hover { transform: translateY(-7px); }
  .spine.is-new:hover { transform: translateY(-14px); }
  .obj:hover { transform: translateY(-5px); filter: drop-shadow(0 0 10px rgba(251, 199, 121, 0.55)); }
  .hot:hover { box-shadow: inset 0 0 0 1px rgba(251, 199, 121, 0.55), 0 0 18px rgba(251, 199, 121, 0.25); }
}

/* каминная полка */
.mantel { position: absolute; left: 616px; top: 326px; width: 368px; height: 46px; z-index: 4; }
.obj {
  position: absolute; bottom: 0; background: none; border: 0; padding: 0; display: block;
  transition: transform 0.18s var(--ease-out), filter 0.18s var(--ease-out);
}
.obj svg { display: block; height: 100%; width: auto; }
.obj-lighter { left: 50px; height: 42px; }
.obj-talisman { left: 128px; height: 48px; }
.obj-pistol { left: 198px; height: 44px; }
.obj-box { left: 300px; height: 36px; }

/* предметы на столе и рамы */
.hot { position: absolute; z-index: 4; background: none; border: 0; padding: 0; border-radius: 2px; transition: box-shadow 0.18s var(--ease-out); }
.hot-notebook { left: 1176px; top: 566px; width: 132px; height: 36px; }
.hot-papers { left: 1326px; top: 558px; width: 96px; height: 44px; }
.hot-frame-1 { left: 1000px; top: 140px; width: 150px; height: 110px; }
.hot-frame-2 { left: 1000px; top: 275px; width: 150px; height: 100px; }
.hot-frame-3 { left: 1020px; top: 400px; width: 110px; height: 74px; }
.hint-continue {
  position: absolute; left: 1300px; top: 444px; width: 230px; z-index: 4; text-align: right;
  background: none; border: 0; padding: 4px 0; color: var(--flame); font-size: 15px; letter-spacing: 0.03em;
  text-shadow: 0 1px 2px #000;
}
.hint-continue:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ворон */
.raven {
  position: absolute; left: 0; top: 0; width: 138px; height: 115px; z-index: 5;
  background: none; border: 0; padding: 0; transform-origin: 69px 104px;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6));
}
.raven svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.raven-fly { display: none; }
.raven.is-flying .raven-sit { display: none; }
.raven.is-flying .raven-fly { display: block; }
.raven-head { transform-origin: 48px 36px; transition: transform 0.4s var(--ease-out); }
.wing-up { transform-origin: 60px 54px; animation: flap-up 0.26s ease-in-out infinite alternate; }
.wing-down { transform-origin: 62px 60px; animation: flap-down 0.26s ease-in-out infinite alternate; }
@keyframes flap-up { from { transform: scaleY(1); } to { transform: scaleY(0.35) translateY(8px); } }
@keyframes flap-down { from { transform: scaleY(0.35) translateY(-8px); } to { transform: scaleY(1); } }
@media (hover: hover) and (pointer: fine) { .raven:hover .raven-head { transform: rotate(9deg) translate(1px, 2px); } }
.raven-say {
  position: absolute; z-index: 6; width: max-content; max-width: 200px; padding: 9px 13px; border-radius: 16px;
  background: #f3efe8; color: #141210; font: 500 14px/1.3 var(--bubble); pointer-events: none;
  animation: say-in 0.22s var(--ease-out);
}
.raven-say::after {
  content: ''; position: absolute; left: -5px; top: 18px; width: 12px; height: 12px; background: #f3efe8;
  transform: rotate(45deg); border-radius: 2px;
}
.raven-say.is-left::after { left: auto; right: -5px; }
@keyframes say-in { from { opacity: 0; transform: scale(0.94); } }

.lightmap { position: absolute; inset: 0; width: 1600px; height: 900px; z-index: 8; pointer-events: none; }
.dust { position: absolute; inset: 0; width: 1600px; height: 900px; z-index: 9; pointer-events: none; }

body.has-card .stage { filter: blur(3px); }
body.has-card .stage, body.is-reading .stage { transition: filter 0.3s var(--ease-out); }

/* ══════════════ КАРТОЧКИ ══════════════ */
.card-layer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; }
.card-backdrop { position: absolute; inset: 0; background: rgba(4, 3, 2, 0.6); animation: fade-in 0.25s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
.card {
  position: relative; width: min(820px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  padding: 44px 48px 40px;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  animation: card-in 0.3s var(--ease-out);
}
@keyframes card-in { from { opacity: 0; transform: scale(0.95); } }
.card-close {
  position: absolute; top: 10px; right: 14px; width: 44px; height: 44px; background: none; border: 0;
  font-size: 30px; line-height: 1; color: var(--paper-dim); transition: color 0.2s;
}
.card-close:hover { color: var(--paper); }
.card h2 { margin: 0 0 0.35em; font-size: 36px; font-weight: 500; line-height: 1.1; letter-spacing: 0.01em; text-wrap: balance; }
.card h3 { margin: 1.2em 0 0.4em; font-size: 22px; font-weight: 500; }
.card p { margin: 0 0 1em; max-width: 62ch; }
.card .dim { color: var(--paper-dim); }
.card .btn {
  display: inline-block; background: none; border: 1px solid rgba(220, 213, 203, 0.35); color: var(--paper); padding: 10px 22px;
  font-size: 18px; letter-spacing: 0.03em; transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.12s;
}
.card .btn:hover { border-color: var(--flame); color: var(--flame); text-decoration: none; }
.card .btn:active { transform: scale(0.98); }
.card .btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.hero-card { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
.hero-card .portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border: 1px solid var(--line); filter: saturate(0.9); }
.hero-card .thing { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; color: var(--paper-dim); }
.hero-card .thing svg { height: 44px; width: auto; flex: none; }
.hero-card .others { display: flex; gap: 18px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.hero-card .others button { background: none; border: 0; padding: 0; color: var(--paper-dim); font-size: 18px; }
.hero-card .others button:hover { color: var(--flame); }

.chapter-list { display: grid; gap: 2px; margin-top: 14px; }
.chapter-row {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px;
  padding: 12px 14px; background: none; border: 0; text-align: left; width: 100%;
  border-top: 1px solid var(--line); color: var(--paper);
}
.chapter-row:last-child { border-bottom: 1px solid var(--line); }
.chapter-row .n { font-size: 28px; font-weight: 500; line-height: 1; color: var(--paper); font-variant-numeric: tabular-nums; }
.chapter-row .meta { color: var(--paper-dim); font-size: 17px; }
.chapter-row .act { color: var(--flame); font-size: 17px; white-space: nowrap; }
.chapter-row:hover { background: rgba(255, 255, 255, 0.03); }
.chapter-row .tag { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--flame); margin-left: 10px; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.heroes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.heroes-grid button { background: none; border: 1px solid var(--line); padding: 0 0 12px; color: var(--paper); display: grid; gap: 10px; font-size: 22px; transition: border-color 0.2s; }
.heroes-grid button:hover { border-color: var(--flame); }
.heroes-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.gallery-grid button { background: none; border: 1px solid var(--line); padding: 0; aspect-ratio: 4 / 3; overflow: hidden; transition: border-color 0.2s; }
.gallery-grid button:hover { border-color: var(--flame); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { display: grid; gap: 12px; }
.lightbox img { width: 100%; max-height: 62vh; object-fit: contain; background: #000; border: 1px solid var(--line); }
.lightbox .lb-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--paper-dim); }
.lightbox .lb-nav button { background: none; border: 0; color: var(--paper); font-size: 18px; padding: 6px 0; }
.lightbox .lb-nav button:hover { color: var(--flame); }

.news-list { margin: 10px 0 0; padding: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.news-list li:last-child { border-bottom: 1px solid var(--line); }
.news-list time { color: var(--paper-dim); font-variant-numeric: tabular-nums; }

.author-card .sign {
  display: inline-block; background: var(--luka); color: #111; font-weight: 600; letter-spacing: 0.2em; padding: 6px 14px 4px; font-size: 22px; margin: 0 0 18px;
}
.author-card .links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }

/* ══════════════ КНИГА ══════════════ */
.reader { position: fixed; inset: 0; z-index: 40; background: var(--void); }
.reader-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 20px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 22px 12px;
  background: linear-gradient(rgba(6, 5, 3, 0.9), rgba(6, 5, 3, 0));
  opacity: 0; transition: opacity 0.3s var(--ease-out); pointer-events: none;
}
.reader.show-ui .reader-bar { opacity: 1; pointer-events: auto; }
.reader-chapter { font-size: 18px; letter-spacing: 0.04em; }
.reader-pos { color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.reader-close { margin-left: auto; background: none; border: 1px solid rgba(220, 213, 203, 0.3); color: var(--paper); padding: 6px 14px; font-size: 16px; }
.reader-close:hover { border-color: var(--flame); color: var(--flame); }
.reader-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 54px 80px 26px;
}
.reader-stage .page { height: 100%; display: flex; align-items: center; justify-content: center; }
.reader-stage img { height: 100%; width: auto; max-width: 100%; object-fit: contain; background: #000; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7); }
.reader-stage.turn-next { animation: turn-next 0.32s var(--ease-out); }
.reader-stage.turn-prev { animation: turn-prev 0.32s var(--ease-out); }
@keyframes turn-next { from { opacity: 0; transform: translateX(14px); } }
@keyframes turn-prev { from { opacity: 0; transform: translateX(-14px); } }
.reader-end {
  display: grid; gap: 18px; text-align: center; padding: 40px; max-width: 420px;
}
.reader-end h2 { margin: 0; font-weight: 400; font-size: 34px; }
.reader-end .btn { display: inline-block; background: none; border: 1px solid rgba(220, 213, 203, 0.35); color: var(--paper); padding: 10px 22px; font-size: 18px; }
.reader-end .btn:hover { border-color: var(--flame); color: var(--flame); text-decoration: none; }
.reader-end .btn.primary { border-color: var(--flame); color: var(--flame); }
.reader-nav {
  position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; background: none; border: 0; color: var(--paper);
  font-size: 54px; opacity: 0; transition: opacity 0.25s var(--ease-out);
}
.reader-prev { left: 0; text-align: left; padding-left: 22px; }
.reader-next { right: 0; text-align: right; padding-right: 22px; }
@media (hover: hover) and (pointer: fine) { .reader-nav:hover { opacity: 0.8; } }
.reader-nav[disabled] { visibility: hidden; }
.reader-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.06); z-index: 3; }
.reader-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--flame)); transition: width 0.3s var(--ease-out); }

.reader.is-paged .reader-stage {
  display: flex; justify-content: flex-start; gap: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.reader.is-paged .reader-stage::-webkit-scrollbar { display: none; }
.reader.is-paged .rpage {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; overflow: auto; overscroll-behavior: contain;
}
.reader.is-paged .rpage img { width: 100%; height: auto; max-width: none; box-shadow: none; }
.reader.is-paged .rpage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.reader.is-paged .rpage.is-zoomed img { width: 200%; }
.reader.is-paged .reader-nav { display: none; }
.reader.is-paged .reader-stage .reader-end { height: 100%; align-content: center; }

/* ══════════════ МОБИЛЬНАЯ ЛЕНТА ══════════════ */
.mobile { display: none; }

@media (max-width: 820px) {
  body { overflow: auto; font-size: 18px; }
  .chrome .menu { display: none; }
  .chrome { padding-left: 20px; padding-right: 20px; }
  .age-mark { display: none; }
  .room { position: relative; height: 58vh; min-height: 340px; max-height: 560px; }
  .stage-wrap { position: absolute; }
  .shelf, .hot, .hint-continue, .dust { display: none; }
  .mobile { display: block; padding: 0 20px calc(40px + env(safe-area-inset-bottom, 0px)); position: relative; z-index: 2; background: var(--void); }
  .m-head { text-align: center; padding: 26px 0 12px; }
  .m-title { margin: 0; font-size: 26px; letter-spacing: 0.32em; text-transform: uppercase; color: #cfc6b6; padding-left: 0.32em; }
  .m-sub { margin: 6px 0 20px; color: var(--paper-dim); font-size: 16px; }
  .m-read {
    background: none; border: 1px solid var(--flame); color: var(--flame); padding: 12px 34px; font-size: 19px; letter-spacing: 0.04em;
    transition: transform 0.12s;
  }
  .m-read:active { transform: scale(0.98); }
  .m-h { font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-dim); font-weight: 500; margin: 34px 0 12px; }
  .m-shelf { display: grid; gap: 8px; }
  .m-spine {
    display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; width: 100%;
    padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: 2px;
    background: linear-gradient(90deg, #2a1c12, #1b120b 60%, #15100a); color: var(--paper);
  }
  .m-spine .n { font-size: 30px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
  .m-spine .meta { color: var(--paper-dim); font-size: 16px; }
  .m-spine .act { color: var(--flame); font-size: 16px; }
  .m-spine.is-new { border-color: rgba(251, 199, 121, 0.6); box-shadow: 0 0 18px rgba(251, 199, 121, 0.15); }
  .m-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .m-hero { background: none; border: 1px solid var(--line); padding: 0 0 10px; color: var(--paper); display: grid; gap: 8px; }
  .m-hero img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center top; }
  .m-hero span { font-size: 17px; }
  .m-desk { display: grid; }
  .m-desk button {
    background: none; border: 0; border-top: 1px solid var(--line); padding: 16px 0; text-align: left; font-size: 20px; color: var(--paper);
  }
  .m-desk button:last-child { border-bottom: 1px solid var(--line); }
  .m-foot { margin-top: 40px; display: grid; gap: 14px; justify-items: center; text-align: center; }
  .m-foot button { background: none; border: 1px solid rgba(220, 213, 203, 0.3); color: var(--paper); padding: 10px 22px; font-size: 17px; }
  .m-foot p { margin: 8px 0 0; color: var(--paper-dim); font-size: 14px; letter-spacing: 0.1em; }
  .card { padding: 34px 22px 30px; }
  .card h2 { font-size: 30px; }
  .hero-card { grid-template-columns: 1fr; gap: 20px; }
  .hero-card .portrait { max-width: 260px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .heroes-grid { gap: 8px; }
  .heroes-grid button { font-size: 17px; }
  .news-list li { grid-template-columns: 1fr; gap: 2px; }
  .chapter-row { grid-template-columns: 50px 1fr auto; gap: 10px; padding: 12px 6px; }
  .reader-stage { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rain { animation: none; }
  .panel { transition-duration: 0.01s; }
  .card, .card-backdrop, .raven-say, .reader-stage { animation: none !important; }
  .stage.is-zooming { transition: none; }
}
