/* ============================================================
   AETHERIA PVP — Animations V2
   Scroll reveals, tilt, transitions ultra-fluides
   ============================================================ */

/* ----- SCROLL REVEAL V2 ----- */
.reveal-text {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-card {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.reveal-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-card:nth-child(1) { transition-delay: 0s; }
.reveal-card:nth-child(2) { transition-delay: 0.1s; }
.reveal-card:nth-child(3) { transition-delay: 0.2s; }
.reveal-card:nth-child(4) { transition-delay: 0.3s; }

/* ----- PAGE TRANSITION OVERLAY V2 ----- */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: var(--bg-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s var(--ease-out-expo);
}

.page-transition-overlay.active {
    opacity: 1;
}

.page-transition-overlay.warp {
    animation: warp-effect 0.8s var(--ease-out-expo) forwards;
}

@keyframes warp-effect {
    0% { transform: scale(1) rotate(0deg); border-radius: 0; opacity: 0; }
    15% { opacity: 1; }
    40% { transform: scale(1.3) rotate(3deg); border-radius: 0; }
    70% { transform: scale(2) rotate(-2deg); border-radius: 50%; opacity: 0.8; }
    100% { transform: scale(3) rotate(5deg); border-radius: 50%; opacity: 0; }
}

/* ----- 3D TILT V2 ----- */
.tilt-3d {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
    perspective: 800px;
}

/* ----- TYPEWRITER V2 ----- */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-violet);
    white-space: nowrap;
    max-width: fit-content;
    animation: typewriter 3s steps(40) forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

/* ----- RIPPLE V2 ----- */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    animation: ripple-expand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    to { transform: scale(4); opacity: 0; }
}

/* ----- PARALLAX ----- */
.parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ----- COUNT UP ----- */
.stat-value[data-count] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stat-value[data-count].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----- SMOOTH ENTRY ----- */
@keyframes float-in {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glow-breath {
    0%, 100% { box-shadow: 0 0 20px rgba(176, 38, 255, 0.15); }
    50% { box-shadow: 0 0 40px rgba(176, 38, 255, 0.35), 0 0 60px rgba(0, 240, 255, 0.1); }
}

/* ----- GLOW ROTATION ----- */
@keyframes glow-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ----- SHOCKWAVE ----- */
@keyframes shockwave-expand {
    0% { transform: scale(0.5); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}

/* ----- SPARKLE ----- */
@keyframes sparkle-burst {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
    100% { opacity: 0; transform: scale(0.5) rotate(360deg); }
}

/* ----- HOVER GLOW ----- */
.hover-glow {
    transition: box-shadow 0.3s ease-out;
}
.hover-glow:hover {
    box-shadow: 0 0 30px var(--card-color, var(--accent-violet)),
                0 0 60px rgba(176, 38, 255, 0.08);
}

/* ----- MINI LOADER ----- */
.loader-mini {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid rgba(176, 38, 255, 0.15);
    border-top-color: var(--accent-violet);
    border-radius: 50%;
    animation: portal-spin 0.7s linear infinite;
}

/* ----- SHATTER ------ */
@keyframes shatter-out {
    0% { clip-path: inset(0); opacity: 1; }
    20% { clip-path: inset(0 0 40% 0); }
    40% { clip-path: inset(20% 40% 20% 0); }
    60% { clip-path: inset(40% 0 0 50%); }
    80% { clip-path: inset(60% 60% 0 20%); }
    100% { clip-path: inset(100% 100% 100% 100%); opacity: 0; }
}

.shatter {
    animation: shatter-out 0.8s ease-in forwards;
}

/* ----- FADE SLIDE ----- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----- SCALE IN ----- */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

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