/* ===== Клипни: общая основа для лендинга и приложения ===== */
:root {
  --bg: #F5F1F4;
  --surface: #FFFFFF;
  --surface-2: #EFE9EE;
  --ink: #231A26;
  --ink-2: #4A3F4D;
  --muted: #6E6272;
  --line: #E6DEE6;
  --hover: #F1ECF0;
  --accent: #A8CF6A;
  --accent-2: #97BF58;
  --accent-soft: #EAF4DA;
  --accent-ink: #4E7A1F;
  --on-accent: #231A26;
  --glow: #A8CF6A;
  --mascot: #A8CF6A;
  --on-mascot: #231A26;
  --ok: #0F8A5F;
  --danger: #C62F2F;

  --card: #151017;
  --card-2: #201823;
  --card-line: #2E2533;
  --card-muted: #9A8E9D;

  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --sans: "Onest", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --r: 12px;
  --shadow: 0 1px 2px rgba(12, 13, 16, .04), 0 12px 32px -12px rgba(12, 13, 16, .14);
}

/* тёмная тема: лендинг и веб-версия всегда; в Telegram — по теме Telegram */
:root.dark {
  color-scheme: dark;
  --bg: #120D14;
  --surface: #1C1520;
  --surface-2: #261D2B;
  --ink: #F3ECF2;
  --ink-2: #D5CAD6;
  --muted: #9D90A0;
  --line: #2E2533;
  --hover: #231A27;
  --accent-soft: rgba(168, 207, 106, .14);
  --accent-ink: #C4E391;
  --card: #0B080D;
  --card-2: #1A131D;
  --card-line: #2A2130;
  --track: #3A3040;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .7);
}
:root { --track: #DCD3DB; }
/* логотип светится */
.mark { box-shadow: 0 0 0 1px rgba(168, 207, 106, .5), 0 0 16px rgba(168, 207, 106, .45); }
:root.dark .mark { animation: markglow 4s ease-in-out infinite; }
@keyframes markglow { 50% { box-shadow: 0 0 0 1px rgba(168, 207, 106, .7), 0 0 26px 2px rgba(168, 207, 106, .6); } }
:root.dark .ic-glow { filter: drop-shadow(0 0 6px rgba(168, 207, 106, .55)); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
.is-hidden { display: none !important; }

.ic { width: 1em; height: 1em; fill: currentColor; stroke: none; flex-shrink: 0; }
.mono { font-family: var(--mono); }

/* ---------- шапка ---------- */
.nav { max-width: 1200px; margin: 0 auto; padding: 18px 32px; display: flex; align-items: center; gap: 36px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.mark {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .95rem; letter-spacing: -.04em;
}
.nav-links { display: flex; gap: 26px; color: var(--muted); font-size: .93rem; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .93rem;
  padding: 10px 18px; border: 0; border-radius: 8px; cursor: pointer; transition: background .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .93rem;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--hover); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

.eyebrow { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- тёмная карточка-показ (лендинг и экран обработки) ---------- */
.show {
  width: 100%; min-width: 0; background: var(--card); color: #ECEDF1; border-radius: 20px;
  border: 1px solid #1C1E24; box-shadow: 0 1px 2px rgba(12, 13, 16, .08), 0 34px 80px -28px rgba(12, 13, 16, .5); overflow: hidden;
}
.stage { position: relative; aspect-ratio: 5 / 4.3; }
.scene-l { position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column; opacity: 0; transform: scale(.985); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.scene-l.on { opacity: 1; transform: none; pointer-events: auto; }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--card-line); }
.steps3 div { position: relative; padding: 12px 16px 14px; font-size: .78rem; color: var(--card-muted); display: flex; align-items: center; gap: 8px; }
.steps3 div + div { border-left: 1px solid var(--card-line); }
.steps3 b { font-family: var(--mono); font-weight: 500; font-size: .7rem; }
.steps3 div::after { content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--glow); transition: width .4s; }
.steps3 div.on { color: #fff; }
.steps3 div.on::after { width: var(--p, 0%); }
.steps3 div.timed::after { animation: fill var(--dur, 3s) linear forwards; }
.steps3 div.done { color: #C8CCD6; }
.steps3 div.done::after { width: 100%; animation: none; }
@keyframes fill { from { width: 0; } to { width: 100%; } }

/* нарисованные кадры: стрим, подкаст, влог */
.scene { position: absolute; inset: 0; overflow: hidden; animation: drift 10s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1.5%); } }
.s-stream { background: radial-gradient(60% 80% at 18% 40%, rgba(150, 110, 230, .5), transparent 60%), radial-gradient(40% 50% at 85% 20%, rgba(0, 210, 190, .16), transparent 70%), linear-gradient(180deg, #150F1A, #0F0B12); }
.s-stream::before { content: ""; position: absolute; left: 5%; top: 18%; width: 30%; height: 42%; border-radius: 4px; background: linear-gradient(135deg, #C9B2FF, #7A55D6); opacity: .5; box-shadow: 0 0 60px 20px rgba(150, 110, 230, .3); }
.s-pod { background: radial-gradient(55% 70% at 70% 30%, rgba(255, 170, 90, .45), transparent 65%), linear-gradient(180deg, #1C1410, #120D0A); }
.s-vlog { background: linear-gradient(180deg, #F59E5B 0%, #D96A4A 38%, #5B3A55 70%, #20182A 100%); }
.s-vlog::before { content: ""; position: absolute; left: 58%; top: 24%; width: 26%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #FFE3B0, rgba(255, 200, 130, 0) 70%); }
.person { position: absolute; left: var(--px, 50%); bottom: 0; width: var(--pw, 30%); aspect-ratio: 1 / 1.05; transform: translateX(-50%); }
.person .head { position: absolute; left: 50%; top: 0; width: 38%; aspect-ratio: 1 / 1.12; border-radius: 48% 48% 44% 44%; transform: translateX(-50%); background: var(--skin, #1A1C22); box-shadow: inset var(--rim, -6px) 0 10px -4px var(--rimc, rgba(190, 160, 255, .8)); }
.person .body { position: absolute; left: 50%; bottom: 0; width: 100%; height: 56%; border-radius: 46% 46% 0 0; transform: translateX(-50%); background: var(--cloth, #15171C); box-shadow: inset var(--rim, -8px) 6px 16px -8px var(--rimc, rgba(190, 160, 255, .7)); }
.s-pod .person { --rimc: rgba(255, 180, 110, .85); --rim: 8px; --cloth: #1E1714; --skin: #221A16; }
.s-vlog .person { --rimc: rgba(255, 190, 130, .9); --rim: 7px; --cloth: #1B1420; --skin: #20171F; }

/* обработка: скан, лицо, слова, чат */
.proc-scene { padding: 0; }
.proc-scene .scene { --px: 56%; }
.scan { position: absolute; top: 0; bottom: 0; width: 30%; left: -30%; background: linear-gradient(90deg, transparent, rgba(168, 207, 106, .22), transparent); border-right: 1px solid rgba(190, 230, 130, .6); }
.scene-l.on .scan { animation: scan 1.8s ease-in-out infinite; }
@keyframes scan { to { left: 100%; } }
.face { position: absolute; left: calc(56% - 6.4%); top: 61%; width: 12.8%; aspect-ratio: 1 / 1.2; opacity: 0; transform: scale(1.6); transition: opacity .4s, transform .5s cubic-bezier(.2, .8, .2, 1); }
.face.on { opacity: 1; transform: none; }
.face::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--glow); border-radius: 3px;
  -webkit-mask: linear-gradient(#000 0 0) top left / 32% 32% no-repeat, linear-gradient(#000 0 0) top right / 32% 32% no-repeat, linear-gradient(#000 0 0) bottom left / 32% 32% no-repeat, linear-gradient(#000 0 0) bottom right / 32% 32% no-repeat;
          mask: linear-gradient(#000 0 0) top left / 32% 32% no-repeat, linear-gradient(#000 0 0) top right / 32% 32% no-repeat, linear-gradient(#000 0 0) bottom left / 32% 32% no-repeat, linear-gradient(#000 0 0) bottom right / 32% 32% no-repeat; }
.face span { position: absolute; left: -2px; top: -19px; font-family: var(--mono); font-size: .58rem; background: var(--glow); color: #231A26; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.chatfly { position: absolute; right: 14px; bottom: 70px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.chatfly span { font-size: .72rem; color: #fff; background: rgba(15, 17, 22, .72); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .1); padding: 4px 10px; border-radius: 999px; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; }
.chatfly span.on { opacity: 1; transform: none; }
.chatfly span b { color: #CDE7A2; font-weight: 600; margin-right: 5px; }
.words { position: absolute; left: 14px; right: 14px; bottom: 14px; font-size: .8rem; color: #fff; background: rgba(10, 11, 14, .66); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; padding: 8px 12px; min-height: 36px; white-space: nowrap; overflow: hidden; }
.words .w { opacity: 0; transition: opacity .2s; }
.words .w.on { opacity: 1; }
.words .w.hot { color: #CDE7A2; font-weight: 600; }
.proc-pill { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 500; color: #fff; background: rgba(10, 11, 14, .62); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .1); padding: 5px 12px 5px 9px; border-radius: 999px; max-width: calc(100% - 28px); }
.proc-pill i { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--glow); border-right-color: transparent; animation: spin .8s linear infinite; flex: 0 0 12px; }
.proc-pill em { font-style: normal; font-family: var(--mono); color: var(--card-muted); margin-left: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- формы ---------- */
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 84px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 7px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(12, 13, 16, .08); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .sw { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--track); transition: background .15s; flex: 0 0 40px; }
.toggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:focus-visible + .sw { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle b { font-weight: 600; font-size: .93rem; display: block; }
.toggle small { color: var(--muted); font-size: .82rem; display: block; }

/* образцы шаблонов субтитров */
.tpl-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #2A3142, #161A24); }
.tpl-frame .person { --pw: 80%; animation: none; }
.tpl-frame .scene { animation: none; }
.tpl-sub { position: absolute; left: 6%; right: 6%; bottom: 20%; text-align: center; line-height: 1.15; font-size: .72rem; }
.tpl-karaoke { font-family: "Montserrat", var(--sans); font-weight: 800; text-transform: uppercase; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 2px 0 #000; }
.tpl-karaoke em { font-style: normal; color: var(--hl, #FFD400); }
.tpl-bold { font-family: "Montserrat", var(--sans); font-weight: 900; text-transform: uppercase; color: #FFE14D; font-size: .92rem; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 3px 0 #000; }
.tpl-minimal { color: #fff; font-weight: 500; font-size: .66rem; }
.tpl-minimal span { background: rgba(0, 0, 0, .62); padding: 2px 6px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tpl-classic { color: #fff; font-weight: 700; font-size: .66rem; text-shadow: 0 0 2px #000, 0 1px 2px #000, 1px 2px 2px rgba(0, 0, 0, .6); }
.tpl-hype { font-family: "Montserrat", var(--sans); font-weight: 900; text-transform: uppercase; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 3px 2px #000; }
.tpl-hype em { font-style: normal; color: #3DFF8A; display: inline-block; animation: tplBounce 1.1s ease-in-out infinite; }
@keyframes tplBounce { 0%, 60%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .tpl-hype em { animation: none; } }
.tpl-neon { font-family: "Montserrat", var(--sans); font-weight: 800; text-transform: uppercase; color: #fff; text-shadow: 0 0 6px var(--glowc, #4D6BFF), 0 0 12px var(--glowc, #4D6BFF), 0 0 2px var(--glowc, #4D6BFF); }

@media (max-width: 560px) {
  .nav { padding: 14px 16px; gap: 16px; }
  .nav-links { display: none; }
  .stage { aspect-ratio: 4 / 4.3; }
  .scene-l { padding: 16px; }
  .proc-scene { padding: 0; }
  .steps3 div { padding: 10px 10px 12px; font-size: .72rem; }
  .steps3 b { display: none; }
  .chatfly { bottom: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Клипыш */
svg.kl { overflow: visible; display: block; }
.kl-body { fill: var(--mascot); transition: fill .4s; }
.kl-flap { fill: var(--on-mascot); opacity: .16; }
.kl-glint { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .55; }
.kl-f { fill: none; stroke: var(--on-mascot); stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.kl-arm { fill: none; stroke: color-mix(in oklab, var(--mascot) 72%, #231A26); stroke-width: 8; stroke-linecap: round; transition: stroke .4s; }
.kl-cheek { fill: #FF6B81; }
.kl-shadow { fill: var(--ink); opacity: .1; transform-box: fill-box; transform-origin: 50% 50%; animation: klsh 3.4s ease-in-out infinite; }
.kl-float, .kl-boing { transform-box: fill-box; transform-origin: 50% 100%; }
.kl-float { animation: klbob 3.4s ease-in-out infinite; }
@keyframes klbob { 50% { transform: translateY(-5px); } }
@keyframes klsh { 50% { transform: scale(.9); } }
.kl-joy .kl-float { animation: klhop .62s ease-in-out infinite; }
.kl-joy .kl-shadow { animation: klshh .62s ease-in-out infinite; }
@keyframes klhop { 0%, 100% { transform: none; } 18% { transform: scale(1.05, .93); } 55% { transform: translateY(-16px) scale(.97, 1.03); } }
@keyframes klshh { 0%, 100% { transform: none; } 55% { transform: scale(.7); opacity: .06; } }
.kl-work .kl-float { animation: klbusy .5s ease-in-out infinite; }
@keyframes klbusy { 50% { transform: translateY(-2px) rotate(-1.5deg); } }
.kl-wink .kl-float { animation: kltilt 2.4s ease-in-out infinite; }
@keyframes kltilt { 50% { transform: rotate(3deg); } }
.kl-sad .kl-float, .kl-sad .kl-shadow { animation-duration: 6s; }
.kl-sleep .kl-float { animation: klbr 3.6s ease-in-out infinite; }
.kl-sleep .kl-shadow { animation: none; }
@keyframes klbr { 50% { transform: scale(1.025, .975); } }
.kl-zz { opacity: 0; transition: opacity .4s; }
.kl-sleep .kl-zz { opacity: 1; }
.kl-zz path { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 50%; animation: klzz 3s ease-in-out infinite; opacity: 0; }
.kl-zz path:nth-child(2) { animation-delay: 1s; } .kl-zz path:nth-child(3) { animation-delay: 2s; }
@keyframes klzz { 0% { opacity: 0; transform: translate(0, 6px) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(12px, -22px) scale(1); } }
