/* Campus co-leads: flip-to-pixel-twin cards and the "This could be you" card. */

.leads {
  position: relative;
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: clamp(64px,10vh,104px);
  padding-inline: var(--gutter);
  scroll-margin-top: 84px;
  /* Hidden speech bubbles near a card's edge must never widen the page. */
  overflow-x: clip;
}

.leads .inner {
  max-width: 1180px;
  margin: 0 auto;
}

.leads h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px,5vw,64px);
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0;
}

.leads .grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
  margin-top: 30px;
}

.lead {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 24px 28px;
  text-align: center;
  transition: border-color .2s ease,transform .2s ease;
}

.lead:hover {
  border-color: color-mix(in srgb,var(--fg) 20%,var(--line));
  transform: translateY(-2px);
}

.flip {
  all: unset;
  display: block;
  width: 116px;
  height: 116px;
  margin: 0 auto;
  perspective: 700px;
  cursor: pointer;
  border-radius: 50%;
}

.flip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.flip-in {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.34,1.4,.5,1);
}

.lead.flipped .flip-in {
  transform: rotateY(180deg);
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 4px var(--bg-raised),0 0 0 5px var(--line);
}

img.front {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.back.skate {
  background: linear-gradient(180deg,#E4E3DF 0%,#B9B8B3 100%);
}

.back.court {
  background: linear-gradient(180deg,#E3EEDC 0%,#CFE3C4 100%);
}

.back img {
  width: 84%;
  height: auto;
  image-rendering: pixelated;
}

.back.skate img {
  width: 72%;
  margin-top: 10%;
}

.back.court img {
  width: 100%;
  margin-top: 6%;
}

.say {
  position: absolute;
  left: 50%;
  top: -14px;
  z-index: 2;
  margin: 0;
  max-width: min(250px,86%);
  width: max-content;
  padding: 8px 10px 7px;
  background: #FFF;
  color: #141413;
  border: 2px solid #141413;
  box-shadow: 3px 3px 0 #141413;
  font: 400 9.5px/1.6 "Press Start 2P",var(--mono);
  text-align: center;
  opacity: 0;
  transform: translate(-50%,6px) scale(.9);
  transition: opacity .2s ease,transform .25s steps(3);
  pointer-events: none;
}

.say::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: #FFF;
  border-right: 2px solid #141413;
  border-bottom: 2px solid #141413;
  transform: rotate(45deg);
}

.lead.flipped .say {
  opacity: 1;
  transform: translate(-50%,0) scale(1);
}

.lead.join {
  border-style: dashed;
  border-width: 1.5px;
  border-color: color-mix(in srgb,var(--fg) 28%,var(--line));
  background: transparent;
}

.join-ic {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb,var(--fg) 30%,var(--line));
  background: var(--bg-raised);
}

.join-ic img {
  width: 78px;
  height: auto;
  image-rendering: pixelated;
  cursor: pointer;
}

.join-text {
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 10px auto 0;
  max-width: 26em;
}

.lead h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin: 20px 0 0;
}

.lead .role {
  color: var(--fg-muted);
  margin: 4px 0 0;
  font-size: 15px;
}

.lead .l-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.lead .l-links .btn svg {
  width: 16px;
  height: 16px;
}

.lead-note {
  margin: 22px 0 0;
  color: var(--fg-muted);
  font-size: 16px;
}

@media (max-width:980px) {
  .leads .grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .lead.join {
    grid-column: 1/-1;
  }
}

@media (max-width:600px) {
  .leads .grid {
    grid-template-columns: minmax(0,1fr);
  }
}

@media (hover:hover) {
  .flip:hover .flip-in {
    transform: rotateY(180deg);
  }

  .lead:has(.flip:hover) .say {
    opacity: 1;
    transform: translate(-50%,0) scale(1);
  }
}

@media (max-width:720px) {
  .leads {
    padding-block: 52px;
  }

  .leads .grid {
    gap: 12px;
    margin-top: 22px;
  }

  .lead {
    display: grid;
    grid-template-columns: 76px minmax(0,1fr);
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    text-align: left;
    padding: 18px;
    align-items: center;
  }

  .flip,
  .join-ic {
    width: 76px;
    height: 76px;
    grid-row: 1/3;
    margin: 0;
  }

  .face {
    box-shadow: 0 0 0 3px var(--bg-raised),0 0 0 4px var(--line);
  }

  .join-ic img {
    width: 50px;
  }

  .join-text {
    grid-column: 1/-1;
    margin: 12px 0 0;
  }

  .say {
    left: 16px;
    top: -16px;
    transform: translate(0,6px) scale(.9);
    max-width: calc(100% - 32px);
  }

  .lead.flipped .say {
    transform: translate(0,0) scale(1);
  }

  .say::after {
    left: 38px;
  }

  .lead h3 {
    margin: 0;
    font-size: 18px;
    align-self: end;
  }

  .lead .role {
    margin: 2px 0 0;
    align-self: start;
    font-size: 14px;
  }

  .lead .l-links {
    grid-column: 1/-1;
    justify-content: flex-start;
    margin-top: 14px;
  }

  .lead .l-links .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flip-in,
  .say {
    transition: none;
  }
}
