/* ========== PREMIUM INTRO SECTION STYLES ========== */
/* Optimized: Modern CSS syntax, performance-focused animations */

/* Hero Title Premium with Animated Gradient */
.hero-title-premium {
    font-size: clamp(1.75rem, 5.5vw, 4rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 2rem;
}

.hero-title-premium .title-line {
    display: block;
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    filter: blur(10px);
    background: linear-gradient(
        135deg,
        #fbbf24 0%,
        #ffffff 30%,
        #fbbf24 60%,
        #f59e0b 100%
    );
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: premiumReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               gradientShift 8s ease infinite;
}

.title-line[data-delay="0"] { animation-delay: 0s; }
.title-line[data-delay="100"] { animation-delay: 0.1s; }
.title-line[data-delay="200"] { animation-delay: 0.2s; }

/* Цветные акценты в заголовке */
.hero-title-premium .text-blue-400,
.hero-title-premium .text-green-400 {
    background: none;
    -webkit-text-fill-color: currentColor;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes premiumReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.9);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.animate-premiumReveal {
    animation: premiumReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 3D Stats Cards - Using direct colors for reliability */
.stat-card-3d {
    position: relative;
    background: linear-gradient(
        135deg,
        rgb(251 191 36 / 0.05),
        rgb(22 22 22 / 0.8)
    );
    backdrop-filter: blur(20px);
    border: 1px solid rgb(251 191 36 / 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s ease;
    overflow: hidden;
    opacity: 0;
    animation: premiumReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    /* Performance: contain layout and paint */
    contain: layout style;
}

.stat-card-3d::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgb(251 191 36 / 0.15),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.stat-card-3d:hover::before {
    opacity: 1;
}

.stat-card-3d:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    box-shadow:
        0 20px 40px rgb(0 0 0 / 0.4),
        0 0 60px rgb(251 191 36 / 0.2);
}

.stat-icon-premium {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transform: translateZ(20px);
}

.stat-value-premium {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateZ(30px);
    margin-bottom: 0.375rem;
    text-align: center;
}

/* Цветные градиенты - direct values for performance */
.stat-value-premium.blue-gradient {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value-premium.green-gradient {
    background: linear-gradient(135deg, #34d399, #10b981);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value-premium.gold-gradient {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value-premium.purple-gradient {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value-premium.orange-gradient {
    background: linear-gradient(135deg, #fb923c, #f97316);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label-premium {
    font-size: 0.8125rem;
    color: rgb(255 255 255 / 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.stat-decoration {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(
        circle,
        rgb(251 191 36 / 0.2),
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(30px);
    animation: pulseGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Цветные glow эффекты */
.stat-decoration.blue-glow {
    background: radial-gradient(circle, rgb(96 165 250 / 0.25), transparent 70%);
}

.stat-decoration.green-glow {
    background: radial-gradient(circle, rgb(52 211 153 / 0.25), transparent 70%);
}

.stat-decoration.gold-glow {
    background: radial-gradient(circle, rgb(251 191 36 / 0.25), transparent 70%);
}

.stat-decoration.purple-glow {
    background: radial-gradient(circle, rgb(168 85 247 / 0.25), transparent 70%);
}

.stat-decoration.orange-glow {
    background: radial-gradient(circle, rgb(251 146 60 / 0.25), transparent 70%);
}

/* ========== MODERN PROGRESS BARS ========== */
.progress-container-modern {
    background: linear-gradient(
        135deg,
        rgb(22 22 22 / 0.9),
        rgb(30 30 30 / 0.7)
    );
    backdrop-filter: blur(40px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgb(251 191 36 / 0.1);
    position: relative;
    overflow: hidden;
}

.progress-container-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 30% 20%,
        rgb(251 191 36 / 0.1),
        transparent 60%
    );
    pointer-events: none;
}

.progress-track-modern {
    height: 16px;
    background: rgb(255 255 255 / 0.05);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.3);
}

.progress-fill-modern {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--color-from, #fbbf24),
        var(--color-to, #f59e0b)
    );
    border-radius: 8px;
    position: relative;
    animation: fillProgress 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fillProgress {
    to { width: var(--progress, 0%); }
}

.progress-fill-modern::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgb(255 255 255 / 0.4),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-glow-modern {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 30px;
    background: radial-gradient(
        ellipse,
        var(--color-to, #f59e0b),
        transparent
    );
    filter: blur(10px);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========== PREMIUM MAGNETIC CTA BUTTON ========== */
.cta-premium-magnetic {
    position: relative;
    padding: 1.25rem 3rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    animation: premiumReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cta-bg-magnetic {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50px;
    transition: all 0.4s ease;
    z-index: 0;
}

.cta-premium-magnetic:hover .cta-bg-magnetic {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    transform: scale(1.05);
}

.cta-border-magnetic {
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        135deg,
        #fbbf24,
        #f59e0b,
        #fbbf24
    );
    background-size: 200% 200%;
    border-radius: 52px;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    to { background-position: 200% center; }
}

.cta-content-magnetic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #000;
    z-index: 1;
}

.cta-icon-magnetic {
    fill: currentColor;
    transition: transform 0.3s ease;
}

.cta-premium-magnetic:hover .cta-icon-magnetic {
    transform: translateY(5px);
}

.cta-glow-magnetic {
    position: absolute;
    inset: -20px;
    background: radial-gradient(
        circle,
        rgb(251 191 36 / 0.4),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    filter: blur(30px);
}

.cta-premium-magnetic:hover .cta-glow-magnetic {
    opacity: 1;
    animation: glowPulse 1.5s ease-in-out infinite;
}

/* ========== GLASS CARD SUBTLE ========== */
.glass-card-subtle {
    background: rgb(22 22 22 / 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 0.05);
    transition: all 0.3s ease;
}

.glass-card-subtle:hover {
    background: rgb(22 22 22 / 0.6);
    border-color: rgb(255 255 255 / 0.1);
    transform: translateY(-2px);
}

/* Canvas backgrounds */
#meshGradient,
#particleSystem {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#meshGradient {
    filter: blur(60px);
    opacity: 0.8;
}

/* 5-column stats grid */
.stats-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 1280px) {
    .stats-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-grid-5 .stat-card-3d:nth-child(4),
    .stats-grid-5 .stat-card-3d:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 900px) {
    .stats-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid-5 .stat-card-3d:last-child {
        grid-column: 1 / -1;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 500px) {
    .stats-grid-5 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .stats-grid-5 .stat-card-3d:last-child {
        max-width: 100%;
    }
}

/* Compact stat cards for 5-column layout */
.stat-card-3d.compact {
    padding: 1.25rem 1rem;
}

.stat-card-3d.compact .stat-icon-premium {
    width: 44px;
    height: 44px;
    margin-bottom: 0.5rem;
}

.stat-card-3d.compact .stat-icon-premium i {
    width: 22px;
    height: 22px;
}

.stat-card-3d.compact .stat-value-premium {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-card-3d.compact .stat-label-premium {
    font-size: 0.6875rem;
    line-height: 1.3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hero-title-premium {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
        line-height: 1.2;
    }

    .stat-card-3d {
        padding: 1.5rem;
    }

    .stat-card-3d.compact {
        padding: 1.25rem;
    }

    .stat-card-3d.compact .stat-value-premium {
        font-size: 1.375rem;
    }

    .stat-value-premium {
        font-size: 2rem;
    }

    .progress-container-modern {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .cta-premium-magnetic {
        padding: 1rem 2rem;
        font-size: 0.75rem;
    }
}

/* Adaptive title line wrapping for mobile */
@media (max-width: 640px) {
    .hero-title-premium .title-line {
        display: inline;
    }
}

/* Extra small mobile devices */
@media (max-width: 390px) {
    .hero-title-premium {
        font-size: clamp(1.25rem, 9vw, 2rem);
    }

    .stat-card-3d {
        padding: 1.5rem 1rem;
        min-width: 0;
    }

    .stat-value-premium {
        font-size: 1.75rem;
    }

    .progress-container-modern {
        padding: 1.25rem 0.75rem;
    }
}

/* Small vertical viewports (laptops with 680-788px height) */
@media (max-height: 720px) {
    .hero-title-premium {
        font-size: clamp(1.5rem, 5vw, 3.5rem);
        line-height: 1.2;
    }

    .stat-card-3d {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .stat-icon-premium {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
    }

    .stat-value-premium {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .stat-label-premium {
        font-size: 0.75rem;
    }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
/* Reduce animations on reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .hero-title-premium .title-line,
    .stat-card-3d,
    .cta-premium-magnetic,
    .progress-fill-modern,
    .stat-decoration {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .progress-fill-modern {
        width: var(--progress, 0%);
    }
}
