/* Team area.
 *
 * One intrinsic layout for every width. The stage band and the copy share a
 * single grid cell, so the row grows to whichever is taller and the photograph
 * covers it — there is no section height to keep in step with the content, and
 * nothing is absolutely positioned against a fixed pixel canvas.
 *
 * Without JavaScript all five members render in sequence. assets/js/team.js
 * turns the picker into a tab set and reveals one member at a time. */

.team {
  width: 100%;
  max-width: 1450px;
  margin: clamp(40px, 5vw, 70px) auto 0;
}

/* ------------------------------------------------------------------ picker */

.team__picker {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  /* The strip scrolls rather than shrinking, so five faces stay legible at
     320px instead of collapsing into unreadable slivers. `fit-content` lets
     the auto margins centre it under the heading while it fits, and hand the
     full width back for scrolling once it does not. */
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #3a3568 transparent;
  margin: 0 auto clamp(28px, 4vw, 52px);
  padding-bottom: 10px;
  /* Fades the trailing edge so an overflowing strip shows there is more to
     reach. `mask` only paints where content overflows because the gradient is
     pinned to the scroll container, not the content. */
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 42px), transparent 100%);
}
.team__picker:not([data-team-overflow]) { mask-image: none; }
.team__pick {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: grid;
  gap: 10px;
  justify-items: center;
  width: clamp(92px, 11vw, 132px);
  padding: 6px 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #b3b0c0;
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  opacity: .62;
}
.team__pick img {
  width: 100%;
  aspect-ratio: 172 / 181;
  border: 1px solid #272d72;
  border-radius: 6px;
  background: #16182e;
  object-fit: cover;
  object-position: center top;
}
.team__pick span { line-height: 1.35; overflow-wrap: anywhere; }
.team__pick:hover,
.team__pick:focus-visible { opacity: 1; color: #fff; }
.team__pick[aria-selected="true"],
.team__pick[aria-current="true"] {
  opacity: 1;
  border-color: #4046a3;
  background: rgba(32, 37, 111, .5);
  color: #fff;
}
.team__pick[aria-selected="true"] img,
.team__pick[aria-current="true"] img {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(225, 189, 79, .3);
}

/* ------------------------------------------------------------------ member */

.team__member { position: relative; }
/* Members are separated in the no-JavaScript sequence; the tab set shows one
   at a time, so the rule between them is not needed there. */
.team__member + .team__member {
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid #232152;
}
.team[data-team-ready] .team__member + .team__member {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.team[data-team-ready] .team__member[hidden] { display: none; }

.team__stage {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
}
.team__stage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1234 / 885;
  object-fit: cover;
  object-position: 62% top;
  background: #0b0c1c;
}
.team__body { position: relative; z-index: 1; }
.team__wordmark {
  margin: clamp(24px, 3vw, 40px) 0 0;
  font-family: Bodoni, Georgia, serif;
  /* Held to 74px at the top of the stacked range so it meets the overlay size
     at the 861px breakpoint. Without that the display name stepped down 38px
     as the screen got wider, which read as a bug. */
  font-size: clamp(42px, 8.5vw, 74px);
  line-height: .94;
  color: #9f9aa8;
}
.team__wordmark span { display: block; }
.team__role {
  margin: clamp(14px, 2vw, 26px) 0 0;
  max-width: 22ch;
  color: #c9c6d1;
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.6;
  text-transform: uppercase;
}
.team__card {
  max-width: 430px;
  margin-top: clamp(24px, 3vw, 38px);
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid #4046a3;
  border-radius: 9px;
  background: #20256f;
  box-shadow: 0 0 26px rgba(55, 66, 208, .38);
}
.team__card-head { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 20px); }
.team__card-head img {
  flex: none;
  width: clamp(60px, 6vw, 76px);
  aspect-ratio: 172 / 181;
  border-radius: 5px;
  object-fit: cover;
  object-position: center top;
}
.team__card-head b {
  display: block;
  color: #fff;
  font-size: clamp(13px, 1.2vw, 14px);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.team__card-head span {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: clamp(10px, .95vw, 11px);
  line-height: 1.5;
  text-transform: uppercase;
}
.team__card p {
  margin: clamp(14px, 1.6vw, 18px) 0 0;
  color: #cfccd6;
  font-size: clamp(13px, 1.15vw, 14px);
  line-height: 1.8;
}

/* --------------------------------------------------- wide: copy over the band */

@media (min-width: 861px) {
  /* The band and the copy occupy the same cell. The cell takes the height of
     whichever is taller, and the photograph covers it — so the composition
     holds from 861px to any width without a fixed height anywhere. */
  .team__member {
    display: grid;
    grid-template-areas: "stage";
    align-items: end;
  }
  .team__stage,
  .team__body { grid-area: stage; }
  .team__stage img {
    height: 100%;
    min-height: clamp(430px, 44vw, 720px);
    aspect-ratio: auto;
    object-position: 72% top;
  }
  /* A scrim under the copy only. The band is bright on the right, where the
     subject stands, so the gradient keeps the display type legible without
     dimming the photograph. */
  .team__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(6, 7, 20, .95) 0%, rgba(6, 7, 20, .88) 30%, rgba(6, 7, 20, .45) 55%, rgba(6, 7, 20, 0) 78%);
  }
  .team__body {
    max-width: min(58%, 680px);
    padding: clamp(32px, 3.6vw, 60px);
  }
  /* Starts at the 74px the stacked range ends on, so the size only ever grows
     with the screen. The ceiling is set by the longest name fitting its column. */
  .team__wordmark { margin-top: 0; font-size: clamp(74px, 6.4vw, 112px); }
  .team__card { max-width: 400px; }
}

@media (min-width: 1500px) {
  .team__body { padding-left: 0; }
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 860px) {
  .team__body { text-align: center; }
  .team__role { max-width: 26ch; margin-inline: auto; }
  .team__card { margin-inline: auto; text-align: left; }
}

@media (max-width: 480px) {
  .team__picker { gap: 8px; }
  .team__pick { width: 84px; padding-inline: 4px; }
  .team__card-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .team__pick { transition: opacity .25s ease, border-color .25s ease, background-color .25s ease, color .25s ease; }
}
