/* Changing icon colors with CSS filters: https://codepen.io/sosuke/pen/Pjoqqp */

:root {
  --bg: #282c34;
  --bg2: #2c313a;
  --bg3: #21252b;
  --bg4: #323842;
  --fg: #abb2bf;
  --fg2: #495162;
  --fg3: #5c6370;
  --red: #e06c75;
  --orange: #d19a66;
  --yellow: #e5c07b;
  --green: #98c379;
  --cyan: #56b6c2;
  --blue: #61afef;
  --purple: #c678dd;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  font-size: 1.1rem;
  margin: 0;
  padding: 0;
}

.navbar {
  display: flex;
  height: 50px;
  flex-direction: row;
  justify-content: center;
  transition: 0.25s linear;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  align-items: center;
  font-size: 0.9rem;
  color: var(--fg3);

  .nav-item {
    padding: 0 1rem 0 1rem;
    transition: 0.25s linear;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .nav-item:hover {
    color: white;
    cursor: pointer;
  }
}

.sticky {
  background-color: rgb(40, 44, 52, 0.5);
  backdrop-filter: blur(0.5rem);
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.25);
  display: flex;
  opacity: 1;
  color: var(--fg1);
  -webkit-backdrop-filter: blur(0.5rem);
}

.grid-item {
  background-color: var(--bg2);
  border-radius: 1rem;
  border: 1px solid var(--fg2);
  padding: 0.5rem 1rem 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-direction: column;
  line-height: 1.25;

  .sub-item {
    border-top: 1px solid var(--fg2);
    width: auto;
    margin: 0.25rem -1rem -1rem -1rem;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-evenly;
  }
}

.item-label {
  font-weight: bold;
  background-color: var(--bg2);
  padding: 0.4rem;
  border: 1px solid var(--fg2);
  border-radius: 0.5rem;
  text-align: center;
  width: max-content;
}

.arrow-down {
  width: 5rem;
  animation: moveUpDown 2s ease-in-out infinite;
  transition: 0.25s linear;
  grid-row-start: 4;
}

.arrow-down:hover {
  cursor: pointer;
}

.list-item-container {
  display: grid;
  grid-template-columns: 1.5rem auto;
  column-gap: 1rem;

  .dot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-area: 1 / 1 / 2 / 2;

    .dot-outline {
      border: 1px solid var(--fg2);
      border-radius: 50%;
      height: 1.5rem;
      width: 1.5rem;
      display: flex;
      justify-content: center;
      align-items: center;
      justify-self: center;

      .dot {
        height: 0.75rem;
        width: 0.75rem;
        border-radius: 50%;
        display: inline-block;
        animation: pulse 3s ease-in-out infinite;
      }
    }

    .dot-elbow-vertical {
      height: auto;
      width: 1px;
      background-color: var(--fg2);
      flex-grow: 1;
    }

    .dot-elbow-horizontal {
      height: 1px;
      width: 1.25rem;
      background-color: var(--fg2);
      margin: -1px 0 0 calc(1.25rem - 0.5px);
    }
  }

  .dot-link {
    width: 1px;
    background-color: var(--fg2);
    grid-area: 2 / 1 / 3 / 2;
    margin-bottom: -1rem;
    justify-self: center;
  }

  .entry-container {
    display: flex;
    flex-direction: column;
    grid-area: 1 / 2 / 2 / 3;
    margin-top: 0.1rem;
  }
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  font-size: 0.9rem;
  color: var(--fg3);
  background-color: var(--bg3);

  #footer-text:link {
    color: var(--fg3);
    transition: 0.25s linear;
  }

  #footer-text:visited {
    color: var(--fg3);
  }

  #footer-text:hover {
    color: white;
  }
}

#home {
  display: grid;
  grid-template-rows: 2fr auto repeat(2, 1fr);
  justify-items: center;
  height: 100vh;

  #home-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 50vw;
    gap: 0.5rem;
    grid-row: 2 / 3;
    padding-bottom: 10vh;

    #hello {
      font-size: 4rem;
      color: var(--yellow);
      margin-bottom: -1.25rem;
    }

    #greeting {
      font-size: 6rem;
      margin-bottom: -0.5rem;

      #name {
        color: var(--green);
        font-weight: bold;
      }
    }

    #description {
      font-size: 2rem;
      line-height: 1.25;

      #adverb {
        color: var(--red);
      }

      #role {
        color: var(--blue);
        font-weight: bold;
      }

      #place {
        color: var(--purple);
        font-weight: bold;
      }
    }
  }
}

#about {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.5fr 1fr 2fr 0.5fr;
  grid-template-rows: 1rem 0.5fr 2fr 0.5fr;
  gap: 0.5rem 1rem;

  #about-me {
    grid-area: 2 / 3 / 3 / 4;

    #about-me-label {
      color: var(--red);
    }

    .about-me-link:link {
      color: var(--red);
      text-decoration: none;
      transition: 0.25s linear;
    }

    .about-me-link:visited {
      color: var(--red);
    }

    .about-me-link:hover {
      color: white;
    }
  }

  #contact {
    grid-area: 2 / 2 / 4 / 3;

    #contact-label {
      color: var(--yellow);
    }

    #contact-container {
      display: grid;
      grid-template-columns: max-content auto;
      align-items: center;
      gap: 0.5rem;

      .icon {
        height: 1rem;
        grid-column: 1 / 2;
        justify-self: center;
      }

      .icon-filtered {
        filter: brightness(0) saturate(100%) invert(83%) sepia(34%)
          saturate(552%) hue-rotate(343deg) brightness(93%) contrast(93%);
      }

      .contact-text,
      .contact-link {
        grid-column: 2 / 3;
        width: max-content;
        color: var(--yellow);
        text-decoration: none;
      }

      .company-icon {
        height: 1rem;
        grid-column: 1 / 2;
      }

      .contact-link:link {
        color: var(--yellow);
        transition: 0.25s linear;
      }

      .contact-link:visited {
        color: var(--yellow);
      }

      .contact-link:hover {
        color: white;
      }
    }

    #education-label {
      color: var(--purple);
    }

    #education-container {
      display: flex;
      flex-direction: column;
      align-content: space-evenly;

      .entry {
        display: flex;
        flex-direction: column;

        .name {
          color: var(--purple);
        }

        .description {
          margin-top: 0.25rem;
          font-style: italic;
        }
      }
    }

    #skills-label {
      color: var(--green);
    }

    #skills-container {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      justify-content: center;

      .entry {
        display: flex;
        flex-direction: column;

        .category {
          color: var(--green);
        }
      }
    }
  }

  #experience {
    grid-area: 3 / 3 / 4 / 4;

    #experience-label {
      color: var(--blue);
    }
  }

  #experience-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .experience-dot-container {
      height: calc(100% + 1.3rem);
    }

    .experience-dot {
      background-color: var(--blue);
    }

    .name {
      color: var(--blue);
    }

    .date {
      font-weight: 300;
      font-style: italic;
    }

    .description {
      margin-top: 0.5rem;
      grid-area: 2 / 2 / 3 / 3;
    }
  }
}

#projects {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-bottom: 5vh;

  .projects-container {
    display: grid;
    grid-template-columns: 0.5fr 1fr 1fr 0.5fr;
    gap: 1.25rem;

    .projects-column {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;

      .project-item {
        display: flex;
        flex-direction: column;
        border-radius: 1rem;
        background: var(--bg2);
        text-decoration: none;
        transition: 0.25s linear;
        border: 1px solid var(--fg2);

        .project-image {
          border-radius: 1rem 1rem 0 0;
          width: 100%;
        }

        .project-text {
          margin: 0.75rem 1rem 1rem 1rem;
          display: flex;
          flex-direction: column;
          gap: 0.25rem;

          .project-title {
            color: var(--orange);
            font-weight: bold;
          }

          .project-description {
            color: var(--fg);
          }
        }
      }
    }

    .column1 {
      grid-column: 2 / 3;
    }

    .column2 {
      grid-column: 3 / 4;
    }

    .clickable:hover {
      background: var(--bg4);
      box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.5);
    }
  }

  #title {
    color: var(--orange);
    font-size: 4rem;
    font-weight: bold;
    margin-top: 5vh;
    margin-bottom: 2vh;
  }
}

@keyframes moveUpDown {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {
  #home #home-container {
    width: 80vw;
  }

  #about {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 5vh 5vw 5vh 5vw;

    #about-me {
      order: -1;
    }
  }

  #projects .projects-container {
    grid-template-columns: 0 1fr 1fr 0;
  }
}

@media only screen and (max-width: 767px) {
  .navbar {
    justify-content: space-evenly;

    .nav-item-container {
      margin: 0;
    }

    .nav-item {
      margin: 0;
    }

    #nav-projects {
      margin: 0;
    }
  }

  #home {
    grid-template-rows: 2fr auto 0.75fr 1.25fr;

    #home-container {
      width: 80vw;

      #hello {
        font-size: 3rem;
      }

      #greeting {
        font-size: 4rem;
      }

      #description {
        font-size: 1.5rem;
      }
    }

    .arrow-down {
      width: 3.5rem;
    }
  }

  #about {
    display: flex;
    flex-direction: column;
    padding-bottom: 5vh;
    margin: 0 calc(2vw - 2px);

    #about-me {
      order: -1;
      margin-top: 0.5rem;
    }
  }

  #projects {
    .projects-container {
      display: flex;
      flex-direction: column;
      gap: 0;

      .projects-column {
        gap: 0;
      }
    }

    .project-item {
      margin: 0 2vw 1rem 2vw;
    }

    #title {
      font-size: 3rem;
      margin-top: 2rem;
    }
  }
}
