@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&family=Inter:wght@400;500;600&display=swap");

:root {
  --background: #050713;
  --background-secondary: #11152b;
  --panel: rgba(12, 16, 36, 0.72);
  --panel-strong: rgba(14, 19, 43, 0.94);
  --text: #f3efe5;
  --muted: #a9adc1;
  --gold: #d8ba79;
  --gold-light: #f5dfaa;
  --line: rgba(216, 186, 121, 0.24);
  --glow: rgba(147, 176, 255, 0.24);
  --sky-accent: #869cff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: "Inter", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.observatory {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 32px clamp(20px, 5vw, 72px) 24px;
  background: radial-gradient(circle at 50% 32%, var(--glow), transparent 36%),
    linear-gradient(145deg, var(--background-secondary), var(--background) 70%);
  transition: background 1.5s ease, color 1s ease;
}

.observatory[data-sky="dawn"] {
  --background: #201426;
  --background-secondary: #6a3849;
  --sky-accent: #ffc08f;
  --glow: rgba(255, 170, 126, 0.28);
}

.observatory[data-sky="day"] {
  --background: #426a8b;
  --background-secondary: #8fb7cb;
  --panel: rgba(16, 35, 56, 0.58);
  --panel-strong: rgba(24, 48, 68, 0.84);
  --text: #fffaf0;
  --muted: #e1e8ec;
  --line: rgba(255, 239, 199, 0.32);
  --sky-accent: #fff0b7;
  --glow: rgba(255, 237, 173, 0.3);
}

.observatory[data-sky="sunset"] {
  --background: #1d1831;
  --background-secondary: #7a3446;
  --sky-accent: #ffac76;
  --glow: rgba(255, 126, 87, 0.27);
}

.observatory[data-sky="night"] {
  --background: #03050d;
  --background-secondary: #10152d;
  --sky-accent: #91a6ff;
  --glow: rgba(107, 138, 255, 0.22);
}

.starfield,
.starfield::before,
.starfield::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.starfield {
  opacity: 0.85;
  background-image: radial-gradient(circle, white 0 1px, transparent 1.5px),
    radial-gradient(circle, white 0 1px, transparent 1.5px),
    radial-gradient(circle, #dce5ff 0 1px, transparent 1.6px);
  background-size: 110px 110px, 173px 173px, 247px 247px;
  background-position: 20px 30px, 85px 110px, 140px 40px;
  animation: driftStars 90s linear infinite;
}

.starfield::before {
  content: "";
  opacity: 0.45;
  background-image: radial-gradient(circle, white 0 1px, transparent 2px);
  background-size: 79px 79px;
  background-position: 15px 20px;
  animation: twinkle 5s ease-in-out infinite alternate;
}

.starfield::after {
  content: "";
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.observatory[data-sky="day"] .starfield {
  opacity: 0.15;
}

.shooting-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shooting-stars::before,
.shooting-stars::after {
  content: "";
  position: absolute;
  top: 18%;
  left: -20%;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, white, transparent);
  opacity: 0;
  transform: rotate(-20deg);
  animation: shootStar 9s ease-in-out infinite;
}

.shooting-stars::after {
  top: 46%;
  animation-delay: 4s;
}

.topbar,
.clock-layout,
footer {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto 36px;
}

.eyebrow,
.card-label {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.9rem, 4vw, 3.7rem);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.sound-toggle {
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(10, 13, 29, 0.38);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clock-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(56px, 8vw, 130px);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.celestial-stage {
  position: relative;
  display: grid;
  width: min(72vw, 690px);
  aspect-ratio: 1;
  place-items: center;
  margin: auto;
}

.orbit {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.02),
    0 0 30px rgba(126, 154, 255, 0.04);
}

.orbit-outer {
  inset: 1%;
}

.orbit-middle {
  inset: 11%;
  border-style: dashed;
}

.orbit-inner {
  inset: 25%;
}

.zodiac-wheel {
  position: absolute;
  inset: 4%;
  animation: rotateWheel 180s linear infinite;
}

.zodiac-wheel::before,
.zodiac-wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.zodiac-wheel::after {
  inset: 8%;
}

.zodiac-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  margin: -27px;
  place-items: center;
  border: 1px solid rgba(216, 186, 121, 0.45);
  border-radius: 50%;
  background: rgba(10, 14, 32, 0.72);
  box-shadow: 0 0 18px rgba(216, 186, 121, 0.12),
    inset 0 0 15px rgba(255, 255, 255, 0.03);
  transform: rotate(var(--angle))
    translateY(calc(clamp(160px, 29vw, 315px) * -1))
    rotate(calc(var(--angle) * -1));
}

.zodiac-marker:hover {
  background: rgba(216, 186, 121, 0.15);
  border-color: var(--gold-light);
}

.zodiac-image {
  display: block;
  width: 68%;
  height: 68%;
  object-fit: contain;
  filter: sepia(1) saturate(0.8) brightness(1.45)
    drop-shadow(0 0 4px rgba(245, 223, 170, 0.45));
}

.marker-1 {
  --angle: 0deg;
}

.marker-2 {
  --angle: 30deg;
}

.marker-3 {
  --angle: 60deg;
}

.marker-4 {
  --angle: 90deg;
}

.marker-5 {
  --angle: 120deg;
}

.marker-6 {
  --angle: 150deg;
}

.marker-7 {
  --angle: 180deg;
}

.marker-8 {
  --angle: 210deg;
}

.marker-9 {
  --angle: 240deg;
}

.marker-10 {
  --angle: 270deg;
}

.marker-11 {
  --angle: 300deg;
}

.marker-12 {
  --angle: 330deg;
}

.sun-hand,
.moon-hand {
  position: absolute;
  inset: 12%;
  pointer-events: none;
  transition: transform 1s linear;
}

.sun-hand::before,
.moon-hand::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 35%;
  background: linear-gradient(to top, var(--line), transparent);
  transform: translateX(-50%);
  transform-origin: bottom center;
}

.sun-orb,
.moon-orb {
  position: absolute;
  top: -3px;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  transform: translateX(-50%);
}

.sun-orb {
  color: #ffe8a3;
  background: rgba(255, 210, 104, 0.14);
  box-shadow: 0 0 26px rgba(255, 207, 95, 0.5),
    inset 0 0 13px rgba(255, 238, 175, 0.24);
}

.moon-orb {
  top: auto;
  bottom: -3px;
  color: #e6ecff;
  background: rgba(184, 202, 255, 0.12);
  box-shadow: 0 0 24px rgba(150, 176, 255, 0.4);
}

.clock-core {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 48%;
  aspect-ratio: 1;
  padding: 22px;
  text-align: center;
  background: radial-gradient(
      circle at 50% 35%,
      rgba(255, 255, 255, 0.08),
      transparent 65%
    ),
    var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 70px var(--glow), inset 0 0 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

#periodLabel {
  margin-bottom: 8px;
  color: var(--sky-accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

#liveTime {
  display: block;
  font-family: "Cinzel", serif;
  font-size: clamp(1.55rem, 4vw, 3.1rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

#liveDate {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: clamp(0.72rem, 1.5vw, 0.88rem);
}

.active-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.current-sign-image {
  display: block;
  width: clamp(44px, 6vw, 68px);
  height: clamp(44px, 6vw, 68px);
  object-fit: contain;
  flex-shrink: 0;
  filter: sepia(1) saturate(0.8) brightness(1.45)
    drop-shadow(0 0 8px rgba(245, 223, 170, 0.45));
}

.panel-sign-image {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  filter: sepia(1) saturate(0.8) brightness(1.45)
    drop-shadow(0 0 8px rgba(245, 223, 170, 0.45));
}

.active-sign div {
  text-align: left;
}

.active-sign small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.active-sign strong {
  font-family: "Cinzel", serif;
  font-size: clamp(0.9rem, 2vw, 1.25rem);
  font-weight: 500;
}

.data-panel {
  display: grid;
  gap: 18px;
}

.data-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.featured-card {
  padding: 28px;
}

.featured-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  pointer-events: none;
}

.sign-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.sign-heading h2 {
  margin-bottom: 4px;
  font-family: "Cinzel", serif;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 500;
}

.sign-heading p,
.data-card > p:not(.card-label),
.progress-meta {
  color: var(--muted);
  line-height: 1.65;
}

#signDescription {
  max-width: 580px;
}

.progress-track {
  width: 100%;
  height: 5px;
  margin: 22px 0 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(255, 216, 135, 0.5);
  transition: width 0.8s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.large-value {
  display: block;
  margin-bottom: 8px;
  font-family: "Cinzel", serif;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 500;
}

footer {
  max-width: 1400px;
  margin: 40px auto 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

@keyframes rotateWheel {
  to {
    transform: rotate(360deg);
  }
}

@keyframes driftStars {
  to {
    background-position: 130px 140px, 258px 283px, 387px 287px;
  }
}

@keyframes twinkle {
  from {
    opacity: 0.25;
  }

  to {
    opacity: 0.8;
  }
}

@keyframes shootStar {
  0%,
  78% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(-20deg);
  }

  82% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    transform: translateX(140vw) translateY(45vh) rotate(-20deg);
  }
}

@media (max-width: 920px) {
  .celestial-stage {
    margin-right: clamp(8px, 1.6vw, 24px);
  }
  .clock-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .data-panel {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
  }
  .data-panel {
    padding-left: clamp(8px, 1.8vw, 24px);
  }

  .clock-core {
    width: 74%;
    aspect-ratio: 1;
  }
}

@media (max-width: 580px) {
  .observatory {
    padding: 22px 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .sound-toggle {
    display: none;
  }

  .celestial-stage {
    width: 96vw;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .zodiac-marker {
    width: 44px;
    height: 44px;
    margin: -22px;
    transform: rotate(var(--angle))
      translateY(calc(clamp(142px, 43vw, 230px) * -1))
      rotate(calc(var(--angle) * -1));
  }

  .clock-core {
    width: 52%;
    padding: 15px;
  }

  .active-sign {
    gap: 7px;
  }

  .current-sign-image {
    width: 42px;
    height: 42px;
  }

  .panel-sign-image {
    width: 58px;
    height: 58px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .featured-card,
  .data-card {
    padding: 20px;
  }

  .progress-meta {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}