@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
  --bg-deep: #04050c;
  --bg-mid: #0a0f24;
  --ink: #eaf0ff;
  --ink-dim: #93a2cc;
  --gold: #e8c98a;
  --accent: #6ea8ff;
  --line: rgba(234, 240, 255, 0.16);

  --saturn: #d9ac66;
  --uranus: #4fd6d0;
  --neptune: #4f7bff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: radial-gradient(
    ellipse at 50% -10%,
    var(--bg-mid) 0%,
    var(--bg-deep) 55%,
    #000 100%
  );
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
  position: relative;
}

.hand {
  font-family: "Oi", serif;
}

.mono {
  font-family: "Space Mono", ui-monospace, monospace;
}

a {
  color: inherit;
}

/* ---------- Starfield ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.stars span {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- Layout shells ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
}

.brand-name {
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1;
}

.home-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.home-btn:hover {
  background: rgba(234, 240, 255, 0.1);
  transform: translateY(-1px);
}

/* ---------- Landing page ---------- */
.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px 64px;
  gap: 20px;
}

.logo-mark {
  width: 96px;
  height: 96px;
  opacity: 0;
  transform: scale(0.7);
  animation: logo-in 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}

@keyframes logo-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reveal-wrap {
  position: relative;
  display: inline-block;
}

.landing h1 {
  font-family: "Oi", serif;
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 6.5rem);
  line-height: 1;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(110, 168, 255, 0.4);
}

.reveal-mask {
  position: absolute;
  inset: -6% -3%;
  background: var(--bg-deep);
  animation: wipe-reveal 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  animation-delay: 1.15s;
}

@keyframes wipe-reveal {
  from {
    clip-path: inset(0 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 100%);
  }
}

.landing .tagline {
  font-family: "Space Mono", monospace;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0;
  animation: fade-up 0.9s ease forwards;
  animation-delay: 2.1s;
}

.landing p.lead {
  max-width: 620px;
  color: var(--ink-dim);
  line-height: 1.8;
  font-size: 0.95rem;
  margin: 0;
  opacity: 0;
  animation: fade-up 0.9s ease forwards;
  animation-delay: 2.35s;
}

.cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  border: 1px solid rgba(234, 240, 255, 0.45);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  transition: all 0.25s ease;
  opacity: 0;
  animation: fade-up 0.9s ease forwards;
  animation-delay: 2.6s;
}

.cta:hover {
  background: var(--ink);
  color: var(--bg-deep);
  box-shadow: 0 0 40px rgba(234, 240, 255, 0.35);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Select / orbit carousel page ---------- */
.select-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 10px 20px 60px;
}

.select-title {
  text-align: center;
}

.select-title h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 6px;
}

.select-title p {
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin: 0;
  font-family: "Space Mono", monospace;
}

.orbit-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 4vw, 40px);
  width: 100%;
  max-width: 980px;
}

.arrow-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.arrow-btn:hover {
  background: rgba(234, 240, 255, 0.1);
  transform: scale(1.06);
}

.arrow-btn svg {
  width: 20px;
  height: 20px;
}

.orbit-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: min(60vw, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(56vw, 360px);
  height: min(56vw, 360px);
  transform: translate(-50%, -50%);
  border: 1.5px dashed var(--line);
  border-radius: 50%;
  animation: orbit-spin 50s linear infinite;
}

.orbit-ring::before,
.orbit-ring::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.orbit-ring::before {
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
}
.orbit-ring::after {
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes orbit-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.orbit-satellite {
  position: absolute;
  top: 50%;
  width: min(16vw, 80px);
  height: min(16vw, 80px);
  transform: translateY(-50%);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.45;
  filter: saturate(0.6) brightness(0.7);
  transition:
    opacity 0.3s ease,
    filter 0.3s ease,
    transform 0.3s ease;
  border: 1px solid var(--line);
}

.orbit-satellite:hover {
  opacity: 0.8;
  filter: saturate(0.9) brightness(0.9);
}

.orbit-satellite.prev {
  left: 6%;
}
.orbit-satellite.next {
  right: 6%;
}

.orbit-satellite img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.orbit-center {
  position: relative;
  z-index: 2;
  width: min(34vw, 210px);
  height: min(34vw, 210px);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 60px 6px var(--planet-glow, rgba(110, 168, 255, 0.45));
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s ease;
}

.orbit-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.orbit-center.swap-out {
  transform: scale(0.25);
  opacity: 0;
}

.orbit-center.swap-in {
  animation: swap-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes swap-in {
  from {
    transform: scale(0.25);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.orbit-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  margin: 0;
}

.orbit-dots {
  display: flex;
  gap: 10px;
}

.orbit-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.orbit-dots span.active {
  background: var(--gold);
  transform: scale(1.3);
}

.hint {
  color: var(--ink-dim);
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.hint strong {
  color: var(--gold);
  font-weight: normal;
}

/* ---------- Detail page ---------- */
.detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 5vw, 64px) 64px;
}

.detail-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.detail-visual {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.detail-photo-ring {
  width: min(50vw, 320px);
  height: min(50vw, 320px);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 90px 10px var(--planet-glow, rgba(110, 168, 255, 0.4));
  animation: float-planet 7s ease-in-out infinite;
}

.detail-photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes float-planet {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

.image-credit {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--ink-dim);
  opacity: 0.7;
  text-align: center;
}

.detail-text {
  flex: 1 1 420px;
  max-width: 580px;
}

.detail-text .tagline {
  display: block;
  text-align: center;
  font-family: "Space Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
  margin-bottom: 6px;
}

.detail-text h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 20px;
  text-align: center;
}

.detail-text p {
  color: var(--ink-dim);
  line-height: 1.85;
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .label {
  font-family: "Space Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.stat .value {
  font-size: 0.92rem;
  color: var(--gold);
}

/* Relations / neighbor links */
.relations {
  max-width: 1200px;
  margin: 8px auto 0;
  width: 100%;
  padding-top: 28px;
}

.relations h3,
.watch h3 {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 14px;
  text-align: center;
}

.relations-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.relation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.relation-card:hover {
  border-color: rgba(234, 240, 255, 0.5);
  transform: translateY(-2px);
}

.relation-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.relation-card .r-label {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}

.relation-card .r-name {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.relation-card.back {
  border-style: dashed;
}

/* Watch on YouTube */
.watch {
  max-width: 620px;
  margin: 40px auto 0;
  width: 100%;
}

.watch-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.watch-card:hover {
  border-color: rgba(234, 240, 255, 0.5);
  transform: translateY(-2px);
}

.watch-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.watch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.85;
}

.watch-thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
}

.watch-text .w-label {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.watch-text .w-title {
  font-weight: 600;
}

@media (max-width: 640px) {
  .orbit-satellite {
    display: none;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arrow-btn {
    width: 42px;
    height: 42px;
  }
}
