/* Nbulai — always-dark cosmic base (page-wide) */
:root {
  --nbulai-deep-space: #02040d;
  --nbulai-night-blue: #050a1c;
  --nbulai-cosmic-black: #00020a;
}

/* Nbulai homepage — living galaxy cosmic hero (12 dark moods via JS) */
#cosmic-cover {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--mood-base-3, #010208);
  --mood-nebula-1: rgba(88, 60, 180, 0.45);
  --mood-nebula-2: rgba(30, 100, 180, 0.35);
  --mood-nebula-3: rgba(94, 238, 255, 0.12);
  --mood-base-1: #02040c;
  --mood-base-2: #030818;
  --mood-base-3: #010208;
  --nebula-opacity: 0.55;
  --bh-scale: 1;
  --bh-opacity: 0.9;
  --wh-scale: 1;
  --wh-opacity: 0.7;
  --ufo-opacity: 0.7;
  --ufo-glow: 94, 238, 255;
  --earth-glow: 80, 140, 220;
  --earth-strength: 0.4;
  --haze-opacity: 0.3;
  --motion-scale: 1;
  --sun-x: 0.5;
  --sun-y: 0.5;
  --sun-strength: 0;
  transition: background 2s ease;
}

/* Deep galaxy base — mood-driven */
.cosmic-hero__base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, var(--mood-base-2) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 20% 30%, var(--mood-nebula-1) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 85% 20%, var(--mood-nebula-2) 0%, transparent 45%),
    linear-gradient(180deg, var(--mood-base-1) 0%, var(--mood-base-2) 40%, var(--mood-base-3) 100%);
}

/* Atmospheric haze */
.cosmic-hero__haze {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, var(--mood-nebula-3), transparent 70%);
  opacity: var(--haze-opacity);
  mix-blend-mode: screen;
}

/* Subtle cosmic gas — dark, low opacity */
.cosmic-hero__gas {
  position: absolute;
  inset: -5%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--gas-opacity, 0.35);
  background:
    radial-gradient(ellipse 70% 45% at 15% 40%, rgba(var(--aurora-rgb, 80, 160, 220), 0.08), transparent 58%),
    radial-gradient(ellipse 55% 40% at 88% 55%, rgba(var(--aurora-rgb-2, 120, 80, 200), 0.07), transparent 55%),
    radial-gradient(ellipse 90% 50% at 50% 80%, rgba(20, 40, 80, 0.12), transparent 65%);
  filter: blur(28px);
}

/* Aurora ribbons — mood-driven, always subtle */
.cosmic-hero__aurora {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  opacity: var(--aurora-opacity, 0.22);
}

.cosmic-hero__aurora-ribbon {
  position: absolute;
  width: 140%;
  height: 28%;
  left: -20%;
  filter: blur(42px);
  mix-blend-mode: screen;
  opacity: 0.55;
}

.cosmic-hero__aurora-ribbon--1 {
  top: 8%;
  transform: rotate(var(--aurora-angle, 12deg));
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(var(--aurora-rgb, 80, 200, 220), 0.14) 35%,
    rgba(var(--aurora-rgb-2, 140, 100, 220), 0.1) 65%,
    transparent 100%
  );
  animation: auroraDrift1 38s ease-in-out infinite alternate;
}

.cosmic-hero__aurora-ribbon--2 {
  bottom: 18%;
  transform: rotate(calc(var(--aurora-angle, 12deg) * -0.65));
  background: linear-gradient(
    75deg,
    transparent,
    rgba(var(--aurora-rgb-2, 100, 80, 180), 0.12),
    rgba(var(--aurora-rgb, 60, 180, 200), 0.08),
    transparent
  );
  animation: auroraDrift2 44s ease-in-out infinite alternate;
}

@keyframes auroraDrift1 {
  from { transform: rotate(var(--aurora-angle, 12deg)) translateX(-2%); }
  to { transform: rotate(calc(var(--aurora-angle, 12deg) + 4deg)) translateX(3%); }
}

@keyframes auroraDrift2 {
  from { transform: rotate(calc(var(--aurora-angle, 12deg) * -0.65)) translateY(0); }
  to { transform: rotate(calc(var(--aurora-angle, 12deg) * -0.5)) translateY(-2%); }
}

/* Readability vignette — keeps center content legible */
.cosmic-hero__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(3, 6, 16, 0.15) 0%, rgba(3, 6, 16, 0.55) 75%, rgba(1, 2, 8, 0.85) 100%);
  z-index: 12;
}

/* Canvas layers */
.cosmic-hero__stars-canvas,
.cosmic-hero__fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.cosmic-hero__stars-canvas { z-index: 1; }
.cosmic-hero__fx-canvas { z-index: 9; }

/* Nebula clouds */
.cosmic-hero__nebula {
  position: absolute;
  inset: -10%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--nebula-opacity);
  mix-blend-mode: screen;
  animation: nebulaDrift 48s ease-in-out infinite alternate;
}

.cosmic-hero__nebula::before,
.cosmic-hero__nebula::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  transition: background 2s ease;
}

.cosmic-hero__nebula::before {
  width: 55%;
  height: 45%;
  left: 5%;
  top: 15%;
  background: radial-gradient(ellipse, var(--mood-nebula-1) 0%, var(--mood-nebula-2) 45%, transparent 70%);
}

.cosmic-hero__nebula::after {
  width: 50%;
  height: 40%;
  right: 0;
  bottom: 20%;
  background: radial-gradient(ellipse, var(--mood-nebula-2) 0%, var(--mood-nebula-1) 50%, transparent 72%);
}

.cosmic-hero__nebula-accent {
  position: absolute;
  width: 35%;
  height: 30%;
  left: 40%;
  top: 55%;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--mood-nebula-3) 0%, transparent 65%);
  filter: blur(36px);
  animation: nebulaPulse 20s ease-in-out infinite;
}

/* Global hero sun removed — daylight only in .celestial-timeline */
.cosmic-hero__solar {
  display: none !important;
}

/* Earth & horizon */
.cosmic-hero__earth-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 5;
  pointer-events: none;
}

.cosmic-hero__horizon-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 35% at 50% 100%, rgba(var(--earth-glow), 0.45), transparent 70%);
  opacity: var(--earth-strength);
  transition: background 2s ease, opacity 1.5s ease;
}

.cosmic-hero__earth {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(48vw, 340px);
  height: min(48vw, 340px);
  margin-left: min(-24vw, -170px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(140, 200, 255, 0.4), transparent 42%),
    radial-gradient(circle at 58% 55%, #1a4a6e 0%, #0d2840 38%, #061220 68%, #020810 100%);
  box-shadow:
    0 0 70px rgba(var(--earth-glow), calc(var(--earth-strength) * 0.35)),
    inset -18px -18px 45px rgba(0, 0, 0, 0.55);
  opacity: 0.94;
}

.cosmic-hero__earth::after {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(circle at 68% 48%, rgba(var(--earth-glow), 0.2), transparent 55%);
}

.cosmic-hero__planet--moon2 {
  right: 22%;
  top: 24%;
  width: min(7vw, 52px);
  height: min(7vw, 52px);
  background:
    radial-gradient(circle at 35% 30%, rgba(190, 200, 220, 0.35), transparent 40%),
    radial-gradient(circle at 60% 65%, #3a4050 0%, #222830 100%);
  box-shadow: 0 0 18px rgba(180, 200, 230, 0.12);
  display: none;
  animation: planetFloat2 30s ease-in-out infinite;
}

/* Planets */
.cosmic-hero__planets {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.cosmic-hero__planet {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* Ringed world — lower left */
.cosmic-hero__planet--ringed {
  left: 6%;
  bottom: 10%;
  width: min(28vw, 200px);
  height: min(28vw, 200px);
  background:
    radial-gradient(circle at 38% 32%, rgba(140, 200, 255, 0.35), transparent 42%),
    radial-gradient(circle at 55% 60%, #2a5a7a 0%, #143850 35%, #081828 68%, #030810 100%);
  box-shadow:
    0 0 50px rgba(60, 140, 220, 0.2),
    inset -12px -12px 30px rgba(0, 0, 0, 0.5);
  animation: planetFloat1 32s ease-in-out infinite;
}

.cosmic-hero__planet--ringed::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 155%;
  height: 38%;
  margin: -19% 0 0 -77.5%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(180, 210, 240, 0.25);
  border-bottom-color: rgba(120, 160, 200, 0.15);
  box-shadow:
    0 0 20px rgba(150, 200, 255, 0.15),
    inset 0 0 12px rgba(200, 230, 255, 0.08);
  transform: rotateX(72deg) rotateZ(-18deg);
  opacity: 0.85;
}

/* Small moon — upper right */
.cosmic-hero__planet--moon {
  right: 12%;
  top: 18%;
  width: min(10vw, 72px);
  height: min(10vw, 72px);
  background:
    radial-gradient(circle at 35% 30%, rgba(200, 210, 230, 0.4), transparent 40%),
    radial-gradient(circle at 60% 65%, #4a5068 0%, #2a3040 50%, #151820 100%);
  box-shadow: 0 0 24px rgba(180, 200, 230, 0.15);
  animation: planetFloat2 26s ease-in-out infinite;
}

/* Distant glow — far background */
.cosmic-hero__planet--distant {
  left: 72%;
  top: 8%;
  width: min(8vw, 56px);
  height: min(8vw, 56px);
  background: radial-gradient(circle, rgba(255, 200, 140, 0.5) 0%, rgba(200, 120, 80, 0.2) 40%, transparent 70%);
  box-shadow: 0 0 40px rgba(255, 180, 120, 0.35);
  opacity: 0.7;
  animation: planetPulse 14s ease-in-out infinite;
}

/* Secondary small planet */
.cosmic-hero__planet--azure {
  right: 28%;
  bottom: 18%;
  width: min(12vw, 88px);
  height: min(12vw, 88px);
  background:
    radial-gradient(circle at 40% 35%, rgba(100, 220, 255, 0.3), transparent 45%),
    radial-gradient(circle at 55% 60%, #1a4a6a 0%, #0d2840 45%, #061018 100%);
  box-shadow: 0 0 30px rgba(40, 120, 200, 0.2);
  opacity: 0.75;
  animation: planetFloat3 38s ease-in-out infinite;
}

/* Black hole */
.cosmic-hero__black-hole {
  position: absolute;
  right: 10%;
  top: 20%;
  width: min(18vw, 130px);
  height: min(18vw, 130px);
  z-index: 4;
  pointer-events: none;
  opacity: var(--bh-opacity);
  transform-origin: center center;
}

.cosmic-hero__black-hole-lens {
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 42%, rgba(80, 120, 200, 0.08) 48%, transparent 55%);
  filter: blur(4px);
}

.cosmic-hero__black-hole-disk {
  position: absolute;
  inset: -35%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 160, 80, 0.15) 40deg,
    rgba(255, 120, 200, 0.55) 90deg,
    rgba(120, 200, 255, 0.45) 140deg,
    rgba(255, 180, 100, 0.35) 200deg,
    transparent 280deg
  );
  filter: blur(6px);
  opacity: 0.9;
  animation: diskRotate 24s linear infinite;
}

.cosmic-hero__black-hole-core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0%, #020208 55%, rgba(20, 10, 40, 0.4) 100%);
  box-shadow:
    inset 0 0 20px #000,
    0 0 30px rgba(0, 0, 0, 0.9);
}

.cosmic-hero__black-hole-glow {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse 100% 40% at 50% 50%, rgba(255, 140, 80, 0.25), transparent 55%);
  filter: blur(12px);
  animation: diskShimmer 8s ease-in-out infinite;
}

/* Wormhole */
.cosmic-hero__wormhole {
  position: absolute;
  left: 8%;
  bottom: 28%;
  width: min(16vw, 110px);
  height: min(16vw, 110px);
  z-index: 4;
  pointer-events: none;
  opacity: var(--wh-opacity);
  transform-origin: center center;
}

.cosmic-hero__wormhole-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(140, 100, 255, 0.35);
  box-shadow:
    0 0 30px rgba(100, 80, 255, 0.35),
    inset 0 0 20px rgba(80, 60, 200, 0.2);
  animation: wormholePulse 6s ease-in-out infinite;
}

.cosmic-hero__wormhole-ring--2 {
  inset: 12%;
  border-color: rgba(94, 238, 255, 0.3);
  animation-delay: -2s;
}

.cosmic-hero__wormhole-ring--3 {
  inset: 24%;
  border-color: rgba(180, 140, 255, 0.25);
  animation-delay: -4s;
}

.cosmic-hero__wormhole-core {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 140, 255, 0.5) 0%, rgba(40, 20, 80, 0.8) 40%, #050210 75%);
  box-shadow:
    0 0 40px rgba(120, 80, 255, 0.5),
    inset 0 0 25px rgba(200, 180, 255, 0.3);
  animation: wormholeCore 10s ease-in-out infinite;
}

.cosmic-hero__wormhole-spiral {
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  background: conic-gradient(from 180deg, transparent, rgba(94, 238, 255, 0.2), transparent, rgba(160, 100, 255, 0.25), transparent);
  filter: blur(8px);
  opacity: 0.6;
  animation: diskRotate 18s linear infinite reverse;
}

/* Sleek UFO */
.cosmic-hero__ufo {
  position: absolute;
  top: 14%;
  right: 22%;
  width: min(14vw, 100px);
  height: min(5vw, 36px);
  z-index: 7;
  pointer-events: none;
  opacity: var(--ufo-opacity);
  animation: ufoGlide calc(28s / var(--motion-scale)) ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(var(--ufo-glow), 0.4));
}

.cosmic-hero__ufo-hull {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 42% 42% / 55% 55% 45% 45%;
  background: linear-gradient(180deg, rgba(180, 230, 255, 0.95) 0%, rgba(60, 140, 180, 0.85) 45%, rgba(20, 50, 80, 0.9) 100%);
  box-shadow:
    0 0 20px rgba(94, 238, 255, 0.4),
    inset 0 -6px 14px rgba(0, 20, 40, 0.4);
}

.cosmic-hero__ufo-cockpit {
  position: absolute;
  left: 50%;
  top: -28%;
  width: 38%;
  height: 55%;
  margin-left: -19%;
  border-radius: 50% 50% 35% 35%;
  background: radial-gradient(ellipse at 50% 80%, rgba(200, 255, 255, 0.9), rgba(80, 180, 220, 0.35));
  box-shadow: 0 0 14px rgba(150, 255, 255, 0.5);
}

.cosmic-hero__ufo-lights {
  position: absolute;
  bottom: 18%;
  left: 15%;
  right: 15%;
  height: 4px;
  display: flex;
  justify-content: space-around;
}

.cosmic-hero__ufo-lights span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--ufo-glow), 0.9);
  box-shadow: 0 0 8px rgba(var(--ufo-glow), 0.8);
  animation: ufoLights 2.5s ease-in-out infinite;
}

.cosmic-hero__ufo-lights span:nth-child(2) { animation-delay: 0.4s; }
.cosmic-hero__ufo-lights span:nth-child(3) { animation-delay: 0.8s; }

.cosmic-hero__ufo-glow {
  position: absolute;
  left: 50%;
  top: 95%;
  width: 70%;
  height: 50px;
  margin-left: -35%;
  background: linear-gradient(180deg, rgba(94, 238, 255, 0.2), transparent);
  clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%);
  opacity: 0.5;
  animation: ufoBeamPulse 4s ease-in-out infinite;
}

/* Parallax wrapper — JS sets transform */
.cosmic-hero__parallax {
  position: absolute;
  inset: 0;
  z-index: 3;
  will-change: transform;
}

/* Keyframes */
@keyframes nebulaDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -1.5%) scale(1.03); }
}

@keyframes nebulaPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

@keyframes planetFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(8px, -10px); }
}

@keyframes planetFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, 8px); }
}

@keyframes planetFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5px, 6px); }
}

@keyframes planetPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

@keyframes diskRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes diskShimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes blackHoleFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-8px, 6px); }
}

@keyframes wormholeFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -8px); }
}

@keyframes wormholePulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes wormholeCore {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@keyframes ufoGlide {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  33% { transform: translate(-24px, 10px) rotate(1deg); }
  66% { transform: translate(16px, -6px) rotate(-1deg); }
}

@keyframes ufoBeamPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

@keyframes ufoLights {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Tablet */
@media (max-width: 768px) {
  .cosmic-hero__earth {
    width: min(58vw, 260px);
    height: min(58vw, 260px);
    margin-left: min(-29vw, -130px);
  }

  .cosmic-hero__sun {
    width: min(16vw, 70px);
    height: min(16vw, 70px);
  }

  .cosmic-hero__planet--ringed {
    width: min(36vw, 160px);
    height: min(36vw, 160px);
    left: 2%;
    bottom: 6%;
  }

  .cosmic-hero__black-hole {
    width: min(22vw, 100px);
    height: min(22vw, 100px);
    right: 4%;
    top: 16%;
  }

  .cosmic-hero__wormhole {
    width: min(20vw, 88px);
    height: min(20vw, 88px);
    left: 4%;
    bottom: 22%;
  }

  .cosmic-hero__ufo {
    width: min(18vw, 80px);
    top: 10%;
    right: 8%;
    opacity: 0.55;
  }

  .cosmic-hero__nebula { opacity: 0.4; }
}

/* Mobile — simplify visible elements */
@media (max-width: 480px) {
  .cosmic-hero__planet--azure,
  .cosmic-hero__planet--distant {
    display: none;
  }

  .cosmic-hero__ufo-glow {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cosmic-hero__nebula,
  .cosmic-hero__nebula-accent,
  .cosmic-hero__aurora-ribbon,
  .cosmic-hero__planet,
  .cosmic-hero__black-hole-disk,
  .cosmic-hero__black-hole-glow,
  .cosmic-hero__wormhole-ring,
  .cosmic-hero__wormhole-core,
  .cosmic-hero__wormhole-spiral,
  .cosmic-hero__ufo,
  .cosmic-hero__ufo-glow,
  .cosmic-hero__ufo-lights span,
  .cosmic-hero__earth {
    animation: none !important;
  }

  #cosmic-cover {
    transition: none;
  }
}

/* ============================================================
   Live Celestial Position — borderless surface overlay
   ============================================================ */
.celestial-timeline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--stack-footer, 76px);
  transform: none;
  z-index: 3;
  width: 100%;
  max-width: none;
  padding: 0 clamp(8px, 2vw, 20px);
  box-sizing: border-box;
  --solar-accent: 255, 200, 120;
  --lunar-accent: 180, 200, 255;
  --solar-strength: 0.5;
  --track-inset: 2%;
  --horizon-pct: 61.5%;
  pointer-events: auto;
  font-family: "Courier New", monospace;
  font-size: 10px;
  color: rgba(220, 230, 245, 0.88);
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  clip-path: inset(0 50% 0 50%);
  animation: celestial-band-enter 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes celestial-band-enter {
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.celestial-timeline--drawn .celestial-horizon-draw {
  animation: celestial-horizon-draw 1.35s cubic-bezier(0.33, 1, 0.45, 1) forwards;
}

.celestial-timeline--drawn .celestial-arc-draw {
  animation: celestial-arc-draw 1.5s cubic-bezier(0.33, 1, 0.45, 1) forwards;
}

@keyframes celestial-horizon-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes celestial-arc-draw {
  to { stroke-dashoffset: 0; }
}

.celestial-timeline::before {
  display: none;
}

.celestial-timeline-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 10px 2px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.celestial-timeline-inner::before {
  display: none;
}

.celestial-graphic-wrap {
  position: relative;
  width: 100%;
  order: 1;
}

.celestial-controls {
  order: 2;
  width: 100%;
  max-width: min(640px, 92vw);
  margin: 0 auto;
  padding: 2px 10px 0;
  text-align: center;
}

.celestial-controls-meta {
  margin: 0 0 5px;
  font-size: clamp(7px, 0.72vw, 8px);
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.35;
  color: rgba(150, 180, 210, 0.48);
}

.celestial-controls-meta .celestial-title {
  font-weight: 600;
  color: rgba(94, 238, 255, 0.68);
  text-shadow: none;
}

.celestial-controls-meta .celestial-subtitle,
.celestial-controls-meta .celestial-sub {
  color: rgba(150, 180, 210, 0.42);
}

.celestial-meta-sep {
  margin: 0 0.4em;
  opacity: 0.35;
}

.celestial-controls-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  flex-wrap: wrap;
}

.timeline-title,
.celestial-title {
  margin: 0;
}

.timeline-sub,
.celestial-sub,
.celestial-subtitle {
  margin: 0;
}

.celestial-btn {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(180, 210, 235, 0.62);
  font-family: inherit;
  font-size: clamp(7px, 0.72vw, 8px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.celestial-btn--sky:hover:not(:disabled) {
  color: rgba(94, 238, 255, 0.92);
  text-shadow: 0 0 10px rgba(94, 238, 255, 0.28);
}

.celestial-btn--hide:hover,
.celestial-btn--hide[aria-expanded="true"] {
  color: rgba(220, 235, 255, 0.88);
  text-shadow: 0 0 8px rgba(200, 220, 240, 0.2);
}

.celestial-graphic.timeline-sky-stage,
.timeline-sky-stage {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.altitude-axis {
  display: none;
}

.altitude-axis__zero {
  color: rgba(94, 238, 255, 0.55);
}

.celestial-sky-svg,
.celestial-path-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 260;
  max-height: min(200px, 22vh);
  margin: 0 auto;
  pointer-events: none;
  overflow: visible;
}

.sky-label-svg {
  fill: rgba(140, 165, 195, 0.55);
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sky-label--horizon {
  fill: rgba(94, 238, 255, 0.48);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.celestial-horizon-draw,
.celestial-arc-draw {
  stroke-dashoffset: 0;
}

.alt-grid {
  stroke: rgba(120, 180, 220, 0.08);
  stroke-width: 0.5;
  stroke-dasharray: 2 6;
}

.alt-grid--0 {
  stroke: rgba(94, 238, 255, 0.18);
  stroke-width: 0.75;
}

.horizon-sea-fill {
  fill: rgba(20, 60, 100, 0.12);
  opacity: 0.7;
}

.horizon-line-svg {
  stroke: rgba(120, 220, 255, 0.62);
  stroke-width: 1.35;
  filter: drop-shadow(0 0 10px rgba(94, 238, 255, 0.4));
}

.solar-path-curve,
.sun-sky-curve {
  stroke: rgba(var(--solar-accent), calc(0.68 * var(--solar-strength)));
  stroke-width: 1.35;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(var(--solar-accent), 0.35));
}

.lunar-path-curve,
.moon-sky-curve {
  stroke: rgba(var(--lunar-accent), 0.52);
  stroke-width: 1.1;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(var(--lunar-accent), 0.3));
}

/* Moon drawn first so Sun arc reads on top at noon */
.solar-path-curve,
.sun-sky-curve {
  pointer-events: none;
}

.timeline-line-wrap,
.horizon-label,
.timeline-point,
.celestial-hud {
  display: none !important;
}

.sun-marker-svg,
.moon-marker-svg {
  opacity: 0;
  transition: transform 1s ease, opacity 0.8s ease;
}

.celestial-timeline--drawn .sun-marker-svg:not([data-below-horizon="true"]),
.celestial-timeline--drawn .moon-marker-svg:not([data-below-horizon="true"]) {
  animation: celestial-marker-in 0.7s ease 1.05s forwards;
}

.celestial-timeline--drawn .sun-marker-svg[data-below-horizon="true"],
.celestial-timeline--drawn .moon-marker-svg[data-below-horizon="true"] {
  animation: celestial-marker-in-dim 0.7s ease 1.05s forwards;
}

@keyframes celestial-marker-in {
  to { opacity: 1; }
}

@keyframes celestial-marker-in-dim {
  to { opacity: 0.35; }
}

.sun-marker-svg .sun-core {
  fill: #fff;
  stroke: rgba(var(--solar-accent), 0.95);
  stroke-width: 0.5;
  filter: drop-shadow(0 0 8px rgba(var(--solar-accent), calc(0.9 * var(--solar-strength))));
}

.sun-marker-svg .sun-halo {
  stroke: rgba(var(--solar-accent), calc(0.55 * var(--solar-strength)));
  stroke-width: 1;
  opacity: 0.85;
}

.sun-marker-svg .marker-tag-svg {
  fill: rgba(255, 210, 140, 0.82);
  font-family: "Courier New", monospace;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.sun-marker-svg[data-below-horizon="true"] {
  filter: saturate(0.5) brightness(0.65);
}

.moon-marker-svg .moon-core {
  fill: rgba(220, 230, 255, 0.88);
  stroke: rgba(var(--lunar-accent), 0.65);
  stroke-width: 0.5;
  filter: drop-shadow(0 0 6px rgba(var(--lunar-accent), 0.5));
}

.moon-marker-svg .moon-halo {
  stroke: rgba(var(--lunar-accent), 0.45);
  stroke-width: 0.85;
}

.moon-marker-svg .marker-tag-svg {
  fill: rgba(180, 210, 255, 0.78);
  font-family: "Courier New", monospace;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.moon-marker-svg[data-below-horizon="true"] {
  filter: saturate(0.55) brightness(0.7);
}

.moon-marker-svg .moon-core {
  filter: drop-shadow(0 0 6px rgba(var(--lunar-accent), 0.5));
}

.celestial-details {
  order: 3;
  display: none !important;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  width: 100%;
  max-width: min(980px, 94vw);
  padding: 10px 14px 8px;
  background: rgba(4, 10, 24, 0.38);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#celestialDetails[hidden],
.celestial-details[hidden] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.celestial-timeline--details-open #celestialDetails:not([hidden]),
.celestial-details.is-open:not([hidden]) {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
  margin: 4px auto 0 !important;
  padding: 10px 14px 8px !important;
}

.celestial-details .celestial-wellness-note,
.celestial-details .celestial-privacy,
.celestial-details .celestial-disclaimer {
  margin-top: 4px;
}

.timeline-readouts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  width: 100%;
}

.readout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: center;
  width: 100%;
}

.celestial-readout {
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.readout-label {
  color: rgba(120, 150, 180, 0.42);
  margin-right: 4px;
}

.readout-value,
.celestial-time {
  color: rgba(240, 248, 255, 0.94);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(94, 238, 255, 0.18);
}

.celestial-tz {
  max-width: 120px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.celestial-wellness-note,
.celestial-privacy,
.celestial-disclaimer {
  margin: 4px 0 0;
  text-align: center;
  font-size: 6px;
  line-height: 1.45;
  color: rgba(100, 130, 160, 0.38);
}

.celestial-disclaimer {
  max-width: 52em;
  margin-left: auto;
  margin-right: auto;
  padding: 0 8px;
}

@media (max-width: 768px) {
  .celestial-timeline {
    --track-inset: 9%;
  }

  .cosmic-hero__aurora,
  .cosmic-hero__gas {
    opacity: calc(var(--aurora-opacity, 0.22) * 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .celestial-timeline {
    opacity: 1;
    clip-path: none;
    animation: none;
  }

  .celestial-timeline--drawn .celestial-horizon-draw,
  .celestial-timeline--drawn .celestial-arc-draw {
    animation: none;
    stroke-dashoffset: 0;
  }

  .sun-marker-svg,
  .moon-marker-svg,
  .cosmic-hero__aurora-ribbon {
    transition: none !important;
    animation: none !important;
  }
}

