:root {
  --clr-neon: hsl(185, 100%, 54%);
  --clr-bg: hsl(180, 21%, 16%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: 'Balsamiq Sans', cursive;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--clr-bg);
  color: var(--clr-neon);
}

.neon-button {
  font-size: 5rem;
  color: var(--clr-neon);
  background: transparent;
  display: inline-block;
  cursor: pointer;
  /* Here, we use em to set the padding according to the font size (if the font size increase, so the border and padding too) */
  padding: 0.25em 1em;
  /* Current color is a native CSS variable that allows us to use the nearest color property to the element */
  border: 0.125em solid var(--clr-neon);
  border-radius: 0.25em;
  text-shadow:
      0 0 0.125em hsl(0 0% 100% / 0.3),
      0 0 0.45em var(--clr-neon);
  box-shadow:
      inset 0 0 0.5em 0 var(--clr-neon),
      0 0 0.5em 0 var(--clr-neon);
  position: relative;
}

.neon-button::before {
  /* Allows us to deactivate the hover transition on the shadow */
  pointer-events: none;
  content: "";
  position: absolute;
  background: var(--clr-neon);
  top: 120%;
  left: 0;
  width: 100%;
  height: 100%;
  transform: perspective(1em) rotateX(40deg) scale(1, 0.35);
  filter: blur(1em);
  opacity: 0.7;
}

.neon-button::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  box-shadow: 0 0 2em 0.5em var(--clr-neon);
  opacity: 0;
  background: var(--clr-neon);
  z-index: -1;
  transition: opacity 100ms linear;
}

/* :focus for tab */
.neon-button:hover,
.neon-button:focus {
  color: var(--clr-bg);
  text-shadow: unset;
}

.neon-button:hover::before,
.neon-button:focus::before {
  opacity: 1;
}

.neon-button:hover::after,
.neon-button:focus::after {
  opacity: 1;
}
