/* Based in Space - Main Stylesheet */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Colors */
    --void-black: #0a0a0c;
    --deep-space: #12121a;
    --nebula-purple: #7b5cff;
    --plasma-orange: #ff6b35;
    --starlight: #f0f0f5;
    --lunar-grey: #8a8a9a;
    
    /* Typography */
    --font-display: 'Instrument Serif', serif;
    --font-ui: 'Syne', sans-serif;
    --font-body: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--starlight);
    background-color: var(--void-black);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--starlight);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(123, 92, 255, 0.3);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

p {
    margin-bottom: var(--space-sm);
    color: rgba(240, 240, 245, 0.85);
}

a {
    color: var(--nebula-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--plasma-orange);
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(123, 92, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 90px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-md);
}

.nav-links a {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--starlight);
    padding: var(--space-xs) 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--nebula-purple);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(80px + var(--space-lg)) var(--space-md) var(--space-lg);
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--lunar-grey);
    max-width: 600px;
    margin: var(--space-sm) auto 0;
}

.content {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   TAGS
   ============================================ */
.tag {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--nebula-purple);
    background: rgba(123, 92, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    margin-bottom: var(--space-xs);
}

/* ============================================
   CARDS
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.card {
    background: var(--deep-space);
    border: 1px solid rgba(123, 92, 255, 0.2);
    padding: var(--space-md);
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
    color: var(--starlight);
}

.card:hover {
    border-color: var(--nebula-purple);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(123, 92, 255, 0.15);
    color: var(--starlight);
}

.card h3 {
    color: var(--starlight);
    margin-top: var(--space-xs);
}

.card p {
    font-size: 0.85rem;
    color: var(--lunar-grey);
    margin-bottom: 0;
}

.card .meta {
    font-size: 0.75rem;
    color: var(--lunar-grey);
    margin-top: var(--space-sm);
    display: block;
}

/* ============================================
   CODEX ENTRIES (Universe section style)
   ============================================ */
.codex-entry {
    background: linear-gradient(135deg, rgba(123, 92, 255, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
    border-left: 3px solid var(--nebula-purple);
    padding: var(--space-md);
    margin: var(--space-md) 0;
}

.codex-entry .classification {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--plasma-orange);
    margin-bottom: var(--space-xs);
}

.codex-entry h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: var(--space-md);
    border-left: 2px solid rgba(123, 92, 255, 0.3);
}

.timeline-entry {
    position: relative;
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-md) - 5px);
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--nebula-purple);
    border-radius: 50%;
}

.timeline-entry .year {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--plasma-orange);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    border-top: 1px solid rgba(123, 92, 255, 0.2);
    margin-top: var(--space-xl);
}

footer p {
    font-size: 0.8rem;
    color: var(--lunar-grey);
    margin-bottom: var(--space-xs);
}

.affiliate-disclosure {
    font-size: 0.7rem;
    color: var(--lunar-grey);
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm);
    }
    
    .logo img {
        height: 50px;
    }
    
    .nav-links {
        gap: var(--space-sm);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    main {
        padding-top: calc(120px + var(--space-md));
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Starfield background (add via JS) */
.star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
}
