:root {
  --profile-ink: #27252c;
  --profile-portrait-corner: 17%;
}

.profile-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgb(29 27 33 / .09);
  border-radius: 15px;
  background: rgb(255 255 255 / .74);
  color: var(--profile-ink);
  box-shadow: 0 1px 2px rgb(29 27 33 / .05), inset 0 1px 0 rgb(255 255 255 / .75);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: .875rem;
  font-weight: 640;
  line-height: 1;
  letter-spacing: -.014em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.profile-control:hover {
  background: #fff;
  box-shadow: 0 2px 7px rgb(29 27 33 / .09);
}

.profile-control:active { background: #eeedf0; }

.profile-control:focus-visible {
  outline: 2px solid #65537c;
  outline-offset: 3px;
}

.profile-chevron {
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  opacity: .58;
  rotate: 45deg;
}

@media (prefers-reduced-motion: no-preference) {
  .profile-control { transition: background-color 160ms ease, box-shadow 160ms ease; }

  :root {
    --portrait-open: 670ms;
    --portrait-return: 620ms;
    --portrait-return-delay: 112ms;
    --print-ease: cubic-bezier(.21, .76, .23, 1);
  }

  ::view-transition-group(profile-portrait) {
    z-index: 12;
    animation-duration: var(--portrait-open);
    animation-timing-function: var(--print-ease);
  }

  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-old(root) {
    z-index: 1;
    mix-blend-mode: normal;
    animation: profile-dissolve 360ms ease both;
  }

  ::view-transition-group(.profile-card) {
    --card-rise: min(26svh, 210px);
    --card-fall: 150svh;
    --card-catch: 230ms;
    --card-departure: 25ms;
    z-index: 3;
  }

  ::view-transition-group(profile-card-front) {
    --card-rise: min(20svh, 156px);
    --card-catch: 134ms;
    --card-departure: 0ms;
    z-index: 8;
  }

  ::view-transition-group(profile-card-back-1) {
    --card-catch: 232ms;
    --card-departure: 48ms;
    z-index: 7;
  }

  ::view-transition-group(profile-card-back-2) {
    --card-rise: min(34svh, 290px);
    --card-catch: 280ms;
    --card-departure: 78ms;
    z-index: 6;
  }

  ::view-transition-group(profile-card-back-3) {
    --card-rise: min(42svh, 360px);
    --card-fall: 195svh;
    --card-catch: 328ms;
    --card-departure: 104ms;
    z-index: 5;
  }

  ::view-transition-group(profile-card-back-4) {
    --card-rise: min(46svh, 400px);
    --card-fall: 240svh;
    --card-catch: 376ms;
    --card-departure: 130ms;
    z-index: 4;
  }

  ::view-transition-group(profile-card-peek) {
    --card-rise: min(11svh, 84px);
    --card-catch: 410ms;
    --card-departure: 0ms;
    z-index: 9;
  }

  ::view-transition-old(.profile-card) {
    mix-blend-mode: normal;
    animation: profile-cards-close 365ms cubic-bezier(.58, .04, .83, .54) var(--card-departure) both;
  }

  ::view-transition-new(.profile-card) {
    mix-blend-mode: normal;
    animation: profile-cards-deal 470ms var(--print-ease) var(--card-catch) both;
  }

  @keyframes profile-cards-close {
    from { transform: none; }
    to { transform: translateY(var(--card-fall)) scale(.975); }
  }

  @keyframes profile-cards-deal {
    0% { opacity: 0; transform: translateY(var(--card-rise)) scale(.94); }
    32% { opacity: 1; }
    84% { transform: translateY(-2px) scale(1); }
    100% { opacity: 1; transform: none; }
  }

  @keyframes profile-dissolve {
    to { opacity: 0; }
  }
}
