/* ==========================================================================
   Animations & Interactions
   ========================================================================== */

/* --- Custom Cursor --- */
@media (pointer: fine) {
    .custom-cursor {
        position: fixed;
        top: 0; left: 0;
        width: 8px; height: 8px;
        background: var(--clr-primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        mix-blend-mode: exclusion;
        transition: width 0.2s, height 0.2s, background 0.2s;
    }

    .custom-cursor-follower {
        position: fixed;
        top: 0; left: 0;
        width: 40px; height: 40px;
        border: 1px solid var(--clr-accent-2);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9998;
        transition: width 0.3s, height 0.3s, background 0.3s, border 0.3s;
        /* Positioning handled via JS */
    }

    /* Hover States applied via JS class */
    .custom-cursor.hover {
        width: 40px; height: 40px;
        background: rgba(245, 200, 66, 0.2);
    }

    .custom-cursor-follower.hover {
        width: 60px; height: 60px;
        border-color: transparent;
        background: rgba(167, 139, 250, 0.1);
        backdrop-filter: blur(2px);
    }
}

/* Hide default cursor only if fine pointer */
@media (pointer: fine) {
    body, a, button, input, select, textarea {
        cursor: none !important;
    }
}

/* --- Page Loader --- */
.loader-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--clr-bg-dark);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    margin-bottom: 2rem;
    animation: pulse 2s infinite ease-in-out;
}

.rocket-path {
    animation: draw 2s ease-in-out infinite alternate;
}

.loader-text {
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--clr-primary);
    animation: blink 1.5s infinite;
}

/* --- Keyframes --- */
@keyframes draw {
    from { stroke-dashoffset: 300; }
    to { stroke-dashoffset: 0; }
}

@keyframes pulse {
    0% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(245, 200, 66, 0.2)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(245, 200, 66, 0.6)); }
    100% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(245, 200, 66, 0.2)); }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Scroll indicator animation */
.scroll-indicator {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.6;
    animation: fadeBounce 2s infinite;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid var(--clr-text-main);
    border-radius: 12px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 6px;
    background: var(--clr-primary);
    border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

@keyframes fadeBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}

/* --- Flip Card (About) --- */
.flip-card {
    perspective: 1000px;
    height: 180px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: var(--grad-primary);
    color: var(--clr-bg-dark);
    padding: 1rem;
}
.flip-card-back p { margin: 0; font-weight: 500;}

/* --- 3D Hover Effect for Bento Grid --- */
.group-hover-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.group-hover-3d:hover .card-glow {
    opacity: 1;
}

/* GSAP Pre-setup */
.section-reveal {
    opacity: 0;
    transform: translateY(40px);
}
