.projects {
  background-image: url("../images/backgroundL.jpg");
  position: relative;
  background-size: auto 600px;
  background-position: left;
  background-repeat: no-repeat;
  overflow: hidden;
  margin-top: -7rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 560px));
  gap: 48px;
  max-width: calc(2 * 560px + 64px);
  margin: 16px auto;
  justify-content: center;
  padding: 0 8px;
}

.projects-card {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: radial-gradient(
    circle at center,

    rgba(21, 112, 147, 0.08) 0%,
    rgba(34, 165, 176, 0.12) 45%,
    rgba(12, 65, 73, 0.85) 100%
  );
  border: 1px solid rgba(52, 54, 55, 0.2);
  transition: transform 0.2s ease;
}

.projects-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.projects-h3 {
  font-size: 1rem;
  color: var(--text);
  text-align: center;
  padding: 8px;
}

.projects-h4 {
  font-size: 1.5rem;
  color: var(--accent);
  text-align: center;
  padding-bottom: 8px;
}

.projects-p {
  font-size: 1rem;
  color: var(--text);
  padding: 8px 16px;
}

.github-project-link {
  color: var(--text);
  font-size: 1.25rem;
  margin-left: 8px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.github-project-link:hover {
  color: var(--accent);
}

.projects-video {
  padding-top: 8px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 15px;
}

.projects-website {
  padding-top: 8px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 15px;
}

.hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-btn {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;

  background: #000;

  text-decoration: none;
  text-align: center;
  color: #ffffff;

  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 1px;

  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.projects-video img,
.projects-website img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

.projects-video:hover .project-btn,
.projects-website:hover .project-btn {
  opacity: 1;
  color: var(--accent);
}

@media (max-width: 900px) {
  .projects {
    margin-top: -4.5rem;
  }
}

@media (max-width: 700px) {
  .projects-grid {
    grid-template-columns: minmax(280px, 560px);
  }
}
