/*
 * animations.css - 씨랭크 애니메이션 스타일시트
 * Cosmic visual effects and transitions
 * /assets/css/animations.css
 */

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   COSMIC GLOW EFFECTS
   ============================================ */
@keyframes cosmic-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.2),
                    0 0 40px rgba(118, 75, 162, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.4),
                    0 0 60px rgba(118, 75, 162, 0.2);
    }
}

@keyframes cosmic-border {
    0% { border-color: rgba(102, 126, 234, 0.3); }
    33% { border-color: rgba(118, 75, 162, 0.3); }
    66% { border-color: rgba(240, 147, 251, 0.3); }
    100% { border-color: rgba(102, 126, 234, 0.3); }
}

.glow-effect {
    animation: cosmic-glow 3s ease-in-out infinite;
}

.border-glow {
    animation: cosmic-border 4s ease-in-out infinite;
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    50% { transform: translateY(-15px) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.float {
    animation: float 4s ease-in-out infinite;
}

.float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.float-gentle {
    animation: float-gentle 3s ease-in-out infinite;
}

/* ============================================
   PULSE ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   GRADIENT ANIMATION
   ============================================ */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

/* ============================================
   SHIMMER EFFECT
   ============================================ */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 3s ease-in-out infinite;
}

/* ============================================
   STAR TWINKLE
   ============================================ */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes twinkle-slow {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

.star {
    animation: twinkle 2s ease-in-out infinite;
}

.star-slow {
    animation: twinkle-slow 4s ease-in-out infinite;
}

/* ============================================
   PLANET RING ANIMATION
   ============================================ */
@keyframes planet-ring-rotate {
    0% { transform: rotateX(75deg) rotateZ(0deg); }
    100% { transform: rotateX(75deg) rotateZ(360deg); }
}

@keyframes planet-ring-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.planet-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: planet-ring-rotate 20s linear infinite;
}

.planet-ring-1 {
    width: 300px;
    height: 300px;
    border-color: rgba(102, 126, 234, 0.3);
    animation-duration: 15s;
}

.planet-ring-2 {
    width: 400px;
    height: 400px;
    border-color: rgba(118, 75, 162, 0.2);
    animation-duration: 20s;
    animation-direction: reverse;
}

.planet-ring-3 {
    width: 500px;
    height: 500px;
    border-color: rgba(240, 147, 251, 0.15);
    animation-duration: 25s;
}

/* ============================================
   NEBULA DRIFT ANIMATION
   ============================================ */
@keyframes nebula-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(30px, -20px) scale(1.1); opacity: 0.4; }
    50% { transform: translate(-20px, 30px) scale(0.95); opacity: 0.35; }
    75% { transform: translate(20px, 20px) scale(1.05); opacity: 0.3; }
}

@keyframes nebula-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
    33% { transform: translate(-40px, -30px) scale(1.15); opacity: 0.35; }
    66% { transform: translate(40px, 20px) scale(0.9); opacity: 0.2; }
}

@keyframes nebula-drift-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
    50% { transform: translate(20px, -40px) rotate(10deg); opacity: 0.35; }
}

/* ============================================
   ENERGY ABSORB ANIMATION
   ============================================ */
@keyframes energy-absorb {
    0% { transform: scale(1.5); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: scale(0.3); opacity: 0; }
}

@keyframes energy-ring {
    0% { transform: scale(0.5); opacity: 0; border-width: 4px; }
    50% { opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; border-width: 1px; }
}

@keyframes energy-core-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(102, 126, 234, 0.5); }
    50% { transform: scale(1.2); box-shadow: 0 0 40px rgba(102, 126, 234, 0.8); }
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary); }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typewriter 3s steps(30) 1s both,
               blink-caret 0.75s step-end infinite;
}

/* ============================================
   COUNTER ANIMATION SUPPORT
   ============================================ */
.counter-animated {
    transition: all 0.1s ease-out;
}

/* ============================================
   PARALLAX LAYERS
   ============================================ */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ============================================
   MAGNETIC BUTTON EFFECT
   ============================================ */
.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   SMOOTH UNDERLINE HOVER
   ============================================ */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-cosmic);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* ============================================
   CARD TILT EFFECT SUPPORT
   ============================================ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

.tilt-card-inner {
    transform: translateZ(30px);
}

/* ============================================
   PAGE TRANSITION
   ============================================ */
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: page-enter 0.6s ease-out;
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-cosmic);
    z-index: 99999;
    transition: width 0.1s ease-out;
    will-change: width;
}

/* ============================================
   COSMIC PARTICLE STYLES
   ============================================ */
.cosmic-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
}

.cosmic-particle.large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px rgba(102, 126, 234, 0.5);
}

.cosmic-particle.bright {
    box-shadow: 0 0 10px rgba(240, 147, 251, 0.6);
}

/* ============================================
   IMAGE LAZY LOAD
   ============================================ */
.lazy-image {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ============================================
   HOVER CARD SHINE
   ============================================ */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 60%
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.card-shine:hover::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* ============================================
   MORPHING SHAPE (Decorative)
   ============================================ */
@keyframes morph {
    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% 50% 70% 60%;
    }
    75% {
        border-radius: 60% 30% 50% 40% / 70% 40% 50% 60%;
    }
}

.morph-shape {
    animation: morph 8s ease-in-out infinite;
}

/* ============================================
   MARQUEE / TICKER
   ============================================ */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-track {
    display: flex;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee-track:hover {
    animation-play-state: paused;
}
