/* Team-Org-Chart: fuenftes Hover-Feld unten mittig. Nutzt die Bubble-
   Mechanik aus placeholder.css (clip-path, project-open); ergaenzt hier
   nur die Team-spezifische Positionierung und das Org-Chart-Layout. */

/* Tile unten mittig */
.project-tile[data-pos="bc"] {
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}

/* Bubble waechst aus der unteren Mitte */
.project-bubble[data-project="team"] { --bx: 50%; --by: 100%; }

body[data-open="team"] .project-bubble[data-project="team"] {
  visibility: visible;
  pointer-events: auto;
  clip-path: circle(150% at var(--bx) var(--by));
  transition:
    clip-path 540ms cubic-bezier(0.42, 0, 0.58, 1),
    visibility 0s linear 0s;
}

body[data-open="team"] .project-bubble[data-project="team"] .bubble-inner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity 320ms ease 220ms,
    transform 380ms cubic-bezier(0.42, 0, 0.58, 1) 200ms;
}

/* Hero faehrt nach oben in die Mitte (Spitze des Org-Charts) statt in
   eine Ecke. Adresse im Top-Knoten ausgeblendet, Knoten bleibt kompakt. */
body[data-open="team"] .leifu-block {
  transform: translate(0, calc(-50dvh + 3.8rem)) translate(-50%, -50%);
  text-align: center;
  max-width: 90vw;
}
body[data-open="team"] .leifu-block .lead { display: none; }

/* Org-Chart. Groessen und Abstaende sind an die Fensterhoehe gekoppelt
   (vh mit clamp), damit der Chart auf niedrigen Fenstern automatisch
   schrumpft und nie in die Footer-Zeile laeuft. */
.team-inner {
  top: 49%;
  width: min(760px, calc(100vw - 3rem));
  max-height: calc(100dvh - 5.5rem);
  text-align: center;
}

.team-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.6vh, 2rem);
}

.team-reports {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.8rem, 2.2vh, 1.7rem);
}

.team-row {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
}

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.3rem, 0.9vh, 0.55rem);
  margin: 0;
  width: clamp(104px, 13vh, 124px);
}

/* Nur das direkte Foto (Jannis) bekommt Rahmen/Hintergrund -- NICHT das
   Logo-img, das verschachtelt in .avatar-head einer .team-card steckt. */
.team-card > img {
  box-sizing: border-box;
  width: clamp(78px, 12vh, 104px);
  height: clamp(98px, 15vh, 130px);
  object-fit: cover;
  border-radius: 12px;
  background: #161b26;
  border: 1px solid #2a3346;
}

/* Quadratischer Avatar: Silhouette fuellt ihn exakt (kein Leerraum unten),
   festes Seitenverhaeltnis -> Kopf-/Logo-Position bleibt bei jeder
   Fenstergroesse gleich. */
.team-avatar {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background-image: url("team/avatar-bust.svg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
/* Logo sitzt im Kopf/Gesicht der Silhouette (Kopf-Mittelpunkt = 50% / 28%). */
.avatar-head {
  position: absolute;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%);
  width: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.avatar-head img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Mitarbeiter mit eigenem Koerper-Bild (Lobster, Leifu) statt Silhouette. */
.team-avatar.is-full {
  background-image: none;
}
.team-avatar.is-full .avatar-body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Chef-Karte (Apex) groesser als die Mitarbeiter. */
.team-lead { width: clamp(146px, 19.5vh, 184px); }
.team-lead img {
  width: clamp(126px, 18vh, 164px);
  height: clamp(156px, 22.5vh, 205px);
  border-color: #3b4763;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.team-card figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
}

.team-name {
  display: block;
  font-weight: 600;
  color: #f9fafb;
  font-size: 0.98rem;
  line-height: 1.2;
}

.team-role {
  display: block;
  color: #9ca3af;
  font-size: 0.8rem;
  line-height: 1.25;
}

.team-badge {
  display: block;
  margin-top: 0.2rem;
  color: #fbbf24;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  font-weight: 500;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 520px) {
  body[data-open="team"] .leifu-block {
    transform: translate(0, calc(-50dvh + 2.6rem)) translate(-50%, -50%);
  }
  .team-inner {
    width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
  }
  .team-chart { gap: 1.6rem; }
  .team-reports { gap: 1.3rem; }
  .team-row { gap: 1.2rem; }
  .team-card { width: 40vw; max-width: 150px; }
  .team-card img { width: 96px; height: 120px; }
  .team-name { font-size: 0.9rem; }
  .team-role { font-size: 0.74rem; }
}
