/* Ролик на витрине: видео с настоящими экранами, главы кнопками под ним, стрелки по бокам */
.demo { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.6vh, 18px); position: relative; }
.demo-film { position: relative; width: 100%; max-width: 1040px; aspect-ratio: 16 / 9; }
.demo-film video { display: block; width: 100%; height: 100%; border-radius: 22px; background: var(--l-paper-2); object-fit: cover; }

/* Стрелки по бокам видео */
.demo-side { position: absolute; top: 50%; z-index: 4; width: 52px; height: 52px; border: 0; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center;
             transform: translateY(-50%); background: var(--l-paper); color: var(--ink); cursor: pointer;
             box-shadow: 0 0 0 1px var(--l-ink-08), 0 10px 24px -10px var(--l-ink-35); transition: transform .2s, box-shadow .2s; }
.demo-side.prev { left: -26px; }
.demo-side.next { right: -26px; }
.demo-side:hover { transform: translateY(-50%) scale(1.06); box-shadow: 0 0 0 1px var(--l-ink-12), 0 14px 30px -12px var(--l-ink-45); }
.demo-side svg { width: 22px; height: 22px; }

/* Главы в одной строке: активная залита, внутри её полоска прогресса; пауза рядом */
.demo-nav { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 920px; }
.demo-segs { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--l-paper); box-shadow: inset 0 0 0 1px var(--l-ink-06); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.demo-segs::-webkit-scrollbar { display: none; }
.demo-seg { position: relative; flex-shrink: 0; border: 0; background: none; padding: 10px 18px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600;
            color: var(--ink-2); white-space: nowrap; cursor: pointer; overflow: hidden; transition: background .25s, color .25s; }
.demo-seg:hover { color: var(--ink); background: var(--l-ink-06); }
.demo-seg.on { background: var(--ink); color: var(--on); }
.demo-seg i { display: none; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 2px; border-radius: 1px; background: var(--l-on-22); overflow: hidden; }
.demo-seg.on i { display: block; }
.demo-seg i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--on); }
.demo-play { width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
             background: var(--ink); color: var(--on); }
.demo-play svg { width: 15px; height: 15px; fill: currentColor; }
.demo-play .i-play, .demo.paused .demo-play .i-pause { display: none; }
.demo.paused .demo-play .i-play { display: block; }
.demo-play:focus-visible, .demo-seg:focus-visible, .demo-side:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Подпись главы одной строкой: что происходит и что это даёт */
.demo-caption { margin: 0; max-width: 760px; font-size: 17px; line-height: 1.45; color: var(--ink-2); text-wrap: balance; }
.demo-caption b { color: var(--ink); font-weight: 600; }
.demo-caption .w { display: inline-block; animation: demo-word .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes demo-word { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) { .demo-caption .w { animation: none; } }

@media (max-width: 1100px) { .demo-side.prev { left: -14px; } .demo-side.next { right: -14px; } }
/* Вертикальная версия на телефоне: 9:16, высота по окну */
.demo.vert .demo-film { aspect-ratio: 9 / 16; width: min(100%, calc((100svh - 300px) * 9 / 16)); }
@media (max-width: 760px) {
  .demo-film video { border-radius: 16px; }
  .demo-side { display: none; }
  .demo-nav { gap: 6px; }
  .demo-seg { padding: 9px 14px; font-size: 14px; }
  .demo-caption { font-size: 15px; }
}
