/* Оформление лендинга. Один файл, без внешних загрузок:
   шрифты системные, картинки — только обложка книги. */

:root {
  --accent: #d8a24a;
  --bg: #12100e;
  --bg-soft: #191612;
  --bg-card: #1f1b16;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f2ece3;
  --muted: #a89e90;
  --accent-ink: #16120c;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --wrap: 1120px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.theme-light {
  --bg: #faf7f2;
  --bg-soft: #f2ece2;
  --bg-card: #ffffff;
  --line: rgba(0, 0, 0, 0.10);
  --text: #1d1a15;
  --muted: #6b6155;
  --accent-ink: #1d1a15;
  --shadow: 0 18px 40px rgba(60, 45, 20, 0.12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 760px; }
.center { text-align: center; }

/* ------------------------------------------------------------- шапка */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-link {
  color: var(--muted); text-decoration: none; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.is-active { color: var(--accent); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 860px) {
  .nav-burger {
    display: flex; flex-direction: column; gap: 4px; margin-left: auto;
    padding: 10px; cursor: pointer; border-radius: 8px;
  }
  .nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav-link { padding: 12px 4px; border-bottom: 1px solid var(--line); }
}

/* --------------------------------------------------------------- герой */
.hero { padding: 56px 0 40px; background:
  radial-gradient(1200px 400px at 20% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.hero-inner { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 48px; align-items: center; }
.hero-text { min-width: 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  color: var(--accent); margin: 0 0 12px; font-weight: 600;
}
.subtitle { font-size: 1.15rem; color: var(--muted); margin-top: -.3em; }
.author { font-size: 1rem; color: var(--muted); margin-bottom: 1.2em; }
.logline { font-family: var(--serif); font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.5; }
.meta-line { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.meta-line .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; }
.cta-note { color: var(--muted); font-size: .86rem; margin-top: 12px; }

.cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-card); }
.cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.cover-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 2 / 3; padding: 24px; font-family: var(--serif); font-size: 1.3rem;
  color: var(--muted); border: 1px solid var(--line);
}
.cover-side { max-width: 260px; }

@media (max-width: 860px) {
  .hero { padding: 32px 0 24px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .cover-hero { max-width: 220px; margin: 0 auto; }
}

/* Порядок на телефоне: цикл, название, обложка, кнопка, дальше всё остальное.
   Разметку не трогаем — hero-text растворяется через display: contents,
   и порядком управляют сами элементы. */
@media (max-width: 640px) {
  .hero-inner { display: flex; flex-direction: column; gap: 0; }
  .hero-text { display: contents; }
  .hero-text > * { order: 5; }
  .hero .eyebrow { order: 1; text-align: center; margin-bottom: 10px; }
  .hero h1 { order: 2; text-align: center; margin-bottom: 20px; }
  .cover-hero { order: 3; max-width: 200px; margin: 0 auto 22px; }
  .hero .cta-row { order: 4; margin: 0 0 8px; }
  .hero .cta-note { order: 4; text-align: center; margin: 0 0 26px; }
  .hero .cta-row .btn { flex: 1 1 100%; }
}

/* --------------------------------------------------------------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 10px; font-size: 1rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 16px 34px; font-size: 1.06rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.center-row { justify-content: center; }

/* --------------------------------------------------------------- секции */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-top { padding-top: 44px; border-top: none; }
.section-title { margin-bottom: 24px; }
.section-excerpt { background: var(--bg-soft); }

.prose { max-width: 68ch; }
.prose p { margin-bottom: 1.1em; }
.prose h2 { margin-top: 1.4em; }
.prose-reader { font-family: var(--serif); font-size: 1.12rem; line-height: 1.75; max-width: 62ch; }
.prose-fade {
  position: relative; max-height: 320px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.split { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } .cover-side { max-width: 200px; } }

/* --------------------------------------------------------------- карточки */
.cards { display: grid; gap: 18px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 0; text-decoration: none; display: block;
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.quote-text { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; margin-bottom: 12px; }
.card-meta { color: var(--accent); font-size: .85rem; margin: 0; }
.review-card blockquote { margin: 0 0 14px; font-size: .98rem; }
.review-card figcaption { color: var(--muted); font-size: .88rem; display: flex; gap: 8px; flex-wrap: wrap; }
.review-card .src { color: var(--accent); }
.stars { color: var(--accent); letter-spacing: 2px; margin-bottom: 10px; }

.big-quote {
  margin: 0 0 24px; padding: 0 0 0 22px; border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: clamp(1.15rem, 2.6vw, 1.5rem); line-height: 1.55;
}
.quote-h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.more-quotes { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.more-quotes h2 { font-size: 1.2rem; color: var(--muted); }

.tags { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .82rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

/* --------------------------------------------------------------- FAQ */
.faq { max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq-item summary {
  cursor: pointer; padding: 14px 0; font-family: var(--serif); font-size: 1.08rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-answer { color: var(--muted); padding-bottom: 8px; }

/* --------------------------------------------------------------- финал */
.final-cta { background: var(--bg-soft); text-align: center; }
.final-inner { max-width: 680px; margin: 0 auto; }
.final-inner .cta-row { justify-content: center; }
.reader-end { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- подвал */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.footer-nav a { text-decoration: none; color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-meta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.footer-soc { display: flex; gap: 14px; }
.footer-note { margin-top: 14px; font-size: .82rem; opacity: .75; max-width: 70ch; }

/* --------------------------------------------------------- переход к книге */
body.is-gate { display: flex; flex-direction: column; min-height: 100vh; }
body.is-gate main { flex: 1; display: flex; align-items: center; }
.gate { width: 100%; padding: 60px 0; }
.gate-card { max-width: 560px; margin: 0 auto; text-align: center; }
.gate-note { color: var(--muted); }
.gate-fallback { margin-top: 22px; font-size: .9rem; }
.gate-fallback a { color: var(--muted); }
.loader {
  width: 34px; height: 34px; margin: 0 auto 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loader { animation-duration: 2.4s; } .btn { transition: none; } }

/* ------------------------------------------------------------- ловушки */
/* Скрытые ссылки для роботов, которые ищут в коде адрес книги.
   Человек их не видит, с клавиатуры не достаёт, скринридер игнорирует. */
.hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
  opacity: 0; pointer-events: none;
}
