/* Блоки 0–5: шапка+главный экран, миссия, «Поможем…», шаги, книга, призыв. Значения из Figma:
   по умолчанию макет 1440, при ширине окна >=1920 — макет 1920. */
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { display: block; }

/* x = «сколько осталось до 1920»: 480px на ≤1440, 0 на ≥1920; значения 1440→1920 интерполируются через var(--x) */
:root { --x: clamp(0px, 1920px - 100vw, 480px); }
@media (max-width: 1439.98px) { :root { --x: 480px; } }

/* общие */
.frame { position: relative; left: 50%; width: 1440px; height: 100%; margin-left: -720px; }
.frame--fluid { left: 0; width: 100%; margin-left: 0; }
.btn { transition: background-color .25s, color .25s, border-color .25s, filter .25s; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 32px; border-radius: 20px; font-weight: 600; font-size: 18px; line-height: 1.123; white-space: nowrap; overflow: hidden; }
.btn--accent { background: #ec642a; color: #fff; }
.btn--sand { background: #ffd7a6; color: #000; }
.btn--dark { background: #1e100d; color: #fff; }
.btn--line { border: 2px solid #fff; color: #fff; }
.btn--accent:hover, .btn--accent:focus-visible { background: #d4521b; }
.btn--sand:hover, .btn--sand:focus-visible { background: #ffc785; }
.btn--dark:hover, .btn--dark:focus-visible { background: #3b221b; }
.btn--line:hover, .btn--line:focus-visible { background: #fff; color: #1e100d; }
.btn:focus-visible { outline: 2px solid #ffd7a6; outline-offset: 3px; }
html { scroll-behavior: smooth; }
section, footer { scroll-margin-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* reveal-анимация (включается классом js на html) */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease var(--d, 0s), transform .8s ease var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .btn.reveal { transition: opacity .8s ease var(--d, 0s), transform .8s ease var(--d, 0s), background-color .25s, color .25s, border-color .25s; }
@media (prefers-reduced-motion: reduce) { .js .reveal, .js .btn.reveal { opacity: 1; transform: none; transition: none; } }

/* уведомление об успешной отправке */
.toast { position: fixed; left: 50%; top: 110px; z-index: 200; transform: translate(-50%, -12px); padding: 16px 28px; border-radius: 16px; background: #2e9e57; color: #fff; font-weight: 600; font-size: 18px; line-height: 1.2; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease, transform .35s ease, visibility 0s .35s; }
.toast.is-shown { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .35s ease, transform .35s ease; }

/* 0 — шапка + главный экран */
#hero { position: relative; height: 884px; background: #1e100d; overflow: hidden; }
.hero__card { position: absolute; left: 40px; top: 90px; width: calc(100% - 80px); height: 794px; border-radius: 32px; overflow: hidden; }
.hero__photo { position: absolute; left: calc(var(--x) * -0.12292); top: calc(-116.49px + var(--x) * 0.14688); width: calc(100% + var(--x) * 0.5); height: auto; max-width: none; }
.header { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 90px; overflow: hidden; background: rgba(30, 16, 13, 0.4); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.header .frame { height: 90px; }
.header__logo { position: absolute; left: 40px; top: calc(50% + 0.18px); transform: translateY(-50%); width: 167px; height: 38.352px; }
.header__logo img { width: 100%; height: 100%; }
.header__menu a { transition: color .25s, opacity .25s; }
.header__menu a:hover, .header__menu a:focus-visible { color: #ffd7a6; }
.header__logo { transition: opacity .25s; }
.header__logo:hover { opacity: .8; }
.header__menu { position: absolute; left: calc(50% + 0.5px); top: calc(50% + 0.5px); transform: translate(-50%, -50%); display: flex; gap: 40px; align-items: center; font-weight: 500; font-size: 16px; line-height: 1.123; color: #fff; white-space: nowrap; }
.header__cta { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); }
.hero__text { position: absolute; left: calc(110px - var(--x) * 0.05313); top: calc(160px - var(--x) * 0.00417); width: 1063px; display: flex; flex-direction: column; gap: 80px; align-items: flex-start; color: #fff; }
.hero__head { display: flex; flex-direction: column; gap: 24px; width: 100%; }
.hero__title { font-weight: 900; font-size: 70px; line-height: 1; }
.hero__lead { font-weight: 500; font-size: 24px; line-height: 1.2; width: 686.67px; }
.hero__buttons { display: flex; gap: 16px; align-items: center; width: 506px; }
.hero__buttons .btn { flex: 1 0 0; min-width: 1px; }

/* 1 — миссия */
#mission { position: relative; height: 884px; background: #1e100d url("../assets/img/mission-bg.svg") center top / 1920px 884px no-repeat; color: #fff; text-align: center; }
.mission__stack { position: absolute; left: 50%; top: calc(50% - 80px); transform: translate(-50%, -50%); width: 822px; display: flex; flex-direction: column; align-items: center; gap: 72px; }
.mission__label { width: 204px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mission__star { width: 32px; height: 32px; }
.mission__label-text { font-weight: 600; font-size: 24px; line-height: 1.2; }
.mission__body { display: flex; flex-direction: column; align-items: center; gap: 25px; width: 100%; line-height: 1.2; }
.mission__title { font-weight: 600; font-size: 40px; width: calc(850px - var(--x) * 0.02292); }
.mission__text { font-weight: 400; font-size: 18px; width: 530px; }

/* 2 — «Поможем сделать…» */
#for-whom { height: 923px; background: #ffeeda; }
.for-whom__title { position: absolute; left: 40px; top: 100px; width: 1360px; font-weight: 900; font-size: 52px; line-height: 1; color: #1e100d; }
.for-whom__cards { position: absolute; left: 40px; top: 192px; width: 1360px; height: 631px; display: flex; gap: 24px; }
.card { position: relative; flex: 1 0 0; min-width: 1px; height: 100%; padding: 24px; border-radius: 32px; background: #ffd7a6; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; color: #fff; }
.card__photo { position: absolute; max-width: none; object-fit: cover; }
.card__shade { position: absolute; left: calc(50% + 0.67px); transform: translateX(-50%); top: 394.21px; width: 873.806px; height: 375.559px; background: #1e100d; filter: blur(125px); }
.card__title { position: relative; font-weight: 900; font-size: 32px; line-height: 1.1; }
.card__text { position: relative; font-weight: 400; font-size: 16px; line-height: 1.3; }
.card--past .card__photo { left: -41.5px; top: -36.46px; width: 506px; height: 678px; }
.card--memories .card__photo { left: -50.83px; top: -84.46px; width: 534px; height: 715px; }
.card--memories .card__shade { left: calc(50% + 1px); }
.card--memories .card__text { width: 374.667px; }
.card--children .card__photo { left: -77.17px; top: -140.46px; width: 576px; height: 771px; }
.card--children .card__shade { left: calc(50% + 0.33px); }

/* 3 — шаги */
#how { height: 1995px; background: #ffeeda; }
.how__abs { position: absolute; }
.how__title { left: 38px; top: 100px; font-weight: 900; font-size: 52px; line-height: 1; color: #1e100d; white-space: nowrap; }
.how__text { font-weight: 400; font-size: 18px; line-height: 28px; color: #393939; }
.how__step { font-weight: 600; font-size: 28px; line-height: 28px; color: #000; white-space: nowrap; }
.how__badge { background: #ec642a; border-radius: 24px; display: flex; align-items: center; justify-content: center; }
.how__badge img { width: 24px; height: 24px; }
.how__shot { max-width: none; }

/* 4 — книга */
#book { height: 1034px; background: #ffeeda; }
.book__row { position: absolute; left: 39.5px; top: 100px; width: 1359.5px; display: flex; align-items: center; justify-content: space-between; }
.book__cover { width: 626.47px; height: 833.767px; border-radius: 32px; overflow: hidden; flex: none; }
.book__cover img { width: 100%; height: 100%; }
.book__col { width: 663px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 66px; }
.book__head { display: flex; flex-direction: column; gap: 13px; width: 100%; }
.book__title { font-weight: 900; font-size: 52px; line-height: 1; color: #1e100d; }
.book__lead { font-weight: 400; font-size: 18px; line-height: 28px; color: #393939; }
.book__list { display: flex; flex-direction: column; gap: 17px; width: 100%; margin: 0; padding: 0; list-style: none; }
.book__item { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 400; font-size: 18px; line-height: 28px; color: #393939; }
.book__item img { width: 32px; height: 32px; flex: none; }
.book__item span { width: 562px; }
.book__btn { width: 357px; }

/* 5 — призыв с голосом */
#cta { position: relative; height: 1034px; background: #1e100d url("../assets/img/cta-bg.png") center top / 1920px 1034px no-repeat; color: #fff; }
.cta__text { position: absolute; left: 40px; top: 100px; width: 853px; display: flex; flex-direction: column; gap: 71px; align-items: flex-start; }
.cta__head { display: flex; flex-direction: column; gap: 27px; width: 100%; }
.cta__title { font-weight: 900; font-size: 52px; line-height: 1; }
.cta__lead { font-weight: 400; font-size: 18px; line-height: 28px; width: 517px; }
.cta__btn { width: 308px; }

/* шире 1920: фон блоков с графикой растягивается на всю ширину (пропорции сохраняются, лишнее по высоте обрезается) */
@media (min-width: 1921px) {
  #mission, #cta { background-size: 100% auto; background-position: center; }
}

/* Сборка иллюстраций (#how, #subscribe): слои появляются по очереди и складываются в целую картинку */
.anim-layer { position: absolute; max-width: none; height: auto; display: block; }
.sub__anim { aspect-ratio: 1321 / 1056; height: auto !important; }
.js .anim-layer { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--r, 0deg)) scale(var(--sc, .92)); transition: opacity .7s ease, transform 1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * .2s + .1s); }
.js .is-visible .anim-layer, .js .anim-layer.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .anim-layer { opacity: 1; transform: none; transition: none; } }

/* Общие анимации (transform/opacity; reduced-motion и без JS — всё на месте) */
/* 1. заголовки по словам: js/landing.js оборачивает слова в .w, задержка --wi */
.js .reveal.wsplit { opacity: 1; transform: none; transition: none; }
.js .wsplit .w { display: inline-block; opacity: 0; transform: translateY(.45em); transition: opacity .7s ease calc(var(--wi, 0) * .06s + var(--d, 0s)), transform .8s cubic-bezier(.2, .8, .2, 1) calc(var(--wi, 0) * .06s + var(--d, 0s)); }
.js .wsplit.is-visible .w { opacity: 1; transform: none; }
/* 2. рост линий FAQ */
.js .faq__item:not(:last-child)::after { transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1) calc(var(--d, 0s) + .25s); }
.js .faq__item.is-visible:not(:last-child)::after { transform: none; }
/* 4. «дыхание» графики фона миссии и #cta (десктоп): фон вынесен в ::after */
@keyframes breathe { from { transform: scale(1) translateY(0); } to { transform: scale(1.045) translateY(-10px); } }
@media (min-width: 1024px) {
  #mission, #cta { overflow: hidden; background-image: none; }
  #mission::after, #cta::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: no-repeat center top / 1920px 884px; animation: breathe 12s ease-in-out infinite alternate; will-change: transform; }
  #mission::after { background-image: url("../assets/img/mission-bg.svg"); }
  #cta::after { background-image: url("../assets/img/cta-bg.png"); background-size: 1920px 1034px; animation-duration: 15s; }
  .mission__stack, #cta .frame { z-index: 1; }
}
@media (min-width: 1921px) {
  #mission::after { background-size: 100% auto; background-position: center; }
  #cta::after { background-size: 100% auto; background-position: center; }
}
/* 5–6. hover-подъём кнопок и карточек (после появления: .is-settled снимает задержку reveal) */
.js .reveal.is-settled { transition: opacity .3s ease, transform .3s ease, background-color .25s, color .25s, border-color .25s, box-shadow .3s; transition-delay: 0s; }
.card__photo { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) {
  .btn.is-settled:hover, .btn.is-settled:focus-visible, .btn:not(.reveal):hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(30, 16, 13, .28); }
  .card.is-settled:hover { transform: translateY(-8px); box-shadow: 0 18px 36px rgba(30, 16, 13, .22); }
  .card:hover .card__photo { transform: scale(1.06); }
}
@media (hover: hover) {
  .header .header__cta:hover, .header .header__cta:focus-visible { transform: translateY(-50%); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .wsplit .w, .js .faq__item:not(:last-child)::after { opacity: 1; transform: none; transition: none; }
  #mission::after, #cta::after { animation: none; }
  .btn:hover, .card:hover, .card:hover .card__photo { transform: none !important; }
}
