/* Home Page Specific Styles */

/* Глобальное затемнение матричного дождя на 50% */
.matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* Hero Section */
.hero {
    background: url('/assets/images/hero-bg.webp') center center / cover no-repeat;
    color: var(--text-primary);
    padding: 120px 0 80px; /* Исходная высота */
    text-align: center;
    position: relative;
    overflow: visible;
    border-bottom: 2px solid var(--primary);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.65);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.lang-zh .hero-title {
    font-size: 2.8rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: calc(8rem + 60px); /* Дополнительные 60px к отступу */
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: calc(8rem + 60px); /* Дополнительные 60px к отступу */
}

.hero-cta .btn {
    min-width: 180px;
}

/* Features Section */
.features {
    padding: 40px 0 100px; /* Увеличен нижний padding для hover scale */
    background: var(--bg-primary);
    position: relative;
    overflow: visible;
    border-bottom: 2px solid var(--primary);
}

.features .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.features .container {
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem; /* Исходный размер */
    font-weight: 700;
    margin-bottom: 4rem;
    margin-top: 0;
    color: var(--text-primary);
}

.lang-zh .section-title {
    font-size: 2.2rem; /* Исходный размер */
}

.features-grid,
.feature-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible; /* Позволяет карточкам выходить за границы при увеличении */
}

@media (max-width: 1024px) {
    .features-grid,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .features-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.feature-block,
.feature-card {
    background: rgba(45, 55, 65, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: all 1s ease, z-index 0s;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.feature-block:hover,
.feature-card:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
    z-index: 10;
}
.feature-block:hover h3,
.feature-card:hover h3 {
    color: var(--primary);
    text-shadow: 0 0 12px rgba(0, 217, 126, 0.8), 0 0 24px rgba(0, 217, 126, 0.4);
}

/* Feature links */
a.feature-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.feature-link:hover {
    text-decoration: none;
}

a.feature-link .feature-icon {
    transition: transform 0.3s ease;
}

a.feature-link:hover .feature-icon {
    transform: scale(1.1);
}

a.feature-link h3 {
    transition: color 0.3s ease;
}

a.feature-link:hover h3 {
    color: var(--primary);
    text-shadow: 0 0 12px rgba(0, 217, 126, 0.8), 0 0 24px rgba(0, 217, 126, 0.4);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    overflow: visible; /* Позволяет изображению выходить за границы при увеличении */
}

.feature-icon img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.feature-block:hover .feature-icon img,
.feature-link:hover .feature-icon img {
    transform: scale(1.2);
}

.feature-block h3,
.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.feature-block h4,
.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.feature-block p,
.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-block ul,
.feature-card ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    text-align: left;
}

.feature-block ul li,
.feature-card ul li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.feature-block ul li:before,
.feature-card ul li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* How It Works Section */
.how-it-works {
    padding: 20px 0 80px; /* Минимальный отступ сверху */
    background: transparent; /* Прозрачный фон для просвечивания матрицы */
    position: relative;
    overflow: visible;
}

.how-it-works::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 25, 30, 0.55);
    z-index: 1;
    pointer-events: none;
}

.how-it-works .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.how-it-works .container {
    position: relative;
    z-index: 2;
    overflow: visible !important;
}

.how-it-works .steps {
    overflow: visible;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    text-align: center;
    position: relative;
    z-index: 1;
    transition: z-index 0s;
}

.step:hover {
    z-index: 10;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-glow);
}

.step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Screenshots Section */
.screenshots {
    padding: 80px 0;
    background: var(--bg-primary);
}

.screenshot-carousel {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.screenshot-carousel img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

/* Statistics Section */
.statistics,
.stats {
    padding: 100px 0; /* Увеличен padding чтобы дать место для scale при hover */
    background: var(--bg-primary); /* Тёмный фон как у блока с карточками */
    color: var(--text-primary);
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    position: relative;
    overflow: visible;
}

.statistics .matrix-canvas,
.stats .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.statistics .container,
.stats .container {
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.stat {
    text-align: center;
    position: relative;
    z-index: 1;
    transition: z-index 0s;
}

.stat:hover,
.stat.is-visible:hover {
    z-index: 10;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 217, 126, 0.5);
    transition: transform 0.3s ease, filter 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Testimonials Section */
.testimonials {
    padding: 80px 0 100px; /* Дополнительный отступ снизу для hover-эффектов */
    background: transparent; /* Прозрачный фон для просвечивания матрицы */
    position: relative;
    overflow: visible;
    border-bottom: 2px solid var(--primary); /* Зелёная полоска снизу */
}

.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 25, 30, 0.55);
    z-index: 1;
    pointer-events: none;
}

.testimonials .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.testimonials .container {
    position: relative;
    z-index: 2;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.testimonial-card,
.testimonial {
    background: rgba(38, 48, 57, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.testimonial-card:hover,
.testimonial:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.testimonial-card.testimonial-hidden,
.testimonial.testimonial-hidden {
    display: none;
}

.testimonials.testimonials-expanded .testimonial-card.testimonial-hidden,
.testimonials.testimonials-expanded .testimonial.testimonial-hidden {
    display: flex;
}

.testimonial-rating {
    color: var(--warning);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.testimonial-text,
.testimonial-quote {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.testimonial-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.testimonial-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.testimonial-author strong {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.testimonial-author span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.testimonials-toggle {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 0.5rem; /* Отступ снизу чтобы рамка не обрезалась */
}

.testimonials-toggle .btn {
    min-width: 200px;
    transition: all 0.3s ease;
}

.testimonials-toggle .btn:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* FAQ Section */
.faq {
    padding: 80px 0;
    background: var(--bg-primary);
    position: relative;
    overflow: visible;
}

.faq .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0);
}

.faq .container {
    position: relative;
    z-index: 1;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(30, 38, 46, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.faq-item:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    background: rgba(30, 38, 46, 0.75);
    box-shadow: 0 0 18px rgba(0, 217, 126, 0.25), 0 0 40px rgba(0, 217, 126, 0.1), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-left: 1rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    line-height: 1;
    user-select: none;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    margin-top: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Final CTA Section */
.final-cta,
.cta {
    padding: 100px 0;
    background: transparent;
    color: var(--text-primary);
    text-align: center;
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    position: relative;
    overflow: visible;
}

.final-cta::before,
.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 25, 30, 0.55);
    z-index: 1;
    pointer-events: none;
}

.final-cta .matrix-canvas,
.cta .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0);
}

.final-cta .container,
.cta .container {
    position: relative;
    z-index: 2;
}

.final-cta h2,
.cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.lang-zh .final-cta h2,
.lang-zh .cta h2 {
    font-size: 2.2rem;
}

.final-cta p,
.cta p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.cta-buttons .btn {
    min-width: 200px;
}

.cta-features {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.cta-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .lang-zh .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .lang-zh .section-title {
        font-size: 1.6rem;
    }
    
    .steps,
    .stats-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero-cta,
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta .btn,
    .cta-buttons .btn {
        width: 100%;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .final-cta h2 {
        font-size: 1.8rem;
    }
    
    .lang-zh .final-cta h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .lang-zh .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .lang-zh .section-title {
        font-size: 1.4rem;
    }
}

/* Green glow for secondary buttons in hero and header */
.hero-cta .btn-secondary,
.hero-buttons .btn-secondary,
.header-auth .btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 217, 126, 0.3);
    box-shadow: 0 0 15px rgba(0, 217, 126, 0.15), inset 0 0 15px rgba(0, 217, 126, 0.05);
}

.hero-cta .btn-secondary:hover,
.header-auth .btn-secondary:hover {
    border-color: rgba(0, 217, 126, 0.6);
    box-shadow: 0 0 25px rgba(0, 217, 126, 0.3), inset 0 0 20px rgba(0, 217, 126, 0.1);
    color: var(--primary);
}

/* Fix sticky header - убираем overflow с html полностью, только body ограничиваем */
html {
    /* overflow-x НЕ ставим на html — это ломает трансформации дочерних элементов */
}
body {
    /* overflow-x: hidden создаёт stacking context и обрезает hover-трансформации */
    /* Используем max-width чтобы предотвратить горизонтальный скролл без overflow */
    max-width: 100%;
    width: 100%;
}

/* Force fixed header - works regardless of overflow on parents */
.site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
}

/* Push body content down so it doesn't hide under fixed header */
/* Push body content down so it doesn't hide under fixed header */
body.home-page {
    padding-top: 70px !important;
}

@media (max-width: 768px) {
    body.home-page {
        padding-top: 120px !important;
    }
}

/* Feature cards as links — reset anchor styles */
a.feature-block {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

a.feature-block:visited,
a.feature-block:focus {
    color: inherit;
    text-decoration: none;
}

/* Green glow for secondary buttons */
.hero-cta .btn-secondary,
.header-auth .btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 217, 126, 0.3);
    box-shadow: 0 0 15px rgba(0, 217, 126, 0.15), inset 0 0 15px rgba(0, 217, 126, 0.05);
}
.hero-cta .btn-secondary:hover,
.header-auth .btn-secondary:hover {
    border-color: rgba(0, 217, 126, 0.6);
    box-shadow: 0 0 25px rgba(0, 217, 126, 0.3);
    color: var(--primary);
}

/* Also target hero-buttons container */
.hero-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 217, 126, 0.3);
    box-shadow: 0 0 15px rgba(0, 217, 126, 0.15), inset 0 0 15px rgba(0, 217, 126, 0.05);
}
.hero-buttons .btn-secondary:hover {
    border-color: rgba(0, 217, 126, 0.6);
    box-shadow: 0 0 25px rgba(0, 217, 126, 0.3);
    color: var(--primary);
}


/* ============================================================
   HOVER ANIMATIONS — Interactive Elements
   ============================================================ */

/* --- Testimonial Cards --- */
@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0.6); }
    50%       { box-shadow: 0 0 0 8px rgba(0, 217, 126, 0); }
}

@keyframes starPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.testimonial-card,
.testimonial {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

.testimonial-card:hover,
.testimonial:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 24px rgba(0, 217, 126, 0.35), 0 0 60px rgba(0, 217, 126, 0.12), 0 16px 40px rgba(0,0,0,0.5);
    border-color: var(--primary);
}

.testimonial-card:hover .testimonial-avatar,
.testimonial:hover .testimonial-avatar {
    animation: avatarPulse 1.2s ease-in-out infinite;
}

.testimonial-card:hover .testimonial-rating span:nth-child(1),
.testimonial:hover .testimonial-rating span:nth-child(1) { animation: starPop 0.4s ease 0.0s both; }
.testimonial-card:hover .testimonial-rating span:nth-child(2),
.testimonial:hover .testimonial-rating span:nth-child(2) { animation: starPop 0.4s ease 0.07s both; }
.testimonial-card:hover .testimonial-rating span:nth-child(3),
.testimonial:hover .testimonial-rating span:nth-child(3) { animation: starPop 0.4s ease 0.14s both; }
.testimonial-card:hover .testimonial-rating span:nth-child(4),
.testimonial:hover .testimonial-rating span:nth-child(4) { animation: starPop 0.4s ease 0.21s both; }
.testimonial-card:hover .testimonial-rating span:nth-child(5),
.testimonial:hover .testimonial-rating span:nth-child(5) { animation: starPop 0.4s ease 0.28s both; }

/* --- Statistics --- */
@keyframes statBorderSpin {
    0%, 100% { border-color: rgba(0, 217, 126, 0.2); box-shadow: 0 0 12px rgba(0, 217, 126, 0.1), inset 0 0 12px rgba(0, 217, 126, 0.05); }
    50%       { border-color: rgba(0, 217, 126, 0.7); box-shadow: 0 0 30px rgba(0, 217, 126, 0.35), inset 0 0 20px rgba(0, 217, 126, 0.1); }
}

.stat {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    border: 1px solid transparent;
}

.stat:hover {
    animation: statBorderSpin 1.8s ease-in-out infinite;
    background: rgba(0, 217, 126, 0.06);
}

.stat:hover .stat-number {
    transform: scale(1.1);
    filter:
        drop-shadow(0 0 8px rgba(0, 217, 126, 1))
        drop-shadow(0 0 20px rgba(0, 217, 126, 0.8))
        drop-shadow(0 0 40px rgba(0, 217, 126, 0.5));
    text-shadow: none;
}

.stat.is-visible:hover {
    transform: none !important;
    border-color: rgba(0, 217, 126, 0.4);
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.3), inset 0 0 20px rgba(0, 217, 126, 0.08);
}

/* --- Steps (How It Works) --- */
@keyframes orbitRing {
    0%   { transform: rotate(0deg) scale(1); opacity: 0.7; }
    50%  { transform: rotate(180deg) scale(1.15); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.7; }
}

.step {
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid transparent;
}

.step:hover {
    transform: scale(1.1);
    border-color: rgba(0, 217, 126, 0.3);
    background: rgba(0, 217, 126, 0.05);
    box-shadow: 0 0 25px rgba(0, 217, 126, 0.15), inset 0 0 20px rgba(0, 217, 126, 0.04);
}

.step:hover h3 {
    color: var(--primary);
    text-shadow: 0 0 12px rgba(0, 217, 126, 0.6);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.step-number {
    position: relative;
    transition: transform 0.35s ease;
}

.step-number::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 217, 126, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.15);
}

.step:hover .step-number::after {
    opacity: 1;
    animation: orbitRing 2s linear infinite;
}

/* --- CTA Buttons --- */

/* btn-primary shimmer — определён в style.css глобально */

/* btn-secondary: border draw + glow */
.btn-secondary {
    position: relative;
    transition: color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: 0 0 18px rgba(0, 217, 126, 0.4), inset 0 0 18px rgba(0, 217, 126, 0.08) !important;
}

/* --- CTA checkmark features animation --- */
@keyframes checkGlow {
    0%, 100% {
        text-shadow:
            0 0 4px rgba(0, 217, 126, 0.4),
            0 0 8px rgba(0, 217, 126, 0.2);
        transform: scale(1);
        color: var(--primary);
    }
    50% {
        text-shadow:
            0 0 14px rgba(0, 217, 126, 1),
            0 0 30px rgba(0, 217, 126, 0.9),
            0 0 55px rgba(0, 217, 126, 0.6),
            0 0 80px rgba(0, 217, 126, 0.3);
        transform: scale(1.4);
        color: #fff;
    }
}

@keyframes featureFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cta-extra {
    animation: featureFadeIn 0.6s ease both;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.cta-extra .cta-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.cta-extra:hover {
    transform: scale(1.05);
}

.cta-check {
    display: inline-block;
    color: var(--primary);
    animation: checkGlow 2s ease-in-out infinite;
    font-weight: 700;
    font-size: 1.4rem;
}

/* stagger delays for each checkmark */
.cta-extra .cta-check:nth-child(1) { animation-delay: 0s; }
.cta-extra .cta-check:nth-child(2) { animation-delay: 0.65s; }
.cta-extra .cta-check:nth-child(3) { animation-delay: 1.3s; }

/* on hover — freeze all checks at max glow */
.cta-extra:hover .cta-check {
    animation-play-state: paused;
    text-shadow:
        0 0 14px rgba(0, 217, 126, 1),
        0 0 30px rgba(0, 217, 126, 0.9),
        0 0 55px rgba(0, 217, 126, 0.5);
    transform: scale(1.35);
    color: #fff;
}


/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */

/* Base hidden state — все анимируемые элементы начинают скрытыми */
.reveal {
    opacity: 0;
    will-change: opacity, transform;
}

/* --- Fade up (заголовки секций, параграфы) --- */
.reveal-fade-up {
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Fade in (общий) --- */
.reveal-fade {
    transition: opacity 0.6s ease;
}

/* --- Slide from left --- */
.reveal-left {
    transform: translateX(-60px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Slide from right --- */
.reveal-right {
    transform: translateX(60px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Scale up (карточки) --- */
.reveal-scale {
    transform: scale(0.85) translateY(30px);
    transition: opacity 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Flip in (шаги) --- */
.reveal-flip {
    transform: perspective(600px) rotateX(25deg) translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Активное состояние — элемент виден */
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger delays для дочерних элементов */
.stagger-children > *:nth-child(1)  { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.15s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.25s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.35s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.45s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.55s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.65s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.75s; }

/* --- Счётчик статистики --- */
.stat-number[data-target] {
    transition: color 0.3s ease;
}

/* --- Линия-разделитель с анимацией ширины --- */
.reveal-line {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    display: block;
    margin: 0 auto 2rem;
}

.reveal-line.is-visible {
    width: 80px;
}

/* --- Glow pulse при появлении --- */
@keyframes revealGlow {
    0%   { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0); }
    40%  { box-shadow: 0 0 30px 8px rgba(0, 217, 126, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0); }
}

.reveal-scale.is-visible {
    animation: revealGlow 0.9s ease 0.3s both;
}

/* Отключить анимации для пользователей с prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-fade-up,
    .reveal-fade,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-flip {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .reveal-line {
        width: 80px !important;
    }
}

/* === Hover-эффекты для элементов после scroll-reveal анимации ===
   Используем .is-visible чтобы специфичность была выше чем у .reveal.is-visible */

.feature-block.is-visible:hover,
.feature-card.is-visible:hover {
    transform: scale(1.1) !important;
    box-shadow: var(--shadow-glow);
}

.step.is-visible:hover {
    transform: scale(1.1) !important;
    border-color: rgba(0, 217, 126, 0.25);
    box-shadow: 0 12px 30px rgba(0, 217, 126, 0.15);
}

.stat.is-visible:hover {
    transform: none !important;
    border-color: rgba(0, 217, 126, 0.4);
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.3), inset 0 0 20px rgba(0, 217, 126, 0.08);
}

.testimonial-card.is-visible:hover,
.testimonial.is-visible:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 0 24px rgba(0, 217, 126, 0.35), 0 0 60px rgba(0, 217, 126, 0.12), 0 16px 40px rgba(0,0,0,0.5);
}

.faq-item.is-visible:hover {
    transform: scale(1.02) !important;
    border-color: var(--primary);
}

.cta-extra.is-visible:hover {
    transform: scale(1.1) !important;
}


/* ============================================
   Blur матрицы через CSS filter на canvas
   Работает т.к. canvas — sibling элемент
   ============================================ */
.how-it-works .matrix-canvas,
.testimonials .matrix-canvas,
.final-cta .matrix-canvas,
.cta .matrix-canvas {
    filter: blur(4px);
}
