/* Shared background for the artifact gallery and research notes. */
main:has(.art-page, .research-notes) {
  position: relative;
  isolation: isolate;
  background-color: #f5f9ff;
}
main:has(.art-page, .research-notes)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: repeating-linear-gradient(112deg, transparent 0 43px, #5991bb22 43px 44px), repeating-linear-gradient(0deg, transparent 0 35px, #5991bb22 35px 36px);
  background-size: auto 36px;
  animation: lab-grid-drift 12s linear infinite;
}
@keyframes lab-grid-drift { to {background-position: 0 36px;} }
@media (prefers-reduced-motion: reduce) {
  main:has(.art-page, .research-notes)::before {animation: none;}
}
.research-notes {max-width: 54rem; margin: auto; padding: clamp(1.5rem,4vw,3rem) 1.25rem; color: #152d46;}
.research-notes section {max-width: none; margin: 1.5rem 0; padding: 1.4rem; background: #fbfdff; border: 1px solid #bdceda; border-radius: 16px;}
.research-notes h1, .research-notes h2 {letter-spacing: normal; text-wrap: balance;}
.research-notes h1 {font-size: clamp(2rem,4vw,3.5rem);}
.research-notes h2 {font-size: clamp(1.45rem,2.5vw,2rem);margin: .5rem 0;}
.research-notes p {max-width: 68ch; line-height: 1.65;}
.research-notes small {color: #28596a;}
.research-notes details {padding: .8rem 1rem;background: #eaf4fa;}
.research-notes summary {cursor: pointer;}

.faculty-directory {
  display: grid;
  gap: 1rem;
}
.faculty-card {
  display: grid;
  grid-template-columns: clamp(4rem, 14vw, 7rem) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  column-gap: clamp(.75rem, 3vw, 1.6rem);
  row-gap: .25rem;
  padding: clamp(.8rem, 2vw, 1.25rem);
  border: 1px solid #c1d2e0;
  border-left: 3px solid #39838c;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.faculty-card .faculty-portrait {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 5px;
}
.faculty-card h3, .faculty-card p {
  grid-column: 2;
  margin: 0;
  text-align: left;
}
.faculty-card h3 {
  align-self: end;
  font: 600 clamp(1.05rem, 2.5vw, 1.4rem)/1.25 Georgia, serif;
  letter-spacing: normal;
}
.faculty-card .faculty-role {color: #28596a; font-weight: 600;}

/* Collaborator cards animate only when the visitor allows motion. */
@keyframes faculty-arrive {
  from { opacity: .72; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .faculty-card {
      animation: faculty-arrive linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }
  }
  @media (hover: hover) and (pointer: fine) {
    .faculty-card {
      transition: transform 180ms ease-out, box-shadow 180ms ease-out;
    }
    .faculty-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 7px 18px #183a5414;
    }
  }
}

/* Moving contour fields for the research notebook. */
main:has(.research-notes) {
  overflow: clip;
  background: linear-gradient(145deg, #e2f7f5, #f4f5ff 52%, #e8e2fb);
}
main:has(.research-notes)::before {
  inset: -64px;
  background-image:
    repeating-radial-gradient(ellipse at 12% 42%, transparent 0 17px, #159f9b45 18px 19px, transparent 20px 32px),
    radial-gradient(ellipse at 18% 45%, #56d9c985, transparent 50%),
    radial-gradient(ellipse at 85% 65%, #9681e780, transparent 55%);
  background-size: 100% 480px, 100% 680px, 100% 800px;
  animation: research-contours 9s ease-in-out infinite alternate;
}
@keyframes research-contours {
  from { transform: translate(-24px,-18px) rotate(-1deg); }
  to { transform: translate(24px,18px) rotate(1deg); }
}
.research-notes > section { border-top: 3px solid #368b97; }
.research-notes > #featured-projects {
  background: linear-gradient(130deg,#dff5ef,#f3efff);
  border-top-color: #7555bd;
}
.research-notes > #publications { border-top-color: #506da9; }
@media (prefers-reduced-motion: reduce) {
  main:has(.research-notes)::before { animation: none; }
}

/* Public engagement on the Collaborations page. */
.collab-events { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap:1rem; }
.collab-events article { padding:1.25rem; border-radius:12px; border:1px solid #bad9df; background:linear-gradient(135deg,#edf9f7,#fff); }
.collab-events article:nth-child(even) { border-color:#d6cbe2; background:linear-gradient(135deg,#f4edf9,#fff); }
.collab-events h3 { margin:.5rem 0; line-height:1.25; }
.collab-events small { font-weight:650; }

.collab-events .event-recording { display:block; color:inherit; text-decoration:none; }
.event-recording img { display:block; width:100%; height:auto; aspect-ratio:16/9; object-fit:cover; border-radius:8px; margin-bottom:1rem; }
.event-recording span { color:#24556e; text-decoration:underline; text-underline-offset:.2em; }
.event-recording:focus-visible { outline:3px solid #24556e; outline-offset:5px; }
