@font-face {
  font-family: 'Pacaembu';
  src: url(assets/fonts/Pacaembu-Medium.otf);
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: 'Pacaembu';
  src: url(assets/fonts/Pacaembu-Regular.otf);
  font-display: swap;
  font-weight: 500;
}

:root {
  font-size: 12px;
  --custom--main: #213b22;
  --custom--main-bright: #00582c;
  --custom--main-dark: #342314;
  --custom--white: #fff8f8;
  --custom--gray-0: #f2f2f2;
  --custom--gray-1: #e6e6e6;
  --custom--gray-2: #b0b0b0;
  --custom--gray-3: #666666;
  --custom--gray-4: #333333;

  --gap: 4px;
  --element-width: 8rem;
  --element-height: 2rem;
  --element--radius: 1rem;
  --input-padding: 0.5rem;

  --ani-duration: 200ms;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

*::selection {
  background-color: var(--custom--gray-1);
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

button,
input {
  all: unset;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
}

input[type='number'] {
  -moz-appearance: textfield;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dropdown:focus,
button:focus {
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('assets/arrow-dropdown.svg');
  background-repeat: no-repeat;
  background-position: right 0px center;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-size: 1rem;
  padding-right: 0px;
}

option {
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-size: 1rem;
  color: black;
  background-color: var(--custom--white);
  border: solid 1px var(--custom--gray-1);
  border-radius: var(--element--radius);
}

html,
body {
  max-width: 1920px;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.025rem;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  overflow: hidden;
  height: 100%;
  margin: 0;
  color: black;
}

/* User Interface */

.main {
  --background--color: var(--custom--gray-1);
  position: absolute;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--background--color);
}

.menu--container {
  z-index: 10;
  position: absolute;
  bottom: 0rem;
  left: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  height: auto;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: scroll;
  -webkit-overflow-scrolling: touch;
}

.menu--container p {
  padding: 0;
  margin: 0;
}

.menu--inner {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  height: 5.5rem;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
}

.menu--inner::before,
.menu--inner::after {
  content: '';
  min-width: 1px;
}

.item--section {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--custom--white);
  border-radius: var(--element--radius);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
}

.item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-right: 1rem;
  height: 100%;
  border-right: solid 1px var(--custom--gray-1);
}

.item:last-child {
  padding-right: 0;
  border-right: none;
}

.item--label {
  display: flex;
  font-size: 0.8rem;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--custom--gray-2);
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.advanced {
  display: none;
}

.advanced--show .advanced {
  display: flex;
}

.hover-info {
  display: flex;
  width: var(--element-height);
  height: var(--element-height);
  justify-content: center;
  align-items: center;
  margin: 2px 0 2px 0;
  border: solid 1px var(--custom--gray-1);
  border-radius: var(--element--radius);
  color: var(--custom--gray-1);
}

.hover-info:hover {
  background-color: var(--custom--white);
}

.hover-icon {
  transform: translateY(0.1rem);
}

.element--container {
  display: flex;
  flex-direction: row;
  gap: var(--gap);
  flex-wrap: nowrap;
}

.element--container.small > .button {
  flex-basis: 1;
}

.button {
  flex: 1;
  flex-basis: calc(50% - var(--gap));
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--element-height);
  max-height: var(--element-height);
  padding: 0.1rem 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--custom--gray-4);
  background-color: var(--custom--gray-1);
  border-radius: var(--element--radius);
  cursor: pointer;
  transition: background-color var(--ani-duration) ease-in-out;
}

.button--selected {
  background-color: var(--custom--main);
  color: var(--custom--white);
}

.button:hover {
  background-color: var(--custom--gray-0);
}

.button--selected:hover {
  background-color: var(--custom--main-bright);
}

.button--large {
  width: 6rem;
  min-height: calc(100% - 2rem);
  padding: 1rem 0;
  background-color: black;
  color: var(--custom--gray-0);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.button--large p {
  font-size: 0.8rem;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--custom--gray-1);
}

.button--large img {
  height: 2rem;
  filter: invert(1);
}

.button--large:hover {
  background-color: var(--custom--gray-4);
}

.button--toggle {
  min-width: calc(var(--element-height) * 1.333);
  max-height: calc(var(--element-height) - 2px);
  border-radius: calc(var(--element-height) * 0.5);
  position: relative;
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--custom--gray-1);
  transition: left var(--ani-duration) ease-in-out,
    background-color var(--ani-duration) ease-in-out,
    box-shadow var(--ani-duration) ease-in-out;
}

.button--toggle::after {
  content: '';
  background-color: var(--custom--gray-4);
  height: calc(var(--element-height) * 0.85);
  width: calc(var(--element-height) * 0.85);
  border-radius: 50%;
  position: absolute;
  left: calc(var(--element-height) * 0.1);
  transition: left var(--ani-duration) ease-in-out,
    background-color var(--ani-duration) ease-in-out;
}

.button--toggle.button--selected {
  background-color: var(--custom--gray-4);
  box-shadow: unset;
}

.button--toggle.button--selected::after {
  left: calc(var(--element-height) * 0.9);
  background-color: white;
}

.button--icon {
  min-width: var(--element-height);
  width: var(--element-height);
  height: var(--element-height);
  padding: 0;
}

.button--icon img {
  width: 1rem;
}

p.label {
  flex: 1;
  display: inline-block;
}

.label--subtitle {
  color: var(--custom--gray-2);
}

.button--dropdown {
  z-index: 1000;
  flex: 1;
  position: relative;
  font-size: 0;
  line-height: 0;
  width: 6rem;
  background-color: transparent;
}

.button--list {
  z-index: 100;
  position: absolute;
  bottom: 100%;
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  max-height: 24rem;
  padding: 0.25rem;
  background-color: white;
  border-radius: var(--element--radius);
  border: solid 1px var(--custom--gray-1);
}

.button--dropdown:hover .button--list {
  display: grid;
}

.button--list-item {
  height: 1.5rem;
}

.button--list-item:hover {
  opacity: 0.9;
}

.button--list-item.button--selected,
.button--list-item.button--selected {
  box-shadow: inset 0 0 0 1px var(--custom--gray-4), inset 0 0 0 3px white;
}

.dropdown {
  display: flex;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-size: 1rem;
  height: var(--element-height);
  width: var(--element-width);
  padding: 0 1rem;
  border: solid 1px var(--custom--gray-1);
  border-radius: var(--element--radius);
  background-color: var(--custom--white);
  cursor: pointer;
}

.slider--container {
  --slider--factor: 0;
  position: relative;
  max-height: var(--element-height);
}

.slider {
  appearance: none;
  position: relative;
  width: var(--element-width);
  height: var(--element-height);
  margin: 0;
  padding: 0;
  outline: none;
  border-radius: var(--element--radius);
  background-color: var(--custom--gray-1);
  cursor: pointer;
  overflow: hidden;
}

.slider--value {
  z-index: 1;
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  user-select: none;
  border-radius: var(--element--radius);
  background-color: var(--custom--gray-1);
  overflow: hidden;
}

.slider--value-bar {
  position: absolute;
  left: 0;
  width: calc(100% * var(--slider--factor));
  height: var(--element-height);
  border-radius: var(--element--radius);
  background-color: var(--custom--gray-4);
  pointer-events: none;
  user-select: none;
}

.slider--value p {
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  color: white;
  mix-blend-mode: difference;
}

.slider--inverted {
  transform: scale(-1, 1);
}

.adder {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  column-count: 2;
  column-fill: balance;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  gap: var(--gap);
}

.value--display,
.value--button {
  display: flex;
  text-align: center;
  width: 1rem;
  height: calc(var(--element-height) - 2px);
}

.value--display {
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  min-width: 4rem;
  border-radius: var(--element--radius);
  border: solid 1px var(--custom--gray-1);
}

#animation--time-value::after {
  content: 's';
}

.divider {
  height: 0.25rem;
}

.disabled {
  pointer-events: none !important;
  opacity: 0.4 !important;
}

.inactive {
  opacity: 0.4;
  transition: opacity var(--ani-duration) ease-in-out;
}

.hidden {
  display: none !important;
}

/* Text */

.input {
  display: flex;
  text-align: center;
  gap: var(--gap);
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.025rem;
  height: var(--element-height);
  width: calc(var(--element-width) - var(--input-padding));
  border-radius: var(--element--radius);
  border: solid 1px var(--custom--gray-1);
  resize: none;
}

.input:hover {
  border: solid 1px var(--custom--gray-1);
}

.input--resolution {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.input--resolution p {
  color: var(--custom--gray-1);
}

input,
textarea {
  -webkit-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

textarea:focus,
input:focus {
  outline: none;
}

.text p {
  padding-bottom: 4px;
}

input[type='file'] {
  display: none;
}

.input--text {
  all: unset;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.5px;
  flex: 1;
  max-height: var(--element-height);
  width: 8rem;
  padding: 0 var(--input-padding);
  background: var(--custom--gray-0);
  border-radius: var(--element--radius);
  color: var(--custom--gray-4);
  overflow: auto;
  resize: none;
  cursor: text;
}

.input--text-title {
  font-weight: 500;
  text-transform: uppercase;
  min-width: 10rem;
}

.input--number {
  all: unset;
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  text-align: center;
  flex: 1;
  height: var(--element-height);
  width: 4rem;
  padding: 0 0.5rem;
  background: var(--custom--gray-0);
  border-radius: var(--element--radius);
  overflow: auto;
  resize: none;
  cursor: text;
}

/* Hover Text */

.hover-text {
  font-family: 'Pacaembu', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4rem;
  max-width: 240px;
  color: var(--custom--gray-3);
  position: absolute;
  padding: 1rem 1.5rem;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  border-radius: var(--element--radius);
  background-color: var(--custom--white);
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.125);
  z-index: 1000;
}

.hover-text br {
  line-height: 10px;
}

.popup--container {
  z-index: 9999;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup {
  padding: 1rem 2rem;
  width: 14rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5rem;
  width: 16rem;
  border-radius: var(--element--radius);
  background-color: var(--custom--white);
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.125);
}

.popup p {
  padding: 0;
  margin: 0;
}

.popup button {
  padding: 0.25rem 1.5rem;
  margin: 0;
  margin-top: 1rem;
  color: var(--custom--white);
  border-radius: var(--element--radius);
  background-color: var(--custom--gray-2);
  cursor: pointer;
}

.popup button:hover {
  background-color: var(--custom--gray-3);
}

/* Scrollbar */

.scrollbar {
  --scrollbar--width: 0px;
  z-index: 100;
  position: fixed;
  width: calc(var(--scrollbar--width) - 2rem);
  left: 0;
  bottom: 1rem;
  height: 0.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.25);
  cursor: grab;
}

.scrollbar:hover,
.scrollbar:active {
  background: rgba(255, 255, 255, 0.5);
}

/* Canvas */

.script-container {
  display: inline-block;
  justify-content: space-between;
  text-align: center;
  align-items: center;
  top: 0;
  padding: 0;
  font-size: 0;
  margin: 0px 5px 0 5px;
}

.canvas-container {
  position: fixed;
  top: -2rem;
  left: 0;
  transform: translate(0, 0);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  margin: 0;
  transform-origin: top;
}

.canvas {
  display: block;
  padding: 0;
}

#gl-canvas--container {
  z-index: 2;
  position: inherit;
}

.canvas-grab:hover {
  cursor: grab;
}

.canvas-grabbing:hover {
  cursor: grabbing;
}

/* HEADER */

.header--container {
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  display: flex;
  justify-content: center;
}

.header {
  width: 100%;
  max-width: 1440px;
  padding: 16px 8px;
  color: white;
  display: flex;
  justify-content: space-between;
}

.header--logo {
  display: block;
  width: 174px;
  height: 40px;
  background: var(--header--color, white);
  -webkit-mask: url('assets/amz_logo.svg') center / contain no-repeat;
  mask: url('assets/amz_logo.svg') center / contain no-repeat;
  mask-mode: luminance;
}

.header--icon {
  --icon--size: calc(1.5rem + 2px);
  width: var(--icon--size);
  max-width: var(--icon--size);
  height: var(--icon--size);
  -webkit-mask: url('assets/icons/icon_globe.svg') center / calc(100% - 2px)
    calc(100% - 2px) no-repeat;
  mask: url('assets/icons/icon_globe.svg') center / calc(100% - 2px)
    calc(100% - 2px) no-repeat;
  fill: var(--header--color, red);
  background-color: var(--header--color);
}

/* MOBILE */

@media (max-width: 768px) {
  :root {
    font-size: 12px;
    --element-height: 2.5rem;
    --element--radius: 1.25rem;
  }

  .no-mobile,
  .advanced {
    display: none;
  }

  .main {
    height: 100dvh;
  }

  .menu--container {
    width: 100%;
    height: 100%;
  }

  .menu--inner {
    height: 6rem;
    margin-bottom: 4rem;
  }

  .item--label {
    font-size: 1rem;
  }

  .scrollbar {
    height: 0.75rem;
    bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.5);
  }

  .button--icon img {
    width: 1.25rem;
  }

  .button--toggle {
    width: calc(var(--element-height) * 1.333);
    max-height: calc(var(--element-height) - 2px);
    border-radius: calc(var(--element-height) * 0.5);
    position: relative;
    background-color: transparent;
    box-shadow: inset 0 0 0 1px var(--custom--gray-1);
  }

  .button--toggle::after {
    height: calc(var(--element-height) * 0.8);
    width: calc(var(--element-height) * 0.8);
    left: calc(var(--element-height) * 0.125);
  }

  .button--toggle.button--selected::after {
    left: calc(var(--element-height) * 0.8);
  }

  .button--list {
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    max-height: 32rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: var(--element--radius);
    border: solid 1px var(--custom--gray-1);
  }

  .button--list-item {
    height: 2rem;
    border-radius: 33%;
  }
}
