/* Team badges: hanging, flippable ID cards rendered by scripts/team.js.
   Shared tokens (--rope, --wire, --metal, --focus) and the .eyelet hardware live in site.css. */

.badges {
  --card-w: 268px;
  --card-h: 376px;
  --card-radius: 24px;
  --card-pad: 19px;
  --card: rgb(0 0 0 / 0.04);
  --card-ink: #25252a;
  --card-label: #7b7b80;
  --divider: rgb(39 39 41 / 0.1);
  --arrow: #27272e;
  --gap: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 32px var(--gap);
  margin: 48px auto 0;
  padding: 0 0 43px;
  list-style: none;
}

.badge {
  position: relative;
  flex: none;
  width: var(--card-w);
}

.badge-rope {
  position: absolute;
  z-index: 0;
  display: block;
  overflow: visible;
  opacity: 0.65;
  pointer-events: none;
}

.badge-rope path {
  fill: none;
  stroke: var(--rope);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.badge-drop {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 13px;
}

.badge-pendulum {
  --sway: 0deg;
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 13px;
  transform: rotate(calc(var(--rest, 0deg) + var(--sway)));
}

.badge-anchor {
  position: absolute;
  z-index: 3;
  top: 9px;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border: 1px solid var(--metal);
  border-radius: 50%;
  background: var(--metal);
  box-shadow: 0 0 0 2px #17182128;
  pointer-events: none;
}

.badge-wire {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 50%;
  width: 1.15px;
  transform: translateX(-50%);
  background: var(--wire);
  box-shadow: 0 0 1px #ffffff24;
  opacity: 0.85;
  pointer-events: none;
}

.badge-card {
  --rx: 0deg;
  --ry: 0deg;
  --px: 50%;
  --py: 50%;
  --light: 0;
  position: absolute;
  left: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  perspective: 900px;
}

.badge-tilt {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 0;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
}

.badge-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  transform-style: preserve-3d;
  transition: transform 760ms cubic-bezier(0.2, 0.82, 0.19, 1);
}

.badge-flipper.is-flipped {
  transform: rotateY(180deg);
}

/* ---------- Faces ---------- */

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: var(--card-pad);
  overflow: hidden;
  border: 0;
  border-radius: var(--card-radius);
  background: var(--card);
  color: var(--card-ink);
  text-align: left;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.face-front {
  appearance: none;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
}

.face-back {
  transform: rotateY(180deg);
  cursor: pointer;
  line-height: 1.4;
  pointer-events: none;
}

.is-flipped .face-front {
  pointer-events: none;
}

.is-flipped .face-back {
  pointer-events: auto;
}

.face-front:focus-visible,
.back-close:focus-visible,
.face-back a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

.face-top,
.back-top {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.face-top {
  color: var(--card-label);
  letter-spacing: 0.08em;
}

.portrait {
  position: relative;
  display: block;
  flex: none;
  width: 100%;
  height: 60%;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 14px;
  background: #d8d7d5;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(transparent, #00000024);
  pointer-events: none;
}

/* Shown when a person has no photo: a softly lit tile in their accent colour. */
.portrait-initials::after {
  display: none;
}

.initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120% 90% at 28% 16%, rgb(255 255 255 / 0.75), transparent 60%),
    linear-gradient(color-mix(in srgb, var(--accent) 16%, #fff), color-mix(in srgb, var(--accent) 36%, #fff));
  color: color-mix(in srgb, var(--accent) 62%, #000);
  font-size: 80px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.person {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 13px;
}

.person-name {
  overflow-wrap: anywhere;
  color: var(--card-ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
  transform: translate(-2px, -1px);
}

.person-role {
  margin-top: 4px;
  color: #6f6f77;
  font-size: 13.5px;
  line-height: 1.2;
  transform: translateY(-2px);
}

.face-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  color: var(--card-ink);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--arrow);
  color: #fff;
}

.arrow svg {
  width: 11px;
  height: 11px;
}

.back-top {
  margin-bottom: 10px;
  color: #7b7b81;
  letter-spacing: 0.1em;
}

.back-close {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #dedfe0;
  color: #1d1d21;
  cursor: pointer;
}

.back-close svg {
  width: 13px;
  height: 13px;
}

.back-identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.back-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 26%, #fff);
  color: color-mix(in srgb, var(--accent) 62%, #000);
  font-size: 13px;
  font-weight: 800;
}

/* Portraits are head-and-shoulders shots; zoom in so the face fills the small circle. */
.back-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.55);
  transform-origin: 50% 40%;
}

.back-intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.back-name {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--card-ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.back-role {
  color: #79797c;
  font-size: 9px;
  line-height: 1;
}

.back-location {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  color: #77777c;
  font-size: 9px;
  line-height: 1;
}

.back-location svg {
  width: 9px;
  height: 9px;
}

.back-about {
  display: -webkit-box;
  margin: 10px 0 8px;
  overflow: hidden;
  color: #5a5a62;
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.back-section {
  padding-top: 9px;
  border-top: 1px solid var(--divider);
}

.back-label {
  margin: 0 0 5px;
  color: #7b7b81;
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.focus-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.focus-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
  color: #26262a;
  font-size: 10px;
  line-height: 1;
}

.back-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-height: 0;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--divider);
}

.back-contact {
  flex: 1;
  min-width: 0;
}

.back-email {
  display: block;
  overflow: hidden;
  color: #26262b;
  font-size: 9px;
  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 8px;
}

.back-links a {
  color: #696970;
  font-size: 8px;
  text-decoration: none;
}

.back-email:hover,
.back-links a:hover {
  text-decoration: underline;
}

.qr {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.qr svg {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  padding: 5px;
  border-radius: 4px;
  background: #fff;
  shape-rendering: crispEdges;
}

.qr figcaption {
  color: #79797c;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* ---------- Holographic sheen (also used by the contact card) ---------- */

.holo,
.holo-gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: var(--light);
  pointer-events: none;
}

.holo {
  background:
    radial-gradient(circle at var(--px) var(--py), #ffffffad 0%, transparent 38%),
    linear-gradient(112deg, #ff4f8500 4%, #fd6ca55b 22%, #6fcaff6b 40%, #d9f47b48 54%, #a16bff6b 71%, #ff8b6500 95%);
  background-size:
    100% 100%,
    210% 210%;
  background-position:
    center,
    var(--px) var(--py);
  mix-blend-mode: color-burn;
}

.holo-gloss {
  background: radial-gradient(ellipse 72% 42% at var(--px) var(--py), #ffffffc2 0%, #ffffff2d 40%, transparent 74%);
  mix-blend-mode: screen;
}

/* ---------- Arrival ---------- */

.badge.will-arrive .badge-drop {
  opacity: 0;
}

.badge.is-arriving .badge-drop {
  animation: badge-arrive 1050ms cubic-bezier(0.16, 1, 0.3, 1) var(--arrive-delay, 0ms) both;
}

@keyframes badge-arrive {
  0% {
    opacity: 0;
    transform: translateY(-28px) rotate(-4deg);
  }
  36% {
    opacity: 1;
    transform: translateY(6px) rotate(3deg);
  }
  58% {
    transform: translateY(-3px) rotate(-2deg);
  }
  78% {
    transform: translateY(1px) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.will-arrive .badge-drop {
    opacity: 1;
  }

  .badge.is-arriving .badge-drop {
    animation: none;
  }

  .badge-flipper {
    transition-duration: 0.01ms;
  }

  .badge-tilt {
    transform: none;
  }

  .holo,
  .holo-gloss {
    display: none;
  }
}
