@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* UI Styling */

.theme {
  cursor: pointer;
  display: inline-block;
  position: relative;
  margin: auto auto;
  padding: 0.5rem 0.5rem;
  font-size: 0;
  text-align: center;
  z-index: 1;
  transition: opacity 0.3s ease;
  pointer-events: all;
}

.theme__list,
.theme__button {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.theme__list {
  list-style: none;
  animation: 1s both fade-in;
  animation-delay: calc(var(--move-in-base-delay) * 9);
}

.theme__item {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.theme__item + .theme__item {
  margin-left: 0.5rem;
  transition: margin-left 0.3s ease;
}

.theme__button {
  display: block;
  position: relative;
  text-indent: -9999px;
  width: 1.2rem;
  height: 1.2rem;
  background: blue;
  border: 0px solid #444;
  border-radius: 0.6rem;
  cursor: pointer;
  z-index: 100;
}

button.theme__button:focus {
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

.theme__button[value="dark"] {
  background: black;
}

.theme__button[value="light"] {
  background: white;
}

@media only screen and (min-width: 640px) {
  .theme {
    opacity: 0.5;
  }
  .theme:hover {
    opacity: 1;
  }
  .theme__item + .theme__item {
    margin-left: -0.8rem;
  }
  .theme:hover .theme__item + .theme__item {
    margin-left: 0.5rem;
  }
}

/* Theme Setting */

body {
  transition: background-color 0.3s ease;
}

body.js-theme-light {
  color: #222;
  background-color: #fdfdfd;
}

.js-theme-light main h1 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.js-theme-light a {
  color: var(--blue);
}

.js-theme-light a:hover {
  background-image: linear-gradient(
    to right,
    var(--brand-blue) 25%,
    var(--brand-green) 50%,
    var(--brand-yellow) 75%,
    var(--brand-blue) 100%
  );
}

body.js-theme-code {
  color: lightslategrey;
  font-family: "Courier New", Courier, monospace;
}

.js-theme-dark .theme__button[value="dark"] {
  z-index: 95;
  border: 3px solid #828282;
}
.js-theme-light .theme__button[value="light"] {
  z-index: 95;
  border: 3px solid #dedede;
}
