/* ==========================================
   Base Reset & Typography
   ========================================== */
body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #000; 
    color: #fff; 
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

canvas { 
    display: block; 
}

/* ==========================================
   Splash Screen (Engraved Mask + Credits)
   ========================================== */
#loader-overlay {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100vh;
    background-color: #000; 
    z-index: 1000; 
    display: flex; justify-content: center; align-items: center;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

#loader-overlay.loaded { 
    transform: translateY(-100vh); 
    pointer-events: none; 
}

#loader-content-mask {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    text-align: center;
}

/* Main animated gradient title */
#loader-title-big {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: clamp(2.5rem, 6vw, 8rem);
    font-weight: 300;
    text-transform: none;
    letter-spacing: -4px;
    margin: 0;
    white-space: nowrap;
    background: linear-gradient(-45deg, #ff2400 0%, #e81d1d 25%, #b224ef 50%, #ffbd55 75%, #ff2400 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(-2px -2px 2px rgba(0,0,0,0.9)) drop-shadow(1px 1px 1px rgba(255,255,255,0.15));
    animation: flow-liquid 6s ease-in-out infinite alternate;
}

/* Author signature */
#loader-credits {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.5rem);
    font-weight: 300;
    color: rgb(255, 255, 255); 
    letter-spacing: -1px; 
    margin: 10px 0 0 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes flow-liquid {
    0% { background-position: 0% 50%; transform: scale(0.98); }
    100% { background-position: 100% 50%; transform: scale(1); }
}

/* ==========================================
   User Interface (UI) Elements
   ========================================== */
#ui-title { 
    position: absolute; 
    top: 24px; left: 28px; 
    z-index: 10; 
    font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 2.5px; 
    color: rgba(255, 255, 255, 0.6); pointer-events: none; 
}

/* Floating Toggle Button */
#nav-toggle {
    position: absolute; top: 24px; right: 28px; z-index: 30; width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.03); 
    backdrop-filter: blur(50px) saturate(150%) brightness(1.1); 
    -webkit-backdrop-filter: blur(50px) saturate(150%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.4); border-left: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1);
    color: #fff; cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); opacity: 0; pointer-events: none; 
}
body.ready #nav-toggle { opacity: 1; pointer-events: auto; }
#nav-toggle:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.05); border-top: 1px solid #fff; border-left: 1px solid #fff; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.2); }

/* Navigation Menu */
#nav-menu {
    position: absolute; top: 80px; right: 28px; width: 220px; z-index: 10;
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(50px) saturate(150%) brightness(1.1); -webkit-backdrop-filter: blur(50px) saturate(150%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.4); border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px; padding: 20px 0;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform: translateX(300px); opacity: 0; pointer-events: none; transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#nav-menu.open { transform: translateX(0); opacity: 1; pointer-events: auto; }

#nav-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: rgba(255, 255, 255, 0.5); padding: 0 24px; margin-bottom: 12px; }
#nav-list { list-style: none; padding: 0; margin: 0; }
#nav-list li { padding: 12px 24px; font-size: 14px; font-weight: 500; color: #fff; cursor: pointer; transition: all 0.3s ease; border-left: 3px solid transparent; }
#nav-list li:hover { background: rgba(255, 255, 255, 0.08); color: #00e5ff; border-left: 3px solid #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
#nav-list li.active { background: rgba(0, 229, 255, 0.15); color: #00e5ff; border-left: 3px solid #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }

/* Back Button (Desktop Default) */
#btn-back {
    position: absolute; top: 30px; left: 50%; transform: translateX(-50%) translateY(-50px); z-index: 20; padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(50px) saturate(150%) brightness(1.1); -webkit-backdrop-filter: blur(50px) saturate(150%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.4); border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: 0.5px; text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    cursor: pointer; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); opacity: 0; pointer-events: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1);
}
#btn-back.visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
#btn-back:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(-50%) scale(1.05); border-top: 1px solid #fff; border-left: 1px solid #fff; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.2); }

/* Information Panel (Desktop Default) */
#info-panel {
    position: absolute; top: 70px; left: 24px; width: 320px; padding: 28px; z-index: 10;
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(50px) saturate(150%) brightness(1.1); -webkit-backdrop-filter: blur(50px) saturate(150%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.4); border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px; 
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1); 
    opacity: 0; transform: translateX(-30px); transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); pointer-events: none; 
}
#info-panel.visible { opacity: 1; transform: translateX(0); pointer-events: auto; }

#info-title { font-size: 32px; font-weight: 800; margin: 0 0 2px 0; color: #fff; letter-spacing: -0.5px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
#info-type { font-size: 13px; color: #00e5ff; font-weight: 600; margin-bottom: 24px; letter-spacing: 0.5px; text-shadow: 0 0 10px rgba(0,229,255,0.4); }
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.1);}
.info-label { color: rgba(255, 255, 255, 0.6); font-weight: 500; }
.info-value { color: #fff; font-weight: 600; text-align: right; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.info-row:nth-last-of-type(2) { border-bottom: none; padding-bottom: 0; }
#info-desc { text-align: left; font-size: 14px; color: rgba(255, 255, 255, 0.85); line-height: 1.6; font-weight: 400; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }

#btn-explore {
    margin-top: 24px; width: 100%; padding: 14px; background: rgba(0, 229, 255, 0.1); border: 1px solid rgba(0, 229, 255, 0.3); border-radius: 14px;
    color: #00e5ff; font-size: 15px; font-weight: 600; letter-spacing: 0.5px; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
#btn-explore:hover { background: rgba(0, 229, 255, 0.3); color: #fff; transform: scale(1.03); border: 1px solid #00e5ff; box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4); text-shadow: none; }

/* ==========================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ========================================== */

/* TABLET (max 1024px) */
@media (max-width: 1024px) {
    #info-panel {
        width: 280px; 
        padding: 24px;
    }
    #loader-title-big {
        white-space: normal;
        text-align: center;
    }
}

/* MOBILE (max 768px) */
@media (max-width: 768px) {
    
    
    #ui-title {
        top: 20px; left: 20px;
        font-size: 11px;
    }

    #nav-toggle {
        top: 20px; right: 20px;
        width: 40px; height: 40px;
    }

    #nav-menu {
        top: 70px; right: 20px;
        width: calc(100vw - 40px); 
        max-width: 300px;
    }
    #info-panel {
        top: auto; 
        bottom: 20px; 
        left: 20px; 
        width: calc(100% - 40px); 
        box-sizing: border-box; 
        padding: 20px;
        border-radius: 20px;
        transform: translateY(150%);
    }
    #info-panel.visible { 
        transform: translateY(0); 
    }
    #info-title { font-size: 26px; }
    #info-desc { font-size: 13px; margin-top: 10px; }
    #btn-explore { padding: 12px; margin-top: 15px; }
    #btn-back {
        top: auto; 
        bottom: 40px; 
       
        transform: translateX(-50%) translateY(100px); 
        padding: 12px 24px;
        font-size: 13px;
        width: max-content;
    }
    #btn-back.visible { 
        transform: translateX(-50%) translateY(0); 
    }
    #loader-title-big {
        letter-spacing: -2px; 
    }
}