body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  font-family: system-ui, sans-serif;
}

.box {
  position: relative;
  width: 300px;
  height: 180px;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  font-size: 20px;
  z-index: 0;
  transition: .5s;
}

/* ROTATING GRADIENT BORDER */
.box::before {
  content: "";
  position: absolute;
  inset: -1;
  border-radius: inherit;
  width: 400px;
  height: 500px;
  background:white;
  z-index: -2;
  animation: none;
}

/* INNER BACKGROUND (MASK) */
.box::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background: #020617;
  z-index: -1;
  transition: .5s;
}

.box:hover {
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 0, 255, 1);
}

/* HOVER → ROTATION */
.box:hover::before {
  animation: spin 2s linear infinite;
  background: conic-gradient(
    from 0deg,
    #00f5ff,
    #ff00ea,
    #00ff85,
    #00f5ff
  );
   width: 400px;
  height: 500px;
  transition:.5s;
}

.box:hover::after {
  inset: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}