.profile-shell {
  display: flex;
  flex-direction: column;
  block-size: auto;
  min-block-size: 100svh;
}

.profile-stage {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  padding: clamp(1.75rem, 4svh, 4rem) var(--gutter);
}

.profile-scene {
  inline-size: min(100%, clamp(17.5rem, 26.709375vw, 32.052rem));
  perspective: 1100px;
}

.profile-reveal { transform-style: preserve-3d; }

.profile-preparing .profile-reveal { visibility: hidden; }

.profile-card {
  position: relative;
  aspect-ratio: 512.82 / 696.75;
  perspective: 1100px;
}

.profile-face {
  position: absolute;
  inset: 0;
  isolation: isolate;
  border-radius: 6.339% / 4.666%;
  background: #4d4d4d;
}

.profile-photo {
  position: absolute;
  inset-block-start: 4.281%;
  inset-inline-start: 4.963%;
  inline-size: 90.578%;
  block-size: 80.782%;
  overflow: hidden;
  border-radius: 2.723% / 2.248%;
}

.profile-photo-mask, .profile-photo-content, .profile-portrait-motion, .profile-portrait-scroll {
  position: absolute;
  inset: 0;
}

.profile-photo-mask { overflow: hidden; }
.profile-photo-content { background: #546074; }

.profile-portrait-scroll img {
  position: absolute;
  inset-block-start: -3.157%;
  inset-inline-start: -1.404%;
  display: block;
  inline-size: 103.867%;
  block-size: auto;
}

.profile-reflection {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  mix-blend-mode: screen;
  pointer-events: none;
}

.profile-light {
  position: absolute;
  inset: -22%;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, rgb(255 252 238 / 0.54), rgb(183 215 255 / 0.24) 25%, transparent 62%),
    linear-gradient(120deg, transparent 25%, rgb(123 180 255 / 0.16) 40%, rgb(245 196 219 / 0.28) 49%, rgb(255 237 167 / 0.16) 57%, transparent 69%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 68%);
}

.profile-name, .profile-status, .profile-contact {
  position: absolute;
  z-index: 2;
  margin: 0;
}

.profile-name {
  inset-block-start: 86.578%;
  inset-inline-start: 4.953%;
  inline-size: 37.181%;
}

.profile-status {
  inset-block-start: 92.884%;
  inset-inline-start: 4.953%;
  inline-size: 10.838%;
}

.profile-name img, .profile-status img, .profile-contact img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.profile-contact {
  inset-block-start: 89.427%;
  inset-inline-start: 81.516%;
  display: grid;
  place-items: center;
  inline-size: 14.026%;
  block-size: 5.546%;
  border-radius: 9.092% / 16.925%;
  background: #333;
  transition: background-color 180ms ease-out;
}

.profile-contact img { inline-size: 56.333%; }
.profile-contact:hover, .profile-contact:focus-visible { background: #424242; }

.profile-contact::after {
  position: absolute;
  inset: -12px -6px;
  content: "";
}

@media (max-width: 760px), (max-aspect-ratio: 59/50) {
  .profile-scene { inline-size: min(100%, 22rem); }
}

@media (max-width: 760px) and (orientation: portrait) {
  .profile-stage {
    padding-block: clamp(0.9rem, 3.6svh, 2rem) var(--controls-space);
  }

  .profile-scene {
    inline-size: min(100%, 22rem, max(13.75rem, calc((100svh - 12.125rem) * 0.736)));
  }
}

@media (hover: none) and (pointer: coarse) and (max-height: 34rem) and (orientation: landscape) {
  .profile-stage { padding-block: 0.75rem 1rem; }
  .profile-scene { inline-size: min(17rem, max(12rem, calc((100svh - 5.75rem) * 0.736))); }
}

@media (hover: none) and (pointer: coarse) {
  .profile-contact { touch-action: manipulation; }
  .profile-contact::after {
    inset: 50% auto auto 50%;
    inline-size: max(100%, 44px);
    block-size: max(100%, 44px);
    translate: -50% -50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-preparing .profile-reveal { visibility: visible; }
  .profile-contact { transition: none; }
}
