@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");

* {
  line-height: 1.5;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-weight: normal;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

:root {
  --max-width: 900px;
  --primary-color: #4ad;
  --secondary-color: #228;
  --tertiary-color: #fe9;
  --background-color: #d5dfe4;
  --text-color: #111;
  --h2-color: var(--text-color);
  --h3-color: var(--primary-color);
  --header-background: var(--primary-color);
  --header-text-color: #fff;
  --footer-text-color: #888;
  --link-color: var(--secondary-color);
  --link-hover-color: var(--tertiary-color);
  --section-border-color: var(--secondary-color);
  --button-background: var(--primary-color);
  --button-hover-background: var(--secondary-color);
  --border-radius: 1.25rem;
  --shadow: 2px 3px 5px #000b;
}

body,
#theme-toggle {
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  padding: 1.25rem;
}

body.dark-mode {
  --background-color: #252b31;
  --text-color: #eee;
  --h2-color: #eee;
  --h3-color: var(--tertiary-color);
  --header-background: var(--secondary-color);
  --link-color: var(--primary-color);
  --section-border-color: var(--primary-color);
  --button-background: var(--secondary-color);
  --button-hover-background: var(--primary-color);
  --border-color: #999;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--header-background);
  color: var(--header-text-color);
  padding: 1.25rem 0;
  margin: 0 auto 1.8rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: var(--max-width);
}

.logo {
  width: 75%;
  max-width: 425px;
  height: auto;
  margin: 0 auto;
  display: block;
}

nav {
  margin-top: 1.5rem;
}

nav a {
  color: var(--header-text-color);
  font-size: 1.4rem;
  margin: 0 2rem;
}

nav a:hover {
  text-decoration: underline;
  color: var(--tertiary-color);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  background-color: #f8f8f8;
  padding: 1.8rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

body.dark-mode main {
  background-color: #181818;
  box-shadow: var(--shadow);
}

h1 {
  color: var(--h1-color);
  font-size: 1.7rem;
  margin-bottom: 0.9rem;
}

h2 {
  position: relative;
  color: var(--h2-color);
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}
/* gradient line */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    to right,
    var(--section-border-color) 0%,
    transparent 100%
  );
}

h3 {
  color: var(--h3-color);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 1rem 0 0;
}

footer p,
#theme-toggle {
  font-size: 1rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

p,
li,
label,
label a {
  font-family: "Open Sans", sans-serif;
  font-size: 1.15rem;
  text-wrap: balance;
}

p {
  line-height: 1.5;
  max-width: 70ch;
  margin-bottom: 1rem;
}

b,
strong,
table thead th {
  font-weight: 500;
  color: var(--link-color);
}

code {
  font-weight: bold;
  margin: 0.35rem;
  color: #2b8;
}

body.dark-mode code {
  color: #3f9;
}

ul {
  font-size: 1rem;
  list-style-type: square;
  padding-left: 0.9rem;
  margin-left: 0.9rem;
  color: var(--h2-color);
}

li {
  display: list-item;
  list-style-position: outside;
  margin-top: 0.6rem;
  padding-left: 0.3rem;
}

ul ul li {
  list-style-type: circle;
}

input[type="checkbox"] {
  accent-color: var(--h3-color);
}

label {
  display: inline-flex;
  line-height: 1.15;
  align-items: center;
  margin-bottom: 1rem;
  cursor: pointer;
}

label .task-checkbox {
  margin-left: 0.6rem;
  margin-right: 1.25rem;
}

.task-checkbox {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.video-responsive {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 500px;
  max-height: 280px; /* in case aspect ratio is ignored */
  max-width: 100%;
  margin: 0 2.75rem 2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

button,
.button {
  background-color: var(--button-background);
  border: none;
  padding: 0.6em 0.9em;
  border-radius: var(--border-radius);
  cursor: pointer;
  color: #eee;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

footer {
  color: var(--footer-text-color);
  text-align: center;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--footer-text-color);
}

.footer a {
  color: inherit;
  transition: none;
}

.footer a:hover {
  color: inherit;
}

footer p {
  margin: 0 auto;
}

.hero-image {
  width: 100%;
  max-width: 1000px;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 1.9rem;
  box-shadow: var(--shadow);
  display: block;
}

.callout {
  text-align: justify;
  background-color: var(--background-color);
  margin: 2rem auto;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  font-size: 1.55rem;
  font-weight: 300;
}

.theme-toggle-container {
  position: fixed;
  bottom: 0.35rem;
  right: 0.35rem;
  z-index: 1000;
}

#theme-toggle {
  color: #eee;
  background-color: var(--button-background);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

a:focus {
  outline: 2px solid var(--tertiary-color);
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 700px) {
  * {
    text-wrap: balance;
  }
  nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  h3 {
    font-size: 1.2rem;
  }
  label {
    margin-bottom: 1.5rem;
  }
  .video-responsive {
    margin: 0 auto 2rem;
  }
  .callout {
    font-size: 1.15em;
    text-align: left;
  }
}
