/* WML Elements — Orbit Showcase */

/* Variable defaults at zero specificity (:where) so colors/sizes set from the
   Bricks panel — emitted on .wml-orbit / .brxe-* — always win over these. */
:where(.wml-orbit) {
  --wml-orbit-accent: #22e58c;
  --wml-orbit-accent2: #0fc977;
  --wml-orbit-ink: #06210f;
  --wml-orbit-tile-bg: rgba(16, 22, 36, .72);
  --wml-orbit-tile-color: #cfeede;
  --wml-orbit-ring-color: rgba(255, 255, 255, .1);
  --wml-orbit-size: 600px;
  --wml-orbit-center: 128px;
}

.wml-orbit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.wml-orbit__scene {
  position: relative;
  width: var(--wml-orbit-size);
  height: var(--wml-orbit-size);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  perspective: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wml-orbit__stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

/* center radial glow */
.wml-orbit__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  height: 60%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--wml-orbit-accent) 22%, transparent), transparent 62%);
  filter: blur(22px);
  pointer-events: none;
}

/* dashed guide circles */
.wml-orbit__circle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px dashed var(--wml-orbit-ring-color);
  border-radius: 50%;
  pointer-events: none;
}
.wml-orbit__circle--1 { width: 37%; height: 37%; }
.wml-orbit__circle--2 { width: 63%; height: 63%; opacity: .7; }
.wml-orbit__circle--3 { width: 89%; height: 89%; opacity: .5; }

/* rotating ring containers (JS-populated) — must NOT capture pointer events,
   otherwise a full-size ring box on top steals hovers from tiles underneath.
   z-index keeps the tiles above the center badge so inner icons stay clickable
   (the tiles' own z-index is trapped inside their transformed wrappers). */
.wml-orbit__ring {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* a single tile floated around a ring */
.wml-orbit__tile {
  position: relative;
  z-index: 1;
  pointer-events: auto; /* only the tile is hoverable */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wml-orbit-tile-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--wml-orbit-tile-color);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .3s;
}
.wml-orbit__tile svg {
  width: 46%;
  height: 46%;
}
.wml-orbit__tile img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: inherit;
}
/* image tiles: image fills the whole tile, no inset/padding */
.wml-orbit__tile--image {
  padding: 0;
  overflow: hidden;
}
.wml-orbit__tile--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wml-orbit__tile i {
  font-size: inherit; /* tile sets a px font-size in JS so icon fonts scale */
  line-height: 1;
}
/* on hover: only the border changes color — nothing else */
.wml-orbit__tile:hover {
  border-color: var(--wml-orbit-tile-hover-border, var(--wml-orbit-accent));
  z-index: 2;
}

/* center badge — sits below the orbiting tiles so inner icons remain clickable */
.wml-orbit__center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* pulse rings stay a fixed circle, centered behind the badge even as it grows */
.wml-orbit__pulse {
  position: absolute;
  inset: 0;
  margin: auto;
  width: var(--wml-orbit-center);
  height: var(--wml-orbit-center);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--wml-orbit-accent) 50%, transparent);
  animation: wml-orbit-pulse 3s ease-out infinite;
  pointer-events: none;
}
.wml-orbit__pulse--delay {
  border-color: color-mix(in srgb, var(--wml-orbit-accent) 35%, transparent);
  animation-delay: 1.5s;
}
.wml-orbit__badge {
  position: relative;
  /* square by default, but widens to fit longer labels */
  min-width: var(--wml-orbit-center);
  height: var(--wml-orbit-center);
  padding: 0 calc(var(--wml-orbit-center) * 0.18);
  border-radius: calc(var(--wml-orbit-center) * 0.22);
  background: linear-gradient(140deg, var(--wml-orbit-accent), var(--wml-orbit-accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 22px 60px -10px color-mix(in srgb, var(--wml-orbit-accent) 70%, transparent), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.wml-orbit__badge--bare {
  background: none;
  box-shadow: none;
  padding: 0;
}
.wml-orbit__badge span {
  font-family: 'Clash Display', system-ui, sans-serif;
  font-weight: 700;
  font-size: var(--wml-orbit-label-size, calc(var(--wml-orbit-center) * 0.34));
  line-height: 1;
  color: var(--wml-orbit-ink);
  white-space: nowrap;
}
.wml-orbit__logo {
  display: block;
  max-width: calc(var(--wml-orbit-center) * 0.72);
  max-height: calc(var(--wml-orbit-center) * 0.72);
  width: auto;
  height: auto;
  object-fit: contain;
}

@keyframes wml-orbit-pulse {
  0%   { transform: scale(.55); opacity: .7; }
  100% { transform: scale(1.75); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wml-orbit__pulse { animation: none; opacity: .35; }
}
