:root {
    /* Palette - Mission Control */
    --void: #030305;
    --starlight: #E2E2E8;
    --muted: #c9c9c9;
    --horizon-gold: #FFD28E;
    --horizon-red: #D66D50;
    --telemetry-blue: #7F9CBB;

    /* Glass / Panels */
    --glass: rgba(15, 15, 20, 0.75);
    --border-faint: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Layout */
    --panel-padding: 32px;
    --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

::selection {
    background: var(--horizon-gold);
    color: var(--void);
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--void);
    color: var(--starlight);
    font-family: var(--font-mono);
    /* Default to mono for tech feel */
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* --- 3D Background --- */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    outline: none;
}

/* --- Horizon Flare (From Snippet) --- */
.planet-horizon {
    position: fixed;
    inset: 0;
    pointer-events: none;

    background: radial-gradient(
        ellipse 200% 150% at 50% -50%,
        rgba(0,0,0,0) 40%,
        rgba(42,42,53,0.3) 60%,
        var(--horizon-red) 65%,
        var(--horizon-gold) 68%,
        transparent 72%
    );
    z-index: 1;
    filter: blur(4vmax);
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.6;
    will-change: transform;
}

/* --- Loading Screen --- */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--void);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s var(--ease-smooth);
}

#preloader.loaded {
    opacity: 0;
    pointer-events: none;
}

.loader-bar {
    width: 120px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.loader-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--horizon-gold);
    transition: width 0.2s linear;
}

.loader-text {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(180deg, rgba(3, 3, 5, 0.8) 0%, rgba(3, 3, 5, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(2px);
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

/* Mobile Menu Toggle Button (Hidden by default) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 101;
}
.menu-bar {
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay (Hidden by default) */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(3, 3, 5, 0.95);
    backdrop-filter: blur(20px);
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-menu.open {
    transform: translateY(0);
}

.mobile-menu a {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--starlight);
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-menu.open a {
    opacity: 1;
    transform: translateY(0);
}
/* Staggered animation for links */
.mobile-menu.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.3s; }

/* --- Layout --- */
main {
    position: relative;
    z-index: 2;
}

section {
    min-height: 100vh;
    min-height: 100svh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 8%;
    position: relative;
    pointer-events: none;
}

/* --- Typography --- */
h1 {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 24px 0;
    color: #fff;
}

/* Gradient Text Effect */
h1 .highlight {
    font-style: italic;
    background: linear-gradient(to right, #fff, var(--horizon-gold), var(--horizon-red));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 400;
    margin: 0;
    color: #fff;
}

p {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--starlight);
    margin: 0;
    text-shadow: #000000 0px 0 6px;
}

/* --- UI Components --- */
.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-line {
    width: 40px;
    height: 1px;
    background: var(--muted);
}

.section-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* --- Content Containers --- */
.content-block {
    pointer-events: auto;
    max-width: 550px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s var(--ease-smooth);
    will-change: transform;
    /* Hint to browser */
}

section.active .content-block {
    opacity: 1;
    transform: translateY(0);
}

/* --- Glass Cards (Refined) --- */
.card-grid {
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin-top: 40px;
    counter-reset: grid-counter;
    transform: translateY(30px);
    opacity: 0;
    transition: all 1s var(--ease-smooth);
    will-change: transform; /* Hint to browser */
}

section.active .card-grid {
    opacity: 1;
    transform: translateY(0);
}

.glass-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 450px;
    padding: 32px;

    background: var(--glass);
    border: 1px solid var(--border-faint);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);

    text-decoration: none;
    transition: all 0.4s var(--ease-smooth);
    counter-increment: grid-counter;
    will-change: transform, background-color, border-color;
    /* Hint to browser */
}

/* Hover State */
.glass-card:hover {
    border-color: var(--border-highlight);
    background: rgba(30, 30, 35, 0.85);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
}

/* Numbering 01, 02... */
.glass-card::before {
    content: "0" counter(grid-counter);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    width: max-content;
    margin-bottom: 20px;
    display: block;
}

.card-img-container {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    filter: grayscale(40%);
    /* Tech feel */
    transition: all 0.5s var(--ease-smooth);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-small {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--starlight);
    border: 1px solid var(--border-faint);
    padding: 6px 12px;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.btn-small:hover {
    background: var(--starlight);
    color: var(--void);
    border-color: var(--starlight);
}

.glass-card:hover .card-img-container img {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}

.card-content {
    margin-top: auto;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: rgb(248, 113, 113);
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-desc {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.card-authors {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--starlight);
    margin-bottom: 12px;
    line-height: 1.4;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.card-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--telemetry-blue);
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-block;
    margin-top: 32px;
    padding: 14px 28px;
    border: 1px solid var(--horizon-gold);
    background: rgba(255, 210, 142, 0.05);
    color: var(--horizon-gold);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--horizon-gold);
    color: var(--void);
    box-shadow: 0 0 20px rgba(255, 210, 142, 0.2);
}

/* --- Decorative Tech Elements --- */
.deco-line-vertical {
    position: absolute;
    right: 48px;
    top: 25%;
    width: 1px;
    height: 150px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.sys-status {
    position: absolute;
    right: 60px;
    top: 25%;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--muted);
    writing-mode: vertical-rl;
    letter-spacing: 0.15em;
}

.hud-footer {
    position: absolute;
    bottom: 40px;
    left: 8%;
    display: flex;
    gap: 40px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    pointer-events: none;
}

.hud-item span {
    display: block;
    color: var(--starlight);
    margin-top: 4px;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
    z-index: 10;
    pointer-events: none;
}

.desktop-indicator,
.mobile-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.indicator-text {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--starlight);
}

/* Desktop Mouse */
.mouse-icon {
    width: 20px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 2px;
    height: 4px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        top: 6px;
        opacity: 1;
        height: 4px;
    }

    100% {
        top: 18px;
        opacity: 0;
        height: 2px;
    }
}

/* Mobile Hand */
.hand-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.8);
    animation: swipeUp 2s infinite;
}

@keyframes swipeUp {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }

    40% {
        transform: translateY(0);
        opacity: 1;
    }

    80% {
        transform: translateY(-10px);
        opacity: 0;
    }

    100% {
        transform: translateY(-10px);
        opacity: 0;
    }
}

/* Alignment Utilities */
.align-right {
    align-items: flex-end;
}

.align-right h1,
.align-right h2 {
    text-align: left;
}

.align-right .section-label {
    flex-direction: row-reverse;
}

/* Media Queries for Visibility and Layout */
@media (min-width: 769px) {
    .mobile-indicator {
        display: none;
    }

    .desktop-indicator {
        display: flex;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .align-right .section-label {
        flex-direction: row;
    }

    /* Responsive Scroll Indicator Switch */
    .desktop-indicator {
        display: none;
    }

    .mobile-indicator {
        display: flex;
    }
    
    nav { 
        padding: 24px; 
        background: linear-gradient(180deg, rgba(3,3,5,0.95) 0%, rgba(3,3,5,0.8) 100%);
    }
    .logo { font-size: 1.1rem; } 
    
    .nav-links { display: none; }
    .menu-toggle { display: flex; } /* Show hamburger */
}

/* Alignment Utilities */
.align-right {
    align-items: flex-end;
}

.align-right h1,
.align-right h2 {
    text-align: right;
}

.align-right .section-label {
    flex-direction: row-reverse;
}