/* =========================
   KEYFRAMES
========================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideClip {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(211, 53, 36, 0.5); }
    50% { box-shadow: 0 0 0 16px rgba(211, 53, 36, 0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes chevronSlide {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes stripeMove {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
        clip-path: inset(0 0 100% 0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0 0 0 0);
    }
}

@keyframes btnGleam {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* =========================
   SCROLL REVEAL
========================= */
[data-anim] {
    opacity: 0;
    transition: none;
    will-change: transform, opacity;
}

[data-anim].visible {
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-anim="fade-up"].visible { animation-name: fadeUp; }
[data-anim="fade-left"].visible { animation-name: fadeLeft; }
[data-anim="fade-right"].visible { animation-name: fadeRight; }
[data-anim="zoom-in"].visible { animation-name: zoomIn; }
[data-anim="clip"].visible { animation-name: slideClip; }
[data-anim="reveal"].visible { animation-name: textReveal; }

/* Задержки для поочерёдной анимации */
[data-anim-delay="1"].visible { animation-delay: 0.1s; }
[data-anim-delay="2"].visible { animation-delay: 0.2s; }
[data-anim-delay="3"].visible { animation-delay: 0.3s; }
[data-anim-delay="4"].visible { animation-delay: 0.4s; }
[data-anim-delay="5"].visible { animation-delay: 0.5s; }

/* =========================
   HERO ANIMATIONS
========================= */
.hero h1 { animation: fadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero__subtitle { animation: fadeUp 0.9s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero__benefits { animation: fadeUp 0.9s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero__form { animation: fadeUp 0.9s 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero__image { animation: zoomIn 1s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.hero::before {
    animation: chevronSlide 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero::after {
    animation: stripeMove 20s linear infinite, fadeUp 1s 0.2s both;
}

.hero__benefits li {
    opacity: 0;
    animation: fadeLeft 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero__benefits li:nth-child(1) { animation-delay: 0.4s; }
.hero__benefits li:nth-child(2) { animation-delay: 0.55s; }
.hero__benefits li:nth-child(3) { animation-delay: 0.7s; }

/* =========================
   BUTTONS — блик + пульс
========================= */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.btn:hover::after { animation: btnGleam 0.8s ease-out; }

/* pulseGlow — только на CTA в hero, чтобы не отвлекать везде */
.hero .btn--primary,
.hero__form .btn--primary { animation: pulseGlow 2.8s ease-in-out infinite; }
.btn--primary:hover { animation: none; }

/* =========================
   CARDS — hover лифт + зум картинки
========================= */
.services__card {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.services__card img {
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.services__card:hover img {
    transform: scale(1.08);
}

.services__card:hover {
    transform: translateY(-8px);
}

/* =========================
   STATS (счётчики)
========================= */
.stats__animated {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: var(--color-dark);
    border: 2px solid var(--color-dark);
    overflow: hidden;
}

.stats__animated > div {
    background: var(--color-white);
    padding: 40px 24px;
    text-align: center;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
}

.stats__animated > div::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.stats__animated > div:hover::before { transform: translateY(0); }

.stats__animated strong {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stats__animated span {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-muted);
}

/* =========================
   FLOATING WIDGETS
========================= */
.float-widget { animation: float 4s ease-in-out infinite; }
.float-widget:nth-child(2) { animation-delay: 0.8s; }
.float-widget:nth-child(3) { animation-delay: 1.6s; }
.float-widget--max { animation: float 4s ease-in-out infinite, pulseGlow 3s ease-in-out infinite; }

/* =========================
   PROMO BAR
========================= */
.promo-bar {
    background: linear-gradient(90deg, var(--color-dark), #2e2b26, var(--color-dark));
    background-size: 200% 100%;
    animation: shimmer 5s linear infinite;
}

.promo-bar__timer {
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

/* =========================
   LIVE NOTICE — плавное появление
========================= */
.live-notice {
    border-left: 4px solid var(--color-primary);
}

.live-notice.show {
    animation: fadeLeft 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* =========================
   CHEVRON DECOR — вращающийся акцент
========================= */
.chevron-decor {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--color-primary);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* =========================
   TICKER (бегущая строка)
========================= */
.ticker {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 16px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    border-top: 2px solid var(--color-dark);
    border-bottom: 2px solid var(--color-dark);
}

.ticker__track {
    display: inline-flex;
    gap: 48px;
    animation: ticker 30s linear infinite;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticker__track span::before {
    content: "▲";
    margin-right: 16px;
    color: var(--color-dark);
}

/* =========================
   SECTION DIVIDER — шевронная полоса
========================= */
.section-divider {
    height: 60px;
    background: var(--stripes-sm);
    clip-path: polygon(0 100%, 100% 100%, 100% 40%, 50% 0, 0 40%);
    margin-bottom: -30px;
    position: relative;
    z-index: 1;
}

/* =========================
   HOVER GLOW для фото
========================= */
.portfolio__card,
.ba-slider {
    position: relative;
    transition: transform 0.4s ease;
}

.portfolio__card:hover,
.ba-slider:hover {
    transform: translateY(-6px);
}

/* =========================
   REDUCED MOTION
========================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
