/* Methods Research Lab
   Plain CSS, no framework, no webfonts. The palette is taken from the shared
   methods-research mark so the Lab reads as part of the same family. */

:root {
  --ground: #fbfbfa;
  --surface: #ffffff;
  --surface-sunk: #f6f7f9;
  --ink: #1b2430;
  --ink-heading: #082b58;
  --ink-muted: #5f6b78;
  --link: #1b6099;
  --link-hover: #082b58;
  --accent: #4297e8;
  /* Darker than --accent so the ring clears 3:1 against the page. */
  --focus: #2f80d0;
  --rule: #e4e7ec;
  --rule-strong: #d4dae1;

  --measure: 38rem;
  --page: 74rem;
  --gutter: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

/* Quarto emits an empty title block because the page supplies its own H1. */
#title-block-header {
  display: none;
}

.site-main {
  display: block;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
}

/* ---------- links ---------- */

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  z-index: 10;
}

.skip-link:focus {
  left: var(--gutter);
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.site-mark {
  display: inline-flex;
  line-height: 0;
}

.site-mark img {
  width: 230px;
  height: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink-heading);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---------- headings and prose ---------- */

h1,
h2,
h3 {
  color: var(--ink-heading);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 2.5rem 0 0.75rem;
  font-size: 2.125rem;
  letter-spacing: -0.015em;
}

h2 {
  margin: 3rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 1.375rem;
  letter-spacing: -0.005em;
}

h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.0625rem;
}

p {
  max-width: var(--measure);
  margin: 0 0 1.15rem;
}

.lead {
  max-width: 44rem;
  margin: 0 0 1.5rem;
  color: var(--ink-heading);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.lead p {
  max-width: none;
  margin: 0;
  font-size: inherit;
}

/* ---------- project cards ---------- */

/* Cards fill the width available. `align-items: start` keeps each card its own
   height, so expanding one does not stretch the rest of its row. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  align-items: start;
  gap: 1rem;
  margin: 0 0 0.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.2rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}

.project-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 0.3rem;
  object-fit: contain;
}

/* Projects without their own mark get a plain tile rather than a stand-in
   logo, so nothing on the page looks like invented branding. */
.project-mark--monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-heading);
  color: #fff;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project-name {
  margin: 0;
  /* Long names wrap inside the card instead of pushing it wide. */
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.0625rem;
}

.project-description {
  max-width: none;
  margin: 0 0 0.9rem;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* ---------- disclosures ---------- */

/* <details> gives expand and collapse, keyboard operation and a correct
   accessibility role with no JavaScript. Links, collaborators and the two
   panel cards all use this one component. */
.card-disclosures {
  margin-top: auto;
  display: grid;
  gap: 0.5rem;
}

.disclosure {
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}

.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  cursor: pointer;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 600;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.disclosure[open] > summary::before {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .disclosure > summary::before {
    transition: none;
  }
}

.disclosure > summary:hover,
.disclosure > summary:focus-visible {
  color: var(--link-hover);
}

.disclosure-count {
  color: var(--ink-muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.disclosure-body {
  margin-top: 0.7rem;
}

.link-groups {
  display: grid;
  gap: 0.8rem;
}

.link-group-name {
  margin: 0 0 0.2rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

.link-list li {
  margin-bottom: 0.3rem;
}

.link-list a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}

.link-list a:hover,
.link-list a:focus-visible {
  border-bottom-color: currentColor;
}

/* A plain numbered list: name and affiliation on one line, easy to count. */
.collab-list {
  margin: 0;
  padding-left: 1.4rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.collab-list li {
  margin-bottom: 0.2rem;
}

.collab-list li::marker {
  color: var(--rule-strong);
}

/* ---------- planned work and related initiatives ---------- */

/* One small card per section, the same size as a project card and opening on
   click. Neither carries a logo, so neither reads as a running Lab project. */
.panel-card {
  max-width: 32rem;
  padding: 0.9rem 1.2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
}

.panel-card--related {
  background: var(--surface-sunk);
}

/* The card is the disclosure, so it needs no rule above the summary. */
.panel-card .disclosure {
  border-top: 0;
  padding-top: 0;
}

.panel-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding-left: 1.3rem;
}

.panel-item::marker {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.panel-item-name {
  margin: 0 0 0.2rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.panel-item-name a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}

.panel-item-name a:hover,
.panel-item-name a:focus-visible {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

.panel-item-description {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---------- people ---------- */

.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.15rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-name {
  display: block;
  color: var(--ink-heading);
  font-weight: 600;
}

/* The one role we show. Quiet, and clearly secondary to the name. */
.member-role {
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  color: var(--ink-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.member-university {
  display: block;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.member-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  margin-top: 0.15rem;
}

/* Small, quiet, and clearly secondary to the name. */
.member-link {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}

.member-link:hover,
.member-link:focus-visible {
  color: var(--ink-heading);
  border-bottom-color: currentColor;
}

/* Four members, four cards above: matching the columns keeps the page tidy. */
@media (min-width: 62rem) {
  .member-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- footer ---------- */

.site-footer {
  max-width: var(--page);
  margin: 3.5rem auto 0;
  padding: 1.1rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.site-footer p {
  max-width: none;
  margin: 0;
}

.site-footer a {
  color: var(--ink-muted);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink-heading);
}

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  body {
    font-size: 1rem;
  }

  .site-header {
    padding-top: 1.25rem;
  }

  .site-mark img {
    width: 190px;
  }

  .site-nav {
    gap: 1.1rem;
    font-size: 0.875rem;
  }

  h1 {
    margin-top: 2rem;
    font-size: 1.75rem;
  }

  h2 {
    margin-top: 2.5rem;
    font-size: 1.25rem;
  }

  .lead {
    font-size: 1.1875rem;
  }

  .project-card {
    padding: 1.05rem 1.1rem;
  }

  .panel-card {
    padding: 0.85rem 1rem 0.95rem;
  }

  .panel-list {
    padding-left: 1.1rem;
  }
}

/* ---------- print ---------- */

@media print {
  .site-header,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
  }

  /* Print everything, including anything the reader left collapsed. */
  .disclosure > summary {
    display: none;
  }

  .disclosure-body {
    display: block;
  }
}
