/* ===========================
   Cape Constellation Website
   CSS Styles
   =========================== */

/* CSS Variables */
:root {
  /* Colors - Navy, Gold & African Warmth */
  --navy-dark: #0A0A14;
  --navy: #1E3A5F;
  --navy-light: #2a4a73;
  --gold: #D4A84B;
  --gold-light: #e5bc6d;
  --african-yellow: #E5A11C;
  --white: #FAFAFA;
  --white-muted: #a8a8b3;

  /* Theme Colors */
  --background: #0d0d18;
  --foreground: #FAFAFA;
  --card: #171728;
  --card-hover: #1e1e35;
  --muted: #1a1a2e;
  --muted-foreground: #8888a0;
  --border: #2a2a45;
  --primary: var(--gold);
  --primary-foreground: #0d0d18;
  --accent: var(--african-yellow);

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

  /* Spacing */
  --container-max: 1200px;
  --section-padding: 6rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.05em;
}

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

/* ===========================
   Starfield Background
   =========================== */
.starfield-container {
  position: fixed;
  inset: 0;
  background: #0a0a12;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.africa-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 80vh;
  min-width: 50vw;
  object-fit: contain;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.2; transform: scale(0.8); }
}

.comet {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 2px;
  z-index: 10;
  width: var(--tail-length, 300px);
  transform: translate(-50%, -50%) rotate(var(--comet-angle, 45deg));
  background: linear-gradient(90deg, rgba(212,168,75,0) 0%, rgba(212,168,75,0.6) 50%, rgba(255,255,255,1) 100%);
  animation: fly 8s linear infinite;
}

.comet::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 20px 4px rgba(212, 168, 75, 0.9), 0 0 40px 8px rgba(229, 161, 28, 0.4);
}

@keyframes fly {
  0% {
    transform: translate(-50%, -50%) rotate(var(--comet-angle, 45deg)) translateX(var(--start-pos, 800px));
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translate(-50%, -50%) rotate(var(--comet-angle, 45deg)) translateX(var(--end-pos, -800px));
    opacity: 0;
  }
}

/* ===========================
   Navigation
   =========================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all var(--transition-normal);
}

.header.scrolled {
  background: rgba(13, 13, 24, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 45px;
  width: auto;
  object-fit: contain;
}

@media (min-width: 480px) {
  .logo-img {
    height: 65px;
  }
}

.logo-fallback {
  display: flex;
  align-items: center;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
}

@media (min-width: 480px) {
  .logo-text {
    font-size: 1.25rem;
  }
}

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

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--foreground);
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--foreground);
  z-index: 60;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--background);
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mobile-nav-link {
  color: var(--foreground);
  font-size: 1.5rem;
  font-weight: 500;
  padding: 0.5rem;
  transition: color var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--primary);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: var(--gold-light);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(250, 250, 250, 0.2);
  color: var(--foreground);
}

.btn-outline:hover {
  background: rgba(250, 250, 250, 0.1);
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 168, 75, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 168, 75, 0.6);
  }
}

/* ===========================
   Main Content
   =========================== */
.main {
  position: relative;
  z-index: 1;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(13, 13, 24, 0.3) 80%, rgba(13, 13, 24, 0.5));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 56rem;
}

.tagline {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease-out;
}

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

.hero-title {
  font-size: clamp(1.25rem, 4.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

@media (max-width: 479px) {
  .hero-title {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1rem;
  color: rgba(168, 168, 179, 0.8);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .hero-ctas {
    flex-direction: row;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted-foreground);
  animation: bounce 2s infinite;
  z-index: 10;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* ===========================
   Sections Common
   =========================== */
.section {
  position: relative;
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===========================
   Why Space Section
   =========================== */
.reasons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.reason-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(23, 23, 40, 0.5);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.reason-card:hover {
  border-color: rgba(212, 168, 75, 0.5);
  transform: translateY(-4px);
}

.reason-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: rgba(212, 168, 75, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--primary);
  transition: background var(--transition-fast);
}

.reason-card:hover .reason-icon {
  background: rgba(212, 168, 75, 0.2);
}

.reason-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.reason-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ===========================
   Stats Section
   =========================== */
.stats-section {
  padding: 5rem 0;
}

.stats-card {
  padding: 1rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(to right, var(--card), rgba(23, 23, 40, 0.8), var(--card));
  border: 1px solid var(--border);
}

@media (min-width: 480px) {
  .stats-card {
    padding: 2rem;
  }
}

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

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-item:not(:last-child) {
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 767px) {
  .stats-grid {
    gap: 0;
  }

  .stat-item:nth-child(-n+2) {
    border-bottom: 1px solid var(--border);
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
}

@media (min-width: 480px) {
  .stat-item {
    padding: 1.5rem;
  }
}

.stat-value {
  font-size: clamp(1.75rem, 6vw, 3.75rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-number {
  color: var(--foreground);
}

.stat-suffix {
  color: var(--primary);
}

.stat-label {
  color: var(--muted-foreground);
  font-weight: 500;
  overflow-wrap: break-word;
  word-break: break-word;
}

.stat-sublabel {
  color: rgba(136, 136, 160, 0.6);
  font-size: 0.875rem;
}

/* ===========================
   Ecosystem Section
   =========================== */
.ecosystem-section {
  background: linear-gradient(to bottom, var(--background), rgba(23, 23, 40, 0.3), var(--background));
}

.ecosystem-diagram {
  position: relative;
}

.eco-level {
  text-align: center;
  margin-bottom: 0;
}

.eco-line {
  width: 2px;
  height: 2rem;
  background: var(--border);
  margin: 0 auto;
}

.eco-box {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
}

.eco-primary {
  background: rgba(212, 168, 75, 0.1);
  border: 1px solid rgba(212, 168, 75, 0.3);
}

.eco-accent {
  background: rgba(229, 161, 28, 0.1);
  border: 1px solid rgba(229, 161, 28, 0.3);
}

.eco-name {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--primary);
}

.eco-accent .eco-name {
  color: var(--accent);
}

.eco-role {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.company-item {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(30, 58, 95, 0.15);
  border: 1px solid rgba(30, 58, 95, 0.4);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.company-item:hover {
  background: rgba(30, 58, 95, 0.25);
  border-color: rgba(42, 74, 115, 0.6);
}

.company-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.company-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.ecosystem-cta {
  text-align: center;
  margin-top: 3rem;
}

.ecosystem-cta .btn svg {
  transition: transform var(--transition-fast);
}

.ecosystem-cta .btn:hover svg {
  transform: translateX(4px);
}

/* ===========================
   Countdown Section
   =========================== */
.countdown-card {
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(212, 168, 75, 0.1), var(--card), rgba(229, 161, 28, 0.1));
  border: 1px solid rgba(212, 168, 75, 0.2);
}

@media (min-width: 768px) {
  .countdown-card {
    padding: 3rem;
  }
}

.countdown-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 36rem;
  margin: 0 auto 2rem;
}

@media (min-width: 480px) {
  .countdown-grid {
    gap: 1rem;
  }
}

.countdown-item {
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  background: rgba(13, 13, 24, 0.5);
  border: 1px solid var(--border);
}

@media (min-width: 480px) {
  .countdown-item {
    padding: 1rem;
  }
}

.countdown-value {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  font-family: var(--font-mono);
}

.countdown-label {
  font-size: clamp(0.625rem, 2vw, 0.875rem);
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.countdown-date {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

/* ===========================
   Footer
   =========================== */
.footer {
  position: relative;
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  background: rgba(23, 23, 40, 0.3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  max-width: 28rem;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: rgba(212, 168, 75, 0.2);
  color: var(--foreground);
}

.footer-heading {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color var(--transition-fast);
}

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

.footer-location {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-location svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-parent {
  font-size: 0.75rem !important;
}

/* ===========================
   Utility Classes
   =========================== */
.text-balance {
  text-wrap: balance;
}

/* Animation delays for staggered effects */
.reason-card:nth-child(1) { animation-delay: 0ms; }
.reason-card:nth-child(2) { animation-delay: 100ms; }
.reason-card:nth-child(3) { animation-delay: 200ms; }
.reason-card:nth-child(4) { animation-delay: 300ms; }
.reason-card:nth-child(5) { animation-delay: 400ms; }
.reason-card:nth-child(6) { animation-delay: 500ms; }
