.button {
  --accent: hsl(var(--primary, 347 100% 50%));
  --accent-alt: hsl(var(--secondary, 180 100% 50%));
  position: relative;
  padding: 1rem 2.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.1s;
}

.button:active {
  transform: scale(0.98);
}

/* VARIANTS */
.solid {
  background: var(--accent);
  color: #000;
}

.outline {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.broken {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 95% 30%, 95% 70%, 100% 70%, 100% 100%, 0 100%);
}

/* DEBRIS */
.debris1, .debris2, .debris3, .debris4 {
  position: absolute;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.button:hover .debris1,
.button:hover .debris2,
.button:hover .debris3,
.button:hover .debris4 {
  opacity: 1;
}

.debris1 {
  width: 20px; height: 2px;
  top: -6px; left: 15%;
  transform: rotate(-5deg);
}

.debris2 {
  width: 2px; height: 15px;
  bottom: -10px; right: 20%;
}

.debris3 {
  width: 15px; height: 1px;
  top: 40%; right: -12px;
}

.debris4 {
  width: 8px; height: 8px;
  bottom: -5px; left: -5px;
  background: transparent;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

/* SLICE */
.slice {
  position: absolute;
  top: 50%;
  left: -5%;
  right: -5%;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transform: translateY(-50%);
}

.button:hover .slice {
  animation: slice 0.3s steps(4) infinite;
}

@keyframes slice {
  0% { opacity: 0.8; clip-path: inset(0 80% 0 0); }
  25% { opacity: 0.6; clip-path: inset(0 30% 0 40%); }
  50% { opacity: 0.8; clip-path: inset(0 0 0 70%); }
  75% { opacity: 0.4; clip-path: inset(0 50% 0 20%); }
  100% { opacity: 0; }
}

/* NOISE */
.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.button:hover .noise {
  opacity: 0.15;
}

/* CONTENT */
.content {
  position: relative;
  z-index: 2;
}

/* GHOST LAYERS */
.ghost1, .ghost2 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.ghost1 { color: var(--accent); }
.ghost2 { color: var(--accent-alt); }

.button:hover .ghost1 {
  opacity: 0.6;
  animation: ghost1 0.15s infinite;
}

.button:hover .ghost2 {
  opacity: 0.4;
  animation: ghost2 0.15s infinite;
}

@keyframes ghost1 {
  0%, 100% { transform: translate(0); clip-path: inset(0 0 60% 0); }
  50% { transform: translate(-3px, 2px); clip-path: inset(30% 0 30% 0); }
}

@keyframes ghost2 {
  0%, 100% { transform: translate(0); clip-path: inset(60% 0 0 0); }
  50% { transform: translate(3px, -2px); clip-path: inset(20% 0 50% 0); }
}

/* CHAOS LEVELS */
.mild .debris1, .mild .debris2, .mild .debris3, .mild .debris4 { opacity: 0.3; }
.mild:hover .ghost1, .mild:hover .ghost2 { animation-duration: 0.3s; }

.extreme .debris1 { width: 30px; height: 3px; }
.extreme .debris2 { width: 3px; height: 25px; }
.extreme .debris3 { width: 25px; }
.extreme .debris4 { width: 12px; height: 12px; }
.extreme:hover .ghost1, .extreme:hover .ghost2 { animation-duration: 0.08s; }
.extreme:hover { animation: shake 0.1s infinite; }

@keyframes shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(2px, 1px); }
  50% { transform: translate(-1px, -2px); }
  75% { transform: translate(1px, -1px); }
}
