.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.team-grid .person,
.team-grid .cvn-team-add {
  min-width: 0;
}

.team-grid .person > .bezel-in,
.team-grid .bio-side {
  display: contents;
}

.portrait-frame {
  position: relative;
  isolation: isolate;
  width: min(100%, 180px);
  aspect-ratio: 1;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--bg);
}

/* Khaled 2026-09-23 ("A few more website updates", item 1): the colour filter
   now matches /composite-a#team. The photo keeps only its light and dark
   (grayscale, luminosity blend) and takes its colour from a slate-blue ground
   behind it, with a light navy veil on top. It replaces the 66% navy multiply,
   which read dark and muddy next to the composite. Values are composite-a's. */
.portrait-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px;
  border-radius: 19px;
  background: linear-gradient(150deg, #8b919f, #35425f);
}

.portrait-frame img,
.portrait-frame .portrait {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 19px;
  background: var(--bg-2);
  filter: grayscale(1) contrast(.96) brightness(1.11);
  mix-blend-mode: luminosity;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 5px;
  pointer-events: none;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(17, 26, 59, .09), rgba(17, 26, 59, .15));
}

.person-arrow {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  transition: transform .3s var(--ease);
}

.person-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.person-link::-webkit-details-marker {
  display: none;
}

.person h3 {
  min-height: 24px;
  margin-top: 18px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.team-grid .credential {
  min-height: 54px;
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
}

.team-grid .bio-role {
  display: none;
  margin: 14px 0 -10px;
}

.person-details[open] .bio-role {
  display: block;
}

.team-grid .bio-side .link-arrow {
  display: none;
  font-size: .84rem;
}

.person-details > p {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: .99rem;
}

.person-details > p + p {
  margin-top: 14px;
}

.team-grid .person:has(.person-details[open]) {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 28px;
  padding-block: 28px;
  border-block: 1px solid var(--line);
}

.person:has(.person-details[open]) .portrait-frame {
  grid-column: 1;
  grid-row: 1;
}

.person:has(.person-details[open]) .person-details {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.person:has(.person-details[open]) .bio-side .link-arrow {
  display: inline-flex;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

.person:has(.person-details[open]) .person-arrow {
  transform: rotate(90deg);
}

@media (min-width: 480px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 11px;
  }

  .team-grid .person:not(:has(.person-details[open])) .portrait-frame {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 27px 12px;
  }

  .credential {
    min-height: 0;
    max-width: 22ch;
  }
}

@media (min-width: 1100px) {
  .team-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 14px;
  }
}

@media (max-width: 479px) {
  .team-grid .person {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
  }

  .person h3 {
    margin-top: 17px;
    font-size: 23px;
  }

  .team-grid .credential {
    min-height: 0;
    max-width: none;
    margin-top: 8px;
    font-size: 13px;
  }

  .team-grid .person:has(.person-details[open]) {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 0;
  }

  .person:has(.person-details[open]) .portrait-frame,
  .person:has(.person-details[open]) .person-details,
  .person:has(.person-details[open]) .bio-side .link-arrow {
    grid-column: 1;
    grid-row: auto;
  }
}

/* --------------------------------------------------------------------------
   2026-09-23 · the portrait opens the full bio
   The frame is now a <button> (team.html, cvn-team.js). Reset the browser's
   button look so the card renders exactly as before, then give the ↗ badge
   the hover and focus state it always implied.
   -------------------------------------------------------------------------- */
button.portrait-frame {
  display: block;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button.portrait-frame:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 25px;
}

button.portrait-frame:hover .person-arrow,
button.portrait-frame:focus-visible .person-arrow {
  border-color: var(--accent);
  background: var(--accent);
  transform: translate(2px, -2px);
}

/* The full bio, inside the site drawer (main.js teamBios fills it). */
.bio-drawer-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}

.bio-drawer .bio-drawer-portrait {
  flex: 0 0 128px;
  width: 128px;
  border-radius: 22px;
}

.bio-drawer .bio-drawer-portrait img,
.bio-drawer .bio-drawer-portrait::before,
.bio-drawer .bio-drawer-portrait::after {
  border-radius: 16px;
}

.bio-drawer-who {
  min-width: 0;
}

.bio-drawer .bio-role {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font-size: 10.5px;
}

.bio-drawer .bio-name {
  margin: 0;
}

.bio-drawer .bio-tag {
  min-height: 0;
  max-width: none;
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 1rem;
}

.bio-drawer-text p {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-2);
  font-size: .99rem;
  line-height: 1.65;
}

.bio-drawer-text p + p {
  margin-top: 14px;
}

.bio-drawer .link-arrow {
  margin-top: 26px;
  font-size: .9rem;
}

@media (max-width: 479px) {
  .bio-drawer-head {
    gap: 16px;
  }

  .bio-drawer .bio-drawer-portrait {
    flex-basis: 96px;
    width: 96px;
    border-radius: 18px;
  }

  .bio-drawer .bio-drawer-portrait img,
  .bio-drawer .bio-drawer-portrait::before,
  .bio-drawer .bio-drawer-portrait::after {
    border-radius: 13px;
  }
}
