* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
}

@font-face {
  font-family: "Iosevka";
  font-display: block;
  font-weight: 400;
  font-stretch: normal;
  font-style: normal;
  src: url("assets/fonts/iosevka-regular.subset.woff2") format("woff2"),
    url("assets/fonts/iosevka-regular.subset.woff") format("woff");
}

@font-face {
  font-family: "Iosevka";
  font-display: block;
  font-weight: 700;
  font-stretch: normal;
  font-style: normal;
  src: url("assets/fonts/iosevka-bold.subset.woff2") format("woff2"),
    url("assets/fonts/iosevka-bold.subset.woff") format("woff");
}

@font-face {
  font-family: "Iosevka";
  font-display: block;
  font-weight: 400;
  font-stretch: normal;
  font-style: italic;
  src: url("assets/fonts/iosevka-italic.subset.woff2") format("woff2"),
    url("assets/fonts/iosevka-italic.subset.woff") format("woff");
}


html {
  font-family: "Iosevka", monospace;
  font-size: 15px;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

#root {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 70ch;
  padding: 3rem 1rem;
}

#root > * + * {
  margin-top: 3rem;
}

#root > header {
  padding: 1rem 0;
}

#root > header h1 {
  text-align: center;
  font-size: 1.75rem;
}

#root > footer {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  opacity: 0.3;
  padding: 2rem 0;
}

#root > footer > * + * {
  margin-top: 2rem;
}

a,
a:hover,
a:visited {
  color: inherit;
}

p {
  text-align: justify;
  hyphens: auto;
}

button {
  background: inherit;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:hover,
button:focus {
  background: #dfcfbf;
  outline: none;
}

button svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.space-out {
  letter-spacing: 0.3rem;
  word-spacing: -0.3rem;
  margin: 0 0.25rem;
}

#github-link {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: #000;
  transform: translate(60px, -60px) rotate(45deg);
  overflow: hidden;
  z-index: 1000;
}

#github-link a {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotate(-45deg) translate(-25px, 25px);
}

#github-link svg {
  width: 32px;
  height: 32px;
  fill: #4a90e2;
}

#welcome > * + * {
  margin-top: 0.5rem;
  text-align: justify;
}

#metronome {
  display: inline-flex;
  vertical-align: middle;
  border: 2px solid #dfcfbf;
  border-radius: 0.3rem;
  height: 1.6rem;
  line-height: 1.35rem;
  background: #efdfcf;
}

#metronome > * {
  padding: 0 0.33rem;
}

#metronome > * + * {
  border-left: 2px solid #dfcfbf;
}

#metronome.on button.toggle .play,
#metronome.off button.toggle .pause,
#metronome.off button.slower,
#metronome.off button.faster {
  display: none;
}

#metronome span {
  text-align: center;
  min-width: 4.5rem;
}

#practice {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#practice > * + * {
  margin-top: 2rem;
}

#practice > section {
  width: 100%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  height: 2.75rem;
  padding: 0.5rem;
  border: 2px solid #dfcfbf;
}

#practice > section > div {
  flex: 1;
  text-align: center;
  height: 1.6rem;
  line-height: 1.5rem;
}

#practice > section.given {
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
}

#practice > section.typed {
  position: relative;
  overflow: hidden;
  background: #efdfcf;
  margin-top: 0;
  border-radius: 0 0 0.5rem 0.5rem;
}

#practice > section.typed > input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

#practice .count {
  font-weight: 700;
}

@keyframes blink {
  0% {
    background: #000;
    color: #4a90e2;
  }
  40% {
    background: #000;
    color: #4a90e2;
  }
  50% {
    background: transparent;
    color: #000;
  }
  90% {
    background: transparent;
    color: #000;
  }
  100% {
    background: #000;
    color: #4a90e2;
  }
}

#practice > section.given > .hl {
  background: #dfcfbf;
}

#practice > section.typed > .hl {
  background: #000;
  color: #fed;
}

#practice > section > .hl.animated {
  animation: blink;
  animation-timing-function: linear;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-delay: 0.25s;
}

#practice > section > .err {
  background: #ff334499;
  color: #000;
}


