:root {
  color-scheme: dark;
  --night: #17121f;
  --night-soft: #211a2d;
  --plum: #342541;
  --ink: #fbf8ff;
  --muted: #bcb3c7;
  --gold: #d7b33d;
  --orbit-size: min(68vw, calc(100vw - 7rem), 25rem);
  --planet-size: clamp(4.5rem, 19vw, 6.25rem);
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; overflow-x: clip; }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(107, 73, 127, .22), transparent 19rem),
    radial-gradient(ellipse at 12% 0%, rgba(70, 56, 88, .18), transparent 22rem),
    url("../assets/grafics/orbit_menu.jpg") center / cover fixed no-repeat,
    var(--night);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}

.selector-page {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vh, 3rem) 1rem;
}

.page-heading {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  margin: 0 0 .45rem;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.45rem);
  font-weight: 740;
  letter-spacing: -.055em;
  line-height: 1.05;
}

.hint {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.orbit-scene {
  position: relative;
  display: grid;
  width: min(100%, 34rem);
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  margin: clamp(.5rem, 2vh, 1.25rem) 0;
  perspective: 850px;
  perspective-origin: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.orbit-ring {
  position: absolute;
  width: var(--orbit-size);
  aspect-ratio: 1;
  border: 1px solid rgba(222, 201, 244, .2);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(175, 131, 203, .08), inset 0 0 30px rgba(175, 131, 203, .035);
  pointer-events: none;
  transform: rotateX(42deg);
  transform-style: preserve-3d;
}

.orbit-ring::before,
.orbit-ring::after {
  position: absolute;
  width: .32rem;
  height: .32rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(215, 179, 61, .8);
  content: "";
}

.orbit-ring::before { top: 16%; left: 16%; }
.orbit-ring::after { right: 16%; bottom: 16%; }

.orbit-system {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--orbit-size);
  aspect-ratio: 1;
  z-index: 2;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(42deg) rotateZ(var(--orbit-angle, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}

.planet {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: var(--planet-size);
  min-height: var(--planet-size);
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--planet-index) * 90deg))
    translateY(calc(var(--orbit-size) / -2))
    rotate(calc(var(--planet-index) * -90deg));
  transform-style: preserve-3d;
  transition: filter .2s ease;
}

.planet-face {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  padding: .38rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(62, 47, 76, .96), rgba(31, 24, 42, .98));
  box-shadow: 0 .6rem 1.5rem rgba(0, 0, 0, .38), 0 0 1.5rem rgba(192, 154, 216, .12);
  backface-visibility: hidden;
  transform: rotateZ(calc(-1 * var(--orbit-angle, 0deg))) rotateX(-42deg);
  transform-style: preserve-3d;
}

.planet img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: .72rem;
  object-fit: cover;
  animation: pulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.planet-face > span {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(.63rem, 2.8vw, .78rem);
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planet:hover .planet-face,
.planet:focus-visible .planet-face {
  border-color: rgba(240, 218, 133, .78);
  box-shadow: 0 .7rem 1.8rem rgba(0, 0, 0, .48), 0 0 1.5rem rgba(215, 179, 61, .25);
}

.orbit-center {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(4.5rem, 19vw, 7.5rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(229, 210, 244, .24);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #493653, #211a2d 72%);
  box-shadow: 0 0 1rem rgba(193, 149, 215, .15), 0 0 3rem rgba(193, 149, 215, .1);
  pointer-events: none;
}

.orbit-center img {
  display: block;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  object-fit: contain;
  animation: pulse 3.2s ease-in-out infinite;
}

.jazz-link {
  display: flex;
  width: min(100%, 21rem);
  min-height: 3.7rem;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .9rem;
  background: rgba(39, 30, 50, .72);
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.jazz-link:hover {
  transform: translateY(-2px);
  border-color: rgba(215, 179, 61, .55);
  background: rgba(55, 42, 68, .92);
}

.jazz-link > img {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border-radius: .55rem;
  object-fit: cover;
}

.jazz-link > span:nth-child(2) { display: grid; gap: .15rem; }
.jazz-link strong { font-size: .82rem; }
.jazz-link small { color: var(--muted); font-size: .72rem; }
.jazz-arrow { margin-left: auto; color: var(--gold); font-size: 1.1rem; }

.is-transitioning .orbit-center img { opacity: 0; transition: opacity .25s ease; }
.is-transitioning .planet:not(.is-selected) { opacity: .16; transition: opacity .2s ease; }
.planet.is-selected {
  z-index: 5;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--planet-index) * 90deg))
    translateY(calc(var(--orbit-size) / -2))
    rotate(calc(var(--planet-index) * -90deg))
    translate3d(var(--zoom-x, 0px), var(--zoom-y, 0px), var(--zoom-z, 0px))
    scale(4.5);
  transition: transform .48s cubic-bezier(.16, .78, .24, 1);
}
.planet.is-selected .planet-face { box-shadow: 0 0 2rem rgba(215, 179, 61, .5); }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@media (min-width: 700px) {
  :root { --orbit-size: min(54vw, calc(34rem - 9.5rem), 24rem); --planet-size: clamp(5.5rem, 12vw, 7.25rem); }
  .selector-page { padding: 1.5rem; }
  .orbit-scene { margin: .2rem 0; }
}

@media (max-width: 380px) {
  :root { --orbit-size: min(70vw, calc(100vw - 6rem), 17rem); --planet-size: clamp(3.75rem, 17vw, 4.25rem); }
  .selector-page { padding-right: .55rem; padding-left: .55rem; }
  .planet-face { gap: .18rem; padding: .28rem; border-radius: .8rem; }
  .planet img { border-radius: .55rem; }
}

@media (max-height: 700px) and (orientation: landscape) {
  :root { --orbit-size: min(60vh, 22rem); --planet-size: min(16vh, 5.2rem); }
  .selector-page { min-height: 100vh; padding: .5rem 1rem; }
  .page-heading .eyebrow { margin-bottom: .2rem; }
  .hint { margin-top: .2rem; }
  .orbit-scene { width: min(70vh, 28rem); margin: 0; }
  .jazz-link { min-height: 3rem; }
}

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