/* =============================================
   SPACE.CSS — Starchart Theme
   ============================================= */

/* =============================================
   Ringed Planet — Fixed Background Element
   ============================================= */

.ringed-planet {
    position: fixed;
    right: -25%;
    top: 50%;
    transform: translateY(-50%);
    width: 1200px;
    height: 1200px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

/* Planet sphere */
.planet-body {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at 35% 30%,
        #3a2860 0%,
        #1e1040 40%,
        #0d0820 80%,
        #050210 100%
    );
    box-shadow:
        inset -30px -10px 60px rgba(0, 0, 0, 0.8),
        inset 8px 8px 30px rgba(160, 32, 240, 0.15),
        0 0 80px rgba(160, 32, 240, 0.08),
        0 0 160px rgba(77, 166, 255, 0.04);
    /* Atmospheric bands */
    overflow: hidden;
}

.planet-body::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        repeating-linear-gradient(
            175deg,
            transparent,
            transparent 18px,
            rgba(160, 32, 240, 0.06) 18px,
            rgba(160, 32, 240, 0.06) 20px,
            transparent 20px,
            transparent 34px,
            rgba(77, 166, 255, 0.04) 34px,
            rgba(77, 166, 255, 0.04) 35px
        );
}

/* Terminator / dark side gradient */
.planet-body::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

/* Outer ring — tilted leftward via rotateY + rotateX */
.planet-ring {
    position: absolute;
    width: 1100px;
    height: 1100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg) rotateY(-25deg);
    border-radius: 50%;
    border: 2px solid rgba(160, 32, 240, 0.25);
    box-shadow:
        0 0 20px rgba(160, 32, 240, 0.1),
        inset 0 0 20px rgba(160, 32, 240, 0.05);
    /* Ring band via pseudo-elements */
}

.planet-ring::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 8px solid rgba(77, 166, 255, 0.08);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.06);
}

.planet-ring::after {
    content: "";
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    border: 3px solid rgba(160, 32, 240, 0.15);
}

/* Inner ring — tighter, slightly different angle */
.planet-ring-inner {
    width: 880px;
    height: 880px;
    border: 6px solid rgba(160, 32, 240, 0.12);
    box-shadow:
        0 0 12px rgba(160, 32, 240, 0.06),
        inset 0 0 12px rgba(77, 166, 255, 0.04);
}

.planet-ring-inner::before {
    border: 4px solid rgba(227, 181, 255, 0.06);
}

.planet-ring-inner::after {
    border: 2px solid rgba(77, 166, 255, 0.08);
}

/* Shadow cast by planet onto the ring (behind the planet) */
.planet-shadow {
    position: absolute;
    width: 320px;
    height: 1100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg) rotateY(-25deg) translateX(40px);
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.7) 0%,
        transparent 70%
    );
    z-index: 1;
    pointer-events: none;
}

/* Responsive — scale down on smaller screens */
@media (max-width: 1024px) {
    .ringed-planet {
        width: 800px;
        height: 800px;
        right: -30%;
    }
    .planet-body {
        width: 380px;
        height: 380px;
    }
    .planet-ring {
        width: 740px;
        height: 740px;
    }
    .planet-ring-inner {
        width: 580px;
        height: 580px;
    }
    .planet-shadow {
        width: 210px;
        height: 740px;
    }
}

@media (max-width: 640px) {
    .ringed-planet {
        width: 500px;
        height: 500px;
        right: -35%;
        opacity: 0.2;
    }
    .planet-body {
        width: 240px;
        height: 240px;
    }
    .planet-ring {
        width: 460px;
        height: 460px;
    }
    .planet-ring-inner {
        width: 360px;
        height: 360px;
    }
    .planet-shadow {
        width: 140px;
        height: 460px;
    }
}

/* Grid Pattern Background */
.bg-grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(160, 32, 240, 0.08) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(160, 32, 240, 0.08) 1px, transparent 1px);
    background-attachment: fixed;
}

/* Flicker on hover */
.flicker-animation:hover {
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Corner bracket decorations */
.corner-bracket {
    position: relative;
}

.corner-bracket::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid #a020f0;
    border-left: 2px solid #a020f0;
}

.corner-bracket::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #a020f0;
    border-right: 2px solid #a020f0;
}

/* Starfield Canvas */
#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* =============================================
   Custom Cursor — NASA Punk Double-Circle
   ============================================= */

@media (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }
}

@media (pointer: coarse) {
    #space-cursor {
        display: none !important;
    }
}

#space-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, opacity 0.2s;
}

/* Outer ring — blue */
#space-cursor .cursor-outer {
    width: 28px;
    height: 28px;
    border: 1.5px solid #4da6ff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(77, 166, 255, 0.4),
                inset 0 0 4px rgba(77, 166, 255, 0.1);
    transition: width 0.2s, height 0.2s, border-color 0.15s, box-shadow 0.15s;
}

/* Inner dot — white */
#space-cursor .cursor-inner {
    width: 6px;
    height: 6px;
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
    transition: width 0.15s, height 0.15s, background 0.15s;
}

/* Crosshair tick marks */
#space-cursor .cursor-tick {
    position: absolute;
    background: rgba(77, 166, 255, 0.5);
}

#space-cursor .cursor-tick-top {
    width: 1px;
    height: 4px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

#space-cursor .cursor-tick-bottom {
    width: 1px;
    height: 4px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

#space-cursor .cursor-tick-left {
    width: 4px;
    height: 1px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

#space-cursor .cursor-tick-right {
    width: 4px;
    height: 1px;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Click state */
#space-cursor.clicking .cursor-outer {
    width: 22px;
    height: 22px;
    border-color: #f02062;
    box-shadow: 0 0 12px rgba(160, 32, 240, 0.6),
                inset 0 0 6px rgba(160, 32, 240, 0.2);
}

#space-cursor.clicking .cursor-inner {
    width: 4px;
    height: 4px;
    background: rgba(160, 32, 240, 0.5);
    border-color: #e3b5ff;
}

/* =============================================
   Sidebar Nav — Active Section Highlight
   ============================================= */

.nav-link {
    color: #c6c6c6;
    opacity: 0.7;
}

.nav-link:hover {
    opacity: 1;
    background-color: #2a2a2a;
}

.nav-link.active {
    background-color: #a020f0;
    color: #131313;
    font-weight: 900;
    opacity: 1;
}

.nav-link-cyber.active {
    background-color: #14ca41;
    color: #131313;
    font-weight: 900;
    opacity: 1;
}


.nav-link.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Material Symbols baseline */
.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
