/* Концепт главной: первый экран из gift.css + облачко героя; ниже — ночные разделы. */
:root { --gold: #f6d898; --cream: #efe6d2; --muted: #cfc5b0; --night: #0f1326; --paper: #f7ecd4; --ink: #51331e;
  /* Сколько следующего блока видно под первым экраном: признак того, что страница продолжается. */
  --peek: clamp(64px, 14svh, 136px); --hero-h: max(280px, calc(100svh - var(--peek))); }
html { scroll-behavior: smooth; }
.home-concept { background: var(--night); }
/* gift.css also serves the gift landing; these overrides belong only to the home page. */
.home-concept .gift-page .brand { filter: none; }
.home-concept .gift-book::before { display: none; filter: none; }
.home-concept .legal-footer a { text-shadow: none; }

/* Первый экран ниже окна; книга масштабируется от его высоты, а не от высоты окна. */
.gift-page.hero { height: var(--hero-h); }
.hero .stage { width: min(100%, calc(var(--hero-h) * 1.05), 880px); }
@media (orientation: portrait) and (max-width: 600px) { .hero .stage { width: min(104vw, calc(var(--hero-h) * .9)); } }

/* Облачко «Как зовут героя?» — как облачко с именем на экране выбора героя в приложении. */
.hero-bubble { position: absolute; z-index: 3; left: 50%; bottom: 91%; transform: translateX(-50%);
  width: 60%; padding: 2.6cqw 3.4cqw 3cqw; border-radius: 4.5cqw; background: #fbf3e0f2;
  outline: .35cqw solid #e2bd7a; display: flex; flex-direction: column;
  align-items: center; gap: 1.7cqw; color: var(--ink); font-family: Georgia, 'Times New Roman', serif; }
.hero-bubble::after { content: ''; position: absolute; left: 50%; bottom: -2.4cqw; width: 4.4cqw; height: 4.4cqw;
  background: #fbf3e0; transform: translateX(-50%) rotate(45deg); border-right: .35cqw solid #e2bd7a; border-bottom: .35cqw solid #e2bd7a; border-radius: 0 0 .8cqw 0; }
.hero-bubble label { font-size: 4.3cqw; line-height: 1.1; color: #6d4a2c; }
.name-row { position: relative; display: block; width: 100%; }
.hero-bubble input { width: 100%; font: 600 5.6cqw/1.2 'Fira Sans', system-ui, sans-serif; text-align: center; color: #3b2412;
  border: 0; border-bottom: .35cqw dashed #c49a5d; background: transparent; padding: .6cqw 5cqw; outline: none; }
.hero-bubble input:focus-visible { border-bottom-style: solid; border-bottom-color: #9e692f; }
.pencil { position: absolute; right: 1cqw; top: 50%; transform: translateY(-50%); font-size: 4.2cqw; color: #b3854a; pointer-events: none; }
.gender { display: flex; gap: 1.6cqw; }
.gender button { display: inline-flex; align-items: center; gap: 1.2cqw; border: .3cqw solid #d8b77f; border-radius: 99cqw;
  background: #fff9ec; color: #6d4a2c; font: 500 3.3cqw/1 'Fira Sans', system-ui, sans-serif; padding: .7cqw 2.4cqw .7cqw .7cqw; cursor: pointer; }
.gender button img { width: 6.4cqw; height: 6.4cqw; border-radius: 50%; }
.gender button[aria-checked="true"] { background: #f1cf8a; border-color: #b07d3c; color: #3b2412;  }
.gender button:focus-visible { outline: .5cqw solid #9e692f; outline-offset: .4cqw; }
/* Горизонтальное окно: облачко слева от книги, над ней остаётся только логотип. */
@media (orientation: landscape) {
  .hero-bubble { left: auto; right: 101%; bottom: auto; top: 26%; transform: none; width: 56%; }
  .hero-bubble::after { left: auto; right: -2.2cqw; top: 46%; bottom: auto; transform: rotate(-45deg); }
}

/* Reserve room for the whole composition, including the bubble outside the book. */
@media (orientation: landscape) {
  .hero .stage { width: min(100%, calc(var(--hero-h) * 1.05), 880px,
    calc((100vw - 32px) / 2.14 / var(--book-scale, .7))); }
}
@media (orientation: portrait) and (min-width: 500px) {
  .hero .stage { width: min(100%, calc(var(--hero-h) * 1.05), 880px,
    calc((var(--hero-h) - 200px) / 1.15 / var(--book-scale, .7))); }
}

/* Ночная часть страницы */
.night { position: relative; isolation: isolate; overflow: clip; color: var(--cream); font-family: 'Fira Sans', system-ui, sans-serif;
  background-color: var(--night);
  background-image: url('night-stars.svg'), linear-gradient(#1c130e, #151426 220px, var(--night));
  background-position: left top;
  background-size: 800px 900px, 100% 520px;
  background-repeat: repeat, no-repeat; }
/* A viewport-sized sky stays behind the sections; it takes no space in the layout. */
.sky-layer { position: sticky; top: 0; height: 0; z-index: -1; pointer-events: none; }
.sky-layer canvas { display: block; width: 100%; height: 100dvh; }
.night.has-live-sky { background-image: linear-gradient(#1c130e, #151426 220px, var(--night));
  background-size: 100% 520px; background-repeat: no-repeat; }

.sec { position: relative; padding: clamp(44px, 5.5vw, 76px) 20px; }
.sec h2 { font-family: Lora, Georgia, serif; font-weight: 600; color: var(--gold); font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.1; text-align: center; margin: 0 auto 16px; max-width: 920px;  letter-spacing: -.01em; }
.lead { text-align: center; max-width: 660px; margin: 0 auto 36px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--muted); }

/* Лента страниц */
.film-wrap { position: relative; margin: 0 -20px; }
.film { display: flex; align-items: flex-start; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px max(20px, calc(50vw - 600px)) 18px;
  scrollbar-width: thin; scrollbar-color: #e2bd7a55 transparent; }
.film img { flex: 0 0 auto; width: min(82vw, 760px); height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 18px; scroll-snap-align: center;
   }
.film-arrow { display: none; }
@media (min-width: 768px) {
  .film-arrow:not([hidden]) { display: grid; place-items: center; position: absolute; top: calc(50% - 8px); transform: translateY(-50%);
    width: 52px; height: 52px; padding: 0; border: 1px solid var(--gold); border-radius: 50%; background: #171829; color: var(--gold); cursor: pointer; }
  .film-previous { left: 24px; }
  .film-next { right: 24px; }
  .film-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .film-arrow:disabled { color: #827d89; border-color: #827d89; cursor: default; }
  .film-arrow:hover:not(:disabled) { background: #353044; }
  .film-arrow:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
}

/* Полки по поводам */
.shelves { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 38px; }
.shelf h3 { font: 500 clamp(20px, 2vw, 26px)/1.2 Lora, Georgia, serif; color: #fff0cb; margin: 0 0 14px 4px; }
.books { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.6vw, 22px); padding: 0 clamp(8px, 1.4vw, 18px) 22px; }
.books::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; border-radius: 4px;
  background: linear-gradient(#a06a3c, #6b4326 60%, #4a2d19);  }
.books figure { position: relative; margin: 0; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden;  transform-origin: bottom; }
.books figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.books figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22% 8% 7%; text-align: center; color: #fff;
  font: 700 clamp(11px, 1.25vw, 16px)/1.15 'Fira Sans', system-ui, sans-serif;
  background: linear-gradient(transparent, #0008 45%, #000b); }
@media (max-width: 700px) {
  .books { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 34vw; overflow-x: auto; scroll-snap-type: x mandatory;
    background: linear-gradient(#a06a3c, #6b4326 60%, #4a2d19) left bottom / 100% 18px no-repeat local; scrollbar-width: none; }
  .books::after { display: none; }
  .books figure { scroll-snap-align: start; }
}

/* Разделы «картинка + текст» */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; max-width: 1120px; margin: 0 auto; }
.split.reverse .media { order: 2; }
.split h2, .split p { text-align: left; margin-left: 0; }
.split .copy p { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--muted); margin: 0 0 18px; }
.media { position: relative; }
.media > img { width: 100%; height: auto; border-radius: 20px;  display: block; }
.wave { position: absolute; left: 8%; right: 8%; bottom: 7%; width: 84%;  }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; font-size: 17px; color: var(--cream); }
.ticks li::before { content: '✦'; position: absolute; left: 4px; color: var(--gold); }
.media.phone { justify-self: center; width: min(300px, 70vw); }
.media.phone > img { border-radius: 34px;  }
@media (max-width: 800px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.reverse .media { order: 0; }
  .split h2 { text-align: center; }
}

/* Честные условия */
.tiles { max-width: 1120px; margin: 0 auto 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { position: relative; background: linear-gradient(#f9f0da, #f1e2c1); color: var(--ink); border-radius: 18px; padding: 22px 20px 24px;
  display: flex; flex-direction: column; gap: 8px;  }
.tile b { font: 600 21px/1.2 Lora, Georgia, serif; color: #4a2c16; }
.tile span { font-size: 16px; line-height: 1.45; color: #6b4e33; }
.tile.cat { padding-top: 76px; }
.tile.cat img { height: auto; position: absolute; top: -34px; left: 12px; width: 108px;  }
.premium { margin-top: 10px; }
.premium b { color: var(--gold); font-weight: 600; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } .tile.cat { padding-top: 22px; padding-left: 116px; } .tile.cat img { height: auto; top: 50%; transform: translateY(-50%); width: 96px; } }

/* Финал */
.final { text-align: center; padding-bottom: 80px; }
.sleepy { height: auto; width: 150px; margin: 0 auto 8px; display: block;  }
.install { display: flex; justify-content: center; align-items: center; gap: 28px; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 30px; border-radius: 99px;
  background: linear-gradient(#ffe2a4, #eab964); color: #3b2412; font: 600 19px/1 'Fira Sans', system-ui, sans-serif; text-decoration: none;
   }
.qr { display: flex; align-items: center; gap: 12px; color: var(--muted); text-align: left; font-size: 14px; line-height: 1.35; }
.qr img { width: 92px; height: 92px; padding: 6px; border-radius: 12px; background: white; }
@media (hover: none) { .qr { display: none; } }

/* Ритм новинок: неделя, где вторник и пятница приносят новую книгу */
.sec.cadence { padding-top: 64px; }
.scroll-cue { position: absolute; left: 50%; top: 8px; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%;
  display: grid; place-items: center; background: #1a1d3acc; border: 1px solid #ffd79a88;  z-index: 2; }
.scroll-cue span { width: 12px; height: 12px; border-right: 2.5px solid var(--gold); border-bottom: 2.5px solid var(--gold); transform: translateY(-3px) rotate(45deg); }
@media (prefers-reduced-motion: no-preference) { .scroll-cue { animation: cue 2.4s ease-in-out infinite; } }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
.cadence-grid { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: clamp(24px, 4vw, 56px); align-items: start; max-width: 1120px; margin: 0 auto; }
.cadence .copy h2 { text-align: left; margin-left: 0; }
.cadence .copy p { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--muted); margin: 0; }
.week { display: grid; grid-template-columns: 1fr 3fr 1fr 1fr 3fr 1fr 1fr; gap: clamp(6px, 1vw, 12px); align-items: start; }
.day { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.day b { font: 600 14px/1 'Fira Sans', system-ui, sans-serif; letter-spacing: .04em; color: #a79fc4; text-transform: uppercase; }
.day.new b { color: var(--gold); }
.day i { width: 100%; aspect-ratio: 1 / 1.9; margin-top: 18%; border-radius: 99px; background: #ffffff08; border: 1px solid #ffffff14; position: relative; }
.day i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border-right: 3px solid #b4a172; transform: rotate(-35deg); }
.day figure { position: relative; margin: 0; width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; overflow: visible; }
.day figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;  }
.day figure figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30% 8% 8%; border-radius: 0 0 12px 12px; text-align: center; color: #fff;
  font: 700 clamp(10px, 1.1vw, 15px)/1.15 'Fira Sans', system-ui, sans-serif;  background: linear-gradient(transparent, #000a 50%, #000c); }
.badge { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); white-space: nowrap; padding: 6px 12px; border-radius: 99px;
  background: linear-gradient(#ffe6ab, #f0bf6a); color: #3b2412; font: 700 clamp(11px, 1.05vw, 14px)/1 'Fira Sans', system-ui, sans-serif;  }
@media (max-width: 800px) {
  .cadence-grid { grid-template-columns: minmax(0, 1fr); }
  .cadence .copy h2, .cadence .copy p { text-align: center; }
  .day b { font-size: 12px; }
  .day i::after { width: 10px; height: 10px; margin: -5px 0 0 -5px;  }
  .badge { padding: 5px 8px; top: -10px; }
}

/* Пол библиотеки плавно уходит в ночную часть страницы; книга остаётся над затемнением. */
.gift-page.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14%; z-index: -1;
  background: linear-gradient(#1c130e00, #1c130e); pointer-events: none; }

@media (max-width: 800px), (pointer: coarse) { .qr { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.night .film img { outline: 2px solid #806c4d; }
.night .media > img { outline: 2px solid #6d6047; }
.night .media.phone > img { outline: 10px solid #1d1a28; }
.night .day figure img { outline: 2px solid #a58a61; }
