/* Colors */
:root {
  color-scheme: light dark;
  --fg-col: black;
  --bg-col: white;
  --mid-col: dimgray;
  --err-col: lightcoral;
}

/* iOS dark mode */
@media (prefers-color-scheme: dark) {
:root {
  --fg-col: white;
  --bg-col: black;
  --mid-col: gray;
  --err-col: lightcoral;
  }
}

/* Globals */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: 0;
  font-family: monospace;
  font-size: 18px;
  line-height: 24px;
  color: var(--fg-col);
  background-color: var(--bg-col);
  transition: color 200ms;
  transition: background-color 200ms;
}

/* Layout - including 'sticky' footer */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  margin-top: 120px;
  padding: 0 10px;
}

footer {
  flex-shrink: 0;
  font-size: 14px;
  text-align: center;
  padding-bottom: 10px;
}

footer > a {
  font-size: 14px;
}

/* Header */
h1 {
  text-align: center;
  font-size: 50px;
  margin-bottom: 30px;
}

/* Icon */
svg {
  display: block;
  margin: 20px auto;
  color: var(--fg-col);
  fill: currentColor;
}

/* Links */
a {
  color: var(--fg-col);
}

a:visited {
  color: var(--fg-col);
}

#result, #target, #return {
  text-align: center;
}

#result {
  margin-top: 50px;
  margin-bottom: 15px;
}

#result > a {
  font-size: 28px;
  font-weight: bold;
}

#target {
  max-height: 250px;
  overflow: hidden;
  margin-bottom: 60px;
}

#target > a {
  font-size: 14px;
}

/* Form */
label, input, button {
  display: block;
  width: 90%;
  margin: 0 auto;
}

input {
  padding: 5px 10px;
  margin-bottom: 20px;
  border: 1px solid var(--fg-col);
  border-radius: 5px;
  border-style: solid;
}

button {
  font-weight: bold;
  padding: 10px 10px;
  border: 1px solid black;
  border-radius: 50px;
  color: var(--bg-col);
  border-color: var(--fg-col);
  background-color: var(--fg-col);
}

button:hover {
  border-color: var(--mid-col);
  background-color: var(--mid-col);
}

/* Special text */
#desc {
  margin-bottom: 30px;
}

#err {
  min-height: 35px;
}

#err > p {
  text-align: center;
  color: var(--err-col);
}

/* Media Queries */
/* Reduce spacing if insufficient height */
@media only screen and (max-height: 500px) {
  main {
    margin-top: 0px;
  }

  svg {
    margin-top: 0px;
  }

  #result {
    margin-top: 100px;
  }

  #desc {
    margin-bottom: 5px;
  }
}
