.hero-constellation {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin: -34px auto -38px;
  isolation: isolate;
  contain: layout style paint;
  color: var(--text);
  user-select: none;
}

.hero-constellation::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 10% 4% 6%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 52% 44%, rgb(57 255 136 / 10%), transparent 42%),
    radial-gradient(circle at 55% 52%, rgb(255 255 255 / 4%), transparent 68%);
}

.hero-constellation-map,
.constellation-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-constellation-map {
  overflow: visible;
}

.constellation-mesh circle,
.constellation-mesh path {
  fill: none;
  stroke: rgb(255 255 255 / 8%);
  stroke-width: 1;
  stroke-dasharray: 2 8;
}

.constellation-route use,
.constellation-dispatch use {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.constellation-line,
.constellation-dispatch > use:not(.constellation-packet) {
  stroke: rgb(255 255 255 / 17%);
  stroke-width: 1.15;
}

.constellation-glow {
  opacity: 0;
  stroke: url(#clodexRouteActive);
  stroke-width: 2.6;
  transition: opacity 420ms ease;
}

.constellation-packet {
  stroke: rgb(217 255 231 / 68%);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 1 24;
  animation: constellation-packet 2.8s linear infinite;
}

.constellation-route:nth-of-type(3n) .constellation-packet {
  animation-delay: -1.1s;
  animation-duration: 3.4s;
}
.constellation-route:nth-of-type(3n + 1) .constellation-packet {
  animation-delay: -2.2s;
  animation-duration: 3.8s;
}
.constellation-route:nth-of-type(3n + 2) .constellation-packet {
  animation-delay: -0.6s;
  animation-duration: 3.1s;
}

.constellation-dispatch > use {
  stroke: rgb(57 255 136 / 17%);
  stroke-width: 1;
}

.constellation-dispatch .constellation-packet {
  stroke: rgb(57 255 136 / 72%);
  animation-duration: 2.3s;
}

.constellation-route[data-active='true'] .constellation-line {
  stroke: rgb(57 255 136 / 42%);
}

.constellation-route[data-active='true'] .constellation-glow {
  opacity: 1;
}

.constellation-route[data-active='true'] .constellation-packet {
  stroke: #e5ffed;
  stroke-width: 3.4;
}

.constellation-hub circle:first-child {
  fill: rgb(57 255 136 / 7%);
  stroke: rgb(57 255 136 / 12%);
}

.constellation-hub circle:last-child {
  fill: #333a35;
  stroke: #707b73;
  transition:
    fill 420ms ease,
    filter 420ms ease,
    stroke 420ms ease;
}

.constellation-hub[data-active='true'] circle:last-child {
  fill: #39ff88;
  stroke: #d9ffe7;
}

.constellation-core-ring {
  fill: rgb(8 10 9 / 88%);
  stroke: rgb(255 255 255 / 12%);
  stroke-width: 1;
}

.constellation-provider {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 62px;
  color: #8d9690;
  font: 500 10px/14px var(--font-mono);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: constellation-float 6.8s ease-in-out var(--delay) infinite;
  transition:
    color 420ms ease,
    opacity 420ms ease;
}

.constellation-provider-tile {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 12px;
  background: linear-gradient(145deg, rgb(28 31 29 / 94%), rgb(10 11 10 / 96%));
  box-shadow:
    0 10px 24px rgb(0 0 0 / 36%),
    inset 0 1px rgb(255 255 255 / 5%);
  transition:
    border-color 420ms ease,
    box-shadow 420ms ease,
    transform 420ms ease;
}

.constellation-provider-tile img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: saturate(0.78) brightness(1.02);
}

.constellation-provider--lg .constellation-provider-tile {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.constellation-provider--lg .constellation-provider-tile img {
  width: 27px;
  height: 27px;
}

.constellation-provider--sm .constellation-provider-tile {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.constellation-provider--sm .constellation-provider-tile img {
  width: 20px;
  height: 20px;
}

.constellation-provider[data-active='true'] {
  z-index: 4;
  color: #e5ffed;
}

.constellation-provider[data-active='true'] .constellation-provider-tile {
  border-color: rgb(57 255 136 / 72%);
  box-shadow:
    0 0 0 4px rgb(57 255 136 / 8%),
    0 0 24px rgb(57 255 136 / 26%),
    inset 0 1px rgb(255 255 255 / 10%);
  transform: scale(1.08);
}

.constellation-core {
  position: absolute;
  z-index: 5;
  left: 52.14%;
  top: 43.93%;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  transform: translate(-50%, -50%);
}

.constellation-core-aura {
  position: absolute;
  inset: 3px;
  border: 1px solid rgb(57 255 136 / 16%);
  border-radius: 50%;
  box-shadow:
    0 0 0 15px rgb(57 255 136 / 3%),
    0 0 58px rgb(57 255 136 / 18%);
  animation: constellation-breathe 4.2s ease-in-out infinite;
}

.constellation-core-orb {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgb(255 255 255 / 12%), transparent 31%),
    linear-gradient(145deg, #151a17, #080a09 70%);
  box-shadow:
    inset 0 1px rgb(255 255 255 / 8%),
    0 20px 44px rgb(0 0 0 / 55%);
}

.constellation-core-orb::after {
  content: '';
  position: absolute;
  inset: -60% 30% 20% -50%;
  background: linear-gradient(
    100deg,
    transparent 36%,
    rgb(255 255 255 / 18%) 50%,
    transparent 64%
  );
  transform: rotate(18deg);
  animation: constellation-glint 5.8s ease-in-out infinite;
}

.constellation-core-orb img {
  width: 72px;
  height: 44px;
  object-fit: contain;
  filter: brightness(1.14) saturate(0.85);
}

.constellation-route-card {
  position: absolute;
  z-index: 6;
  left: 52.14%;
  top: 77.14%;
  width: 232px;
  padding: 12px 14px 11px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 15px;
  background: rgb(10 12 11 / 96%);
  box-shadow:
    0 20px 46px rgb(0 0 0 / 46%),
    inset 0 1px rgb(255 255 255 / 5%);
  transform: translate(-50%, 0);
}

.constellation-route-head,
.constellation-flow {
  display: flex;
  align-items: center;
}

.constellation-route-head {
  justify-content: space-between;
  gap: 12px;
  color: #727c75;
  font: 600 9px/12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.constellation-route-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b8c0bb;
}

.constellation-route-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #39ff88;
  box-shadow: 0 0 9px rgb(57 255 136 / 72%);
}

.constellation-route-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 9px;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 10px;
  background: rgb(255 255 255 / 3%);
}

.constellation-route-provider > span:not(.constellation-route-icon) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.constellation-route-copy {
  flex: 1 1 auto;
}

.constellation-route-provider b,
.constellation-route-provider code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.constellation-route-provider b {
  font: 500 12px/16px var(--font-ui);
}

.constellation-route-provider code {
  color: #7e8982;
  font: 400 9px/13px var(--font-mono);
}

.constellation-route-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(57 255 136 / 20%);
  border-radius: 9px;
  background: #111512;
}

.constellation-route-icon img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.constellation-category-chip {
  display: inline-flex;
  min-height: 20px;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgb(57 255 136 / 24%);
  border-radius: 999px;
  background: rgb(57 255 136 / 7%);
  color: #a6e9bd;
  font: 600 8px/12px var(--font-mono);
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.constellation-category-chip[data-category='video'] {
  border-color: rgb(127 176 255 / 27%);
  background: rgb(86 139 255 / 9%);
  color: #aec8ff;
}

.constellation-category-chip[data-category='image'] {
  border-color: rgb(255 198 107 / 27%);
  background: rgb(255 178 66 / 9%);
  color: #ffd48a;
}

.constellation-category-chip[data-category='audio'] {
  border-color: rgb(224 150 255 / 27%);
  background: rgb(190 102 255 / 9%);
  color: #e7baff;
}

.constellation-category-labels {
  display: none;
}

.constellation-flow {
  justify-content: space-between;
  gap: 5px;
  color: #6f7972;
  font: 500 8px/11px var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.constellation-flow i {
  position: relative;
  height: 1px;
  flex: 1 1 16px;
  overflow: hidden;
  background: rgb(255 255 255 / 10%);
}

.constellation-flow i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #39ff88, transparent);
  animation: constellation-flow 2.2s linear infinite;
}

.constellation-route-card small {
  display: block;
  margin-top: 7px;
  color: #58615b;
  font: 400 8px/11px var(--font-mono);
  text-align: center;
}

.hero-constellation.is-swapping .constellation-route-provider {
  animation: constellation-swap 360ms ease both;
}

.hero-constellation.is-paused *,
.hero-constellation.is-paused *::before,
.hero-constellation.is-paused *::after {
  animation-play-state: paused !important;
}

@keyframes constellation-packet {
  to {
    stroke-dashoffset: -100;
  }
}

@keyframes constellation-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes constellation-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes constellation-glint {
  0%,
  58% {
    translate: -65% 0;
    opacity: 0;
  }
  67% {
    opacity: 1;
  }
  82%,
  100% {
    translate: 165% 0;
    opacity: 0;
  }
}

@keyframes constellation-flow {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes constellation-swap {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  45% {
    opacity: 0;
    transform: translateY(4px);
  }
  55% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero-constellation {
    width: min(100%, 620px);
    margin: -18px auto -42px;
  }
}

@media (max-width: 620px) {
  .hero-constellation {
    margin: -8px auto -20px;
  }

  .constellation-provider {
    min-width: 48px;
    gap: 3px;
    font-size: 8px;
    line-height: 10px;
  }

  .constellation-provider-tile {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .constellation-provider-tile img,
  .constellation-provider--lg .constellation-provider-tile img {
    width: 19px;
    height: 19px;
  }

  .constellation-provider--lg .constellation-provider-tile {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .constellation-provider--sm .constellation-provider-tile {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }

  .constellation-provider--sm .constellation-provider-tile img {
    width: 17px;
    height: 17px;
  }

  .constellation-core {
    width: 96px;
    height: 96px;
  }

  .constellation-core-orb {
    width: 74px;
    height: 74px;
  }

  .constellation-core-orb img {
    width: 58px;
    height: 36px;
  }

  .constellation-route-card {
    width: min(210px, 58vw);
    padding: 9px 10px;
  }

  .constellation-route-provider {
    margin-block: 7px;
    padding: 6px;
  }

  .constellation-category-chip {
    padding-inline: 6px;
    font-size: 7px;
  }

  .constellation-route-card small {
    display: none;
  }
}

@media (max-width: 420px) {
  .constellation-provider > span:last-child {
    display: none;
  }

  .constellation-route-card {
    top: 76.5%;
  }
}

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

  .constellation-packet,
  .constellation-glow {
    display: none;
  }

  .constellation-provider[data-active='true'] .constellation-provider-tile {
    transform: none;
  }
}
