/* ============================================================
 * RETURN TO ORIGIN ENGINE™ — SIGNATURE HASKARI INTERACTIVE SYSTEM
 * Scoped, high-performance, GPU-friendly animations.
 * ============================================================ */

.origin-engine {
    position: fixed !important;
    bottom: 32px !important;
    right: 32px !important;
    z-index: 9999 !important;
    cursor: pointer !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Default state: dormant vertical energy line */
    width: 2px !important;
    height: 80px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    
    /* Compaction transition */
    transition: 
        width 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.4s ease !important;
}

/* Active & Compacted State */
.origin-engine.is-active {
    width: 48px !important;
    height: 48px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Dormant Light Fiber State */
.origin-engine.is-dormant {
    opacity: 0.35 !important;
    width: 2px !important;
    height: 80px !important;
    pointer-events: none !important;
}

/* Container Wrapper supporting cursor magnetic translations */
.origin-engine__wrapper {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    will-change: transform !important;
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) !important;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Inner Glassmorphic Core Container */
.origin-engine__core {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(8, 8, 12, 0.85) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 50% !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.6), 
        inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
    overflow: hidden !important;
    z-index: 2 !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Dormant State visual core fiber/dot */
.origin-engine__dot {
    position: absolute !important;
    width: 3px !important;
    height: 3px !important;
    background: #ffb800 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px #ffb800 !important;
    z-index: 4 !important;
    transition: transform 0.5s ease, opacity 0.5s ease !important;
}

/* Active Core Compacted: Dot transforms into tiny pulsing nucleus */
.origin-engine.is-active .origin-engine__dot {
    width: 4px !important;
    height: 4px !important;
    background: #00d4ff !important;
    box-shadow: 0 0 8px #00d4ff !important;
}

/* Slow breathing ambient glow inside core */
.origin-engine__breathing {
    position: absolute !important;
    width: 60% !important;
    height: 60% !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%) !important;
    animation: coreBreathing 4s infinite alternate ease-in-out !important;
    z-index: 3 !important;
    pointer-events: none !important;
    will-change: transform, opacity !important;
}

@keyframes coreBreathing {
    0% {
        transform: scale(0.85);
        opacity: 0.4;
        background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%) !important;
    }
    100% {
        transform: scale(1.15);
        opacity: 0.9;
        background: radial-gradient(circle, rgba(255, 184, 0, 0.15) 0%, transparent 70%) !important;
    }
}

/* Circular SVG Progress Ring surrounding Core */
.origin-engine__progress {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    transform: rotate(-90deg) !important; /* Start progress from top */
    pointer-events: none !important;
}

.origin-engine__bar {
    stroke-linecap: round !important;
    transition: stroke-dashoffset 0.1s ease !important;
    will-change: stroke-dashoffset !important;
}

/* Proximity Aura / Ambient Backlight Glow */
.origin-engine__aura {
    position: absolute !important;
    inset: -12px !important;
    background: radial-gradient(circle, rgba(255, 184, 0, 0.08) 0%, transparent 70%) !important;
    opacity: 0.5 !important;
    z-index: 1 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, background 0.3s ease !important;
}

/* Proximity attraction visual trigger */
.origin-engine.is-near .origin-engine__aura {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 70%) !important;
    opacity: 1 !important;
}

.origin-engine.is-near .origin-engine__core {
    border-color: rgba(0, 212, 255, 0.25) !important;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.7), 
        0 0 20px rgba(0, 212, 255, 0.15) !important;
}

/* Active Hover state visual tension */
.origin-engine:hover .origin-engine__core {
    transform: scale(1.08) !important;
    border-color: rgba(255, 184, 0, 0.4) !important;
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.8), 
        0 0 25px rgba(255, 184, 0, 0.25) !important;
}

.origin-engine:hover .origin-engine__aura {
    background: radial-gradient(circle, rgba(255, 184, 0, 0.18) 0%, transparent 70%) !important;
    opacity: 1 !important;
}

/* Phase A — Preparation (Short Clic micro-contraction) */
.origin-engine.is-preparing .origin-engine__core {
    transform: scale(0.8) !important;
    border-color: rgba(0, 212, 255, 0.7) !important;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.5), 
        0 0 35px rgba(0, 212, 255, 0.5) !important;
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.12s ease, box-shadow 0.12s ease !important;
}

.origin-engine.is-preparing .origin-engine__dot {
    transform: scale(2.5) !important;
    background: #fff !important;
    box-shadow: 0 0 15px #fff !important;
}

/* Phase C & Exit — Dissolving State */
.origin-engine.is-dissolving {
    pointer-events: none !important;
    animation: dissolveOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes dissolveOut {
    0% {
        transform: scale(1) translateY(0) !important;
        opacity: 1 !important;
    }
    30% {
        /* Compress horizontally into vertical needle thread */
        transform: scaleX(0.04) scaleY(1.8) translateY(-10px) !important;
        opacity: 0.8 !important;
    }
    100% {
        /* Dissolve into system upwardly */
        transform: scaleX(0.01) scaleY(3) translateY(-40px) !important;
        opacity: 0 !important;
        filter: blur(6px) !important;
    }
}

/* Intelligent Conscious State (Polite fade-out during manual scroll up) */
.origin-engine.is-anticipating {
    opacity: 0.25 !important;
}

/* ============================================================
 * MOBILE CUSTOMIZATION — NO CURSOR PROXIMITY MAGNET
 * ============================================================ */
@media (max-width: 768px) {
    .origin-engine {
        bottom: 24px !important;
        right: 24px !important;
    }
    
    .origin-engine__wrapper {
        transform: none !important;
        transition: none !important;
    }
}
