:root {
    --bg-dark: #090C08;
    --accent-purple-deep: #474056;
    --accent-purple-mid: #757083;
    --accent-grey-blue: #8A95A5;
    --text-light: #B9C6AE;
    --logo-rx: 120px;
    --logo-ry: 45px;
}

@property --orbit-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: true; 
}

body, html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    font-family: 'Lato', sans-serif;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* CENTRALIZED BACKGROUND FIX */
.hero-background {
    position: absolute; /* Changed from fixed to absolute so it stays at the top */
    top: 0; 
    left: 0;
    width: 100%; 
    height: 70vh; /* Limits height so it doesn't bleed into the footer area */
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0; 
    opacity: 0.6;
    pointer-events: none;
    
    /* Smooth fade out to black */
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
}

/* HEADER & LOGO */
header {
    position: relative; 
    width: max-content; 
    text-align: center; 
    margin: 40px auto 20px auto;
    padding: 20px;
    box-sizing: content-box;
    z-index: 1001;
}

.logo-text-block {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    z-index: 10;
    line-height: 1;
}

header::before {
    content: '';
    position: absolute;
    top: 50%; left: 45%; 
    transform: translate(-50%, -50%);
    z-index: -1;
    width: 180%; height: 130%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0.8) 50%, transparent 95%);
    filter: blur(10px);
}

.logo-top { display: block; font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.5em; color: #FFFFFF; text-shadow: 0 0 5px rgba(255, 255, 255, 0.4); margin-bottom: 5px; }
.logo-main { display: block; font-family: 'Cinzel', serif; font-size: 2.2rem; letter-spacing: 0.2em; font-weight: 700; color: var(--text-light); text-transform: uppercase; margin: 0; }
.logo-bottom { display: block; font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.6em; color: #FFFFFF; text-transform: lowercase; text-shadow: 0 0 5px rgba(255, 255, 255, 0.4); margin-top: 5px; }

/* ORBITAL SYSTEM */
.logo-orbit-system {
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    pointer-events: none;
    transform: rotateZ(-25deg);
    animation: smoothOrbit 12s linear infinite;
}

.logo-planet-main {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    --lp-color1: #c75b48; 
    --lp-color2: #69261b;
    background-image: 
        radial-gradient(circle at 30% 30%, transparent 20%, rgba(0,0,0,0.9) 90%),
        radial-gradient(circle at 50% 30%, rgba(255,255,255,0.5) 0%, transparent 20%),
        radial-gradient(circle at 20% 70%, rgba(255,255,255,0.4) 0%, transparent 15%),
        linear-gradient(to bottom, var(--lp-color1) 0%, var(--lp-color2) 50%, var(--lp-color1) 100%);
    background-size: 100% 100%, 200% 100%, 200% 100%, 100% 100%;
    background-repeat: no-repeat, repeat-x, repeat-x, no-repeat;
    background-blend-mode: normal, overlay, overlay, normal;
    box-shadow: inset -4px -2px 6px rgba(0,0,0,1);
    left: calc(cos(var(--orbit-angle)) * var(--logo-rx) - 10px);
    top:  calc(sin(var(--orbit-angle)) * var(--logo-ry) - 10px);
    scale: calc(1 + sin(var(--orbit-angle) + 45deg) * 0.4);
    animation: planetSpin 6s linear infinite;
}

@keyframes smoothOrbit {
    0% { --orbit-angle: 0deg; z-index: 11; }
    30% { z-index: 11; } 
    40% { z-index: 9; }
    80% { z-index: 9; }
    90% { z-index: 11; }
    100% { --orbit-angle: 360deg; z-index: 11; }
}

@keyframes planetSpin { 
    from { background-position: 0 0, 0 0, 0 0, 0 0; } 
    to { background-position: 0 0, -40px 0, -40px 0, 0 0; } 
}

.logo-moon {
    position: absolute;
    top: 50%; left: 50%;
    background: #ddd;
    border-radius: 50%;
    box-shadow: inset -1px -1px 2px #000;
}
.m1 { width: 3px; height: 3px; --orbit-r: 14px; background: #eee; animation: multiMoonOrbit 2s linear infinite; }
.m2 { width: 5px; height: 5px; --orbit-r: 22px; background: #ccc; animation: multiMoonOrbit 3.5s linear infinite reverse; }
.m3 { width: 4px; height: 4px; --orbit-r: 30px; background: #bbb; animation: multiMoonOrbit 5.5s linear infinite; }

@keyframes multiMoonOrbit {
     from { transform: rotate(0deg) translateX(var(--orbit-r)) rotate(0deg); }
     to { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); }
}

/* NAVIGATION */
nav {
    width: 100%;
    padding: 8px 0; 
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.50); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1000;
}

.menu-toggle { display: none; }

nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 50px; }
nav a { position: relative; text-decoration: none; color: var(--text-light); font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; }
nav a:hover { color: #fff; }

/* Planet Colors & Tilts */
.planet-home { --p-color1: #4a6fa5; --p-color2: #162a4a; --p-tilt: 15deg; }
.planet-explore { --p-color1: #d4a373; --p-color2: #8b5e34; --p-tilt: 3deg; }
.planet-news { --p-color1: #b9c6ae; --p-color2: #474056; --p-tilt: 23deg; }
.planet-about { --p-color1: #757083; --p-color2: #2a2a2a; --p-tilt: 98deg; }

/* The Main Planet (Appears on Hover) */
nav a::after {
    content: '';
    position: absolute;
    left: 50%; transform: translateX(-50%) rotate(var(--p-tilt, 0deg));
    bottom: -18px; width: 14px; height: 14px;
    border-radius: 50%;
    background-image: 
        radial-gradient(circle at 30% 30%, transparent 20%, rgba(0,0,0,0.8) 90%),
        radial-gradient(circle at 50% 30%, rgba(255,255,255,0.5) 0%, transparent 20%),
        radial-gradient(circle at 20% 70%, rgba(255,255,255,0.4) 0%, transparent 15%),
        linear-gradient(to bottom, var(--p-color1) 0%, var(--p-color2) 25%, var(--p-color1) 50%, var(--p-color2) 75%, var(--p-color1) 100%);
    background-size: 100% 100%, 200% 100%, 200% 100%, 100% 100%;
    background-repeat: no-repeat, repeat-x, repeat-x, no-repeat;
    background-blend-mode: normal, overlay, overlay, normal;
    box-shadow: inset -3px -1px 4px rgba(0,0,0,0.9);
    opacity: 0; transition: 0.3s; z-index: 2;
}

nav a:hover::after { opacity: 1; animation: planetSpin 6s linear infinite; }

/* Moon Container & Visibility */
.moon-container { 
    position: absolute; left: 50%; bottom: -22px; 
    width: 14px; height: 14px; 
    transform: translateX(-50%); 
    opacity: 0; transition: 0.3s; z-index: 1; 
}
nav a:hover .moon-container { opacity: 1; }

.moon-container::before, .moon-container::after {
    content: '';
    position: absolute;
    background: #eee;
    border-radius: 50%;
    box-shadow: inset -1px -1px 2px #000;
    display: none;
}

.moon-container::before { width: 4px; height: 4px; top: 5px; left: 5px; animation: moonOrbit1 4s linear infinite; }
.moon-container::after { width: 3px; height: 3px; top: 5px; left: 5px; animation: moonOrbit2 8s linear infinite; }

.planet-home .moon-container::before, .planet-home .moon-container::after,
.planet-about .moon-container::before, .planet-about .moon-container::after { display: block; }
.planet-explore .moon-container::before, .planet-news .moon-container::before { display: block; }

@keyframes moonOrbit1 { 
    from { transform: rotate(0deg) translateX(14px) rotate(0deg); z-index: 3; } 
    50% { z-index: 1; opacity: 0.6; } 
    to { transform: rotate(360deg) translateX(14px) rotate(-360deg); z-index: 3; } 
}
@keyframes moonOrbit2 { 
    from { transform: rotate(180deg) translateX(20px) rotate(-180deg); z-index: 3; } 
    50% { z-index: 1; opacity: 0.6; } 
    to { transform: rotate(540deg) translateX(20px) rotate(-540deg); z-index: 3; } 
}

/* FOOTER */
footer {
    position: relative;
    flex-shrink: 0;
    margin-top: 150px; 
    border-top: 1px dashed var(--accent-grey-blue);
    background-color: #050505; 
    padding: 60px 10% 30px;
    color: var(--accent-purple-mid);
    font-size: 0.9rem;
    z-index: 10;
}

footer::before {
    content: '';
    position: absolute;
    bottom: 100%; left: 0; width: 100%; height: 150px; 
    background: linear-gradient(to bottom, rgba(9, 12, 8, 0) 0%, rgba(50, 50, 50, 0.1) 40%, rgba(100, 100, 100, 0.3) 100%);
    pointer-events: none; 
}

/* UPDATED GRID LAYOUT (Desktop Default) */
.footer-grid { 
    display: grid; 
    /* Left col takes remaining space, right cols shrink to content */
    grid-template-columns: 1fr auto auto; 
    gap: 0; 
    margin-bottom: 40px; 
    align-items: start;
}

/* DESKTOP BORDERS & SPACING */
/* 1st Column: Brand */
.footer-grid > div:nth-child(1) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 60px; 
}
/* 2nd Column: Nav */
.footer-grid > div:nth-child(2) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 60px;  
    padding-right: 60px;
}
/* 3rd Column: Network */
.footer-grid > div:nth-child(3) {
    padding-left: 60px;
    border-right: none;
}

.footer-brand h3 { font-family: 'Cinzel', serif; color: var(--text-light); letter-spacing: 0.3em; margin-bottom: 15px; }
.footer-links h4 { font-family: 'Cinzel', serif; color: var(--accent-grey-blue); font-size: 0.8rem; margin-bottom: 15px; text-transform: uppercase; white-space: nowrap; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--accent-purple-mid); text-decoration: none; transition: 0.3s; white-space: nowrap; }
.footer-links a:hover { color: var(--text-light); }
.copyright { text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 20px; font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.1em; }

/* MOBILE */
@media (max-width: 768px) {
    header { margin: 40px auto 20px auto; left: 0; padding-left: 10px; }
    nav { padding: 20px 0; }
    .menu-toggle {
        display: flex; align-items: center; gap: 12px; cursor: pointer;
        padding: 8px 15px; background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px;
        position: absolute; right: 5%; top: 50%; transform: translateY(-50%); z-index: 1002;
    }
    .menu-label { font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 0.2em; color: var(--text-light); display: block; }
    .hamburger-lines { display: flex; flex-direction: column; gap: 5px; }
    .hamburger-lines span { width: 22px; height: 2px; background-color: var(--text-light); transition: 0.3s; }

    nav ul {
        display: none; flex-direction: column; 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: rgba(0, 0, 0, 0.95); backdrop-filter: blur(15px); 
        align-items: center; gap: 25px; padding: 40px 0; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    nav ul.active { display: flex; }
    nav a { font-size: 1.2rem; }
    nav a::after, .moon-container { display: none !important; } 

    .menu-toggle.active .hamburger-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.active .hamburger-lines span:nth-child(2) { opacity: 0; }
    .menu-toggle.active .hamburger-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 40px; 
    }
    
    /* Remove borders and padding from the columns */
    .footer-grid > div:nth-child(1),
    .footer-grid > div:nth-child(2) {
        border-right: none;
        padding: 0;
        /* Add horizontal divider instead */
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding-bottom: 30px;
    }
    
    .footer-grid > div:nth-child(3) {
        padding: 0;
        border: none;
    }
}

.content { padding: 40px 10%; max-width: 800px; margin: 0 auto; }
h2 { font-family: 'Cinzel', serif; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; margin-top: 40px; color: #fff; }
p { line-height: 1.8; color: var(--accent-grey-blue); margin-bottom: 20px; }