/* TitovSystems: анимация кнопки «Смотреть презентацию». */

.hero-video-cta__inner {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    animation: cta-breathe 2.6s ease-in-out infinite;
}

/* Расходящиеся волны вокруг кнопки */
.hero-video-cta::before,
.hero-video-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 999px;
    border: 2px solid var(--accent);
    opacity: 0;
    pointer-events: none;
    animation: cta-ripple 2.6s ease-out infinite;
}

.hero-video-cta::after {
    animation-delay: 1.3s;
}

/* Блик, пробегающий по кнопке */
.hero-video-cta__inner::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    z-index: 1;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: cta-shine 4.2s ease-in-out infinite;
}

/* Пульсирующая иконка play */
.hero-video-cta__icon {
    animation: cta-icon 1.3s ease-in-out infinite;
}

.hero-video-cta__icon::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .9);
    animation: cta-icon-ring 1.3s ease-out infinite;
    pointer-events: none;
}

.hero-video-cta:hover .hero-video-cta__inner,
.hero-video-cta:focus-visible .hero-video-cta__inner {
    animation-play-state: paused;
    transform: translateY(-2px) scale(1.03);
}

/* Во время презентации и загрузки — без анимации */
body.presentation-lock .hero-video-cta,
body.presentation-lock .hero-video-cta *,
.hero-video-cta.is-loading,
.hero-video-cta.is-loading * {
    animation: none !important;
}

body.presentation-lock .hero-video-cta::before,
body.presentation-lock .hero-video-cta::after,
.hero-video-cta.is-loading::before,
.hero-video-cta.is-loading::after,
.hero-video-cta.is-loading .hero-video-cta__inner::after {
    display: none;
}

@keyframes cta-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 14px 38px rgba(16, 191, 167, .22); }
    50% { transform: scale(1.04); box-shadow: 0 18px 48px rgba(16, 191, 167, .42); }
}

@keyframes cta-ripple {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(1.18, 1.45); opacity: 0; }
}

@keyframes cta-shine {
    0%, 55% { left: -60%; }
    85%, 100% { left: 130%; }
}

@keyframes cta-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@keyframes cta-icon-ring {
    0% { transform: scale(.9); opacity: .9; }
    100% { transform: scale(1.25); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-video-cta,
    .hero-video-cta * {
        animation: none !important;
    }

    .hero-video-cta::before,
    .hero-video-cta::after,
    .hero-video-cta__inner::after,
    .hero-video-cta__icon::after {
        display: none;
    }
}

/* Текст кнопки в две строки */
.hero-video-cta__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    white-space: normal !important;
    line-height: 1.1;
}

.hero-video-cta__sub {
    font-size: .72em;
    font-weight: 500;
    letter-spacing: .02em;
    opacity: .85;
}

/* ---------- Всплывающее приглашение к видео ---------- */
.video-nudge {
    position: fixed;
    top: 50%;
    right: 20px;
    z-index: 60;
    width: min(360px, calc(100vw - 24px));
    transform: translate(calc(100% + 40px), -50%);
    opacity: 0;
    transition: transform .55s cubic-bezier(.2, .9, .25, 1.15), opacity .35s ease;
    pointer-events: none;
}

.video-nudge.is-visible {
    transform: translate(0, -50%);
    opacity: 1;
    pointer-events: auto;
}

.video-nudge__body {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 40px 14px 14px;
    border: 1px solid rgba(16, 22, 36, .08);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(21, 35, 63, .18);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.video-nudge__avatar {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #eef7f5 url("/assets/img/titov-avatar.jpg") center / cover no-repeat;
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent);
    animation: nudge-avatar 2s ease-out infinite;
}

.video-nudge__play {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 6px 14px rgba(16, 191, 167, .4);
}

.video-nudge__play::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 7px;
    border-style: solid;
    border-width: 6px 0 6px 9px;
    border-color: transparent transparent transparent #ffffff;
}

.video-nudge__content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.video-nudge__name {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
}

.video-nudge__title {
    font-size: 15px;
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -.01em;
}

.video-nudge__cta {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.video-nudge__cta::after {
    content: " →";
}

.video-nudge__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 22, 36, .06);
    color: var(--muted);
    font-size: 20px;
    line-height: 30px;
    cursor: pointer;
}

.video-nudge__body:hover {
    box-shadow: 0 26px 70px rgba(21, 35, 63, .24);
}

@keyframes nudge-avatar {
    0% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent), 0 0 0 5px rgba(16, 191, 167, .5); }
    100% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent), 0 0 0 16px rgba(16, 191, 167, 0); }
}

@media (max-width: 640px) {
    .video-nudge {
        right: 10px;
        width: min(340px, calc(100vw - 20px));
    }

    .video-nudge__avatar {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }

    .video-nudge__title {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-nudge {
        transition: opacity .2s ease;
    }

    .video-nudge__avatar {
        animation: none;
    }
}
