/* ===== Design System Variables ===== */
:root {
  /* Colors - Dark Mode (SpaceX/Rocket Lab/Palantir inspired) */
  --bg: #000000;
  --bg-2: #0a0a0a;
  --bg-card: #0d0d0d;
  --text: #ffffff;
  --text-dim: #b0b0b0;
  --muted: #808080;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --accent-2: #38bdf8;
  --accent-glow: rgba(14, 165, 233, 0.3);
  --border: #1a1a1a;
  --border-bright: #2a2a2a;
  
  /* Typography */
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
  
  /* Spacing */
  --container-max: 1200px;
  --section-padding: clamp(3rem, 6vw, 6rem);
  
  /* Borders - Sharper, more geometric */
  --radius: 4px;
  --radius-sm: 2px;
  
  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Base Styles ===== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
}

h5 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 600;
}

h6 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 600;
}

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

a {
  transition: color var(--transition);
}

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

/* ===== Layout Utilities ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  width: 100%;
}

.section {
  padding-block: var(--section-padding);
}

.grid {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
  display: flex;
  gap: 1rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-center {
  text-align: center;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-dark);
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ===== Header / Navigation ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color var(--transition), backdrop-filter var(--transition);
  padding: 1rem 0;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-desktop {
  display: none;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
}

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

/* Prevent the underline ::after on dropdown toggle */
.nav-dropdown-toggle::after {
  content: '▾';
  position: static;
  font-size: 0.8em;
  line-height: 1;
  display: inline-block;
  margin-left: 0.3rem;
  width: auto;
  height: auto;
  background: none;
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--accent);
}

/* Dropdown for "About" */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  white-space: nowrap;
}

.nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  margin-top: 0.5rem;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-submenu-item {
  padding: 0.5rem 1rem;
}

.nav-submenu-link {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

/* Mobile Menu */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  padding: 5rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 999;
}

.nav-mobile.active {
  transform: translateX(0);
}

.nav-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.nav-mobile-link {
  font-size: 1.25rem;
  font-weight: 500;
  display: block;
  padding: 0.5rem 0;
}

.nav-mobile-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 500;
  padding: 0.5rem 0;
}

.nav-mobile-dropdown-toggle::after {
  content: '+';
  font-size: 1.5rem;
  transition: transform var(--transition);
}

.nav-mobile-dropdown-toggle.active::after {
  transform: rotate(45deg);
}

.nav-mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 1rem;
}

.nav-mobile-submenu.active {
  max-height: 500px;
}

.nav-mobile-submenu-item {
  padding: 0.5rem 0;
}

.nav-mobile-submenu-link {
  font-size: 1rem;
  color: var(--muted);
}

/* Overlay backdrop for mobile menu */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 998;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: block;
  }
  
  .hamburger {
    display: none;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: all var(--transition);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none; /* Allow clicks through the overlay */
}

.card:hover::before {
  opacity: 0.5;
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 30px rgba(0, 168, 255, 0.1);
}

.card-title {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card-content {
  color: var(--text-dim);
}

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

#hero-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 2rem;
}

.hero-title {
  margin-bottom: 1rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-label.required::after {
  content: ' *';
  color: var(--accent);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: #ff4d4d;
}

.form-error {
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.form-error.active {
  display: block;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-checkbox-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}

.form-notice {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.form-notice.success {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.1);
}

.form-notice.warning {
  border-color: #ffa500;
  background: rgba(255, 165, 0, 0.1);
}

/* Honeypot (hidden) */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-success {
  text-align: center;
  padding: 3rem 2rem;
}

.form-success h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

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

.footer-main {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links h4 {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

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

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.social-link:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 0 15px var(--accent-glow);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-bottom a {
  color: var(--muted);
  transition: color var(--transition);
}

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

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

/* ===== Speed Intelligence Module ===== */
.speed-intelligence {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(2rem, 4vw, 3rem);
}

.speed-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.speed-tab {
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  transition: all var(--transition);
}

.speed-tab.active {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

.speed-tab:hover:not(.active) {
  border-color: var(--accent-dark);
  color: var(--text);
}

.speed-content {
  display: none;
}

.speed-content.active {
  display: block;
}

.speed-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.speed-item h4 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.speed-slider-container {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.speed-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 1.5rem 0;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dark);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.5);
}

.speed-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dark);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.5);
}

.speed-result {
  text-align: center;
  margin-top: 1rem;
}

.speed-result-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.speed-result-band {
  font-size: 1.25rem;
  color: var(--accent-2);
  margin-top: 0.5rem;
}

.speed-result-mach {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: var(--accent-dark);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: 2px solid var(--bg);
}

.timeline-date {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ===== Utility Classes ===== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
