:root {
  --pointer-x: 50%;
  --pointer-y: 50%;
  --pointer-from-center: 0;
  --pointer-from-top: 0.5;
  --pointer-from-left: 0.5;
  --card-opacity: 0;
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --background-x: 50%;
  --background-y: 50%;
  --grain: none;
  --icon: none;
  --behind-gradient: none;
  --behind-glow-color: rgba(125, 190, 255, 0.67);
  --behind-glow-size: 25%;
  --inner-gradient: none;
  --sunpillar-1: hsl(2, 100%, 73%);
  --sunpillar-2: hsl(53, 100%, 69%);
  --sunpillar-3: hsl(93, 100%, 69%);
  --sunpillar-4: hsl(176, 100%, 76%);
  --sunpillar-5: hsl(228, 100%, 74%);
  --sunpillar-6: hsl(283, 100%, 73%);
  --sunpillar-clr-1: var(--sunpillar-1);
  --sunpillar-clr-2: var(--sunpillar-2);
  --sunpillar-clr-3: var(--sunpillar-3);
  --sunpillar-clr-4: var(--sunpillar-4);
  --sunpillar-clr-5: var(--sunpillar-5);
  --sunpillar-clr-6: var(--sunpillar-6);
  --card-radius: 30px;
}

.pc-card-wrapper {
  perspective: 500px;
  transform: translate3d(0, 0, 0.1px);
  position: relative;
  touch-action: none;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.pc-behind {
  display: none !important;
}

.pc-card-wrapper:hover,
.pc-card-wrapper.active {
  --card-opacity: 1;
}

.pc-card {
  height: 80svh;
  max-height: 540px;
  display: grid;
  aspect-ratio: 0.718;
  border-radius: var(--card-radius);
  position: relative;
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: transform 1s ease;
  transform: translateZ(0) rotateX(0deg) rotateY(0deg);
  backface-visibility: hidden;
  overflow: hidden;
  animation: none !important;
}

.pc-card:hover,
.pc-card.active {
  transition: none;
  transform: translateZ(0) rotateX(var(--rotate-y)) rotateY(var(--rotate-x));
}

.pc-card-shell.entering .pc-card {
  transition: transform 180ms ease-out;
}

.pc-card-shell {
  position: relative;
  z-index: 1;
}

.pc-card * {
  display: grid;
  grid-area: 1/-1;
  border-radius: var(--card-radius);
  pointer-events: none;
}

.pc-inside {
  inset: 0;
  position: absolute;
  background-image: var(--inner-gradient);
  background-color: rgba(0, 0, 0, 0.9);
  transform: none;
}

.pc-shine {
  display: none !important;
}

.pc-shine,
.pc-shine::after {
  display: none !important;
}

.pc-shine::before,
.pc-shine::after {
  display: none !important;
}

.pc-glare {
  display: none !important;
}

.pc-avatar-content {
  mix-blend-mode: normal;
  overflow: hidden;
  transform: translateZ(2);
  backface-visibility: hidden;
  background: transparent;
}

.pc-avatar-content .avatar {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 50%;
  transform-origin: 50% 100%;
  transform: translateX(calc(-50% + (var(--pointer-from-left) - 0.5) * 6px)) translateZ(0)
    scaleY(calc(1 + (var(--pointer-from-top) - 0.5) * 0.02)) scaleX(calc(1 + (var(--pointer-from-left) - 0.5) * 0.01));
  bottom: 0;
  object-fit: cover;
  object-position: top center;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 120ms ease-out;
  display: block;
  border-radius: 0;
}

.pc-avatar-content::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: none;
  pointer-events: none;
}

.pc-user-info {
  position: absolute;
  --ui-inset: 14px;
  --ui-radius-bias: 6px;
  bottom: var(--ui-inset);
  left: var(--ui-inset);
  right: var(--ui-inset);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: calc(max(0px, var(--card-radius) - var(--ui-inset) + var(--ui-radius-bias)));
  padding: 10px 12px;
  pointer-events: auto;
}

.pc-user-details {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pc-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pc-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pc-user-text {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pc-handle {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.pc-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.pc-contact-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.pc-contact-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
}

.pc-content:not(.pc-avatar-content) {
  max-height: 100%;
  overflow: hidden;
  text-align: center;
  position: relative;
  transform: translate3d(
    calc(var(--pointer-from-left) * -6px + 3px),
    calc(var(--pointer-from-top) * -6px + 3px),
    0.1px
  );
  z-index: 5;
  mix-blend-mode: luminosity;
}

.pc-details {
  width: 100%;
  position: absolute;
  top: 2.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.pc-details h3 {
  font-weight: 700;
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.1;
  background-image: linear-gradient(to bottom, #fff, #d0d0ff);
  background-size: 1em 1.5em;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  text-align: center;
}

.pc-details p {
  font-weight: 600;
  position: relative;
  top: 4px;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 auto;
  width: min-content;
  background-image: linear-gradient(to bottom, #fff, #9a9aff);
  background-size: 1em 1.5em;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  opacity: 0.95;
}

@keyframes glow-bg {
  0% { --bgrotate: 0deg; }
  100% { --bgrotate: 360deg; }
}

@keyframes holo-bg {
  0% {
    background-position:
      0 var(--background-y),
      0 0,
      center;
  }
  100% {
    background-position:
      0 var(--background-y),
      90% 90%,
      center;
  }
}

@media (max-width: 768px) {
  .pc-card {
    height: 70svh;
    max-height: 450px;
  }
  .pc-details { top: 2em; }
  .pc-details h3 { font-size: 1.35rem; }
  .pc-details p { font-size: 11px; }
  .pc-user-info { --ui-inset: 12px; padding: 9px 10px; }
  .pc-mini-avatar { width: 30px; height: 30px; }
  .pc-handle { font-size: 11px; }
  .pc-status { font-size: 10px; }
  .pc-contact-btn { padding: 7px 10px; font-size: 10px; }
}

@media (max-width: 480px) {
  .pc-card { height: 60svh; max-height: 380px; }
  .pc-details { top: 1.5em; }
  .pc-details h3 { font-size: 1.15rem; }
  .pc-details p { font-size: 10px; top: 2px; }
  .pc-user-info { --ui-inset: 10px; padding: 8px 9px; }
  .pc-mini-avatar { width: 26px; height: 26px; }
  .pc-contact-btn { padding: 6px 9px; font-size: 9px; border-radius: 50px; }
}

/* ===== TEAM OVERRIDES FOR PROFILECARD ===== */
.team .pc-card-wrapper {
  max-width: 100%;
}

.team__grid--profile {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 60px;
  align-items: start;
}

@media (max-width: 1023px) {
  .team__grid--profile { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}
@media (max-width: 600px) {
  .team__grid--profile { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
}

/* Ensure avatar covers correctly and not luminosity washed */
.team .pc-avatar-content { mix-blend-mode: normal; }
.team .pc-avatar-content .avatar { mix-blend-mode: normal; filter: none; }

/* Remove disappear/appear effect — cards always visible (no opacity/transform hide) */
.team .pc-card-wrapper,
.team .pc-card-wrapper.reveal,
.team .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.team .pc-card-wrapper { --card-opacity: 1 !important; }

/* Remove top name/role and keep only lower small box — per request */
.team .pc-details { display: none !important; }
.team .pc-content:not(.pc-avatar-content) { display: none !important; }
/* Enlarge lower box to fit name+role */
.team .pc-user-info {
  padding: 12px 14px;
  gap: 12px;
}
.team .pc-handle {
  font-size: 13px;
  font-weight: 700;
  max-width: 150px;
}
.team .pc-status {
  font-size: 11px;
  max-width: 150px;
}

/* Override to make team cards slightly shorter for grid harmony */
.team .pc-card {
  height: 440px;
  max-height: 440px;
}
@media (max-width: 768px) {
  .team .pc-card { height: 400px; max-height: 400px; }
}

/* ===== SHINING EFFECT ===== */
.pc-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.pc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  background: radial-gradient(650px circle at var(--pointer-x) var(--pointer-y), rgba(255,255,255,0.22), rgba(255,255,255,0.08) 22%, transparent 48%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.pc-card-wrapper:hover .pc-card::before,
.pc-card-wrapper.active .pc-card::before {
  opacity: 1;
}

.pc-card::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0) 35%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0) 65%, transparent 100%);
  transform: skewX(-14deg) translateX(0);
  opacity: 0;
  filter: blur(0.5px);
  z-index: 4;
  pointer-events: none;
  border-radius: 0;
  mix-blend-mode: soft-light;
}

.pc-card-wrapper:hover .pc-card::after,
.pc-card-wrapper.active .pc-card::after {
  animation: pc-shine-sweep 0.95s ease;
  opacity: 1;
}

@keyframes pc-shine-sweep {
  0% { transform: skewX(-14deg) translateX(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: skewX(-14deg) translateX(360%); opacity: 0; }
}

.team .pc-card-wrapper:hover .pc-card,
.team .pc-card-wrapper.active .pc-card {
  box-shadow: 0 10px 36px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.14), 0 0 32px rgba(37, 99, 235, 0.22);
}

/* keep user info above shine */
.team .pc-user-info {
  z-index: 6 !important;
  position: absolute;
}

/* subtle continuous gleam on idle for visual cue - runs once every 4s */
@media (prefers-reduced-motion: no-preference) {
  .pc-card-wrapper:not(:hover) .pc-card::after {
    animation: pc-shine-idle 4.5s ease-in-out infinite;
    animation-delay: 1.2s;
    opacity: 0;
  }
  @keyframes pc-shine-idle {
    0%, 85% { transform: skewX(-14deg) translateX(0); opacity: 0; }
    88% { opacity: 0.55; }
    92% { transform: skewX(-14deg) translateX(360%); opacity: 0; }
    100% { opacity: 0; }
  }
}
