/* Team grid members are buttons that open a profile dialog. */
.tmember {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* The accent halo sits on the portrait at rest, not only on hover: it is the
   only cue that a face is a button, and hover cannot carry that on touch.
   Same --accent the LinkedIn pill uses, so it tracks the theme on its own.

   It rides a wrapper rather than the img because .tmember img carries
   filter: grayscale(1), and a CSS filter desaturates the element's own border
   and box-shadow along with the bitmap, which painted the ring gray. */
.tmember-ring {
  display: block;
  border: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  line-height: 0;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms var(--ease-out);
}

.tmember-ring img {
  display: block;
  transition: opacity 200ms ease;
}

.tmember:focus-visible {
  outline: 0;
}

.tmember:focus-visible .tmember-ring,
.tmember:hover .tmember-ring {
  border-color: var(--accent);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-2px);
}

/* Light theme needs a heavier ring: --accent is a deeper indigo there, and it
   sits between a dark portrait and a near-white page, so a thinned-out border
   and a faint glow both wash out. */
html[data-theme="light"] .tmember-ring {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 26%, transparent);
}

html[data-theme="light"] .tmember:focus-visible .tmember-ring,
html[data-theme="light"] .tmember:hover .tmember-ring {
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 42%, transparent);
}

.tmember:focus-visible img,
.tmember:hover img {
  opacity: 1;
}

.tmember:focus-visible b,
.tmember:hover b {
  color: var(--accent);
}

.tmember b {
  transition: color 180ms ease;
}

.team-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--cream);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .46);
  font-family: "Space Grotesk", sans-serif;
  animation: team-dialog-in 280ms var(--ease-out);
}

.team-dialog::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: team-backdrop-in 220ms ease-out;
}

.team-dialog__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 218px) minmax(0, 1fr);
  gap: clamp(26px, 3.4vw, 44px);
  padding: clamp(28px, 3.8vw, 46px);
}

.team-dialog__inner:focus {
  outline: 0;
}

.team-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), .05);
  color: var(--cream);
  font-size: 0;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out);
}

.team-dialog__close::before,
.team-dialog__close::after {
  grid-area: 1 / 1;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: '';
}

.team-dialog__close::before {
  transform: rotate(45deg);
}

.team-dialog__close::after {
  transform: rotate(-45deg);
}

.team-dialog__close:active {
  transform: scale(.96);
}

.team-dialog__close:focus-visible,
.team-dialog__li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.team-dialog__id {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-dialog__photo {
  width: 152px;
  height: 152px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent);
  filter: grayscale(1);
}

.team-dialog__name {
  margin: 24px 0 0;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.team-dialog__role {
  margin: 8px 0 0;
  color: var(--muted);
  font: 500 11px/1.3 "IBM Plex Mono", monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.team-dialog__li {
  gap: 9px;
  margin-top: 22px;
}

/* The site-wide .button hover inverts to var(--cream), which reads as a white
   pill in dark mode and a black one in light. The profile's single action stays
   in the accent family instead: mixing toward --cream lightens the indigo on
   dark and deepens it on light, so one rule covers both themes. */
@media (hover: hover) and (pointer: fine) {
  .team-dialog__li:hover {
    background: color-mix(in srgb, var(--accent) 84%, var(--cream));
    border-color: color-mix(in srgb, var(--accent) 84%, var(--cream));
    color: var(--accent-ink);
  }
}

.team-dialog__li-mark {
  width: 15px;
  height: 15px;
  flex: none;
}

.team-dialog__bio {
  align-self: center;
  padding-left: clamp(26px, 3.4vw, 44px);
  border-left: 1px solid var(--line);
}

.team-dialog__bio p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.team-dialog__bio p:last-child {
  margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .team-dialog__close:hover {
    background: rgba(var(--ink-rgb), .1);
    color: var(--cream);
  }
}

@media (max-width: 720px) {
  .team-dialog__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 30px 22px;
  }

  .team-dialog__bio {
    padding-left: 0;
    padding-top: 26px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .team-dialog__photo {
    width: 124px;
    height: 124px;
  }
}

@media (max-width: 560px) {
  .team-dialog {
    width: min(100% - 20px, 560px);
    max-height: calc(100svh - 20px);
    border-radius: 20px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .team-dialog::backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-dialog,
  .team-dialog::backdrop {
    animation: none;
  }

  .tmember img,
  .tmember b,
  .team-dialog__close {
    transition: none;
  }
}

@keyframes team-dialog-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }
}

@keyframes team-backdrop-in {
  from { opacity: 0; }
}
