/* CSS-only framing: measured crown-to-chin height is 63.31% of each card.
   Source landmarks are recorded in scripts/team_portrait_landmarks.json.
   Individual eye anchors preserve natural anatomy with a common 7% crown margin. */
.md-typeset .team-portraits .team-portrait-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 1rem 0 2rem;
  padding: 0;
}

.md-typeset .team-portraits .team-portrait-list > li {
  background: none;
  border: 0;
  box-shadow: none;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.md-typeset .team-portraits .team-portrait {
  --portrait-scale: 1;
  aspect-ratio: 1;
  background: #b7b7b7;
  border: 0;
  border-radius: 0;
  display: block;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.md-typeset .team-portraits .team-portrait img {
  aspect-ratio: auto;
  border-radius: 0;
  display: block;
  height: auto;
  left: 50%;
  margin: 0;
  max-height: none;
  max-width: none;
  object-fit: contain;
  object-position: center;
  position: absolute;
  top: var(--portrait-eye-line, 35%);
  /* Centre the subject, not the source canvas. This remains correct when
     mobile increases the rendered image width for the taller cards. */
  transform: translate(calc(-1 * var(--portrait-subject-center, 50%)), var(--portrait-eye-lift));
  width: calc(var(--portrait-width) * var(--portrait-scale));
}

.md-typeset .team-portraits .team-portrait--julia {
  --portrait-width: 137.82%;
  --portrait-subject-center: 50.4%;
  --portrait-eye-lift: -33.094%;
  --portrait-eye-line: 40.631%;
}

.md-typeset .team-portraits .team-portrait--toby {
  --portrait-width: 151.79%;
  --portrait-subject-center: 49.7%;
  --portrait-eye-lift: -33.333%;
  --portrait-eye-line: 37.866%;
}

.md-typeset .team-portraits .team-portrait--samuel {
  --portrait-width: 147.01%;
  --portrait-subject-center: 50.6%;
  --portrait-eye-lift: -33.971%;
  --portrait-eye-line: 37.363%;
}

.md-typeset .team-portraits .team-portrait--jonathan {
  --portrait-width: 110%;
  --portrait-subject-center: 54.5%;
  --portrait-eye-lift: -28.108%;
  --portrait-eye-line: 37.083%;
}

.md-typeset .team-portraits .team-portrait--kasper {
  --portrait-width: 152.37%;
  --portrait-subject-center: 49.6%;
  --portrait-eye-lift: -33.413%;
  --portrait-eye-line: 38.957%;
}

.md-typeset .team-portraits .team-portrait--madison {
  --portrait-width: 132.43%;
  --portrait-subject-center: 50.7%;
  --portrait-eye-lift: -24.625%;
  --portrait-eye-line: 41.624%;
}

.md-typeset .team-portraits .team-portrait::after {
  background: linear-gradient(transparent 62%, rgb(0 0 0 / 42%) 80%, rgb(0 0 0 / 90%));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.md-typeset .team-portraits .team-portrait-caption {
  bottom: 0;
  color: #fff;
  display: grid;
  gap: 0.15rem;
  inset-inline: 0;
  line-height: 1.3;
  padding: 0.9rem;
  position: absolute;
  text-align: left;
  z-index: 1;
}

.md-typeset .team-portraits .team-portrait-caption strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.md-typeset .team-portraits .team-portrait-caption > em {
  font-size: 0.75rem;
  font-style: normal;
}

.md-typeset .team-portraits a.team-portrait:focus-visible {
  outline: 3px solid var(--md-accent-fg-color);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .md-typeset .team-portraits .team-portrait-list {
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-typeset .team-portraits .team-portrait {
    --portrait-scale: 1.25;
    aspect-ratio: 4 / 5;
  }

  .md-typeset .team-portraits .team-portrait-caption {
    gap: 0.1rem;
    padding: 0.5rem;
  }

  .md-typeset .team-portraits .team-portrait-caption strong {
    font-size: 0.7rem;
  }

  .md-typeset .team-portraits .team-portrait-caption > em {
    font-size: 0.6rem;
  }
}

@media (max-width: 360px) {
  .md-typeset .team-portraits .team-portrait-caption {
    padding: 0.3rem;
  }
  .md-typeset .team-portraits .team-portrait-caption strong {
    font-size: 0.62rem;
  }
  .md-typeset .team-portraits .team-portrait-caption > em {
    font-size: 0.53rem;
  }
}

/* Three columns just above the mobile breakpoint still have narrow cards.
   Keep labels compact until the photos have room for desktop typography. */
@media (min-width: 761px) and (max-width: 1000px) {
  .md-typeset .team-portraits .team-portrait-caption {
    gap: 0.1rem;
    padding: 0.5rem;
  }
  .md-typeset .team-portraits .team-portrait-caption strong {
    font-size: 0.7rem;
  }
  .md-typeset .team-portraits .team-portrait-caption > em {
    font-size: 0.6rem;
  }
}

/* Wider archive photos need a subject-centred circular viewport, rather
   than a centre crop of the entire scene. No source pixels are rewritten. */
.former-member-avatar-frame {
  border-radius: 50%;
  display: block;
  flex: 0 0 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  position: relative;
  width: 2.5rem;
}

.former-member-card .former-member-avatar-frame img {
  border-radius: 0;
  height: auto;
  left: 50%;
  margin: 0;
  max-height: none;
  max-width: none;
  position: absolute;
  top: var(--avatar-eye-line, 35%);
  transform: translate(calc(-1 * var(--avatar-center)), calc(-1 * var(--avatar-eye)));
  width: var(--avatar-width);
}

.former-member-avatar-frame--evan {
  --avatar-width: 140%;
  --avatar-center: 52%;
  --avatar-eye: 28%;
}

.former-member-avatar-frame--kai {
  --avatar-width: 125%;
  --avatar-center: 40%;
  --avatar-eye: 30%;
}

.former-member-avatar-frame--leandro {
  --avatar-width: 208%;
  --avatar-center: 24.5%;
  --avatar-eye: 25%;
  --avatar-eye-line: 40%;
}

.former-member-avatar-frame--mark {
  --avatar-width: 250%;
  --avatar-center: 68%;
  --avatar-eye: 63%;
}

.former-member-avatar-frame--shivesh {
  --avatar-width: 140%;
  --avatar-center: 46.5%;
  --avatar-eye: 26%;
}
