/* Team scene: one baseline for every portrait and a calm greeting on selection. */
.panel-team .team-main-portrait {
  transform-origin: 52% 100%;
  will-change: transform, opacity, filter;
  animation: team-portrait-idle 6.8s ease-in-out infinite;
  overflow: hidden;
  background: none;
}

.team-main-portrait__frame {
  position: absolute;
  inset: 0;
  display: block;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  opacity: 0;
  transition: opacity 680ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity;
}

.team-main-portrait__frame.is-visible {
  opacity: 1;
}

.team-main-portrait__frame.is-hq-frame {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 94%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 94%, transparent 100%);
}

.panel-team.is-changing .team-main-portrait {
  animation: team-portrait-welcome 920ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.panel-team.is-changing .team-details {
  animation: team-copy-welcome 620ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

@keyframes team-portrait-welcome {
  0% {
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(92, 236, 255, 0.08));
    transform: translate3d(34px, 14px, 0) scale(0.965) rotate(1.1deg);
  }
  48% {
    opacity: 1;
    filter: drop-shadow(0 0 34px rgba(92, 236, 255, 0.44));
    transform: translate3d(-4px, -8px, 0) scale(1.012) rotate(-0.55deg);
  }
  72% {
    transform: translate3d(2px, -3px, 0) scale(1.004) rotate(0.22deg);
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(88, 45, 255, 0.34));
    transform: translate3d(0, 0, 0) scale(1) rotate(0);
  }
}

@keyframes team-portrait-idle {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  50% { transform: translate3d(0, -3px, 0) rotate(0.12deg); }
}

@keyframes team-copy-welcome {
  0% { opacity: 0; transform: translate3d(-20px, 10px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (min-width: 600px) and (max-width: 1199px) {
  .panel-team .team-details {
    align-self: center;
  }

  .panel-team .team-main-portrait {
    top: 136px !important;
    right: 0 !important;
    bottom: 54px !important;
    width: 50% !important;
    height: calc(100% - 190px) !important;
  }
}

@media (min-width: 1200px) {
  .panel-team .team-details {
    top: clamp(18px, 3vh, 32px);
    align-self: center;
  }

  .panel-team .team-main-portrait {
    top: 92px !important;
    right: 1.5% !important;
    bottom: 92px !important;
    width: 50% !important;
    height: calc(100% - 184px) !important;
  }
}

@media (max-width: 599px) {
  .panel-team .team-main-portrait {
    top: 136px !important;
    right: -12% !important;
    bottom: 70px !important;
    width: 94% !important;
    height: calc(100% - 206px) !important;
  }
}

@media (max-width: 299px) {
  .panel-team .team-main-portrait {
    bottom: 80px !important;
    height: calc(100% - 216px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-team .team-main-portrait,
  .panel-team.is-changing .team-main-portrait,
  .panel-team.is-changing .team-details {
    animation: none !important;
    transform: none !important;
  }

  .team-main-portrait__frame {
    transition: none;
  }
}
