.team {
  /* Wider than the handoff's min(24.4vw, 39vh): with bios on the back, the photo takes the space they used. */
  --card-w: min(27.8vw, 44.5vh);
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  min-height: 100vh;
  padding: var(--section-top) var(--gutter) 6vh;
  display: flex;
  justify-content: center;
}
.js .team { pointer-events: none; }

.team__inner {
  width: calc(3 * var(--card-w) + 48px);
  display: flex;
  flex-direction: column;
}

.team__head { margin-bottom: 4.9vh; }

.team__row { display: flex; gap: 24px; }
.team__slot { width: var(--card-w); flex: none; display: flex; }

.js .team__head, .js .team__slot { opacity: 0; }

/* Sets back the cards either side on phones, from js/swipe.js. */
.team__shade { display: none; }

/* Two faces stacked in one grid cell, either side of one satin plate. js/team.js rotates .card;
   the slot around it stays still for hit testing. */
.card {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  border-radius: 20px;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Brushed metal, drawn by shaders/satin.frag. The flat surface and ring show if WebGL is unavailable. */
.card__satin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 20px;
  background: var(--surface-1);
  box-shadow: var(--key-rest);
  transition:
    background-color var(--dur-micro) var(--ease-glide),
    box-shadow var(--dur-micro) var(--ease-glide);
}
.card[data-state="hover"] .card__satin { background: var(--surface-2); box-shadow: var(--key-hover); }
.card[data-state="pressed"] .card__satin { background: var(--surface-3); box-shadow: var(--key-pressed); }

.card__face {
  grid-area: 1 / 1;
  position: relative;
  min-width: 0;
  border-radius: 20px;
  transform: translateZ(.1px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card__face--front { padding: 8px; }
.card__face--front .card__name { padding: 18px 14px 14px; }

.card__face--back {
  transform: rotateY(180deg) translateZ(.1px);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: #101014;
}

/* Placeholder silhouette, until a photo is in the slot. */
.silhouette { position: absolute; inset: 0; }
.silhouette::before, .silhouette::after { content: ''; position: absolute; background: #18181D; }
.silhouette::before { left: 35%; top: 22%; width: 30%; aspect-ratio: 1; border-radius: 50%; }
.silhouette::after { left: 17%; right: 17%; bottom: -10%; height: 42%; border-radius: 999px 999px 0 0; }

/* A real photo. Grayscale and slightly dimmed so mismatched photos sit together. */
.has-art .silhouette {
  background: var(--art) var(--pos, 50% 50%) / var(--size, cover) no-repeat;
  filter: grayscale(1) brightness(.85);
}
.has-art .silhouette::before, .has-art .silhouette::after { display: none; }
.has-art .card__asset { display: none; }

.card__asset {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.card__name { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.4; }
.card__face--back .card__name { margin-bottom: 16px; font-size: clamp(20px, 2.67vh, 24px); }

/* Three equal rows that fill the card below the name, so the dividers line up across all three backs. */
.card__facts {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(12px, min(2vh, 1.25vw), 18px);
  line-height: 1.4;
  color: var(--text-primary);
}
.card__facts li { flex: 1 1 0; padding-top: 16px; border-top: 1px solid var(--hairline-strong); }

/* Top-edge highlight: three solid segments that follow the cursor, clipped to the card's top edge. */
.card__edge {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}
.card__glint {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 1px;
  background: rgba(255, 255, 255, .20);
  opacity: 0;
}
.card__glint::before, .card__glint::after { content: ''; position: absolute; top: 0; height: 1px; }
.card__glint::before { left: 50px; width: 100px; background: rgba(255, 255, 255, .45); }
.card__glint::after { left: 80px; width: 40px; background: rgba(255, 255, 255, .9); }

/* No rotation: the faces crossfade instead. */
@media (prefers-reduced-motion: reduce) {
  .card__face {
    transform: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    transition: opacity var(--dur-micro) var(--ease-glide);
  }
  .card__face--back { transform: none; opacity: 0; }
  .card[data-state="hover"] .card__face--back, .card[data-state="pressed"] .card__face--back { opacity: 1; }
  .card[data-state="hover"] .card__face--front, .card[data-state="pressed"] .card__face--front { opacity: 0; }
}
