/* The star map: nine hidden stars and the dialog they open. Shared by the home page. */

html.is-starmap-open {
  overflow: hidden;
}

.hstar {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}

.hstar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(200, 230, 255, 0.7);
  animation: twinkle var(--tw, 4s) ease-in-out infinite;
  animation-delay: var(--td, 0s);
}

.hstar::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(160, 235, 220, 0.75);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.hstar:hover::after,
.hstar:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.hstar__name {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translate(4px, -50%);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(220, 245, 240, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.hstar:hover .hstar__name,
.hstar:focus-visible .hstar__name {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ---------------------------------------------------------------- star map */

.starmap {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.starmap::backdrop {
  background: rgba(2, 4, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.starmap[open] {
  animation: fade 0.6s var(--ease);
}

.starmap__inner {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: 28px var(--gutter) 20px;
  background:
    radial-gradient(1200px 600px at 70% 20%, rgba(40, 70, 110, 0.35), transparent 60%),
    radial-gradient(900px 500px at 10% 90%, rgba(30, 90, 80, 0.25), transparent 60%),
    rgba(3, 6, 11, 0.94);
}

.starmap__head {
  position: relative;
  max-width: var(--wrap);
  width: 100%;
  margin-inline: auto;
  padding-right: 56px;
}

.starmap__title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
}

.starmap__lead {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.64);
}

.starmap__close {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: transparent;
}

.starmap__close span::before,
.starmap__close span::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: 21px;
  height: 1.5px;
  background: #fff;
  transform: rotate(45deg);
}

.starmap__close span::after {
  transform: rotate(-45deg);
}

.starmap__sky {
  position: relative;
  min-height: 0;
  margin: 10px 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.starmap__sky::-webkit-scrollbar {
  display: none;
}

.starmap__sky svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sm-line {
  fill: none;
  stroke: rgba(150, 220, 210, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.4s;
}

.sm-group.is-active .sm-line {
  stroke: rgba(160, 240, 220, 0.75);
}

.sm-group-label {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--font);
}

.sm-group.is-active .sm-group-label {
  fill: #c9f5ea;
}

.sm-star {
  cursor: pointer;
  outline: none;
}

.sm-star circle.core {
  fill: #fff;
  filter: drop-shadow(0 0 4px rgba(190, 235, 255, 0.9));
  transition: r 0.3s var(--ease);
}

.sm-star circle.hit {
  fill: transparent;
}

.sm-star text {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-family: var(--font);
  pointer-events: none;
  transition: fill 0.3s;
}

.sm-star.is-featured text {
  fill: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.sm-star:hover text,
.sm-star:focus-visible text,
.sm-star.is-active text {
  fill: #c9f5ea;
}

.sm-star:focus-visible circle.core,
.sm-star.is-active circle.core {
  fill: #c9f5ea;
}

.starmap__card {
  position: absolute;
  left: var(--gutter);
  bottom: 84px;
  width: min(360px, calc(100% - var(--gutter) * 2));
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 14, 21, 0.96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}

.starmap__card.is-on {
  opacity: 1;
  transform: none;
}

.starmap__card .c-group {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(200, 245, 230, 0.8);
}

.starmap__card .c-name {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
}

.starmap__card .c-years {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.starmap__card .c-line {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.85;
}

.starmap__card .c-source {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.starmap__foot {
  max-width: var(--wrap);
  width: 100%;
  margin-inline: auto;
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.starmap__foot a {
  margin-left: 6px;
  color: rgba(200, 245, 230, 0.85);
  border-bottom: 1px solid rgba(200, 245, 230, 0.4);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .starmap__inner {
    padding-top: 20px;
  }

  .starmap__sky svg {
    display: block;
    margin-bottom: 240px;
  }

  .starmap__card {
    left: var(--gutter);
    right: var(--gutter);
    bottom: 96px;
    width: auto;
  }
}
