/* Homepage Open Research panel (src/models.jsx): frameworks, benchmarks and
   foundation models, each item tagged with its data modality. The section
   chrome and heading keep the shared .section styles in styles.css. */
.home-page #research.research-index {
  --sophont-electric: #2233bb;
  --sophont-surface: #efedf4;
  --sophont-ink: #20222c;
  --sophont-copy: #343640;
  --sophont-muted: #626674;
  --sophont-paper: #f8f5fa;
  --sophont-panel: #ffffff;
  --sophont-rule: rgba(8, 8, 42, 0.08);
  --sophont-rule-strong: rgba(8, 8, 42, 0.17);
  --font-sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Modality colors come from the categorical palette (violet for H&E
     pathology, teal, electric), darkened where needed for 4.5:1 contrast. */
  --modality-pathology: #8a4592;
  --modality-pathology-soft: #f3e8f4;
  --modality-neuro: #00685e;
  --modality-neuro-soft: #d9eeea;
  --modality-text: #2233bb;
  --modality-text-soft: #e4e6f8;
}

.home-page .research-panel {
  border: 1px solid var(--sophont-rule-strong);
  border-radius: var(--radius-md);
  background: var(--sophont-panel);
  font-family: var(--font-sans);
  overflow: hidden;
}
.home-page .research-group {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
}
.home-page .research-group + .research-group { border-top: 1px solid var(--sophont-rule-strong); }
.home-page .research-group-head { padding: 1.625rem 2rem; }
.home-page .research-group-head h3 {
  margin: 0;
  color: var(--sophont-ink);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.home-page .research-group-head p {
  max-width: 22ch;
  margin: 0.375rem 0 0;
  color: var(--sophont-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.home-page .research-list {
  margin: 0;
  padding: 0.75rem 0;
  list-style: none;
}
.home-page .research-list li + li { border-top: 1px solid var(--sophont-rule); }

.home-page .research-item {
  display: grid;
  grid-template-columns: 2.25rem minmax(10rem, 13rem) minmax(0, 1fr) auto;
  grid-template-areas: "icon name desc end";
  align-items: center;
  column-gap: 1.25rem;
  padding: 0.875rem 2rem 0.875rem 1rem;
  color: inherit;
  text-decoration: none;
}
.home-page .research-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  /* Same-hue hairline keeps the tinted tile crisp against the white panel. */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent);
}
.home-page .research-icon svg { width: 1.375rem; height: 1.375rem; }
.home-page .research-icon .research-icon-body { fill: currentColor; fill-opacity: 0.14; }
.home-page .research-icon.is-pathology { color: var(--modality-pathology); background: var(--modality-pathology-soft); }
.home-page .research-icon.is-neuro { color: var(--modality-neuro); background: var(--modality-neuro-soft); }
.home-page .research-icon.is-text { color: var(--modality-text); background: var(--modality-text-soft); }
.home-page .research-name {
  grid-area: name;
  color: var(--sophont-ink);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.home-page .research-desc {
  grid-area: desc;
  color: var(--sophont-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.home-page .research-cta {
  grid-area: end;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--sophont-copy);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}
.home-page .research-cta svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 160ms var(--ease-out);
}
.home-page .research-soon {
  grid-area: end;
  justify-self: end;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-pill);
  background: var(--sophont-surface);
  color: var(--sophont-copy);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.home-page a.research-item:hover { background: var(--sophont-paper); }
.home-page a.research-item:hover :is(.research-name, .research-cta) { color: var(--sophont-electric); }
.home-page a.research-item:hover .research-cta svg { transform: translateX(2px); }
.home-page a.research-item[target="_blank"]:hover .research-cta svg { transform: translate(2px, -2px); }
.home-page a.research-item:focus-visible {
  outline: 3px solid var(--sophont-electric);
  outline-offset: -3px;
}

/* Name above description once a one-line row no longer fits. */
@media (max-width: 80rem) {
  .home-page .research-item {
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    grid-template-areas: "icon name end" "icon desc end";
    row-gap: 0.125rem;
  }
}
@media (max-width: 56rem) {
  .home-page .research-group { grid-template-columns: minmax(0, 1fr); }
  .home-page .research-group-head { padding: 1.375rem 1.25rem 0; }
  .home-page .research-group-head p { max-width: none; }
  .home-page .research-list { padding: 0.5rem 0; }
  .home-page .research-item { padding-inline: 1.25rem; }
}
@media (max-width: 40rem) {
  .home-page .research-group-head h3 { font-size: 1.5rem; }
  .home-page .research-item {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    grid-template-areas: "icon name" "icon desc" "icon end";
    align-items: start;
    column-gap: 0.875rem;
  }
  .home-page :is(.research-cta, .research-soon) { justify-self: start; margin-top: 0.375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .research-cta svg { transition: none; }
}
