#projects {
  position: relative;
  width: 100%;
  padding: 4em 0;

  .title-container {
    margin: 0 4em 3em 4em;
  }

  #project-display {
    margin: 0 4em;
  }
}

.project-item {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--foreground);
  opacity: 0.7;
  padding: 2.5em 0;
  transition: opacity 0.3s ease, border-color 0.3s ease;
  /* border: solid; */
  /* overflow: hidden; */
}

.project-item:hover {
  opacity: 1;
  border-bottom-color: var(--foreground);
}

.project-item:last-child {
  border-bottom: none;
}

.project-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2em;
  /* border: solid; */
}

.project-info {
  width: 100%;
  max-width: 45%;
  height: 100%;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
  box-sizing: border-box;
  /* border: solid; */
}

.project-title {
  font-family: var(--font-gravitas);
  font-size: clamp(1.5em, 4vw, 2.5em);
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.project-description {
  width: 100%;
  max-width: 42em;
  text-align: justify;
  font-size: 1.1em;
  line-height: 1.5;
  opacity: 0.8;
  margin: 0;
}

.project-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
}

.tech-tag {
  font-size: 0.9em;
  padding: 0.3em 0.8em;
  border: 1px solid var(--foreground);
  border-radius: 9999px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.project-item:hover .tech-tag {
  opacity: 1;
}

.project-image {
  position: absolute;
  pointer-events: none;
  width: 25em;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  top: 0;
  left: 0;
}

.project-image.visible {
  opacity: 1;
}

.project-links {
  width: max-content;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: flex-end;
  justify-content: space-between;
  /* border: solid; */
  box-sizing: border-box;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 2em;
  font-weight: 500;
  text-decoration: none;
  color: var(--foreground);
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.project-link:hover {
  opacity: 1;
  transform: translateX(-4px);
}

.project-item:hover .project-link {
  opacity: 0.9;
}

@media (max-width: 900px) {
  #projects {
    padding: 2em 0;

    .title-container {
      margin: 0 2em 2em 2em;
    }

    #project-display {
      margin: 0 2em;
    }
  }

  .project-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5em;
    min-height: unset;
  }

  .project-info{
    max-width: 100%;
    height: auto; /* reset for mobile */
  }

  .project-links {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    height: auto; /* reset for mobile */
    min-height: unset;
  }

  .project-link:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 600px) {
  #projects {
    padding: 2em 1em;

    .title-container {
      margin: 0 0 1.5em 0;
    }

    #project-display {
      margin: 0;
    }
  }

  .project-item {
    padding: 2em 0;
  }

  .project-technologies {
    gap: 0.4em;
  }

  .tech-tag {
    font-size: 0.8em;
    padding: 0.25em 0.6em;
  }
}