/* ==========================================================================
   ProfileCard —— React Bits 官方 ProfileCard（TS + CSS）的原生移植
   源码：https://raw.githubusercontent.com/DavidHDev/react-bits/main/public/r/ProfileCard-TS-CSS.json
   许可：MIT + Commons Clause（Copyright (c) David HDev / react-bits）
   移植说明：官方为 React 组件，本项目为无构建的静态页面，故保留原有类名、
   CSS 自定义属性、弹簧参数与视觉层叠顺序，用等价的原生 JS 驱动（见 pcard.js）。
   ========================================================================== */

.profile-card {
  --pc-radius: 16px;
  --pc-holo: .32;
  --pc-glare: .5;
  --pc-parallax: 8px;
  --pc-status: #5b9dff;

  /* dark 主题（官方 THEMES.dark） */
  --pc-frame: rgba(38, 35, 46, .66);
  --pc-frame-edge: rgba(255, 255, 255, .08);
  --pc-frame-highlight: rgba(255, 255, 255, .07);
  --pc-frame-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8), 0 6px 16px -8px rgba(0, 0, 0, .5);
  --pc-tile: linear-gradient(180deg, #3a3644 0%, #27242f 100%);
  --pc-tile-edge: rgba(255, 255, 255, .07);
  --pc-tile-highlight: rgba(255, 255, 255, .12);
  --pc-tile-shadow: 0 4px 10px -4px rgba(0, 0, 0, .7);
  --pc-ink: #f4f4f5;
  --pc-muted: rgba(244, 244, 245, .6);
  --pc-hover: brightness(1.12);
  --pc-press: brightness(.8);
  --pc-shade: rgba(0, 0, 0, .4);
  --pc-backdrop: var(--pc-tile);

  /* dark 箔纸（官方 FOILS.dark） */
  --pc-blend: color-dodge;
  --pc-holo-filter: hue-rotate(0deg);

  /* 全息纹理：不用规则图案遮罩（会像一层静态反光膜），改为整面箔纸跟随指针流动 */
  --pc-holo-gain: 1;
  --pc-holo-detail: .4;
  --pc-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0.55 0 0 0 -0.24 0.55 0 0 0 -0.24 0.55 0 0 0 -0.24 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");

  --pc-light-x: 50%;
  --pc-light-y: 50%;
  --pc-pointer-x: 50%;
  --pc-pointer-y: 50%;
  --pc-band-x: 50%;
  --pc-band-y: 50%;
  --pc-reach: 0;
  --pc-rotate-x: 0deg;
  --pc-rotate-y: 0deg;
  --pc-shift-x: 0px;
  --pc-shift-y: 0px;
  --pc-tilt: 0;
  --pc-active: 0;
  position: relative;
  width: 340px;
  max-width: 100%;
  perspective: 1000px;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.profile-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: calc(var(--pc-radius) + 10px);
  background: var(--pc-frame);
  box-shadow: var(--pc-frame-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  transform: rotateX(var(--pc-rotate-x)) rotateY(var(--pc-rotate-y));
  will-change: transform;
}

.profile-card__tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--pc-radius);
  background: var(--pc-backdrop);
  box-shadow: var(--pc-tile-shadow);
  overflow: hidden;
  isolation: isolate;
}

.profile-card__holo,
.profile-card__scrim,
.profile-card__tile-rim,
.profile-card__glare,
.profile-card__shade,
.profile-card__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.profile-card__holo {
  --pc-spectrum: repeating-linear-gradient(
    0deg,
    hsl(2, 100%, 73%) 5%,
    hsl(53, 100%, 69%) 10%,
    hsl(93, 100%, 69%) 15%,
    hsl(176, 100%, 76%) 20%,
    hsl(228, 100%, 74%) 25%,
    hsl(260, 100%, 76%) 30%,
    hsl(2, 100%, 73%) 35%
  );
  --pc-bars: repeating-linear-gradient(
    -45deg,
    #0e152e 0%,
    hsl(180, 10%, 60%) 3.8%,
    hsl(180, 29%, 66%) 4.5%,
    hsl(180, 10%, 60%) 5.2%,
    #0e152e 10%,
    #0e152e 12%
  );
  --pc-falloff: radial-gradient(
    farthest-corner circle at var(--pc-pointer-x) var(--pc-pointer-y),
    hsla(0, 0%, 0%, .1) 12%,
    hsla(0, 0%, 0%, .15) 20%,
    hsla(0, 0%, 0%, .25) 120%
  );
  background-image: var(--pc-spectrum), var(--pc-bars), var(--pc-falloff);
  background-position:
    0 var(--pc-band-y),
    var(--pc-band-x) var(--pc-band-y),
    center;
  background-size:
    500% 500%,
    300% 300%,
    200% 200%;
  background-blend-mode: color, hard-light;
  mix-blend-mode: var(--pc-blend);
  filter: brightness(calc(.66 + .19 * var(--pc-active))) contrast(calc(1.33 + .17 * var(--pc-active)))
    saturate(calc(.33 + .17 * var(--pc-active))) var(--pc-holo-filter);
  /* 静止时完全透明：只有指针进入 / 移动时才浮现箔纸，不再有静态「规则膜」 */
  opacity: calc(var(--pc-holo) * var(--pc-holo-gain) * var(--pc-active));
}

.profile-card__holo-glow,
.profile-card__holo-shift {
  position: absolute;
  inset: 0;
  opacity: calc(var(--pc-active) * var(--pc-holo-detail));
}

.profile-card__holo-glow {
  background-image:
    linear-gradient(
      45deg,
      hsl(176, 100%, 76%),
      hsl(228, 100%, 74%),
      hsl(260, 100%, 76%),
      hsl(2, 100%, 73%),
      hsl(53, 100%, 69%),
      hsl(93, 100%, 69%)
    ),
    radial-gradient(circle at var(--pc-pointer-x) var(--pc-pointer-y), hsl(0, 0%, 70%) 0%, hsla(0, 0%, 30%, .2) 90%),
    var(--pc-grain);
  background-size:
    250% 250%,
    100% 100%,
    220px 220px;
  background-position:
    var(--pc-pointer-x) var(--pc-pointer-y),
    center,
    0 0;
  background-blend-mode: color-dodge;
  filter: brightness(calc(2 - var(--pc-reach))) contrast(calc(var(--pc-reach) + 2))
    saturate(calc(.5 + var(--pc-reach)));
  mix-blend-mode: luminosity;
}

.profile-card__holo-shift {
  background-image: var(--pc-spectrum), var(--pc-bars), var(--pc-falloff);
  background-position:
    0 var(--pc-band-y),
    calc(var(--pc-band-x) * .4) calc(var(--pc-band-y) * .5),
    center;
  background-size:
    200% 300%,
    700% 700%,
    100% 100%;
  background-blend-mode: color, hard-light;
  mix-blend-mode: difference;
  filter: brightness(.8) contrast(1.5);
}

.profile-card__photo {
  position: absolute;
  inset: calc(var(--pc-parallax) * -1);
  width: calc(100% + var(--pc-parallax) * 2);
  height: calc(100% + var(--pc-parallax) * 2);
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center bottom;
  transform: translate3d(var(--pc-shift-x), var(--pc-shift-y), 0);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 站点全局有 `.rf img { max-width:100% }`（0,1,1），单类名压不过它，
   视差外扩的宽度会被裁回、右侧露出黑边 —— 用双类名覆盖 */
.profile-card .profile-card__photo {
  max-width: none;
  max-height: none;
}

.profile-card__scrim {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .72) 0%,
    rgba(0, 0, 0, .66) 8%,
    rgba(0, 0, 0, .56) 15%,
    rgba(0, 0, 0, .44) 23%,
    rgba(0, 0, 0, .3) 31%,
    rgba(0, 0, 0, .17) 39%,
    rgba(0, 0, 0, .07) 47%,
    rgba(0, 0, 0, 0) 56%
  );
}

.profile-card__info {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  color: #ffffff;
}

.profile-card__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: inherit;
}

.profile-card__title {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .78);
}

.profile-card__tile-rim {
  box-shadow:
    inset 0 0 0 1px var(--pc-tile-edge),
    inset 0 1px 0 var(--pc-tile-highlight);
}

.profile-card__footer {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 8px 12px 10px;
}

/* 应聘地点 / 全职 */
.pc-facts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.pc-fact {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.pc-fact em {
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .16em;
  color: var(--pc-muted);
}

.pc-fact b {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .04em;
  color: var(--pc-ink);
}

.pc-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #9cc8ff;
  background: rgba(62, 207, 142, .12);
  box-shadow: inset 0 0 0 1px rgba(62, 207, 142, .32);
}

/* 绿点 + 邮箱 */
.pc-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--pc-muted);
  text-decoration: none;
  transition: color .2s ease;
}

.pc-mail-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pc-status);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, .16);
}

.pc-mail:hover { color: var(--pc-ink); }

.pc-mail:focus-visible {
  outline: 2px solid var(--pc-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.profile-card__glare {
  background: radial-gradient(
    farthest-corner circle at var(--pc-light-x) var(--pc-light-y),
    rgba(255, 255, 255, .8) 0%,
    rgba(255, 255, 255, .36) 20%,
    rgba(255, 255, 255, 0) 60%
  );
  mix-blend-mode: overlay;
  opacity: calc(var(--pc-glare) * var(--pc-active));
}

.profile-card__shade {
  background: radial-gradient(
    farthest-corner circle at var(--pc-light-x) var(--pc-light-y),
    transparent 30%,
    var(--pc-shade) 100%
  );
  opacity: calc(var(--pc-glare) * var(--pc-tilt));
}

.profile-card__rim {
  box-shadow:
    inset 0 0 0 1px var(--pc-frame-edge),
    inset 0 1px 0 var(--pc-frame-highlight);
}
