/* motion.css — движение для лендингов. Пара к motion.js.
 * Скрытые начальные состояния действуют только под html.js: без скрипта страница видна целиком.
 * html.js ставит строчка в <head> (см. README), motion.js ставит html.motion-on, ?static и
 * «уменьшить движение» в системе ставят html.motion-static — всё сразу в конечном виде. */

/* ---------- заголовок по словам и буквам ---------- */
.lp-w { display: inline-block; vertical-align: top; clip-path: inset(-0.25em -0.08em -0.3em -0.08em); }
.lp-wi, .lp-c { display: inline-block; transform: none; will-change: transform; }
.lp-wi { transition: transform 1s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i, 0) * 70ms + var(--d, 0ms)); }
.lp-c { transition: transform .9s cubic-bezier(.16, 1, .3, 1), opacity .9s ease; transition-delay: calc(var(--i, 0) * 28ms + var(--d, 0ms)); }
.js [data-split]:not(.is-in) .lp-wi { transform: translateY(135%) rotate(4deg); }
.js [data-split]:not(.is-in) .lp-c { transform: translateY(120%); opacity: 0; }

/* ---------- проявление блоков ---------- */
.js [data-reveal] { transition: opacity .9s ease, transform 1.1s cubic-bezier(.16, 1, .3, 1), clip-path 1.2s cubic-bezier(.7, 0, .2, 1); transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(48px); }
.js [data-reveal="fade"]:not(.is-in) { transform: none; }
.js [data-reveal="scale"]:not(.is-in) { transform: scale(.9); }
.js [data-reveal="left"]:not(.is-in) { transform: translateX(-80px); }
.js [data-reveal="right"]:not(.is-in) { transform: translateX(80px); }
.js [data-reveal="tilt"]:not(.is-in) { transform: translateY(60px) rotate(-6deg); }
.js [data-reveal="clip"] { clip-path: inset(0 0 0 0); }
.js [data-reveal="clip"]:not(.is-in) { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); }
.js [data-reveal="curtain"] { clip-path: inset(0 0 0 0); }
.js [data-reveal="curtain"]:not(.is-in) { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); }

/* ---------- бегущая строка ---------- */
[data-marquee] { overflow: hidden; white-space: nowrap; }
.lp-mq-skew { display: block; transform: skewX(var(--skew, 0deg)); transition: transform .3s ease-out; }
.lp-mq-track { display: inline-flex; align-items: center; animation: lp-mq var(--mq-dur, 30s) linear infinite; }
[data-marquee="reverse"] .lp-mq-track { animation-direction: reverse; }
@keyframes lp-mq { to { transform: translateX(-50%); } }

/* ---------- сцена «вбок» ---------- */
[data-scene="horizontal"] { position: relative; }
[data-scene="horizontal"] .lp-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
[data-scene="horizontal"] .track { display: flex; width: max-content; will-change: transform; }
[data-scene="horizontal"] .track > * { flex: 0 0 auto; }

/* ---------- стопка карточек ---------- */
[data-scene="stack"] > * { position: sticky; top: calc(var(--stack-top, 12vh) + var(--i, 0) * var(--stack-step, 18px)); transform-origin: 50% 0; transform: scale(var(--s, 1)); filter: brightness(var(--b, 1)); }

/* ---------- полосы-аккордеон ---------- */
[data-scene="strips"] { display: flex; gap: var(--strip-gap, 10px); height: var(--strip-h, clamp(380px, 62vh, 660px)); }
[data-scene="strips"] > * { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; transition: flex-grow .7s cubic-bezier(.7, 0, .2, 1); cursor: pointer; }
[data-scene="strips"] > .is-open { flex-grow: var(--strip-open, 5); cursor: default; }
[data-scene="strips"] > * .strip-body { opacity: 0; transition: opacity .4s ease; }
[data-scene="strips"] > .is-open .strip-body { opacity: 1; transition-delay: .35s; }

/* ---------- свой курсор ---------- */
.lp-cursor { position: fixed; left: 0; top: 0; z-index: 9999; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none; transition: width .25s ease, height .25s ease, margin .25s ease; }
.lp-cursor.is-big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
@media (pointer: coarse) { .lp-cursor { display: none; } }

/* ---------- заставка ---------- */
[data-preloader] { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: flex-end; justify-content: flex-start; transition: clip-path .9s cubic-bezier(.7, 0, .2, 1); clip-path: inset(0 0 0 0); }
[data-preloader].is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
html:not(.js) [data-preloader] { display: none; }

/* ---------- полоса прогресса прокрутки ---------- */
[data-progress] { transform-origin: 0 50%; transform: scaleX(var(--scroll, 0)); }

/* ---------- узкий экран и снимки: сцены раскладываются обычным потоком ---------- */
@media (max-width: 760px) {
  [data-scene="horizontal"] { height: auto !important; }
  [data-scene="horizontal"] .lp-pin { position: static; height: auto; overflow: visible; display: block; }
  [data-scene="horizontal"] .track { width: auto; flex-direction: column; transform: none !important; }
  [data-scene="strips"] { flex-direction: column; height: auto; }
  [data-scene="strips"] > * { flex: none; }
  [data-scene="strips"] > * .strip-body { opacity: 1; }
}
.motion-static [data-scene="horizontal"] { height: auto !important; }
.motion-static [data-scene="horizontal"] .lp-pin { position: static; height: auto; overflow: visible; display: block; }
.motion-static [data-scene="horizontal"] .track { width: auto; flex-wrap: wrap; transform: none !important; }
.motion-static [data-scene="stack"] > * { position: relative; top: auto; transform: none; filter: none; }
.motion-static [data-preloader] { display: none; }
.motion-static .lp-mq-track { animation-play-state: paused; }
.motion-static [data-reveal], .motion-static [data-split] .lp-wi, .motion-static [data-split] .lp-c { transition: none !important; }
/* режим снимков: появление сразу конечное, сцены и переходы от прокрутки работают */
.motion-shot [data-reveal], .motion-shot [data-split] .lp-wi, .motion-shot [data-split] .lp-c { transition: none !important; }
.motion-shot [data-preloader] { display: none; }
.motion-shot .lp-mq-track { animation-play-state: paused; }
