/* ЛиСказка — лендинг (09.11.2026): два экрана. Первый — обещание и кнопки, второй — пять домашних ситуаций и ответ на каждую.
   Море — фон всей страницы (мир островов из приложения), страницы сказок и плитки — «наклейки» с чернильным контуром и жёсткой тенью.
   Движение одно: стопка страниц и герой появляются при загрузке. Фильтров на картинках нет (iOS WebKit). */

:root {
  --sea: #13717D;
  --sea-deep: #0E5862;
  --ink: #1C2B31;
  --paper: #FBF4E6;
  --fox: #D85A22;
  --fox-deep: #A9441A;
  --gold: #FFC778;
  --lagoon: #A6DCD3;
  --line: 2.5px solid var(--ink);
  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sans: 'Alegreya Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sea); }
body {
  margin: 0;
  background: var(--sea);
  color: var(--paper);
  font: 500 18px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Задняя страница стопки (повёрнута и сдвинута вправо) вылезает за край экрана: без обрезки телефон расширяет страницу и даёт сдвиг вбок. clip не делает main прокручиваемым; hidden — для старых Safari. */
main { overflow-x: hidden; overflow-x: clip; }

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 26px;
  border: var(--line);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  font: 800 19px/1.1 var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--fox { background: var(--fox); color: var(--paper); }
.btn--paper { background: var(--paper); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--square { width: 58px; padding: 0; flex: none; }
.btn__ico { width: 22px; height: 22px; flex: none; color: #2A9FD8; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .actions .btn { flex: 1 1 auto; }
.actions--stack { flex-direction: column; }

/* ── Шапка ── */
.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: block; line-height: 0; }
.brand__logo { width: 170px; height: 31px; }
.top__link {
  font: 700 17px/1 var(--sans);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--gold);
}
.top__link:hover { color: var(--gold); }

/* ── Первый экран ── */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  min-height: min(calc(100svh - 64px), 820px);
  padding: clamp(24px, 4vh, 48px) var(--pad) clamp(48px, 7vh, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
}
.hero__title {
  font: 800 clamp(42px, 5vw, 70px)/.98 var(--serif);
  letter-spacing: -.015em;
  text-wrap: balance;
  max-width: 16ch;
  margin-bottom: 22px;
}
.hero__lead { font-size: clamp(18px, 1.45vw, 21px); max-width: 33ch; margin-bottom: 30px; }
.hero__note { margin-top: 20px; font-size: 16px; max-width: 40ch; }

/* Стопка страниц: сверху сегодняшняя сказка, под ней — вчерашняя; сбоку — портрет героя. */
.book { position: relative; margin: 0; width: 100%; max-width: 580px; justify-self: end; padding: 0 0 0 25%; }
.book__stack { position: relative; }
.book__back, .book__card {
  border: var(--line);
  border-radius: 18px;
  background: var(--paper);
  overflow: hidden;
}
.book__back {
  position: absolute;
  inset: 0;
  transform: rotate(5deg) translate(7%, -4%);
  box-shadow: 6px 6px 0 var(--ink);
}
.book__back img { width: 100%; height: 100%; object-fit: cover; }
.book__card { position: relative; transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--ink); color: var(--ink); }
.book__art { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 35%; border-bottom: var(--line); }
.book__page { padding: 16px 20px 18px; font: 400 17px/1.45 var(--serif); }
.book__title { font: 800 21px/1.15 var(--serif); margin-bottom: 6px; }
.book__page mark { background: none; color: inherit; font-weight: 700; box-shadow: inset 0 -.42em 0 var(--gold); padding: 0 .08em; }
.book__voice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 6px 12px 6px 9px;
  border: 2px solid var(--fox-deep);
  border-radius: 999px;
  color: var(--fox-deep);
  font: 700 14px/1 var(--sans);
}
.book__voice svg { width: 18px; height: 18px; }
.book__kid { position: absolute; left: -3%; bottom: -9%; width: 39%; z-index: 2; pointer-events: none; }
.book__note {
  position: absolute;
  left: -15%;
  top: 3%;
  width: 34%;
  font: 700 25px/1.02 var(--hand);
  color: var(--paper);
  transform: rotate(-5deg);
}
.book__note svg { display: block; width: 48px; height: 56px; margin: 4px 0 0 30%; fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
  .book__card { animation: card-in .7s cubic-bezier(.2, .8, .2, 1) both; }
  .book__back { animation: back-in .8s .08s cubic-bezier(.2, .8, .2, 1) both; }
  .book__kid { animation: kid-in .55s .45s cubic-bezier(.3, 1.45, .5, 1) both; }
  .book__note { animation: note-in .4s .85s ease-out both; }
}
@keyframes card-in { from { opacity: 0; transform: rotate(-8deg) translateY(28px); } }
@keyframes back-in { from { opacity: 0; transform: rotate(0deg) translate(0, 0); } }
@keyframes kid-in { from { opacity: 0; transform: translateY(36px) scale(.9); } }
@keyframes note-in { from { opacity: 0; transform: rotate(-5deg) translateY(8px); } }

/* ── Второй экран: «Знакомо?» ── */
.why { max-width: var(--max); margin: 0 auto; padding: 8px var(--pad) clamp(56px, 8vh, 88px); }
.why__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-bottom: 26px; }
.why__head h2 { font: 800 clamp(36px, 4.2vw, 56px)/1 var(--serif); letter-spacing: -.01em; }
.why__head p { font-size: 19px; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "story story hero help" "voice map go go";
  gap: 18px;
}
.bento__deck { display: contents; }

.tile {
  --q: var(--fox-deep);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 22px 22px 0;
  border: var(--line);
  border-radius: 26px;
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.tile__quote { font: 700 25px/1.05 var(--hand); color: var(--q); margin-bottom: 8px; }
.tile h3 { font: 800 clamp(23px, 1.95vw, 28px)/1.06 var(--serif); letter-spacing: -.005em; margin-bottom: 8px; text-wrap: balance; }
.tile__text > p:last-child { font-size: 16.5px; line-height: 1.4; }

/* Новая сказка каждый день: текст слева, страница сказки справа во всю высоту. */
.tile--story { grid-area: story; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding: 0; }
.tile--story .tile__text { padding: 22px; align-self: center; }
.tile--story .tile__art { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; border-left: var(--line); }

/* Герой — он сам: три портрета выходят снизу плитки. */
.tile--hero { grid-area: hero; background: var(--gold); --q: var(--ink); }
.kids { margin: auto -22px 0; display: flex; justify-content: center; align-items: flex-end; height: 168px; }
.kids img { width: auto; height: 100%; margin: 0 -14px; transform: translateY(18%); }
.kids img:nth-child(2) { height: 112%; position: relative; z-index: 1; transform: translateY(12%); }

/* Поможет с тем, что непросто: темы особой сказки. */
.tile--help { grid-area: help; }
.chips { list-style: none; margin: auto 0 20px; padding: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 5px; }
.chips li { padding: 6px 10px 7px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font: 700 14px/1 var(--sans); white-space: nowrap; }
.chips li:nth-child(3n+1) { background: var(--lagoon); }
.chips li:nth-child(3n+2) { background: #FFE2B8; }
.chips .chips__more { background: none; border-style: dashed; }

/* Можно слушать: тёмная плитка, полоска звука. */
.tile--voice { grid-area: voice; background: var(--ink); color: var(--paper); --q: var(--gold); }
.wave { margin: auto -2px 26px; display: flex; align-items: center; gap: 5px; height: 56px; color: var(--gold); }
.wave svg { width: 34px; height: 34px; margin-right: 8px; flex: none; }
.wave i { width: 6px; border-radius: 3px; background: var(--paper); height: 30%; }
.wave i:nth-of-type(2n) { height: 62%; }
.wave i:nth-of-type(3n) { height: 88%; }
.wave i:nth-of-type(5n) { height: 46%; }
.wave i:nth-of-type(7n) { height: 100%; }
.wave i:nth-of-type(n+9) { background: rgba(251, 244, 230, .35); }

/* Одна сказка в день: путь от дома к новому острову, лодка и новый друг. */
.tile--map { grid-area: map; background: var(--lagoon); }
.isles { position: relative; margin: auto -22px 0; height: 118px; }
.isles img { position: absolute; }
.isles__route { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.isles__route path { vector-effect: non-scaling-stroke; }
.isles img { width: auto; }
.isles__a { height: 112%; left: calc(50% - 150px); bottom: -14%; }
.isles__b { height: 108%; right: calc(50% - 150px); bottom: 2%; }
.isles__boat { height: 46%; left: calc(50% - 22px); bottom: 32%; transform: rotate(-24deg); }
.isles__pal { height: 38%; right: calc(50% - 92px); bottom: 40%; }

/* Призыв: лиса радуется рядом с кнопками. */
.tile--go { grid-area: go; background: var(--fox); color: var(--paper); padding: 0; flex-direction: row; align-items: stretch; }
.go__lis { flex: 0 0 34%; width: 34%; align-self: flex-end; margin: 0 -2% -3% 2%; }
.go__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 26px 26px 26px 10px; }
.go__title { font: 800 clamp(27px, 2.4vw, 34px)/1.04 var(--serif); margin-bottom: 20px; text-wrap: balance; }
.tile--go .btn { width: 100%; min-height: 54px; font-size: 18px; padding: 0 16px; }
.tile--go .btn--ink { box-shadow: 4px 4px 0 rgba(28, 43, 49, .35); }
.tile--go .btn--ink:hover { box-shadow: 6px 6px 0 rgba(28, 43, 49, .35); }
.tile--go :focus-visible { outline-color: var(--ink); }

/* ── Подвал ── */
.foot {
  background: var(--sea-deep);
  padding: 26px max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad))) calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
  font-size: 15px;
}
.foot__logo { width: 128px; height: 24px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot__links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(251, 244, 230, .45); }
.foot__links a:hover { text-decoration-color: var(--gold); }
.foot__copy { margin-left: auto; opacity: .8; }

/* ── Липкая кнопка (телефон): появляется, когда кнопки первого экрана ушли из виду ── */
.dock { display: none; }

/* ── Плашка cookie (её строит js/stats.js) ── */
.cookie {
  position: fixed;
  z-index: 30;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px 16px;
  border: var(--line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}
.cookie__text a { color: var(--fox-deep); }
.cookie__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn--sm { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.btn--sm:hover { box-shadow: 4px 4px 0 var(--ink); }
.btn--line { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .6; cursor: default; }
/* Узкий телефон: плашка ниже (на 320 px она закрывала «Создать сказку» первого экрана) — меньше поля и шрифт, кнопки в одну строку. Текст тот же. */
@media (max-width: 399px) {
  .cookie { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 10px 12px 12px; border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); font-size: 13px; line-height: 1.35; }
  .cookie__btns { flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
  .cookie__btns .btn { flex: 1 1 auto; padding: 0 10px; white-space: nowrap; }
}
@media (max-width: 359px) {
  .cookie__btns .btn { font-size: 14px; }
}

/* ── Планшет: сетка в две колонки ── */
/* ── ЛиСказка на телефоне (15.11): установка с экрана «Домой», вкладки iPhone / Android — своя открывается сама по устройству (js/site.js) ── */
.phone { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) clamp(56px, 8vh, 88px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px 40px; align-items: center; }
.phone__head h2 { font: 800 clamp(36px, 4.2vw, 56px)/1 var(--serif); letter-spacing: -.01em; margin-bottom: 14px; }
.phone__head p { font-size: 19px; line-height: 1.4; max-width: 34ch; }
.phone__app { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 26px; font: 700 15px/1 var(--sans); }
.phone__app img { width: 76px; height: 76px; border: var(--line); border-radius: 20px; box-shadow: 4px 4px 0 var(--ink); }
.phone__card { display: flex; flex-direction: column; gap: 20px; padding: 22px; border: var(--line); border-radius: 26px; box-shadow: 6px 6px 0 var(--ink); background: var(--paper); color: var(--ink); }
.phone__tabs { align-self: flex-start; display: flex; gap: 6px; padding: 5px; border: var(--line); border-radius: 14px; background: #fff; }
.phone__tabs button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: 800 17px/1 var(--sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.phone__tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.phone__tabs button:focus-visible { outline: 3px solid var(--fox); outline-offset: 2px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 14px; margin: 0; padding: 0; }
.steps[hidden] { display: none; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 18px; line-height: 1.3; font-weight: 700; text-wrap: pretty; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border: var(--line); border-radius: 50%; background: var(--gold); font: 800 19px/1 var(--serif); }
.steps__ico { width: 28px; height: 28px; color: var(--fox-deep); }
.phone__card .btn { align-self: stretch; }
.phone__note { font-size: 15px; line-height: 1.35; color: rgba(28, 43, 49, .75); }
@media (max-width: 899px) { .phone { grid-template-columns: minmax(0, 1fr); } .phone__head p { max-width: none; } .phone__app { display: none; } }
@media (max-width: 699px) {
  .phone__head h2 { font-size: clamp(32px, 9vw, 42px); }
  .phone__head p { font-size: 17px; }
  .phone__card { padding: 18px; gap: 16px; }
  .steps li { font-size: 16.5px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .steps li::before { width: 36px; height: 36px; font-size: 17px; }
}

@media (max-width: 1099px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "story story" "hero help" "voice map" "go go"; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .book { padding-left: 24%; }
}

/* ── Узкий планшет: первый экран в столбец, стопка страниц под кнопками ── */
@media (max-width: 899px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .book { justify-self: center; max-width: 520px; margin-top: 12px; }
}

/* ── Телефон: один столбец, ситуации листаются вбок ── */
@media (max-width: 699px) {
  body { font-size: 17px; }
  .top { padding-top: 14px; }
  .brand__logo { width: 140px; height: 26px; }
  .top__link { display: none; }

  .hero { display: block; min-height: 0; padding-top: 22px; padding-bottom: 44px; }
  .hero__title { font-size: clamp(34px, 10vw, 44px); margin-bottom: 14px; }
  .hero__lead { font-size: 17px; margin-bottom: 22px; }
  .actions { gap: 12px; }
  .hero .actions .btn { width: 100%; }
  .hero__note { font-size: 15px; margin-top: 16px; }

  .book { margin: 38px auto 0; max-width: 420px; padding-left: 24%; }
  .book__page { padding: 12px 14px 14px; font-size: 15px; }
  .book__title { font-size: 18px; }
  .book__voice { margin-top: 10px; font-size: 13px; }
  .book__note { font-size: 20px; left: -1%; top: 2%; width: 27%; }
  .book__note svg { width: 36px; height: 42px; margin-left: 24%; }

  .why { padding-top: 0; }
  .why__head { margin-bottom: 16px; }
  .why__head p { font-size: 17px; }
  .bento { display: block; }
  .bento__deck {
    display: flex;
    gap: 12px;
    margin: 0 calc(-1 * var(--pad));
    padding: 2px var(--pad) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pad);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .bento__deck::-webkit-scrollbar { display: none; }
  .bento__deck .tile { flex: 0 0 84%; height: 400px; min-height: 0; scroll-snap-align: start; }
  .tile { padding: 18px 18px 0; border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); }
  .tile__quote { font-size: 23px; }
  .tile h3 { font-size: 23px; }
  .tile__text > p:last-child { font-size: 16px; }
  .tile--story { display: flex; padding: 0; }
  .tile--story .tile__text { padding: 18px 18px 14px; align-self: stretch; }
  .tile--story .tile__art { flex: 1; min-height: 0; border-left: 0; border-top: var(--line); }
  .kids, .isles { margin-inline: -18px; }
  .kids { height: 205px; }
  .isles { height: 180px; }
  .chips { gap: 8px 6px; margin-bottom: 22px; }
  .chips li { font-size: 15px; padding: 8px 12px 9px; }
  .wave { height: 84px; gap: 6px; margin-bottom: 34px; }
  .wave i { width: 7px; }
  .wave svg { width: 40px; height: 40px; }
  .tile--go { margin-top: 18px; min-height: 0; display: block; padding: 0; }
  .go__lis { position: absolute; top: 10px; right: 6px; width: 108px; margin: 0; }
  .go__body { padding: 22px 18px 20px; }
  .go__title { font-size: 25px; padding-right: 92px; margin-bottom: 18px; min-height: 104px; }

  .foot { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .foot__copy { margin-left: 0; }

  .dock {
    display: flex;
    gap: 10px;
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--sea);
    border-top: var(--line);
    transform: translateY(110%);
    /* Спрятанная кнопка не ловит Tab и не читается экранным диктором: visibility гаснет после выезда. */
    visibility: hidden;
    transition: transform .25s ease, visibility 0s .25s;
  }
  .dock.is-on { transform: none; visibility: visible; transition: transform .25s ease; }
  .dock .btn--fox { flex: 1; }
  /* Пока висит плашка cookie, липкую кнопку не показываем: вместе они закрывают почти половину экрана. */
  .has-cookie .dock { display: none; }
}

@media (max-width: 359px) {
  .chips li { font-size: 13.5px; padding: 6px 9px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .dock { transition: none; }
}
