.projects {
  min-height: 90vh;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-left: 24vw;
  margin-top: 6rem;
  width: 74vw;
  z-index: -1;
}

.hidden {
  display: none !important;
}

#concept {
  position: relative;
  top: 0;
  left: 0;
  display: block; /* Keep it hidden initially */
  width: 20vw;
  min-height: 90vh;
  z-index: -1;
  margin: 0;
}

.project-container {
  position: relative;
  overflow: hidden;
  display: block;
  /* Make the container a perfect square */
  aspect-ratio: 1 / 1;
  width: 100%;
}

.grid img {
  object-fit: cover; /* Ensure images fit perfectly within their containers */
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.logo {
  filter: invert(0);
}

.header {
  background-color: white;
}

.title {
  position: absolute;
  top: 0; /* Covers the top of the image */
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 130%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  color: white;
  font-size: 1.3rem;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease; /* Smooth fade effect */
}
.project-link {
  text-decoration: none;
}

.project-container:hover .title {
  opacity: 1;
}

.project-container:hover img {
  transform: scale(1.1);
}

.category-list a {
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
  text-decoration: none; /* Remove underline by default */
  color: grey; /* Change color for the active link, if desired */
}

.category-list {
  position: fixed;
  left: 3vw;
  top: 7rem;
  z-index: 5;
  width: 20vw;
}

.category-list a.active {
  color: black; /* Change color for the active link, if desired */
}

.category-list a:hover {
  text-decoration: underline;
}

a {
  color: black;
}

.category-list ul,
.category-list li {
  list-style-type: none;
  padding: 0;
  width: 21vw;
  margin-top: 0.6rem;
  margin-right: 0.8rem;
  line-height: 127%;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

#concept p,
#concept ul {
  font-size: 1.3rem;
}
.hidden {
  display: none;
}

.grid {
  transition: opacity 0.3s ease-in-out;
}

.grid.hidden {
  opacity: 0;
  pointer-events: none;
}

#concept-link {
  position: fixed;
  display: block;
  bottom: 6vh;
  left: 3vw;
  z-index: 3;
}

strong,
b {
  font-weight: 500;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 120%;
}

@media (max-width: 1360px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    margin-left: 28vw;
    width: 69vw;
  }
  .grid img {
    height: auto;
    margin-bottom: 0.5rem;
    object-fit: cover;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 1280px) {
  .grid {
    grid-template-columns: repeat(1, 1fr);
    margin-left: 40vw;
    width: 50vw;
  }

  .category-list ul,
  .category-list li {
    width: 35vw;
  }

  .project-container {
    width: 55vw;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    padding-top: 2rem;
    width: 100%;
    min-height: 75vh;
    margin-left: 0%;
  }

  .project-container {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .category-list {
    position: fixed;
    left: 0rem;
    right: 1.5rem;
    top: 0rem;
    width: 100%;
    z-index: 1000;
    background-color: white;
  }

  #concept-link {
    position: relative !important;
    bottom: 0;
    left: 0;
  }

  .category-list ul {
    padding-top: 3rem;
    padding-left: 5vw;
    padding-bottom: 0rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .category-list ul,
  .category-list li {
    width: auto;
  }

  .category-list a {
    font-size: 1rem;
  }

  .category-list ul::-webkit-scrollbar {
    display: none;
  }

  .category-list li {
    flex: 0 0 auto;

    margin-right: 1.5rem;
  }

  .category-list a {
    white-space: nowrap;
  }

  .title {
    font-size: 1.3rem;
  }

  h1,
  h2,
  h3,
  h4,
  h5 {
    font-size: 1.5rem;
  }

  #concept p,
  #concept ul,
  #concept .record,
  #concept .record .trf,
  #concept .record .lists,
  #concept .record .lists p,
  #concept .record .list,
  #concept .record .list p {
    font-size: 1rem !important;
  }
}
