/* NiCALab — site styles.
   "Lab notebook" direction: lots of white, ink-coloured text, the logo's
   pastel tones as backgrounds only (never as text colour), monospace for
   titles, navigation, dates and labels. All colours are defined once below. */

/* ---------- Fonts (IBM Plex, SIL OFL, see static/fonts/OFL.txt) ---------- */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-400-italic.ac3e6cdbce96.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-600-normal.5a2ce7798732.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Ink and paper */
  --ink: #1d1b1c;
  --muted: #6b6468;      /* secondary text: only on paper/white (AA 5.1+) */
  --line: #e6e1dc;
  --paper: #fcfbf8;
  --paper-2: #f3f0ea;
  --white: #ffffff;

  /* Pastels from the logo: backgrounds only, text on them is always --ink */
  --sage: #bbd0c0;
  --lilac: #dabfcd;
  --sand: #ebd4aa;
  --peach: #e8c9ad;

  /* Links and buttons: only on paper/white (AA 5.5+) */
  --accent: #2e6b5e;
  --accent-dark: #24574c;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 10px;
  --container: 72rem;
  --gutter: 1rem;
  --pattern: url("../img/pattern.33abb2148736.svg");
}

@media (min-width: 48rem) {
  :root { --gutter: 1.5rem; }
}

/* ---------- Base ---------- */

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-sans);
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main { flex: 1; }
main:focus { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.18rem + 0.6vw, 1.6rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
address { font-style: normal; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 0.5rem; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font: 400 0.8125rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead { font-size: 1.2rem; color: var(--muted); margin: 0.75rem 0 0; max-width: 60ch; }

.empty { font-family: var(--font-mono); color: var(--muted); list-style: none; }

/* ---------- Header and navigation ---------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.site-logo { display: block; flex: none; }
.site-logo img { height: 40px; width: auto; }

.language-switcher { display: flex; gap: 0.25rem; }
.language-switcher button {
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 400 0.8125rem/1 var(--font-mono);
  cursor: pointer;
}
.language-switcher button:hover { color: var(--ink); border-color: var(--line); }
.language-switcher button[aria-current="true"] { color: var(--ink); border-color: var(--ink); }

.nav-list { display: flex; flex-wrap: wrap; gap: 0 1.6rem; margin: 0; padding: 0; list-style: none; }
.nav-list a {
  display: inline-block;
  padding: 0.85rem 0 0.7rem;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font: 400 0.9375rem/1.2 var(--font-mono);
  text-decoration: none;
}
.nav-list a:hover { border-bottom-color: var(--line); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 600; }

.site-nav { display: none; border-top: 1px solid var(--line); }

.site-nav-mobile { border-top: 1px solid var(--line); }
.site-nav-mobile summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem var(--gutter);
  font: 400 0.9375rem/1 var(--font-mono);
  cursor: pointer;
  list-style: none;
}
.site-nav-mobile summary::-webkit-details-marker { display: none; }
.site-nav-mobile .nav-list { flex-direction: column; padding: 0 var(--gutter) 0.75rem; }
.site-nav-mobile .nav-list a { padding-block: 0.6rem; }

@media (min-width: 56rem) {
  .site-nav { display: block; }
  .site-nav-mobile { display: none; }
}

/* ---------- Page header band (node pattern) ---------- */

.page-header {
  padding-block: 2.5rem 2.25rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--paper-2);
  /* The pattern fades out behind the title so the text always sits on a calm area. */
  background-image:
    linear-gradient(90deg, var(--paper-2) 0%, rgb(243 240 234 / 0.85) 45%, rgb(243 240 234 / 0) 85%),
    var(--pattern);
  background-size: auto, 480px 300px;
}
.page-title { margin: 0; max-width: 32ch; }

.page-header--home { padding-block: 3.5rem 3.25rem; }
.page-header--home .page-title { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); max-width: 22ch; }

.page-body { padding-block: 2.5rem 4rem; }

/* ---------- Text ---------- */

.prose { max-width: 68ch; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote {
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 1.2em;
  border-left: 3px solid var(--sage);
  color: var(--muted);
}
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.3em; border-radius: 3px; }

.section-title {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; }
.section-heading__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 400 0.9375rem/1 var(--font-mono);
}

.back-link { margin: 3rem 0 0; font: 400 0.9375rem/1 var(--font-mono); }
.back-link a { display: inline-flex; align-items: center; gap: 0.4rem; }
.back-link .icon { transform: scaleX(-1); }

/* ---------- Page sections (home, lab) ---------- */

.page-section { display: grid; gap: 1.5rem 3rem; align-items: start; padding-block: 2rem; }
.page-section:first-child { padding-top: 0; }
.page-section + .page-section { border-top: 1px solid var(--line); }

.page-section__media { margin: 0; max-width: 20rem; }
.page-section__media img {
  max-height: 32rem;
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius);
}

@media (min-width: 48rem) {
  /* Images stay a supporting column; the text keeps most of the width. */
  .page-section--with-image { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
}

.home-news { margin-top: 3rem; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr));
  gap: 1.25rem;
}
.card-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:has(.card__link):hover { box-shadow: 0 8px 24px rgb(29 27 28 / 0.08); transform: translateY(-2px); }

.card__media { aspect-ratio: 1; background: var(--paper-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }

/* No image: a pastel block with the node pattern (and initials for people). */
.card__media--empty {
  display: grid;
  place-items: center;
  background-image: var(--pattern);
  background-size: 360px 225px;
}
.card-grid > :nth-child(4n + 1) .card__media--empty { background-color: var(--sage); }
.card-grid > :nth-child(4n + 2) .card__media--empty { background-color: var(--lilac); }
.card-grid > :nth-child(4n + 3) .card__media--empty { background-color: var(--sand); }
.card-grid > :nth-child(4n + 4) .card__media--empty { background-color: var(--peach); }

.card__initials,
.card__wordmark {
  padding: 0.35em 0.55em;
  border-radius: 8px;
  background: rgb(252 251 248 / 0.75);
  color: var(--ink);
  font: 600 2.25rem/1 var(--font-mono);
}
.card__wordmark { font-size: 1.5rem; }

/* Logos are shown whole, on white. */
.card--logo .card__media { aspect-ratio: 16 / 9; }
.card--logo .card__media:not(.card__media--empty) { padding: 1.5rem 2rem; background: var(--white); border-bottom: 1px solid var(--line); }
.card--logo .card__media img { object-fit: contain; }

.card__body { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem 1.2rem; }
.card__meta { margin: 0; font: 400 0.8125rem/1.4 var(--font-mono); color: var(--muted); }
.card__title { margin: 0; font: 600 1.0625rem/1.35 var(--font-sans); letter-spacing: 0; }
.card__title a { color: var(--ink); text-decoration: none; }
/* The whole card is clickable through the title link. */
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card__title a { text-decoration: underline; text-decoration-thickness: 1px; }
.card__subtitle { margin: 0; font-style: italic; }
.card__text { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }

/* ---------- Members ---------- */

.group + .group { margin-top: 3.5rem; }

.people-list { margin: 0; padding: 0; list-style: none; columns: 2 22rem; column-gap: 3rem; }
.people-list li { break-inside: avoid; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.people-list__name { font-weight: 600; }
.people-list__bio { display: block; color: var(--muted); font-size: 0.9375rem; }

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.partner { display: flex; flex-direction: column; gap: 0.6rem; }
.partner__link { display: block; text-decoration: none; }
.partner__logo {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.partner__logo img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1); opacity: 0.85; transition: filter 0.2s, opacity 0.2s; }
.partner:hover .partner__logo img, .partner__link:focus-visible img { filter: none; opacity: 1; }
.partner__logo--empty { background: var(--paper-2) var(--pattern); background-size: 360px 225px; }
.partner__wordmark { color: var(--ink); font: 600 1.15rem/1.2 var(--font-mono); text-align: center; }
.partner__text { display: flex; flex-direction: column; font-size: 0.9375rem; }
.partner__text span { color: var(--muted); }

.profile { display: grid; gap: 2rem 3rem; }
@media (min-width: 48rem) {
  .profile { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); }
}
.profile__photo img { width: 100%; border-radius: var(--radius); }
.avatar-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--sage) var(--pattern);
  background-size: 360px 225px;
}
.avatar-placeholder span { padding: 0.3em 0.5em; border-radius: 8px; background: rgb(252 251 248 / 0.75); font: 600 3rem/1 var(--font-mono); }

.contact-links, .pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 400 0.875rem/1 var(--font-mono);
  text-decoration: none;
}
.pill-link:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Projects ---------- */

.project__logo { max-width: 16rem; max-height: 6rem; width: auto; margin-bottom: 1.5rem; }
.project__tagline { font-style: italic; font-size: 1.125rem; }
.project__section { margin-top: 3rem; }

.citation-list { margin: 0; padding: 0; list-style: none; max-width: 75ch; }
.citation-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); font-size: 0.9688rem; }
.citation__doi { word-break: break-all; }

/* ---------- Publications and resources ---------- */

.year-group + .year-group { margin-top: 2.5rem; }
.year-group__title {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  background: var(--sand);
  font-size: 1.05rem;
}
.year-group:nth-child(4n + 2) .year-group__title { background: var(--sage); }
.year-group:nth-child(4n + 3) .year-group__title { background: var(--lilac); }
.year-group:nth-child(4n + 4) .year-group__title { background: var(--peach); }

.pub-list, .resource-list { margin: 0; padding: 0; list-style: none; }
.pub { padding: 1.25rem 0; border-bottom: 1px solid var(--line); max-width: 75ch; }
.pub__title { margin: 0 0 0.3rem; font: 600 1.0625rem/1.4 var(--font-sans); letter-spacing: 0; }
.pub__authors { margin: 0; color: var(--muted); font-size: 0.9688rem; }
.pub__venue { margin: 0.15rem 0 0; font-style: italic; font-size: 0.9688rem; }
.pub .pills { margin-top: 0.75rem; }

.pills a {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font: 600 0.75rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.pills a:hover { background: var(--accent); color: var(--white); }

.resource { padding-bottom: 2rem; }
.resource + .resource { padding-top: 2rem; border-top: 1px solid var(--line); }
.resource__title { font-size: 1.25rem; max-width: 50ch; }

/* ---------- News, conferences ---------- */

.lead-image { margin: 0 0 2rem; }
.lead-image img { max-height: 70vh; width: auto; border-radius: var(--radius); }

.gallery { margin-top: 2.5rem; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery a { display: block; overflow: hidden; border-radius: 8px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.gallery a:hover img { transform: scale(1.03); }

/* ---------- Outreach timeline ---------- */

.timeline { margin: 0; padding: 0 0 0 1.5rem; list-style: none; border-left: 2px solid var(--line); }
.timeline__item { position: relative; padding-bottom: 3rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: calc(-1.5rem - 9px);
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sage);
}
.timeline__item:nth-child(4n + 2)::before { background: var(--lilac); }
.timeline__item:nth-child(4n + 3)::before { background: var(--sand); }
.timeline__item:nth-child(4n + 4)::before { background: var(--peach); }
.timeline__date { margin: 0 0 0.75rem; font: 600 0.9375rem/1.3 var(--font-mono); }
.timeline__title { margin-bottom: 1rem; }
.participants { margin-top: 1.25rem; font-size: 0.9375rem; max-width: 68ch; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 0.9375rem;
}
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 2rem; }
.site-footer__name { margin: 0.75rem 0 0; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.site-footer__contact p { margin: 0 0 0.5rem; }
.site-footer .label { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.site-footer__social { margin: 0; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .card:has(.card__link):hover { transform: none; }
  .gallery a:hover img { transform: none; }
}
