:root {
  --bg: #0B0B0B;
  --ink: #F5F5F2;
  --muted: #B8B8B8;
  --line: #3B3B3B;
  --panel: rgba(11, 11, 11, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button {
  font: inherit;
  cursor: pointer;
}

.app,
.sky {
  min-height: 100vh;
  min-height: 100dvh;
}

.sky {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  touch-action: auto;
}

#galaxy {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.planetLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  touch-action: none;
}

.planet {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  pointer-events: auto;
  touch-action: none;
  transform-origin: center;
  opacity: 0.88;
  transition: opacity 420ms linear, filter 420ms linear;
}

.planet svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.planetText {
  fill: currentColor;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0;
}

.planetGuide {
  fill: transparent;
  stroke: rgba(245, 245, 242, 0.16);
  stroke-width: 0.8;
  transition: stroke 420ms linear;
}

.planetCore {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  max-width: 68%;
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
  font-size: 10px;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 360ms linear;
  pointer-events: none;
}

.planetCore small {
  color: var(--muted);
  font-size: 8px;
}

.planet:hover,
.planet.isHovered,
.planet.isSelected {
  opacity: 1;
  color: #FFFFFF;
  filter: drop-shadow(0 0 12px rgba(245, 245, 242, 0.2));
}

.planet:hover svg,
.planet.isHovered svg {
  animation: slowOrbit 22s linear infinite;
}

.planet.isSelected svg {
  animation: slowOrbit 30s linear infinite;
}

.planet:hover .planetCore,
.planet.isHovered .planetCore,
.planet.isSelected .planetCore {
  opacity: 1;
}

.planet:hover .planetGuide,
.planet.isHovered .planetGuide,
.planet.isSelected .planetGuide {
  stroke: rgba(245, 245, 242, 0.58);
}

.planet.isRelated {
  opacity: 0.96;
}

.planet.isDimmed {
  opacity: 0.24;
}

@keyframes slowOrbit {
  to {
    transform: rotate(360deg);
  }
}

.topbar,
.legend,
.supportMark,
.detailPanel {
  position: absolute;
  z-index: 2;
}

.topbar {
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.topbar h1 {
  max-width: 360px;
  margin: 0;
  font-size: clamp(15px, 1.55vw, 21px);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(245, 245, 242, 0.82);
}

.eyebrow,
.legend,
.detailKicker,
.detailPanel dt {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 12px;
}

.brandLogo {
  display: block;
  width: clamp(132px, 10vw, 164px);
  height: auto;
  margin-bottom: 22px;
}

.brandLogoLink {
  display: block;
  width: fit-content;
  pointer-events: auto;
}

.brandLogoLink:focus-visible {
  outline: 1px solid rgba(245, 245, 242, 0.62);
  outline-offset: 5px;
}

.toolbar {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.iconButton,
.textButton,
.closeButton {
  min-height: 36px;
  border: 1px solid rgba(245, 245, 242, 0.34);
  background: rgba(11, 11, 11, 0.26);
  color: var(--ink);
}

.iconButton {
  width: 36px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.textButton {
  border-radius: 999px;
  padding: 0 14px;
}

.legend {
  right: 32px;
  bottom: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legend > span,
.legendLink {
  border: 1px solid rgba(245, 245, 242, 0.24);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(11, 11, 11, 0.34);
  color: var(--muted);
  text-decoration: none;
}

.legendLinkSecondary {
  background: rgba(11, 11, 11, 0.56);
  color: rgba(184, 184, 184, 0.78);
}

.legendLink:hover,
.legendLink:focus-visible {
  color: var(--ink);
  border-color: rgba(245, 245, 242, 0.46);
  outline: none;
}

.indexToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(245, 245, 242, 0.34);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(245, 245, 242, 0.08);
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
}

.indexToggle span {
  display: block;
}

.indexToggle:hover,
.indexToggle:focus-visible {
  background: rgba(245, 245, 242, 0.16);
  outline: none;
}

.indexPanel {
  position: absolute;
  z-index: 3;
  right: 32px;
  bottom: 76px;
  width: min(430px, calc(100vw - 64px));
  max-height: min(560px, calc(100vh - 170px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(245, 245, 242, 0.28);
  border-radius: 2px;
  background: rgba(11, 11, 11, 0.84);
  backdrop-filter: blur(16px);
  transform: translateY(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms linear, transform 320ms linear, visibility 320ms linear;
}

.indexPanel.isOpen {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.indexHeader {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 14px 54px 12px 16px;
  border-bottom: 1px solid rgba(245, 245, 242, 0.18);
}

.indexHeader p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-transform: uppercase;
}

.indexList {
  overflow: auto;
  padding: 6px 0;
}

.indexItem {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  border: 0;
  border-bottom: 1px solid rgba(245, 245, 242, 0.1);
  padding: 11px 16px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.indexItem:hover,
.indexItem.isActive {
  background: rgba(245, 245, 242, 0.08);
}

.indexArtist {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.indexTitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.supportMark {
  left: 24px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.supportMark img {
  display: block;
  width: 118px;
  height: auto;
}

.detailPanel {
  top: 116px;
  right: 32px;
  z-index: 4;
  width: min(360px, calc(100vw - 64px));
  max-height: calc(100vh - 190px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 58px 18px 20px;
  border: 1px solid rgba(245, 245, 242, 0.28);
  border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  transform: translateX(calc(100% + 44px));
  transition: transform 520ms linear;
  scrollbar-color: rgba(245, 245, 242, 0.34) rgba(245, 245, 242, 0.08);
  scrollbar-width: thin;
}

.detailPanel.isOpen {
  transform: translateX(0);
}

.detailPanel::-webkit-scrollbar {
  width: 7px;
}

.detailPanel::-webkit-scrollbar-track {
  background: rgba(245, 245, 242, 0.06);
}

.detailPanel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(11, 11, 11, 0.86);
  border-radius: 999px;
  background: rgba(245, 245, 242, 0.34);
}

.closeButton {
  position: absolute;
  top: 12px;
  right: 12px;
  transform: none;
  width: 30px;
  min-height: 30px;
  border-radius: 50%;
}

.detailKicker {
  margin-bottom: 18px;
  padding-right: 42px;
}

.detailArtist {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detailPanel h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.16;
  font-weight: 400;
  letter-spacing: 0;
}

.detailArtwork {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  overflow: hidden;
}

.detailArtwork[hidden] {
  display: none;
}

.detailArtwork img {
  display: block;
  width: 100%;
  max-height: min(44vh, 430px);
  height: auto;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(245, 245, 242, 0.16);
  background: rgba(245, 245, 242, 0.03);
}

.detailArtwork.isPortrait img {
  max-height: min(50vh, 500px);
}

.detailArtwork.isSquare img {
  max-height: min(40vh, 360px);
}

.detailArtwork img[hidden] {
  display: none;
}

.detailArtwork a {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(245, 245, 242, 0.24);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.detailArtwork a[hidden] {
  display: none;
}

.detailArtwork a:hover,
.detailArtwork a:focus-visible {
  color: var(--ink);
  border-color: rgba(245, 245, 242, 0.46);
  outline: none;
}

.detailArtwork figcaption {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.detailQuote {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.58;
}

.detailPanel dl {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}

.detailPanel dl div {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 245, 242, 0.18);
}

.detailPanel dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.42;
}

.detailNav {
  position: absolute;
  top: 10px;
  left: 12px;
  right: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  pointer-events: none;
}

.detailNav button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border: 1px solid rgba(245, 245, 242, 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  pointer-events: auto;
}

.detailNav button:hover,
.detailNav button:focus-visible {
  border-color: rgba(245, 245, 242, 0.54);
  background: rgba(245, 245, 242, 0.08);
  outline: none;
}

.detailNav span {
  display: none;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 780px) {
  .topbar {
    left: 18px;
    right: 18px;
    top: 18px;
  }

  .topbar h1 {
    max-width: 28ch;
    font-size: clamp(14px, 4vw, 17px);
  }

  .toolbar {
    flex-direction: column;
  }

  .legend {
    position: fixed;
    left: auto;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 28px);
    gap: 7px;
    justify-content: flex-end;
  }

  .legend > span,
  .legendLink,
  .indexToggle {
    padding: 6px 8px;
    font-size: 10px;
  }

  .legend span:nth-child(n + 2) {
    display: block;
  }

  .indexPanel {
    left: 18px;
    right: 18px;
    bottom: 64px;
    width: auto;
    max-height: 58vh;
  }

  .indexItem {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .detailPanel {
    top: auto;
    left: 18px;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(72vh, calc(100dvh - 132px));
    background: rgba(11, 11, 11, 0.92);
    box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.46);
    transform: translateY(calc(100% + 44px));
  }

  .detailPanel.isOpen {
    transform: translateY(0);
  }

  .supportMark {
    position: fixed;
    left: 14px;
    bottom: calc(58px + env(safe-area-inset-bottom));
    gap: 7px;
    font-size: 9px;
  }

  .supportMark img {
    width: 86px;
  }
}
