/* CSS Reset */

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  /* set relative sizing to go off of the border box, not the content box. explanation: https://www.joshwcomeau.com/css/custom-css-reset/ */
  box-sizing: inherit;
}

* {
  /* remove default margin */
  margin: 0;
  /* remove default padding */
  padding: 0;
}

body {
  /* disable subpixel antialiasing on macs https://www.joshwcomeau.com/css/custom-css-reset/#four-font-smoothing-5 */
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  /* convert media elements from inline to block */
  display: block;
  /* prevent media elements from spilling out of container */
  max-width: 100%;
}

input, button, textarea, select {
  /* prevent input areas from having their own separate style */
  font: inherit;
}

a {
color: inherit;
}

h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; }

/* stop browsers from adding quotes around quote elements */
q:before,q:after { content:''; }

/* ------------ */

/* Light theme colors */
body.light-theme {
  --text-for-light: #313541;
  --bkg-for-light: #f2f0f2;
  --box-for-light: lightgrey;
}

/* Dark theme colors */
body.dark-theme {
  --text-for-dark: #eee;
  --bkg-for-dark: #06101c;
  --box-for-dark: #364c67;
}

/* Styles for users who prefer dark mode at the OS level */
@media (prefers-color-scheme: dark) {
  /* defaults to dark theme */
  body {
    --text-color: var(--text-for-dark);
    --bkg-color: var(--bkg-for-dark);
    --box-color: var(--box-for-dark);
    --contrast: var(--bkg-for-light);
  }
  /* Override dark mode with light mode styles if the user decides to swap */
  body.light-theme {
    --text-color: var(--text-for-light);
    --bkg-color: var(--bkg-for-light);
    --box-color: var(--box-for-light);
    --contrast: var(--bkg-for-dark);
  }
}

nav {
  -moz-border-radius: .5rem;
  -webkit-border-radius: .5rem;
  border-radius: .5rem;
  background-color: var(--box-color);
  padding: 0.5rem;
  height: 3rem;
  width: 45%;
  min-width: 40rem;
  margin: 1rem auto 0 auto;
  display: flex;
  font-size: 2rem;
  align-items: center;
}

.title {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 1em;
}

nav a#about {
  flex-basis: 2rem;
}

.about {
  font-size: 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0.1rem solid var(--text-color);
  width: 2rem;
  height: 2rem;
  text-align: center;
  padding-right: 0.04rem
}

.back {
  flex-basis: 1em;
  display: grid;
  place-content: center;
}

#theme-button {
  flex-basis: 1em;
}

#sun-icon, #moon-icon, .back {
  width: 1em;
  height: 1em;
}

.container {
  width: 45%;
  min-width: 40rem;
  margin-inline: auto;
  min-height: 100%;
}

body {
  margin: 0px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  background-color: var(--bkg-color);
  font-family: "Helvetica", "Arial", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

canvas {
  display: block;
  width: 100%;
  height: var(width);
  margin: auto;
  padding: 0;
  border: none;
}

#key {
  display: flex;
  flex-wrap: wrap;
  font-size: 1.5rem;
  gap: 0.3rem;
  height: fit-content;
  margin: 0.75rem;
  justify-content: flex-start;
}

#key p {
  max-width: 15rem;
  margin-right: 2rem;
}

#key p:last-child {
  margin-right: 0;
  margin-left: auto;
}

.key-item {
  display: grid;
  place-content: center;
  flex-shrink: 0;
}

.key-item canvas {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin: 0rem;
}

.key-item canvas#highlighted-quake-key {
  background-color: red;
}

.key-item canvas#normal-quake-key {
  background-color: #4585c6;
}

#key p {
  display: flex;
  justify-content: center;
  align-content: center;
  flex-direction: column;
}

#feed p {
  background-color: var(--box-color);
  padding: 0.5rem;
  border: 0.3rem solid var(--box-color);
  border-radius: 0.5rem;
  border-color: #4585c6;
  cursor: pointer;
  font-size: 1.5rem;
  margin: 0.75rem;
}

#feed .highlight {
  border-color: red;
}

footer {
  display: flex;
  position: relative;
  bottom: 0;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  margin-bottom: 1rem;
}

#disclaimer {
  max-width: 50%;
  font-size: 1.5rem;
  line-height: 2rem;
  margin: auto auto auto auto;
  text-align: center;
  padding: 1rem
}

#disclaimer p {
  text-align: left;
  margin-bottom: 0.5rem;
}

#disclaimer a {
  text-decoration: underline;
}

#disclaimer a:link {
  color: #0107c7;
}

#disclaimer a:visited {
  color: #6500c3;
  color: #0107c7;
}

#disclaimer h2 {
  font-size: 1.75rem;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.5rem;
}

#disclaimer::backdrop {
  background-color: #06101c;
}

#disclaimer button#disclaimer-button {
  font-size: 1.5rem;
  text-align: center;
}

.about-wrapper {
  width: 45%;
  min-width: 40rem;
  font-size: 2rem;
  line-height: 3rem;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
}

.about-wrapper a {
  text-decoration: underline;
}

.about-wrapper p {
  margin-bottom: 1rem;
}

/* Mobile */

/* TODO: Change to "max-width" after I have gotten it looking right on mobile */
@media only screen and (max-device-width: 768px) {
  .container {
    width: 90%;
    min-width: unset;
  }

  #feed p {
    font-size: 3rem;
  -moz-border-radius: 1rem;
  -webkit-border-radius: 1rem;
  border-radius: 1rem;
    margin: 1rem;
  }

  nav {
    font-size: 4rem;
    height: 5.5rem;
    margin: 2rem 2rem 0 2rem;
    min-width: unset;
    padding: 1rem;
    border-radius: 1rem;
  }

  .about-wrapper, nav {
    width: 90%;
    min-width: unset;
    margin-left: auto;
    margin-right: auto;
  }

  .about-wrapper p {
    font-size: 3.5rem;
    margin-top: 3rem;
    line-height: 1.5em;
  }

  #disclaimer {
    font-size: 3rem;
    line-height: 4rem;
    max-width: 80%;
    padding: 2rem;
  }

  #disclaimer h2 {
    font-size: 4rem;
    padding-bottom: 1rem
  }

  #disclaimer p {
    padding-bottom: 2rem;
  }

  #disclaimer button#disclaimer-button {
    font-size: 3rem;
  }

  footer {
    margin-top: 1rem;
    margin-bottom: 2rem;
    font-size: 2rem;
  }

  #key {
    font-size: 2.5rem;
    gap: 1rem;
    margin: 2rem;
  }

  .key-item canvas {
    width: 4rem;
    height: 4rem;
  }

  .about {
    font-size: 3rem;
    width: 4rem;
    height: 4rem;
    border-width: 0.2rem;
  }
}
