/* A bright SVG stroke follows the actual perimeter of each button. */
.neon-control {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  touch-action: manipulation;
  transition: transform .38s cubic-bezier(.16,1,.3,1), border-color .3s ease,
    background-color .3s ease, box-shadow .4s ease;
}
.btn.neon-control::after { display: none; }
.btn.neon-control::before {
  inset: 0;
  z-index: -1;
  background: radial-gradient(100px circle at var(--pointer-x,50%) var(--pointer-y,50%), #e5caff38, transparent 80%);
  opacity: 0;
  transform: none;
  transition: opacity .35s ease;
}
.button-neon {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity .35s ease;
}
.button-neon rect { fill: none; vector-effect: non-scaling-stroke; }
.neon-track { stroke: #c396ff; stroke-width: 1; opacity: .6; }
.neon-halo, .neon-trail, .neon-core {
  stroke-linecap: round;
  stroke-dashoffset: 0;
  animation: neon-perimeter 2.8s linear infinite;
  animation-play-state: paused;
}
.neon-halo {
  stroke: #b27aff;
  stroke-width: 6;
  stroke-dasharray: 24 76;
  opacity: .7;
  filter: blur(3px);
}
.neon-trail { stroke: #d7b8ff; stroke-width: 2.5; stroke-dasharray: 17 83; }
.neon-core { stroke: #fff; stroke-width: 2; stroke-dasharray: 5 95; }
.neon-control:focus-visible .button-neon,
.neon-control.is-pressed .button-neon { opacity: 1; }
.neon-control:focus-visible {
  outline: 2px solid #ecdbff;
  outline-offset: 4px;
  box-shadow: 0 0 0 1px #bc8dff, 0 0 26px #a565ff45;
}
.neon-control:active, .neon-control.is-pressed { transform: translateY(0) scale(.975); }
.neon-control:disabled .button-neon,
.neon-control[aria-disabled="true"] .button-neon { display: none; }
.neon-control:disabled, .neon-control[aria-disabled="true"] { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .neon-control:not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    border-color: #aa78ef;
    box-shadow: 0 0 0 1px #b985ff35, 0 0 26px #ad70ff38, 0 10px 28px #0004;
  }
  .neon-control:not(:disabled):hover .button-neon { opacity: 1; }
  .btn.neon-control:not(:disabled):hover::before { opacity: 1; transform: none; }
  .neon-control:not(:disabled):hover .neon-halo,
  .neon-control:not(:disabled):hover .neon-trail,
  .neon-control:not(:disabled):hover .neon-core,
  .neon-control:focus-visible .neon-halo,
  .neon-control:focus-visible .neon-trail,
  .neon-control:focus-visible .neon-core { animation-play-state: running; }
  .neon-control:not(:disabled):active { transform: translateY(0) scale(.975); }
}
@keyframes neon-perimeter { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
  .neon-control, .button-neon { transition: none !important; }
  .neon-control:hover, .neon-control:active, .neon-control.is-pressed { transform: none !important; }
  .neon-halo, .neon-trail, .neon-core { animation: none !important; }
  .neon-track { stroke: #dfc5ff; stroke-width: 1.5; opacity: 1; }
  .neon-control:hover .button-neon { opacity: 1; }
}
/* Only a deliberate click can override the device setting, for button effects. */
html[data-motion="full"] .neon-control {
  transition: transform .38s cubic-bezier(.16,1,.3,1), border-color .3s ease,
    background-color .3s ease, box-shadow .4s ease !important;
}
html[data-motion="full"] .button-neon,
html[data-motion="full"] .neon-control::before { transition: opacity .35s ease !important; }
html[data-motion="full"] .neon-control::before { display: block; }
html[data-motion="full"] .neon-halo,
html[data-motion="full"] .neon-trail,
html[data-motion="full"] .neon-core {
  animation: neon-perimeter 2.8s linear infinite !important;
  animation-play-state: paused !important;
}
html[data-motion="full"] .neon-control:focus-visible .neon-halo,
html[data-motion="full"] .neon-control:focus-visible .neon-trail,
html[data-motion="full"] .neon-control:focus-visible .neon-core {
  animation-play-state: running !important;
}
html[data-motion="full"] .neon-control.is-pressed,
html[data-motion="full"] .neon-control:active { transform: translateY(0) scale(.975) !important; }
html[data-motion="full"] .motion-wave { display: block; }
@media (hover: hover) and (pointer: fine) {
  html[data-motion="full"] .neon-control:not(:disabled):hover { transform: translateY(-2px) !important; }
  html[data-motion="full"] .neon-control:not(:disabled):hover .neon-halo,
  html[data-motion="full"] .neon-control:not(:disabled):hover .neon-trail,
  html[data-motion="full"] .neon-control:not(:disabled):hover .neon-core { animation-play-state: running !important; }
  html[data-motion="full"] .neon-control:not(:disabled):active { transform: translateY(0) scale(.975) !important; }
}
.motion-toggle { font-size: 11px; padding: 9px 12px; min-height: 36px; }
.restore-header .motion-toggle { margin-left: auto; letter-spacing: 0; }
.restore-header .motion-toggle span { letter-spacing: 0; font-size: inherit; }
@media(max-width:650px) {
  .home-actions .motion-toggle { max-width: 130px; white-space: normal; line-height: 1.25; }
  .restore-header { flex-wrap: wrap; }
  .restore-header .motion-toggle { order: 4; }
}
