/* Auto-sizing grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 48px;
  justify-items: center;
  align-items: start;
}

/* Individual card */
.team-card {
  text-align: center;
  max-width: 260px;
}

/* Circular image */
.team-card img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

/* Name */
.team-card h3 {
  font-family: 'Rubik', sans-serif;
  font-size: 22px;
  margin-bottom: 6px;
}

/* Subtitle */
.team-card p {
  font-size: 18px;
  opacity: 0.85;
}

/* =====================
   Mobile Adjustments
===================== */
@media (max-width: 1000px) {
  .team-card img {
    width: 140px;
    height: 140px;
  }

  .team-card h3 {
    font-size: 18px;
  }

  .team-card p {
    font-size: 14px;
  }
}

.legacy-projects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;        /* bunch toward center */
  gap: 1.25rem;

  padding-inline: 4rem;           /* left & right padding */
  padding-block: 2rem;

  max-width: 80px;
  margin-inline: auto;            /* center section itself */
}

/* =====================
   Legacy Work Section
===================== */

.legacy-layout {
	display: flex;
	gap: 48px;
	align-items: center;

	/* THIS is the key */
	box-sizing: border-box;
}

/* Left: Text */
.legacy-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
}

.legacy-text h3 {
	font-size: 1.5rem;
	margin-bottom: 16px;
}

.legacy-text p {
	font-size: 1rem;
	line-height: 1.6;
	opacity: 0.85;
}

/* Right: Media */
.legacy-media {
	flex: 0 0 auto;
	display: flex;
	justify-content: flex-end;   /* right-aligned as requested */
	align-items: center;
	gap: 24px;
}

.legacy-media img {
	width: 200px;
	aspect-ratio: 16 / 9;
	object-fit: cover;

	filter: grayscale(100%);
	opacity: 0.8;
	transition: opacity 0.2s ease;
}

.legacy-media a:hover img {
	opacity: 1;
	filter: grayscale(60%);
}

@media (max-width: 1000px) {
	.legacy-layout {
		flex-direction: column;
		align-items: stretch;
	}

	.legacy-text {
		flex: none;
		max-width: 100%;
	}
	.legacy-text p {
		text-align: center;
	}

	.legacy-media {
		justify-content: center; /* images side-by-side */
	}
}

@media (max-width: 680px) {
	.legacy-media {
		flex-direction: column;
	}
}