/* =========================================================
   Księżyc — fotograficzny z prawdziwymi fazami
   Bazuje na NASA LRO photograph.
   ========================================================= */

.moon {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

/* Outer atmospheric halo */
.moon::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(240, 230, 200, 0.10) 0%,
    rgba(200, 182, 132, 0.05) 25%,
    rgba(240, 230, 200, 0.02) 55%,
    transparent 75%);
  pointer-events: none;
  z-index: 0;
  animation: moon-halo 16s ease-in-out infinite;
  filter: blur(16px);
}

@keyframes moon-halo {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Moon SVG wrapper — host for the canvas */
.moon-svg {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;
  filter: drop-shadow(0 0 24px rgba(240, 230, 200, 0.10));
}

.moon-svg canvas,
.moon-svg .moon-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  animation: moon-breath 24s ease-in-out infinite;
}

@keyframes moon-breath {
  0%, 100% {
    filter: contrast(1) brightness(1);
  }
  50% {
    filter: contrast(1.03) brightness(1.03);
  }
}

/* Soft atmospheric edge inside disk */
.moon-svg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    transparent 60%,
    rgba(0, 0, 0, 0.25) 100%);
  z-index: 3;
  mix-blend-mode: multiply;
}

/* =========================================================
   Phase indicator label
   ========================================================= */

.moon-caption {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  z-index: 5;
  display: flex;
  gap: 14px;
  align-items: center;
}

.moon-caption .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
  animation: twinkle-dot 3s ease-in-out infinite;
}

@keyframes twinkle-dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* =========================================================
   Moon video wrapper
   ========================================================= */

.moon-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 0 40px rgba(240, 230, 200, 0.10);
  box-sizing: border-box;
}

.moon-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  animation: moon-breath 24s ease-in-out infinite;
}

/* Outer halo removed — was causing overflow */

/* Soft vignette edge */
.moon-video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    transparent 65%,
    rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
  z-index: 3;
}

/* =========================================================
   Compact moon (nav) — keep as CSS
   ========================================================= */

.moon-compact {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-image: url("assets/moon-nasa.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 10px rgba(240, 230, 200, 0.25);
  flex-shrink: 0;
}
