:root {
  --width-target: calc(100vw / 6);
  --height-target: calc(100vh / 4);
  --size: min(var(--width-target), var(--height-target));
  --padding-vertical: calc((100vh - var(--size) * 2.5) / 2);
  --padding-horizontal: calc((100vw - var(--size) * 5) / 2);
}

a {
  color: white;
  text-decoration: none;
}

a:hover {
  text-shadow: 0 0 5px #fff;
}

body {
  height: 100%;
  margin: 0;
  position: relative;
  top: 0;
}

button {
  color: black;
  margin: 0.5em;
  padding: 0.5em;
}

footer {
  bottom: 0;
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
}

canvas {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

html {
  background-color: black;
  color: white;
  font-family: sans-serif;
  height: 100%;
}

nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  left: var(--padding-horizontal);
  mix-blend-mode: difference;
  position: absolute;
  top: var(--padding-vertical);
}

nav > * {
  width: var(--size);
}

nav > a {
  align-items: center;
  display: flex;
  font-size: calc(var(--size) / 9);
  height: calc(var(--size) / 2);
  justify-content: center;
  line-height: calc(var(--size) / 9);
}

nav > div {
  font-size: var(--size);
  height: var(--size);
  line-height: var(--size);
  overflow: hidden;
  text-align: center;
  text-shadow: 0 0 5px #fff;
}

nav > div:hover {
  filter: blur(4px);
}

samp {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  bottom: 0;
  color: red;
  display: -webkit-box;
  margin: 1em;
  mix-blend-mode: difference;
  overflow: hidden;
  position: absolute;
  visibility: visible;
  width: calc(100% - 2rem);
  word-wrap: break-word;
}

select {
  margin: 0.5rem;
  position: absolute;
  right: 0;
  top: 0;
}

aside {
  -webkit-text-stroke-color: black;
  -webkit-text-stroke-width: 1px;
  font-size: 1.5em;
  font-weight: 900;
  margin: 0.5rem;
}

textarea {
  -webkit-text-stroke-color: black;
  -webkit-text-stroke-width: 1px;
  background-color: transparent;
  border: 0;
  box-sizing: border-box;
  color: white;
  font-size: 1.5em;
  font-weight: 900;
  height: 100%;
  left: 0;
  outline: none;
  padding: 1em;
  position: absolute;
  resize: none;
  top: 0;
  width: 100%;
}

main {
  opacity: 0;
  visibility: hidden;
}

.fade-in {
  opacity: 1;
  transition: opacity 1s linear;
  visibility: visible;
}

.fade-out {
  opacity: 0;
  transition: visibility 0s 1s, opacity 1s linear;
  visibility: hidden;
}

canvas { z-index: 0; }
samp { z-index: 1; }
textarea { z-index: 2; }
select { z-index: 3; }
footer { z-index: 4;}
nav { z-index: 5; }
