/* Member profile — two-pane dialog (js/components/profile.js). Photo left, details right. */

.pf {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s var(--ease),
    visibility 0s 0.45s;
}

.pf.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease);
}

html.pf-lock {
  overflow: hidden;
}

.pf-bg {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 4, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pf-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  width: min(1100px, 100%);
  height: min(720px, calc(100dvh - 48px));
  border-radius: 32px;
  border: 1px solid var(--w10);
  background: rgba(9, 9, 11, 0.97);
  box-shadow: 0 60px 120px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  outline: none;
  transform: translateY(32px) scale(0.97);
  transition: transform 0.7s var(--ease);
}

.pf.open .pf-panel {
  transform: none;
}

/* Close */
.pf-x {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.6);
  border: 1px solid var(--w18);
  transition:
    background 0.5s var(--ease),
    border-color 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.pf-x span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1px;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}

.pf-x span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.pf-x:hover {
  background: #fff;
  border-color: #fff;
  transform: rotate(90deg);
}

.pf-x:hover span {
  background: #050505;
}

/* Left pane — photo, or initials until a photo is added */
.pf-media {
  position: relative;
  min-height: 0;
  border-right: 1px solid var(--w05);
}

.pf-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 28% 22%, color-mix(in srgb, var(--t, var(--accent)) 42%, transparent), transparent 65%),
    radial-gradient(80% 60% at 85% 95%, var(--cool-25), transparent 60%), #0d0e16;
}

/* Pixel grid, echoing the club mark; fades out towards the edges. */
.pf-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--w05) 1px, transparent 1px), linear-gradient(90deg, var(--w05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
}

.pf-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(9, 9, 11, 0.85) 100%);
}

.pf-photo.has-photo::before {
  display: none;
}

.pf-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.pf-photo.is-ready .pf-img {
  opacity: 1;
}

/* Small photos: framed at a size they can hold, over a blurred, dimmed copy of themselves. */
.pf-amb {
  display: none;
}

.pf-photo.is-small .pf-amb {
  display: block;
  position: absolute;
  inset: -60px;
  width: calc(100% + 120px);
  height: calc(100% + 120px);
  object-fit: cover;
  filter: blur(40px) saturate(1.15) brightness(0.42);
}

.pf-photo.is-small .pf-img {
  position: relative;
  inset: auto;
  width: min(72%, 340px, var(--nw, 340px) * 1.5);
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--w18);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}

.pf-mono {
  position: relative;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(6rem, 13vw, 11rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent-pale);
  text-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.pf-group {
  position: absolute;
  left: 28px;
  bottom: 26px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid var(--w30);
  background: rgba(5, 5, 5, 0.6);
  font-family: var(--ui);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

/* Right pane — details, then the prev/next bar */
.pf-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pf-info {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 60px 56px 32px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--w18) transparent;
}

.pf-role {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--accent-pale);
}

.pf-info h2 {
  padding-right: 56px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.pf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 14px;
}

.pf-study {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Separator hangs off the role, so a wrapped line never starts with it. */
.pf-role::after {
  content: "·";
  margin-left: 12px;
  color: var(--w30);
}

/* Description, set off from the name, role and links above. */
.pf-about {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--w05);
}

.pf-about > :first-child {
  margin-top: 0;
}

.pf-headline {
  max-width: 48ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--accent-pale);
}

.pf-bio {
  margin-top: 14px;
  max-width: 60ch;
  line-height: 1.75;
  font-size: 1.04rem;
  color: var(--text);
}

.pf-info h3 {
  margin: 28px 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.12rem;
  color: var(--accent-pale);
}

.pf-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-skills li {
  padding: 7px 12px;
  border-radius: 100px;
  border: 1px solid var(--w18);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fff;
}

.pf-hl {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-hl li {
  position: relative;
  padding-left: 16px;
  line-height: 1.5;
  font-size: 1rem;
  color: var(--text);
}

.pf-hl li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

.pf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.pf-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px 9px 13px;
  border-radius: 100px;
  border: 1px solid var(--w18);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  transition:
    background 0.4s var(--ease),
    color 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.pf-link svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.pf-bid svg {
  color: var(--accent-pale);
}

.pf-bid:hover svg {
  color: currentColor;
}

.pf-link:hover {
  background: #fff;
  border-color: #fff;
  color: #050505;
}

.pf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 16px 56px;
  border-top: 1px solid var(--w05);
}

.pf-count {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.pf-prev,
.pf-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 44px;
  border-radius: 100px;
  border: 1px solid var(--w18);
  color: #fff;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  transition:
    background 0.4s var(--ease),
    color 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.pf-prev {
  order: -1;
  width: 44px;
}

.pf-prev svg {
  transform: rotate(180deg);
}

.pf-prev svg,
.pf-next svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.pf-next {
  max-width: 60%;
  padding: 0 14px 0 18px;
}

.pf-next span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pf-prev:hover,
.pf-next:hover {
  background: #fff;
  border-color: #fff;
  color: #050505;
}

.pf-count {
  margin-right: auto;
}

/* Entrance — replayed for every person (the panel gets .pf-swap on each render). */
.pf-swap .pf-photo > * {
  animation: pf-rise 0.8s var(--ease) both;
}

.pf-swap .pf-info > * {
  animation: pf-rise 0.7s var(--ease) both;
}

.pf-swap .pf-info > :nth-child(2) {
  animation-delay: 0.04s;
}

.pf-swap .pf-info > :nth-child(3) {
  animation-delay: 0.08s;
}

.pf-swap .pf-info > :nth-child(n + 4) {
  animation-delay: 0.12s;
}

@keyframes pf-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-panel,
  .pf-swap .pf-photo > *,
  .pf-swap .pf-info > * {
    transition: none;
    animation: none;
  }
}

/* Stacked: photo on top, details below, the whole panel scrolls. */
@media (max-width: 800px) {
  .pf {
    padding: 10px;
  }

  .pf-panel {
    display: block;
    height: auto;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px;
  }

  .pf-media {
    height: min(46vh, 420px);
    border-right: 0;
    border-bottom: 1px solid var(--w05);
  }

  .pf-mono {
    font-size: 7rem;
  }

  .pf-group {
    left: 20px;
    bottom: 18px;
  }

  .pf-info {
    overflow: visible;
    padding: 28px 22px 24px;
  }

  .pf-info h2 {
    padding-right: 0;
  }

  .pf-meta {
    flex-direction: column;
    gap: 6px;
  }

  .pf-role::after {
    display: none;
  }

  .pf-info h2 {
    font-size: 2.3rem;
  }

  .pf-foot {
    position: sticky;
    bottom: 0;
    padding: 12px 14px;
    background: rgba(9, 9, 11, 0.97);
  }

  /* No transform here, so the close button can stay pinned to the viewport while the panel scrolls. */
  .pf-panel,
  .pf.open .pf-panel {
    transform: none;
  }

  .pf-x {
    position: fixed;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
  }
}
