/* ============================================
   Mars High Speed - Sci-Fi / Mars Theme CSS
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --accent: #ff6b35;
  --accent-hover: #ff8c5a;
  --accent-glow: rgba(255, 107, 53, 0.3);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --border-color: #2a2a2a;
  --border-accent: rgba(255, 107, 53, 0.4);
  --font-heading: 'Orbitron', 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
  --container-max: 1200px;
}

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

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }

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

/* --- Header / Navbar --- */
.site-header {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 15px var(--accent-glow);
}

.logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: #e0e0e0;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0;
  position: relative;
}

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

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

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

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
  transform: translateY(-4px);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-wrap: wrap;
}

.card-category {
  color: var(--accent);
  font-weight: 600;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--accent);
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* --- Section Spacing --- */
.section {
  padding: 4rem 0;
}

.section-sm {
  padding: 2rem 0;
}

.section-lg {
  padding: 6rem 0;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0.75rem auto 0;
  box-shadow: 0 0 10px var(--accent-glow);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* --- Badge / Tag --- */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* --- Divider --- */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 2rem 0;
}

/* --- Grid Utilities --- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Flex Utilities --- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* --- Page Loader --- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hide {
  opacity: 0;
  visibility: hidden;
}
.loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 0 20px var(--accent-glow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 107, 53, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 30px var(--accent-glow);
}

.hero p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
}

/* Starfield canvas behind hero */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.4;
}

/* --- Responsive --- */
@media (max-width: 1024px) and (min-width: 769px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.3rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.5rem; }

  /* Hide hamburger on tablet — the nav row still fits */
  .mobile-toggle {
    display: none !important;
  }

  /* Show nav links on tablet */
  .nav-links {
    display: flex !important;
    position: static;
    background: transparent;
    border: none;
    flex-direction: row;
    padding: 0;
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Compact header — save vertical space on phones */
  .header-inner { height: 56px; padding: 0 1rem; }
  .site-header.scrolled .header-inner { height: 56px; }
  .logo { font-size: 1rem; gap: 0.55rem; }
  .logo-icon { width: 30px; height: 30px; font-size: 0.85rem; }

  .mobile-toggle {
    display: block;
    width: 38px;
    height: 34px;
    padding: 0;
    line-height: 1;
  }

  /* Nav becomes a small, content-sized panel anchored to the top-right
     instead of a full-width dropdown that covers the hero. */
  .nav-links {
    display: flex;
    position: absolute;
    top: 60px;
    right: 0.75rem;
    left: auto;
    width: max-content;
    min-width: 172px;
    max-width: calc(100vw - 1.5rem);
    background: rgba(8, 11, 20, 0.97);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
    flex-direction: column;
    padding: 0.35rem;
    gap: 0;
    z-index: 999;
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s var(--ease-out), visibility 0.22s ease;
  }

  .nav-links.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links li:last-child { border-bottom: 0; }

  .nav-links a {
    display: block;
    padding: 0.5rem 0.7rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    border-radius: 4px;
    white-space: nowrap;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255, 107, 53, 0.1);
  }

  .nav-links a::after { display: none; }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3rem 0;
  }

  .section-lg {
    padding: 4rem 0;
  }

  .hero h1 { font-size: 2rem; }
  .hero { min-height: 50vh; }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .container { padding: 0 1rem; }
  .btn-lg { padding: 0.875rem 1.5rem; }
  .hero h1 { font-size: 1.75rem; }
}

/* Additional styles for index.html */
.hero-home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.section-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Fix: Dark overlay for hero background */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1614728894747-a83421e2b9c3?w=1920&q=80');
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.7) 0%, rgba(10, 10, 15, 0.9) 100%);
}

/* Fix: Center Latest News hero on desktop */
.hero-news .hero-content .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
