* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  user-select: none;
}

html {
  scroll-behavior: smooth;
}
body {
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Nested selection */

header {
  width: 100%;
  height: 5.5rem;
  position: fixed;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f3f7f8;
  padding: 0.2rem 0.8rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
header > h1 > a {
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 1.7rem;
  text-decoration: none;
  color: #232222;
}

/* Nested and class selector */

button {
  padding: 0;
  border: none;
  background: none;
}
.nav-close {
  display: block;
  margin-inline-start: auto;
  margin-block-end: 8rem;
}

/* Select adjacent sibling using + with attribute select with condition*/
.nav-open[aria-expanded="true"] + .nav-menu {
  translate: 0;
}
.nav-close img,
.nav-open img {
  height: 2.5rem;
  transition: transform ease-in-out 50ms;
}
.nav-close img:active,
.nav-open img:active {
  transform: scale(0.96);
}
.nav-menu > ul {
  padding: 0 0.5rem;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  list-style: none;
  gap: 4;
}
.nav-item {
  height: 2.5rem;
  width: 6.5rem;
  border-radius: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6f01ec;
  box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform ease-in-out 200ms;
}

/* pseudo selectors */
.nav-item:hover,
.nav-item:focus {
  background-color: #5808b3;
  transform: scale(1.03);
}
.nav-item:active {
  transform: scale(0.93);
}
.nav-item a {
  font-weight: 400;
  color: rgb(255, 255, 255);
  text-decoration: none;
}

#home {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: end;
  justify-content: center;
}
#home > img {
  position: relative;
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}

/* Glassmorphic bg */
.home-content {
  background: rgba(52, 50, 53, 0.272);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5.1px);
  -webkit-backdrop-filter: blur(5.1px);
  height: 58%;
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  padding: 2rem;
  margin-bottom: 6rem;
  transition: all ease 300ms;
}
.home-content > h2 {
  color: #f3f7f8;
  font-size: 2rem;
  line-height: 2.3rem;
  margin-bottom: 0.8rem;
}
.home-content > p {
  color: #ffffffe0;
}
.home-content > button {
  margin-top: 3rem;
  color: #f3f7f8;
  border-radius: 0.3rem;
  border-radius: 0.3rem;
  height: 2.5rem;
  width: 10rem;
  border: 2px solid white;
  cursor: pointer;
  margin-block-start: auto;
  transition: transform ease 200ms;
}

.home-content > button:hover {
  background-color: #6f01ec;
}
.home-content > button:active {
  transform: scale(0.96);
}

#courses,
#offerings,
#instructors {
  min-height: 100vh;
  width: 100%;
  background-color: #f3f7f8;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding-bottom: 2rem;
}
#instructors {
  color: white;
  background-color: #661eab;
}
.content {
  margin-top: 2rem;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}
.content > h2 {
  font-size: 2.5rem;
  line-height: 4rem;
  text-align: center;
}
.content > h2 > span {
  color: #661eab;
}

.content > p {
  margin-top: 0.4rem;
  font-size: 1.3rem;
  text-align: center;
  padding: 0 0.4rem;
}

.cards {
  margin-top: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 95%;
  flex-wrap: wrap;
  padding: 1rem 0;
  gap: 2rem;
}
.courses-card,
.instructor-card,
.offering-card {
  height: 25rem;
  width: 20rem;
  color: #f3f7f8;
  border-radius: 1rem;
  background-color: #661eab;
  padding-bottom: 1rem;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: rgb(173, 118, 221) 2px 8px 30px;
  transition: transform ease-in-out 200ms;
  cursor: pointer;
}

.courses-card:hover,
.instructor-card:hover {
  transform: scale(1.05);
}
.courses-card > img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
}
.courses-card > h2 {
  margin-top: 1rem;
  text-align: center;
  font-weight: 500;
  line-height: 1.5rem;
  padding: 0.4rem;
}
.courses-card > p {
  text-align: center;
  padding: 0.4rem;
  font-size: 0.8rem;
  color: #ffffffd5;
}
.courses-card > button {
  color: #f3f7f8;
  border: 2px solid #f3f7f8;
  height: 2.5rem;
  width: 10rem;
  margin-top: auto;
  border-radius: 0.5rem;
  transition: all ease-in 200ms;
  cursor: pointer;
}
.courses-card > button:hover {
  transform: scale(1.03);
  background-color: #5808b3;
}
.courses-card > button:active {
  transform: scale(0.9);
  background-color: #5808b3;
}

#span-instruct {
  color: rgb(78, 228, 121);
}
.instructor-card {
  min-height: 12rem;
  height: auto;
  width: 30rem;
  color: #333;
  background-color: #f3f7f8;
  padding: 1rem;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-around;
  width: 100%;
  height: 35%;
}
.card-title > h3 {
  line-height: 1rem;
}
.card-title > p {
  font-size: 0.8rem;
}
#github-logo {
  height: 2.4rem;
}
.card-about {
  margin-top: 1rem;
  font-size: 0.8rem;
}
.card-avatar {
  height: 5rem;
  width: 5rem;
  overflow: hidden;
  border-radius: 100%;
  box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px 0px inset,
    rgba(0, 0, 0, 0.15) 0px -36px 30px 0px inset,
    rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset, rgba(0, 0, 0, 0.06) 0px 2px 1px,
    rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px,
    rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
}
.card-avatar > img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
footer {
  color: white;
  background-color: #232222;
  height: 14vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offering-card {
  align-items: start;
  height: 13rem;
  width: 100%;
  padding: 0.8rem 1rem;
  box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px 0px inset,
    rgba(0, 0, 0, 0.15) 0px -36px 30px 0px inset,
    rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset, rgba(0, 0, 0, 0.06) 0px 2px 1px,
    rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px,
    rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
}

.offering-card:hover {
  transform: translateY(-0.5rem);
}

.offering-icon {
  height: 2rem;
  width: 2rem;
  margin-bottom: 0.5rem;
}
.offering-title {
  font-size: 1.25rem;
}
.offering-description {
  font-size: 0.9rem;
  margin-top: 1rem;
}
/* Media queries for screen sizes */
/* Mobiles */
@media (max-width: 720px) {
  .nav-menu {
    z-index: 5;
    position: fixed;
    inset: 0;
    background-color: #f3f7f8;
    padding: 1.5rem;
    translate: 100vw 0;
    transition: translate ease-in-out 400ms;
  }
  .nav-menu > ul {
    flex-direction: column;
    justify-content: start;
    gap: 1.2rem;
  }
  .nav-item {
    height: 2.8rem;
    width: 8rem;
  }
  nav {
    height: 100%;
    width: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Tablets */
@media (min-width: 721px) and (max-width: 1024px) {
  .nav-close,
  .nav-open {
    display: none;
  }
  #home {
    justify-content: start;
  }
  .home-content {
    height: 54%;
    width: 52%;
    padding: 3rem;
    margin-bottom: 4rem;
    margin-left: 4rem;
  }
  #offerings .cards {
    flex-wrap: wrap;
    flex-direction: row;
  }
  .offering-card {
    width: 20rem;
  }
}

/* Desktops */
@media (min-width: 1025px) {
  .nav-close,
  .nav-open {
    display: none;
  }
  #home {
    justify-content: start;
  }
  .home-content {
    height: 40%;
    width: 50%;
    margin-left: 4rem;
  }
  #offerings .cards {
    flex-wrap: wrap;
    flex-direction: row;
  }
  .offering-card {
    width: 20rem;
  }
}
