.team__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.team__card {
  padding-top: 16px;
  border-top: 2px solid var(--ink);
}

/* Square box; photos are anchored to the top so faces are never cut off */
.team__avatar {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1 / 1;
  padding: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #e3e6e4, #cdd2cf);
  color: var(--primary);
  font: 500 44px/1 var(--font-head);
  letter-spacing: -0.06em;
}

.team__avatar--photo {
  padding: 0;
}

.team__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team__card h3 {
  margin: 16px 0 0;
  font-size: 19px;
}

.team__role {
  min-height: 36px;
  margin: 4px 0 0;
  color: var(--kick);
  font: 500 12px/1.5 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.team__excerpt {
  margin: 10px 0;
  color: var(--mute);
  font-size: 14px;
}

/* Underlined text button */
.link-btn {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--ink);
  font: 500 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--kick);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Bio dialog */
.bio {
  width: calc(100% - 40px);
  max-width: 640px;
  max-height: calc(100% - 40px);
  padding: 32px;
  overflow: auto;
  border: 0;
  background: var(--card);
  color: var(--ink);
}

.bio::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.bio h3 {
  margin: 0;
}

.bio .team__role {
  min-height: 0;
  margin-bottom: 16px;
}

.bio__text {
  margin: 0 0 24px;
  color: var(--mute);
}

/* Stop the page scrolling behind an open dialog */
body:has(dialog[open]) {
  overflow: hidden;
}

@media (max-width: 850px) {
  .team__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .team__grid {
    grid-template-columns: 1fr;
  }

  .team__role {
    min-height: 0;
  }
}



/* The intro runs the full width of the grid, in line with the last card */
.team .section__intro {
  max-width: none;
}
