/* KidsBook — лендинг под пробную закупку. Mobile-first, канон полей Фотоцвета. */

:root {
  --gutter: 16px;

  --ink: #241d17;
  --ink-soft: #5c5148;
  --ink-mute: #8a7f74;

  --bg: #fffdf9;
  --bg-tint: #f7f0e6;
  --line: #e6dccd;

  --accent: #d4622a;
  --accent-dark: #b44f1f;

  --radius: 14px;
  --radius-lg: 20px;

  --maxw: 1128px;
}

@media (min-width: 601px) { :root { --gutter: 32px; } }
@media (min-width: 1025px) { :root { --gutter: 48px; } }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.narrow { max-width: 720px; }

/* ---------- Кнопки ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s cubic-bezier(.2, .7, .3, 1), box-shadow .15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(212, 98, 42, .28);
}

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(212, 98, 42, .34);
}

.btn--primary:active {
  background: var(--accent-dark);
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(212, 98, 42, .26);
}

/* ---------- Заглушки изображений ---------- */

.ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: repeating-linear-gradient(
    45deg,
    #f0e7d9, #f0e7d9 10px,
    #eae0d0 10px, #eae0d0 20px
  );
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-mute);
  overflow: hidden;
}

.ph::after {
  content: attr(data-ph);
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.ph__label { font-size: 14px; font-weight: 600; }

.ph--square { aspect-ratio: 1 / 1; }
.ph--spread { aspect-ratio: 16 / 10; }

/* ---------- 1. Первый экран ---------- */

.hero {
  position: relative;
  padding: 40px 0 48px;
  background: linear-gradient(180deg, #fdf3e3 0%, var(--bg) 78%);
  overflow: hidden;
}

/* Небо: медленно плывущие облака. Декор, за экраном скринридера. */
.hero__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  border-radius: 999px;
  background: #fff;
  opacity: .55;
  filter: blur(0.5px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud--1 {
  width: 120px; height: 34px; top: 8%; left: -140px;
  animation: drift 46s linear infinite;
}
.cloud--1::before { width: 54px; height: 54px; top: -22px; left: 22px; }
.cloud--1::after  { width: 38px; height: 38px; top: -14px; left: 64px; }

.cloud--2 {
  width: 90px; height: 26px; top: 26%; left: -120px;
  opacity: .4;
  animation: drift 64s linear infinite 8s;
}
.cloud--2::before { width: 42px; height: 42px; top: -18px; left: 16px; }
.cloud--2::after  { width: 30px; height: 30px; top: -10px; left: 50px; }

.cloud--3 {
  width: 150px; height: 40px; top: 60%; left: -180px;
  opacity: .3;
  animation: drift 82s linear infinite 20s;
}
.cloud--3::before { width: 66px; height: 66px; top: -28px; left: 28px; }
.cloud--3::after  { width: 46px; height: 46px; top: -18px; left: 82px; }

@keyframes drift {
  to { transform: translateX(calc(100vw + 220px)); }
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero__title { font-size: 32px; }

.hero__line { display: block; }

.hero__line--accent { color: var(--accent); }

/* Заголовок и текст въезжают снизу при загрузке. */
.hero__title,
.hero__lead,
.hero__price,
.hero__cta,
.hero__micro {
  animation: rise .7s cubic-bezier(.2, .7, .3, 1) backwards;
}

.hero__title { animation-delay: .05s; }
.hero__lead  { animation-delay: .15s; }
.hero__price { animation-delay: .25s; }
.hero__cta   { animation-delay: .35s; }
.hero__micro { animation-delay: .45s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.hero__lead {
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero__price-num { font-size: 30px; font-weight: 700; }
.hero__price-note { font-size: 14px; color: var(--ink-mute); }

.hero__cta { margin-top: 20px; width: 100%; }

/* Мягкое дыхание кнопки: заметно боковым зрением, не дёргает. */
.hero__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(212, 98, 42, .45);
  animation: pulse 3.4s ease-out infinite 1.2s;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 98, 42, .40); }
  70%  { box-shadow: 0 0 0 18px rgba(212, 98, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 98, 42, 0); }
}

.hero__micro { margin-top: 12px; font-size: 14px; color: var(--ink-mute); }

/* ---------- Книга: раскрывается и покачивается ---------- */

.hero__media { position: relative; width: 100%; perspective: 1600px; }

.book {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 2 / 1.12;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 18px 40px rgba(90, 60, 30, .18),
    0 3px 10px rgba(90, 60, 30, .10);
  transform-style: preserve-3d;
  animation: book-open 1.1s cubic-bezier(.22, .8, .28, 1) .25s backwards,
             book-float 7s ease-in-out 1.6s infinite;
}

@keyframes book-open {
  from { opacity: 0; transform: rotateX(28deg) rotateY(-14deg) scale(.92); }
  to   { opacity: 1; transform: none; }
}

@keyframes book-float {
  0%, 100% { transform: translateY(0) rotate(-.25deg); }
  50%      { transform: translateY(-9px) rotate(.25deg); }
}

.book__page { position: relative; width: 50%; overflow: hidden; }

.book__img {
  display: block;
  width: 200%;
  height: 100%;
  object-fit: cover;
}

/* Каждая половина показывает свою картинку целиком: левая — своё, правая — своё. */
.book__page--left  .book__img { object-position: left center; width: 100%; }
.book__page--right .book__img { object-position: right center; width: 100%; }

/* Тень у корешка: даёт объём раскрытой книги. */
.book__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 34px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    rgba(60, 40, 20, 0) 0%,
    rgba(60, 40, 20, .16) 42%,
    rgba(60, 40, 20, .22) 50%,
    rgba(60, 40, 20, .16) 58%,
    rgba(60, 40, 20, 0) 100%
  );
  pointer-events: none;
}

/* Искры вокруг книги: «волшебство» для ребёнка, ненавязчиво для взрослого. */
.hero__sparkles { position: absolute; inset: -14px; pointer-events: none; }

.spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd479 0%, rgba(255, 212, 121, 0) 70%);
  animation: twinkle 3.6s ease-in-out infinite;
}

.spark--1 { top: 8%;  left: 4%;   animation-delay: 0s; }
.spark--2 { top: 22%; right: 6%;  animation-delay: .9s; width: 13px; height: 13px; }
.spark--3 { bottom: 14%; left: 12%; animation-delay: 1.8s; width: 7px; height: 7px; }
.spark--4 { bottom: 6%; right: 16%; animation-delay: 2.6s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.5); }
  50%      { opacity: 1; transform: scale(1.25); }
}

/* ---------- Секции ---------- */

.section { padding: 48px 0; }
.section--tint { background: var(--bg-tint); }

.section__title { font-size: 26px; }

.section__lead {
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink-soft);
}

/* ---------- 2. Шаги ---------- */

.steps {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.step__title { margin-top: 12px; font-size: 19px; }
.step__text { margin-top: 6px; font-size: 16px; color: var(--ink-soft); }

/* ---------- 3. Примеры ---------- */

.examples { display: grid; gap: 24px; margin-top: 28px; }

.example { margin: 0; }

.example__pair {
  display: grid;
  grid-template-columns: 1fr 22px 1fr;
  align-items: start;
  gap: 8px;
}

.example__side { min-width: 0; }

/* Заглушка фото и готовая иллюстрация обязаны быть одного размера: пара читается
   как «было → стало» только когда обе половины совпадают по высоте. */
.example__side .ph--square { width: 100%; }

.example__img {
  display: block;
  width: 100%;
  height: auto;            /* иначе атрибут height="600" из разметки диктует размер и cover режет бока */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(90, 60, 30, .14);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.example:hover .example__img { transform: scale(1.03) rotate(-.6deg); }

/* Стрелка рисуется, а не пишется символом: не зависит от шрифта. */
.example__arrow {
  position: relative;
  align-self: center;
  width: 22px;
  height: 22px;
  margin-top: -18px;
}

.example__arrow::before,
.example__arrow::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
}

.example__arrow::before {
  top: 50%; left: 2px;
  width: 16px; height: 2px;
  transform: translateY(-50%);
}

.example__arrow::after {
  top: 50%; right: 3px;
  width: 8px; height: 8px;
  border-radius: 0 2px 0 0;
  background: none;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.example__tag {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
}

.example__tag--accent { color: var(--accent); font-weight: 600; }

.examples__note {
  margin-top: 22px;
  font-size: 15px;
  color: var(--ink-mute);
  text-align: center;
}

.spreads { display: grid; gap: 16px; margin-top: 28px; }

.spread-card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(90, 60, 30, .16);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease;
}

.spread-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(90, 60, 30, .22);
}

/* Единая пропорция ряда: в него попадают и развороты 16:10, и квадратные иллюстрации. */
.spread-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}

/* ---------- Появление при скролле ---------- */

/* Скрываем только когда JS точно жив и наблюдатель повесится: иначе контент
   останется невидимым навсегда. Класс js ставит app.js первой строкой. */
.js .reveal > *,
.js .reveal.example,
.js .reveal.spread-card,
.js .reveal.price-card {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
}

.js .reveal.is-in > *,
.js .reveal.example.is-in,
.js .reveal.spread-card.is-in,
.js .reveal.price-card.is-in {
  opacity: 1;
  transform: none;
}

/* Дети внутри списка появляются по очереди. */
.reveal.is-in > *:nth-child(2) { transition-delay: .10s; }
.reveal.is-in > *:nth-child(3) { transition-delay: .20s; }
.reveal.is-in > *:nth-child(4) { transition-delay: .30s; }

/* ---------- 4. Что в книге ---------- */

.specs { display: grid; gap: 14px; margin-top: 28px; }

.spec {
  padding: 16px;
  background: var(--bg-tint);
  border-radius: var(--radius);
}

.spec__val { display: block; font-size: 19px; font-weight: 700; }
.spec__key { display: block; margin-top: 4px; font-size: 15px; color: var(--ink-soft); }

.section--tint .spec { background: var(--bg); }

/* ---------- 5. Проза ---------- */

.prose { margin-top: 16px; font-size: 17px; color: var(--ink-soft); }
.prose--muted { color: var(--ink-mute); font-size: 15px; }

/* ---------- 6. Цена ---------- */

.price-card {
  margin-top: 24px;
  padding: 24px 20px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.section--tint .price-card { background: var(--bg); }

.price-card__num { font-size: 34px; font-weight: 700; }

.price-card__list { margin-top: 16px; display: grid; gap: 10px; }

.price-card__list li {
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  color: var(--ink-soft);
}

.price-card__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.price-card__extra { margin-top: 16px; font-size: 15px; color: var(--ink-mute); }

.price-card__cta { margin-top: 20px; width: 100%; }

/* ---------- 7. Форма ---------- */

.form { margin-top: 24px; }

.field { margin-bottom: 18px; }

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

select.field__input { padding-right: 36px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a7f74' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field__input[aria-invalid="true"] { border-color: #c0392b; }

.field__err {
  margin-top: 6px;
  font-size: 14px;
  color: #c0392b;
  min-height: 0;
}

.field__err:empty { display: none; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
}

.check__box {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.check__label { font-size: 15px; color: var(--ink-soft); line-height: 1.45; }

.form__submit { margin-top: 22px; width: 100%; }

.form__note { margin-top: 12px; font-size: 14px; color: var(--ink-mute); }

.thanks {
  margin-top: 24px;
  padding: 28px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.thanks__title { font-size: 22px; }
.thanks__text { margin-top: 10px; font-size: 16px; color: var(--ink-soft); }

/* ---------- 8. Вопросы ---------- */

.faq { margin-top: 24px; border-top: 1px solid var(--line); }

.faq__item { border-bottom: 1px solid var(--line); }

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker { display: none; }

.faq__q::after {
  content: "+";
  flex: none;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-mute);
}

.faq__item[open] .faq__q::after { content: "\2212"; }

.faq__a {
  padding-bottom: 18px;
  font-size: 16px;
  color: var(--ink-soft);
}

/* ---------- Подвал ---------- */

.footer { padding: 32px 0 40px; border-top: 1px solid var(--line); }
.footer__text { font-size: 15px; color: var(--ink-mute); }

/* ---------- Уважение к настройке «меньше движения» ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal > *,
  .js .reveal.example,
  .js .reveal.spread-card,
  .js .reveal.price-card {
    opacity: 1;
    transform: none;
  }

  .book { animation: none; }
  .cloud, .spark { display: none; }
}

/* ---------- Планшет и десктоп ---------- */

@media (min-width: 601px) {
  .hero { padding: 56px 0 64px; }
  .hero__title { font-size: 40px; }
  .hero__lead { font-size: 18px; }
  .hero__cta { width: auto; min-width: 240px; }
  .hero__price-num { font-size: 34px; }

  .section { padding: 64px 0; }
  .section__title { font-size: 32px; }

  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  /* Пары «фото → герой» держим в ДВЕ колонки: в трёх картинка ужимается до ~170px
     и лицо героя, ради которого блок существует, перестаёт читаться. */
  .examples { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .spreads { grid-template-columns: repeat(2, 1fr); }
  .specs { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .price-card { padding: 32px; }
  .price-card__cta { width: auto; min-width: 240px; }
  .form__submit { width: auto; min-width: 240px; }
}

@media (min-width: 1025px) {
  .hero { padding: 72px 0 80px; }

  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: 56px;
  }

  .hero__text { flex: 0 1 42%; }
  .hero__media { flex: 1 1 58%; }

  .hero__title { font-size: 48px; }

  .section { padding: 80px 0; }
  .specs { grid-template-columns: repeat(4, 1fr); }
}
