/* Движение лендинга. Значения — drafts/2026-10-06-landing-motion-spec.md.
   Контент виден без анимации: минимум opacity .35, прокрутка — только view()/scroll(),
   заливка forwards, чтобы блок ниже экрана оставался в обычном виде. */
.lp { --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-scroll: cubic-bezier(.3, .5, .4, 1); --ease-press: cubic-bezier(.3, 1.4, .5, 1); --lp-rise: 14px; }

/* --- Фото неба на первом экране: слой под землёй и текстом, снизу растворяется в фон --- */
.lp .hero-sky::after {
  display: block; content: ""; position: absolute; inset: 0; height: auto; z-index: -1; transform: none;
  background: url("/static/img/hero-sky-1536.webp") center 58% / cover no-repeat;
  background-image: image-set(url("/static/img/hero-sky-960.webp") 1x, url("/static/img/hero-sky-1536.webp") 2x);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 96%); }
@media (min-width: 900px) { .lp .hero-sky::after { background-image: url("/static/img/hero-sky-1536.webp"); } }

/* пролёт самолёта: слева направо, без зеркала; без анимации его нет вовсе */
.lp .lp-flyby { display: none; }

@media (prefers-reduced-motion: no-preference) {

/* --- 2. Первый экран при загрузке --- */
@keyframes lp-in { from { translate: 0 var(--lp-rise); filter: blur(6px); opacity: .35; } }
.lp .hero-kicker { animation: lp-in .9s var(--ease-out) .05s backwards; }
.lp .lp-title    { animation: lp-in 1s var(--ease-out) .12s backwards; }
.lp .lp-sub      { animation: lp-in .9s var(--ease-out) .24s backwards; }
.lp .lp-cta      { animation: lp-in .9s var(--ease-out) .34s backwards; }
.lp .hero-thread { animation: lp-in .9s var(--ease-out) .46s backwards; }

@keyframes lp-rise-earth { from { translate: 0 48px; } }
.lp .hero-earth { animation: lp-rise-earth 1.8s var(--ease-out) backwards; }

@keyframes lp-draw { from { scale: 0 1; } }
@keyframes lp-plane { from { translate: -12px 0; opacity: .35; } }
.lp .hero-thread__line .line { transform-origin: left center; animation: lp-draw .7s var(--ease-out) .55s backwards; }
.lp .hero-thread__line .line:last-of-type { animation-delay: 1.15s; }
.lp .hero-thread__line .plane { animation: lp-plane .5s var(--ease-out) 1.1s backwards; }

/* табличка «N поездок · M лет» ставится как штамп; базовый transform не трогаем */
@keyframes lp-stamp { from { scale: 1.6; rotate: -7deg; opacity: .35; } }
.lp .hero-stamp { animation: lp-stamp .55s var(--ease-press) 1s backwards; }

/* фото: лёгкий наезд и проявление, как у motionsites (heroIn) */
@keyframes lp-photo-in { from { transform: scale(1.08); filter: brightness(.82) saturate(.9); } }
.lp .hero-sky::after { animation: lp-photo-in 2.4s var(--ease-out) backwards; }

/* пролёт: 26 с цикл, сам перелёт — первые 30%, первый раз после штампа */
.lp .lp-flyby { display: block; position: absolute; left: 0; top: 290px; width: 100%; height: 0; pointer-events: none;
  animation: lp-fly-x 26s linear 1.7s infinite backwards; }
.lp .lp-flyby__arc { position: absolute; left: 0; top: 0; display: block; animation: lp-fly-y 26s ease-in-out 1.7s infinite backwards; }
.lp .lp-flyby svg { display: block; width: 22px; height: 13px; fill: color-mix(in srgb, var(--text) 62%, transparent); rotate: -5deg; }
.lp .lp-flyby__arc::before { content: ""; position: absolute; right: 100%; top: 6px; width: 240px; height: 2px; border-radius: 2px;
  background: linear-gradient(to left, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)); }
@keyframes lp-fly-x { 0% { translate: -14vw 0; } 30%, 100% { translate: 112vw 0; } }
@keyframes lp-fly-y { 0% { translate: 0 14px; } 30%, 100% { translate: 0 -8px; } }

/* --- 3–4. Прокрутка --- */
@supports (animation-timeline: view()) {
  /* горизонт уходит медленнее текста */
  @keyframes lp-drift { to { transform: translateY(22%); } }
  .lp .hero-earth { animation: lp-rise-earth 1.8s var(--ease-out) backwards, lp-drift linear forwards;
    animation-timeline: auto, scroll(root); animation-range: normal, 0 90vh; }

  /* подъезжает только первый блок после шапки: на каждом блоке эффект утомляет */
  @keyframes lp-enter { from { transform: translateY(36px) scale(.985); } }
  .lp > .lp-hero + .lp-ch {
    animation: lp-enter linear forwards; animation-timeline: view(); animation-range: entry 0% entry 70%; }

  /* полосы и столбики не растут: рост только у цифр первого экрана */

  /* письмо превращается в строку поездки; задержки — удержанием в ключевых кадрах */
  .lp .lp-mail { view-timeline: --lp-mail block; }
  @keyframes lp-mail-msg { from { transform: translateY(-16px); } }
  @keyframes lp-mail-arrow { 0%, 25% { transform: scaleY(0); } }
  @keyframes lp-mail-row { 0%, 45% { transform: translateY(-24px) scale(.97); } }
  .lp .lp-mail .msg, .lp .lp-mail .arrow, .lp .lp-mail .row {
    animation: lp-mail-msg var(--ease-scroll) forwards; animation-timeline: --lp-mail; animation-range: entry 0% cover 42%; }
  .lp .lp-mail .arrow { animation-name: lp-mail-arrow; transform-origin: center top; }
  .lp .lp-mail .row { animation-name: lp-mail-row; }
}
}
