* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
}

header {
  background: #f4f6fb;
  position: fixed;
  top: 0;
  width: 100%;
  height: 120px;
  z-index: 999;
}

main {
  margin-top: 120px;
  /* Only a gap. Nothing is pinned over the end of the page at this width, so
     nothing has to be reserved for it — see the footer below. */
  margin-bottom: 20px;
  width: 100%;
}

/* Mobile first, and on a phone the footer is simply the end of the page.
   It used to be pinned to the bottom at a fixed 80px, which the copyright line
   overflowed by half as much again once it wrapped to three lines: the last of
   it, the version included, was off the bottom of the bar and unreadable. A bar
   that cannot hold its own text is not worth a quarter of a phone screen — so
   below 768px it scrolls with everything else, and grows to whatever it holds. */
footer {
  width: 100%;
  padding: 20px;
  background: #111;
  color: white;
  text-align: center;
}

footer p {
  text-align: left;
}

/* There to be found rather than read: it answers "which version is live?" for
   whoever goes looking, and says nothing to anybody else. */
.site-version {
  opacity: 0.55;
  font-size: 0.85em;
  margin-left: 0.5em;
  white-space: nowrap;
}

body {
  background: #f4f6fb;
  color: #333;
  transition: 0.3s;
  position: absolute;
  margin-bottom: 60px;
}

/* DARK MODE */

.dark {
  background: #121212;
  color: #eee;
}

/* NAVBAR (mobile first) */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
}

.nav-logo {
  height: 75px;
}

/* MOBILE MENU DEFAULT */
.menu {
  display: none;
  flex-direction: column;
  list-style: none;
  background: white;
  position: absolute;
  top: 60px;
  right: 5%;
  padding: 20px;
  width: 200px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.menu.active {
  display: flex;
}

.menu li {
  margin: 10px 0;
}

.menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.menu a:hover {
  color: #2563eb;
}

.hamburger {
  display: block;
  font-size: 26px;
  cursor: pointer;
}

/* HEADINGS */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-align: left;
}

/* HERO (mobile first) */
.hero {
  height: 450px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("../images/bookshelf-superJumbo.png");
  background-size: cover;
  padding: 20px;
}

.hero h1 {
  font-size: 32px;
  margin-bottom: 15px;
  text-align: center;
}

.hero h2 {
  font-size: 28px;
  margin-bottom: 15px;
  text-align: center;
}

.hero h3 {
  font-size: 28px;
  margin-bottom: 15px;
  text-align: center;
}

.hero p {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
}

p {
  text-align: justify;
}

/* SECTIONS */
section {
  padding: 30px 5%;
  text-align: center;
  scroll-margin-top: 100px;
}

section h2 {
  font-size: 26px;
  margin-bottom: 5px;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 500px);
  gap: 20px;
  justify-content: center;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  margin-top: 18px;
  object-fit: cover;
}

.noselect {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.hidden {
  display: none;
}

.image-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
}

td {
  text-align: left;
  vertical-align: top;
}

td:first-child {
  font-weight: bold;
}

.button {
  padding: 12px 25px;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

/* ========================= */
/* TABLET (>= 768px) */
/* ========================= */
@media (min-width: 768px) {
  main {
    margin-top: 100px;
    /* Room for the pinned footer below, so the last section is not covered by
       it. These two belong together: change one and check the other. */
    margin-bottom: 100px;
  }

  /* Wide enough for the line to fit, so the bar goes back to being pinned to
     the bottom of the window. min-height rather than height: it can still hold
     a second line at an unusual text size instead of hiding it. */
  footer {
    position: fixed;
    bottom: 0;
    min-height: 80px;
  }

  body {
    box-sizing: border-box;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero h2 {
    font-size: 35px;
  }

  .hero p {
    font-size: 18px;
  }
}

/* ========================= */
/* DESKTOP (>= 1024px) */
/* ========================= */
@media (min-width: 1024px) {
  main {
    width: 100vw;
  }

  nav {
    padding: 18px 5%;
  }

  .menu {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    box-shadow: none;
    width: auto;
    padding: 0;
  }

  .menu li {
    margin-left: 25px;
  }

  .hamburger {
    display: none;
  }

  .hero {
    height: 600px;
  }

  .hero h1 {
    font-size: 55px;
  }

  .hero h2 {
    font-size: 42px;
  }

  .hero p {
    font-size: 20px;
  }
}
