/* Space Elevator – High-Fidelity Exploration Simulator */
:root {
  --bg-space: #000003;
  --accent-cyan: #38bdf8;
  --accent-neon: #00f2fe;
  --accent-aurora: #34d399;
  --accent-gold: #fbbf24;
  --hud-bg: rgba(15, 23, 42, 0.85);
  --hud-border: rgba(255, 255, 255, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-space);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Atmosphere & Stars Canvas */
#sky-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Navigation Top Bar */
.top-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

.top-nav > * {
  pointer-events: auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hud-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hud-border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: var(--hud-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hud-border);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

/* Center Carbon Nanotube Cable */
.space-cable {
  position: fixed;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 40%, #0f172a 80%, #334155 100%);
  transform: translateX(-50%);
  z-index: 50;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  pointer-events: none;
}

/* Glass Elevator Capsule Anchored in Center Viewport */
.elevator-capsule-rig {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.elevator-capsule {
  width: 100px;
  height: 140px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(15, 23, 42, 0.65));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 0 20px rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease-out;
}

.elevator-capsule.shake {
  animation: capsuleTurbulence 0.1s infinite alternate ease-in-out;
}

@keyframes capsuleTurbulence {
  0% { transform: rotate(-2deg) translateY(-2px); }
  100% { transform: rotate(2deg) translateY(2px); }
}

.capsule-beacon {
  width: 14px;
  height: 6px;
  background: #38bdf8;
  border-radius: 4px;
  margin-top: 6px;
  box-shadow: 0 0 12px #38bdf8;
  animation: beaconPulse 1.2s infinite ease-in-out;
}

@keyframes beaconPulse {
  0%, 100% { opacity: 1; filter: brightness(1.3); }
  50% { opacity: 0.4; filter: brightness(0.7); }
}

.capsule-interior {
  width: 78px;
  height: 96px;
  background: rgba(15, 23, 42, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  margin-top: 6px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
}

/* Animated Astronaut Avatar */
.avatar-rig {
  width: 48px;
  height: 70px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: avatarHover 2.5s infinite ease-in-out;
}

@keyframes avatarHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.avatar-helmet {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.avatar-visor {
  width: 20px;
  height: 14px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 8px;
  position: absolute;
  top: 7px;
  left: 4px;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.avatar-visor::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 6px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  opacity: 0.8;
}

.avatar-suit {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 8px 8px 0 0;
  margin-top: -4px;
  position: relative;
}

.avatar-chestpack {
  width: 20px;
  height: 16px;
  background: #0284c7;
  border-radius: 4px;
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 2px;
}

.chest-led {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.chest-led.red { background: #ef4444; box-shadow: 0 0 4px #ef4444; }
.chest-led.green { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.chest-led.blue { background: #38bdf8; box-shadow: 0 0 4px #38bdf8; }

/* Cable Thruster Rings */
.thruster-ring {
  width: 120px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.8) 0%, rgba(56, 189, 248, 0) 70%);
  margin-top: 4px;
  opacity: 0.7;
}

/* Floating HUD Left: Science Telemetry */
.telemetry-hud {
  position: fixed;
  left: 20px;
  top: 90px;
  background: var(--hud-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hud-border);
  border-radius: 20px;
  padding: 1.25rem 1.4rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-width: 240px;
  width: calc(100vw - 40px);
}

.hud-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.hud-val {
  font-family: 'Space Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.hud-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.layer-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-align: center;
}

/* Bottom Flight Control Dock */
.control-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hud-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hud-border);
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.dock-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.dock-btn:hover {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
  transform: scale(1.05);
}

.dock-btn.active {
  background: var(--accent-cyan);
  color: #0f172a;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
}

.speed-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.speed-slider {
  -webkit-appearance: none;
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Quick Layer Jump Bar (Right Floating) */
.layer-quick-jump {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jump-node {
  background: var(--hud-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hud-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
}

.jump-node:hover, .jump-node.active {
  color: #ffffff;
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
  transform: translateX(-4px);
}

/* Scroll Virtual Container for 40+ Landmarks */
.landmarks-stream-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}

.landmark-item {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.landmark-item.left-side {
  right: calc(50% + 70px);
  flex-direction: row-reverse;
  text-align: right;
}

.landmark-item.right-side {
  left: calc(50% + 70px);
  flex-direction: row;
  text-align: left;
}

.landmark-visual-box {
  width: 80px;
  height: 80px;
  background: var(--hud-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hud-border);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.landmark-item:hover .landmark-visual-box {
  transform: scale(1.1);
  border-color: var(--accent-cyan);
}

.landmark-svg {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.landmark-info {
  background: var(--hud-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--hud-border);
  border-radius: 16px;
  padding: 0.8rem 1.1rem;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.landmark-alt {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.landmark-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 2px 0 4px 0;
}

.landmark-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Layer Section Banner in Landmarks Stream */
.layer-section-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  text-align: center;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.9), transparent);
  border-top: 1px solid var(--accent-cyan);
  border-bottom: 1px solid var(--accent-cyan);
  padding: 1rem 0;
}

.layer-banner-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.layer-banner-alt {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

/* Semantic SEO Article Section */
.seo-article {
  position: absolute;
  top: 100000px; /* Positioned out of viewport stream but fully accessible to search engines */
  left: 0;
  width: 100%;
  padding: 3rem 1.5rem;
  background: #020617;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-article h2 {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.seo-article p {
  margin-bottom: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .telemetry-hud {
    top: 75px;
    left: 12px;
    padding: 0.85rem 1rem;
    max-width: 190px;
    gap: 8px;
  }
  .hud-val {
    font-size: 1.05rem;
  }
  .control-dock {
    bottom: 12px;
    padding: 0.45rem 1rem;
    gap: 8px;
  }
  .layer-quick-jump {
    display: none;
  }
  .landmark-item.left-side {
    right: calc(50% + 55px);
  }
  .landmark-item.right-side {
    left: calc(50% + 55px);
  }
  .landmark-visual-box {
    width: 60px;
    height: 60px;
  }
  .landmark-svg {
    width: 40px;
    height: 40px;
  }
  .landmark-info {
    max-width: 200px;
    padding: 0.6rem 0.8rem;
  }
  .landmark-title {
    font-size: 0.9rem;
  }
  .landmark-desc {
    font-size: 0.75rem;
  }
}
