:root {
  --globe-bg: #060a12;
  --globe-bg-highlight: #0b1626;
  --globe-atmosphere: #5b9bff;
  --globe-text-primary: #e9eff7;
  --globe-text-secondary: #9aa7b8;
  --globe-accent: #7fb2ff;
  --map-ocean: var(--globe-bg);
  --map-land: var(--globe-bg-highlight);
  --map-border: var(--globe-atmosphere);
}

body {
  background: var(--globe-bg);
  color: var(--globe-text-primary);
}

.globe-layer {
  position: fixed;
  inset: 0;
  /* Zero, not negative: a negative z-index here would stack behind <body>'s
     own box (which covers the full viewport via min-height: 100vh), making
     it permanently unclickable regardless of what else is on the page. */
  z-index: 0;
  background: var(--globe-bg); /* fallback shown when WebGL is unavailable */
  display: flex;
  align-items: center;
  justify-content: center;
}

#globe-canvas {
  width: min(70vmin, 640px);
  height: min(70vmin, 640px);
  cursor: pointer;
}

#globe-canvas[hidden] {
  display: none;
}

.foreground {
  position: relative;
  z-index: 1;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  background: rgba(11, 22, 38, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--globe-text-primary);
  /* The panel is a read-only overlay on top of the clickable globe background;
     only the jimmy-trial link below opts back in to receiving clicks. */
  pointer-events: none;
}

.foreground pre {
  color: var(--globe-text-secondary);
}

.foreground a {
  color: var(--globe-accent);
  pointer-events: auto;
}

.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.85);
  opacity: 0;
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.map-overlay[hidden] {
  display: none;
}

.map-overlay[data-open="true"] {
  opacity: 1;
}

.map-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  transform: scale(0.96);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.map-overlay[data-open="true"] img {
  transform: scale(1);
}

#map-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--globe-atmosphere);
  background: rgba(11, 22, 38, 0.55);
  color: var(--globe-text-primary);
  font-size: 1rem;
  cursor: pointer;
}

#map-close:hover {
  background: var(--globe-accent);
  color: var(--globe-bg);
}

@media (prefers-reduced-motion: reduce) {
  .map-overlay,
  .map-overlay img {
    transition-duration: 150ms;
  }
}
