/* ForeSITE brand palette. The three official colors come straight from
   "ForeSITE Logo Guidelines" (Pantone 201 C, 1235 C, and 7540 C); nothing else in this
   file may introduce a competing hue. Everything named below is either one of those
   three or a tint/shade derived from them. */
:root {
  color-scheme: light;

  /* Official */
  --crimson: #a60f2d;
  --gold: #fdb921;
  --gray: #4e4e4e;

  /* Derived */
  --crimson-deep: #7c0b22;
  --crimson-soft: #c2405a;
  --crimson-tint: #f7e7ea;
  --gold-deep: #8a6413;
  --gold-tint: #fdf1d6;

  --ink: #2c2c2c;
  --ink-soft: var(--gray);
  --ink-muted: #6f6f6f;
  --sand: #f2ede9;
  --sand-deep: #dcd2cb;
  --paper: #f8f6f4;
  --white: #fff;
  --line: #e3ddd8;

  --shadow: 0 18px 55px rgb(78 78 78 / 12%);
  --radius: 20px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  /* The logo is set in Proxima Nova Semibold. It is a licensed face that cannot be
     shipped with a dependency-free static site, so the stack asks for it first and
     falls back to the geometric humanist sans faces closest to it. */
  font-family:
    "Proxima Nova", "Avenir Next", Avenir, Montserrat, "Segoe UI", Inter, ui-sans-serif,
    -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--crimson);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(166 15 45 / 35%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 0.7rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

/* The brand bar carries the two official accent colors across the full width, so the
   page reads as ForeSITE before the logo is even in view. */
.brand-bar {
  background: linear-gradient(90deg, var(--crimson) 0%, var(--crimson) 45%, var(--gold) 100%);
  height: 5px;
}

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

.header-inner {
  align-items: center;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0.9rem 1.5rem;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 1rem;
  text-decoration: none;
}

/* Logo clear space: the guidelines require at least 1X — the height of the mark's end
   point — free on every side, which the padding here reserves. The logo is never
   recolored, cropped, or redrawn; only scaled in proportion. */
.brand-logo {
  display: block;
  height: auto;
  padding: 0.35rem 0.5rem;
  width: clamp(112px, 12vw, 148px);
}

.brand-rule {
  background: var(--line);
  height: 2.1rem;
  width: 1px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.97rem;
  letter-spacing: -0.015em;
}

.brand small {
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

nav {
  align-items: center;
  display: flex;
  gap: 0.2rem;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.nav-link,
.text-action {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.nav-link {
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 650;
  padding: 0.55rem 0.78rem;
}

a.nav-link {
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--sand);
  color: var(--ink);
}

.official-site-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.48rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.official-site-link:hover {
  background: var(--white);
  border-color: var(--sand-deep);
}

main {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 2rem 1.5rem 5rem;
}

.hero {
  align-items: center;
  background:
    radial-gradient(circle at 9% 0%, rgb(255 255 255 / 78%), transparent 30%),
    linear-gradient(115deg, var(--crimson-tint) 0%, #f6ece4 52%, var(--gold-tint) 100%);
  border: 1px solid rgb(78 78 78 / 10%);
  border-radius: 24px;
  column-gap: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.1rem) clamp(1.4rem, 4vw, 2.6rem);
  position: relative;
  row-gap: 0.9rem;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.kicker {
  color: var(--crimson);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 0.5rem;
  max-width: 890px;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
  margin-bottom: 0.6rem;
}

h3,
h4 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}

/* The site's own description is a footnote, not a pitch: it states whose profiles are
   here and points at the official network site for everything else. */
.hero-note {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-bottom: 0;
  max-width: 760px;
}

.freshness {
  align-items: center;
  color: var(--ink-soft);
  display: flex;
  font-size: 0.8rem;
  gap: 0.55rem;
}

.status-dot {
  background: var(--ink-muted);
  border: 4px solid rgb(111 111 111 / 18%);
  border-radius: 50%;
  height: 0.8rem;
  width: 0.8rem;
}

.freshness.is-current .status-dot {
  background: var(--gold);
  border-color: rgb(253 185 33 / 26%);
}

.freshness.is-stale .status-dot {
  background: var(--crimson);
  border-color: rgb(166 15 45 / 18%);
}

.view {
  animation: reveal 280ms ease both;
}

.view[hidden] {
  display: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-answer[aria-busy="true"]::after {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .view {
    animation: none;
  }
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-heading p:not(.kicker) {
  color: var(--ink-soft);
  max-width: 700px;
}

.section-heading-spaced {
  margin-top: 5rem;
}

.text-action {
  color: var(--crimson);
  font-size: 0.86rem;
  font-weight: 720;
  padding: 0.4rem 0;
  white-space: nowrap;
}

.researcher-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

.card,
.expert-group {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgb(78 78 78 / 6%);
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 1.4rem;
}

.card:hover {
  border-color: var(--sand-deep);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 180ms ease;
}

.card-meta,
.record-meta,
.result-count,
.last-updated {
  color: var(--ink-muted);
  font-size: 0.77rem;
}

.card h3 {
  font-size: 1.25rem;
  margin: 0.65rem 0 0.6rem;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--crimson);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.tag {
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
}

.empty-state {
  background: linear-gradient(145deg, #fff, var(--sand));
  border: 1px dashed var(--sand-deep);
  border-radius: var(--radius);
  max-width: 760px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
}

.empty-state.compact {
  margin-top: 1rem;
  padding: 1.5rem;
}

.empty-state h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

.filter-bar {
  align-items: end;
  background: var(--sand);
  border-radius: var(--radius);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1.7fr 1fr 1fr;
  margin-bottom: 1rem;
  padding: 1rem;
}

label > span:not(.tag) {
  color: var(--ink-soft);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0.15rem;
}

input[type="search"],
select {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 11px;
  color: var(--ink);
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  width: 100%;
}

#works-filters {
  grid-template-columns: 2fr repeat(4, 1fr);
}

/* Caveats a reader needs before they draw a conclusion from a list, set apart from the
   list itself by the gold accent rather than by an alarm color. */
.callout {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.3rem;
}

.callout h3 {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}

.callout ul {
  color: var(--ink-soft);
  font-size: 0.84rem;
  margin: 0;
  max-width: 860px;
  padding-left: 1.1rem;
}

.callout li + li {
  margin-top: 0.35rem;
}

.callout strong {
  color: var(--ink);
}

.works-list {
  display: grid;
  gap: 0.8rem;
}

.work-record {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgb(78 78 78 / 6%);
  padding: 1.35rem 1.5rem;
}

.work-record h3 {
  font-size: 1.15rem;
  margin: 0.45rem 0 0.5rem;
}

.work-record h3 a {
  color: var(--ink);
  text-decoration: none;
}

.work-record h3 a:hover {
  color: var(--crimson);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.work-record .record-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.work-type {
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  text-transform: uppercase;
}

.work-type-article {
  background: var(--sand);
  color: var(--crimson);
}

.work-type-preprint {
  background: var(--gold-tint);
  color: var(--gold-deep);
}

.work-authors {
  color: var(--ink-soft);
  font-size: 0.84rem;
  margin: 0 0 0.55rem;
}

.work-authors .network-author {
  color: var(--crimson);
}

.work-authors .muted {
  color: #8f8a86;
}

.work-abstract {
  color: var(--ink-soft);
  display: -webkit-box;
  font-size: 0.88rem;
  margin: 0;
  max-width: 900px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.work-record.is-expanded .work-abstract {
  display: block;
  overflow: visible;
}

.work-abstract.is-missing {
  color: #8f8a86;
  font-style: italic;
}

.work-toggle {
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

.work-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.work-ids a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  text-decoration: none;
}

.work-ids a:hover {
  border-color: var(--crimson);
}

.match-reason {
  color: var(--crimson);
  font-size: 0.76rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.work-people {
  color: var(--ink-muted);
  font-size: 0.76rem;
  margin: 0.7rem 0 0;
}

.works-more {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.works-more button {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 999px;
  color: var(--crimson);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
}

.works-more button:hover {
  background: var(--sand);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.profile-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
}

.profile-links a:hover {
  background: var(--sand);
}

.researcher-card {
  min-height: 245px;
}

.researcher-role {
  color: var(--crimson);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.expert-form {
  margin: 0 0 1rem;
  max-width: 840px;
}

.search-shell {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  padding: 0.4rem;
}

.search-shell input {
  border: 0;
  font-size: 1.05rem;
  min-height: 3.4rem;
}

.search-shell input:focus-visible {
  outline: 0;
}

.search-shell button {
  background: var(--crimson);
  border: 0;
  border-radius: 11px;
  color: var(--white);
  cursor: pointer;
  font-weight: 730;
  min-width: 110px;
  padding: 0.7rem 1.1rem;
}

.search-shell button:hover {
  background: var(--crimson-deep);
}

.inline-error,
.app-message {
  background: var(--crimson-tint);
  border: 1px solid #e3bcc4;
  border-radius: 12px;
  color: var(--crimson-deep);
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

/* The ask bar spans the full hero width beneath the title and the freshness badge. */
.ask-form {
  flex: 1 1 100%;
  margin-top: 1.2rem;
}

.ask-shell {
  max-width: 760px;
}

.ask-examples {
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
}

/* What the assistant is and where the question goes, next to the box it goes into. */
.ask-disclosure {
  color: var(--ink-muted);
  font-size: 0.78rem;
  margin: 0.9rem 0 0;
  max-width: 760px;
}

.ask-results {
  margin-top: 1.8rem;
}

/* The status and echo lines are empty until a question is asked, and an empty paragraph
   still reserves a line; collapsing them keeps the two searches close together. */
.ask-results p:empty {
  display: none;
}

/* A budget or rate-limit message is information, not failure, so it reads gold rather
   than crimson while keeping the same box as .inline-error. */
.inline-notice {
  background: var(--gold-tint);
  border: 1px solid var(--sand-deep);
  border-radius: 12px;
  color: var(--gold-deep);
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

.ask-answer {
  font-size: 1.06rem;
  line-height: 1.65;
  margin-top: 0.6rem;
  max-width: 70ch;
}

.ask-answer p {
  margin: 0 0 0.9rem;
}

/* The answer to "who can help with X" is a set of people, and a set is far easier to
   compare down a column than inside a paragraph. The rule doubles as the bullet, so ten
   names scan without ten disc markers competing with the citation superscripts. */
.ask-people {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
}

.ask-people li {
  border-left: 2px solid var(--sand-deep);
  margin-bottom: 0.75rem;
  padding-left: 0.9rem;
}

.ask-people li:last-child {
  margin-bottom: 0;
}

.ask-answer[aria-busy="true"]::after {
  animation: ask-caret 1s steps(2) infinite;
  background: var(--crimson);
  content: "";
  display: inline-block;
  height: 1.05em;
  margin-left: 0.15rem;
  vertical-align: text-bottom;
  width: 2px;
}

@keyframes ask-caret {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.ask-cite a,
.ask-cite {
  color: var(--crimson);
  font-weight: 700;
  padding-left: 0.1rem;
  text-decoration: none;
}

.ask-cite a:hover {
  text-decoration: underline;
}

.ask-citations {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.ask-citations-heading {
  font-size: 1rem;
  margin: 0;
}

/* A citation is a title and a line of detail, so it must not inherit the card grid's
   220px floor — ten researchers can cite twenty documents, and twenty mostly-empty
   boxes bury the answer they belong to. */
.ask-citation {
  min-height: 0;
}

.ask-citation h4 {
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.expert-group {
  margin-top: 1rem;
  padding: 1.4rem;
}

.expert-group > h3 {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.count-pill {
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 800px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #ece7e3;
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-muted);
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.28rem 0.6rem;
  text-transform: uppercase;
}

/* Status stays inside the three official colors rather than reaching for a green: gold
   reads as healthy here because the freshness dot already uses it that way, and crimson
   is the only alarm color the brand has. */
.status-ok {
  background: var(--gold-tint);
  color: var(--gold-deep);
}

.status-skipped {
  background: var(--sand);
  color: var(--gray);
}

.status-blocked,
.status-error {
  background: var(--crimson-tint);
  color: var(--crimson-deep);
}

/* The reverse logo needs a dark, quiet field behind it — the guidelines rule out busy or
   low-contrast backgrounds — so the footer is a flat band in the official dark gray. */
.site-footer {
  background: var(--gray);
  border-top: 5px solid var(--crimson);
  color: #eae7e4;
}

.footer-inner {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 2.6rem 1.5rem 2.8rem;
}

.footer-top {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
}

.footer-logo {
  display: block;
  height: auto;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  width: 150px;
}

.site-footer p,
.footer-meta {
  color: #d6d1cd;
  font-size: 0.77rem;
  margin-bottom: 0;
}

.site-footer p {
  max-width: 540px;
}

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

.footer-meta {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-data-links {
  display: flex;
  gap: 0.75rem;
}

.footer-version a {
  font-weight: 700;
  text-decoration: none;
}

.footer-version a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer .footer-colophon {
  border-top: 1px solid rgb(255 255 255 / 15%);
  margin-top: 2rem;
  max-width: none;
  padding-top: 1.2rem;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .header-actions {
    max-width: 100%;
  }

  nav {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .nav-link {
    white-space: nowrap;
  }

  .researcher-grid {
    grid-template-columns: 1fr 1fr;
  }

  #works-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .header-inner,
  main,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .hero {
    padding: 1.4rem;
  }

  h1 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .researcher-grid,
  .filter-bar,
  #works-filters {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .search-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .search-shell button {
    min-height: 2.8rem;
  }

  .footer-top {
    align-items: start;
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-meta {
    align-items: start;
  }
}
