/* Header, footer and navigation bar */
.header,
.footer {
  border: 1px solid var(--border-light-color);
  padding: 1.25rem 1.5rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
}

.header__logo {
  display: block;
  height: 36px;
}

.header__nav {
  display: none;
  padding: 2rem;
}

.header__nav--opened {
  background-color: white;
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 85px;
  height: 100vh;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav__item {
  font-size: 2rem;
}

.nav__item--active {
  border-bottom: 1px solid var(--main-blue-color);
  color: var(--main-blue-color);
  font-weight: 600;
}

.header__nav-trigger {
  display: flex;
  align-items: center;
}

.trigger__label {
  color: var(--main-blue-color);
  font-weight: 500;
}

.footer__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.footer__networks {
  display: flex;
  gap: 1rem;
}

/* Homepage */
.welcome {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.welcome__picture {
  width: clamp(130px, 30vw, 300px);
}

.welcome__image {
  border-radius: 50%;
  height: auto;
}

.welcome__text {
  max-width: 35rem;
  font-size: 2.5rem;
}

.welcome__text--highlight {
  color: var(--text-blue-highlight);
}

.welcome__subtitle {
  font-size: clamp(0.75rem, 0.75vw + 0.55rem, 1rem);
  margin-top: 0.75rem;
}

.welcome__button {
  margin-top: 2.5rem;
}

.projects__grid,
.values__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.projects__grid {
  margin-top: 1rem;
}

.project-card--homepage:nth-last-child(-n + 3) {
  display: none;
}

.projects__button {
  margin-top: 1.5rem;
}

.values__title {
  margin-bottom: 1.5rem;
}

.contact__description {
  margin: 1rem 0 1.5rem 0;
  max-width: 38rem;
}

.contact__subtitle {
  margin: 2.5rem 0 0.25rem 0;
}

.contact__email {
  display: inline-block;
  color: var(--main-blue-color);
  font-size: 1.25rem;
  font-weight: 500;
  width: fit-content;
}

/* Project page */
.project-header {
  position: relative;
  text-align: center;
}

.project-header__image {
  width: 100%;
  max-height: 400px;
  max-width: 60em;
  object-fit: cover;
  object-position: top;
  height: auto;
}

.project-header__back {
  position: absolute;
  background: white;
  border-radius: 50%;
  left: 2rem;
  top: 1rem;
  padding: 0.5rem;
}

.project-description__subtitle {
  color: var(--text-grey);
  margin-top: 0.5rem;
}

.project-description__title {
  margin: 2.5rem 0 0.5rem 0;
}

.project-description__story {
  max-width: 52rem;
}

.project-description__story + .project-description__story {
  margin-top: 2rem;
}

.project-description__list {
  list-style-type: disc;
  margin-bottom: 2rem;
}

.project-description__list li {
  margin-left: 3rem;
  margin-top: 1rem;
}

.project-techniques__list {
  margin-top: 2rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(12em, auto));
}

.project-techniques__element {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* About page */
.about__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 300px);
  margin-top: 1.5rem;
}

.about-card {
  display: flex;
  flex-direction: column;
}

.about-card__picture {
  display: contents;
}

.about-card__image {
  border-radius: 6px;
  margin-bottom: 0.5rem;
  min-height: 0;
  object-fit: cover;
}

/* Contact page */
.location__flag {
  margin-top: 0.5rem;
  width: 30px;
}

/* Media queries */
@media screen and (min-width: 38em) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card--homepage:nth-last-child(3) {
    display: block;
  }
}

@media screen and (min-width: 60em) {
  .welcome__text {
    font-size: 3rem;
  }

  .header {
    column-gap: 4rem;
    justify-content: start;
  }

  .header__nav {
    display: block;
    padding: initial;
  }

  .nav {
    flex-direction: row;
  }

  .nav__item {
    font-size: 1rem;
  }

  .header__nav-trigger {
    display: none;
  }

  .welcome {
    text-align: initial;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 3rem;
  }

  .projects__grid,
  .values__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-card--homepage:nth-last-child(-n + 2) {
    display: block;
  }

  .project-header__back {
    display: none;
  }

  .about__grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      'one three four'
      'two three four';
  }

  .about-card:nth-child(1) {
    grid-area: one;
  }

  .about-card:nth-child(2) {
    grid-area: three;
  }

  .about-card:nth-child(3) {
    grid-area: two;
  }

  .about-card:nth-child(4) {
    grid-area: four;
  }
}
