/* ===================================================================
   BUTTONS — AAA Game-grade interactive buttons
   Light sweeps, click bursts, chromatic aberration, snap-back
   =================================================================== */

/* ---- Primary Button (Filled Cyan) ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  background: var(--color-cyan);
  color: var(--color-bg);
  padding: 1rem 2.5rem;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1),
              background 0.2s ease,
              filter 0.2s ease;
  animation: idleGlow 3s ease-in-out infinite;
}

/* Light sweep beam — diagonal highlight on hover */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.3) 45%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.3) 55%,
    transparent 80%
  );
  pointer-events: none;
  z-index: 1;
  transition: none;
}

/* Click burst ring — radial energy explosion on press */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-cyan-light) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

/* --- Hover state --- */
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  color: #fff;
  transform: translateY(-3px);
  animation: edgeFlare 2s ease infinite;
  filter: brightness(1.15);
  box-shadow: 0 0 25px var(--color-cyan-shadow),
              0 0 50px rgba(0, 240, 255, 0.12),
              inset 0 0 15px rgba(255, 255, 255, 0.08);
}

.btn-primary:hover::before {
  animation: lightSweep 0.6s ease forwards;
}

/* --- Focus visible (keyboard) --- */
.btn-primary:focus-visible {
  animation: edgeFlare 1.5s ease infinite;
}

/* --- Active / Click state --- */
.btn-primary:active {
  transform: scale(0.95);
  background: #fff;
  color: var(--color-bg);
  filter: brightness(1.4);
  box-shadow: 0 0 40px var(--color-cyan-shadow),
              0 0 80px rgba(0, 240, 255, 0.2);
  animation: snapPunch 0.35s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.btn-primary:active::after {
  animation: clickBurst 0.45s ease-out forwards;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}


/* ---- Secondary Button (Ghost / Outline) ---- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  background: rgba(0, 240, 255, 0.03);
  color: var(--color-text);
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1),
              border-color 0.2s ease,
              color 0.2s ease,
              background 0.2s ease;
}

/* Light sweep for secondary */
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(0, 240, 255, 0.08) 45%,
    rgba(0, 240, 255, 0.15) 50%,
    rgba(0, 240, 255, 0.08) 55%,
    transparent 80%
  );
  pointer-events: none;
  z-index: 1;
}

/* Click burst for secondary — purple variant */
.btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-purple-light) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

/* --- Hover state --- */
.btn-secondary:hover {
  border-color: var(--color-cyan);
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(180, 74, 255, 0.10) 100%);
  transform: translateY(-3px);
  box-shadow: 0 0 25px var(--color-cyan-glow),
              0 0 50px rgba(0, 240, 255, 0.08),
              inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.btn-secondary:hover::before {
  animation: lightSweep 0.7s ease forwards;
}

/* Chromatic text glitch on hover — subtle channel split */
.btn-secondary:hover span,
.btn-secondary:hover {
  animation: chromaticShift 0.4s ease forwards;
}

/* --- Active / Click state --- */
.btn-secondary:active {
  transform: scale(0.95);
  border-color: var(--color-purple);
  color: var(--color-purple-light);
  animation: snapPunch 0.35s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.btn-secondary:active::after {
  animation: clickBurst 0.45s ease-out forwards;
}

.btn-secondary svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}
