/* A contained portrait and an open profile share the hero's anthracite. */
.team-section {
  scroll-margin-top: -20px;
  background: var(--dark);
  color: #f5f5f5;
  padding: clamp(56px, 6vw, 88px) 0;
  overflow: clip;
}
.team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 28px;
  margin-bottom: 48px;
  border-bottom: 1px solid #353638;
}
.team-heading h2 { font-size: clamp(25px, 2.2vw, 32px); line-height: 1.2 }
.team-heading > p { max-width: 36ch; color: #b8b8bb; font-size: 14px; line-height: 1.65 }
.team-stage {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(56px, 7vw, 110px);
  align-items: center;
}
.portrait-column { position: relative; width: min(100%, 350px); justify-self: center; perspective: 1200px }
.portrait-column::before {
  content: '';
  position: absolute;
  inset: -12px auto auto -12px;
  width: 64px;
  height: 64px;
  border-left: 2px solid var(--orange);
  border-top: 2px solid var(--orange);
  pointer-events: none;
}
.portrait-stage { position: relative; aspect-ratio: 4 / 5; background: #242526; overflow: hidden; isolation: isolate }
.portrait { position: absolute; inset: 0; overflow: hidden; margin: 0 }
.portrait > img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%;
  transform: scale(1.03) translateY(var(--portrait-y, 0px));
}
.portrait[data-portrait="1"] > img { object-position: 50% 16% }
.portrait[data-portrait="2"] > img { object-position: 50% 38% }
.portrait-corner {
  position: absolute; bottom: 16px; right: 16px; z-index: 3;
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; background: #fff; color: #161616;
  transition: transform .4s var(--ease), background .3s;
}
.portrait-corner .icon { width: 20px; height: 20px }
.portrait-corner:hover { transform: rotate(45deg); background: #ff8546 }
.profile-column { min-width: 0; width: 100%; max-width: 520px; position: relative }
.profile { min-height: 336px }
.profile-role { color: #ff955b; font-size: 13px; line-height: 1.6; margin-bottom: 16px }
.profile h3 { font-size: clamp(30px, 3vw, 40px); line-height: 1.13; margin-bottom: 22px }
.profile-bio { color: #c6c6c8; font-size: 15px; line-height: 1.75; max-width: 46ch }
.profile-skills { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-wrap: wrap; gap: 8px 20px }
.profile-skills li { font-size: 12px; line-height: 1.6; color: #b8b8bb }
.profile .text-link { font-size: 13px; color: #f1f1f1; min-height: 44px }
.profile .text-link .icon { color: #ff955b; width: 17px; height: 17px }
.profile-controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding-top: 22px; border-top: 1px solid #353638 }
.profile-controls > div { display: flex; gap: 10px }
.profile-count { font-size: 13px; color: #a4a4a9; font-variant-numeric: tabular-nums; letter-spacing: 1px }
.profile-count strong { font-weight: 500; color: #f5f5f5 }
.team-section .round-button { width: 46px; height: 46px; border-color: #707174; color: #eee }
.team-section .round-button:hover { color: #101112; border-color: var(--orange) }
.team-section [data-team-prev]:hover { transform: translateX(-3px) }

@media (max-width: 1000px) and (min-width: 761px) {
  .team-stage { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 48px }
  .profile { min-height: 370px }
  .profile h3 { font-size: 32px }
}
@media (max-width: 760px) {
  .team-heading { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 24px; margin-bottom: 36px }
  .team-heading > p { font-size: 13px }
  .team-stage { grid-template-columns: 1fr; gap: 32px }
  .portrait-column { width: min(100% - 24px, 300px) }
  .portrait-stage { aspect-ratio: 1 / 1.08 }
  .portrait-column::before { inset: -9px auto auto -9px; width: 44px; height: 44px }
  .profile-column { max-width: 460px; justify-self: center }
  .profile { min-height: 348px }
  .profile-role { font-size: 12px; margin-bottom: 12px }
  .profile h3 { font-size: 32px; margin-bottom: 18px }
  .profile-bio { font-size: 14px }
  .profile-skills { gap: 7px 16px; margin: 20px 0 14px }
  .profile-controls { margin-top: 18px; padding-top: 18px }
}
@media (max-width: 370px) {
  .profile { min-height: 380px }
  .profile h3 { font-size: 30px }
}

/* Browser-driven entrances keep their position while scrolling either way. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .portrait-column {
      view-timeline: --team-portrait block;
      animation: team-frame-enter 1s linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
    .portrait > img {
      animation: team-photo-drift 1s linear both;
      animation-timeline: --team-portrait;
      animation-range: entry 0% exit 100%;
    }
    .profile-column {
      animation: team-copy-enter 1s linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 32%;
    }
  }
}
@keyframes team-frame-enter {
  from { transform: perspective(1200px) translateY(30px) rotateY(-5deg) }
  to { transform: perspective(1200px) translateY(0) rotateY(0) }
}
@keyframes team-photo-drift {
  from { transform: scale(1.03) translateY(-5px) }
  to { transform: scale(1.03) translateY(5px) }
}
@keyframes team-copy-enter {
  from { transform: translateY(22px); opacity: .7 }
  to { transform: translateY(0); opacity: 1 }
}
@media (prefers-reduced-motion: reduce) {
  .team-section *, .team-section *::before { animation: none !important; transition: none !important }
  .portrait-column, .profile-column, .portrait > img { transform: none !important; opacity: 1 !important }
}
