html, body {
  height: 100%;
  margin: 0;
  display: flex;
  overflow: hidden !important;
  background: #020617;
  font-family: "Iowan Old Style", "Georgia", serif;
}

/* Canvas */
#webgl {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Text */
.labels {
  display: flex;
  flex-direction: column;
  margin: 24px;
}
.label {
  text-align: center;
  margin: 8px;
  padding: 20px;
  z-index: 1;
  border-radius: 16px;
  letter-spacing: 0.5ch;
  position: relative;
  color: rgb(117, 129, 148);

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  opacity: 0; 
  transform: translateY(25px);
  filter: blur(2px);
}
.title {
  background: rgba(36, 40, 45, 0.5);
  font-size: 42px;
}
.subtitle {
  flex-direction: column;
  max-width: 500px;
  gap: 12px;
  font-size: 18px;
  cursor: default;
}
.subtitle p {
  position: relative;
  color: rgb(72, 79, 91);
}
.subtitle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(23, 28, 34, 0.5);
  z-index: 0;
  pointer-events: none;

  transform-origin: top center;
  transform: scaleY(1);
  transition: transform 600ms ease;
}
.subtitle:hover::before {
  transform: scaleY(1.3);
}
.title.loaded {
  animation: fadeIn 3s ease-out 1s forwards;
}
.subtitle.loaded {
animation: fadeIn 3s ease-out 2s forwards;
}
@keyframes fadeIn {
  to {opacity: 1; transform: translateY(0); filter: blur(0px); }
}

/* Actions */
.subtitle__actions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease 100ms;
}
.subtitle:hover .subtitle__actions {
  opacity: 1;
  pointer-events: auto;
}
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  background: rgba(49, 57, 70, 0.5);
}
.action:hover {
  filter: brightness(1.8);
}
i {
  font-weight: 400;
  line-height: 1;
  font-size: 20px;
  color: rgb(99, 114, 136);
}

/* Modals */
dialog {
  color: rgb(112, 126, 148);
  background: rgba(32, 38, 46, 0.5);
  padding: 0px 32px 32px 32px;
  border-radius: 16px;
  letter-spacing: 0.3ch;
  border: none;
  gap: 24px;
}

dialog[open] {
  animation: fadein 500ms ease-in;
}
@keyframes fadein{ 0%{ opacity:0; } 100%{ opacity:1; } }

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.infomodal-close {
  position: absolute;
  inset: 16px 16px auto auto;
  width: 32px;
  height: 32px;
}
.infomodal h2 {
  margin: 32px;
}
.infomodal p {
  font-size: 12px;
  max-width: 72ch;
}
.infomodal a {
  display: inline;
  color: rgb(112, 126, 148);
}

.settingsdialog {
  z-index: 1;
  position: absolute;
  inset: 32px 32px auto auto;
}
.settingsdialog h2 {
  text-align: center;
}
.controls {
  display: grid;
  grid-template-areas: 
  "switches colorpickers"
  "wavecontrols colorpickers";
  flex-direction: column;
  gap: 12px;
}

/* Switches */
.switches {
  display: grid;
  grid-area: switches;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-right: 32px;
  align-items: center;
}
.switch {
  display: inline-flex;
  justify-content: end;
  cursor: pointer;
}
.switch .input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: relative;
  width: 32px;
  height: 16px;
  flex-shrink: 0;
  background-color: rgba(32, 38, 46, 0.5);
  border: 1px solid rgb(112, 126, 148);
  border-radius: 6px;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  inset: auto auto 2px 2px;
  background: white;
  border-radius: 4px;
  transition: transform 100ms;
}
.switch .input:checked + .slider {
  background-color: rgb(112, 126, 148);
}

.switch .input:checked + .slider::before {
  transform: translateX(16px);
}
.switchlabel {
  margin: 0;
} 

/* Color Pickers */
.colorpickers {
  display: flex;
  grid-area: colorpickers;
  flex-direction: column;
  gap: 8px;
}
.colorpicker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  width: 160px;
  background: rgba(36, 40, 45, 0.25);
  border: 1px solid rgb(112, 126, 148);
  border-radius: 8px;
}
.colorpicker__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.colorpicker__value {
  font-size: 12px;
  letter-spacing: 0.15ch;
}
.colorpicker__swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}
.colorpicker__saturation {
  position: relative;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(112, 126, 148, 0.4);
  background: hsl(210, 100%, 50%);
  cursor: crosshair;
  touch-action: none;
}
.colorpicker__saturation-white,
.colorpicker__saturation-black {
  position: absolute;
  inset: 0;
}
.colorpicker__saturation-white {
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0));
}
.colorpicker__saturation-black {
  background: linear-gradient(0deg, #000, rgba(0, 0, 0, 0));
}
.colorpicker__hue {
  position: relative;
  height: 16px;
  border-radius: 6px;
  background: linear-gradient( 90deg, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100% );
  border: 1px solid rgba(112, 126, 148, 0.4);
  cursor: pointer;
  touch-action: none;
}
.colorpicker__pointer {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.2);
}
.colorpicker__pointer--hue {
  top: 50%;
}

/* Wave Controls */
#waveCanvas {
  grid-area: wave;
  height: 120px;
  width: 280px;
  border-radius: 8px;
  border: 1px solid rgb(112, 126, 148);
}
.wavecontrols {
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgb(112, 126, 148);
  grid-area: wavecontrols;
  display: grid;
  grid-template-areas: 
  "wave wave wave wave wave"
  "kl dg1 dg2 dg3 dg4";
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.wavecontrols span {
  font-size: 10px;
}
.dial-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dial {
  place-self: center;
}
.dial::before {
  background: rgb(112, 126, 148);
  width: 8em;
  height: 8em;
  border-radius: 50%;
}
.dial::before, .knob {
  width: 48px;
  height: 48px;
  position: relative;
}
.knob::before,
.knob::after,
.dial::before {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.knob::before {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #fff;
}
.knob__val {
  margin-top: 8px;
  margin-left: 18%;
  color: rgb(112, 126, 148);
  width: 42px;
}
.dial-labels {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.dial__label {
  writing-mode: vertical-lr;
}