#randomize {
  position: fixed;
  bottom: 1em;
  left: 1em;
  margin: 0;
  font-weight: 700;
  border-radius: 5px;
  padding: 0.5em 1em;
  display: inline-block;
  color: white;
  border: none;
  background-color: #8bc34a;
  box-shadow: 0px 5px 0px 0px #4caf50;
}

#randomize:active {
  transform: translate(0, 5px);
  box-shadow: 0px 0px 0px 0px;
}

#randomize:hover {
  background: lighten(rgb(204, 209, 217), 5);
  cursor: pointer;
}

#randomize:focus {
  outline: 0;
}

.glitchButton,
#randomize {
  z-index: 999;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: white;
  color: #313131;
}

header {
  position: sticky;
  top: 0;
  padding: 8px 16px 16px 16px;
  text-align: center;
  background: white;
  z-index: 100;
  font-size: 0.7rem;
}

header h1 {
  margin: 0;
  padding-bottom: 8px;
}

section {
  display: grid;
  grid-template-columns: 1fr;
}

figure {
  position: relative;
  margin: 0;
}

figure img {
  border: none;
  display: block;
  width: 100%;
  height: 100%;
}

figure figcaption {
  position: absolute;
  z-index: 9;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0.9;
  top: 0;
  transition: all 150ms ease-in-out;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 600ms ease-out;
}

figure:hover figcaption {
  opacity: 0;
  cursor: pointer;
  transition: all 400ms ease-in;
}

figure figcaption div {
  padding: 16px 0;
}

figure figcaption div:first-of-type {
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  font-style: italic;
  font-weight: bolder;
  font-size: 1.25rem;
}

figure figcaption div:last-child {
  font-weight: 100;
  font-size: 0.8rem;
}

@media screen and (min-width: 640px) {
  section {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (min-width: 960px) {
  section {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media screen and (min-width: 1280px) {
  section {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  }
}

@media screen and (min-width: 2560px) {
  section {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #dcdcdc;
  }

  header {
    background: #121212;
  }

  figure figcaption {
    background: #121212;
    color: #dcdcdc;
  }
}
