/* ==========================================================================
   SPACE JOURNEY STYLING (Three.js & GSAP Interactive Cinematic Portal)
   ========================================================================== */

/* Normalize uploaded image scales to look clean and un-stretched */
.block-section img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* WebGL Background Canvas */
#webgl-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    pointer-events: none;
    background: radial-gradient(circle at center, #0B0A26 0%, #03030F 100%);
    opacity: 0.8;
}

/* Floating Audio Control */
.space-audio-control {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    background: rgba(13, 13, 27, 0.75);
    border: 1px solid rgba(250, 204, 21, 0.3);
    padding: 0.7rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(250, 204, 21, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.space-audio-control:hover {
    border-color: rgba(250, 204, 21, 0.8);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(250, 204, 21, 0.3);
    transform: scale(1.05);
}

.space-audio-control span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--primary);
    text-transform: uppercase;
}

/* Sound Wave Animation */
.sound-waves {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    width: 20px;
    height: 16px;
}

.sound-waves span {
    width: 2.5px;
    background-color: var(--primary);
    border-radius: 1px;
    transition: height 0.2s ease;
}

/* Dynamic height classes for the equalizer bars */
.sound-waves.active span:nth-child(1) {
    animation: soundBarWave 1.2s ease-in-out infinite;
}

.sound-waves.active span:nth-child(2) {
    animation: soundBarWave 0.8s ease-in-out infinite 0.2s;
}

.sound-waves.active span:nth-child(3) {
    animation: soundBarWave 1.4s ease-in-out infinite 0.1s;
}

.sound-waves.active span:nth-child(4) {
    animation: soundBarWave 1.0s ease-in-out infinite 0.3s;
}

.sound-waves:not(.active) span {
    height: 3px !important;
    animation: none !important;
}

@keyframes soundBarWave {

    0%,
    100% {
        height: 3px;
    }

    50% {
        height: 16px;
    }
}

/* Floating Astronaut Container */
.astronaut-space-wrapper {
    position: fixed;
    top: 50%;
    right: 12%;
    transform: translateY(-50%);
    width: 28vw;
    height: 28vw;
    max-width: 420px;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.25));
    transition: transform 0.1s ease-out;
}

.astronaut-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: floatAstronaut 8s ease-in-out infinite;
}

@keyframes floatAstronaut {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(4deg);
    }
}

/* Hologram styling for text and cards */
.hologram-card {
    background: rgba(13, 13, 27, 0.55) !important;
    border: 1px solid rgba(250, 204, 21, 0.2) !important;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.05), inset 0 0 15px rgba(250, 204, 21, 0.05) !important;
    backdrop-filter: blur(16px) !important;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hologram-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.4), transparent);
    animation: scanLinesEffect 4s linear infinite;
}

.hologram-card:hover {
    border-color: rgba(250, 204, 21, 0.55) !important;
    box-shadow: 0 0 35px rgba(250, 204, 21, 0.18), inset 0 0 20px rgba(250, 204, 21, 0.1) !important;
    transform: translateY(-5px);
}

/* HUD corners */
.hologram-card::after {
    content: 'HUD // ACTIVE';
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 0.52rem;
    font-family: monospace;
    letter-spacing: 1px;
    color: var(--primary);
    opacity: 0.4;
}

@keyframes scanLinesEffect {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(300px);
    }
}

/* Space HUD elements decoration */
.hud-line-decor {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: var(--primary);
    border-style: solid;
    pointer-events: none;
    opacity: 0.6;
}

.hud-tl {
    top: 12px;
    left: 12px;
    border-width: 1.5px 0 0 1.5px;
}

.hud-tr {
    top: 12px;
    right: 12px;
    border-width: 1.5px 1.5px 0 0;
}

.hud-bl {
    bottom: 12px;
    left: 12px;
    border-width: 0 0 1.5px 1.5px;
}

.hud-br {
    bottom: 12px;
    right: 12px;
    border-width: 0 1.5px 1.5px 0;
}

/* Custom split-text animations */
.space-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px) skewY(6deg);
    filter: blur(2px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.space-char.active {
    opacity: 1;
    transform: translateY(0) skewY(0);
    filter: blur(0);
}

/* Fix select dropdowns styling so options have a dark background */
select.form-input,
select.form-input option {
    background-color: #0c0b24 !important;
    color: #ffffff !important;
    border: 1px solid rgba(250, 204, 21, 0.3) !important;
}


/* Adjustments for normal landing layout to fit the astronaut */
@media (min-width: 992px) {

    /* Create space for the side astronaut */
    .block-section .container {
        max-width: 84% !important;
        margin-left: 5% !important;
        margin-right: auto !important;
    }

    .about-grid .grid {
        grid-template-columns: 1.1fr 0.9fr !important;
        gap: 4rem;
    }

    #blk_contact_001 .container {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 1200px !important;
    }
}

@media (max-width: 991px) {
    .astronaut-space-wrapper {
        width: 45vw;
        height: 45vw;
        top: 20%;
        right: 5%;
        opacity: 0.18;
        /* fade out on mobile to prevent blocking text */
    }
}