.profile-pass {
  --pass-rx: 0deg;
  --pass-ry: 0deg;
  position: relative;
  width: 190px;
  height: 300px;
  justify-self: end;
  align-self: start;
  margin: 0;
  padding: 30px 0 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  touch-action: manipulation;
}

.profile-pass-tether {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, rgba(165, 139, 99, 0), rgba(165, 139, 99, 0.86));
  transform: translateX(-50%);
  transform-origin: 50% 0;
}

.profile-pass-tether::after {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 16px;
  height: 8px;
  border: 1px solid rgba(243, 244, 237, 0.34);
  border-radius: 999px;
  background: #111417;
  content: "";
  transform: translateX(-50%);
}

.profile-pass-tilt,
.profile-pass-card,
.profile-pass-face {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-pass-tilt {
  height: 270px;
  transform: rotateX(var(--pass-rx)) rotateY(var(--pass-ry));
  transform-style: preserve-3d;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-pass-card {
  position: relative;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-pass.is-flipped .profile-pass-card {
  transform: rotateY(180deg);
}

.profile-pass-face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 22px 18px 18px;
  border: 1px solid rgba(243, 244, 237, 0.14);
  border-radius: 14px;
  backface-visibility: hidden;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.25);
}

.profile-pass-front {
  background:
    linear-gradient(150deg, rgba(165, 139, 99, 0.14), transparent 42%),
    #111417;
}

.profile-pass-back {
  background:
    linear-gradient(145deg, rgba(243, 244, 237, 0.06), transparent 48%),
    #0c0f11;
  transform: rotateY(180deg);
}

.profile-pass-slot {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  width: 32px;
  height: 5px;
  border: 1px solid rgba(243, 244, 237, 0.22);
  border-radius: 999px;
  background: #050708;
  transform: translateX(-50%);
  pointer-events: none;
}

.profile-pass-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(243, 244, 237, 0.5);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.profile-pass-mark {
  position: absolute;
  top: 72px;
  left: 50%;
  width: 68px;
  aspect-ratio: 1;
  background: var(--acid);
  transform: translateX(-50%);
  -webkit-mask: url("bianhao-logo.svg") center / contain no-repeat;
  mask: url("bianhao-logo.svg") center / contain no-repeat;
}

.profile-pass-name {
  position: absolute;
  right: 18px;
  bottom: 42px;
  left: 18px;
  display: grid;
  gap: 7px;
  text-align: left;
}

.profile-pass-name strong {
  color: #f3f4ed;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.profile-pass-name span,
.profile-pass-back-list strong {
  color: rgba(243, 244, 237, 0.68);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.55;
}

.profile-pass-prompt {
  position: absolute;
  right: 18px;
  bottom: 15px;
  left: 18px;
  color: rgba(165, 139, 99, 0.8);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: right;
}

.profile-pass-back-list {
  display: grid;
  gap: 13px;
  margin-top: 29px;
  text-align: left;
}

.profile-pass-back-list > span {
  display: grid;
  gap: 4px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(243, 244, 237, 0.1);
}

.profile-pass-back-list small {
  color: rgba(165, 139, 99, 0.86);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.profile-pass:hover .profile-pass-face {
  border-color: rgba(165, 139, 99, 0.34);
}

.profile-pass:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 5px;
  border-radius: 14px;
}

.profile-dossier.in-view .profile-pass {
  animation: profile-pass-arrive 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes profile-pass-arrive {
  0% { opacity: 0; transform: translateY(-22px) rotate(2.8deg); }
  48% { opacity: 1; transform: translateY(4px) rotate(-1.2deg); }
  74% { transform: translateY(-2px) rotate(0.4deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

@media (max-width: 767px) {
  .profile-identity {
    grid-template-columns: 1fr;
  }

  .profile-pass {
    width: 176px;
    height: 280px;
    justify-self: start;
    margin-top: 8px;
    perspective: none;
  }

  .profile-pass-tilt {
    height: 250px;
    transform: none !important;
    transition: none;
  }

  .profile-pass-card {
    transition: none;
  }

  .profile-dossier.in-view .profile-pass {
    animation: none;
  }

  .profile-pass-face {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-pass,
  .profile-pass-tilt,
  .profile-pass-card {
    animation: none !important;
    transition: none !important;
  }

  .profile-pass-tilt {
    transform: none !important;
  }
}

html[data-reduced-motion="true"] .profile-pass,
html[data-reduced-motion="true"] .profile-pass-tilt,
html[data-reduced-motion="true"] .profile-pass-card {
  animation: none !important;
  transition: none !important;
}

html[data-reduced-motion="true"] .profile-pass-tilt {
  transform: none !important;
}

/* Full WebGL lanyard experience. The earlier profile-pass rules remain as a
   harmless fallback for older cached markup; the live dossier uses this stage. */
.profile-identity {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.profile-identity-copy {
  align-self: end;
  padding-bottom: 56px;
}

.profile-lanyard {
  position: absolute;
  z-index: 5;
  inset: -220px -12vw -220px;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
  outline: none;
  pointer-events: none;
  user-select: none;
}

.profile-lanyard::after {
  display: none;
}

.profile-lanyard-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-lanyard-hitbox {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: block;
  border-radius: 18px;
  cursor: grab;
  pointer-events: auto;
  touch-action: pan-y;
  will-change: transform;
}

.profile-lanyard.is-dragging .profile-lanyard-hitbox {
  cursor: grabbing;
}

.profile-lanyard.is-ready .profile-lanyard-canvas {
  opacity: 1;
}

.profile-lanyard-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 220ms ease;
}

.profile-lanyard.is-ready .profile-lanyard-fallback {
  opacity: 0;
  pointer-events: none;
}

.profile-lanyard-fallback-rope {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 9px;
  height: 178px;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, #c2b492 0 5px, #343a3c 5px 12px);
  transform: translateX(-50%) rotate(-4deg);
  transform-origin: 50% 0;
}

.profile-lanyard-fallback-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 8px;
  width: 226px;
  height: 316px;
  margin-top: 104px;
  padding: 26px;
  border: 1px solid rgba(243, 244, 237, 0.17);
  border-radius: 14px;
  color: #f3f4ed;
  background: #111417;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  transform: rotate(2deg);
}

.profile-lanyard-fallback-mark {
  position: absolute;
  top: 48px;
  left: 50%;
  width: 110px;
  aspect-ratio: 1;
  background: #a58b63;
  transform: translateX(-50%);
  -webkit-mask: url("bianhao-logo.svg") center / contain no-repeat;
  mask: url("bianhao-logo.svg") center / contain no-repeat;
}

.profile-lanyard-fallback-card strong {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.profile-lanyard-fallback-card small {
  color: rgba(243, 244, 237, 0.62);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .profile-lanyard {
    inset: -180px -8vw -180px;
  }
}

@media (max-width: 767px) {
  .profile-identity {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .profile-identity-copy {
    padding-bottom: 0;
  }

  .profile-lanyard {
    position: relative;
    z-index: auto;
    inset: auto;
    width: 100%;
    max-width: 420px;
    height: 560px;
    justify-self: center;
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-lanyard-hitbox {
    cursor: default;
    touch-action: auto;
  }

  .profile-lanyard-canvas,
  .profile-lanyard-fallback {
    transition: none;
  }
}

html[data-reduced-motion="true"] .profile-lanyard-hitbox {
  cursor: default;
  touch-action: auto;
}
