/* Imports */
@import url('https://fonts.googleapis.com/css?family=Roboto|Viga&display=swap');

/* Resets */
*, *::after, *::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Button resets & styles */
button {
    display: block;
    border: none;
    color: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

button:focus, button:active {
    outline: none;
    }

button:active {
    transform: scale(1);
}

/* General styles */
body {
  --background: #FBFFF1;
  --text: #3C3744;
  --accent: #F49D6E;
  background-color: var(--background);
  font-family: 'Roboto', sans-serif;
  color: var(--text);
  height: 100vh;
  transition: color ease-out 250ms;
  overflow-x: hidden;
}

.wrapper {
  margin: auto;
  height: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

article {
  margin-bottom: 1rem;
  text-align: center;
}

h2 {
  font-size: 2.2em;
  font-family: 'Viga', sans-serif;
}

h2, * + p {
  margin-bottom: 1rem;
}
article > p:nth-of-type(2) {
  margin-top: -1rem;
}

/* Emoji custom styles */
article > p:last-of-type {
  color: transparent;
  text-shadow: 0 0 0 var(--text);
  transition: text-shadow ease-out 250ms;
}

/* Toggle button styles */
.toggle {
  background-color: var(--text);
  min-width: 80px;
  min-height: 40px;
  margin-bottom: 1rem;
  position: relative;
  border: 2px solid;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color ease-out 250ms;
}

.toggle::after {
  content: "";
  position: absolute;
  background-color: var(--background);
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  border-radius: 30px;
  transition: transform ease-out 250ms;
}

/* Active (dark mode) class for animating transition on toggle button*/
.toggle.clicked::after {
  transform: translateX(100%);
}

/* "Sun to moon" graphics and animation */
.circle, .circle::after {
  background-color: var(--accent);
  min-width: 300px;
  min-height: 300px;
  border-radius: 50%;
  margin-bottom: 2rem;
}

.circle {
  transform: rotate(-25deg);
  transition: background-color ease-out 250ms;
}
 
  .circle::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  background-color: var(--background);
  transition: transform ease-out 250ms;
  transition-delay: 20ms;
}

.circle.clicked::after {
  transform: translateY(-30%);
}

@media screen and (max-height: 560px) {
  .circle, .circle::after {
    margin-bottom: calc(-6rem - 12vh);
    z-index: -1;
  }
}