/* =========================================================
   ANIMATIONS.CSS — Premium Animations for SP.A
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   CUSTOM CURSOR
   ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    cursor: none !important;
}

.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.15s ease, height 0.15s ease, background 0.15s ease, opacity 0.3s ease;
}
.cursor-ring {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(208, 188, 255, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                opacity 0.3s ease;
}
.cursor-dot.hovering {
    width: 10px;
    height: 10px;
    background: #ffffff;
}
.cursor-ring.hovering {
    width: 58px;
    height: 58px;
    border-color: rgba(208, 188, 255, 0.85);
}

/* ─────────────────────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────────────────────── */

@keyframes anim-fadeInUp {
    from { opacity: 0; transform: translateY(44px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes anim-fadeInLeft {
    from { opacity: 0; transform: translateX(-52px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes anim-fadeInRight {
    from { opacity: 0; transform: translateX(52px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes anim-scaleIn {
    from { opacity: 0; transform: scale(0.84); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes anim-gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes anim-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}
@keyframes anim-glowPulse {
    0%, 100% { box-shadow: 0 8px 24px -8px rgba(51, 78, 255, 0.55); }
    50%       { box-shadow: 0 14px 48px -4px rgba(51, 78, 255, 0.9),
                             0 0 70px -10px rgba(208, 188, 255, 0.35); }
}
@keyframes anim-shine {
    from { left: -120%; }
    to   { left: 160%; }
}
@keyframes anim-particleFly {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
@keyframes anim-morphBlob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50%       { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75%       { border-radius: 70% 30% 50% 50% / 40% 70% 30% 60%; }
}
@keyframes anim-borderGlow {
    0%, 100% { border-color: rgba(51, 78, 255, 0.25); }
    50%       { border-color: rgba(208, 188, 255, 0.5); }
}
@keyframes anim-liveBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}
@keyframes anim-auroraPulse {
    0%, 100% { opacity: 0.2; }
    50%       { opacity: 0.4; }
}

/* ─────────────────────────────────────────────────────────
   PAGE ENTRANCE
   ───────────────────────────────────────────────────────── */

main {
    animation: anim-fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    z-index: 2;
}

/* ─────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────── */

header {
    animation: anim-fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Nav link animated underline */
nav ul li a {
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 1px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
nav ul li a:hover::after {
    width: 100%;
}

/* Logo icon spin on hover */
.logo img {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.logo:hover img {
    transform: rotate(20deg) scale(1.12) !important;
}

/* ─────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────── */

#hero h1 {
    background: linear-gradient(90deg,
        var(--color-primary),
        #a78bfa,
        var(--color-accent),
        #60a5fa,
        var(--color-primary)
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: anim-fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both,
               anim-gradientFlow 7s 0.9s linear infinite;
}
#hero .hero-actions {
    animation: anim-fadeInUp 0.9s 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#hero .hero-server-ip {
    animation: anim-fadeInUp 0.9s 0.34s cubic-bezier(0.16, 1, 0.3, 1) both,
               anim-float 5s 1.25s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────
   SCROLL REVEAL SYSTEM
   ───────────────────────────────────────────────────────── */

.anim-reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-reveal.anim-revealed {
    opacity: 1;
    transform: translateY(0);
}

.anim-reveal-left {
    opacity: 0;
    transform: translateX(-48px);
    transition: opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-reveal-left.anim-revealed {
    opacity: 1;
    transform: translateX(0);
}

.anim-reveal-right {
    opacity: 0;
    transform: translateX(48px);
    transition: opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-reveal-right.anim-revealed {
    opacity: 1;
    transform: translateX(0);
}

.anim-reveal-scale {
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-reveal-scale.anim-revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.anim-delay-1 { transition-delay: 0.05s !important; }
.anim-delay-2 { transition-delay: 0.12s !important; }
.anim-delay-3 { transition-delay: 0.20s !important; }
.anim-delay-4 { transition-delay: 0.28s !important; }
.anim-delay-5 { transition-delay: 0.36s !important; }

/* ─────────────────────────────────────────────────────────
   CARDS — SHINE SWEEP & ICON ANIMATIONS
   ───────────────────────────────────────────────────────── */

/* Launcher feature cards */
.launcher-feature-card {
    position: relative;
    overflow: hidden;
}
.feature-icon {
    transition: transform 0.35s ease;
}
.launcher-feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(8deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Step cards */
.step-card {
    position: relative;
    overflow: hidden;
}
.step-card .step-icon {
    transition: transform 0.35s ease;
}
.step-card:hover .step-icon {
    transform: translateY(-6px) scale(1.14);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ─────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────── */

.btn-download.primary {
    animation: anim-glowPulse 3s ease-in-out infinite;
}

.launcher-download-block {
    animation: anim-borderGlow 4.5s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────
   FEED ITEMS
   ───────────────────────────────────────────────────────── */

.feed-item {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.feed-item:hover {
    transform: translateX(12px) !important;
}

/* Live badge red dot blink */
.feed-badge .material-icons {
    animation: anim-liveBlink 1.4s ease-in-out infinite;
    color: #ff4040 !important;
}

/* ─────────────────────────────────────────────────────────
   GALLERY
   ───────────────────────────────────────────────────────── */

.gallery-item {
    overflow: hidden;
    border-radius: 16px;
    transition: box-shadow 0.35s ease;
}
.gallery-item:hover {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
}
.gallery-item img {
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.4s ease !important;
}
.gallery-item:hover img {
    transform: scale(1.09) !important;
    filter: brightness(1.08) saturate(1.18) !important;
    opacity: 1 !important;
}

/* ─────────────────────────────────────────────────────────
   ABOUT PAGE
   ───────────────────────────────────────────────────────── */

/* Картинка — влетает с увеличением */
#about-hero img {
    animation: anim-fadeInLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.5s ease, filter 0.45s ease;
}
#about-hero img:hover {
    transform: scale(1.03);
    filter: brightness(1.08) saturate(1.15);
}

/* Заголовок — влетает + градиентный текст */
#about-hero .about-text h1 {
    background: linear-gradient(90deg,
        var(--color-primary),
        #a78bfa,
        var(--color-accent),
        #60a5fa,
        var(--color-primary)
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: anim-fadeInRight 0.9s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both,
               anim-gradientFlow 7s 1.1s linear infinite;
}

/* Параграфы и blockquote — влетают справа с задержкой */
#about-hero .about-text > p:nth-of-type(1) {
    animation: anim-fadeInRight 0.9s 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#about-hero .about-text > blockquote {
    animation: anim-fadeInRight 0.9s 0.44s cubic-bezier(0.16, 1, 0.3, 1) both,
               anim-borderGlow 3s ease-in-out infinite;
}
#about-hero .about-text > p:nth-of-type(2) {
    animation: anim-fadeInRight 0.9s 0.56s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Цитата — светящаяся граница */
#about-hero blockquote {
    position: relative;
    animation: anim-borderGlow 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}
#about-hero blockquote:hover {
    transform: translateX(6px);
}

/* ─────────────────────────────────────────────────────────
   CONTACT PAGE
   ───────────────────────────────────────────────────────── */

/* Картинка слева — влетает */
.contact-left-panel img {
    animation: anim-fadeInLeft 0.9s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.5s ease, filter 0.45s ease;
}
.contact-left-panel img:hover {
    transform: scale(1.02);
    filter: brightness(1.06) saturate(1.1);
}

/* Заголовок — градиент + влетает снизу */
#contact-hero h1 {
    background: linear-gradient(90deg,
        var(--color-primary),
        #a78bfa,
        var(--color-accent),
        #60a5fa,
        var(--color-primary)
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: anim-fadeInUp 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both,
               anim-gradientFlow 7s 1s linear infinite;
}

/* Подзаголовок */
#contact-hero p {
    animation: anim-fadeInUp 0.9s 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Соц. кнопки — scale in с задержкой */
.social-button {
    animation: anim-scaleIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background-color 0.3s ease !important;
}
.social-button:nth-child(1) { animation-delay: 0.38s; }
.social-button:nth-child(2) { animation-delay: 0.52s; }
.social-button:nth-child(3) { animation-delay: 0.66s; }
.social-button:nth-child(4) { animation-delay: 0.80s; }

.social-button.telegram:hover {
    box-shadow: 0 18px 52px rgba(0, 136, 204, 0.4) !important;
}

/* Деловые контакты */
.professional-contacts {
    animation: anim-fadeInUp 0.9s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Ссылка email */
.professional-contacts a {
    transition: color 0.25s ease, letter-spacing 0.25s ease;
}
.professional-contacts a:hover {
    letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────
   AURORA ENHANCED
   ───────────────────────────────────────────────────────── */

.aurora-layer {
    animation-timing-function: ease-in-out !important;
    will-change: transform, opacity;
}
.aurora-layer:nth-child(1) {
    animation: drift 18s infinite linear alternate,
               anim-auroraPulse 9s ease-in-out infinite !important;
}
.aurora-layer:nth-child(2) {
    animation: drift 23s infinite linear alternate-reverse,
               anim-auroraPulse 11s 2s ease-in-out infinite !important;
}
.aurora-layer:nth-child(3) {
    animation: drift 16s infinite linear alternate,
               anim-auroraPulse 8s 4s ease-in-out infinite !important;
}

/* ─────────────────────────────────────────────────────────
   AMBIENT HERO PARTICLES
   ───────────────────────────────────────────────────────── */

@keyframes anim-ambientFloat {
    0%   { transform: translateY(0)      translateX(0);            opacity: 0; }
    8%   { opacity: 0.7; }
    85%  { opacity: 0.25; }
    100% { transform: translateY(-220px) translateX(var(--drift)); opacity: 0; }
}

.ambient-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: anim-ambientFloat var(--dur, 5s) ease-in-out forwards;
}

/* ─────────────────────────────────────────────────────────
   CLICK PARTICLES
   ───────────────────────────────────────────────────────── */

.anim-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    animation: anim-particleFly var(--dur, 0.5s) ease-out both;
}

/* ─────────────────────────────────────────────────────────
   DECORATIVE BLOBS
   ───────────────────────────────────────────────────────── */

.anim-blob {
    position: absolute;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: anim-morphBlob 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.055;
    filter: blur(60px);
}

/* ─────────────────────────────────────────────────────────
   L: ANIMATED DOT GRID BACKGROUND
   ───────────────────────────────────────────────────────── */

@keyframes anim-dotGridDrift {
    0%   { background-position: 0px 0px; }
    100% { background-position: 28px 28px; }
}

.dot-grid-bg {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(
        circle,
        rgba(208, 188, 255, 0.11) 1px,
        transparent 1px
    );
    background-size: 28px 28px;
    animation: anim-dotGridDrift 7s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────
   J: GLASSMORPHISM CARDS
   ───────────────────────────────────────────────────────── */

.launcher-feature-card,
.step-card {
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    background: rgba(30, 30, 30, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
}


/* ─────────────────────────────────────────────────────────
   K: NEON GLOW
   ───────────────────────────────────────────────────────── */

/* Hero heading neon aura (drop-shadow works with gradient text) */
#hero h1 {
    filter: drop-shadow(0 0 28px rgba(208, 188, 255, 0.38))
            drop-shadow(0 0 64px rgba(51, 78, 255, 0.22));
    transform-origin: center top;
    will-change: transform;
}

/* Card icons — neon color + glow on hover */
.launcher-feature-card:hover .feature-icon .material-icons,
.step-card:hover .step-icon .material-icons {
    filter: drop-shadow(0 0 10px var(--color-primary));
    color: var(--color-primary);
    transition: filter 0.35s ease, color 0.35s ease;
}

/* Filled button neon glow */
.md-button--filled {
    box-shadow: 0 0 18px rgba(51, 78, 255, 0.45),
                0 8px 24px -8px rgba(51, 78, 255, 0.55) !important;
    transition: box-shadow 0.3s ease !important;
}
.md-button--filled:hover {
    box-shadow: 0 0 32px rgba(51, 78, 255, 0.75),
                0 0 64px rgba(208, 188, 255, 0.30),
                0 12px 36px -6px rgba(51, 78, 255, 0.80) !important;
}

/* Download button neon — replaces old glowPulse animation */
.btn-download.primary {
    animation: none !important;
    box-shadow: 0 0 22px rgba(51, 78, 255, 0.50),
                0 0 48px rgba(208, 188, 255, 0.22),
                0 8px 24px -8px rgba(51, 78, 255, 0.60) !important;
    transition: box-shadow 0.35s ease !important;
}
.btn-download.primary:hover {
    box-shadow: 0 0 36px rgba(51, 78, 255, 0.80),
                0 0 72px rgba(208, 188, 255, 0.38),
                0 12px 36px -4px rgba(51, 78, 255, 0.85) !important;
}
