:root {
  --border-radius: 5px;
  --accent-color: teal;
  --accent-color-light: #a4f0f0;
  --body-font: system-ui, sans-serif;
  --mono-font: ui-monospace, Menlo, Monaco, "Consolas", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
}

::selection {
  color: white;
  background-color: var(--accent-color);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body-font);
  text-align: center;
  margin: 35px auto 25px auto;
  max-width: 720px;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: clamp(1.5rem, 10vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 0;
}

h2 {
  font-weight: 500;
}

p {
  letter-spacing: 0.15px;
  margin-bottom: 0.6em;
}

img, .box {
  border-radius: var(--border-radius);
}

#target {
  border: 2px dashed #ddd;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.5em;
  line-height: 1.5em;
  padding: 0.8em;
  margin-top: 0.5em;
  user-select: none;
  transition: 0.1s;
}

#target:hover {
  transform: scale(1.02);
}

label {
  color: #aaa;
  pointer-events: none; /* prevent system file dialogue to be accidentally triggered twice since label overlaps with input */
}

.row {
  margin: 20px 0;
  display: flex;
}

.cell {
  box-sizing: border-box;
  width: 50%;
}

.image img {
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease;
  user-select: none;
  max-width: 100%;
}

.image img:active {
  cursor: zoom-out;
  transform: scale(1.4);
}

.color ul {
  margin: 0;
  padding: 10px;
  list-style-type: none;
  font-family: var(--mono-font);
  line-height: 1.65;
}

.box {
  height: 80px;
}

button, a {
  border: none;
  font-size: inherit;
  cursor: pointer;
  transition: 0.1s;
}

a {
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: none;
}

button {
  font-family: var(--body-font);
  background-color: transparent;
  padding: 0;
  opacity: 0.8;
}

button:hover {
  opacity: 1;
}

aside {
  display: flex;
  gap: 0.75em;
  position: fixed;
  bottom: 15px;
  left: 15px;
}

#footer {
  margin: 40px 0;
}

#upload {
  position: absolute;
  left: -9999px;
}

/*dark mode*/

@media screen and (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
  }

  :not(#target, label, .box, a) {
    color: #ddd;
  }

  a {
    font-weight: 400;
    color: var(--accent-color-light);
  }

  a[href="about"] {
    color: #ddd;
    opacity: 0.8;
  }

  #target {
    border: 2px dashed #646464;
  }

  .color ul {
    opacity: 0.9;
  }
}

@media screen and (prefers-color-scheme: light) {
  #about-btn {
      font-weight: 400;
      color: inherit;
      opacity: 0.8;
  }
}

/*reduced motion*/

@media screen and (prefers-reduced-motion: reduce) {
  #target:hover {
    transform: revert;
    opacity: 0.8;
  }
}

@media screen and (max-width: 700px) {
  body {
    padding: 0 30px;
  }
  
  .row {
    flex-direction: column;
    align-items: center;
  }
}

@media screen and (min-width: 700px) {
  .color {
    padding: 0 0 0 20px;
  }
}