/* Team selector — isolated to /team/. The unenhanced state keeps every profile
   in normal document flow; JavaScript adds the overlay only after validation. */
.team-selector {
  width: 100%;
  margin-top: clamp(2.6rem, 6vw, 4.8rem);
}

.team-selector__control[hidden] {
  display: none;
}

.team-selector__control {
  width: min(100%, 42rem);
}

.team-selector__tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 43, 55, .18);
  border-radius: 999px;
  background: linear-gradient(180deg, #0a2a39 0%, #061c28 100%);
  box-shadow:
    0 20px 45px -27px rgba(3, 22, 32, .72),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.team-selector__tab,
.team-selector__lens-label {
  display: grid;
  min-width: 0;
  min-height: 54px;
  place-items: center;
  padding: .7rem clamp(.3rem, 2vw, 1rem);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(.78rem, 1.25vw, .94rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .055em;
  white-space: nowrap;
}

.team-selector__tab {
  position: relative;
  z-index: 2;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(237, 252, 251, .72);
  cursor: pointer;
  touch-action: manipulation;
}

.team-selector__tab[aria-selected="true"] {
  color: #a5fff4;
}

.team-selector__tab:hover {
  color: #f4ffff;
}

.team-selector__tab:focus-visible {
  z-index: 4;
  outline: 0;
  box-shadow: inset 0 0 0 2px #a5fff4, inset 0 0 18px rgba(101, 228, 220, .13);
}

.team-selector--lens-ready .team-selector__tab[aria-selected="true"]:focus-visible > span {
  opacity: 0;
}

.team-selector__lens {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  display: block;
  width: 1px;
  height: 1px;
  overflow: hidden;
  border: 1px solid rgba(187, 255, 249, .38);
  border-radius: 999px;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(31, 65, 77, .97) 0%, rgba(5, 31, 43, .96) 54%, rgba(4, 24, 35, .98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(101, 228, 220, .12),
    inset 10px 0 17px -17px rgba(215, 255, 251, .9),
    inset -10px 0 17px -17px rgba(215, 255, 251, .82),
    0 8px 22px -13px rgba(1, 18, 27, .85);
  pointer-events: none;
  transform-origin: 50% 50%;
}

.team-selector--lens-ready .team-selector__lens {
  opacity: 1;
}

.team-selector__lens::before,
.team-selector__lens::after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.team-selector__lens::before {
  inset: 1px 11% auto;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent);
  filter: blur(.6px);
}

.team-selector__lens::after {
  inset: 10% 0;
  border-radius: inherit;
  box-shadow:
    inset 7px 0 9px -9px rgba(165, 255, 244, .9),
    inset -7px 0 9px -9px rgba(165, 255, 244, .8);
}

.team-selector__lens-copy {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: block;
  width: 1px;
  height: 1px;
  color: #a5fff4;
  pointer-events: none;
}

.team-selector:not(.team-selector--filter-fallback) .team-selector__lens-copy {
  filter: url("#team-selector-refraction");
}

.team-selector__lens-label {
  position: absolute;
  color: #a5fff4;
  text-shadow: 0 0 14px rgba(101, 228, 220, .18);
  transform: scale(1.06);
  transform-origin: 50% 50%;
}

.team-selector__filter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .team-selector__lens {
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
  }
}

.team-profile-stage {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  margin-top: clamp(2rem, 5vw, 4.2rem);
}

.team-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, .88fr) minmax(0, 1.12fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  min-width: 0;
  padding: clamp(.85rem, 2vw, 1.35rem);
  overflow: hidden;
  border: 1px solid rgba(9, 64, 78, .14);
  border-radius: clamp(22px, 3vw, 34px);
  background:
    radial-gradient(circle at 92% 8%, rgba(101, 228, 220, .09), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(239, 248, 249, .82));
  box-shadow:
    0 34px 70px -48px rgba(6, 40, 54, .44),
    inset 0 1px 0 rgba(255, 255, 255, .96);
  transform-origin: 50% 58%;
}

.team-profile + .team-profile {
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.team-selector--enhanced .team-profile-stage {
  isolation: isolate;
}

.team-selector--enhanced .team-profile {
  grid-area: 1 / 1;
}

.team-selector--enhanced .team-profile + .team-profile {
  margin-top: 0;
}

.team-profile__portrait {
  position: relative;
  width: min(100%, 470px);
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: clamp(18px, 2.4vw, 26px);
  background: #d8e8eb;
  box-shadow: 0 28px 58px -38px rgba(3, 35, 47, .6);
}

.team-profile__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.team-profile__portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 112, 121, .025), rgba(9, 43, 55, .11)),
    linear-gradient(105deg, transparent 66%, rgba(165, 255, 244, .07));
  pointer-events: none;
}

.team-profile__copy {
  min-width: 0;
  max-width: 37rem;
  padding-right: clamp(.3rem, 2vw, 1.2rem);
}

.team-profile__role {
  display: block;
  margin-bottom: .85rem;
  color: #0b7079;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(.7rem, .9vw, .82rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.panel--light .team-profile__copy h3 {
  margin: 0;
  color: #072b37;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 590;
  line-height: .92;
  letter-spacing: -.06em;
}

.panel--light .team-profile__copy p {
  max-width: 58ch;
  margin: clamp(1.3rem, 3vw, 2rem) 0 0;
  color: rgba(9, 43, 55, .78);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.68;
}

@media (max-width: 760px) {
  .team-selector {
    margin-top: clamp(2.1rem, 9vw, 3.2rem);
  }

  .team-selector__control {
    width: 100%;
  }

  .team-selector__tab,
  .team-selector__lens-label {
    min-height: 50px;
    padding-inline: .25rem;
    font-size: clamp(.72rem, 3.6vw, .88rem);
    letter-spacing: .035em;
  }

  .team-profile-stage {
    margin-top: clamp(1.5rem, 7vw, 2.5rem);
  }

  .team-profile {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.4rem, 6vw, 2.2rem);
    align-items: start;
    padding: clamp(.7rem, 3vw, 1rem);
  }

  .team-profile__portrait {
    width: min(100%, 440px);
  }

  .team-profile__copy {
    max-width: 38rem;
    padding: 0 clamp(.35rem, 2vw, .7rem) clamp(.65rem, 2vw, 1rem);
  }

  .panel--light .team-profile__copy h3 {
    font-size: clamp(2.55rem, 13vw, 4.4rem);
  }
}

@media (max-width: 360px) {
  .team-selector__tab,
  .team-selector__lens-label {
    font-size: .7rem;
    letter-spacing: .015em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-selector__lens-copy {
    filter: none !important;
  }

  .team-selector__lens-label {
    transform: none;
  }
}

@media (forced-colors: active) {
  .team-selector__filter,
  .team-selector__lens {
    display: none !important;
  }

  .team-selector__tabs {
    border: 1px solid ButtonText;
    background: Canvas;
    box-shadow: none;
  }

  .team-selector__tab {
    color: CanvasText;
  }

  .team-selector__tab[aria-selected="true"] {
    background: Highlight;
    color: HighlightText;
  }

  .team-selector__tab:focus-visible {
    outline: 2px solid ButtonText;
    outline-offset: -4px;
    box-shadow: none;
  }

  .team-selector--lens-ready .team-selector__tab[aria-selected="true"]:focus-visible > span {
    opacity: 1;
  }

  .team-profile {
    border: 1px solid CanvasText;
    background: Canvas;
    box-shadow: none;
  }
}

@media print {
  .team-selector__control,
  .team-selector__filter {
    display: none !important;
  }

  .team-selector--enhanced .team-profile-stage {
    display: block;
  }

  .team-selector--enhanced .team-profile {
    grid-area: auto;
    margin-top: 1rem;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    transform: none !important;
  }
}
