html {
  background: #23272f;
  color: white;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.4;
  overflow: clip;
}

body {
  padding: 2rem;
  max-width: 250px;
  margin-inline: auto;
}

p {
  text-wrap: balance;
}

.button {
  background-image: radial-gradient(
    100% 100% at 100% 0,
    #5adaff 0,
    #5468ff 100%
  );
  color: white;
  border: 0;
  border-radius: 6px;
  box-shadow:
    rgba(45, 35, 66, 0.4) 0 2px 4px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px,
    rgba(58, 65, 111, 0.5) 0 -3px 0 inset;
  box-sizing: border-box;
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  padding: 1rem 2rem;
  position: relative;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  margin: 5px;

  &:hover {
    transform: translateY(1px);
  }
  &:active {
    box-shadow: #3c4fe0 0 3px 7px inset;
    transform: translateY(2px);
  }

  &.expanded {
    scale: 1.4;
    rotate: -6deg;
  }
}

.add-button {
  background-image: radial-gradient(100% 100% at 100% 0, red 0, #5468ff 100%);
}

/* Enter animation */
::view-transition-new(.button-entering) {
  animation: slide-in 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Exit animation */
::view-transition-old(.button-leaving) {
  animation: fade-out 300ms ease-out;
}

@keyframes fade-out {
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}
