@font-face {
  font-family: "Medieval";
  src:
    url("/fonts/Elementary Gothic Bookhand.woff2") format("woff2"),
    url("/fonts/Elementary Gothic Bookhand.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* prevents invisible text during load */
}

/* @font-face {
  font-family: "Tudor";
  src:
    url("/fonts/Boere Tudor.woff2") format("woff2"),
    url("/fonts/Boere Tudor.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
} */

html {
  font-family: "Medieval";
  font-size: 1rem;
  height: 100%;
}

body {
  min-height: 90%;
  display: flex;
  flex-direction: column;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

svg {
  width: 0;
  height: 0;
}

::selection {
  color: white;
  background-color: black;
}

nav ul {
  list-style-type: none;
  display: flex;
  justify-content: space-evenly;
  padding: 0;
}

a {
  cursor: pointer;
}

h1 {
  font-size: 1.5rem;
  cursor: default;
}

header, #controlPanel  {
  filter: url("#textFilter");
}

#sectionTitle {
  text-align: center;
}

hr {
  height: 0.2rem;
  background-color: black;
  border: none;
}

main {
  flex: 1;
  display: flex;
  justify-content: end;
  gap: 2rem;
  margin: 1rem;
  padding: 1rem;
  box-sizing: border-box;
}

#controlPanel {
  flex: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

canvas {
  flex: 1;
  /* flex items don't shrink below the intrinsic size of their content
     - signed Claude */
  min-width: 0;
  border: 0.2rem solid #000000;
}

canvas.hidden {
  display: none;
}

canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 30px solid black;
  filter: url("#textFilter");
  pointer-events: none;
  z-index: -1; /* or 1, depending on whether you want it above content */
}

@media (max-width: 900px) {
  main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  canvas {
    align-self: stretch;
  }
}

#sliderPanel,
#checkboxPanel {
  /* width: max-content; */
  display: grid;
  grid-template-columns: 15ch 1fr;
  justify-items: start;
  align-items: center;
}

#sliderPanel > *,
#checkboxPanel > * {
  display: flex;
  align-items: center;
  height: 2.5rem;
  transition:
    height 300ms ease,
    opacity 300ms ease;
  overflow: hidden; /* used so the contents get covered by elements directly below when hiding */
}

#checkboxPanel > input[type="checkbox"] {
  cursor: pointer;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 0.2rem solid black;
  border-radius: 25%;
  /* border-style: outset; */
  padding: 0.4rem;
  background: white;
  /* center the checkmark element */
  display: grid;
  place-content: center;
  transition: 200ms transform ease-in-out;
}

#checkboxPanel > input[type="checkbox"]:hover,
#checkboxPanel > input[type="checkbox"]:active {
  transform: scale(1.2);
}

#checkboxPanel > input[type="checkbox"]::before {
  font-family: "Medieval";
  content: "x";
  font-size: 0.9rem;
  transform: scale(0);
  transition: 300ms transform ease-in-out;
  padding-bottom: 0.5rem;
}

#checkboxPanel > input[type="checkbox"]:checked::before {
  transform: scale(1);
}

#sliderPanel > .hidden {
  height: 0;
  opacity: 0;
}

input[type="range"] {
  margin: 0;
  min-width: 200px;
  /* remove OS specific styling */
  -webkit-appearance: none;
  appearance: none;
  accent-color: transparent;
}

/* For Chrome, Safari, Opera, and Edge */
input[type="range"]::-webkit-slider-runnable-track {
  background-color: black;
  height: 0.25rem;
  border-radius: 1rem;
}

input[type="range"]::-webkit-slider-thumb {
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px; /* Centers the thumb */
  background-color: white;
  height: 1rem;
  width: 1rem;
  border: 0.2rem solid black;
  border-radius: 50%;
  transition:
    height 300ms ease,
    width 300ms ease,
    background-color 300ms ease;
}

/* For Firefox */
input[type="range"]::-moz-range-track {
  background-color: black;
  height: 0.25rem;
  border-radius: 1rem;
}

input[type="range"]::-moz-range-thumb {
  cursor: grab;
  background-color: white;
  height: 0.75rem;
  width: 0.75rem;
  border: 0.2rem solid black;
  border-radius: 50%;
  transition:
    height 300ms ease,
    width 300ms ease,
    background-color 300ms ease;
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:active::-moz-range-thumb,
input[type="range"]:active::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
}

input[type="range"]:active::-moz-range-thumb,
input[type="range"]:active::-webkit-slider-thumb {
  background-color: black;
  cursor: grabbing;
}
