/* ============================================
   AlienIntroductions.com - Core Design System
   NASA/JPL Dark Aesthetic
   ============================================ */

/* ── CSS Variables ── */
:root {
    /* Backgrounds */
    --bg-deep: #0B0D17;
    --bg-surface: #121829;
    --bg-elevated: #1A2040;
    --bg-input: #0E1225;

    /* Borders */
    --border: #1E2A4A;
    --border-light: #2A3A5C;

    /* Text */
    --text-primary: #E8ECF4;
    --text-secondary: #8892B0;
    --text-muted: #4A5568;

    /* Accents */
    --accent-cyan: #00D4FF;
    --accent-teal: #00E5A0;
    --accent-amber: #FFB547;
    --accent-red: #FF4757;
    --accent-purple: #A78BFA;

    /* Accent Glows */
    --glow-cyan: rgba(0, 212, 255, 0.15);
    --glow-teal: rgba(0, 229, 160, 0.15);
    --glow-amber: rgba(255, 181, 71, 0.15);
    --glow-red: rgba(255, 71, 87, 0.15);
    --glow-purple: rgba(167, 139, 250, 0.15);

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --container-width: 1280px;
    --section-gap: 4rem;
    --card-gap: 1.5rem;
    --card-radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.5); }
::selection { background: var(--accent-cyan); color: var(--bg-deep); }

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ── */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-deep);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ── Noise Texture Overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* ── Star Canvas ── */
#star-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.main-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

/* ── Container ── */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1440px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: #4DE0FF;
}

strong { color: var(--text-primary); }

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}
li { margin-bottom: 0.35rem; }

code, .mono {
    font-family: var(--font-mono);
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 23, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    flex-shrink: 0;
}
.logo:hover { color: var(--accent-cyan); }

.logo-icon {
    color: var(--accent-cyan);
    display: flex;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    line-height: 1.2;
}

.logo-tagline {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.nav-link.active {
    color: var(--accent-cyan);
    background: var(--glow-cyan);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Header search */
.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 0.75rem;
    flex-shrink: 0;
    transition: border-color var(--transition);
}
.header-search:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--glow-cyan);
}

.search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    width: 160px;
    outline: none;
}
.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    padding: 4px;
    transition: color var(--transition);
}
.search-btn:hover {
    color: var(--accent-cyan);
}

/* ── Breadcrumbs ── */
.breadcrumbs {
    padding: 1rem 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.breadcrumbs a {
    color: var(--text-muted);
}
.breadcrumbs a:hover {
    color: var(--accent-cyan);
}
.breadcrumb-sep {
    color: var(--text-muted);
    margin: 0 0.5rem;
    opacity: 0.5;
}
.breadcrumb-current {
    color: var(--text-secondary);
}

/* ── Footer ── */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    background: rgba(11, 13, 23, 0.8);
    position: relative;
    z-index: 2;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color var(--transition);
}
.footer-col a:hover {
    color: var(--accent-cyan);
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-mono {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    opacity: 0.4;
}

/* ── Section Layout ── */
.section {
    padding: var(--section-gap) 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title .section-icon {
    color: var(--accent-cyan);
    font-size: 1.2rem;
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}
.section-link:hover {
    text-decoration: underline;
}

/* ── Grid Layouts ── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--card-gap);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--card-gap);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--card-gap);
}

/* ── Page Header ── */
.page-header {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .page-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
}

/* ── Content Layout (detail pages) ── */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 2rem 0;
}

.content-main h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-cyan);
}
.content-main h3:first-child {
    margin-top: 0;
}

.content-main p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.content-main ul, .content-main ol {
    margin-bottom: 1.25rem;
}

.content-main li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.25rem;
}

.sidebar-panel-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.fact-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(30, 42, 74, 0.5);
    font-size: 0.85rem;
}
.fact-row:last-child { border-bottom: none; }

.fact-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fact-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: right;
}
