/* Interaction enhancements share the selected palette. */
.hero-visual {
  perspective: 900px;
}

.hero-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse at var(--map-light-x, 50%) var(--map-light-y, 50%),
    color-mix(in srgb, var(--acid) 14%, transparent),
    transparent 57%
  );
  transition: opacity 350ms ease;
}

.hero-visual.map-pointer-active::after {
  opacity: 1;
}

#system-map {
  rotate: var(--map-tilt, none);
  transition: rotate 220ms ease-out;
}

#system-map .map-route {
  stroke: var(--acid);
  stroke-width: 2.2;
  opacity: 0.85;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--acid) 45%, transparent));
  pointer-events: none;
}

#system-map .map-node-active {
  stroke: var(--acid);
  fill: color-mix(in srgb, var(--acid) 12%, var(--ink));
  stroke-width: 1.2;
}

.map-explorer {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1fr);
  gap: 7px 35px;
  align-items: center;
  padding: 15px 0 21px;
  border-top: 1px solid var(--line);
}

.map-explorer-label {
  grid-column: 1;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.map-explorer-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  grid-column: 1;
}

.map-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: clamp(9px, 0.8vw, 12px);
  line-height: 1.3;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.map-choice-number {
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.65;
}

.map-choice[aria-pressed="true"] {
  color: var(--accent-ink, var(--ink));
  background: var(--acid);
  border-color: var(--acid);
}

.map-choice.is-previewed:not([aria-pressed="true"]),
.map-choice:hover:not([aria-pressed="true"]) {
  color: var(--paper);
  border-color: var(--acid);
  background: color-mix(in srgb, var(--acid) 8%, transparent);
}

.map-choice:focus-visible,
.map-explore-link:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
}

.map-explorer-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 55px;
  padding-left: 27px;
  border-left: 1px solid var(--line);
}

.map-explorer-description {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-explorer-description strong {
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
}

.map-explorer-description > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.map-explore-link {
  flex-shrink: 0;
  padding: 10px 0;
  color: var(--acid);
  font-size: 10px;
  white-space: nowrap;
}

.map-explore-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.scroll-reveal {
  transition:
    opacity 600ms ease,
    translate 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal-pending {
  opacity: 0;
  translate: 0 18px;
}

html.interaction-still #system-map .orbit,
html.interaction-still #system-map .signal {
  animation-play-state: paused;
}

html.interaction-still #system-map,
html.interaction-still .hero-visual::after,
html.interaction-still .scroll-reveal,
body.motion-paused .map-choice {
  transition: none;
}

@media (max-width: 1050px) {
  .map-explorer {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding-top: 17px;
  }
  .map-explorer-detail {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
    padding: 2px 0 0;
    border-left: 0;
  }
  .map-choice {
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .map-explorer {
    gap: 10px;
    padding: 17px 0 22px;
  }
  .map-explorer-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .map-choice {
    justify-content: flex-start;
    min-height: 43px;
    gap: 9px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .map-choice-number {
    font-size: 9px;
  }
  .map-explorer-detail {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding-top: 4px;
  }
  .map-explorer-description {
    gap: 5px;
  }
  .map-explorer-description strong {
    font-size: 13px;
  }
  .map-explorer-description > span {
    font-size: 11px;
  }
  .map-explore-link {
    padding: 8px 0 0;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #system-map {
    rotate: none;
  }
  .scroll-reveal-pending {
    opacity: 1;
    translate: none;
  }
  .hero-visual::after {
    display: none;
  }
}
