/* Constellation map — atmospheric night sky with tap-able stars. */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(58, 102, 112, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 90%, rgba(196, 69, 54, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #050a14 0%, #060810 60%, #04060c 100%);
  color: #d4cfc1;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  width: 100%;
  height: 100vh;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
}

.head {
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 5;
}
.head h1 {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #d4cfc1;
  text-transform: lowercase;
}
.head .back {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(154, 163, 176, 0.7);
  text-decoration: none;
  transition: color 220ms ease;
}
.head .back:hover { color: #5fb4c4; }
.head .hint {
  margin-left: auto;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: rgba(154, 163, 176, 0.5);
  text-transform: lowercase;
  animation: hint-fade 4s ease-in-out infinite;
}
@keyframes hint-fade {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.85; }
}

#sky {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  margin: 0 -32px;
}

/* connection lines — very dim, brighten when adjacent star is hovered */
.line {
  stroke: rgba(220, 230, 245, 0.08);
  stroke-width: 1;
  transition: stroke 300ms ease, stroke-width 300ms ease;
}
.line.lit {
  stroke: rgba(95, 180, 196, 0.55);
  stroke-width: 1.4;
}

/* background dust — tiny twinkling specks */
.dust {
  fill: #ffffff;
}
.dust.t1 { animation: twinkle 5s ease-in-out infinite; }
.dust.t2 { animation: twinkle 7s ease-in-out infinite 1s; }
.dust.t3 { animation: twinkle 9s ease-in-out infinite 2.5s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.7; }
}

/* main stars — sized by section, colored by section */
.star { cursor: pointer; }
.star-halo {
  opacity: 0.18;
  transition: opacity 300ms ease, r 300ms ease;
}
.star-dot {
  transition: r 300ms cubic-bezier(0.2, 0.7, 0.2, 1.2);
  animation: star-blink 6s ease-in-out infinite;
}
.star-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  fill: #d4cfc1;
  text-anchor: middle;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 300ms ease, fill 300ms ease;
}
.star:hover .star-halo { opacity: 0.55; }
.star:hover .star-dot  { filter: drop-shadow(0 0 8px currentColor); }
.star:hover .star-name { opacity: 1; fill: #ffffff; }

@keyframes star-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* section accent colors via class */
.star.moored  .star-dot, .star.moored  .star-halo { fill: #ffd86c; color: #ffd86c; }
.star.deep    .star-dot, .star.deep    .star-halo { fill: #5fb4c4; color: #5fb4c4; }
.star.signal  .star-dot, .star.signal  .star-halo { fill: #ffffff; color: #ffffff; }
.star.stash   .star-dot, .star.stash   .star-halo { fill: #8a8576; color: #8a8576; }
.star.root    .star-dot, .star.root    .star-halo { fill: #c44536; color: #c44536; }

/* tooltip — fixed positioned, shown on hover */
.tooltip {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  background: rgba(8, 12, 18, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(220, 230, 245, 0.12);
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10;
  max-width: 260px;
}
.tooltip.show { opacity: 1; transform: translateY(0); }
.tooltip-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #d4cfc1;
}
.tooltip-note {
  margin-top: 3px;
  font-style: italic;
  color: #8a8576;
  font-size: 11px;
}

footer {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(154, 163, 176, 0.6);
  text-align: center;
  padding: 14px 0 0;
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: #5fb4c4; }

@media (max-width: 720px) {
  main { padding: 16px 16px 8px; }
  #sky { margin: 0 -16px; }
  .head h1 { font-size: 16px; }
  .head .hint { display: none; }
  .star-name { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
