html {
  font-family: sans-serif;
  font-size: 62.5%;
}

body {
  background: var(--primary-dark-bg);
  color: var(--primary-color);
  font-size: 2rem;
  text-rendering: optimizeSpeed;
  margin: auto;
  text-align: center;
}

header {
  text-align: center;
}

header img {
  width: 18rem;
  height: 18rem;
}

main {
  margin: auto 1rem;

  section {
    background-color: var(--primary-light-bg);
    padding: 2rem;
    padding-top: 1rem;
    border-radius: var(--border-radius);
  }

  section ~ section {
    margin-top: 1rem;
  }
}

h1,
h2,
.capitalize {
  text-transform: capitalize;
}

span {
  text-transform: none;
}

details {
  margin-left: 2rem;

  > ul {
    margin-left: 1rem;
  }
}

a {
  color: var(--text-link);
}

dl,
ul {
  text-align: start;
}

dt {
  margin-top: 1.8rem;
  font-weight: bold;
}
dt:first {
  margin-top: 0;
}

dt,
dd {
  text-transform: capitalize;
}

dd {
  font-style: italic;
  margin-left: 0;

  > p {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem 1rem;

    > a {
      text-transform: lowercase;
    }
  }
}


ul {
  padding-left: 2rem;
  margin-left: 2rem;
}

li {
  text-transform: none;
}

p {
  margin: 2rem auto;
}

table {
  width: 100%;
}

td {
  display: inline-block;
  padding: 2rem 1rem;
  background: var(--primary-lighter-bg);
  width: calc(100% - 4rem);
  height: 100%;
  min-height: 16rem;
  text-align: center;
  border-radius: var(--border-radius);

  > img {
    width: 9rem;
    height: 9rem;
    margin: 0 auto 1rem;
    display: block;
  }

  > p {
    margin: 2rem auto 0;
  }
}

td:hover {
  box-shadow: 5px 5px 5px light-dark(#ccc, #000);
}

td ~ td {
  margin: 1rem 0 0 0;
}

li::first-letter,
p::first-letter,
td::first-letter {
  text-transform: uppercase;
}

img {
  width: 100%;
  max-width: 50rem;
  display: block;
  margin: 0 auto;
}

footer {
  font-style: italic;
  font-size: 1.8rem;
  text-align: center;
  text-transform: capitalize;
  margin: 2rem 0;
}

/* switch */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--primary-light-bg);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--secondary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--secondary-color);
}

input:checked + .slider:before {
  -webkit-transform: translateX(14px);
  -ms-transform: translateX(14px);
  transform: translateX(14px);
}

/* general */
:root {
  color-scheme: dark light;

  &:has(#color-mode:not(checked)) {
    color-scheme: light;
  }
  &:has(#color-mode:checked) {
    color-scheme: dark;
  }

  --primary-dark-bg: light-dark(#DDDDDD, #333333);
  --primary-light-bg: light-dark(#EEEEEE, #444444);
  --primary-lighter-bg: light-dark(#FBFBFB, #555555);
  --primary-color: light-dark(#000000, #FFFFFF);
  --text-link: light-dark(#0069C2, #8CB4FF);
  --secondary-color: #00ff00;
  --border-radius: 10px;
}

/* screen specific configuration */
@media only screen and (min-width: 1000px) {
  body {
    max-width: 100rem;
    text-align: start;
  }

  header img {
    width: 16rem;
    height: 16rem;
  }

  section > p {
    margin: 1rem 2rem;
  }

  td {
    max-width: calc(50% - 2.5rem);
    min-height: 20rem;
    margin: 1rem 0 0 2rem;
    padding: 2rem;
    box-sizing: border-box;
  }
  td ~ td {
    margin: 1rem 0 0 2rem;
  }
  td:nth-child(2n) {
    margin: 1rem 1rem 0 1rem;
  }

  footer {
    font-size: 1.6rem;
  }
}
@media only screen and (min-width: 1600px) {
  body {
    font-size: 1.6rem;
    max-width: 140rem;
  }

  main {
    margin: auto;
  }

  td {
    max-width: calc((100%/3) - 1rem -(1rem/3));
    margin: 1rem 0 0 1rem;
  }
  td:nth-child(2n),
  td ~ td {
    margin: 1rem 0 0 1rem;
  }

  footer {
    font-size: 1.2rem;
  }
}

/* printing */
@media print {
  color-scheme: light;

  a {
    color: var(--primary-color);
  }

  #color-mode-switch,
  footer {
    display: none;
  }
}
