*, *::before, *::after {
  box-sizing: border-box;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.project-card {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
}

.project-card:hover {
  transform: scale(1.03);
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  padding: 1.5rem;
  border-radius: 16px;
  backface-visibility: hidden;
  transition: transform 0.6s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-front {
  background: #0a1623;
  color: white;
  transform: rotateY(0deg);
}

.card-front h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.card-back {
  background: #16072f;
  color: #e6f6f3;
  transform: rotateY(180deg);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-back p, .card-front p {
  margin: 0.5rem 0;
  padding: 0 1rem; /* Innenabstand rechts/links */
}

.project-card:hover .card-front {
  transform: rotateY(-180deg);
}

.project-card:hover .card-back {
  transform: rotateY(0deg);
}

.project-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  background: #00bfa6;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.project-btn:hover {
  background: #009e8a;
}

