/* =========================================
   1. THEME VARIABLES & SETUP
   ========================================= */
:root {
    
 /* DEFAULT: Light Mode Variables */
    --primary: #2563eb; /* Deep Tech Blue (Cobalt) */
    --accent-glow: rgba(37, 99, 235, 0.3);
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); 
    --header-bg: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 20px 50px rgba(0,0,0,0.1);
    --blur-overlay: radial-gradient(circle at 50% 110%, rgba(255, 255, 255, 1) 25%, rgba(255, 255, 255, 0.9) 45%, rgba(255, 255, 255, 0.5) 65%, rgba(255, 255, 255, 0) 85%);
    --hero-overlay: linear-gradient(rgba(240, 249, 255, 0.85), rgba(224, 242, 254, 0.95));
    
    /* Bulb State (Off by default) */
    --bulb-color: #cbd5e1; 
    --bulb-glow: none;
    --btn-text: #2563eb; 
    --btn-text-filled: #ffffff;
}

/* Dark Mode Overrides */
body.dark-mode {
    
    
    --primary: #fbbf24; /* Warm Yellow */
    --accent-glow: rgba(251, 191, 36, 0.25);
    --text-dark: #fefce8;
    --text-light: #9ca3af;
    --bg-gradient: linear-gradient(135deg, #0c0a09 0%, #1c1917 100%);
    --header-bg: rgba(12, 10, 9, 0.85);
    --card-bg: rgba(28, 25, 23, 0.6);
    --card-border: rgba(251, 191, 36, 0.1);
    --blur-overlay: radial-gradient(circle at 50% 110%, rgba(12, 10, 9, 1) 25%, rgba(12, 10, 9, 0.9) 45%, rgba(12, 10, 9, 0.5) 65%, rgba(12, 10, 9, 0) 85%);
    --hero-overlay: linear-gradient(rgba(12, 10, 9, 0.85), rgba(28, 25, 23, 0.95));
    
    /* Bulb On State */
    --bulb-color: #ffaa00;
    --bulb-glow: drop-shadow(0 0 15px rgba(255, 170, 0, 0.8));
    --btn-text: #fbbf24;
    --btn-text-filled: #1c1917; 

}

html { 
    scroll-behavior: smooth; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

body {
    background: var(--bg-gradient);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 1.5s ease, color 1.5s ease;
}

/* =========================================
   2. THE LIGHT SWITCH (HANGING BULB)
   ========================================= */
.lamp-container {
    position: fixed; 
    top: 0; 
    right: 10%; 
    z-index: 1000;
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.wire { 
    width: 2px; 
    height: 60px; 
    background: #475569; 
    z-index: 1; 
}

.bulb-fixture { 
    position: relative; 
    z-index: 2; 
    cursor: pointer; 
}

.bulb {
    width: 40px; 
    height: 40px; 
    background: var(--bulb-color);
    border-radius: 50%; 
    border: 2px solid #475569;
    filter: var(--bulb-glow); 
    transition: all 0.3s ease; 
    position: relative; 
    z-index: 2;
}

.socket { 
    width: 20px; 
    height: 15px; 
    background: #334155; 
    margin: 0 auto -5px; 
    position: relative; 
    z-index: 1; 
    border-radius: 2px; 
}

.pull-string {
    width: 1px; 
    height: 60px; 
    background: #94a3b8; 
    margin: 0 auto;
    position: relative; 
    top: -2px; 
    cursor: pointer;
    transition: height 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.knob { 
    width: 8px; 
    height: 14px; 
    background: #64748b; 
    border-radius: 4px; 
    position: absolute; 
    bottom: -14px; 
    left: 50%; 
    transform: translateX(-50%); 
}

.lamp-container:active .pull-string, 
.lamp-container.pulled .pull-string { 
    height: 85px; 
}

/* =========================================
   3. HEADER & HERO
   ========================================= */
header {
    background: var(--header-bg); 
    backdrop-filter: blur(10px);
    padding: 1.5rem 5%; 
    position: sticky; 
    top: 0; 
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    transition: background 1.5s ease;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-dark); 
    letter-spacing: -0.5px; 
    transition: color 1.5s ease; 
    cursor: pointer; 
    user-select: none;
}

.logo span { 
    color: var(--primary); 
    transition: color 1.5s ease; 
}

.hero-section { 
    padding: 8rem 20px 6rem; 
    min-height: 80vh; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    text-align: center; 
    position: relative; 
    overflow: hidden; 
    background-image: var(--hero-overlay), url('images/rover.webp');
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 1.5s ease;
}

.hero-section::before {
    content: ''; 
    position: absolute; 
    top: -50%; 
    left: 50%; 
    transform: translateX(-50%);
    width: 800px; 
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 70%);
    z-index: 1; 
    transition: background 1.5s ease;
    animation: pulse-glow 10s infinite alternate;
}

@keyframes pulse-glow {
    0% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 0.5; }
}

h1 { 
    font-size: 3.5rem; 
    color: var(--text-dark); 
    margin-bottom: 1.5rem; 
    line-height: 1.1; 
    font-weight: 800; 
    position: relative;
    z-index: 2;
    transition: color 1.5s ease; 
}

.gradient-text {
    background: linear-gradient(135deg, #673de6 0%, #2f2f2f 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    background-size: 200% auto; 
    animation: gradient-move 5s ease infinite; 
    transition: background 1.5s ease;
}

body.dark-mode .gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

@keyframes gradient-move { 
    0% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
    100% { background-position: 0% 50%; } 
}

p.subtitle { 
    font-size: 1.25rem; 
    color: var(--text-light); 
    margin-bottom: 3rem; 
    max-width: 650px; 
    margin-left: auto; 
    margin-right: auto;
    position: relative;
    z-index: 2;
    transition: color 1.5s ease; 
}

/* =========================================
   4. DECLARATION & STATS
   ========================================= */
.declaration-section {
    padding: 2rem 20px 6rem;
    text-align: center;
}

.declaration-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 4rem 3rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 1.5s ease;
}

.declaration-quote {
    font-family:'Times New Roman', Times, serif; 
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary );
    margin-bottom: 2rem;
    transition: color 1.5s ease;
}

.declaration-text {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    transition: color 1.5s ease;
}

.declaration-text.highlight {
    font-weight: 700;
    margin-bottom: 0;
    margin-top: 2rem;
}

.stats-section {
    padding: 2rem 20px 5rem;
    text-align: center;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    flex: 1;
    min-width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 1rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: color 1.5s ease;
}

.stat-number span {
    font-size: 2.5rem;
    color: var(--text-dark);
    transition: color 1.5s ease;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 1.5s ease;
}

.stats-cta {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    transition: color 1.5s ease;
}

.stats-cta a {
    color: var(--primary);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.stats-cta a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* =========================================
   X. EXPLORE PRODUCTS (ZIG-ZAG LAYOUT)
   ========================================= */
.explore-products {
    padding: 2rem 20px 6rem;
}

.explore-products .section-heading {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5rem;
    transition: color 1.5s ease;
}

.zig-zag-container {
    display: flex;
    flex-direction: column;
    gap: 6rem; /* Vertical spacing between each product */
    max-width: 1150px;
    margin: 0 auto;
}

.zig-zag-row {
    display: flex;
    align-items: center;
    gap: 4rem; /* Spacing between video and text */
}

/* MAGIC RULE: Automatically flips every second row */
.zig-zag-row:nth-child(even) {
    flex-direction: row-reverse;
}

.zig-zag-media {
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transform: translateZ(0); /* Hardware acceleration for smooth video rendering */
    position: relative;
}

.zig-zag-media::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 2;
}

.zig-zag-media video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 24px;
    position: relative;
    z-index: 1;
}

.zig-zag-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.zig-zag-text h3 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
    transition: color 1.5s ease;
}

.zig-zag-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 2rem;
    transition: color 1.5s ease;
}
/* ─── ZIG-ZAG LAYOUT ─── */
.zig-zag-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
    margin-top: 40px;
}

.zig-zag-row {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* This is the magic that alternates left/right */
.zig-zag-row:nth-child(even) {
    flex-direction: row-reverse;
}

.zig-zag-media {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Deep tech border */
}

.zig-zag-media video {
    width: 100%;
    height: auto;
    display: block;
}

.zig-zag-text {
    flex: 1;
}

/* Mobile Fallback: Stack them vertically on phones */
@media (max-width: 900px) {
    .zig-zag-row, .zig-zag-row:nth-child(even) {
        flex-direction: column;
        gap: 30px;
    }
}
/* Mobile Responsiveness */
@media (max-width: 900px) {
    .zig-zag-row,
    .zig-zag-row:nth-child(even) {
        flex-direction: column; /* Stack video on top of text on small screens */
        text-align: center;
        gap: 2.5rem;
    }

    .zig-zag-text {
        align-items: center;
    }
    
    .zig-zag-container {
        gap: 5rem;
    }
}

/* =========================================
   5. CARDS, GRID & STRETCHED LINKS
   ========================================= */
.container { 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 0 20px 6rem; 
}

.section-label {
    text-align: center; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    font-size: 0.85rem; 
    color: var(--primary); 
    font-weight: 700; 
    margin-bottom: 3rem;
    position: relative; 
    display: inline-block; 
    left: 50%; 
    transform: translateX(-50%);
    transition: color 1.5s ease;
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 2.5rem; 
}

/* FIX: Card minimum height and transition optimization to prevent jittering */
.card {
    position: relative; 
    min-height: 520px; 
    height: 100%;
    border-radius: 24px; 
    overflow: hidden;
    box-shadow: var(--shadow); 
    border: 1px solid var(--card-border);
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: flex-end;
    
    /* 1. ANTI-JITTER MAGIC */
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    backface-visibility: hidden;
    transform: translateZ(0); /* Forces GPU Hardware Acceleration */
    will-change: transform;
    
    /* 2. CURSOR LOCK */
    cursor: pointer; 
}

.card:hover { 
    /* Removed scale(1.02) to stop grid recalculation jitter */
    transform: translateY(-12px); 
    box-shadow: 0 30px 70px var(--accent-glow); 
}

.card::before { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    z-index: 1; 
    background: var(--blur-overlay); 
    transition: background 1.5s ease; 
}

/* IMAGES */
.bg-sentinel { background-image: url('images/sentinel.png'); }
.bg-aura     { background-image: url('images/aura.png'); }
.bg-civitas  { background-image: url('images/civitas.png'); }
.bg-basis    { background-image: url('images/basis.png');  }
.bg-raptor   { background-image: url('images/raptor.png');  }
.bg-aether   { background-image: url('images/aether.png');  }
.bg-systems  { background-image: url('images/systems.png');  }

.card-content { 
    position: static; 
    padding: 2.5rem; 
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content > * {
    position: relative;
    z-index: 2;
}

.card-tag {
    position: absolute; 
    top: 1rem; 
    right: 1rem; 
    z-index: 3;
    padding: 8px 16px; 
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px); 
    border-radius: 50px;
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 1px; 
    color: white; 
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    transition: all 1.5s ease;
}

body.dark-mode .card-tag { 
    background: rgba(0, 0, 0, 0.6); 
    border-color: rgba(251, 191, 36, 0.3); 
    color: #fbbf24; 
}

.card-title { 
    font-size: 2.2rem; 
    font-weight: 800; 
    margin-bottom: 0.5rem; 
    color: var(--text-dark); 
    text-shadow: 0 2px 10px rgba(255,255,255,0.5); 
    transition: color 1.5s ease; 
}

body.dark-mode .card-title { 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); 
}

.card-desc { 
    color: var(--text-light); 
    font-size: 1.05rem; 
    line-height: 1.6; 
    font-weight: 500; 
    margin-bottom: 1.5rem; 
    transition: color 1.5s ease; 
}

/* FIX: Changed to row so buttons don't push out of the card */
.card-actions {
    position: static; 
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    z-index: 10;
    margin-top: 15px;
}

.extra-btn {
    background: var(--primary);
    color: var(--btn-text-filled);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.extra-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* FIX: Stretched link implementation */
.main-card-link {
    position: static; 
}

.main-card-link:hover {
    transform: none; 
}

.main-card-link::after {
    content: "";
    position: absolute;
    inset: 0; 
    z-index: 5; /* Stays below the tools button */
    cursor: pointer; /* Forces the hand cursor over the whole card */
}

.tools-btn {
    position: relative;
    z-index: 10; /* Keeps this clickable separately */
    cursor: pointer;
}

/* =========================================
   6. UPDATES, FORM & FOOTER
   ========================================= */
.updates-section {
    padding: 4rem 20px 2rem;
    transition: background 1.5s ease;
}

.updates-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 850px;
    margin: 0 auto;
}

.notification-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 5px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
}

.notification-card:hover {
    transform: translateX(10px);
    box-shadow: 0 15px 35px var(--accent-glow);
}

.notification-badge {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    transition: all 1.5s ease;
}

body.dark-mode .notification-badge {
    color: var(--btn-text);
}

.notification-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    transition: color 1.5s ease;
}

.notification-desc {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.6;
    transition: color 1.5s ease;
}

.contact-section { 
    background: var(--header-bg); 
    padding: 5rem 20px; 
    border-top: 1px solid rgba(0,0,0,0.05); 
    transition: background 1.5s ease; 
}

.form-container { 
    max-width: 600px; 
    margin: 0 auto; 
    background: var(--bg-gradient); 
    padding: 3rem; 
    border-radius: 24px; 
    box-shadow: var(--shadow); 
    border: 1px solid var(--card-border); 
    transition: background 1.5s ease, border-color 1.5s ease; 
}

.form-group { margin-bottom: 1.5rem; }

label { 
    display: block; 
    margin-bottom: 0.5rem; 
    color: var(--text-dark); 
    font-weight: 600; 
    font-size: 0.9rem; 
    transition: color 1.5s ease; 
}

input, textarea { 
    width: 100%; 
    padding: 14px; 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    font-size: 1rem; 
    transition: all 0.3s; 
    background: var(--card-bg); 
    color: var(--text-dark); 
}

body.dark-mode input, body.dark-mode textarea { 
    border-color: #44403c; 
    background: rgba(12, 10, 9, 0.5); 
}

body.dark-mode input:focus, body.dark-mode textarea:focus { 
    border-color: #fbbf24; 
}

input:focus, textarea:focus { 
    outline: none; 
    border-color: var(--primary); 
}

.submit-btn { 
    width: 100%; 
    padding: 16px; 
    background: var(--primary); 
    color: var(--btn-text-filled);
    border: none; 
    border-radius: 12px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: background 1.5s, transform 0.2s; 
}

.submit-btn:hover { 
    filter: brightness(1.1); 
    transform: translateY(-2px); 
}

footer { 
    background: #0b0f19; 
    color: #a0a0a5; 
    padding: 4rem 20px; 
    text-align: center; 
}

.footer-links { 
    margin: 2rem 0; 
    display: flex; 
    justify-content: center; 
    gap: 2rem; 
}

.footer-links a { 
    color: white; 
    text-decoration: none; 
    font-weight: 500; 
    transition: color 0.3s; 
}

.footer-links a:hover { 
    color: var(--primary); 
}

/* =========================================
   7. THE HIDDEN GAME & MOBILE FIXES
   ========================================= */
#gameCanvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; background: transparent; cursor: none; opacity: 0;
    pointer-events: none; transition: opacity 1s ease-in-out; display: none;
}

#gameUI {
    position: fixed; top: 20px; left: 20px; z-index: 10000;
    color: #fff; font-family: 'Courier New', monospace; pointer-events: none; display: none;
}

#gameOverlay, #warningScreen {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 10000; text-align: center; color: #fff; font-family: 'Courier New', monospace; display: none;
}

#warningScreen { color: #ff3333; width: 90%; }

.active-game #gameCanvas, .active-game #gameUI, .active-game #gameOverlay {
    display: block; opacity: 1; pointer-events: auto;
}

#blastOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10001; background: white; pointer-events: none;
    opacity: 0; transition: opacity 3s cubic-bezier(0.5, 0, 0.5, 1);
}

#blastOverlay.active { opacity: 1; }

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .card-title { font-size: 1.8rem; }
    .subtitle { font-size: 1rem; }
    .hero-section { padding: 6rem 15px 4rem; }
    .container { padding: 0 15px 4rem; }
    .contact-section { padding: 3rem 15px; }
    .grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .card { height: 480px; }
    .form-container { padding: 1.5rem; }
    .lamp-container { right: 5%; }
    .wire { height: 40px; }
    .declaration-container { padding: 3.5rem 1.5rem; }
    .declaration-quote { font-size: 1.5rem; }
    .declaration-text { font-size: 1rem; }
    .notification-card { padding: 1.5rem; }
    .notification-card:hover { transform: translateY(-5px); }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    .logo { font-size: 1.2rem; }
    .footer-links { flex-direction: column; gap: 1rem; }
}

/* --- COSMOS BACKGROUND ANIMATION --- */
#cosmosBackground {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 9998;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/bigbang.webp'); 
    background-size: cover;
    background-position: center;
    background-color: #000; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    display: none;
    animation: expandVoid 40s linear infinite alternate;
}

.active-game #cosmosBackground {
    display: block;
    opacity: 1; 
}

@keyframes expandVoid {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); } 
}

/* --- HERO BUTTONS --- */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.hero-btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.btn-gamified {
    background: var(--primary);
    color: var(--btn-text-filled);
    border: 2px solid var(--primary);
}

.btn-gamified:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-professional {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.btn-professional:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
    transform: translateY(-3px);
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        padding: 0 20px;
    }
    .hero-btn {
        width: 100%;
    }
}

/* =========================================
   8. ROVER TOUR GUIDE (GAMIFIED UI)
   ========================================= */
#rover-bot {
    position: absolute; 
    top: 50vh;          
    left: -200px;       
    z-index: 9900;      
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; 
    transition: top 1.2s cubic-bezier(0.25, 0.8, 0.25, 1), left 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#rover-sprite {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

#rover-speech {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--accent-glow);
    backdrop-filter: blur(10px);
    margin-bottom: 15px;
    max-width: 250px;
    text-align: center;
    pointer-events: auto; 
    position: relative;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#rover-speech.active {
    transform: scale(1);
    opacity: 1;
}

#rover-speech::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
    display: block;
    width: 0;
}

#rover-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

#rover-action-btn {
    background: var(--primary);
    color: var(--btn-text-filled);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#rover-action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* --- THE SPOTLIGHT EFFECT --- */
#tour-curtain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    z-index: 8500; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#tour-curtain.active {
    opacity: 1;
    pointer-events: auto; 
}

.tour-focus {
    position: relative !important;
    z-index: 8600 !important; 
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary), 0 20px 50px rgba(103, 61, 230, 0.4) !important;
    transition: all 0.5s ease;
}

/* =========================================
   9. GAMIFIED MAP LAYOUT
   ========================================= */
.game-map {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 300px;
    display: flex;
    flex-direction: column;
    gap: 150px; 
}

.game-map::before {
    content: '';
    position: absolute;
    top: 50px;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background: repeating-linear-gradient(to bottom, rgba(103, 61, 230, 0.8) 0, rgba(103, 61, 230, 0.8) 20px, transparent 20px, transparent 40px);
    z-index: 0;
}

.node-left { align-self: flex-start; margin-left: 5%; }
.node-right { align-self: flex-end; margin-right: 5%; }
.node-center { align-self: center; }

.map-node::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20vw;
    height: 4px;
    background: rgba(103, 61, 230, 0.5);
    z-index: -1;
}

.node-left::after { left: 100%; }
.node-right::after { right: 100%; }
.node-center::after { display: none; }

@media (max-width: 768px) {
    .map-node { width: 100%; height: 400px; border-radius: 24px; }
    .map-node .card-content { border-radius: 24px; }
    .game-map::before, .map-node::after { display: none; } 
    .node-left, .node-right, .node-center { align-self: center; margin: 0; }
}

.map-node {
    width: 450px;
    height: 450px;
    margin: 0;
    position: relative;
    z-index: 2;
    border: 4px solid var(--primary);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphAmoeba 8s ease-in-out infinite both;
}

.map-node .card-content {
    background: rgba(0,0,0,0.6);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: inherit; 
}

@keyframes morphAmoeba {
    0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    33%  { border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%; }
    66%  { border-radius: 70% 30% 50% 50% / 30% 50% 70% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* =========================================
   10. PROFESSIONAL STATIC AI AGENT
   ========================================= */
#pro-ai-agent {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

#pro-agent-avatar {
    width: 75px; 
    height: auto;
    cursor: pointer;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    transition: transform 0.2s ease;
}

#pro-agent-avatar:hover {
    transform: scale(1.1);
}

#pro-speech-bubble {
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    width: 320px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

#pro-chat-history {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
}

.bot-msg { 
    font-size: 0.9rem; 
    color: var(--text-dark); 
    background: rgba(0,0,0,0.05); 
    padding: 10px 14px; 
    border-radius: 12px 12px 12px 2px; 
    align-self: flex-start; 
    max-width: 90%; 
    margin: 0;
}

.user-msg { 
    font-size: 0.9rem; 
    background: var(--primary); 
    color: white; 
    padding: 10px 14px; 
    border-radius: 12px 12px 2px 12px; 
    align-self: flex-end; 
    max-width: 90%; 
    margin: 0;
}

body.dark-mode .bot-msg { 
    background: rgba(255,255,255,0.08); 
    color: #fff; 
}

#pro-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--card-border);
    gap: 8px;
}

#pro-user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.85rem;
    outline: none;
}

#pro-user-input:focus {
    border-color: var(--primary);
}

#pro-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

#pro-send-btn:hover {
    transform: scale(1.1);
}

/* =========================================
   11. GATEWAY MODAL
   ========================================= */
.gateway-modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    transition: opacity 0.5s ease;
}

.gateway-inner {
    background: linear-gradient(135deg, #1c1917 0%, #0c0a09 100%);
    border: 1px solid rgba(251, 191, 36, 0.15);
    padding: 3.5rem 2.5rem;
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.gateway-title {
    color: #fefce8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.gateway-title span { color: #673de6; }

.gateway-subtitle {
    color: #9ca3af;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.gateway-btns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gateway-btn-primary {
    background: #673de6;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(103, 61, 230, 0.4);
}

.gateway-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.gateway-btn-secondary {
    background: transparent;
    color: #9ca3af;
    border: 2px solid #44403c;
    padding: 14px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gateway-btn-secondary:hover {
    border-color: #9ca3af;
    color: #fefce8;
}

/* =========================================
   12. MISC UTILITIES
   ========================================= */
.contact-heading {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    transition: color 1.5s ease;
}

.footer-location {
    font-size: 0.8rem;
    margin-top: 1rem;
    opacity: 0.5;
}
