
html, body {
  scroll-behavior: smooth; /* Ensures smooth scrolling */
  overflow-x: hidden; /* Prevents layout shift */
}

.projects-container {
  will-change: opacity, transform;
  transform: translateZ(0); /* Prevents minor shifts */
  backface-visibility: hidden; /* Avoids rendering flickers */
}



.project img {
  transition: transform 0.1s ease-in-out;
  will-change: transform, opacity; /* Prevents browser reflow issues */
  transform: translateZ(0); /* Forces GPU rendering to avoid flicker */
  backface-visibility: hidden; /* Prevents micro re-rendering */
}



body, html {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  overflow-x: visible;
  color: #333;
  background-color: white;
  box-sizing: border-box;
}


.top-container.sticky {
  padding: 10px 30px;
  background-color: white; 
}

.top-container.sticky .logo {
  height: 25px; 
}

.top-container.sticky .navbar ul {
  gap: 20px; 
}

.top-container.sticky .navbar a {
  font-size: 14px;
} 


.external-links {
  margin-top: 90px; 
  display: flex;
  gap: 20px;
  padding: 40px 50px;
  background-color: white;
}




.external-links a {
  text-decoration: none;
  font-size: 16px;
  color: grey; 
  font-weight: bold;
  transition: color 0.3s ease; 
}

.external-links a.active {
  color: black; 
}

.external-links a:hover {
  color: black; 
}


@media (min-width: 769px) {
  .external-links a:hover {
    color: #a8b137; 
  }
}


.projects-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
  padding: 20px 50px;
  background-color: white;
  box-sizing: border-box;
}

.project {
  position: relative;
  width: calc(33.33% - 20px); 
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
}

.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.5s ease-in-out; 
}


.project:hover img {
  filter: grayscale(70%) brightness(1.2);
}


.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column; 
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s, bottom 0.5s ease-in-out; 
  z-index: 1;
}

.project:hover .overlay {
  opacity: 1; 
  visibility: visible; 
  bottom: 50%;
}

.overlay-text {
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px; 
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.5s ease-in-out;
}

.overlay-icon {
  width: 24px;
  height: 24px;
  background: url('../images/icons/link.svg') no-repeat center center;
  background-size: contain; 
  display: inline-block; 
  filter: brightness(0) invert(1);
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.5s ease-in-out;
}

.project:hover .overlay-text,
.project:hover .overlay-icon {
  transform: translateY(0%);
  opacity: 1;
}

@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 70px;
    right: 20px;
    background-color: #a8b137; 
    padding: 10px 15px;
    border-radius: 5px;
    max-height: 0;
    overflow: hidden; 
    visibility: hidden;
    opacity: 0; 
    transition: all 0.3s ease-in-out;
  }

  .project {
    width: 100%; 
  }

  .external-links {
    display: grid; 
    grid-template-columns: 1fr 1fr;
    gap: 20px; 
    padding: 20px; 
  }

  .external-links a {
    text-align: center;
    font-size: 14px; 
  }

  .overlay-text {
    font-size: 16px; 
  }

  .overlay-icon {
    width: 20px;
    height: 20px;
  }
}


@media (max-width: 480px) {
  .project {
    width: 100%; 
  }

  .external-links {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    padding: 20px; 
  }

  .external-links a {
    text-align: center; 
    font-size: 14px; 
  }

  .overlay-text {
    font-size: 16px; 
  }

  .overlay-icon {
    width: 20px;
    height: 20px;
  }
}
