/* Reusable Grokling card styles. Pair with lib/tilt.js. */

.tribe-group {
  margin: 0 0 2.75rem;
}

.tribe-group-title {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #cbb9a2);
}

.tribe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.25rem;
  perspective: 900px;
}

.tribe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 100%;
  padding: 1.25rem 1.2rem 1.35rem;
  border: 1px solid rgba(28, 23, 18, 0.08);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 42%),
    var(--paper, #f7f1e6);
  color: var(--paper-ink, #1c1712);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 12px 28px rgba(0, 0, 0, 0.22);
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg) translateZ(0);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
  will-change: transform;
}

.tribe-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--tilt-x, 50%) var(--tilt-y, 20%),
    rgba(255, 255, 255, 0.28),
    transparent 55%
  );
  opacity: 0.85;
  mix-blend-mode: soft-light;
}

.tribe-card.is-tilting {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 18px 36px rgba(0, 0, 0, 0.3);
  transition: box-shadow 140ms ease-out;
}

.tribe-portrait {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 0 0.55rem;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(160deg, #3d4f55, #1b2326 58%, #8a5a32);
  box-shadow: 0 0 0 2px rgba(28, 23, 18, 0.08), 0 8px 16px rgba(0, 0, 0, 0.12);
  transform: translateZ(28px);
}

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

.tribe-portrait--initials {
  display: grid;
  place-items: center;
  color: #f7f1e6;
}

.tribe-initials {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.tribe-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--paper-ink, #1c1712);
  transform: translateZ(18px);
}

.tribe-lane {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a5a3a;
  transform: translateZ(16px);
}

.tribe-voice {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #3a322b;
  transform: translateZ(14px);
}

@media (prefers-reduced-motion: reduce) {
  .tribe-card,
  .tribe-card.is-tilting {
    transform: none !important;
    transition: none;
    will-change: auto;
  }

  .tribe-card::after {
    background: none;
  }
}
