/*
Adapted from Kevin Powell's "Neon button with CSS":
https://codepen.io/kevinpowell/pen/QWdRzON
Copyright (c) 2026 Kevin

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

:root {
    --clr-neon: #00f3ff;
    --clr-bg: #030712;
}

button:not(:disabled),
button:disabled {
    position: relative;
    z-index: 0;
    color: var(--clr-neon);
    border: var(--clr-neon) 0.125em solid;
    background-color: transparent;
    background-image: none;
    text-shadow: 0 0 0.125em rgb(255 255 255 / 0.3), 0 0 0.45em currentColor;
    box-shadow: inset 0 0 0.25em var(--clr-neon), 0 0 0.2em var(--clr-neon);
    transition: color 100ms linear, text-shadow 100ms linear;
}

button:not(:disabled)::before {
    content: "";
    position: absolute;
    top: 120%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--clr-neon);
    transform: perspective(1em) rotateX(40deg) scale(1, 0.35);
    filter: blur(0.55em);
    opacity: 0.12;
    pointer-events: none;
}

button:not(:disabled)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background-color: var(--clr-neon);
    box-shadow: 0 0 0.8em 0.2em var(--clr-neon);
    opacity: 0;
    transition: opacity 100ms linear;
    pointer-events: none;
}

button:not(:disabled):hover,
button:not(:disabled):focus-visible {
    color: var(--clr-bg);
    text-shadow: none;
}

button:not(:disabled):hover::before,
button:not(:disabled):focus-visible::before {
    opacity: 0.28;
}

button:not(:disabled):hover::after,
button:not(:disabled):focus-visible::after {
    opacity: 1;
}

button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    button:not(:disabled),
    button:not(:disabled)::after {
        transition: none;
    }
}

/* Adapted from CSS Only Shimmer Button by Simey, MIT licensed.
   https://codepen.io/simeydotme/pen/gOqNxRa
   Copyright (c) 2026 Simey. */
@property --button-shimmer-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes button-shimmer-spin {
    to { --button-shimmer-angle: 360deg; }
}

@keyframes button-shimmer-flare {
    0% { opacity: 0; }
    20%, 65% { opacity: 1; }
    100% { opacity: 0; }
}

.shimmer-button {
    --shimmer-color: #9ffaff;
    position: relative;
    isolation: isolate;
    overflow: visible;
}

.shimmer-button .shimmer {
    position: absolute;
    inset: -5px;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(
        from var(--button-shimmer-angle),
        transparent 0 24%,
        var(--shimmer-color) 36% 42%,
        transparent 49% 70%,
        var(--shimmer-color) 84% 90%,
        transparent 100%
    );
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    padding: 2px;
    opacity: .46;
    animation: button-shimmer-spin 7s linear infinite;
}

.shimmer-button .shimmer::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    box-shadow: 0 0 5px 1px var(--shimmer-color), 0 0 16px 3px var(--shimmer-color);
    opacity: 0;
    pointer-events: none;
}

.shimmer-button:hover .shimmer::before,
.shimmer-button:focus-visible .shimmer::before {
    animation: button-shimmer-flare 900ms ease-out;
}

button.shimmer-button:not(:disabled):hover,
button.shimmer-button:not(:disabled):focus-visible,
a.shimmer-button:hover,
a.shimmer-button:focus-visible {
    transform: translateY(-1px);
}

.shimmer-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .shimmer-button .shimmer { animation: none; }
    .shimmer-button:hover .shimmer::before,
    .shimmer-button:focus-visible .shimmer::before { animation: none; opacity: .55; }
    button.shimmer-button:not(:disabled):hover,
    button.shimmer-button:not(:disabled):focus-visible,
    a.shimmer-button:hover,
    a.shimmer-button:focus-visible { transform: none; }
}