/* Том Сойер в XXI веке. Ночной город: тёмно-синий фон, тёплый свет фонарей, холодный свет экрана. */
:root {
  --night: #0b1018;
  --night-2: #121a27;
  --night-3: #1a2434;
  --paper: #f6efe2;
  --ink: #f3ece0;
  --muted: #a9b0bd;
  --gold: #ecb858;
  --gold-deep: #c98a2b;
  --blue: #6fc3ff;
  --line: rgba(255, 255, 255, .12);
  --radius: 18px;
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(18px, 5vw, 64px);
  --top-h: 60px;
  /* шапка и подвал на очень широком экране держатся колонки контента, а не краёв окна */
  --edge: max(var(--pad), calc((100vw - 1320px) / 2 + var(--pad)));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
summary { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #1b1207; padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 22px;
  border: 1px solid transparent; border-radius: 999px;
  font: 700 16px/1.2 var(--sans); text-decoration: none; text-align: center; white-space: nowrap;
  cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold { background: linear-gradient(180deg, #f6cd7c, var(--gold) 55%, #dba13c); color: #20150a; box-shadow: 0 8px 24px rgba(236, 184, 88, .28); }
.btn-gold:hover { box-shadow: 0 10px 30px rgba(236, 184, 88, .42); }
.btn-blue { background: linear-gradient(180deg, #8fd2ff, var(--blue)); color: #06203a; box-shadow: 0 8px 24px rgba(111, 195, 255, .22); }
.btn-line { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn-line:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.btn-off { background: rgba(255, 255, 255, .06); border-color: var(--line); color: var(--muted); cursor: default; }
.btn-off:hover { transform: none; }
.btn-big { min-height: 54px; padding: 14px 28px; font-size: 17px; }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: 14px; gap: 0; }
.lbl-extra { margin-left: .28em; }
.play-ico { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor; flex: none; }

.eyebrow { margin: 0 0 14px; color: var(--gold); font: 700 13px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--top-h); padding: 8px var(--edge);
  background: rgba(11, 16, 24, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand-mark { flex: none; display: block; width: 34px; height: 38px; color: var(--gold); overflow: visible; }
.brand-mark .swing { transform-origin: 17px 4px; animation: pendulum 3.2s ease-in-out infinite alternate; }
@keyframes pendulum { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
.brand-name { font: 700 17px/1.15 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name span { display: block; margin-top: 3px; color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.topnav { display: flex; gap: clamp(14px, 2.2vw, 28px); font-size: 15px; }
.topnav a { color: #d5d9e2; text-decoration: none; padding: 11px 0; white-space: nowrap; }
.topnav a:hover { color: var(--gold); }
.top-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; color: #d5d9e2; text-decoration: none; font-size: 15px; padding: 0 4px; white-space: nowrap; }
.top-link:hover { color: var(--gold); }

.flash { max-width: 760px; margin: 18px auto 0; padding: 14px 18px; background: #2a2010; border: 1px solid rgba(236, 184, 88, .5); border-radius: 14px; color: #ffe2a8; }
main > .flash { margin-left: max(var(--pad), calc(50% - 380px)); margin-right: max(var(--pad), calc(50% - 380px)); }

/* ---------- первый экран ---------- */
.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: clamp(24px, 5vw, 72px);
  max-width: 1320px; margin: 0 auto;
  padding: clamp(36px, 7vh, 84px) var(--pad) clamp(44px, 8vh, 96px);
}
.hero::before {
  content: ""; position: absolute; z-index: -2; inset: 0 calc(50% - 50vw);
  background: url("../img/cover.webp") center 30% / cover no-repeat;
  filter: blur(26px) saturate(1.1); opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 96%); mask-image: linear-gradient(180deg, #000 55%, transparent 96%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw);
  background: linear-gradient(180deg, rgba(11, 16, 24, .55) 0%, rgba(11, 16, 24, .78) 60%, var(--night) 100%);
}
.hero h1 { font-size: clamp(40px, min(7.2vw, 11vh), 88px); letter-spacing: -.02em; margin-bottom: 20px; }
.hero h1 span { display: block; color: var(--gold); }
.hero-lead { max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: #e4e2dc; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 15px; color: #c9ced8; }
.hero-facts li { position: relative; padding-left: 16px; }
.hero-facts li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.hero-facts strong { color: #fff; }
.hero-facts a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.hero-book { justify-self: center; width: min(100%, 400px, calc((100vh - var(--top-h) - 150px) * 2 / 3)); min-width: 220px; }
.hero-book a { display: block; border-radius: 14px; transform: rotate(2deg); transition: transform .3s ease; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 90px rgba(236, 184, 88, .18); }
.hero-book a:hover { transform: rotate(0deg) scale(1.015); }
.hero-book img { width: 100%; border-radius: 14px; aspect-ratio: 2 / 3; object-fit: cover; }

/* ---------- общие блоки ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--pad); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { font-size: clamp(30px, 4.6vw, 52px); letter-spacing: -.01em; }
.section-sub { margin: 16px 0 0; color: #c9ced8; font-size: 18px; }

/* ---------- трейлер ---------- */
.trailer-section { max-width: 1040px; }
.trailer { background: #05080d; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
/* сцена вместе с полосой управления (~64px) всегда помещается в экран под шапкой */
.trailer { scroll-margin-top: calc(var(--top-h) + 12px); }
.trailer-stage { position: relative; aspect-ratio: 16 / 9; min-height: 200px; max-height: calc(100vh - var(--top-h) - 88px); max-height: calc(100svh - var(--top-h) - 88px); width: 100%; overflow: hidden; background: #05080d; cursor: pointer; }
.trailer-blur { position: absolute; inset: -8%; background: center / cover no-repeat; filter: blur(30px) brightness(.5); transition: background-image .9s ease; }
.trailer-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.1s ease; }
.trailer-slide.is-on { opacity: 1; }
.trailer.is-playing .trailer-slide.is-on { animation: drift 14s ease-out both; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
.trailer-caption { position: absolute; left: 16px; bottom: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(5, 8, 13, .72); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #e8e2d6; opacity: 0; transition: opacity .5s ease; }
.trailer-caption.is-on { opacity: 1; }
/* кнопка внизу по центру: в середине кадра обычно лица */
.trailer-big { position: absolute; left: 0; right: 0; bottom: 24px; margin: 0 auto; width: 84px; height: 84px; border: 0; border-radius: 50%; background: var(--gold); color: #20150a; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(236, 184, 88, .22), 0 20px 50px rgba(0, 0, 0, .5); transition: transform .2s ease, opacity .3s ease; }
.trailer-big .play-ico { border-width: 16px 0 16px 26px; margin-left: 6px; }
.trailer-big:hover { transform: scale(1.06); }
.trailer.is-playing .trailer-big { opacity: 0; pointer-events: none; }
.trailer-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--night-2); }
.trailer-toggle { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.trailer-toggle:hover { background: rgba(255, 255, 255, .18); }
.trailer.is-playing .trailer-toggle .play-ico { width: 12px; height: 14px; border: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }
.trailer-track { position: relative; flex: 1; height: 28px; cursor: pointer; touch-action: none; }
.trailer-track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.trailer-fill { position: absolute; left: 0; top: 12px; height: 4px; width: 0; border-radius: 2px; background: var(--gold); }
.trailer-fill::after { content: ""; position: absolute; right: -7px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.trailer-time { flex: none; font-size: 14px; font-variant-numeric: tabular-nums; color: #c9ced8; }
.trailer-credit { margin: 14px 2px 0; font-size: 14px; color: var(--muted); }

/* ---------- о книге ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.about-text p { font-size: 18px; color: #dfe1e6; }
.about-text .btn { margin-top: 10px; }
.about-points { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.about-points li { display: flex; gap: 16px; padding: 18px 20px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.about-points span { flex: none; font: 700 22px/1.2 var(--serif); color: var(--gold); }
.about-points strong { display: block; margin-bottom: 4px; font-size: 18px; }
.about-points div { color: #c9ced8; font-size: 16px; }
.gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 5vw, 56px); }
.gallery img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--night-3); }

/* ---------- интервью ---------- */
.interview-section { max-width: 860px; }
.interview h3 { font-size: clamp(22px, 3vw, 30px); color: #ffe1a3; margin: 36px 0 16px; }
.interview > h3:first-child { margin-top: 0; }
.dialogue p { margin: 0 0 12px; padding: 14px 18px; background: var(--night-2); border-left: 3px solid var(--line); border-radius: 0 14px 14px 0; font-size: 17px; }
.dialogue b { color: var(--gold); margin-right: 8px; }
.dialogue b::after { content: ":"; }
.dialogue i { font-style: normal; font-weight: 400; color: var(--muted); }
.more { margin-top: 20px; }
.more summary { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 22px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; font-weight: 700; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: rgba(255, 255, 255, .08); }
.more .more-close, .more[open] .more-open { display: none; }
.more[open] .more-close { display: inline; }
.interview-song { margin: 20px 0 0; }

/* ---------- читать и скачать ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 26px 24px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.plan-main { border-color: rgba(236, 184, 88, .6); background: linear-gradient(180deg, rgba(236, 184, 88, .12), var(--night-2) 55%); }
.plan-full { border-color: rgba(111, 195, 255, .4); }
.plan-tag { margin: 0; font: 700 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.plan-full .plan-tag { color: var(--blue); }
.plan h3 { font-size: clamp(26px, 3vw, 34px); }
.plan p { margin: 0; color: #c9ced8; font-size: 16px; }
.plan .btn { width: 100%; margin-top: auto; white-space: normal; }
.plan > p:not(.plan-tag):not(.plan-note) { margin-bottom: 8px; }
.plan-note { font-size: 14px !important; color: var(--muted) !important; align-self: center; }
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.formats a { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; }
.formats a:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- вопросы ---------- */
.faq-section { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; padding: 18px 40px 18px 0; font: 700 19px/1.35 var(--serif); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 28px/1 var(--sans); color: var(--gold); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 20px; color: #c9ced8; max-width: 44em; }

.final-cta { text-align: center; padding: clamp(48px, 8vw, 96px) var(--pad) clamp(64px, 10vw, 120px); background: radial-gradient(600px 300px at 50% 100%, rgba(236, 184, 88, .16), transparent 70%); }
.final-cta h2 { font-size: clamp(30px, 4.6vw, 52px); margin-bottom: 12px; }
.final-cta p { color: #c9ced8; font-size: 18px; margin-bottom: 26px; }

/* ---------- подвал ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; padding: 32px var(--edge) 40px; background: #070b11; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.footer-about { display: grid; gap: 4px; }
.footer-about strong { color: var(--ink); font: 700 18px/1.3 var(--serif); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; align-content: flex-start; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: #e2cf9f; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- плашка с кнопками на телефоне ---------- */
.sticky-cta { display: none; }

/* ---------- читалка ---------- */
.read-progress { position: sticky; top: var(--top-h); z-index: 35; height: 3px; background: transparent; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--gold); }
.reader-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); max-width: 1160px; margin: 0 auto; padding: clamp(18px, 3vw, 40px) var(--pad) 64px; }
.chapter-nav { position: sticky; top: calc(var(--top-h) + 20px); align-self: start; max-height: calc(100vh - var(--top-h) - 40px); overflow-y: auto; padding: 16px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.chapter-nav-title { display: block; margin: 0 0 8px 8px; font: 700 13px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chapter-list { display: grid; gap: 2px; }
.chapter-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: #dfe1e6; }
.chapter-list a span { display: none; }
.chapter-list em { font-style: normal; }
.chapter-list small { width: 100%; font-size: 12px; color: var(--muted); }
.chapter-list a:hover { background: rgba(255, 255, 255, .07); }
.chapter-list a.is-current { background: rgba(236, 184, 88, .16); color: #ffd98f; font-weight: 700; }
.chapter-list a.is-locked em { color: var(--muted); }
.chapter-nav-more { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.chapter-nav-more a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: #e2cf9f; text-decoration: none; }
.chapter-nav-more a:hover { text-decoration: underline; }

.reader { --measure: calc(36 * clamp(18px, 1.5vw, 20px)); min-width: 0; background: var(--paper); color: #231a10; border-radius: var(--radius); padding: clamp(22px, 5vw, 64px) clamp(18px, 6vw, 72px); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.reader-book { max-width: var(--measure); margin: 0 auto 6px; font: 700 13px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.reader-book a { color: #8a6a3a; text-decoration: none; }
.reader h1 { max-width: var(--measure); margin: 0 auto clamp(20px, 3vw, 36px); font-size: clamp(30px, 4.4vw, 46px); color: #160f08; }
.reader-text { max-width: var(--measure); margin: 0 auto; font: clamp(18px, 1.5vw, 20px)/1.75 var(--serif); overflow-wrap: break-word; }
.reader-text p { margin: 0 0 1.05em; }
.reader-text hr, .scene-break { border: 0; margin: 2.2em 0; text-align: center; }
.reader-text hr::after, .scene-break::after { content: "* * *"; letter-spacing: .3em; color: #8a6a3a; }
.chapter-illustration { margin: 2.2em auto; text-align: center; }
.chapter-illustration img { width: auto; max-width: 100%; max-height: 82vh; margin: 0 auto; border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .28); background: #e6dac4; }
.chapter-illustration figcaption { margin-top: .7em; font: 14px/1.4 var(--sans); color: #7a6042; }
.reader-next { max-width: var(--measure); margin: 44px auto 0; padding-top: 28px; border-top: 1px solid #dccdb2; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; font-family: var(--sans); }
.reader-prev { display: inline-flex; align-items: center; min-height: 44px; color: #6b5231; font-weight: 700; text-decoration: none; }
.reader-prev:hover { text-decoration: underline; }
.reader-offer { width: 100%; display: flex; flex-wrap: wrap; gap: 12px; padding: 24px; background: #141c29; color: var(--ink); border-radius: var(--radius); }
.reader-offer h2 { width: 100%; font-size: clamp(22px, 3vw, 28px); }
.reader-offer p { width: 100%; margin: 0 0 6px; color: #c9ced8; }
.reader .btn-line { color: #fff; }

/* ---------- вход и регистрация ---------- */
.auth { display: grid; place-items: start center; padding: clamp(28px, 6vw, 72px) var(--pad) 72px; min-height: 70vh; }
.auth-box { width: 100%; max-width: 440px; display: grid; gap: 16px; padding: clamp(22px, 4vw, 34px); background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-box .eyebrow { margin: 0; }
.auth-box h1 { font-size: clamp(28px, 4vw, 36px); }
.auth-sub { margin: 0; color: #c9ced8; }
.auth-box label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.auth-box input:not([type=hidden]) { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; background: rgba(255, 255, 255, .07); color: #fff; font: 17px/1.3 var(--sans); }
.auth-box input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(236, 184, 88, .25); }
.auth-box small { font-weight: 400; color: var(--muted); }
.auth-box .btn { width: 100%; }
.auth-alt { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
.auth-alt a { color: #e2cf9f; white-space: nowrap; display: inline-block; padding: 10px 0; }
.form-error { margin: 0; padding: 12px 14px; background: rgba(255, 99, 71, .12); border: 1px solid rgba(255, 99, 71, .5); border-radius: 12px; color: #ffc9bd; }

/* ================= планшет ================= */
@media (max-width: 1020px) {
  .topnav { display: none; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr 1fr; }
  .plan-main { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 28px; }
  .hero-book { order: -1; width: min(58vw, 260px); min-width: 0; }
  .hero-book a { transform: none; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-facts { justify-content: center; }
  .hero-facts li { text-align: left; }
  .about-grid { grid-template-columns: 1fr; }
  .trailer-stage { aspect-ratio: 4 / 5; }

  .reader-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 12px; }
  .chapter-nav { position: static; max-height: none; overflow: visible; padding: 10px 12px; }
  .chapter-nav-title { display: none; }
  /* все десять глав видны сразу (в два ряда на телефоне), без скрытой прокрутки вбок */
  .chapter-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .chapter-list a { flex: none; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); }
  .chapter-list a span { display: inline; font-weight: 700; }
  .chapter-list em, .chapter-list small { display: none; }
  .chapter-list a.is-locked span::after { content: " 🔒"; font-size: 11px; }
  .chapter-nav-more { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; padding-top: 8px; }
}

/* ================= телефон ================= */
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --top-h: 56px; }
  .brand-name span { display: none; }
  .top-actions { gap: 8px; }

  /* первый экран: маленькая обложка слева от названия, чтобы главная кнопка была видна сразу */
  .hero { grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; align-items: center; text-align: left; padding-top: 20px; padding-bottom: 40px; }
  .hero-copy { display: contents; }
  .hero-book { order: 0; grid-column: 1; grid-row: 1 / span 2; width: clamp(92px, min(38vw, 16vh), 170px); }
  .hero .eyebrow { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 8px; font-size: 12px; letter-spacing: .1em; }
  .hero h1 { grid-column: 2; grid-row: 2; align-self: start; margin-bottom: 0; font-size: clamp(28px, 8vw, 40px); }
  .hero-lead, .hero-actions, .hero-facts { grid-column: 1 / -1; }
  .hero-lead { margin: 20px 0; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-facts { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 22px; }
  /* на телефоне ещё и место под нижнюю плашку с кнопками (~66px) */
  .trailer-stage { aspect-ratio: 2 / 3; max-height: calc(100vh - var(--top-h) - 154px); max-height: calc(100svh - var(--top-h) - 154px); }
  .trailer-big { width: 68px; height: 68px; bottom: 18px; box-shadow: 0 0 0 9px rgba(236, 184, 88, .22), 0 14px 36px rgba(0, 0, 0, .5); }
  .trailer-big .play-ico { border-width: 13px 0 13px 21px; margin-left: 5px; }
  .gallery { display: flex; gap: 10px; overflow-x: auto; margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); padding: 0 var(--pad) 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery img { flex: none; width: 44vw; scroll-snap-align: center; }
  .plans { grid-template-columns: 1fr; }
  .dialogue p { padding: 12px 14px; font-size: 16px; }
  .trailer-bar { gap: 10px; padding: 8px 10px; }
  .reader { border-radius: 14px; }
  .reader-layout { padding-left: 10px; padding-right: 10px; }
  .reader-offer .btn { width: 100%; white-space: normal; }

  .sticky-cta:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 16, 24, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .sticky-cta .btn { flex: 1; min-width: 0; padding-left: 12px; padding-right: 12px; font-size: 15px; }
  .sticky-cta .btn-gold { flex: 1.3; }
}

/* в шапке на узком экране кнопка короче: «Читать» */
@media (max-width: 440px) {
  .lbl-extra { display: none; }
}

@media (max-width: 359px) {
  .top-link { display: none; }
  .btn-big { padding-left: 18px; padding-right: 18px; }
}

/* невысокие экраны: телефон на боку — обложка справа, название и кнопка в первом экране */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 0 32px; text-align: left; padding-top: 18px; padding-bottom: 28px; }
  .hero-copy { display: block; }
  .hero-book { order: 0; grid-column: auto; grid-row: auto; align-self: start; min-width: 0; width: min(26vw, calc((100vh - var(--top-h) - 46px) * 2 / 3)); }
  .hero .eyebrow { margin-bottom: 8px; }
  .hero h1 { font-size: clamp(30px, 11vh, 60px); margin-bottom: 12px; }
  .hero-lead { margin: 0 0 16px; font-size: 16px; line-height: 1.5; }
  .hero-actions { flex-direction: row; justify-content: flex-start; }
  .hero-facts { flex-direction: row; justify-content: flex-start; }
  .gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-left: 0; margin-right: 0; padding: 0; overflow: visible; }
  .gallery img { width: 100%; }
  .trailer-big { width: 60px; height: 60px; bottom: 14px; box-shadow: 0 0 0 8px rgba(236, 184, 88, .22), 0 12px 30px rgba(0, 0, 0, .5); }
  .trailer-big .play-ico { border-width: 11px 0 11px 18px; margin-left: 4px; }
}

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

@media print {
  .topbar, .footer, .sticky-cta, .chapter-nav, .reader-next, .read-progress { display: none !important; }
  body, .reader { background: #fff; color: #000; box-shadow: none; }
}

/* ---------- поделиться ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.share-label { color: var(--muted); font-size: 15px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: transparent; color: var(--ink); font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--gold); color: var(--gold); }
.final-cta .share { justify-content: center; margin-top: 28px; }
.song-page h1 { font-size: clamp(32px, 5vw, 56px); }
.song-next { margin: 32px 0 0; }

/* ---------- отзывы ---------- */
.reviews-section { max-width: 860px; }
.reviews { display: grid; gap: 14px; margin-bottom: 32px; }
.review { margin: 0; padding: 20px 22px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.review blockquote { margin: 0 0 12px; font: 18px/1.6 var(--serif); color: #e8e4dc; overflow-wrap: break-word; }
.review figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.review figcaption strong { color: var(--gold); }
.review-form { display: grid; gap: 14px; padding: clamp(18px, 3vw, 28px); background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.review-form h3 { font-size: clamp(22px, 3vw, 28px); }
.review-form label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.review-form input, .review-form textarea { width: 100%; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; background: rgba(255, 255, 255, .07); color: #fff; font: 17px/1.5 var(--sans); }
.review-form input { min-height: 50px; }
.review-form textarea { resize: vertical; min-height: 130px; }
.review-form input:focus, .review-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(236, 184, 88, .25); }
.review-form .btn { justify-self: start; }
.review-note { margin: 0; font-size: 14px; color: var(--muted); }
.trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mod h1, .mod h2 { margin: 24px 0 16px; font-size: 26px; }
.mod-item { padding: 16px 18px; margin-bottom: 12px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: break-word; }
.mod-meta { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.mod-item form { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .review-form .btn { justify-self: stretch; } .share { flex-direction: column; align-items: flex-start; } .final-cta .share { align-items: center; } }
.review-source { margin-left: auto; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.review-source:hover { color: var(--gold); }
.mod .review-form { margin-bottom: 32px; }
.mod-check { display: flex !important; align-items: center; gap: 10px; font-weight: 400 !important; }
.mod-check input { width: 20px; min-height: 20px; height: 20px; }

/* ---------- сборка 23.11: песня, цитаты, покупка, условия ---------- */
.song-bridge { margin: 0 0 10px; font: italic 20px/1.4 var(--serif); color: var(--gold); }
.about-section { max-width: 860px; }
.about-section .about-text p { font-size: 19px; }
.quotes-section { max-width: 1040px; }
.quotes { columns: 2; column-gap: 18px; }
.quote { break-inside: avoid; margin: 0 0 18px; padding: 22px 24px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); }
.quote blockquote { margin: 0 0 12px; font: 20px/1.5 var(--serif); color: #f0ece4; }
.quote figcaption { font-size: 14px; color: var(--gold); }
.plan-price { font: 700 clamp(30px, 4vw, 40px)/1.1 var(--serif) !important; color: var(--ink) !important; margin: 0 !important; }
.unlock { width: 100%; margin-top: auto; }
.unlock-steps { display: grid; gap: 12px; }
.unlock-steps .share-buttons { margin-top: 4px; }
.unlock form { margin: 0; }
.unlock .btn { width: 100%; }
.reader-offer .unlock { margin-top: 0; }
.reader-offer p { font-size: 18px; color: var(--ink) !important; }
.float-read { position: fixed; right: 20px; bottom: 20px; z-index: 44; min-height: 52px; padding: 12px 26px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 8px 24px rgba(236, 184, 88, .3); }
.book-box { max-width: 520px; }
.formats-big a { min-height: 56px; font-size: 17px; }
.book-mail { display: grid; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.book-mail p { margin: 0; }
.form-note { padding: 10px 14px; background: rgba(236, 184, 88, .12); border: 1px solid rgba(236, 184, 88, .4); border-radius: 12px; color: #ffe2a8; }
.terms { max-width: 760px; }
.terms h1 { font-size: clamp(30px, 4.6vw, 46px); margin-bottom: 24px; }
.terms h2 { font-size: 22px; margin: 28px 0 10px; color: #ffe1a3; }
.terms p { color: #dfe1e6; }
.terms a, .footer-about a, .auth-sub a, .auth-alt a { color: #e2cf9f; }
.mod-table { width: 100%; border-collapse: collapse; margin: 0 0 28px; font-size: 14px; }
.mod-table th, .mod-table td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.mod-table input { width: 100%; min-width: 220px; background: transparent; color: var(--ink); border: 0; font: inherit; }
.chapter-list a.is-locked em::after { content: " 🔒"; font-size: 12px; }
.reader-text .verse, .reader-text blockquote { margin: 1.2em 0 1.2em 1.2em; font-style: italic; }
@media (max-width: 860px) { .quotes { columns: 1; } .chapter-list { flex-wrap: wrap; } }
@media (max-width: 640px) {
  .float-read { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: 96px; }
  .page-reader .footer { padding-bottom: 40px; }
}

/* покупка: форма с почтой перед оплатой */
.buy-form { display: grid; gap: 14px; }
.buy-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mod-kv th { width: 34%; text-align: left; vertical-align: top; }
.buy-note a { display: inline; padding: 0; white-space: normal; }
