/* ============================================================================
   SWEPROG SIGNATURE BADGE — standalone, copy this file to any project
   ============================================================================
   Usage:
     <link rel="stylesheet" href="sweprog-badge.css" />
     <a class="sweprog-badge" href="#" aria-label="Built By SWEPROG">
       <span class="sweprog-badge__s" aria-hidden="true">S</span>
       <span>Built By SWEPROG</span>
     </a>

   Default position: bottom-right, fixed.
   To pin top instead, add the modifier class .sweprog-badge--top.
   To pin left instead of right, add .sweprog-badge--left.
   ============================================================================ */

.sweprog-badge {
  position: fixed;
  bottom: 14px;
  left: 0;
  --sw-x: calc(100vw - 100% - 14px);
  --sw-y: 0;
  --sw-scale: 1;
  transform: translateX(var(--sw-x)) translateY(var(--sw-y)) scale(var(--sw-scale));
  z-index: 200;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 14px 4px 5px;
  font-size: 0.7rem;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition:
    transform 0.55s cubic-bezier(0.65, 0, 0.35, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.3s ease;
}

.sweprog-badge--top {
  top: 14px;
  bottom: auto;
}

.sweprog-badge--left {
  --sw-x: 14px;
}

.sweprog-badge--center {
  --sw-x: calc(50vw - 50%);
}

.sweprog-badge:hover {
  --sw-y: -2px;
  --sw-scale: 1.03;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.40);
  color: #fff;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.30);
}

.sweprog-badge__s {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 0.72rem;
  color: #fff;
  background: radial-gradient(circle at 30% 30%, #a78bfa 0%, #7c3aed 50%, #4c1d95 100%);
  text-shadow:
    0 0 6px rgba(196, 181, 253, 0.9),
    0 0 2px rgba(255, 255, 255, 0.4);
  animation: sweprogSpin 5s linear infinite, sweprogPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
  isolation: isolate;
  transition: filter 0.3s ease;
}

.sweprog-badge__s::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(196, 181, 253, 0) 0%,
    rgba(196, 181, 253, 0.75) 18%,
    rgba(139, 92, 246, 0) 35%,
    rgba(139, 92, 246, 0) 65%,
    rgba(196, 181, 253, 0.75) 82%,
    rgba(196, 181, 253, 0) 100%
  );
  -webkit-mask: radial-gradient(circle, transparent 56%, black 60%);
  mask: radial-gradient(circle, transparent 56%, black 60%);
  animation: sweprogSpin 3.2s linear infinite reverse;
  pointer-events: none;
  z-index: -1;
}

.sweprog-badge:hover .sweprog-badge__s {
  filter: brightness(1.25) saturate(1.15);
  animation: sweprogSpin 1.8s linear infinite, sweprogPulse 1.2s ease-in-out infinite;
}

.sweprog-badge:hover .sweprog-badge__s::after {
  animation: sweprogSpin 1.5s linear infinite reverse;
}

@keyframes sweprogSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes sweprogPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(167, 139, 250, 0.55),
      0 0 8px rgba(139, 92, 246, 0.5),
      0 0 0 0 rgba(139, 92, 246, 0.5),
      inset 0 0 6px rgba(196, 181, 253, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(167, 139, 250, 0.85),
      0 0 18px rgba(139, 92, 246, 0.85),
      0 0 0 6px rgba(139, 92, 246, 0),
      inset 0 0 9px rgba(196, 181, 253, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sweprog-badge,
  .sweprog-badge:hover,
  .sweprog-badge__s,
  .sweprog-badge__s::after {
    animation: none !important;
    transition: none !important;
  }
}
