/* apps.yuechan.moe — constellation hub */
.hub {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 16px 24px;
}

.hub-head {
  text-align: center;
  margin-bottom: 18px;
}

.hub-head h1 {
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.2;
  letter-spacing: 0.14em;
}

.hub-sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
}

.constellation {
  position: relative;
  width: min(92vw, 760px);
  height: 64vh;
  min-height: 490px;
  max-height: 680px;
  margin: 6px auto 12px;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.constellation-lines line {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 5;
  vector-effect: non-scaling-stroke;
}

.star-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.star-node.is-open,
.star-node:hover,
.star-node:focus-within {
  z-index: 10;
}

.star-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 10px;
  margin: -10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.star-dot {
  display: block;
  width: var(--size, 9px);
  height: var(--size, 9px);
  border-radius: 50%;
  background: var(--ink-hi);
  box-shadow: 0 0 10px rgba(236, 234, 244, 0.45);
  animation: twinkle var(--twinkle-dur, 4.6s) ease-in-out infinite;
  animation-delay: var(--twinkle-delay, 0s);
}

.star-name {
  margin-top: 5px;
  font-family: var(--font-disp);
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--ink-hi);
  white-space: nowrap;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(7, 8, 15, 0.9);
}

.star-card {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(220px, 68vw);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 17, 36, 0.92);
  text-align: center;
  display: none;
}

.star-node:hover .star-card,
.star-node:focus-within .star-card,
.star-node.is-open .star-card {
  display: block;
}

.star-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-dim);
}

.star-open {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-disp);
  font-size: 12.5px;
  color: var(--ink-hi);
  letter-spacing: 0.06em;
}

.hub-home {
  margin-top: auto;
  padding-top: 18px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.home-link:hover {
  color: var(--ink-hi);
  text-decoration: none;
}

.home-link .moon {
  width: 13px;
  height: 13px;
  flex: none;
}

footer.site {
  margin-top: 24px;
  padding: 18px 0 24px;
}

footer.site .wrap {
  justify-content: center;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.92;
    transform: scale(1);
  }
  50% {
    opacity: 0.48;
    transform: scale(0.86);
  }
}

@media (prefers-reduced-motion: reduce) {
  .star-dot {
    animation: none;
  }
}

@media (max-width: 480px) {
  .hub {
    padding: 32px 10px 18px;
  }

  .constellation {
    width: 96vw;
    height: 66vh;
    min-height: 470px;
  }

  .star-name {
    font-size: 12.5px;
  }
}
