:root {
  --bg-color: #f2efe5;
  --bg-color2: #dcd9d0;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

main {
  height: calc(100dvh - 1rem);
  overflow: hidden;
  max-width: 35rem;
  margin: 0.5rem;
  position: relative;
}

.main-section {
  height: 100%;
  background-color: var(--bg-color);
  border: 2px solid #2d3250;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  padding: 0.5rem;
  gap: 0.5rem;
  touch-action: none;
}

.canvas-container {
  background-color: var(--bg-color2);
  position: relative;
}
.canvas-container canvas {
  width: 100%;
  height: 100%;
}

.canvas-text {
  width: 100%;
  text-align: center;
  pointer-events: none;
  color: #fff;
  font-weight: 700;
  z-index: 1;
  font-size: 2rem;
  opacity: 0.2;
  position: absolute;
  font-family: "Solway", sans-serif;
}

.canvas-text1 {
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
}
.canvas-text2,
.canvas-text3 {
  font-size: 1.5rem;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.text-container {
  position: relative;
  background-color: var(--bg-color2);
  max-height: 100%;
  max-width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  font-size: 1.1rem;
  font-size: 300;
  padding: 1rem;
  padding-bottom: 4rem;
  font-family: "Pixelify Sans", sans-serif;
}

.section3 {
  position: relative;
}

.section4 {
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.section-link {
  color: #000;
  text-underline-offset: 2px;
  font-size: 1.2rem;
  font-family: "Solway", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.section4 small {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Pixelify Sans", sans-serif;
}

.scroll-btn {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-color);
  height: 2.8rem;
  width: 1.7rem;
  border: 2px solid #484848;
  border-radius: 500px;
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: start;
  padding: 0.2rem 0.2rem;
}

.scroll-btn.jump {
  animation: jump-shaking 0.83s 1.5s 3 backwards;
}

.scroll-btn::before {
  position: absolute;
  bottom: -0.9rem;
  content: "Tap to scroll";
  white-space: nowrap;
  color: #000;
  font-size: 0.6rem;
  /* text-path: path('M 50 100 Q 100 200 150 100 Q 200 0 250 100 Q 300 200 350 100'); */
}

.scroll-btn.fade-out {
  animation: fadeOut 2s ease 1 forwards;
}

.scroll-btn .ball {
  display: inline-block;
  width: 100%;
  border-radius: 999px;
  background: #504f4f;
  aspect-ratio: 1 / 1;
  /* animation: name duration timing-function delay iteration-count direction fill-mode; */
  animation: ballSlide 2s ease infinite forwards;
}

.scroll-btn2 {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  height: 2.5rem;
  width: 2.5rem;
  border: 2px solid #252424;
  border-radius: 999px;
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
}
.scroll-btn2.fade-in {
  animation: fadeIn 1s ease 1 forwards;
  opacity: 1;
}

.scroll-btn2 svg {
  transform: rotate(90deg);
  margin-top: -1px;
}

@keyframes ballSlide {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(calc(100% - 0.1rem));
  }
}

@keyframes fadeOut {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(15rem);
  }
}

@keyframes fadeIn {
  0% {
    transform: translateX(-120vw);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateX(0);
  }
}

.some-text {
  position: fixed;
  width: 100%;
  text-align: center;
  top: 0;
  left: 50%;
  pointer-events: none;
  color: #fff;
  font-weight: 700;
  z-index: 1;
  transform: translateX(-50%);
  font-size: 2rem;
  opacity: 0.2;
}

.edit-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background-color: var(--bg-color2);
  border: none;
  padding: 0.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.form-container {
  position: absolute;
  top: 0.5rem;
  right: -15rem;
  height: fit-content;
  width: 14rem;
  background-color: var(--bg-color2);
  border: 2px solid #2d3250;
  z-index: 1000;
  padding: 0.4rem;
}
.form-container .form {
  z-index: 1000;
  max-height: 49dvh;
  overflow-y: scroll;
  width: 100%;
  display: flex;
  gap: 0.3rem;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
}

.form-container .form div {
  width: 100%;
}

.randomize-btn {
  width: 100%;
  padding: 0.5rem;
  background-color: var(--bg-color);
  border: 2px solid #2d3250;
  color: #2d3250;
  font-size: 1rem;
  font-weight: 600;
  position: relative;
  font-family: "Pixelify Sans", sans-serif;
}

.randomize-btn small {
  font-size: 0.5rem;
  font-weight: 300;
  position: absolute;
  white-space: nowrap;
  bottom: 0.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Solway", sans-serif;
}

.form-container.slide-in {
  animation: slideIn 0.5s linear 1 forwards;
}
.form-container.slide-out {
  animation: slideOut 0.5s linear 1 forwards;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

input[type="range"]::-webkit-slider-runnable-track {
  background-color: #000000;
  border-radius: 0.5rem;
  height: 0.2rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -8px;
  background-color: #2d3250;
  border: 1px solid #000000;
  height: 1.1rem;
  width: 1.1rem;
  border-radius: 50%;
}

input[type="range"]::-moz-range-track {
  background-color: #040506;
  border-radius: 0.5rem;
  height: 0.2rem;
}

input[type="range"]::-moz-range-thumb {
  border: none;
  border-radius: 0;
  background-color: #2d3250;
  border: 1px solid #000000;
  height: 1.1rem;
  width: 1.1rem;
  border-radius: 50%;
}

input[type="range"]:focus::-moz-range-thumb {
  border: 1px solid #2d3250;
  outline: 2px solid #2d3250;
  /* outline-offset: 0.125rem; */
}

@keyframes slideIn {
  from {
    right: -15rem;
  }
  to {
    right: 0.5rem;
  }
}
@keyframes slideOut {
  from {
    right: 0.5rem;
  }
  to {
    right: -15rem;
  }
}

@keyframes jump-shaking {
  0% {
    transform: translateX(-50%);
  }
  25% {
    transform: translateX(-50%) translateY(-9px);
  }
  35% {
    transform: translateX(-50%) translateY(-9px) rotate(17deg);
  }
  55% {
    transform: translateX(-50%) translateY(-9px) rotate(-17deg);
  }
  65% {
    transform: translateX(-50%) translateY(-9px) rotate(17deg);
  }
  75% {
    transform: translateX(-50%) translateY(-9px) rotate(-17deg);
  }
  100% {
    transform: translateX(-50%) translateY(0) rotate(0);
  }
}
