/* Team list and person pages. Loaded after styles.css. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(*) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Leads tier, then members. */
.team-roster { padding-top: clamp(40px, 6vw, 80px); }
.team-roster:last-child { padding-bottom: clamp(56px, 8vw, 112px); }
.team-roster + .team-roster { padding-top: clamp(48px, 7vw, 96px); }
.team-roster-leads .person-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.person-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: clamp(28px, 3vw, 44px) clamp(18px, 2.2vw, 32px); }
.person-card { scroll-margin-top: 24px; }
.person-card a { display: block; text-decoration: none; }
.person-card a:focus-visible { outline-offset: 4px; }
/* Marks the card "All team members" returns to. */
.person-card:target > a { animation: returned 2.4s ease-out; }
@keyframes returned { from { outline: 3px solid var(--deck); outline-offset: 6px; } to { outline: 3px solid transparent; outline-offset: 6px; } }

.portrait { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--blue); }
.portrait-empty { display: grid; place-items: center; background: linear-gradient(160deg, #1f4252, var(--navy)); color: #cfe2e8; }
.portrait-empty span { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: clamp(48px, 6vw, 84px); letter-spacing: .02em; }

/* The frame clips the hover zoom so the photo stays inside its box. */
.portrait-frame { display: block; overflow: hidden; }
.person-card .portrait { transition: transform 260ms ease, filter 260ms ease; }
.person-card a:hover .portrait { transform: scale(1.04); filter: saturate(1.08); }
.person-meta { display: grid; gap: 4px; margin-top: 16px; }
.person-role { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.person-name { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 600; line-height: 1.05; }
.person-card a:hover .person-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.person-study { font-size: 13px; color: var(--grey); }

/* Person page */
.person { padding-top: 28px; padding-bottom: clamp(40px, 6vw, 80px); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.person-layout { display: grid; grid-template-columns: clamp(220px, 34vw, 420px) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; margin-top: 20px; }
.person-photo { position: sticky; top: 28px; }
.person-body h1 { font-size: clamp(52px, 6vw, 96px); margin-top: 10px; }
.person-body .person-study { margin-top: 14px; font-size: 15px; }
.person-bio { margin-top: 32px; max-width: 680px; border-left: 2px solid var(--deck); padding-left: 24px; }
.person-bio p { font-size: 16px; line-height: 1.85; color: #34505b; }
.person-bio p + p { margin-top: 18px; }
/* Darker than --deck so 16px links clear WCAG AA (5.1:1 on --paper). */
.person-bio a { color: #076fa2; font-weight: 600; }
.person-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.resume-link { display: none !important; }
.person-links .button, .resume-actions .button { gap: 18px; min-height: 48px; padding: 14px 20px; }

.resume { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); background: var(--blue); max-width: none; }
.resume-head, .resume-frame { margin-left: auto; margin-right: auto; }
.resume-head { max-width: 900px; margin-bottom: 24px; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.resume-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.resume-frame { display: block; width: 100%; max-width: 900px; aspect-ratio: 8.5 / 11; max-height: 90svh; border: 1px solid var(--rule); background: white; }

.person-video { padding-top: clamp(40px, 5vw, 64px); }
.video-frame { aspect-ratio: 16 / 9; max-width: 1100px; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }

/* An even grid of one shared shape; a lone photo keeps its own shape instead. */
.person-gallery { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(56px, 8vw, 112px); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.person-gallery img { aspect-ratio: 3 / 2; object-fit: cover; background: var(--blue); }
.person-gallery:has(> figure:only-child) { display: block; }
.person-gallery figure:only-child img { aspect-ratio: auto; width: auto; max-height: 80svh; }

.contact { padding-top: clamp(48px, 7vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); }
.contact p { font-size: 18px; line-height: 1.7; color: var(--grey); }
.contact h1 { margin-top: 8px; font-size: clamp(28px, 3vw, 40px); }
/* Breaks before the @ (via <wbr>) rather than mid-word on narrow phones. */
.contact-email { color: #076fa2; overflow-wrap: anywhere; }
.contact .not-found-text { margin-top: 20px; }

@media (max-width: 760px) {
  /* Name and study first, so they show above the photo on the first screen. */
  .person-layout { grid-template-columns: 1fr; gap: 0; margin-top: 8px; }
  .person-body { display: contents; }
  .person-photo { position: static; order: 1; margin-top: 24px; }
  .person-bio, .person-links { order: 2; }
  /* Two equal columns where labels fit on one line, one column on the narrowest phones. */
  .person-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .person-links .button { justify-content: space-between; white-space: nowrap; }
  .person-bio { padding-left: 16px; margin-top: 24px; }
  .person-bio p { font-size: 15px; line-height: 1.7; }
  .person-name { font-size: 24px; }
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .team-roster-leads .person-grid { grid-template-columns: 1fr; gap: 20px; }
  .team-roster-leads .person-card a { display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 16px; align-items: center; }
  .team-roster-leads .person-meta { margin-top: 0; }
  .person-meta { margin-top: 10px; }
  .person-study { font-size: 12px; }
  /* Phones handle embedded PDFs poorly; Open shows the PDF in the phone's own viewer. */
  .resume { display: none; }
  .resume-link { display: inline-flex !important; }
}
@media (prefers-reduced-motion: reduce) {
  .person-card .portrait { transition: none; }
  .person-card a:hover .portrait { transform: none; }
}
