.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(20, 25, 35, .08);
  box-shadow: 0 10px 30px rgba(20, 25, 35, .055);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.team-card::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: 0;
  width: 36px;
  height: 2px;
  background: #17191d;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.team-card:hover {
  transform: translateY(-6px);
  border-color: rgba(20, 25, 35, .14);
  box-shadow: 0 20px 45px rgba(20, 25, 35, .1);
}

.team-card:hover::after {
  transform: scaleX(1);
}

.team-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  background: #f1f2f4;
}

.team-card__img-wrap::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -55px;
  background-image: var(--member-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(35px);
  transform: scale(1.15);
  opacity: .8;
}

.team-card__img-wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, .02),
    rgba(255, 255, 255, .04) 55%,
    rgba(255, 255, 255, .2) 100%
  );
  pointer-events: none;
}

.member-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .55s cubic-bezier(.2, .65, .3, 1);
}

.team-card:hover .member-img {
  transform: scale(1.025);
}

.team-card__details {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px 25px 28px;
}

.team-card__title {
  margin-bottom: 9px;
  color: #777;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.45;
  text-transform: uppercase;
}

.team-card__name {
  margin: 0;
  color: #17191d;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.team-card__summary {
  margin: 15px 0 0;
  color: #65676b;
  font-size: .88rem;
  line-height: 1.7;
}

.team-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 23px;
}

.team-card__contact {
  display: flex;
  gap: 7px;
}

.team-card__contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  color: #555;
  border: 1px solid rgba(20, 25, 35, .1);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.team-card__contact a:hover {
  color: #17191d;
  border-color: rgba(20, 25, 35, .22);
  background: rgba(255, 255, 255, .95);
  transform: translateY(-2px);
}

.team-card__view {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  color: #17191d;
  border: 0;
  background: transparent;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.team-card__view i {
  font-size: .7rem;
  transition: transform .25s ease;
}

.team-card__view:hover i {
  transform: translateX(5px);
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

.profile-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.profile-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 15, .72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.profile-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1080px, 100%);
  height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 35px 100px rgba(0, 0, 0, .28);
  transform: translateY(18px) scale(.985);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.profile-modal.is-open .profile-modal__dialog {
  transform: translateY(0) scale(1);
}

.profile-modal__close {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(20, 25, 35, .1);
  background: rgba(255, 255, 255, .94);
  color: #17191d;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.profile-modal__close:hover {
  background: #fff;
  transform: rotate(4deg);
}

.profile-modal__content {
  display: grid;
  grid-template-columns: minmax(300px, 38%) minmax(0, 62%);
  width: 100%;
  min-height: 0;
  height: 100%;
}

.profile-modal__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #f1f2f4;
}

.profile-modal__image::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -60px;
  background-image: var(--member-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(45px);
  transform: scale(1.15);
  opacity: .82;
}

.profile-modal__image::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, .02),
    rgba(255, 255, 255, .05) 65%,
    rgba(255, 255, 255, .18) 100%
  );
  pointer-events: none;
}

.profile-modal__image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.profile-modal__details {
  min-width: 0;
  min-height: 0;
  padding: 58px 52px 55px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 25, 35, .25) transparent;
}

.profile-modal__details::-webkit-scrollbar {
  width: 7px;
}

.profile-modal__details::-webkit-scrollbar-track {
  background: transparent;
}

.profile-modal__details::-webkit-scrollbar-thumb {
  background: rgba(20, 25, 35, .2);
}

.profile-modal__details::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 25, 35, .35);
}

.profile-modal__details h3 {
  max-width: 650px;
  margin: 0;
  color: #17191d;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.profile-modal__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin: 27px 0 30px;
  padding: 18px 0;
  border-top: 1px solid rgba(20, 25, 35, .08);
  border-bottom: 1px solid rgba(20, 25, 35, .08);
}

.profile-modal__contact a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #555;
  font-size: .8rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.profile-modal__contact a:hover {
  color: #17191d;
}

.profile-modal__contact i {
  flex: 0 0 auto;
  color: #777;
}

.profile-modal__bio {
  max-width: 720px;
  color: #555;
  font-size: .95rem;
  line-height: 1.85;
}

.profile-modal__bio p {
  margin: 0 0 20px;
}

.profile-modal__bio p:last-child {
  margin-bottom: 0;
}

body.profile-modal-open {
  overflow: hidden;
}

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

  .profile-modal__content {
    grid-template-columns: minmax(260px, 35%) minmax(0, 65%);
  }

  .profile-modal__details {
    padding: 52px 40px 45px;
  }
}

@media (max-width: 760px) {
  .profile-modal {
    padding: 14px;
  }

  .profile-modal__dialog {
    width: 100%;
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
  }

  .profile-modal__content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .profile-modal__image {
    flex: 0 0 270px;
    height: 270px;
  }

  .profile-modal__image img {
    object-fit: contain;
  }

  .profile-modal__details {
    flex: 1;
    padding: 32px 25px 38px;
    overflow-y: auto;
  }

  .profile-modal__close {
    top: 13px;
    right: 13px;
  }
}

@media (max-width: 620px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .team-card__img-wrap {
    aspect-ratio: 4 / 3;
  }

  .team-card__details {
    padding: 22px 20px 25px;
  }

  .team-card__name {
    font-size: 1.2rem;
  }

  .profile-modal__image {
    flex: 0 0 240px;
    height: 240px;
  }

  .profile-modal__image img {
    object-fit: contain;
  }

  .profile-modal__details {
    padding: 28px 20px 35px;
  }

  .profile-modal__details h3 {
    font-size: 1.75rem;
  }

  .profile-modal__bio {
    font-size: .9rem;
    line-height: 1.75;
  }
}

@media (max-width: 420px) {
  .team-card__img-wrap {
    aspect-ratio: 1 / 1;
  }

  .profile-modal {
    padding: 8px;
  }

  .profile-modal__dialog {
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .profile-modal__image {
    flex-basis: 220px;
    height: 220px;
  }

  .profile-modal__details {
    padding: 24px 18px 30px;
  }

  .profile-modal__contact {
    gap: 10px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-card,
  .member-img,
  .team-card__view i,
  .team-card__contact a,
  .profile-modal,
  .profile-modal__dialog,
  .profile-modal__close {
    transition: none;
  }
}