body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: white;
  color: #fff;
}

.home-page {
  padding: 40px 0;
  display: flex;
  justify-content: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 1200px;
  width: 100%;
}

.project-item {
  position: relative;
  width: 70%;
  /* centered and smaller */
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  cursor: pointer;
  background-color: #111;
  z-index: 0;
}

.project-item.show {
  opacity: 1;
  transform: translateY(0);
}

.project-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
  border-radius: 16px;
  z-index: 2;
  /* always on top so clicks work */
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  transition: background 0.3s ease;
  z-index: 3;
}

.project-item:hover .overlay {
  background: rgba(0, 0, 0, 0.15);
}

.video-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 16px;
  opacity: 0;
  animation: fadeInVideo 0.5s forwards ease;
  object-fit: cover;
  z-index: 1;
  /* below thumbnail but still visible for aesthetics */
  pointer-events: none;
  /* clicks pass through to the parent */
}

.project-item:hover .video-hover {
  opacity: 1;
}

.project-item img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-item.show img {
  opacity: 1;
}

/* --- Project Title Overlay --- */
.project-title-thumbnail {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;

  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  max-width: 90%;

  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7),
               0 0 12px rgba(0, 0, 0, 0.5);

  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  backdrop-filter: blur(2px);
}

/* Fade in when grid animation finishes */
.project-item.show .project-title-thumbnail {
  opacity: 1;
}

/* Hover effect — cinematic scale + glow */
.project-item:hover .project-title-thumbnail {
  transform: translate(-50%, -50%) scale(1.08);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}



@keyframes fadeInVideo {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.filter-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-transform: uppercase;
}

.filter-btn:hover {
  opacity: 0.7;
}

/* --- MOBILE ADAPTATION --- */
@media (max-width: 600px) {
  .project-title-thumbnail {
    font-size: 0.7rem;   /* smaller text */
    max-width: 80%;      /* tighter, avoids wrapping */
    padding: 3px 6px;    /* fit better */
    text-shadow: 0 0 4px rgba(0,0,0,0.8); /* stronger contrast on small screens */
  }

  .project-item {
    width: 100%;         /* thumbnails fit mobile grid better */
    aspect-ratio: 16/9;
  }

  .projects-grid {
    grid-template-columns: 1fr; /* one thumbnail per row */
    gap: 14px;
    padding: 0 12px;
  }
}
