/* General */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: Josefin Sans, sans-serif;
  font-size: 16px;
  color: #222;
}

.content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

h2 {
  font-size: 2rem;
}

p {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.5;
}

section {
  scroll-margin-top: 80px;
  padding: 150px 0;
}

.btn {
  display: inline-block;
  padding: 20px 30px;
  margin-top: 40px;
  background-color: #4f86c6;
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.btn:hover {
  background-color: #376ca9;
}

/* Hero section */
#hero {
  height: calc(100vh - 80px);
  width: 100%;
  background: url(../img/hero-bg1.svg) repeat center center;
  background-size: 300px;
  overflow: hidden;
  display: flex;
  animation: background-move 15s linear infinite;

  position: absolute; /* to hide sticky hero header */
  top: 0;
  left: 0;
  z-index: 11;
}

#hero h1 a {
  color: inherit;
  text-decoration: none;
}

@keyframes background-move {
  0% {
    background-position: 0px 0px;
  }
  100% {
    background-position: -300px -332px;
  }
}

#hero .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#hero .content img {
  width: 100%;
  max-width: 300px;
  border-radius: 100%;
  border: 10px solid white;
}

#hero .content h1 {
  font-size: 3rem;
  font-weight: 700;
  background-color: white;
  padding: 10px;
  margin-bottom: 0px;
  text-align: center;
}

#hero .content span {
  font-size: 1.5rem;
  font-weight: 300;
  background-color: #fff;
  padding: 5px;
}

/* Sticky hero */

#hero-sticky {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 10;
  background-color: white;
  margin-top: calc(100vh - 160px);
}

#hero-sticky .content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 80px;
  gap: 50px;
}

#hero-sticky h1 {
  margin-bottom: 10px;
}
#hero-sticky h1 a {
  color: inherit;
  text-decoration: none;
}

#hero-sticky img {
  width: 50px;
  height: 50px;
  border-radius: 100%;
}

/* Navbar */
#navbar {
  position: sticky;
  top: 80px;
  left: 0;
  width: 100%;
  z-index: 10;
  background-color: #80df9a;
}

#navbar nav ul {
  height: 80px;
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
  align-items: center;
}

#navbar nav ul li a {
  padding: 15px 30px;
  margin: 0 20px;
  border-radius: 30px;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  color: #0c5625;
  font-size: 1.2rem;
  line-height: 1;
}

#navbar nav ul li a:hover {
  background: white;
  color: black;
}

/* About */
#about {
  padding: 150px 0;
}

#about .content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
}

#about #technologies ul {
  display: block;
  list-style: none;
  padding: 0;
  margin: 0;
}

#about #technologies ul li {
  display: inline-block;
  background: #80df9a;
  color: #0c5625;
  padding: 10px 20px;
  margin: 0px 5px 10px 0px;
}

/* Projects */
#projects {
  background-color: #ececec;
}

#projects .content {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 30px;
}

#projects #projects-menu {
  position: sticky;
  top: 190px;
  left: 0px;
}

#projects #projects-menu ul {
  display: block;
  list-style: none;
  padding: 0;
  margin: 0;
}

#projects #projects-menu ul li a {
  display: inline-block;
  padding: 15px;
  margin: 0px 5px 10px 0px;
  color: black;
  text-decoration: none;
  background: white;
  transition: all 0.2s ease-in-out;
}

#projects #projects-menu ul li a:hover {
  background: #80df9a;
}

#projects .item {
  scroll-margin-top: 180px;
  background-color: white;
  margin-bottom: 30px;
  display: flex;
  flex-direction: row;
}

#projects .item h3 a {
  color: inherit;
  text-decoration: none;
}

#projects .item h3 a:hover {
  text-decoration: underline;
}

#projects .item h3 a::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  margin-bottom: -2px;
  background-image: url("../img/external-link.svg");
  background-size: contain;
  background-position: center bottom;
}

#projects .item .item-content {
  padding: 15px 25px;
}

#projects .item img {
  max-width: 300px;
  object-fit: cover;
  background: #c5c5c5;
  border-left: 1px solid #ececec;
}

#projects .item:nth-of-type(even) {
  flex-direction: row-reverse;
}

#projects .item:nth-of-type(even) img {
  border-left: 0;
  border-right: 1px solid #ececec;
}

/* Contact */
#contact {
  color: white;
  background-color: #4f86c6;
}

#contact .row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

#contact .row .item a {
  font-size: 2rem;
  margin-right: 2rem;
  color: white;
  text-decoration-color: white;
  transition: all 0.2s ease-in-out;
}

#contact .row .item a:hover {
  background-color: white;
  color: #4f86c6;
  text-decoration-color: transparent;
}

footer {
  padding: 30px 0;
  background-color: #376ca9;
  color: #ffffffc2;
}

/* Smaller screens */
@media (max-width: 1100px) {
  #projects .content {
    grid-template-columns: 1fr;
  }
  #projects #projects-menu ul li {
    display: inline-block;
  }
}

@media (max-width: 800px) {
  section {
    padding: 100px 0;
  }

  #navbar nav ul li a {
    padding: 15px 20px;
    margin: 0;
  }

  #hero-sticky .content {
    gap: 0px;
    justify-content: space-around;
  }

  #about .content {
    grid-template-columns: 1fr;
  }

  #projects .item {
    flex-direction: column !important;
  }

  #projects .item img {
    max-width: 100%;
    max-height: 300px;
  }

  #contact .row {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }
}
