:root {
  --space-blue: #05031c;
  --planet-orange: #ff8a65;
  --planet-purple: #9370ff;
  --cloud-white: rgba(255, 255, 255, 0.85);
  --ufo-green: #88ffda;
  --ufo-purple: #9c27b0;
  --card-bg: rgba(5, 3, 28, 0.75);
  --text-color: #f5f7ff;
}

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

body {
  font-family: "Poppins", sans-serif;
  background: var(--space-blue);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
}

.space-scene {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #040115 0%, #090536 100%);
  overflow: hidden;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.content {
  position: relative;
  z-index: 1;
  padding: 3rem clamp(1.5rem, 4vw, 4rem);
  display: grid;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.main-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1.5rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.logo {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  letter-spacing: 0.12em;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 0.25rem;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--planet-orange), var(--planet-purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

/* Estado activo para enlaces del menú (usado por scripts.js) */
.main-nav a.active {
  font-weight: 700;
}

.main-nav a.active::after {
  transform: scaleX(1);
}

main {
  display: grid;
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1.75rem;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.card p {
  line-height: 1.7;
  color: rgba(245, 247, 255, 0.85);
}

#stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

#planets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.planet {
  position: absolute;
  border-radius: 50%;
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.35));
}

.planet-one {
  width: 180px;
  height: 180px;
  top: 12%;
  left: 8%;
  background: radial-gradient(circle at 30% 30%, #fff4e6, var(--planet-orange));
}

.planet-two {
  width: 120px;
  height: 120px;
  bottom: 18%;
  right: 12%;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--planet-purple));
}

#clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 240px;
  height: 100px;
  background: var(--cloud-white);
  border-radius: 50% 50% 45% 45%;
  filter: blur(1px);
  opacity: 0.6;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: var(--cloud-white);
  border-radius: 50%;
}

.cloud::before {
  width: 120px;
  height: 120px;
  top: -40px;
  left: 30px;
}

.cloud::after {
  width: 150px;
  height: 140px;
  top: -60px;
  right: 20px;
}

.cloud-one {
  top: 28%;
  left: 10%;
}

.cloud-two {
  top: 65%;
  left: 55%;
}

#ufo {
  position: absolute;
  bottom: 25%;
  left: 50%;
  width: 200px;
  height: 120px;
  transform: translateX(-50%);
  pointer-events: none;
}

.ufo-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 160px;
  height: 60px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--ufo-purple), #5e1b80);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.45);
}

.ufo-glass {
  position: absolute;
  top: 0;
  left: 50%;
  width: 110px;
  height: 90px;
  transform: translate(-50%, -20%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2));
  border-radius: 55% 55% 45% 45%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}

.ufo-character {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 40% 35%, #ffe0b2, #ffb74d);
  border-radius: 50%;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15);
}

.ufo-character::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 32px;
  height: 20px;
  transform: translateX(-50%);
  background: #2d1b55;
  border-radius: 20px 20px 60px 60px;
}

.ufo-light {
  position: absolute;
  bottom: -20px;
  left: 50%;
  width: 50px;
  height: 50px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(136, 255, 218, 0.9), rgba(136, 255, 218, 0));
  filter: blur(2px);
}

@media (max-width: 768px) {
  .content {
    padding: 2.5rem 1.5rem 4rem;
  }

  .main-nav ul {
    justify-content: center;
  }

  #ufo {
    width: 160px;
  }

  .ufo-body {
    width: 130px;
  }

  .ufo-glass {
    width: 90px;
    height: 70px;
  }
}
