:root {
  /* Background colors */
  --color-bg-header: hsla(210, 57%, 11%, 0.5);
  --color-bg-main: hsl(210, 57%, 11%);
  --color-bg-about: hsl(210, 57%, 15%);
  --color-bg-story: hsl(210, 57%, 15%);
  --color-bg-challenges: hsl(210, 57%, 15%);

  /* Text colors */
  --color-text-main: hsl(0, 0%, 88%);
  --color-text-cta: hsl(0, 0%, 10%);

  /* Accent colors */
  --color-accent-cyan: hsl(188, 100%, 50%);
  --color-accent-cyan-hover: hsl(188, 100%, 30%);
  --color-accent-cyan-active: hsl(194, 100%, 10%);
  --color-accent-orange: hsl(33, 100%, 65%);

  /* Challenges colors */
  --color-bg-challenges-preview: hsl(0 0% 88%);
  --color-bg-challenges-content: hsl(0 0% 96%);
  --color-challenges-title: hsl(0 0% 10%);
  --color-challenges-text: hsl(0 0% 45%);

  /* Level colors */
  --color-level-newbie: rgb(7, 182, 213);
  --color-level-junior: rgb(52, 211, 153);
  --color-level-intermediate: rgb(251, 191, 35);
  --color-level-advanced: rgb(249, 114, 22);

  /* Tag colors */
  --color-tag-html: hsl(14, 70%, 65%);
  --color-tag-css: hsl(220, 60%, 70%);
  --color-tag-js: hsl(50, 70%, 65%);
  --color-tag-api: hsl(280, 50%, 70%);
}

html {
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
}

.container {
  display: flex;
  justify-content: center;
  min-width: 360px;
  color: var(--color-text-main);
  background-color: var(--color-bg-main);
}

.inner-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}

/* Header */
header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  width: 100%;
}

.header__logo-svg {
  height: 50px;
  width: 50px;
  color: var(--color-accent-cyan);
}

/* Nav */
body.menu-open {
  overflow: hidden;
  height: 100dvh;
}

.nav {
  position: relative;
}

.nav__open {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-main);
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 0.6rem;
  padding: 0 0.5rem;
  z-index: 100;
  text-shadow: 0 0 2px hsla(0, 0%, 0%, 0.6), 1px 1px 3px hsla(0, 0%, 0%, 0.4);
}

.nav__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2rem;
  height: 2rem;
  background-color: transparent;
  border-style: none;
  cursor: pointer;
}

.nav__wrapper {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  background-color: var(--color-bg-main);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

.nav__wrapper.hidden {
  transform: translateX(100%);
}

.nav__wrapper:not(.hidden) {
  transform: translateX(0);
}

.nav__heading {
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: underline;
  margin-bottom: 5rem;
  color: var(--color-text-main);
}

.nav__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nav__list-item {
  margin-bottom: 1rem;
}

.nav__list-link {
  font-size: 1.3rem;
  color: var(--color-text-main);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.nav__list-link:hover {
  color: var(--color-accent-cyan);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  z-index: 0;
}

.hero__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero__portrait {
  width: 250px;
  height: 250px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--color-accent-cyan);
  margin-bottom: 2rem;
  box-shadow: 0 4px 8px hsla(0, 0%, 0%, 0.2);
}

.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 30%;
  filter: contrast(1.05) brightness(1.05);
}

.hero__heading {
  font-size: 1.8rem;
  line-height: 1.3;
  color: var(--color-accent-orange);
  margin-bottom: 1.5rem;
  text-align: center;
}

.hero__text {
  font-size: 1.1rem;
  color: var(--color-text-main);
  text-align: center;
  margin-bottom: 3rem;
}

.cta {
  position: relative;
  display: inline-block;
  width: 100%;
  overflow: hidden;
  text-align: center;

  padding: 1rem;
  border: none;
  border-radius: 6px;
  box-shadow: 0 4px 8px hsl(0 0% 0% / 0.2);

  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-cta);

  background-color: var(--color-accent-cyan);
  cursor: pointer;
}

.cta span {
  position: relative;
  z-index: 1;
}

.cta:before {
  content: "";
  position: absolute;
  background-color: var(--color-accent-orange);
  width: 0;
  height: 0;
  left: var(--xPos);
  top: var(--yPos);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: width 0.75s, height 0.75s;
}

.cta:hover::before {
  width: 1000px;
  height: 1000px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    hsl(210, 57%, 11%),
    hsl(210, 57%, 15%)
  );
  z-index: -1;
}

/* About */
.about {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 0;
  padding: 1rem;
  background-color: var(--color-bg-about);
}

.about__heading {
  padding-top: 6rem;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent-orange);
  text-align: center;
}

.about__list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.about__list li {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.about__list li::before {
  content: "•";
  font-size: 1.4rem;
  line-height: 1;
  margin-right: 0.6rem;
  color: var(--color-accent-cyan);
}

/* Story */
.story {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 0;
  padding: 1rem;
  background-color: var(--color-bg-story);
}

.story__heading {
  padding-top: 5rem;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent-orange);
  text-align: center;
  margin-bottom: 1rem;
}

.story__toggle {
  width: 10rem;
  text-align: center;

  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  box-shadow: 0 4px 8px hsl(0 0% 0% / 0.2);

  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-cta);

  background-color: var(--color-accent-cyan);
  cursor: pointer;
}

.story__full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.open {
  max-height: 500px;
}

.invisible {
  display: none;
}

/* Challenges */
.challenges {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--color-bg-challenges);
}

.challenges__heading {
  margin: 7rem 2rem 1rem;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent-orange);
}

.challenges__grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
}

.challenges__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 1rem;
  border-radius: 1rem;
}

.challenges__preview {
  background-color: var(--color-bg-challenges-preview);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  padding: 1.5rem;
}

.challenges__preview-img {
  box-shadow: 0px 8px 12px hsl(0 0% 0% / 0.2);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.challenges__preview-img:hover {
  transform: scale(1.05);
}

.challenges__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding: 1rem 1.5rem 1.5rem;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  background-color: var(--color-bg-challenges-content);
}

.challenges__title {
  font-size: 1.3rem;
  color: var(--color-challenges-title);
  margin-bottom: 0.5rem;
}

.challenges__wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.challenges__tags span {
  font-weight: 600;
  font-size: 1rem;
  margin-right: 0.5rem;
}

/* colors tag */
[data-tag="HTML"] {
  color: var(--color-tag-html);
}

[data-tag="CSS"] {
  color: var(--color-tag-css);
}

[data-tag="JS"] {
  color: var(--color-tag-js);
}

[data-tag="API"] {
  color: var(--color-tag-api);
}

.challenges__level {
  border: 1px solid hsl(0 0% 0%);
  border-radius: 0.3rem;
  padding: 0.1rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.challenges__level--newbie {
  color: var(--color-level-newbie);
  border-color: var(--color-level-newbie);
  text-transform: uppercase;
}

.challenges__level--junior {
  color: var(--color-level-junior);
  border: 2px solid var(--color-level-junior);
  text-transform: uppercase;
}

.challenges__description {
  color: var(--color-challenges-text);
  font-size: 1rem;
  margin-top: 1rem;
}

.challenges__learnings {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--color-challenges-title);
  text-decoration: none;
}

.challenges__learnings:hover {
  text-decoration: underline;
}

.challenges__live {
  color: var(--color-challenges-title);
  text-decoration: none;
}

.challenges__live:hover {
  text-decoration: underline;
}

.challenges i {
  margin-left: 0.2rem;
}

.show-more {
  margin-top: 0;
  padding: 0.5rem;
  width: 15rem;
}

/* Contact */
.contact {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  z-index: 0;
}

.contact::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    hsl(210, 57%, 15%),
    hsl(210, 57%, 11%)
  );
  z-index: -1;
}

.contact__heading {
  margin-top: 6rem;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent-orange);
  text-align: center;
}

.contact__intro {
  text-align: center;
  font-size: 1rem;
}

.contact .cta {
  width: 15rem;
  margin: 0;
}

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 4rem;
  padding: 1rem;
}

.footer__socials {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer__social-link {
  font-size: 2rem;
  color: hsla(210, 10%, 95%, 0.2);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__social-link:hover {
  color: hsl(201, 100%, 37%);
}

.footer__social-link:nth-child(2):hover {
  color: hsl(128, 49%, 60%);
}

.footer__social-link:nth-child(3):hover {
  color: hsl(0, 100%, 50%);
}

/* Tablet */
@media (min-width: 610px) {
  .inner-container {
    max-width: 1400px;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: var(--color-bg-header);
    padding: 1rem 3rem;
  }

  .nav__open {
    display: none;
  }

  .nav__close {
    display: none;
  }

  .nav__wrapper {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: none;
    transform: none;
    height: auto;
  }

  .nav__wrapper.hidden {
    transform: none;
  }

  .nav__wrapper:not(.hidden) {
    transform: none;
  }

  .nav__heading {
    display: none;
  }

  .nav__list {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
  }

  .nav__list-item {
    margin-bottom: 0;
  }

  .nav__list-link {
    font-size: 0.9rem;
  }

  .header__logo {
    font-size: 2.5rem;
  }

  .hero {
    padding: 3rem;
  }

  .hero__heading {
    font-size: 1.5rem;
  }

  .hero__text {
    font-size: 1.1rem;
  }

  .about {
    padding: 0 3rem;
  }

  .about__list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    font-size: 1.1rem;
    width: 100%;
  }

  .story {
    padding: 0 3rem;
  }

  .story p {
    font-size: 1.1rem;
  }

  .challenges {
    padding: 3rem;
  }
}

/* Laptop */
@media (min-width: 1024px) and (max-width: 1599px) {
  .inner-container {
    max-width: 1599px;
  }

  header {
    padding: 1rem 6rem;
  }

  .header__logo-svg {
    height: 80px;
    width: 80px;
  }

  .nav__list {
    display: flex;
    gap: 3rem;
  }

  .nav__list-link {
    font-size: 1.4rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 6rem;
  }

  .hero__wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
  }

  .hero__heading {
    text-align: left;
    font-size: clamp(2.6rem, calc(1.6rem + 1.5vw), 3rem);
    max-width: 30ch;
  }

  .hero__text {
    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
    text-align: left;
    max-width: 60ch;
    width: 100%;
  }

  .cta {
    margin-top: 2rem;
    width: 25rem;
  }

  .about {
    padding: 0 6rem;
  }

  .about__heading {
    font-size: 3rem;
  }

  .about__list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
    width: 100%;
  }

  .story {
    padding: 0 6rem;
  }

  .story__heading {
    padding-top: 6rem;
    font-size: 3rem;
  }

  .story p {
    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
  }

  .challenges__heading {
    font-size: 3rem;
  }

  .challenges__completed-counter {
    font-size: 1.5rem;
  }

  .challenges__goal {
    font-size: 1.5rem;
  }

  .challenges__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: stretch;
    gap: 2rem;
    padding: 5rem 5rem;
  }

  .challenges__content {
    flex: 1;
  }

  .challenges__card {
    width: 30rem;
    display: flex;
    flex-direction: column;
  }

  .show-more {
    margin-top: 1rem;
  }

  .contact__heading {
    font-size: 3rem;
  }
}

/* Large desktop */
@media (min-width: 1600px) {
  .inner-container {
    max-width: 1599px;
  }

  header {
    padding: 2rem 6rem;
  }

  .header__logo-svg {
    width: 100px;
    height: auto;
  }

  .nav__list {
    display: flex;
    gap: 3rem;
  }

  .nav__list-link {
    font-size: 1.4rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 4rem 6rem;
  }

  .hero__wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
  }

  .hero__heading {
    text-align: left;
    font-size: clamp(2.6rem, calc(1.6rem + 1.5vw), 3rem);
    max-width: 30ch;
  }

  .hero__text {
    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
    text-align: left;
    max-width: 60ch;
    width: 100%;
  }

  .cta {
    margin-top: 2rem;
    width: 25rem;
  }

  .about {
    padding: 0 6rem;
  }

  .about__heading {
    font-size: 4rem;
  }

  .about__list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
    width: 100%;
  }

  .story {
    padding: 0 6rem;
  }

  .story__heading {
    padding-top: 6rem;
    font-size: 4rem;
  }

  .story p {
    font-size: clamp(1.6rem, calc(0.6rem + 1vw), 2rem);
  }

  .challenges__heading {
    font-size: 4rem;
  }

  .challenges__completed-counter {
    font-size: 1.5rem;
  }

  .challenges__goal {
    font-size: 1.5rem;
  }

  .challenges__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    padding: 5rem 0;
  }

  .challenges__content {
    flex: 1;
  }

  .challenges__card {
    width: 24rem;
    display: flex;
    flex-direction: column;
  }

  .contact__heading {
    font-size: 4rem;
  }
}
