@font-face {
    font-family: planet;
    src: url('./Fonts/SolarSystem.woff');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: planet, sans-serif;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000 url('https://www.transparenttextures.com/patterns/stardust.png'); /* Starry background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s;
    overflow: hidden;
}

#preloader::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    animation: drift 20s infinite linear;
    pointer-events: none;
}

@keyframes drift {
    from { transform: translate(-25%, -25%) rotate(0deg); }
    to { transform: translate(-25%, -25%) rotate(360deg); }
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    z-index: 10000;
}

.loader-circle {
    width: 100px;
    height: 100px;
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    position: relative;
    animation: spin 2s linear infinite;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.loader-circle::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #fff, 0 0 30px #a855f7;
}

.loader-text {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    animation: pulse 2s infinite ease-in-out;
}

.loader-bar-container {
    width: 250px;
    height: 1px;
    background: rgba(168, 85, 247, 0.2);
    position: relative;
    overflow: hidden;
}

.loader-bar {
    position: absolute;
    width: 120px;
    height: 100%;
    background: linear-gradient(90deg, transparent, #a855f7, transparent);
    animation: scan 2s infinite ease-in-out;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; text-shadow: 0 0 10px #fff; }
}

@keyframes scan {
    from { left: -100px; }
    to { left: 200px; }
}


body,
html {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: #000;
}

canvas#canvas {
    display: block;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
}

canvas#canvas:active {
    cursor: grabbing;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Navigation */
nav {
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    pointer-events: auto;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

nav h2 {
    font-size: 25px;
    cursor: pointer;
    letter-spacing: 2px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    font-size: 14px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

nav ul li a:hover {
    color: #a855f7;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 100px;
    right: 2rem;
    color: #fff;
    text-align: right;
    pointer-events: auto;
    max-width: 350px;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    transition: opacity 0.3s ease;
}

.info-panel h1 {
    font-size: 2.5rem;
    color: #a855f7;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.info-panel p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.info-panel button {
    background: transparent;
    border: 1px solid #a855f7;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.info-panel button:hover {
    background: rgba(168, 85, 247, 0.2);
}

/* Controls Hint */
.controls-hint {
    position: absolute;
    bottom: 80px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    pointer-events: none;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    nav ul {
        display: none;
    }

    .info-panel {
        top: 80px;
        right: 1rem;
        left: 1rem;
        text-align: left;
        max-width: none;
    }
}

/* ===== INTRO LAYER STYLES ===== */
#introLayer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    overflow: hidden;
    background: black;
}

#introGalaxyCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 1.4s ease;
}

#introWarpCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#introContent {
    position: absolute;
    width: 100%;
    top: 30%;
    text-align: center;
    z-index: 10;
    transition: opacity 1.1s ease;
}

.sig-wrap {
    display: inline-block;
    opacity: 0;
    transition: opacity 1s ease;
    margin-top: 10px;
}

.sig-wrap.visible {
    opacity: 1;
}

.intro-subtitle {
    font-size: 22px;
    margin-top: 20px;
    opacity: 0;
    transition: opacity 1s ease;
    text-shadow: 0 0 30px rgba(80, 180, 255, 0.35);
    letter-spacing: 0.5px;
    color: white;
}

.intro-subtitle.visible {
    opacity: 0.85;
}

.goButton {
    margin-top: 32px;
    padding: 13px 42px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.07);
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 1s ease, background 0.25s, box-shadow 0.25s;
    letter-spacing: 3px;
    backdrop-filter: blur(6px);
    font-family: inherit;
}

.goButton.visible {
    opacity: 1;
}

.goButton:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 28px rgba(100, 200, 255, 0.28);
}

.intro-hint {
    position: absolute;
    bottom: 26px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.28);
    z-index: 10;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 1s ease;
}

.intro-hint.visible {
    opacity: 1;
}