/* Team gallery, using the site's typography and brand colors. */
[data-page="team"] main {
  background: radial-gradient(ellipse at 72% 54%, #e3f2ff, transparent 64%), var(--white);
}

.team-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.team-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 56px 0 0 32%;
  background: url("team/ribbon.webp") center right / cover no-repeat;
  mix-blend-mode: multiply;
  mask-image: linear-gradient(to right, transparent, #000 50%),
    linear-gradient(to bottom, #000 60%, transparent);
  mask-composite: intersect;
}

.team-intro { padding-bottom: clamp(2rem, 4vw, 3rem); }
.team-gallery { padding-block: 1rem clamp(3.5rem, 7vw, 6rem); }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.15rem, 2.3vw, 2.25rem); }
.team-profile { min-width: 0; color: var(--navy); }

.team-summary {
  max-width: 69ch;
  margin-top: clamp(2rem, 5vw, 4rem);
  padding-inline-start: 1.15rem;
  border-inline-start: 2px solid var(--gold);
  color: var(--navy);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.65;
}

.team-portrait {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  padding: 5px;
  border-radius: 13px;
  background: linear-gradient(125deg, #fff, #91cdf4 14%, var(--blue) 31%, #ebf8ff 55%, #5fa8e7 76%, #c6efff);
  color: var(--navy);
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 3px 4px 0 #4c92c6, 0 14px 24px -13px #154b938c;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}

.team-portrait img {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  background: #d6eafb;
}

.team-portrait img[src$="/assets/team/habib.webp"] {
  object-view-box: inset(0 16% 30% 16%);
}

.team-portrait::after {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #ffffff80, inset 0 0 12px #45aaf450;
  background: linear-gradient(118deg, transparent 25%, #e3faff5c 47%, transparent 61%);
  background-size: 240% 100%;
  background-position: var(--shine, 100%) center;
  opacity: 0;
  transition: opacity 200ms var(--ease), background-position 240ms var(--ease);
}

@media (hover: hover) {
  .team-portrait:hover {
    transform: perspective(900px) translateY(-4px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    box-shadow: 4px 6px 0 #4c92c6, 0 19px 28px -12px #154b938c;
  }
  .team-portrait:hover::after { opacity: 1; }
}

.team-toggle {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  font: 500 1.45rem/1 var(--sans);
  color: var(--white);
}

.team-toggle span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d1edff;
  border-radius: 50%;
  background: var(--navy);
  transition: transform 200ms var(--ease);
}

.team-toggle[aria-expanded="true"] span { transform: rotate(45deg); }
.team-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.team-bio {
  position: absolute;
  z-index: 2;
  inset: auto 11px 11px;
  padding: clamp(.7rem, 1.3vw, 1rem);
  border: 1px solid #a1d9ff;
  border-radius: 9px;
  background: linear-gradient(125deg, #02538ff5, #0e2249fa 75%);
  color: var(--white);
  box-shadow: inset 0 0 14px #6bd5ff38, 0 0 12px #53ceff70;
  font-size: .92rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  animation: team-bio-in 200ms var(--ease) both;
}

@keyframes team-bio-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.team-bio strong { display: block; font-size: 1.08rem; line-height: 1.2; }
.team-profile .team-bio p { color: var(--white); }
.team-profile .team-bio .team-card-role { color: #c4e8ff; }
.team-about { margin-top: .6rem; padding-top: .55rem; border-top: 1px solid #a1d9ff55; }
.team-about h3 { font-size: .81rem; font-weight: 700; color: #c4e8ff; }
.team-profile h2 { margin-top: 1rem; font-size: clamp(1.25rem, 2.25vw, 1.8rem); letter-spacing: -.035em; line-height: 1.12; }
.team-profile p { margin-top: .35rem; color: var(--blue); line-height: 1.35; }
.team-profile .team-languages { font-size: .9rem; }

@media (max-width: 1050px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .team-intro::before { inset-inline-start: 25%; opacity: .55; }
  .team-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .team-profile { width: 100%; max-width: 26rem; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .team-portrait, .team-portrait:hover { transform: none; transition: none; }
  .team-toggle span { transition: none; }
  .team-portrait::after { display: none; }
  .team-bio { animation: none; }
}
