:root {
  /* Нейтрали с лёгким фиолетовым подтоном — сумерки, а не неон */
  --bg-deep: #0a0811;
  --bg: #0e0b16;
  --surface: #15121f;
  --raised: #1d1929;
  --line: rgba(239, 234, 247, 0.08);
  --line-2: rgba(239, 234, 247, 0.14);
  --text: #efeaf7;
  --text-2: #aba4bd;
  --muted: #8a8299;
  --accent: #b29bff;
  --accent-fill: #7254e8;
  --accent-fill-hover: #6646de;
  --accent-soft: rgba(178, 155, 255, 0.12);
  --lamp: #f2c37e;
  --light-btn: #f1ecfb;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Lora', Georgia, serif;
  --font-hand: 'Caveat', cursive;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --enter: 600ms;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p, figure { margin: 0; }
svg { flex-shrink: 0; }
button { font: inherit; color: inherit; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 16px; }

.handnote { font: 500 24px/1.1 var(--font-hand); color: var(--lamp); }
.handnote svg { display: block; width: 56px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 10px; border: 0;
  background: var(--raised); color: var(--text); font: 500 15px/1 var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover { background: #262136; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn--light { background: var(--light-btn); color: #15121f; box-shadow: none; }
.btn--light:hover { background: #ffffff; }
.btn--ghost { background: rgba(239, 234, 247, 0.1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgba(239, 234, 247, 0.16); }
.btn--accent { background: var(--accent-fill); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.btn--accent:hover { background: var(--accent-fill-hover); }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 8px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background-color 240ms var(--ease);
}
.header.is-solid {
  background: rgba(14, 11, 22, 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 500 16px/1 var(--font); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 15px; color: var(--text-2);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(239, 234, 247, 0.06); }
.burger { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(720px, 100svh, 960px);
  padding: calc(var(--header-h) + 96px) 0 192px;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%;
  animation: settle 2400ms var(--ease) both;
}
/* Мягкое затухание картинки в цвет страницы: слева под текст, снизу под плеер */
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 11, 22, 0.88) 0%, rgba(14, 11, 22, 0.55) 34%, rgba(14, 11, 22, 0) 62%),
    linear-gradient(0deg, var(--bg) 0%, rgba(14, 11, 22, 0) 36%),
    linear-gradient(180deg, rgba(14, 11, 22, 0.6) 0%, rgba(14, 11, 22, 0) 20%);
}
.hero__inner { position: relative; }
.hero__content { max-width: 720px; }
.hero h1 {
  font: 500 clamp(44px, 5vw, 72px)/1.04 var(--font-display);
  letter-spacing: -0.02em; text-wrap: balance; margin-bottom: 24px;
}
.hero__lead { font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 34rem; text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.perks { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 12px 24px; }
.perks li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.perks .i { width: 16px; height: 16px; color: var(--muted); }
.hero__note { position: absolute; left: 60%; top: 288px; width: 200px; transform: rotate(-6deg); }
.hero__note svg { margin: 4px 0 0 96px; }

@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }

[data-enter] { animation: rise var(--enter) var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 60ms); }
.hero__content > :nth-child(2) { --i: 1; }
.hero__content > :nth-child(3) { --i: 2; }
.hero__content > :nth-child(4) { --i: 3; }
.hero__content > :nth-child(5) { --i: 4; }
.hero__note { --i: 8; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Появление секций при скролле — включается только когда работает JS */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--enter) var(--ease), transform var(--enter) var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Result: плеер и сравнение ---------- */
.result { position: relative; z-index: 2; margin-top: -144px; }
.film__screen {
  position: relative; isolation: isolate; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 20px; background: var(--bg-deep);
  box-shadow: 0 40px 120px rgba(5, 3, 10, 0.7);
}
/* Тени сверху и снизу — в цвет страницы, чтобы на картинке читались титры и управление */
.film__screen::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 8, 17, 0.55) 0%, rgba(10, 8, 17, 0) 22%),
    linear-gradient(0deg, rgba(10, 8, 17, 0.85) 0%, rgba(10, 8, 17, 0) 34%);
}
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity 1200ms var(--ease); }
.scene.is-active { opacity: 1; }
/* Кадр клипа 16:9; на узких экранах (4:5) ниже он обрезается по бокам с фокусом на героине */
.scene__cam { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 16 / 9; translate: 0 -50%; }
.scene__cam > img, .scene__cam > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }


.film__head { position: absolute; z-index: 2; left: 28px; top: 24px; display: grid; gap: 4px; transition: opacity 300ms var(--ease); }
.film__kicker { font-size: 13px; color: var(--text-2); }
.film__title { font: 500 24px/1.2 var(--font-display); color: var(--text); }

.film__sub {
  position: absolute; z-index: 2; left: 50%; bottom: 88px; translate: -50% 0; width: min(720px, 100% - 48px);
  text-align: center; font-size: 19px; line-height: 1.45; color: #f6f2fb; text-wrap: balance;
  text-shadow: 0 1px 2px rgba(5, 3, 10, 0.8), 0 2px 16px rgba(5, 3, 10, 0.6);
}
.film__sub.is-new { animation: sub-in 700ms var(--ease) both; }
@keyframes sub-in { from { opacity: 0; transform: translateY(6px); } }

.film__big {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 80px; height: 80px; translate: -50% -50%;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgba(14, 11, 22, 0.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: scale(0.94);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms, background-color var(--fast) var(--ease);
}
.film__big svg { width: 28px; height: 28px; margin-left: 4px; fill: var(--text); }
.film__big:hover { background: rgba(14, 11, 22, 0.7); }
.film.is-paused .film__big { opacity: 1; visibility: visible; transform: none; }

.film__controls {
  position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
/* На устройствах с мышью управление прячется во время просмотра и возвращается при наведении */
@media (hover: hover) {
  .film:not(.is-paused) .film__screen:not(:hover, :focus-within) .film__controls { opacity: 0; transform: translateY(8px); }
  .film:not(.is-paused) .film__screen:not(:hover, :focus-within) .film__head { opacity: 0; }
}
.film__btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(239, 234, 247, 0.12); color: var(--text);
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.film__btn:hover { background: rgba(239, 234, 247, 0.2); }
.film__btn:active { transform: scale(0.96); }
.film__btn--play { background: var(--light-btn); color: #15121f; }
.film__btn--play:hover { background: #fff; }
.film__btn--play .i--play { fill: currentColor; }
.film__btn--play .i--play, .film.is-paused .film__btn--play .i--pause { display: none; }
.film.is-paused .film__btn--play .i--play { display: block; }
.film__time { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 88px; }
.film__scrub { position: relative; flex: 1; height: 24px; display: grid; align-items: center; }
.film__rail { position: relative; height: 4px; border-radius: 2px; background: rgba(239, 234, 247, 0.22); transition: transform var(--fast) var(--ease); }
.film__scrub:hover .film__rail { transform: scaleY(1.5); }
.film__fill { position: absolute; inset: 0; border-radius: 2px; background: var(--light-btn); transform-origin: left; transform: scaleX(var(--p, 0)); }
/* Метки глав на дорожке */
.film__rail i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(10, 8, 17, 0.8); }
.film__rail i:nth-of-type(1) { left: 25%; }
.film__rail i:nth-of-type(2) { left: 50%; }
.film__rail i:nth-of-type(3) { left: 75%; }
.film__scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.film__scrub:has(input:focus-visible) .film__rail { outline: 2px solid var(--accent); outline-offset: 4px; }
.film__screen:fullscreen { border-radius: 0; }

/* Главы под экраном */
.chapters { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.chapter {
  position: relative; width: 100%; display: grid; grid-template-columns: 88px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-content: center;
  padding: 8px 12px 8px 8px; border-radius: 14px; border: 0; background: none; text-align: left; cursor: pointer; overflow: hidden;
  transition: background-color 240ms var(--ease);
}
.chapter:hover { background: rgba(239, 234, 247, 0.04); }
.chapter.is-active { background: var(--surface); }
.chapter img { grid-row: 1 / 3; width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; opacity: 0.7; transition: opacity 240ms var(--ease); }
.chapter.is-active img, .chapter:hover img { opacity: 1; }
.chapter__meta { align-self: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter__name { align-self: start; font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 240ms var(--ease); }
.chapter.is-active .chapter__name { color: var(--text); }
.chapter__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }

.result__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; margin-top: 96px; }
.result__note { margin-top: 32px; transform: rotate(-4deg); width: max-content; }
.result__note svg { margin: 4px 0 0 112px; }

.compare {
  --pos: 58%;
  position: relative; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden;
  background: var(--surface); user-select: none;
}
.compare > img, .compare__sketch img { width: 100%; height: 100%; object-fit: cover; }
.compare__sketch { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; translate: -1px 0; background: var(--light-btn); pointer-events: none; }
.compare__handle::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; translate: -50% -50%;
  border-radius: 50%; background: var(--light-btn);
  /* стрелки ‹ › внутри ручки */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315121f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E");
  background-size: 20px; background-repeat: no-repeat; background-position: center;
  box-shadow: 0 4px 16px rgba(5, 3, 10, 0.4);
}
.compare__tag {
  position: absolute; top: 16px; padding: 4px 8px; border-radius: 6px; font-size: 13px;
  background: rgba(14, 11, 22, 0.64); color: var(--text); pointer-events: none;
}
.compare__tag--left { left: 16px; }
.compare__tag--right { right: 16px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Sections ---------- */
.section { padding: 128px 0; position: relative; }
.section--alt { background: linear-gradient(var(--bg), var(--bg-deep) 160px, var(--bg-deep) calc(100% - 160px), var(--bg)); }
.section__head { max-width: 600px; margin-bottom: 48px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head h2 { font: 500 clamp(32px, 3.6vw, 48px)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; margin-bottom: 16px; }
.section__head p:not(.eyebrow, .handnote) { color: var(--text-2); font-size: 17px; text-wrap: pretty; }
.result__grid .section__head { margin-bottom: 0; }

/* Pipeline: четыре кадра одной истории */
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.pipe { position: relative; }
.pipe:nth-child(2) { --i: 1; }
.pipe:nth-child(3) { --i: 2; }
.pipe:nth-child(4) { --i: 3; }
/* Карточки-демо: каждая показывает сам процесс своего шага */
.demo { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--surface); margin-bottom: 20px; isolation: isolate; }
.demo__fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo__chip, .demo__panel {
  position: absolute; left: 12px; right: 12px; z-index: 1; margin: 0; border-radius: 10px;
  background: rgba(14, 11, 22, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.demo__chip { top: 12px; padding: 8px 12px; font-size: 13px; line-height: 18px; color: var(--text); }
.demo__chip span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.demo__chip b { font-weight: 400; }
.demo__panel { bottom: 12px; padding: 8px; }

/* 01 · персонаж */
.demo--char .demo__fill { object-position: 62% 50%; }
.demo__shots { display: flex; align-items: center; gap: 8px; }
.demo__shots span { margin-left: 4px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.shot { flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--raised) no-repeat; animation: shot 6s var(--ease) infinite; }
.shot--1 { background-image: url(/assets/img/scene-2.webp); background-size: 500%; background-position: 77% 65%; }
.shot--2 { background-image: url(/assets/img/hero.webp); background-size: 500%; background-position: 87% 62%; animation-delay: 2s; }
.shot--3 { background-image: url(/assets/img/scene-3.webp); background-size: 400%; background-position: 78% 79%; animation-delay: 4s; }
@keyframes shot { 0%, 100% { opacity: 0.55; } 12%, 30% { opacity: 1; } 42% { opacity: 0.55; } }

/* 02 · кадр: промпт печатается, затем картинка проявляется сверху вниз из размытого шума */
.demo--gen .demo__fill { object-position: 70% 50%; }
.demo__noise { filter: blur(14px) saturate(0.6) brightness(0.6); transform: scale(1.1); }
.demo__reveal {
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 55%); mask-image: linear-gradient(180deg, #000 45%, transparent 55%);
  -webkit-mask-size: 100% 220%; mask-size: 100% 220%;
  -webkit-mask-position: 0 100%; mask-position: 0 100%;
  animation: gen-reveal 7s linear infinite;
}
@keyframes gen-reveal {
  0%, 30% { -webkit-mask-position: 0 100%; mask-position: 0 100%; opacity: 1; }
  78%, 94% { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; }
  100% { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 0; }
}
.demo__typed { display: block; clip-path: inset(0 100% 0 0); animation: gen-type 7s infinite; }
@keyframes gen-type {
  0% { clip-path: inset(0 100% 0 0); animation-timing-function: steps(30); }
  28%, 94% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
.demo__status { display: grid; gap: 8px; padding: 10px 12px; }
.demo__state { position: relative; height: 16px; font-size: 12px; line-height: 16px; }
.demo__state b { position: absolute; inset: 0; font-weight: 400; }
.demo__state b:first-child { color: var(--text-2); animation: gen-busy 7s infinite; }
.demo__state b:last-child { color: var(--text); opacity: 0; animation: gen-done 7s infinite; }
@keyframes gen-busy { 0%, 76% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes gen-done { 0%, 76% { opacity: 0; } 80%, 94% { opacity: 1; } 100% { opacity: 0; } }
.demo__progress { display: block; height: 4px; border-radius: 2px; background: rgba(239, 234, 247, 0.14); overflow: hidden; }
.demo__progress i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: left; animation: gen-progress 7s linear infinite; }
@keyframes gen-progress { 0%, 30% { transform: scaleX(0); } 78%, 94% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* 03 · оживление: клип и исходный кадр в углу */
.demo--anim .demo__fill { object-position: 50% 50%; }
.demo__source {
  position: absolute; z-index: 1; left: 12px; bottom: 12px; width: 44%; padding: 6px; border-radius: 10px;
  background: rgba(14, 11, 22, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.demo__source img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.demo__source span { display: block; padding: 6px 2px 0; font-size: 12px; line-height: 16px; color: var(--text-2); }

/* 04 · монтаж: превью переключается вместе с плей-хедом, цикл 8 с на 4 клипа */
.demo--edit { display: grid; grid-template-rows: 1fr auto; padding: 12px; gap: 12px; }
.demo__screen { position: relative; border-radius: 8px; overflow: hidden; background: #000; }
.demo__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: edit-show 8s linear infinite; }
.demo__screen img:nth-child(2), .demo__clips i:nth-child(2) { animation-delay: -6s; }
.demo__screen img:nth-child(3), .demo__clips i:nth-child(3) { animation-delay: -4s; }
.demo__screen img:nth-child(4), .demo__clips i:nth-child(4) { animation-delay: -2s; }
@keyframes edit-show { 0%, 22% { opacity: 1; } 28%, 94% { opacity: 0; } 100% { opacity: 1; } }
.demo__tracks { position: relative; display: grid; gap: 8px; padding: 8px; border-radius: 10px; background: var(--bg-deep); }
.demo__clips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; height: 32px; }
.demo__clips i { border-radius: 4px; background: center / cover no-repeat; animation: edit-clip 8s linear infinite; }
.demo__clips i:nth-child(1) { background-image: url(/assets/img/scene-1.webp); }
.demo__clips i:nth-child(2) { background-image: url(/assets/video/scene-2-poster.webp); }
.demo__clips i:nth-child(3) { background-image: url(/assets/img/hero.webp); }
.demo__clips i:nth-child(4) { background-image: url(/assets/img/scene-3.webp); }
@keyframes edit-clip { 0%, 22% { opacity: 1; } 28%, 94% { opacity: 0.45; } 100% { opacity: 1; } }
.demo__wave { width: 100%; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0.7; }
.demo__head { position: absolute; inset: 4px 8px; pointer-events: none; animation: edit-head 8s linear infinite; }
.demo__head::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; border-radius: 1px; background: var(--light-btn); }
@keyframes edit-head { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* Демо крутятся только на экране: класс ставит JS */
.demo:not(.is-live) *, .demo:not(.is-live) { animation-play-state: paused; }
.pipe:not(:last-child)::after {
  content: ''; position: absolute; top: 40%; right: -18px; width: 12px; height: 12px;
  border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); rotate: 45deg;
}
.pipe__num { display: block; font: 400 13px/1 var(--font-mono); color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.pipe > h3 { font-size: 18px; line-height: 1.3; margin-bottom: 8px; }
.pipe > p { color: var(--text-2); font-size: 15px; }



/* ---------- Program ---------- */
.program { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 4px; }
.steps li {
  counter-increment: step; position: relative; padding: 16px 16px 16px 64px; border-radius: 12px;
  cursor: default;
  transition: background-color 240ms var(--ease);
}
/* Номер шага в кружке, кружки соединены вертикальной линией */
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 12px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 500 14px/1 var(--font); font-variant-numeric: tabular-nums;
  background: var(--raised); color: var(--text-2);
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
.steps li.is-active { background: var(--surface); }
.steps li.is-active::before { background: var(--accent-fill); color: #fff; }
.steps h3 { font-size: 17px; line-height: 1.4; margin-bottom: 4px; color: var(--text-2); transition: color 240ms var(--ease); }
.steps li.is-active h3 { color: var(--text); }
.steps p { color: var(--text-2); font-size: 15px; }
/* Отрезок линии до следующего шага; у активного он заполняется, пока шаг не сменится */
.steps li:not(:last-child)::after {
  content: ''; position: absolute; left: 31px; top: 50px; bottom: -12px; width: 2px; border-radius: 1px;
  background: linear-gradient(var(--accent), var(--accent)) top / 100% 0% no-repeat, var(--line-2);
}
.steps li.is-active::after { animation: rail var(--step-ms, 4500ms) linear both; }
.steps.is-held li.is-active::after { animation-play-state: paused; }
@keyframes rail { to { background-size: 100% 100%, auto; } }

.program__art { position: relative; }
/* У фото ноутбука пустые поля по бокам — выводим их за колонку, чтобы сам ноутбук был крупнее */
@media (min-width: 1101px) { .devices { margin-left: -8%; } }
@media (min-width: 1360px) { .devices { margin-right: -8%; } }

/* Переключатель «Ноутбук / Телефон»: показываем одно устройство, второе гаснет на том же месте */
.device-note { margin: 0 auto 24px; max-width: 30em; text-align: center; font-size: 15px; color: var(--text); text-wrap: balance; }
.device-switch { display: flex; width: max-content; gap: 4px; margin: 0 auto 12px; padding: 4px; border-radius: 12px; background: var(--surface); }
.device-switch button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 8px;
  background: none; color: var(--text-2); font: 500 14px/1 var(--font); cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.device-switch button:hover { color: var(--text); }
.device-switch button[aria-pressed='true'] { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.device-switch .i { width: 16px; height: 16px; }
.devices { position: relative; display: grid; place-items: center; }
.devices > .laptop { width: 100%; }
.devices > .laptop, .devices > .phone { transition: opacity 400ms var(--ease), transform 400ms var(--ease), visibility 400ms; }
.devices[data-device='laptop'] > .phone, .devices[data-device='phone'] > .laptop { opacity: 0; visibility: hidden; transform: scale(0.96); }
.program__note { position: absolute; top: -40px; right: 0; transform: rotate(-4deg); z-index: 1; }

/* Ноутбук: фото + настоящий интерфейс поверх экрана.
   Координаты экрана — в процентах от картинки laptop.webp */
.laptop { position: relative; aspect-ratio: 3 / 2; --sx: 15.89%; --sy: 12.3%; --sw: 68.23%; --sh: 59.67%; }
.laptop.is-bare .laptop__img { display: none; }
.laptop.is-bare .editor { --sx: 0%; --sy: 0%; --sw: 100%; --sh: 100%; border-radius: 16px; box-shadow: 0 32px 80px rgba(5, 3, 10, 0.6); }
.laptop__img { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent); mask-image: radial-gradient(closest-side, #000 82%, transparent); mask-size: 120% 140%; mask-position: center; -webkit-mask-size: 120% 140%; -webkit-mask-position: center; }
.editor {
  position: absolute; left: var(--sx); top: var(--sy); width: var(--sw); height: var(--sh);
  container-type: size; overflow: hidden; background: #0c0a12; border-radius: 4px;
}
/* cq-единицы считаются от .editor, поэтому вся вёрстка — во внутренней обёртке */
.editor__ui {
  width: 100%; height: 100%; display: grid; grid-template-rows: 7cqh 1fr;
  font: 400 2.1cqw/1.2 var(--font); color: var(--text-2);
}
.editor__top { display: flex; align-items: center; gap: 3cqw; padding: 0 2.4cqw; border-bottom: 1px solid var(--line); background: #13101b; }
.editor__file { color: var(--text); font-weight: 500; }
.editor__tabs { display: flex; gap: 0.6cqw; }
.editor__tabs b { padding: 0.6cqw 1.2cqw; border-radius: 0.6cqw; font-weight: 400; transition: background-color 400ms var(--ease), color 400ms var(--ease); }
.editor__tabs b.is-on { background: var(--raised); color: var(--text); }
.editor__export { margin-left: auto; padding: 0.8cqw 1.8cqw; border-radius: 0.8cqw; background: var(--accent-fill); color: #fff; }

/* Экраны программы: по одному на шаг курса, переключаются вместе со шагом */
.editor__views { position: relative; min-height: 0; }
.view { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 500ms var(--ease), visibility 500ms; }
.editor[data-view='0'] .view--setup, .editor[data-view='1'] .view--gen,
.editor[data-view='2'] .view--anim, .editor[data-view='3'] .view--edit { opacity: 1; visibility: visible; }

/* 1 · настройки */
.view--setup { display: grid; grid-template-columns: 30% 1fr; }
.setup__tools { display: grid; align-content: start; gap: 0.8cqw; padding: 1.8cqw; border-right: 1px solid var(--line); background: #110e18; }
.tool { display: flex; align-items: center; gap: 1.2cqw; padding: 1cqw 1.2cqw; border-radius: 0.8cqw; }
.tool i { width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--muted); }
.tool.is-on { background: var(--raised); color: var(--text); }
.tool.is-on i { background: var(--accent); }
.setup__params { display: grid; grid-template-rows: auto auto auto auto 1fr; gap: 1.8cqw; padding: 1.8cqw 2.4cqw; min-height: 0; }
.param { display: grid; gap: 1cqw; align-content: start; min-height: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 0.8cqw; }
.opt { padding: 0.7cqw 1.6cqw; border-radius: 0.6cqw; background: var(--raised); font-style: normal; }
.opt.is-on { background: var(--accent-fill); color: #fff; }
.range { position: relative; height: 0.8cqw; margin: 1cqw 0; border-radius: 0.4cqw; background: var(--raised); }
.range__fill { position: absolute; inset: 0 28% 0 0; border-radius: inherit; background: var(--accent); }
.range::after { content: ''; position: absolute; left: 72%; top: 50%; width: 2.4cqw; height: 2.4cqw; translate: -50% -50%; border-radius: 50%; background: var(--light-btn); }
.param--sample { grid-template-rows: auto 1fr; }
.sample { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqw; min-height: 0; }
.sample img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 0.8cqw; }

/* 2 · генерация */
.view--gen { display: grid; grid-template-rows: auto 1fr; gap: 1.8cqw; padding: 1.8cqw; }
.gen__prompt { display: flex; align-items: center; gap: 1.6cqw; padding: 1cqw 1cqw 1cqw 1.8cqw; border-radius: 1cqw; background: var(--raised); color: var(--text); }
.gen__prompt span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen__prompt b { padding: 0.8cqw 1.8cqw; border-radius: 0.8cqw; background: var(--accent-fill); color: #fff; font-weight: 500; }
.gen__grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1.2cqw; min-height: 0; }
.res { position: relative; border-radius: 0.8cqw; overflow: hidden; background: var(--raised); }
.res img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.res.is-picked::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.4cqw var(--accent); }
.editor[data-view='1'] .res { animation: res-in 600ms var(--ease) both; }
.editor[data-view='1'] .res:nth-child(2) { animation-delay: 150ms; }
.editor[data-view='1'] .res:nth-child(3) { animation-delay: 300ms; }
.editor[data-view='1'] .res:nth-child(4) { animation-delay: 450ms; }
@keyframes res-in { from { opacity: 0; transform: scale(0.96); } }

/* 3 · анимация */
.view--anim { display: grid; grid-template-columns: 1fr auto 1.5fr; grid-template-rows: auto 1fr auto; align-items: center; gap: 1.8cqw; padding: 1.8cqw 2.4cqw; }
.anim__prompt { grid-column: 1 / -1; align-self: start; }
.anim__prompt span { white-space: normal; }
.view--anim figure { margin: 0; display: grid; gap: 1cqw; }
.view--anim img, .view--anim video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0.8cqw; background: #000; }
.view--anim figcaption { color: var(--text-2); }
.anim__arrow { width: 3cqw; height: 3cqw; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.anim__params { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 1.2cqw 3.6cqw; }

/* Промпт печатается при открытии экрана, результат появляется следом */
.editor[data-view='1'] .gen__prompt span, .editor[data-view='2'] .anim__prompt span { animation: type-in 1400ms steps(36) both; }
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.editor[data-view='1'] .res:nth-child(1) { animation-delay: 1400ms; }
.editor[data-view='1'] .res:nth-child(2) { animation-delay: 1550ms; }
.editor[data-view='1'] .res:nth-child(3) { animation-delay: 1700ms; }
.editor[data-view='1'] .res:nth-child(4) { animation-delay: 1850ms; }
.editor[data-view='2'] .anim__out { animation: res-in 600ms var(--ease) 1400ms both; }

/* Телефон перед ноутбуком справа: тот же шаг в мобильной версии */
/* Фото телефона с прозрачным фоном + интерфейс поверх экрана; координаты экрана — в процентах от phone.webp */
.phone { position: absolute; z-index: 2; left: 50%; top: 50%; height: 96%; aspect-ratio: 665 / 1354; translate: -50% -50%; }
.phone__img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 24px 40px rgba(5, 3, 10, 0.7)); }
.phone__screen {
  position: absolute; left: 4.96%; top: 1.99%; width: 89.92%; height: 95.94%; overflow: hidden; container-type: size;
  border-radius: 12.5% / 5.8%; background: #0c0a12; color: var(--text-2);
}
/* Экран телефона ≈ 217cqw в высоту: статус 0–14, навигация 14–27, контент, вкладки — нижние 24cqw */
.phone__screen::before { content: ''; position: absolute; z-index: 3; top: 3.2cqw; left: 50%; width: 30cqw; height: 8.4cqw; translate: -50% 0; border-radius: 4.2cqw; background: #000; }
/* cq-единицы на самом контейнере считаются от окна, поэтому базовый размер задаём детям */
.phone__screen > * { font: 400 5.6cqw/1.3 var(--font); }
.pi { width: 6cqw; height: 6cqw; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pi--fill { fill: currentColor; stroke: none; }

.ios-status { position: absolute; inset: 0 0 auto; height: 14cqw; display: flex; align-items: center; justify-content: space-between; padding: 1cqw 7cqw 0 9cqw; color: var(--text); }
.ios-time { font: 600 6cqw/1 var(--font); font-variant-numeric: tabular-nums; }
.ios-icons { display: flex; align-items: center; gap: 1.6cqw; }
.ios-icons svg { width: auto; fill: currentColor; }
.ios-cell, .ios-wifi { height: 3.3cqw; }
.ios-wifi path { stroke: currentColor; stroke-width: 0.5; stroke-linejoin: round; }
.ios-battery { height: 3.9cqw; }
.ios-home { position: absolute; z-index: 3; left: 50%; bottom: 2.2cqw; width: 34cqw; height: 1.4cqw; translate: -50% 0; border-radius: 1cqw; background: var(--text); opacity: 0.9; }

.pnav { position: absolute; inset: 14cqw 0 auto; height: 13cqw; display: flex; align-items: center; justify-content: space-between; padding: 0 4cqw; color: var(--accent); }
.pnav__title { font: 600 5.8cqw/1 var(--font); color: var(--text); }

.ptabs {
  position: absolute; inset: auto 0 0; height: 24cqw; display: grid; grid-template-columns: repeat(4, 1fr); padding: 2.4cqw 2cqw 0;
  background: rgba(19, 16, 27, 0.92); box-shadow: 0 -1px 0 var(--line);
}
.ptabs span { display: grid; justify-items: center; align-content: start; gap: 1cqw; font-size: 4cqw; color: var(--muted); transition: color 400ms var(--ease); }
.ptabs .pi { width: 6.4cqw; height: 6.4cqw; }
.phone[data-view='0'] .ptabs span:nth-child(1), .phone[data-view='1'] .ptabs span:nth-child(2),
.phone[data-view='2'] .ptabs span:nth-child(3), .phone[data-view='3'] .ptabs span:nth-child(4) { color: var(--accent); }

.pviews { position: absolute; inset: 27cqw 0 24cqw; }
.pview { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2.4cqw; padding: 1cqw 5cqw 3cqw; opacity: 0; visibility: hidden; transition: opacity 500ms var(--ease), visibility 500ms; }
.phone[data-view='0'] .pview--setup, .phone[data-view='1'] .pview--gen,
.phone[data-view='2'] .pview--anim, .phone[data-view='3'] .pview--edit { opacity: 1; visibility: visible; }
.pcap { display: block; padding: 0 2cqw; font-size: 4.4cqw; color: var(--muted); }
.pchips { display: flex; gap: 1.6cqw; }
.pchips i { padding: 1.4cqw 3cqw; border-radius: 3cqw; background: var(--raised); font-style: normal; font-size: 4.4cqw; color: var(--text-2); }

/* 1 · стиль: сгруппированные строки, как в системных настройках */
.pgroup { border-radius: 4cqw; background: var(--raised); overflow: hidden; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; min-height: 11cqw; padding: 0 3.6cqw; color: var(--text); }
.prow + .prow { box-shadow: inset 0 1px 0 var(--line); }
.prow b { display: flex; align-items: center; gap: 0.6cqw; font-weight: 400; color: var(--text-2); }
.prow b .pi { width: 4.6cqw; height: 4.6cqw; color: var(--muted); }
.prow--seg { gap: 1cqw; padding: 1.4cqw; }
.prow--seg i { flex: 1; padding: 1.6cqw 0; border-radius: 2.4cqw; text-align: center; font-style: normal; font-size: 4.8cqw; color: var(--text-2); }
.prow--seg i.is-on { background: #3a3448; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.ptoggle { position: relative; width: 10.4cqw; height: 6.4cqw; border-radius: 3.2cqw; background: #3a3448; flex: none; }
.ptoggle::after { content: ''; position: absolute; top: 0.6cqw; left: 0.6cqw; width: 5.2cqw; height: 5.2cqw; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.ptoggle.is-on { background: var(--accent-fill); }
.ptoggle.is-on::after { left: 4.6cqw; }
.psample { position: relative; flex: 1; min-height: 0; border-radius: 4cqw; overflow: hidden; }
.psample img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.psample span { position: absolute; left: 3cqw; bottom: 3cqw; padding: 1cqw 2.4cqw; border-radius: 2cqw; background: rgba(14, 11, 22, 0.7); font-size: 4.2cqw; color: var(--text); }

/* 2 · кадры: варианты и поле промпта снизу */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; }
.pgrid .res { aspect-ratio: 1; border-radius: 3cqw; }
.pgrid .res img { object-position: 70% 50%; }
.pgrid .res.is-picked::after { box-shadow: inset 0 0 0 0.8cqw var(--accent); }
.phone[data-view='1'] .pgrid .res { animation: res-in 600ms var(--ease) both; }
.phone[data-view='1'] .pgrid .res:nth-child(1) { animation-delay: 1400ms; }
.phone[data-view='1'] .pgrid .res:nth-child(2) { animation-delay: 1550ms; }
.phone[data-view='1'] .pgrid .res:nth-child(3) { animation-delay: 1700ms; }
.phone[data-view='1'] .pgrid .res:nth-child(4) { animation-delay: 1850ms; }
.pview--gen .pchips { margin-top: auto; }
.pcomposer { display: flex; align-items: center; gap: 2cqw; min-height: 12cqw; padding: 1.4cqw 1.4cqw 1.4cqw 4cqw; border-radius: 6cqw; background: var(--raised); color: var(--text); }
.pcomposer__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psend { display: grid; place-items: center; width: 9cqw; height: 9cqw; border-radius: 50%; background: var(--accent-fill); color: #fff; flex: none; }
.psend .pi { width: 5cqw; height: 5cqw; stroke-width: 2.2; }
.phone[data-view='1'] .pcomposer__text, .phone[data-view='2'] .pfield__text { animation: type-in 1400ms steps(30) both; }

/* 3 · видео: плеер, промпт движения, кнопка */
.pplayer { position: relative; flex: 1; min-height: 0; border-radius: 4cqw; overflow: hidden; background: #000; }
.pplayer video { width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; }
.pplayer__bar { position: absolute; left: 3cqw; right: 3cqw; bottom: 3cqw; height: 1cqw; border-radius: 0.5cqw; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.pplayer__bar i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.phone[data-view='2'] .pplayer__bar i { animation: pbar 5000ms linear 1400ms infinite; }
@keyframes pbar { to { transform: scaleX(1); } }
.pplayer__time { position: absolute; right: 3cqw; top: 3cqw; padding: 0.8cqw 2cqw; border-radius: 2cqw; background: rgba(0, 0, 0, 0.5); font-size: 4cqw; color: #fff; font-variant-numeric: tabular-nums; }
.pfield { display: grid; gap: 1cqw; padding: 2.4cqw 3.6cqw 3cqw; border-radius: 4cqw; background: var(--raised); }
.pfield .pcap { padding: 0; }
.pfield__text { color: var(--text); }
.pbutton { display: grid; place-items: center; min-height: 12cqw; border-radius: 3.6cqw; background: var(--accent-fill); color: #fff; font: 500 5.6cqw/1 var(--font); }

/* 4 · монтаж: плей-хед стоит по центру, лента клипов едет под ним */
.pview--edit { padding-left: 0; padding-right: 0; }
.pedit__preview { position: relative; flex: 1; min-height: 0; margin: 0 5cqw; border-radius: 3cqw; overflow: hidden; background: #000; }
.pedit__preview > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; opacity: 0; transition: opacity 400ms var(--ease); }
.pedit__preview > .is-on { opacity: 1; }
.pedit__ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 6cqw; font-size: 4.4cqw; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pedit__ctrl .pi { color: var(--text); }
.pedit__ctrl .pi:last-child { justify-self: end; width: 5cqw; height: 5cqw; color: var(--text-2); }
.pedit__timeline { position: relative; overflow: hidden; padding: 2cqw 0; }
.pedit__strip { display: grid; gap: 1.6cqw; width: max-content; padding-left: 50%; transform: translateX(calc(var(--ph, 0) * -131cqw)); }
.pedit__clips { display: flex; gap: 1cqw; height: 13cqw; }
.pedit__clips i { width: 32cqw; border-radius: 1.6cqw; background: center / cover no-repeat; }
.pedit__clips i:nth-child(1) { background-image: url(/assets/img/scene-1.webp); }
.pedit__clips i:nth-child(2) { background-image: url(/assets/video/scene-2-poster.webp); }
.pedit__clips i:nth-child(3) { background-image: url(/assets/img/hero.webp); }
.pedit__clips i:nth-child(4) { background-image: url(/assets/img/scene-3.webp); }
.pedit__clips b { display: grid; place-items: center; width: 10cqw; border-radius: 1.6cqw; background: #f1ecfb; color: #15121f; font: 500 6cqw/1 var(--font); }
.pedit__audio { width: 131cqw; height: 6cqw; border-radius: 1.6cqw; background: repeating-linear-gradient(90deg, rgba(178, 155, 255, 0.55) 0 0.6cqw, transparent 0.6cqw 1.6cqw) center / 100% 60% no-repeat, rgba(114, 84, 232, 0.3); }
.pedit__head { position: absolute; top: 0; bottom: 0; left: 50%; width: 0.6cqw; translate: -50% 0; border-radius: 0.3cqw; background: #fff; box-shadow: 0 0 0 0.4cqw rgba(0, 0, 0, 0.35); }
.pedit__tools { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 3cqw; }
.pedit__tools span { display: grid; justify-items: center; gap: 1cqw; font-size: 3.8cqw; color: var(--text-2); }
.pedit__tools .pi { width: 5.6cqw; height: 5.6cqw; color: var(--text); }

/* 4 · монтаж */
.view--edit { display: grid; grid-template-rows: 1fr 38cqh; }
.editor__body { display: grid; grid-template-columns: 22% 1fr; min-height: 0; }
.editor__scenes { display: grid; align-content: start; gap: 1.2cqw; padding: 1.8cqw; border-right: 1px solid var(--line); background: #110e18; overflow: hidden; }
.editor__cap { font-size: 1.8cqw; color: var(--muted); }
.thumb { display: grid; grid-template-columns: 7cqw 1fr; align-items: center; gap: 1.2cqw; padding: 0.6cqw; border-radius: 0.8cqw; transition: background-color 400ms var(--ease), color 400ms var(--ease); }
.thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 0.5cqw; }
.thumb.is-on { background: var(--raised); color: var(--text); }
.editor__preview { position: relative; margin: 1.8cqw; border-radius: 0.8cqw; overflow: hidden; background: #000; }
.editor__preview > :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 600ms var(--ease); }
.editor__preview > .is-on { opacity: 1; }
.editor__tc { position: absolute; right: 1.2cqw; bottom: 1.2cqw; padding: 0.4cqw 1cqw; border-radius: 0.6cqw; background: rgba(0, 0, 0, 0.6); color: var(--text); font: 400 1.8cqw/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.editor__timeline { position: relative; display: grid; grid-template-rows: 5cqh repeat(4, minmax(0, 1fr)); gap: 0.6cqh; padding: 1cqh 1.8cqw 1.6cqh; border-top: 1px solid var(--line); background: #110e18; }
.editor__ruler { display: flex; justify-content: space-between; margin-left: 13cqw; font: 400 1.6cqw/1 var(--font-mono); color: var(--muted); align-items: center; }
.track { display: grid; grid-template-columns: 13cqw 1fr; align-items: center; border-radius: 0.6cqw; transition: background-color 400ms var(--ease); }
.track__name { padding-left: 0.8cqw; font-size: 1.8cqw; transition: color 400ms var(--ease); }
.track__lane { position: relative; height: 100%; display: flex; gap: 0.6cqw; align-items: center; padding: 0.4cqh 0; }
.track__lane i { font-style: normal; }
.chip { padding: 0.5cqw 1.2cqw; border-radius: 0.6cqw; background: var(--raised); color: var(--text-2); font-size: 1.6cqw; white-space: nowrap; }
.track__lane--clips i { flex: 1; height: 100%; border-radius: 0.6cqw; background: center / cover; opacity: 0.7; transition: opacity 400ms var(--ease); }
.track__lane--clips i:nth-child(1) { background-image: url(/assets/img/scene-1.webp); }
.track__lane--clips i:nth-child(2) { background-image: url(/assets/video/scene-2-poster.webp); }
.track__lane--clips i:nth-child(3) { background-image: url(/assets/img/hero.webp); }
.track__lane--clips i:nth-child(4) { background-image: url(/assets/img/scene-3.webp); }
.track__lane--keys::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.track__lane--keys i:nth-child(1) { left: 6%; }
.track__lane--keys i:nth-child(2) { left: 21%; }
.track__lane--keys i:nth-child(3) { left: 33%; }
.track__lane--keys i:nth-child(4) { left: 52%; }
.track__lane--keys i:nth-child(5) { left: 64%; }
.track__lane--keys i:nth-child(6) { left: 81%; }
.track__lane--keys i:nth-child(7) { left: 93%; }
.track__lane--keys i { position: absolute; top: 50%; width: 1.4cqw; height: 1.4cqw; translate: -50% -50%; rotate: 45deg; background: var(--text-2); border-radius: 0.2cqw; transition: background-color 400ms var(--ease); }
.track__lane--wave svg { width: 100%; height: 3cqh; fill: none; stroke: var(--muted); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: stroke 400ms var(--ease); }
.track.is-on { background: var(--raised); }
.track.is-on .track__name { color: var(--accent); }
.track.is-on .chip { background: var(--accent-soft); color: var(--text); }
.track.is-on .track__lane--keys i { background: var(--accent); }
.track.is-on .track__lane--wave svg { stroke: var(--accent); }
.track.is-on .track__lane--clips i { opacity: 1; }
/* Плей-хед едет через transform: обёртка шириной с дорожку сдвигается на долю своей ширины */
.editor__playhead { position: absolute; top: 1cqh; bottom: 1.6cqh; left: calc(1.8cqw + 13cqw); right: 1.8cqw; pointer-events: none; }
.editor__playhead b { position: absolute; inset: 0; transform: translateX(calc(var(--ph, 0) * 100%)); }
.editor__playhead b::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--light-btn); }
.editor__playhead b::after { content: ''; position: absolute; top: 0; left: 0; width: 1.4cqw; height: 1.4cqw; translate: -50% 0; background: var(--light-btn); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* ---------- Pricing ---------- */
.tariffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.tariffs__loading { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px 0; }
.tariff {
  position: relative; display: flex; flex-direction: column; padding: 32px 28px 28px;
  border-radius: 16px; background: var(--surface);
  transition: background-color var(--fast) var(--ease);
}
.tariff:hover { background: #191523; }
.tariff--popular {
  background: linear-gradient(180deg, rgba(114, 84, 232, 0.16), rgba(114, 84, 232, 0.04) 60%), var(--raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 64px rgba(5, 3, 10, 0.5);
}
.tariff--popular:hover { background: linear-gradient(180deg, rgba(114, 84, 232, 0.2), rgba(114, 84, 232, 0.06) 60%), var(--raised); }
.tariff__badge { position: absolute; top: 32px; right: 28px; font-size: 13px; color: var(--accent); line-height: 24px; }
.tariff__title { font-size: 18px; line-height: 24px; padding-right: 88px; }
/* Место под подзаголовок держим всегда, чтобы цены в соседних карточках стояли на одной линии */
.tariff__subtitle { margin-top: 4px; min-height: 20px; color: var(--muted); font-size: 14px; line-height: 20px; }
.tariff__subtitle[hidden] { display: block; visibility: hidden; }
.tariff__price { font: 500 40px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 24px 0; }
.tariff__features { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; flex: 1; align-content: start; }
.tariff__features li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.tariff__features li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8299' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tariff--popular .tariff__features li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b29bff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.tariff__btn { width: 100%; }
.tariff--popular .tariff__btn { background: var(--accent-fill); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.tariff--popular .tariff__btn:hover { background: var(--accent-fill-hover); }
.note { margin-top: 24px; color: var(--muted); font-size: 13px; text-align: center; }
.note a { color: var(--text-2); text-underline-offset: 3px; }
.note a:hover { color: var(--text); }

.how { list-style: none; padding: 0; margin: 80px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: how; }
.how li { counter-increment: how; position: relative; display: grid; gap: 4px; padding-top: 48px; }
.how li::before {
  content: counter(how); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 500 14px/1 var(--font); background: var(--raised); color: var(--text);
}
.how li:not(:last-child)::after { content: ''; position: absolute; left: 48px; right: 0; top: 16px; height: 1px; background: var(--line-2); }
.how b { font-weight: 500; font-size: 16px; }
.how span { color: var(--text-2); font-size: 15px; }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: 4fr 8fr; gap: 64px; align-items: start; }
.faq { display: grid; gap: 8px; }
.faq details { border-radius: 12px; background: var(--surface); transition: background-color var(--fast) var(--ease); interpolate-size: allow-keywords; }
.faq details:hover { background: #191523; }
.faq details[open] { background: var(--raised); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative; font-weight: 500; font-size: 16px; border-radius: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 24px; top: 50%; width: 16px; height: 16px; translate: 0 -50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aba4bd' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: rotate 220ms var(--ease);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 300ms var(--ease), content-visibility 300ms allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq details p { padding: 0 24px 24px; color: var(--text-2); font-size: 15px; max-width: 64ch; }

/* ---------- Finale ---------- */
.finale { position: relative; isolation: isolate; overflow: hidden; padding: 160px 0; text-align: center; }
.finale__bg { position: absolute; inset: 0; z-index: -1; }
.finale__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.finale__bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(14, 11, 22, 0.55) 30%, rgba(14, 11, 22, 0.55) 70%, var(--bg) 100%);
}
.finale__inner { display: grid; justify-items: center; }
.finale h2 { font: 500 clamp(36px, 4.4vw, 60px)/1.08 var(--font-display); letter-spacing: -0.02em; max-width: 14em; text-wrap: balance; }
.finale p { margin: 20px 0 40px; color: var(--text-2); font-size: 18px; }

/* ---------- Footer ---------- */
.footer { padding: 64px 0 40px; background: var(--bg); }
.footer__inner { display: grid; grid-template-columns: auto 1fr; gap: 32px 40px; align-items: center; }
.footer .logo { align-items: flex-start; }
.footer .logo small { display: block; margin-top: 8px; color: var(--muted); font: 400 13px/1.4 var(--font); }
.footer__nav { display: flex; gap: 24px; justify-content: flex-end; flex-wrap: wrap; }
.footer__nav a, .footer__legal a { text-decoration: none; color: var(--text-2); font-size: 14px; transition: color var(--fast) var(--ease); }
.footer__nav a:hover, .footer__legal a:hover { color: var(--text); }
.footer__legal { grid-column: 1 / -1; display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-top: 16px; }
.footer__legal > span { margin-right: auto; }
.footer__legal a { font-size: 13px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 100; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 12px; background: #2a1520; color: #ffd9dc;
  box-shadow: 0 16px 40px rgba(5, 3, 10, 0.5); font-size: 14px;
  animation: rise 220ms var(--ease) both;
}

/* ---------- Legal pages ---------- */
.header--static .header__cta { margin-left: auto; }
.legal { max-width: 760px; padding: calc(var(--header-h) + 64px) 0 96px; }
.legal h1 { font: 500 clamp(36px, 5vw, 52px)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.legal__meta { margin-top: 12px; font-size: 14px; color: var(--muted); }
.legal__lead { margin-top: 32px; padding: 20px 24px; border-radius: 14px; background: var(--surface); font-size: 17px; color: var(--text); text-wrap: pretty; }
.legal__toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 16px; }
.legal__toc a { padding: 6px 12px; border-radius: 8px; background: var(--surface); font-size: 14px; color: var(--text-2); text-decoration: none; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.legal__toc a:hover { background: var(--raised); color: var(--text); }
.legal section { padding-top: 40px; scroll-margin-top: calc(var(--header-h) + 16px); }
.legal h2 { margin-bottom: 16px; font-size: 22px; line-height: 1.3; }
.legal section p, .legal li { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.legal section p + p, .legal ul + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0; padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal li::marker { color: var(--muted); }
.legal a { color: var(--text); text-underline-offset: 3px; text-decoration-color: rgba(239, 234, 247, 0.3); }
.legal a:hover { text-decoration-color: currentColor; }
.legal__card { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0; padding: 24px; border-radius: 14px; background: var(--surface); }
.legal__card dt { font-size: 14px; color: var(--muted); }
.legal__card dd { margin: 0; color: var(--text); }
/* Незаполненные реквизиты — видно издалека, чтобы не уехало в прод */
.legal__fill { padding: 1px 6px; border-radius: 4px; background: rgba(242, 195, 126, 0.16); color: var(--lamp); }
.legal__back { margin-top: 56px; font-size: 14px; }
@media (max-width: 600px) {
  .legal { padding-top: calc(var(--header-h) + 40px); }
  .legal__card { grid-template-columns: 1fr; gap: 4px; }
  .legal__card dd + dt { margin-top: 12px; }
}

/* ---------- Order page ---------- */
.order-page { min-height: 100svh; display: grid; place-items: center; padding: calc(var(--header-h) + 48px) 0 48px; }
.header--static { background: rgba(14, 11, 22, 0.82); }
.order-card {
  width: min(560px, 100%); padding: 40px 32px; border-radius: 20px; text-align: center;
  background: var(--surface);
  box-shadow: 0 32px 80px rgba(5, 3, 10, 0.5);
  animation: rise var(--enter) var(--ease) both;
}
.order-card h1 { font: 500 clamp(28px, 4vw, 36px)/1.15 var(--font-display); letter-spacing: -0.01em; margin: 24px 0 12px; }
.order-card p { color: var(--text-2); }
.order-card .btn { margin-top: 32px; }
.order-card__meta { margin-top: 8px; font-weight: 500; color: var(--text) !important; }
.order-card__hint { margin-top: 24px; font-size: 13px; color: var(--muted) !important; }
.order-card__code { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--bg-deep); font: 400 13px/1.4 var(--font-mono); color: var(--text) !important; word-break: break-all; user-select: all; }
.status-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--raised); }
.status-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(178, 155, 255, 0.2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
  .pipe:nth-child(2)::after { display: none; }
  .tariffs { grid-template-columns: 1fr 1fr; }
  .tariff--max { grid-column: 1 / -1; }
  .program { grid-template-columns: 1fr; gap: 64px; }
  .program__art { max-width: 820px; }
  .hero__note { display: none; }
}

@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .container { width: calc(100% - 32px); }
  .header { background: rgba(14, 11, 22, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .header__inner { gap: 12px; }
  .header__cta { margin-left: auto; }
  .burger {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 8px;
    background: var(--raised); border: 0; cursor: pointer;
  }
  .burger span, .burger span::before, .burger span::after {
    content: ''; display: block; width: 16px; height: 1.5px; background: var(--text); border-radius: 1px;
    transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
  }
  .burger span { position: relative; }
  .burger span::before { position: absolute; top: -5px; }
  .burger span::after { position: absolute; top: 5px; }
  .burger[aria-expanded='true'] span { background: transparent; }
  .burger[aria-expanded='true'] span::before { transform: translateY(5px) rotate(45deg); }
  .burger[aria-expanded='true'] span::after { transform: translateY(-5px) rotate(-45deg); }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0; margin: 0;
    padding: 8px 16px 16px; background: rgba(14, 11, 22, 0.97);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 200ms;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 12px 4px; font-size: 17px; border-radius: 0; }
  .nav a:hover { background: none; }

  .hero { min-height: 0; padding: calc(var(--header-h) + 56px) 0 160px; }
  .hero__bg img { object-position: 78% 50%; }
  .hero__bg::after {
    background:
      linear-gradient(180deg, rgba(14, 11, 22, 0.7) 0%, rgba(14, 11, 22, 0.35) 45%, rgba(14, 11, 22, 0.2) 70%, var(--bg) 100%);
  }
  .hero h1 { font-size: clamp(36px, 9vw, 44px); }
  .hero__lead { font-size: 17px; }
  .result { margin-top: -96px; }
  .film__screen { aspect-ratio: 3 / 2; border-radius: 16px; }
  .chapters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .result__grid { grid-template-columns: 1fr; gap: 40px; margin-top: 64px; }
  .result__note { display: none; }
  .section { padding: 96px 0; }
  .faq-wrap { grid-template-columns: 1fr; gap: 0; }
  .how { grid-template-columns: 1fr; gap: 24px; margin-top: 64px; }
  .how li { padding: 4px 0 0 48px; }
  .how li:not(:last-child)::after { left: 16px; top: 40px; bottom: -20px; right: auto; width: 1px; height: auto; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__nav { justify-content: flex-start; }
  /* На маленьком экране интерфейс в ноутбуке упрощаем, а не ужимаем */
  .editor__scenes, .editor__ruler + .track, .editor__tabs { display: none; }
  .editor__body { grid-template-columns: 1fr; }
  .editor__ui { grid-template-rows: 9cqh 1fr; }
  .view--edit { grid-template-rows: 1fr 34cqh; }
  .editor__timeline { grid-template-rows: 6cqh repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .header__cta { display: none; }
  .burger { margin-left: auto; }
  .section { padding: 80px 0; }
  .hero__actions .btn { flex: 1 1 100%; }
  .perks { flex-direction: column; gap: 12px; margin-top: 32px; }
  .film__screen { aspect-ratio: 4 / 5; }
  .scene__cam { left: 50%; top: 0; width: auto; height: 100%; translate: -50% 0; }
  /* В узком кадре героиня справа — сдвигаем камеру к ней */
  .scene:nth-child(1) .scene__cam { translate: -62% 0; }
  .scene:nth-child(3) .scene__cam { translate: -73% 0; }
  .scene:nth-child(4) .scene__cam { translate: -65% 0; }
  .film__head { left: 16px; top: 16px; }
  .film__title { font-size: 20px; }
  .film__sub { bottom: 72px; font-size: 16px; width: calc(100% - 32px); }
  .film__controls { left: 12px; right: 12px; bottom: 12px; gap: 12px; }
  .film__time { min-width: 0; font-size: 13px; }
  .film__big { width: 64px; height: 64px; }
  .chapter { grid-template-columns: 56px 1fr; column-gap: 8px; padding: 8px; }
  .chapter img { width: 56px; }
  .chapter__name { font-size: 14px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe::after { display: none; }
  .demo { aspect-ratio: 1 / 1; }
  .tariffs { grid-template-columns: 1fr; }
  .tariff--max { grid-column: auto; }
  .program__note { display: none; }
  /* Подписи в редакторе здесь мельче 11px — оставляем только картинку и дорожки */
  .editor__top, .editor__ruler, .track__name, .editor__tc { display: none; }
  .editor__ui { grid-template-rows: 1fr; }
  .view--edit { grid-template-rows: 1fr 30cqh; }
  .setup__tools, .setup__params > .param:not(.param--sample), .editor__cap, .anim__src, .anim__arrow, .anim__params, .anim__prompt, .view--anim figcaption { display: none; }
  .view--setup { grid-template-columns: 1fr; }
  .setup__params { grid-template-rows: 1fr; padding: 1.8cqw; }
  .param--sample { grid-template-rows: 1fr; }
  .gen__prompt { display: none; }
  .devices { aspect-ratio: 1 / 1; }
  .view--gen { grid-template-rows: 1fr; }
  .view--anim { grid-template-columns: 1fr; grid-template-rows: 1fr; padding: 1.8cqw; }
  .view--anim video { height: 100%; aspect-ratio: auto; }
  .view--anim figure { height: 100%; }
  .editor__timeline { grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .track { grid-template-columns: 1fr; }
  .editor__playhead { left: 1.8cqw; }
  .finale { padding: 112px 0; }
  .order-card { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
