/**
 * Tech Sutro — Team / Leadership Section Styles
 * "Bold Tech / Dark Glass": frosted glass cards, gradient avatar
 * rings and glass role pills.
 *
 * Loaded after cards.css, so the rules here are the definitive layer
 * for the leadership grid. The `.card` base (glass + hover ring) and
 * the shared `.avatar-*` atoms still come from main.css / sections.css.
 */

/* ------------------------------------------------------------------
   TEAM GRID (base columns + stretch)
   ------------------------------------------------------------------ */
.team-grid {
  display: grid;
  gap: var(--space-6);
  align-items: stretch;
}

.team-grid-directors {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-grid-technology {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* ------------------------------------------------------------------
   TEAM GROUPS
   ------------------------------------------------------------------ */
.team-group {
  margin-top: var(--space-8);
}

.team-group + .team-group {
  margin-top: var(--space-20);
}

.team-group-technology {
  scroll-margin-top: 120px;
}

.team-group-technology .team-grid-technology {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-group-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);

  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);

  border-bottom: 1px solid var(--border-base);
}

.team-group-label {
  display: block;

  margin-bottom: 0.35rem;

  color: var(--accent-primary);

  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.team-group-header h3 {
  margin: 0;

  font-size: var(--text-xl);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.team-group-title {
  grid-column: 1 / -1;

  margin-top: var(--space-4);
  margin-bottom: var(--space-2);

  color: var(--text-muted);

  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}

.team-group-company {
  color: var(--text-tertiary);

  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;

  text-align: right;
}


/* ------------------------------------------------------------------
   TEAM CARD
   ------------------------------------------------------------------ */
.team-card {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);

  min-height: 390px;
  padding: var(--space-6);

  border-radius: var(--radius-xl);

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);

  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);

  overflow: hidden;

  transition:
    transform var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.team-card:hover {
  transform: translateY(-6px);

  background: var(--card-bg-hover);

  border-color: color-mix(in oklab, var(--accent-primary), transparent 55%);

  box-shadow: var(--card-shadow-hover);
}

.team-card-top {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);

  width: 100%;
  margin-bottom: var(--space-6);
}

.team-number {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;

  background: var(--accent-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  opacity: 0.85;
}

/* Glass role pill. */
.team-role-tag {
  display: inline-flex;
  align-items: center;

  min-height: 26px;
  padding: 0.3rem 0.75rem;

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);

  background: var(--glass-bg-soft);

  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);

  color: var(--text-secondary);

  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  transition:
    color var(--transition-base),
    border-color var(--transition-base),
    background var(--transition-base);
}

.team-card:hover .team-role-tag {
  color: var(--accent-primary);

  border-color: color-mix(in oklab, var(--accent-primary), transparent 45%);

  background: color-mix(in oklab, var(--accent-primary), transparent 90%);
}


/* ------------------------------------------------------------------
   AVATAR
   ------------------------------------------------------------------ */
.team-avatar {
  position: relative;

  width: 112px;
  height: 112px;
  margin-bottom: var(--space-6);

  padding: 3px;

  border: 1px solid color-mix(in oklab, var(--accent-primary), transparent 55%);
  border-radius: var(--radius-full);

  background: var(--accent-gradient);

  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--accent-primary), transparent 85%),
    var(--shadow-sm);

  overflow: hidden;

  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.team-avatar img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  border-radius: var(--radius-full);
  background: var(--bg-surface-2);

  transition: transform var(--transition-slow);
}

.team-avatar::after {
  content: '';

  position: absolute;
  inset: 3px;

  border: 1px solid color-mix(in oklab, var(--accent-primary), transparent 70%);
  border-radius: var(--radius-full);

  opacity: 0;

  pointer-events: none;

  transition: opacity var(--transition-base);
}

.team-card:hover .team-avatar {
  transform: translateY(-4px);

  border-color: color-mix(in oklab, var(--accent-primary), transparent 30%);

  box-shadow:
    0 0 0 5px color-mix(in oklab, var(--accent-primary), transparent 90%),
    0 0 32px var(--accent-glow);
}

.team-card:hover .team-avatar::after {
  opacity: 1;
}

.team-card:hover .team-avatar img {
  transform: scale(1.05);
}

/* Avatars rendered straight into the card (no gradient ring wrapper). */
.avatar-img {
  width: 56px;
  height: 56px;

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);

  object-fit: cover;

  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-primary), transparent 88%);

  flex-shrink: 0;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 56px;
  height: 56px;

  background: var(--accent-gradient-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);

  color: var(--accent-primary);

  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-md);

  flex-shrink: 0;
  user-select: none;
}

/* Inside the gradient ring the avatar should fill the frame. */
.team-avatar .avatar-img {
  width: 100%;
  height: 100%;

  border: 0;

  box-shadow: none;
}

.team-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;

  border: 0;

  box-shadow: none;

  font-size: var(--text-2xl);
}


/* ------------------------------------------------------------------
   TEAM INFO
   ------------------------------------------------------------------ */
.team-info {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  gap: 0.35rem;

  width: 100%;
  min-width: 0;

  margin-top: auto;
}

.team-info h4 {
  margin: 0;

  font-size: var(--text-lg);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.team-info p {
  margin: 0;

  font-size: var(--text-sm);
  line-height: 1.6;

  color: var(--text-secondary);
}

.team-position {
  margin: 0 0 var(--space-2);

  color: var(--text-secondary);

  font-size: var(--text-sm);
  line-height: 1.6;
}

.team-department {
  display: inline-flex;
  align-items: center;

  margin-top: 0.15rem;

  color: var(--accent-primary);

  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.team-card-wide {
  min-height: 350px;
}


/* ------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------ */
@media (max-width: 900px) {

  .team-grid-directors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-grid-technology {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-group + .team-group {
    margin-top: var(--space-16);
  }

  .team-avatar {
    width: 100px;
    height: 100px;
  }

}

@media (max-width: 640px) {

  .team-group-header {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3);
  }

  .team-group-company {
    text-align: left;
  }

  .team-grid-directors,
  .team-grid-technology {
    grid-template-columns: 1fr;
  }

  .team-group + .team-group {
    margin-top: var(--space-12);
  }

  .team-card,
  .team-card-wide {
    min-height: 340px;
  }

  .team-card {
    padding: var(--space-4);
  }

  .team-avatar {
    width: 96px;
    height: 96px;
  }

  .avatar-img,
  .avatar-placeholder {
    width: 48px;
    height: 48px;
  }

  .team-info h4 {
    font-size: var(--text-md);
  }

  .team-info p {
    font-size: var(--text-xs);
  }

}


/* ------------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

  .team-card,
  .team-card:hover,
  .team-avatar,
  .team-avatar::after,
  .team-avatar img,
  .team-role-tag {
    transition: none;
  }

  .team-card:hover,
  .team-card:hover .team-avatar,
  .team-card:hover .team-avatar img {
    transform: none;
  }

}
