@font-face {
  font-family: "Favorit";
  src: url("ABCFavoritMonoVariableEdu.woff2") format("woff2");
  font-weight: 100 900;
}

* {
  box-sizing: border-box;
}

/* Light */
:root {
  --Color1: #3448fb;
  --Color2: #df3580;
  --Color3: #e87921;

  --LayerColor: var(--Color1);

  --Ink: #0c0b0c;
  --Paper: #f8f9f8;
  --Background: #e5e2df;
  --StageBackground: #efedeb;
}

/* Dark */
:root.Dark {
  --Ink: #f8f9f8;
  --Paper: #0c0b0c;
  --Background: #2c2927;
  --StageBackground: #1c1a18;
}

body {
  margin: 0;
  font-family: "Favorit", Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--Paper);
  background-color: var(--Background);
}

.ToolContainer {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 15px;
  /* background-color: #b0b0b0; */
}

/*
  Topbar
*/

.Topbar {
  display: flex;
  align-items: top;
  justify-content: space-between;
  height: 25px;
  flex-shrink: 0;
  /* background-color: red; */
}

.Logo {
  display: flex;
  font-size: 16px;
  text-align: center;
}

.LogoCircle {
  background-color: var(--Ink);

  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2.5px;
  width: 25px;
  height: 25px;
  border-radius: 15px;
}

.ModeSwitch {
  display: flex;
  align-items: top;
  justify-content: space-between;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 25px;
  border: 1px solid var(--Ink);
}

.ModeSwitchButton {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  padding-top: 2px;
  width: 97px;
  height: 19px;
  cursor: pointer;
}

.ModeSwitchButton.active {
  color: var(--Paper);
  background-color: var(--Ink);
}

.Info {
  position: relative;
  display: flex;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  padding-top: 2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid var(--Ink);
  cursor: pointer;
}
.Info.active {
  color: var(--Paper);
  background-color: var(--Ink);
  font-size: 0;
}
.Info.active::before,
.Info.active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.5px;
  background-color: var(--Paper);
  transform: translate(-50%, -50%) rotate(45deg);
}

.Info.active::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.TopbarControls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  /* background-color: red; */
}

.InfoPanel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  width: 100%;
  max-width: 522px;
  max-height: 100%;
  overflow-y: auto;
  padding: 30px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--Ink);
  background-color: var(--Background);
  border-left: 12px solid var(--Background);
  border-bottom: 12px solid var(--Background);
  box-shadow: inset 0 0 0 1px var(--Ink);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.InfoPanel.open {
  opacity: 1;
  visibility: visible;
}

.InfoPanel p {
  margin: 0 0 16px 0;
}

.InfoPanel p:last-child {
  margin-bottom: 0;
}

.InfoIntro {
  font-size: 16px;
  line-height: 1.5;
}

.InfoPanel a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.InfoLinks a + a {
  margin-left: 24px;
}
/*
  Stage
*/

.Stage {
  position: relative;
  display: flex;
  height: 100%;
  width: 100%;
  background-color: var(--StageBackground);
  margin-top: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.Arp {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ArpLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --LetterColor: var(--Color1);
}

.ArpLetter {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.125em;
  border-radius: 50%;
  font-weight: 300;
  color: #f8f9f8;
  background-color: var(--LetterColor);
}

.ArpLetter.Hit {
  color: #0c0b0c;
  /* background-color: black; */
  /* filter: invert(1); */
}

.TrailCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/*
  Toolbar
*/

.Toolbar {
  display: flex;
  color: var(--Ink);
  justify-content: space-between;
  height: 100px;
  width: 100%;
  /*background-color: blue;*/
  border: 1px solid var(--Ink);
}

.ToolbarBase {
  display: flex;
  padding: 10px 26px 10px 25px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 200px;
  height: 100%;
  border-right: 1px solid var(--Ink);
  /* background-color: red; */
}

.BaseContent {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  /* background-color: yellow; */
}

.ToolbarAdjust {
  display: flex;
  align-items: center;
  justify-content: left;
  flex-grow: 1;
  height: 100%;
}

.AdjustContent {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  margin-left: 35px;
}

.ToolbarEffect {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 0;
  height: 100%;
  overflow: hidden;
  transition: width 0.3s ease;
  border-left: 1px solid var(--Ink);
  margin-right: -1px;
}

.ToolbarEffect.active {
  width: var(--EffectWidth);
}

.Toolbar.NoTransition .ToolbarEffect {
  transition: none;
}

.ToolbarEffect.Wave {
  --EffectWidth: 408px;
}

.ToolbarEffect.Rep {
  --EffectWidth: 258px;
}

.ToolbarEffect.Dist {
  --EffectWidth: 101px;
}

.ToolbarEffect.Trail {
  --EffectWidth: 168px;
}

.EffectContent {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 10px 26px 10px 25px;
  width: var(--EffectWidth);
  height: 100%;
}

.ToolbarControl {
  display: flex;
  padding: 10px 26px 10px 25px;
  align-items: center;
  justify-content: center;
  width: 200px;
  flex-shrink: 0;
  height: 100%;
  border-left: 1px solid var(--Ink);
}

.ControlContent {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

/*
  Controls
*/

.Control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  margin-right: 16px;
  height: 72px;
  /* background-color: red; */
}

.Control:last-child {
  margin-right: 0;
}

.ControlLabel {
  height: 22px;
}

.Control.Knob {
  width: 50px;
}

.Control.Base {
  width: 74px;
}

.KnobDial {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--Ink);
  cursor: ns-resize;
  touch-action: none;
}

.KnobDial::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 50%;
  transform: translateX(-50%) rotate(var(--KnobRotation, 0deg));
  transform-origin: 50% 100%;
  background-color: var(--Ink);
}

.Dropdown {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 74px;
  height: 18px;
  border: 1px solid var(--Ink);
  cursor: pointer;
}

.Dropdown::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 4px solid var(--Ink);
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  pointer-events: none;
}

.DropdownColor {
  flex: 1;
  height: 100%;
}

.DropdownColor.Color1 {
  background-color: var(--Color1);
}

.DropdownColor.Color2 {
  background-color: var(--Color2);
}

.DropdownColor.Color3 {
  background-color: var(--Color3);
}

.Dropdown.Palette .DropdownText,
.Dropdown.Palette.Music .DropdownColor {
  display: none;
}

.Dropdown.Palette.Music .DropdownText {
  display: flex;
}

.Dropdown.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.DropdownList {
  display: none;
  position: fixed;
  z-index: 10;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  width: 74px;
  border: 1px solid var(--Ink);
  background-color: var(--Background);
}

.Dropdown.open .DropdownList {
  display: flex;
}

.DropdownOption {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  width: 100%;
  height: 14px;
  border: 1px solid var(--Ink);
}

.DropdownOption.active {
  outline: 1px solid var(--Ink);
  outline-offset: 1px;
}

.DropdownOption.Text {
  height: 18px;
}

.DropdownOption.Text.active {
  outline: 0;
  color: var(--Paper);
  background-color: var(--Ink);
}

.BaseSwitch {
  display: flex;
  flex-direction: row;
  width: 74px;
  align-items: center;
  justify-content: center;
  height: 18px;
  border: 1px solid var(--Ink);
}

.BaseSwitchButton {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  font-size: 10px;
  padding-top: 2px;
  width: 34px;
  height: 13px;
  cursor: pointer;
}

.BaseSwitchButton.active {
  color: var(--Paper);
  background-color: var(--Ink);
}

.BaseStack {
  display: flex;
  flex-direction: column;
  /* background-color: red; */
  justify-content: center;
  height: 50px;
  gap: 10px;
}

/*
  Adjust
*/

.InstrumentIndicators {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 50px;
  gap: 10px;
}

.InstrumentIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  padding-top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  opacity: 0.5;
  cursor: pointer;
}

.InstrumentIndicator.Color1 {
  background-color: var(--Color1);
}

.InstrumentIndicator.Color2 {
  background-color: var(--Color2);
}

.InstrumentIndicator.Color3 {
  background-color: var(--Color3);
}

.InstrumentIndicator.active {
  opacity: 1;
  color: #f8f9f8;
}

.TextInput {
  display: flex;
  align-items: center;
  height: 50px;
}

.TextInputField {
  margin: 0;
  padding: 2px 5px 0 5px;
  width: 120px;
  height: 18px;
  border: 0;
  outline: 0;
  font: inherit;
  text-transform: uppercase;
  color: var(--Ink);
  background-color: var(--Paper);
}

.TextInputField::placeholder {
  color: var(--Ink);
  opacity: 0.3;
}

.EffectButtons {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 50px;
}

.EffectButton {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  width: 70px;
  height: 36px;
  border: 1px solid var(--Ink);
  cursor: pointer;
}

.EffectButton + .EffectButton {
  margin-left: -1px;
}

.EffectButton.active {
  color: #f8f9f8;
  background-color: var(--LayerColor);
  border: 1px solid var(--LayerColor);
}

/*
  Effect
*/

.Control.Grid {
  width: 74px;
}
.QuantizeButton {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  font-size: 10px;
  padding-top: 2px;
  width: 74px;
  height: 18px;
  border: 1px solid var(--Ink);
  cursor: pointer;
}

.QuantizeButton.active {
  color: var(--Paper);
  background-color: var(--Ink);
}
.Control.Style {
  width: 158px;
}

.StyleStack {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.DropdownText {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 10px;
  padding-top: 2px;
  height: 100%;
}

.EffectClose {
  display: none;
}

/*
  Control
*/

.Control.Play {
  width: 50px;
}

.Control.Output {
  width: 74px;
}

.OutputButton {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  font-size: 10px;
  padding-top: 2px;
  width: 74px;
  height: 18px;
  border: 1px solid var(--Ink);
  cursor: pointer;
}

.OutputButton.active {
  color: var(--Paper);
  background-color: var(--Ink);
}

.PlayButton {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--Ink);
  cursor: pointer;
}

.PlayButton.active {
  background-color: var(--Ink);
}

.PlayIcon {
  margin-left: 4px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--Ink);
}

.PauseIcon {
  display: none;
  width: 12px;
  height: 14px;
  border-left: 4px solid var(--Paper);
  border-right: 4px solid var(--Paper);
}

.PlayButton.active .PlayIcon {
  display: none;
}

.PlayButton.active .PauseIcon {
  display: block;
}

.Info,
.ModeSwitchButton,
.BaseSwitchButton,
.Dropdown,
.DropdownOption,
.InstrumentIndicator,
.EffectButton,
.EffectClose,
.QuantizeButton,
.PlayButton,
.OutputButton {
  touch-action: manipulation;
}

@media (hover: hover) {
  .DropdownOption:hover {
    outline: 1px solid var(--Ink);
    outline-offset: 1px;
  }

  .DropdownOption.Text:hover {
    outline: 0;
    color: var(--Paper);
    background-color: var(--Ink);
  }

  .EffectButton:hover {
    color: #f8f9f8;
    background-color: var(--LayerColor);
    border: 1px solid var(--LayerColor);
  }

  .QuantizeButton:hover,
  .OutputButton:hover {
    color: var(--Paper);
    background-color: var(--Ink);
  }
}

@media (max-width: 1479px) {
  .Toolbar {
    flex-wrap: wrap;
    height: auto;
  }

  .ToolbarBase,
  .ToolbarAdjust,
  .ToolbarControl {
    height: 100px;
  }

  .ToolbarAdjust {
    min-width: 0;
  }

  .ToolbarEffect,
  .ToolbarEffect.active {
    width: 100%;
  }

  .ToolbarEffect {
    position: relative;
    order: -1;
    align-items: flex-end;
    justify-content: flex-start;
    height: 0;
    transition: height 0.3s ease;
    border-left: 0;
    border-bottom: 1px solid var(--Ink);
    margin-right: 0;
    margin-top: -1px;
  }

  .ToolbarEffect.active {
    height: var(--EffectHeight, 100px);
  }

  .EffectContent {
    position: relative;
    justify-content: flex-start;
    padding: 10px 26px 10px 25px;
    width: 100%;
    height: calc(var(--EffectHeight, 100px) - 1px);
  }

  .EffectClose {
    display: flex;
    position: absolute;
    z-index: 1;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: var(--Ink);
    font-size: 0;
    cursor: pointer;
  }

  .EffectClose::before,
  .EffectClose::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 1.5px;
    background-color: var(--Paper);
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .EffectClose::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
}

/*
  Mobile
*/

@media (max-width: 1099px) {
  .InfoPanel {
    padding: 20px;
  }

  .ToolContainer {
    inset: 10px;
  }

  .ToolbarBase,
  .ToolbarAdjust,
  .ToolbarControl {
    height: auto;
  }

  .ToolbarBase,
  .ToolbarControl {
    width: auto;
    padding: 10px 8px 10px 8px;
  }

  .BaseContent,
  .ControlContent {
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
  }

  .Control.Base .ControlLabel,
  .Control.Layer .ControlLabel,
  .Control.Edit .ControlLabel,
  .Control.Output .ControlLabel {
    display: none;
  }

  .Control.Base,
  .Control.Layer,
  .Control.Text,
  .Control.Edit,
  .Control.Output {
    height: auto;
  }

  .BaseContent .Control,
  .AdjustContent .Control,
  .ControlContent .Control {
    margin-right: 0;
  }

  .ToolbarAdjust {
    flex-basis: 0;
  }

  .AdjustContent {
    display: grid;
    align-items: stretch;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    margin-left: 0;
    width: 100%;
    height: 100%;
  }

  .Control.Layer {
    grid-row: 1 / 3;
    justify-content: flex-start;
    padding: 10px 0 10px 10px;
  }

  .InstrumentIndicators {
    flex-direction: column;
    height: auto;
    gap: 12px;
  }

  .Control.Text {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 0 10px;
    width: 100%;
  }

  .Control.Text .ControlLabel {
    height: auto;
    padding-top: 2px;
  }

  .TextInput {
    flex: 1;
    min-width: 0;
    height: auto;
  }

  .TextInputField {
    min-width: 0;
    width: 100%;
  }

  .Control.Edit {
    padding: 10px;
    width: 100%;
  }

  .EffectButtons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: auto;
  }

  .EffectButton {
    width: auto;
  }

  .EffectButton + .EffectButton {
    margin-left: 0;
  }

  .EffectButton:nth-child(even) {
    margin-left: -1px;
  }

  .EffectButton:nth-child(n + 3) {
    margin-top: -1px;
  }

  .Control.Output {
    width: 50px;
  }

  .OutputButton {
    width: 50px;
  }

  .EffectContent {
    padding: 10px 15px 10px 15px;
  }

  .EffectContent .Control {
    margin-right: 10px;
  }
}

@media (max-width: 479px) {
  .Logo {
    align-items: center;
    font-size: 13px;
  }

  .LogoCircle {
    padding-top: 2px;
    width: 20px;
    height: 20px;
  }

  .TopbarControls {
    gap: 8px;
  }

  .ModeSwitch {
    width: 150px;
  }

  .ModeSwitchButton {
    font-size: 10px;
    width: 72px;
  }

  .InfoPanel {
    border-left: 0;
  }
}
