/* Страница книги. Цвета и шрифты: css/base.css */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.narrow { max-width: 760px; }
.hand { font-family: var(--f-hand); }

.skip { position: absolute; left: 16px; top: -64px; z-index: 30; padding: 12px 16px; background: var(--ink); color: var(--paper); border-radius: 2px; }
.skip:focus { top: 16px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 24px; border-radius: 2px;
  background: var(--ink); color: var(--paper);
  font: 600 16px/1.2 var(--f-text); text-decoration: none; text-align: center;
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-light { background: var(--mint-2); color: var(--ink); }
.btn-light:hover { background: var(--paper); }
.buy .btn:focus-visible, .buy a:focus-visible, .foot a:focus-visible { outline-color: var(--mint-2); }

/* Шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.top-name { display: inline-flex; align-items: center; min-height: 44px; font: 400 30px/1 var(--f-hand); color: var(--ink); text-decoration: none; }

/* Первый экран */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding-top: 8px; padding-bottom: 80px; }
.hero-author { font-size: 24px; color: var(--ink); margin-bottom: 12px; }
.title { font-family: var(--f-title); color: var(--ink); font-size: 60px; line-height: 1; text-transform: uppercase; }
.split { position: relative; display: block; }
.split-base { display: block; clip-path: inset(52% -0.2em -0.2em -0.2em); }
/* Верхняя половина букв рисуется стилем: в тексте страницы слово одно */
.split::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute; inset: 0;
  clip-path: inset(-0.2em -0.2em 48% -0.2em);
  transform: translateX(0.07em);
  animation: split 0.9s var(--ease) 0.35s both;
}
.split + .split { margin-top: 4px; }
.title-hand { display: block; margin-top: 12px; font-size: 36px; line-height: 1.1; text-transform: none; }
@keyframes split { from { transform: translateX(0); } }
.lead { max-width: 520px; margin-top: 20px; font-size: 20px; line-height: 1.55; color: var(--text); }
.shops { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.shops .btn { flex: 1 1 220px; }
.store { margin-top: 16px; font-size: 16px; color: var(--muted); }
.proof { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(21, 50, 51, 0.25); font-size: 16px; color: var(--ink); max-width: 520px; }
.hero-pic img {
  width: 100%; max-width: 560px; margin-left: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}

/* Появление первого экрана */
.up { animation: up 0.7s var(--ease) both; }
.lead.up { animation-delay: 0.5s; }
.shops.up { animation-delay: 0.56s; }
.store.up { animation-delay: 0.62s; }
.proof.up { animation-delay: 0.68s; }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }

/* Сцена обложки: небо, горизонт, земля */
.word { background: var(--mint); padding: 96px 0 64px; }
.sec-title { font: 400 36px/1.2 var(--f-title); color: var(--ink); margin-bottom: 24px; }
.word-text { margin: 0; }
.word-text p { font-size: 24px; line-height: 1.6; color: var(--ink); }
.word-sign { margin-top: 16px; font-size: 30px; color: var(--ink); text-align: right; }

.horizon { position: relative; height: 96px; overflow: hidden; overflow: clip; background: linear-gradient(var(--mint) 0, var(--mint) 64px, var(--sand-2) 64px); }
.walker-track { position: absolute; inset: 0; transform: translateX(calc(-100% + 120px)); }
.walker { position: absolute; right: 24px; top: 8px; fill: var(--night); }
@supports (animation-timeline: view()) {
  .walker-track { animation: walk linear both; animation-timeline: view(); animation-range: entry 40% exit 10%; }
  @keyframes walk { from { transform: translateX(calc(-100% + 120px)); } to { transform: translateX(0); } }
}

.parts { background: linear-gradient(var(--sand-2), var(--sand) 70%); padding: 48px 0 96px; }
.parts-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.parts-list li { padding: 0 32px; border-left: 1px solid rgba(21, 50, 51, 0.35); }
.parts-list li:first-child { padding-left: 0; border-left: 0; }
.parts-list h3 { font: 400 30px/1.2 var(--f-title); color: var(--ink); }
.parts-count { margin: 4px 0 16px; font-size: 16px; color: var(--ink); }
.parts-list p { color: var(--ink); }
.parts-after { margin-top: 48px; font-size: 18px; color: var(--ink); }
.parts-after .hand { font-size: 24px; }

/* Первая страница книги */
.page { background: var(--paper); padding: 96px var(--gut); }
.sheet { max-width: 640px; margin: 0 auto; }
.sheet-part { text-align: center; font-size: 16px; color: var(--muted); }
.sheet-title { text-align: center; font: 400 36px/1.2 var(--f-title); color: var(--ink); margin-top: 4px; }
.sheet-chapter { text-align: center; margin: 24px 0 40px; font-size: 18px; font-weight: 600; color: var(--ink); }
.sheet-text p { text-indent: 1.5em; line-height: 1.7; }
.sheet-num { margin-top: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.page-cta { display: flex; justify-content: center; margin-top: 48px; }

/* Об авторе */
.author { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding-top: 96px; padding-bottom: 96px; }
.author-pic img {
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
}
.author-text p + p { margin-top: 16px; }
.motto .hand { font-size: 24px; color: var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.links a, .foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 4px; }

/* Вопросы */
.faq { background: var(--paper); padding: 96px 0; }
.faq-list details { border-top: 1px solid rgba(21, 50, 51, 0.2); }
.faq-list details:last-child { border-bottom: 1px solid rgba(21, 50, 51, 0.2); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 12px 0; cursor: pointer; list-style: none;
  font-size: 20px; color: var(--ink);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font: 400 30px/1 var(--f-title); transition: transform .3s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 0 24px; max-width: 640px; }

/* Где купить */
.buy { background: var(--ink); color: var(--mint-2); padding: 96px 0; }
.buy .sec-title { color: var(--paper); }
.buy-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }
.buy-note { font-size: 18px; }
.store-box { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(194, 213, 210, 0.3); }
.store-box b { color: var(--paper); font-weight: 600; }
.link-arrow { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--paper); text-underline-offset: 4px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(194, 213, 210, 0.2); }
.facts dt { font-size: 16px; color: var(--mint); }
.facts dd { margin: 0; font-size: 16px; color: var(--paper); font-variant-numeric: tabular-nums; }
/* Ссылка на издательство: палец попадает в 44 точки, строка таблицы не растёт */
.facts dd a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; text-underline-offset: 4px; }

/* Подвал */
.foot { background: var(--night); color: var(--mint-2); padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); font-size: 16px; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot-mark { font-size: 30px; color: var(--paper); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { color: var(--mint-2); }

/* Кнопка внизу экрана на телефоне */
.dock {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  opacity: 0; transform: translateY(24px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .5s var(--ease), background-color .25s var(--ease);
}
.dock.on { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 861px) { .dock { display: none; } }

/* Появление разделов при прокрутке */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.seen { opacity: 1; transform: none; }

@media (max-width: 860px) {
  :root { --gut: 16px; }
  body { font-size: 17px; }
  .hero { grid-template-columns: 1fr; gap: 8px; padding-top: 0; padding-bottom: 64px; }
  .hero-pic { order: -1; }
  .hero-pic img { max-width: 240px; margin: 0 auto; }
  .hero-author { font-size: 20px; margin-bottom: 8px; }
  .title { font-size: min(48px, 13.4vw); }
  .title-hand { font-size: 36px; margin-top: 12px; }
  .lead { font-size: 18px; margin-top: 16px; }
  .shops { margin-top: 24px; }
  .shops .btn { flex-basis: 100%; }
  .word { padding: 64px 0 48px; }
  .sec-title { font-size: 30px; }
  .word-text p { font-size: 20px; }
  .parts { padding: 32px 0 64px; }
  .parts-list { grid-template-columns: 1fr; gap: 32px; }
  .parts-list li { padding: 0 0 0 16px; border-left: 1px solid rgba(21, 50, 51, 0.35); }
  .parts-list li:first-child { padding-left: 16px; border-left: 1px solid rgba(21, 50, 51, 0.35); }
  .parts-list h3 { font-size: 24px; }
  .page { padding: 64px var(--gut); }
  .author { grid-template-columns: 1fr; gap: 24px; padding-top: 64px; padding-bottom: 64px; }
  .faq { padding: 64px 0; }
  .faq-list summary { font-size: 18px; }
  .buy { padding: 64px 0 96px; }
  .buy-grid { grid-template-columns: 1fr; gap: 40px; }
  .facts div { grid-template-columns: 112px 1fr; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .split::after { animation: none; }
  .up { animation-name: fade; }
  @keyframes fade { from { opacity: 0; } }
  .js .reveal { transform: none; }
  .walker-track { animation: none; transform: translateX(calc(-50% + 60px)); }
  .btn, .dock { transition: opacity .3s, background-color .25s; }
  .btn:hover, .btn:active { transform: none; }
}

/* Страница 404 */
.lost { padding-top: 96px; padding-bottom: 96px; }
.lost-cta { margin-top: 32px; }
