/* Earth Intro Animation CSS */
.wave-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(74, 108, 247, 0.08) 0%, rgba(74, 108, 247, 0.03) 18%, transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--secondary-bg) 88%, #0b1220 12%) 0%, var(--secondary-bg) 45%, color-mix(in srgb, var(--secondary-bg) 94%, #0b1220 6%) 100%);
}

.earth-intro {
  position: relative;
  width: min(78vw, 920px);
  height: min(78vw, 920px);
  perspective: 1200px;
  transform: translateY(-2vh);
}

.earth-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.earth-globe {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(36vw, 430px);
  height: min(36vw, 430px);
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(23.4deg) rotateZ(-8deg);
  animation: globe-tilt 18s ease-in-out infinite alternate;
  filter: drop-shadow(0 30px 55px rgba(11, 18, 32, 0.28));
}

.earth-globe::before,
.earth-globe::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.earth-globe::before {
  background:
    radial-gradient(circle at 68% 32%, rgba(255,255,255,0.55) 0 8%, rgba(255,255,255,0.14) 10%, transparent 20%),
    radial-gradient(circle at 50% 35%, rgba(18, 33, 68, 0.85) 0 24%, rgba(14, 28, 56, 0.98) 52%, rgba(8, 16, 34, 1) 74%, rgba(6, 12, 25, 1) 100%);
  box-shadow:
    inset -24px -28px 44px rgba(0, 0, 0, 0.28),
    inset 18px 18px 44px rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255,255,255,0.06);
}

.earth-globe::after {
  background:
    radial-gradient(circle at 58% 34%, rgba(71, 144, 255, 0.95) 0 8%, rgba(44, 103, 220, 0.88) 10%, rgba(29, 79, 183, 0.8) 24%, transparent 28%),
    radial-gradient(circle at 40% 54%, rgba(38, 126, 86, 0.92) 0 7%, rgba(30, 110, 74, 0.9) 12%, transparent 18%),
    radial-gradient(circle at 66% 66%, rgba(47, 142, 95, 0.9) 0 7%, rgba(31, 111, 75, 0.88) 12%, transparent 18%),
    radial-gradient(circle at 28% 30%, rgba(240, 227, 175, 0.88) 0 5%, rgba(223, 197, 120, 0.88) 10%, transparent 18%),
    radial-gradient(circle at 53% 52%, transparent 0 38%, rgba(10, 20, 40, 0.18) 40%, rgba(10, 20, 40, 0.42) 58%, rgba(5, 10, 22, 0.92) 100%);
  mix-blend-mode: screen;
  opacity: 0.82;
  animation: earth-spin 14s linear infinite;
  transform-origin: 50% 50%;
  image-rendering: pixelated;
}

.earth-hemisphere,
.earth-atmosphere,
.earth-grid,
.earth-clouds,
.earth-orbit,
.earth-satellite {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.earth-hemisphere--day {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), transparent 52%);
  clip-path: inset(0 50% 0 0);
  opacity: 0.6;
}

.earth-hemisphere--night {
  background: radial-gradient(circle at 50% 50%, rgba(5, 12, 24, 0.92), rgba(5, 12, 24, 0.72));
  clip-path: inset(0 0 0 50%);
  opacity: 0.52;
}

.earth-atmosphere {
  inset: -3%;
  border: 1px solid rgba(110, 178, 255, 0.18);
  box-shadow:
    0 0 40px rgba(90, 158, 255, 0.15),
    inset 0 0 28px rgba(120, 181, 255, 0.06);
  background: radial-gradient(circle at 50% 50%, transparent 65%, rgba(115, 176, 255, 0.14) 100%);
}

.earth-grid {
  inset: 2%;
  background:
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(255,255,255,0.08) 16px 17px, transparent 17px 32px),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(255,255,255,0.08) 16px 17px, transparent 17px 32px);
  opacity: 0.12;
  mix-blend-mode: soft-light;
  transform: rotateX(23.4deg);
  animation: grid-drift 12s linear infinite;
}

.earth-clouds {
  inset: 4%;
  background:
    radial-gradient(circle at 35% 22%, rgba(255,255,255,0.22) 0 4%, transparent 8%),
    radial-gradient(circle at 62% 26%, rgba(255,255,255,0.18) 0 5%, transparent 10%),
    radial-gradient(circle at 45% 60%, rgba(255,255,255,0.16) 0 6%, transparent 12%),
    radial-gradient(circle at 70% 55%, rgba(255,255,255,0.14) 0 5%, transparent 11%),
    radial-gradient(circle at 28% 68%, rgba(255,255,255,0.12) 0 4%, transparent 9%);
  opacity: 0.65;
  filter: blur(0.6px);
  animation: cloud-drift 20s linear infinite;
  mix-blend-mode: screen;
}

.earth-orbit {
  left: 50%;
  top: 50%;
  width: min(46vw, 560px);
  height: min(46vw, 560px);
  transform: translate(-50%, -50%) rotateX(72deg) rotateZ(90deg);
  border: 1px solid rgba(200, 219, 255, 0.18);
  box-shadow: 0 0 18px rgba(95, 152, 255, 0.08);
  border-radius: 50%;
  opacity: 0.8;
}

.earth-orbit--south {
  width: min(54vw, 640px);
  height: min(54vw, 640px);
  opacity: 0.45;
}

.earth-orbit--north {
  animation: orbit-turn 14s linear infinite;
}

.earth-orbit--south {
  animation: orbit-turn 22s linear infinite reverse;
}

.earth-satellite {
  width: 16px;
  height: 16px;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  background:
    linear-gradient(90deg, rgba(244,248,255,0.95) 0 36%, rgba(172,190,214,0.92) 36% 64%, rgba(244,248,255,0.95) 64% 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.55),
    0 0 14px rgba(180, 210, 255, 0.35);
  image-rendering: pixelated;
  transform-origin: 50% 50%;
}

.earth-satellite::before,
.earth-satellite::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 6px;
  margin-top: -3px;
  background: linear-gradient(90deg, rgba(180, 206, 236, 0.9), rgba(244, 248, 255, 0.9));
  box-shadow: 0 0 6px rgba(184, 214, 255, 0.45);
}

.earth-satellite::before {
  right: 100%;
  margin-right: 2px;
}

.earth-satellite::after {
  left: 100%;
  margin-left: 2px;
}

.earth-satellite--north {
  animation: polar-satellite-1 11s linear infinite;
}

.earth-satellite--south {
  animation: polar-satellite-2 16s linear infinite reverse;
}

@keyframes earth-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes globe-tilt {
  0% { transform: translate(-50%, -50%) rotateX(23.4deg) rotateZ(-10deg) scale(0.98); }
  100% { transform: translate(-50%, -50%) rotateX(23.4deg) rotateZ(-6deg) scale(1.01); }
}

@keyframes orbit-turn {
  0% { transform: translate(-50%, -50%) rotateX(72deg) rotateZ(90deg) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(72deg) rotateZ(90deg) rotate(360deg); }
}

@keyframes polar-satellite-1 {
  0% { transform: translate(-50%, -50%) rotate(0deg) translateY(-280px) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateY(-280px) rotate(-360deg); }
}

@keyframes polar-satellite-2 {
  0% { transform: translate(-50%, -50%) rotate(180deg) translateY(-320px) rotate(180deg); }
  100% { transform: translate(-50%, -50%) rotate(540deg) translateY(-320px) rotate(-540deg); }
}

@keyframes grid-drift {
  0% { transform: rotateX(23.4deg) translateX(0); }
  100% { transform: rotateX(23.4deg) translateX(16px); }
}

@keyframes cloud-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(18px); }
}

@media (max-width: 768px) {
  .earth-intro {
    width: min(100vw, 620px);
    height: min(100vw, 620px);
    transform: translateY(-1vh);
  }

  .earth-globe {
    width: min(48vw, 320px);
    height: min(48vw, 320px);
  }

  .earth-orbit {
    width: min(68vw, 420px);
    height: min(68vw, 420px);
  }

  .earth-orbit--south {
    width: min(78vw, 470px);
    height: min(78vw, 470px);
  }

  .earth-satellite {
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
  }

  @keyframes polar-satellite-1 {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateY(-200px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateY(-200px) rotate(-360deg); }
  }

  @keyframes polar-satellite-2 {
    0% { transform: translate(-50%, -50%) rotate(180deg) translateY(-235px) rotate(180deg); }
    100% { transform: translate(-50%, -50%) rotate(540deg) translateY(-235px) rotate(-540deg); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .earth-globe,
  .earth-globe::after,
  .earth-grid,
  .earth-clouds,
  .earth-orbit,
  .earth-satellite {
    animation: none !important;
  }
}
