.profile-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 19;
  background: transparent;
}

.profile-scrim.is-active {
  display: block;
}

.profile {
  --profile-w: min(12.5rem, calc(100vw - 8rem));
  --profile-w-open: min(17.5rem, calc(100vw - 8rem));
  --profile-pad: 0.35rem;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.profile__card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: var(--profile-w);
  padding: var(--profile-pad);
  overflow: hidden;
  border-radius: 0.75rem;
  background: rgba(12, 12, 12, 0.5);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.profile__bar,
.profile__panel-inner {
  width: calc(var(--profile-w-open) - (var(--profile-pad) * 2));
  flex-shrink: 0;
}

.profile__bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.3rem;
}

.profile__avatar {
  display: block;
  width: 2.3rem;
  height: 2.3rem;
  object-fit: cover;
  border-radius: 0.45rem;
  background: var(--surface);
  flex-shrink: 0;
}

.profile__who {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.profile__name {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
}

.profile__role {
  max-height: 0;
  overflow: hidden;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  transition: max-height 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.profile__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.profile__panel-inner {
  overflow: hidden;
  min-height: 0;
}

.profile__bio {
  margin-top: 0.55rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.profile__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .profile__card:hover {
    width: var(--profile-w-open);
  }

  .profile__card:hover .profile__role {
    max-height: 1.2rem;
  }

  .profile__card:hover .profile__panel {
    grid-template-rows: 1fr;
  }
}

.profile.is-open .profile__card {
  width: var(--profile-w-open);
}

.profile.is-open .profile__role {
  max-height: 1.2rem;
}

.profile.is-open .profile__panel {
  grid-template-rows: 1fr;
}

@media (max-width: 560px) {
  .profile {
    --profile-w: min(11rem, calc(100vw - 7rem));
    --profile-w-open: min(15.5rem, calc(100vw - 2rem));
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .profile__name {
    font-size: 0.65rem;
  }
}
