@charset "UTF-8";

/* Шрифты лежат на сервере сайта: Lora (заголовки) и Source Sans 3 (текст), лицензия SIL OFL, см. /fonts/OFL.txt */
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/lora-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/lora-latin-wght-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: "Lora"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/fonts/lora-cyrillic-wght-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/fonts/lora-latin-wght-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: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/fonts/source-sans-3-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/fonts/source-sans-3-latin-wght-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: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/fonts/source-sans-3-ruble-wght-normal.woff2") format("woff2"); unicode-range: U+20BD; }
/* Эмодзи в сообщениях бота: на iPhone и Mac системные Apple, на остальных Noto Color Emoji (SIL OFL, /fonts/OFL-NotoEmoji.txt),
   урезанный до значков, которые есть на страницах. Новый значок нужно добавить и в шрифт, и в unicode-range. */
@font-face { font-family: "Site Emoji"; font-display: swap; src: local("Apple Color Emoji"), url("/fonts/noto-emoji-site.woff2") format("woff2"); unicode-range: U+1F3A8, U+1F447, U+1F466-1F467, U+1F476, U+1F4B3, U+1F4D5-1F4D8, U+1F4DA, U+1F5BC, U+1F9D2, U+1F9F8, U+2705, U+270D, U+270F, U+FE0F; }

/* Цвета взяты с обложки книги: ночной фон, золотая рамка, кремовая бумага страниц. */
:root {
  color-scheme: light;
  --night: #1b2440;
  --night-deep: #131a30;
  --night-2: #26325a;
  --paper: #f8f3ea;
  --paper-2: #eee5d3;
  --sheet: #fbf7ee; /* фон бумаги в картинках бота, поле paper в manifest.json */
  --ink: #1b2440;
  --ink-soft: #424c69;
  --cream: #f4ecdc;
  --cream-soft: #c5cad9;
  --gold: #d8b46a;
  --gold-deep: #b8913f;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --font-ui: "Site Emoji", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 6px;
  --wrap: 1200px;
  --gutter: 20px;
  --section: clamp(88px, 12vw, 176px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--gold-deep) var(--paper-2); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--gold-deep); accent-color: var(--gold-deep); }
::selection { color: var(--night); background: var(--gold); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a, button, summary, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 5.2vw, 4rem); line-height: 1.04; }
h3 { font-size: 1.45rem; line-height: 1.2; }
.lead { max-width: 46ch; font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.5; }

.wrap { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.skip-link { position: fixed; z-index: 50; top: 12px; left: 12px; padding: 10px 16px; color: var(--night); background: var(--gold); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* Кнопки */
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: 12px 24px; border: 0; border-radius: 999px; font: 700 1rem/1.2 var(--font-body); text-align: center; text-decoration: none; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease; }
.button:active { transform: scale(.97); }
.button-gold { color: var(--night); background: var(--gold); }
.button-ghost { color: var(--cream); background: var(--night-2); }
.button-small { min-height: 40px; padding: 8px 18px; font-size: .95rem; }
@media (hover: hover) and (pointer: fine) {
  .button-gold:hover { background: #e6c784; }
  .button-ghost:hover { background: #33416f; }
}
.text-link { display: inline-flex; min-height: 48px; align-items: center; font-weight: 700; text-decoration-color: var(--gold); text-underline-offset: .3em; }
.text-link:hover { color: var(--gold); }

/* Шапка */
.site-header { position: relative; z-index: 20; color: var(--cream); background: var(--night); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); font: 600 1.35rem/1 var(--font-display); text-decoration: none; }
.wordmark img { width: 30px; height: 30px; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-actions .button { display: none; }
.lang-switch { display: inline-grid; min-width: 44px; min-height: 44px; place-items: center; color: var(--cream-soft); font-size: .95rem; font-weight: 700; text-decoration: none; }
.lang-switch:hover { color: var(--gold); }
.menu-toggle { display: inline-flex; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0; border: 0; border-radius: 50%; background: var(--night-2); cursor: pointer; }
.menu-toggle span { width: 18px; height: 2px; background: var(--cream); transition: transform 200ms var(--ease-out); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.primary-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; flex-direction: column; padding: 8px var(--gutter) 20px; background: var(--night); }
.primary-nav.is-open { display: flex; animation: drop 220ms var(--ease-out); }
.primary-nav a { padding: 12px 0; color: var(--cream); font: 500 1.35rem/1.2 var(--font-display); text-decoration: none; }
.primary-nav a:hover { color: var(--gold); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.no-js .primary-nav { position: static; display: flex; flex-flow: row wrap; gap: 0 16px; padding: 0 0 12px; }
.no-js .primary-nav a { font-size: 1rem; }
.no-js .menu-toggle { display: none; }
.no-js .header-inner { flex-wrap: wrap; }

/* Первый экран: ночное небо и обложка */
.hero { position: relative; overflow: hidden; padding-block: 40px 96px; color: var(--cream); background: var(--night); }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky .constellation path { fill: none; stroke: rgba(216,180,106,.28); stroke-width: 1; }
.sky .stars circle { fill: var(--cream); animation: twinkle 4.8s ease-in-out infinite alternate; }
.sky .stars circle:nth-child(3n) { animation-delay: -1.6s; }
.sky .stars circle:nth-child(3n+1) { animation-delay: -3.2s; animation-duration: 6s; }
.sky .sparkles path { fill: var(--gold); opacity: .85; }
.sky .sparkles, .sky .constellation { display: none; }
@keyframes twinkle { from { opacity: .25; } to { opacity: .95; } }
.hero-grid { position: relative; display: grid; gap: 48px; }
.hero h1 { max-width: 15ch; font-size: clamp(2.5rem, 8.4vw, 4.7rem); line-height: 1; letter-spacing: -.03em; }
.hero .lead { margin-top: 24px; color: var(--cream); }
.hero-facts { margin-top: 16px; color: var(--gold); font: italic 500 1.15rem/1.4 var(--font-display); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 32px; }
.hero-actions .button { width: 100%; }
.hero-notes { display: grid; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--cream-soft); font-size: 1rem; }
.hero-notes li { position: relative; padding-left: 26px; }
.hero-notes li::before { position: absolute; top: .3em; left: 0; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='%23d8b46a' d='M7 0Q8.2 5.8 14 7Q8.2 8.2 7 14Q5.8 8.2 0 7Q5.8 5.8 7 0Z'/%3E%3C/svg%3E") center / contain no-repeat; content: ""; }

.book-stage { display: grid; justify-items: center; gap: 24px; }
/* Размеры внутри книги в cqw: обложка масштабируется целиком, на телефоне так же, как на десктопе */
.book { position: relative; container-type: inline-size; width: min(78vw, 380px); aspect-ratio: 1 / 1.414; transform-origin: left center; transition: transform 900ms var(--ease-expo); }
.book.is-open { transform: translateX(50%) scale(.64); cursor: zoom-out; }
.book { cursor: pointer; }
.book-page, .cover-front, .cover-back { position: absolute; inset: 0; border-radius: 3px 8px 8px 3px; }
.bookplate { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.8cqw; padding: 12%; color: var(--ink); background: var(--sheet); text-align: center; }
.bookplate img { width: 12.8cqw; height: 12.8cqw; margin-bottom: 3.3cqw; }
.bookplate-label { font: italic 5.5cqw/1.3 var(--font-display); }
.bookplate-name { width: 100%; padding-bottom: 1.7cqw; border-bottom: 2px solid var(--gold); font: 600 11cqw/1.1 var(--font-display); overflow-wrap: anywhere; }
.bookplate-wish { margin-top: 7.8cqw; font: italic 5.1cqw/1.4 var(--font-display); }
.bookplate-from { color: var(--ink-soft); font-size: 4.4cqw; }
.book-cover { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; transition: transform 1000ms var(--ease-expo); }
.book.is-open .book-cover { transform: perspective(2200px) rotateY(-178deg); }
.cover-front, .cover-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7%; padding: 12% 10%; overflow: hidden; background: var(--night-2); }
.cover-front::before, .cover-front::after { position: absolute; border: 2px solid var(--gold); border-radius: 3px; content: ""; pointer-events: none; }
.cover-front::before { inset: 3.9cqw; }
.cover-front::after { inset: 5.5cqw; border-width: 1px; }
.cover-back { display: grid; place-items: center; background: var(--paper-2); transform: rotateY(180deg); }
.cover-back::after { width: 22%; aspect-ratio: 1; background: url("/assets/brand/moon-star-mono-1f2a44.svg") center / contain no-repeat; content: ""; opacity: .18; }
.cover-plate { width: 100%; padding: 2.5%; border: 2px solid var(--gold); border-radius: 4px; background: var(--sheet); }
.cover-plate img { width: 100%; }
.cover-title { color: var(--cream); font: italic 500 8cqw/1.15 var(--font-display); text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
.cover-brand { color: var(--gold); font: 600 4.4cqw/1 var(--font-display); letter-spacing: .04em; }
.cover-star { width: 5cqw; height: 5cqw; fill: var(--gold); animation: glint 3.2s ease-in-out infinite; }
@keyframes glint { 0%, 100% { opacity: .55; transform: scale(.85) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
/* Смена героя: обложка переворачивается ребром, пока меняются картинка и название */
.book.is-turning .book-cover { transform: perspective(2200px) rotateY(-88deg); transition-duration: 320ms; transition-timing-function: var(--ease-in-out); }
/* Смена стиля: картинка гаснет с размытием и проявляется новая */
[data-img] { transition: opacity 260ms var(--ease-out), filter 260ms var(--ease-out); }
[data-img].is-swapping { opacity: 0; filter: blur(6px); }
.book-controls { display: grid; gap: 16px; width: min(100%, 440px); }
.name-field { display: grid; gap: 6px; color: var(--cream-soft); font-size: .95rem; }
.name-field input { min-height: 50px; padding: 10px 18px; border: 0; border-radius: 999px; color: var(--night); background: var(--cream); font: 600 1.05rem var(--font-body); }
.name-field input:focus-visible { outline-offset: 2px; }
.book-controls .button { color: var(--cream); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.seg legend { width: 100%; margin-bottom: 6px; padding: 0; color: var(--cream-soft); font-size: .95rem; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 999px; color: var(--cream); background: var(--night-2); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.seg label:active span { transform: scale(.97); }
.seg input:checked + span { color: var(--night); background: var(--gold); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .seg input:not(:checked) + span:hover { background: #33416f; } }
.no-js .book-controls { display: none; }

/* Как появляется книга: шаги и сообщения бота */
.how { padding-block: var(--section); background: var(--paper); }
.how-head { display: grid; gap: 20px; margin-bottom: 56px; }
.how-head .lead { color: var(--ink-soft); }
.story-steps { display: grid; gap: 72px; margin: 0; padding: 0; list-style: none; }
.story-step { display: grid; gap: 24px; }
.step-text h3 { margin-bottom: 12px; font-size: clamp(1.7rem, 3.2vw, 2.6rem); transition: color 300ms ease; }
.step-text p { max-width: 40ch; font-size: clamp(1.125rem, 1.5vw, 1.3rem); line-height: 1.55; }
.story-stage { display: none; }

.chat { display: grid; gap: 8px; width: 100%; max-width: 420px; padding: 20px 16px; border-radius: 18px; background: #d9e3cf; font: 400 15.5px/1.38 var(--font-ui); color: #0f1419; }
.msg { position: relative; max-width: 86%; padding: 8px 12px 9px; border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
.msg.bot { justify-self: start; border-bottom-left-radius: 4px; }
.msg.me { justify-self: end; border-bottom-right-radius: 4px; background: #e2f7cb; }
.msg b { font-weight: 600; }
.msg-photo { padding: 4px; overflow: hidden; }
.msg-photo img { width: 100%; border-radius: 11px 11px 4px 4px; background: #fff; }
.msg-photo figcaption { padding: 8px 8px 4px; }
.msg-file { display: flex; align-items: center; gap: 12px; }
.file-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #2a6fb0; font-size: 12px; font-weight: 700; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 92%; }
.keys span { display: flex; align-items: center; justify-content: center; padding: 9px 8px; border-radius: 8px; color: #fff; background: #4f6150; font-size: 14px; font-weight: 500; text-align: center; }
.keys span:only-child { grid-column: 1 / -1; }

/* Что внутри книги: страницы по порядку */
.inside { padding-block: var(--section); overflow: hidden; background: var(--paper-2); }
.inside .lead { margin-top: 20px; color: var(--ink-soft); }
.pages { display: grid; grid-auto-flow: column; grid-auto-columns: min(64vw, 260px); align-items: start; gap: 20px; margin: 48px 0 0; padding: 8px var(--gutter) 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); list-style: none; scrollbar-width: thin; }
.page { scroll-snap-align: start; }
.page-wide { grid-column: span 1; }
.sheet, .mini-cover { position: relative; aspect-ratio: 1 / 1.414; overflow: hidden; border-radius: 3px; background: var(--sheet); transition: transform 300ms var(--ease-out); }
.page-wide .sheet { display: grid; place-items: center; aspect-ratio: 1.414 / 1; padding: 6%; }
.page-wide .sheet img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.sheet { display: flex; flex-direction: column; gap: 12px; padding: 12%; }
.sheet img { width: 100%; }
.page-wide .sheet img { mix-blend-mode: multiply; }
.sheet-center { align-items: center; justify-content: center; text-align: center; }
.sheet-center img { width: 30px; mix-blend-mode: normal; }
.sheet-small { color: var(--ink-soft); font: italic 1rem/1.3 var(--font-display); }
.sheet-name { width: 100%; border-bottom: 2px solid var(--gold); font: 600 1.7rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.sheet-wish { font: italic 1.2rem/1.4 var(--font-display); }
.sheet-text { font: 1rem/1.45 var(--font-display); }
.mini-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12%; padding: 13% 12% 10%; color: var(--cream); background: var(--night-2); }
.mini-cover::before { position: absolute; inset: 9px; border: 1.5px solid var(--gold); border-radius: 2px; content: ""; }
.mini-plate { width: 100%; padding: 2.5%; border: 1.5px solid var(--gold); border-radius: 3px; background: var(--sheet); }
.mini-cover p { font: italic 500 1.1rem/1.2 var(--font-display); text-align: center; overflow-wrap: anywhere; }
.mini-end { justify-content: center; }
.mini-end p { margin: 0; color: var(--gold); font-size: 2rem; }
.page-caption { margin-top: 12px; font-size: 1rem; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .page:hover .sheet, .page:hover .mini-cover { transform: translateY(-6px) rotate(-.6deg); }
}

/* Цены, как меню */
.plans { padding-block: var(--section); color: var(--cream); background: var(--night); }
.plans-grid { display: grid; gap: 40px; }
.plans-head p { max-width: 38ch; margin-top: 20px; color: var(--cream-soft); font-size: 1.125rem; }
.plans-art { display: none; }
.menu h3 { margin: 48px 0 20px; color: var(--gold); font-size: 1.5rem; font-style: italic; }
.menu h3:first-child { margin-top: 0; }
.menu ul { display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; }
.menu li { display: grid; grid-template-columns: 1fr auto; gap: 2px 20px; }
.menu-name { font: 500 1.35rem/1.3 var(--font-display); }
.menu-price { font: 500 1.35rem/1.3 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-desc { grid-column: 1 / -1; max-width: 40ch; color: var(--cream-soft); }
.menu-note { margin-top: 48px; color: var(--cream-soft); }
.menu-note a { color: var(--cream); }

/* Письмо про нейросети и фото */
.trust { padding-block: var(--section); background: var(--paper-2); }
.trust-grid { display: grid; gap: 72px; align-items: start; }
.keep-block { display: grid; gap: 36px; }
.letter { position: relative; max-width: 720px; padding: 40px 24px 0; background: var(--sheet); }
.letter::after { position: absolute; top: 100%; right: 0; left: 0; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Ccircle cx='12' cy='0' r='12' fill='%23fffbf3'/%3E%3C/svg%3E") 0 0 / 24px 12px repeat-x; content: ""; }
.letter h2 { margin-bottom: 28px; font-size: clamp(2rem, 4.4vw, 3rem); }
.letter p { max-width: 62ch; font-size: 1.125rem; line-height: 1.6; }
.letter p + p { margin-top: 18px; }
.letter-stub { display: grid; gap: 4px; margin: 36px -24px 0; padding: 20px 24px 24px; border-top: 4px dotted var(--paper-2); }
.letter-stub a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; text-decoration-color: var(--gold-deep); }
.letter-stub a:hover { color: var(--gold-deep); }

/* Сроки хранения */
.keep-block h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.keep-block > div p { max-width: 42ch; margin-top: 20px; font-size: 1.125rem; }
.keep-block > div a { font-weight: 700; text-decoration-color: var(--gold-deep); }
.keep-list { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.keep-list li { display: grid; gap: 4px; }
.keep-time { font: 500 clamp(2.2rem, 5vw, 3.2rem)/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }

/* Вопросы как сплошной текст */
.faq { padding-block: var(--section); background: var(--paper); }
.faq-grid { display: grid; gap: 32px; }
.faq-text p { max-width: 62ch; font-size: 1.0625rem; line-height: 1.6; break-inside: avoid; }
.faq-text p + p { margin-top: 20px; }
.faq-text b { font-weight: 700; }
.faq-text a { font-weight: 700; text-decoration-color: var(--gold-deep); }

/* Контакты: отрывной купон */
.contacts { padding-block: 0 var(--section); background: var(--paper); }
.coupon { position: relative; display: grid; border-radius: var(--radius); color: var(--cream); background: var(--night); }
.coupon-main { padding: 36px 24px 32px; }
.coupon-main h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.coupon-main p { max-width: 40ch; margin-top: 16px; color: var(--cream-soft); font-size: 1.125rem; }
.coupon-actions { display: grid; gap: 10px; margin-top: 28px; }
.coupon-actions .button { overflow-wrap: anywhere; }
.coupon-actions .button-ghost { color: var(--cream); }
.coupon-stub { position: relative; display: grid; gap: 16px; margin: 0; padding: 32px 24px 36px; border-top: 4px dotted rgba(216,180,106,.5); }
.coupon-stub::before, .coupon-stub::after { position: absolute; top: -16px; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); content: ""; }
.coupon-stub::before { left: -14px; }
.coupon-stub::after { right: -14px; }
.coupon-stub dt { color: var(--cream-soft); font-size: .95rem; }
.coupon-stub dd { margin: 0; overflow-wrap: anywhere; }
.coupon-stub a { color: var(--gold); font-weight: 700; }

/* Подвал: задняя обложка */
.back-cover { position: relative; overflow: hidden; padding-top: 72px; color: var(--cream); background: var(--night-deep); }
.back-top { display: grid; gap: 40px; }
.back-invite p { max-width: 12ch; margin-bottom: 28px; font: 500 clamp(2.4rem, 7vw, 4.6rem)/1.02 var(--font-display); letter-spacing: -.03em; }
.back-links { display: grid; gap: 2px; align-content: start; }
.back-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--cream); text-decoration-color: rgba(216,180,106,.6); }
.back-links a:hover { color: var(--gold); }
.back-legal { display: grid; gap: 6px; margin-top: 56px; color: var(--cream-soft); font-size: .9rem; }
.back-legal a { color: var(--cream); }
.back-wordmark { margin: 24px 0 0; color: var(--gold); font: 600 30vw/.8 var(--font-display); letter-spacing: -.04em; white-space: nowrap; transform: translate(-1.5vw, 22%); user-select: none; }

/* Документы */
.legal-document { width: min(760px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 56px 0 var(--section); overflow-wrap: break-word; }
.legal-document h1 { margin-bottom: 28px; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; }
.legal-document h2 { margin: 44px 0 12px; font-size: clamp(1.35rem, 3.6vw, 1.75rem); line-height: 1.25; }
.legal-document h3 { margin: 28px 0 8px; font-size: 1.2rem; }
.legal-document p + p, .legal-document p + ul, .legal-document p + ol, .legal-document ul + p, .legal-document ol + p, .legal-document .table-wrap + p { margin-top: 14px; }
.legal-document ul, .legal-document ol { padding-left: 1.3em; }
.legal-document li + li { margin-top: 8px; }
.legal-document a { font-weight: 700; text-decoration-color: var(--gold-deep); }
.legal-note { margin-bottom: 32px; padding: 18px 20px; border-radius: var(--radius); background: var(--paper-2); }
.table-wrap { margin: 16px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legal-document table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal-document th, .legal-document td { padding: 9px 10px; border: 1px solid #d8ccb4; text-align: left; vertical-align: top; }
.legal-document th { background: var(--paper-2); font-weight: 700; }
.legal-more { margin-top: 64px; padding: 28px 24px; border-radius: var(--radius); background: var(--paper-2); }
.legal-more h2 { margin: 0 0 8px; font-size: 1.35rem; }
.legal-more ul { margin: 0; padding-left: 1.1em; }

/* 404 */
.not-found { width: min(640px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 96px 0; }
.not-found h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); }
.not-found p { margin-top: 16px; }
.not-found a { font-weight: 700; }

/* Появление при прокрутке: включает script.js, без него всё видно сразу */
/* Каждая анимация что-то показывает: обложка ложится на стол, страницы книги перелистываются по порядку,
   строки меню и сроки хранения проявляются по одной. Остальное видно сразу. */
.reveal-ready [data-reveal], .reveal-ready [data-reveal-group] > * { opacity: 0; transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-expo); transition-delay: var(--d, 0ms); }
.reveal-ready [data-reveal-group] > * { transform: translateY(10px); }
.reveal-ready .pages[data-reveal-group] > * { transform: perspective(900px) rotateY(-28deg) translateX(-16px); transform-origin: left center; transition-duration: 700ms, 1000ms; }
.reveal-ready .is-in[data-reveal], .reveal-ready [data-reveal-group].is-in > * { opacity: 1; transform: none; }
.reveal-ready .book-stage[data-reveal] { transform: translateY(40px) rotate(3deg); transition-duration: 900ms, 1300ms; }
.reveal-ready .book-stage.is-in[data-reveal] { transform: none; }

.sticky-cta { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--night); transform: translateY(110%); transition: transform 320ms var(--ease-expo); }
.sticky-cta.is-visible { transform: none; }
.sticky-cta .button { width: 100%; }
@media (max-width: 959px) {
  .hero-grid { gap: 0; }
  .hero-copy, .book-stage { display: contents; }
  .hero h1 { order: 1; }
  .book { order: 2; justify-self: center; width: min(60vw, 250px); margin: 28px 0 4px; }
  .hero .lead { order: 3; }
  .hero-facts { order: 4; }
  .hero-actions { order: 5; }
  .hero-notes { order: 6; }
  .book-controls { order: 7; justify-self: center; width: 100%; max-width: 460px; margin-top: 44px; }
  .sky .stars circle:nth-child(n+12) { display: none; }
}
@media (min-width: 960px) { .sticky-cta { display: none; } }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .hero-actions .button { width: auto; }
  .coupon-actions { display: flex; flex-wrap: wrap; }
  .letter { padding: 56px 56px 0; }
  .letter-stub { margin-inline: -56px; padding-inline: 56px; display: flex; flex-wrap: wrap; gap: 8px 32px; }
}

@media (min-width: 960px) {
  :root { --gutter: 48px; }
  body { font-size: 1.125rem; }
  .header-inner { min-height: 80px; gap: 40px; }
  .menu-toggle { display: none; }
  .primary-nav { position: static; display: flex; flex-direction: row; gap: 32px; padding: 0; background: none; }
  .primary-nav a { padding: 0; font: 600 1rem/1 var(--font-body); color: var(--cream-soft); }
  .primary-nav a:hover { color: var(--gold); }
  .header-actions { gap: 16px; }
  .header-actions .button { display: inline-flex; }

  .hero { padding-block: 48px 112px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; gap: 64px; }
  .hero-copy { padding-top: 64px; }
  .book { width: min(100%, 360px); }
  .book-controls { grid-template-columns: 1fr auto; align-items: end; width: min(100%, 460px); }
  .seg-style, .book-controls .button { grid-column: 1 / -1; }
  .seg-style { display: flex; }
  .book-controls .seg span { min-height: 50px; }
  .seg-style label { flex: 1 1 auto; }
  .book.is-open { transform: translateX(50%) scale(.72); }
  .sky .sparkles, .sky .constellation { display: inline; }

  .how-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 64px; margin-bottom: 40px; }
  .js .story { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 96px; }
  .js .story-step { min-height: 46vh; align-content: center; }
  .js .story-step:not(.is-active) .step-text h3 { color: var(--ink-soft); }
  .js .story-step .chat { display: none; }
  .js .story-stage { position: sticky; top: calc(50vh - 280px); display: block; height: 560px; align-self: start; }
  .story-stage .chat { position: absolute; inset: auto 0 auto 0; top: 50%; opacity: 0; transform: translateY(calc(-50% + 16px)) scale(.98); filter: blur(4px); transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-expo), filter 400ms var(--ease-out); }
  .story-stage .chat.is-active { opacity: 1; transform: translateY(-50%); filter: none; }
  .no-js .story-step, .story-step { grid-template-columns: minmax(0, 1fr) 420px; gap: 96px; align-items: center; }
  .js .story-step { grid-template-columns: 1fr; }

  .pages { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding: 8px 0 0; overflow: visible; }
  .page-wide { grid-column: span 2; }
  .page-wide .sheet { aspect-ratio: auto; height: calc((min(var(--wrap), 100vw - 2 * var(--gutter)) - 96px) / 4 * 1.414); }

  .plans-grid { grid-template-columns: 5fr 7fr; gap: 96px; }
  .plans-art { display: block; width: 82%; margin-top: 56px; }
  .menu ul { gap: 28px; }
  .trust-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px; }
  .keep-block { padding-top: 40px; }
  .faq-grid { grid-template-columns: 4fr 8fr; gap: 64px; align-items: start; }
  .faq-text { columns: 2; column-gap: 56px; }
  .faq-text p { margin: 0 0 22px; }
  .faq-text p + p { margin-top: 0; }

  .coupon { grid-template-columns: 1.4fr 1fr; }
  .coupon-main { padding: 56px; }
  .coupon-stub { align-content: center; padding: 56px 48px; border-top: 0; border-left: 4px dotted rgba(216,180,106,.5); }
  .coupon-stub::before, .coupon-stub::after { top: auto; left: -16px; }
  .coupon-stub::before { top: -14px; }
  .coupon-stub::after { right: auto; bottom: -14px; }

  .back-top { grid-template-columns: 2fr 1fr; align-items: start; }
  .back-legal { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky .stars circle, .cover-star { animation: none; }
  .book.is-turning .book-cover { transform: none; }
  [data-img].is-swapping { filter: none; }
  .book, .book-cover { transition-duration: 1ms; }
  .reveal-ready [data-reveal], .reveal-ready [data-reveal-group] > *, .reveal-ready .book-stage[data-reveal] { transform: none; transition: opacity 400ms ease; }
  .story-stage .chat { transform: translateY(-50%); filter: none; transition: opacity 200ms ease; }
  .page:hover .sheet, .page:hover .mini-cover { transform: none; }
}
