.pgb-gateway {
  --pgb-panel: #111827;
  --pgb-text: #f8fafc;
  --pgb-muted: rgba(248, 250, 252, .72);
  --pgb-line: rgba(255, 255, 255, .14);
  --pgb-fire: #ff7a18;
  position: relative;
  min-height: clamp(720px, 96vh, 980px);
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 54px);
  background: radial-gradient(circle at 50% 50%, #1d1410 0%, #0b0d12 54%, #050608 100%);
  color: var(--pgb-text);
}

.pgb-theme-midnight {
  background: radial-gradient(circle at 50% 50%, #132033 0%, #0b1120 54%, #020617 100%);
  --pgb-fire: #38bdf8;
}

.pgb-theme-light {
  background: radial-gradient(circle at 50% 50%, #fff7ed 0%, #f8fafc 62%, #e5e7eb 100%);
  --pgb-panel: #ffffff;
  --pgb-text: #111827;
  --pgb-muted: rgba(17, 24, 39, .68);
  --pgb-line: rgba(17, 24, 39, .12);
}

.pgb-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at var(--pgb-x, 50%) var(--pgb-y, 50%), rgba(255, 122, 24, .32), transparent 24rem),
    radial-gradient(circle at 20% 20%, rgba(244, 63, 94, .22), transparent 18rem),
    radial-gradient(circle at 80% 82%, rgba(56, 189, 248, .18), transparent 18rem);
  transition: opacity .2s ease;
}

.pgb-gateway::after {
  display: none;
}

.pgb-orbit {
  width: min(94vw, 920px);
  aspect-ratio: 1;
  position: relative;
}

.pgb-orbit::before,
.pgb-orbit::after {
  display: none;
}

.pgb-wheel-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  filter: drop-shadow(0 34px 80px rgba(0, 0, 0, .28));
}

.pgb-segment {
  fill: color-mix(in srgb, var(--pgb-color), rgba(5, 6, 8, .78) 78%);
  stroke: color-mix(in srgb, var(--pgb-color), rgba(255, 255, 255, .82) 50%);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: fill .22s ease, filter .22s ease;
}

.pgb-segment:hover {
  fill: color-mix(in srgb, var(--pgb-color), rgba(5, 6, 8, .58) 58%);
  filter: brightness(1.12);
}

.pgb-wheel-inner {
  fill: rgba(5, 6, 8, .78);
  stroke: color-mix(in srgb, var(--pgb-fire), rgba(255, 255, 255, .68) 55%);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.pgb-center,
.pgb-node {
  color: var(--pgb-text);
  text-decoration: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pgb-panel), transparent 6%);
  border: 1px solid var(--pgb-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  overflow: hidden;
}

.pgb-center::before,
.pgb-node::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  background-image: var(--pgb-image, none);
  background-size: cover;
  background-position: center;
  opacity: .26;
  filter: saturate(1.08) contrast(1.02);
}

.pgb-center::after,
.pgb-node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(5, 6, 8, .28), rgba(5, 6, 8, .62)),
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--pgb-color, var(--pgb-fire)), transparent 70%), transparent 62%);
  pointer-events: none;
}

.pgb-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: var(--pgb-center-size, clamp(190px, 26vw, 280px));
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 26px;
  text-align: center;
  border-color: rgba(255, 122, 24, .46);
  box-shadow: 0 0 0 10px rgba(255, 122, 24, .06), 0 30px 90px rgba(255, 122, 24, .16);
  z-index: 4;
}

.pgb-center strong {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.pgb-center small,
.pgb-node small {
  color: var(--pgb-muted);
  line-height: 1.35;
}

.pgb-badge,
.pgb-node-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.pgb-badge {
  min-width: 64px;
  min-height: 32px;
  padding: 0 12px;
  color: #111827;
  background: var(--pgb-fire);
  font-size: 12px;
}

.pgb-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--pgb-node-size, clamp(150px, 17vw, 190px));
  min-height: auto;
  padding: var(--pgb-node-padding, 18px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  transform:
    translate(-50%, -50%)
    rotate(var(--pgb-angle))
    translate(var(--pgb-radius))
    rotate(calc(var(--pgb-angle) * -1));
  z-index: 2;
}

.pgb-node > * {
  position: relative;
  z-index: 1;
}

.pgb-center > * {
  position: relative;
  z-index: 1;
}

.pgb-node::before {
  display: none;
}

.pgb-node::after {
  display: none;
}

.pgb-node-badge {
  width: var(--pgb-badge-size, 42px);
  height: var(--pgb-badge-size, 42px);
  margin: 0 auto 2px;
  background: var(--pgb-color);
  color: #050608;
  font-size: clamp(12px, 1vw, 15px);
}

.pgb-node strong {
  font-size: var(--pgb-node-title-size, clamp(16px, 1.7vw, 22px));
  line-height: 1.08;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .36);
}

.pgb-node small {
  font-size: var(--pgb-node-text-size, 12px);
  text-shadow: 0 3px 14px rgba(0, 0, 0, .36);
}

.pgb-center:hover,
.pgb-node:hover {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .32), 0 0 36px color-mix(in srgb, var(--pgb-color, var(--pgb-fire)), transparent 54%);
  z-index: 5;
}

.pgb-node:hover {
  border-color: transparent;
  box-shadow: none;
  transform:
    translate(-50%, -50%)
    rotate(var(--pgb-angle))
    translate(var(--pgb-radius))
    rotate(calc(var(--pgb-angle) * -1))
    scale(1.07);
}

@media (max-width: 760px) {
  .pgb-gateway {
    min-height: auto;
    padding: 24px 16px 32px;
  }

  .pgb-gateway::after {
    display: none;
  }

  .pgb-orbit {
    width: 100%;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pgb-orbit::before,
  .pgb-orbit::after,
  .pgb-wheel-svg {
    display: none;
  }

  .pgb-center,
  .pgb-node,
  .pgb-center:hover,
  .pgb-node:hover {
    position: static;
    width: auto;
    min-height: 150px;
    transform: none;
    border-radius: 18px;
  }

  .pgb-center {
    grid-column: 1 / -1;
    aspect-ratio: auto;
  }

  .pgb-node {
    min-height: 150px;
    padding: 18px;
    background: color-mix(in srgb, var(--pgb-panel), transparent 6%);
    border: 1px solid var(--pgb-line);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
  }
}

@media (max-width: 460px) {
  .pgb-orbit {
    grid-template-columns: 1fr;
  }
}
