:root {
    --bg-dark: #020b14;
    --bg-card: rgba(10, 25, 41, 0.7);
    --primary: #00f3ff;
    --primary-glow: rgba(0, 243, 255, 0.5);
    --secondary: #0066ff;
    --text-main: #e0e6ed;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Global Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

h1 { font-size: 4rem; width: 100%; }
h2 { font-size: 2.5rem; color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); text-align: center; margin-bottom: 3rem; }
h3 { font-size: 1.5rem; color: #fff; }

.section-padding {
    padding: 100px 0;
}

/* Button Component */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin-right: 15px;
}

.btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn.secondary {
    border-color: var(--secondary);
    color: var(--secondary);
}
.btn.secondary:hover {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.5);
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(2, 11, 20, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: padding 0.3s;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.logo span { color: var(--primary); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

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

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

/* Hero Section */
#hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #0b1e36 0%, #020b14 100%);
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url(''); /* Placeholder for grid */
    opacity: 0.1;
    background-size: 40px 40px;
    background-image: linear-gradient(to right, #ffffff 1px, transparent 1px),
                      linear-gradient(to bottom, #ffffff 1px, transparent 1px);
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

.hero-buttons {
    margin-top: 2rem;
}

.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Particles - JS will populate this */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.glitch-text {
    position: relative;
}
.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark);
}
.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    20% { clip: rect(80px, 9999px, 90px, 0); }
    40% { clip: rect(10px, 9999px, 30px, 0); }
    60% { clip: rect(60px, 9999px, 20px, 0); }
    80% { clip: rect(5px, 9999px, 80px, 0); }
    100% { clip: rect(90px, 9999px, 50px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(15px, 9999px, 85px, 0); }
    20% { clip: rect(75px, 9999px, 5px, 0); }
    40% { clip: rect(50px, 9999px, 25px, 0); }
    60% { clip: rect(20px, 9999px, 70px, 0); }
    80% { clip: rect(95px, 9999px, 35px, 0); }
    100% { clip: rect(40px, 9999px, 60px, 0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* About Section */
#about {
    position: relative;
    background: linear-gradient(180deg, #020b14 0%, #051424 50%, #020b14 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-dim);
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,243,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    transform: translate(0, 0);
    pointer-events: none;
}

.about-card:hover::before {
    opacity: 1;
}

/* Technical Specs */
#technical {
    background: var(--bg-dark);
}

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

.spec-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: default;
}

.spec-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.spec-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.spec-card h3 {
    margin-bottom: 1rem;
}

.spec-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Telemetry / Live Data */
#telemetry {
    background: #030f1c;
}

.telemetry-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    background: #000;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}
@media(max-width: 900px) {
    .telemetry-dashboard { grid-template-columns: 1fr; }
}

.data-panel {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--primary);
    border-radius: 5px;
    padding: 1.5rem;
    position: relative;
}

.data-panel h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    padding-bottom: 0.5rem;
}

.chart-container {
    height: 200px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2px;
    overflow: hidden;
}

.bar {
    width: 100%;
    background: var(--secondary);
    transition: height 0.5s ease;
}
.bar.high { background: #ff3333; box-shadow: 0 0 10px #ff3333; }
.bar.med { background: var(--primary); }

.data-value {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}
.data-label {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* How It Works - Timeline */
#how-it-works {
    background: var(--bg-dark);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-dark);
    border: 2px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 10px var(--primary-glow);
}

.left { left: 0; }
.right { left: 50%; }

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--bg-card);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--bg-card);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--bg-card);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--bg-card) transparent transparent;
}

.right::after { left: -10px; }

.timeline-content {
    padding: 20px 30px;
    background: var(--bg-card);
    position: relative;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

.timeline-content h3 { margin-top: 0; }

/* Gallery */
#gallery {
    background: #020b14;
}
.gallery-carousel {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scrollbar-width: none; /* Firefox */
}
.gallery-carousel::-webkit-scrollbar { display: none; }

.gallery-item {
    min-width: 300px;
    height: 400px;
    background: #111;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
    border: 1px solid var(--glass-border);
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #000, transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Real Rover Photos Grid */
#real-photos {
    background: #051424;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.photo-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: opacity 0.3s;
}
.photo-grid img:hover { opacity: 0.8; border-color: var(--primary); }

/* Contact */
#contact {
    background: linear-gradient(0deg, #000 0%, #020b14 100%);
}

.contact-wrapper {
    display: flex;
    justify-content: center;
}

.contact-form {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    padding: 15px;
    color: #fff;
    border-radius: 5px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

/* Footer */
footer {
    background: #000;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid #111;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; } /* Simple hide for mobile MVP, or could be hamburger */
    h1 { font-size: 2.5rem; }
    .about-grid { grid-template-columns: 1fr; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item::before { left: 60px; border: medium solid white; border-width: 10px 10px 10px 0; border-color: transparent white transparent transparent; }
    .left::after, .right::after { left: 21px; }
    .right { left: 0; }
    nav .container {
        justify-content: center;
    }
}
