/* ========================================
   HOMEPAGE ANIMATIONS — CINEMATIC ENTRANCE
   ======================================== */

/* ---- Scroll Reveal System ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ---- Hero Entrance ---- */
.hero-text h2 {
    opacity: 0;
    transform: translateY(30px);
    animation: heroTitleIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-text p {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.cta-buttons {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero-visual {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
    animation: heroVisualIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

@keyframes heroTitleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroVisualIn {
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ---- Header Slide Down ---- */
.main-header {
    animation: headerSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ---- Stat Cards Stagger ---- */
.stat-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.stat-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

/* ---- Stat Number Count-Up Glow ---- */
.stat-number {
    transition: text-shadow 0.3s;
}

.stat-card.revealed .stat-number {
    animation: statGlow 1.5s ease-out forwards;
}

@keyframes statGlow {
    0% { text-shadow: 0 0 20px rgba(0, 217, 179, 0.8); }
    100% { text-shadow: none; }
}

/* ---- Parallax Background Layers ---- */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 150%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(0, 217, 179, 0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(108, 92, 231, 0.04) 0%, transparent 60%);
    z-index: 1;
    animation: parallaxDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes parallaxDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, -20px) rotate(2deg); }
}

/* ---- Floating Particles Enhancement ---- */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(1px 1px at 20% 30%, rgba(0, 217, 179, 0.4), transparent),
        radial-gradient(1px 1px at 80% 20%, rgba(108, 92, 231, 0.3), transparent),
        radial-gradient(1px 1px at 50% 80%, rgba(0, 217, 179, 0.2), transparent),
        radial-gradient(1px 1px at 10% 70%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 90% 60%, rgba(0, 217, 179, 0.3), transparent);
    z-index: 1;
    pointer-events: none;
    animation: sparkle 8s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ---- Recruitment Section Glow Line ---- */
.recruitment-section {
    position: relative;
}

.recruitment-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.recruitment-section.revealed::before {
    width: 60%;
}

/* ---- Ambient Music Toggle ---- */
.music-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 25, 35, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.music-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 217, 179, 0.2);
}

.music-toggle.playing {
    border-color: var(--primary);
    color: var(--primary);
    animation: musicPulse 2s ease-in-out infinite;
}

.music-toggle.playing .music-icon-off { display: none; }
.music-toggle .music-icon-on { display: none; }
.music-toggle.playing .music-icon-on { display: block; }

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 217, 179, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(0, 217, 179, 0.4); }
}

/* Sound bars animation */
.sound-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.sound-bar {
    width: 3px;
    background: var(--primary);
    border-radius: 1px;
    animation: soundBar 0.8s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.sound-bar:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.sound-bar:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.sound-bar:nth-child(4) { height: 90%; animation-delay: 0.1s; }

@keyframes soundBar {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

/* ---- Smooth Scroll ---- */
html {
    scroll-behavior: smooth;
}

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