/* =========================
TEAM SECTION
========================== */
.team-section {
  padding: 80px 0 60px 0;
  background: #0a0a0a;
  position: relative;
}

.team-subtitle {
  font-size: 1rem;
  line-height: 1.6;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Center the last two items when there are 5 members */
.team-card:nth-child(4) {
  grid-column: 1 / 2;
}

.team-card:nth-child(5) {
  grid-column: 2 / 3;
}

.team-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: default;
  display: flex;
  flex-direction: column;
}

.team-card:hover {
  transform: translateY(-8px);
  border-color: rgba(77, 163, 255, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.team-image {
  position: relative;
  width: 100%;
  padding-top: 80%; /* 80% height relative to width */
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}

.team-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.team-card:hover .team-image img {
  transform: scale(1.05);
}

.team-social {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.team-card:hover .team-social {
  opacity: 1;
  transform: translateY(0);
}

.team-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.team-social a:hover {
  background: #4da3ff;
  border-color: #4da3ff;
  transform: scale(1.1);
  color: #fff;
}

.team-info {
  padding: 20px 22px 24px;
  text-align: left;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.team-info h4 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.team-info span {
  font-size: 0.8rem;
  font-weight: 300;
  color: #4da3ff;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}

.team-info p {
  font-size: 0.85rem;
  font-weight: 200;
  color: #b0b0b0;

}

/* =========================
RESPONSIVE - TEAM
========================== */
@media (max-width: 992px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  /* Reset the nth-child centering for tablet */
  .team-card:nth-child(4),
  .team-card:nth-child(5) {
    grid-column: auto;
  }

  .team-image {
    padding-top: 75%; /* Slightly shorter on tablet */
  }
}

@media (max-width: 768px) {
  .team-image {
    padding-top: 70%; /* Even shorter on smaller tablets */
  }
}

@media (max-width: 576px) {
  .team-section {
    padding: 50px 0 40px 0;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .team-image {
    padding-top: 65%; /* Shorter on mobile for better proportions */
  }

  .team-info {
    padding: 16px 18px 20px;
  }

  .team-info h4 {
    font-size: 1rem;
  }

  .team-info span {
    font-size: 0.7rem;
  }

  .team-info p {
    font-size: 0.8rem;
  }

  .team-subtitle {
    font-size: 0.9rem;
  }

  .team-social a {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .team-grid {
    max-width: 100%;
  }
  
  .team-image {
    padding-top: 60%;
  }
}