:root {
  --ink: #1a1914;
  --ink-soft: #3d3a32;
  --paper: #f3eee4;
  --paper-2: #e8e1d3;
  --cream: #faf7f1;
  --copper: #9a5a2a;
  --copper-deep: #7a4318;
  --moss: #3f5340;
  --line: rgba(26, 25, 20, 0.12);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: var(--copper-deep);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--cream);
  padding: 8px 12px;
}

.skip:focus {
  left: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.mark {
  width: 28px;
  height: 28px;
  stroke: var(--copper);
  stroke-width: 1.6;
  fill: var(--copper);
}

.mark path {
  fill: none;
}

.header-note,
.muted,
.result-meta,
.stats,
.study-meta,
.conditions,
.collaborators {
  color: var(--ink-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-soft);
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.text-link {
  text-decoration: none;
  font-weight: 600;
}

.hero {
  padding: 64px 0 28px;
  background:
    radial-gradient(1000px 420px at 90% -20%, rgba(154, 90, 42, 0.14), transparent 55%),
    linear-gradient(180deg, var(--cream), var(--paper));
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--copper-deep);
  margin: 0 0 12px;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
}

h1 em {
  font-style: italic;
  color: var(--moss);
}

.lede {
  font-size: 1.12rem;
  max-width: 42rem;
}

.molecule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.molecule-layout.has-wiki {
  grid-template-columns: minmax(0, 1fr) min(20rem, 34%);
}

.wiki-sidebar {
  position: sticky;
  top: 1.25rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.95), rgba(243, 238, 228, 0.98)),
    var(--cream);
}

.wiki-kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--copper-deep);
}

.wiki-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.45rem;
}

.wiki-desc {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.wiki-figure {
  margin: 0 0 0.9rem;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.wiki-figure img {
  display: block;
  width: 100%;
  max-height: 220px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.wiki-extract {
  margin: 0 0 0.95rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.wiki-facts {
  margin: 0;
  display: grid;
  gap: 0.55rem 0;
}

.wiki-row {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.wiki-row dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.wiki-row dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wiki-source {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.wiki-source a {
  text-decoration: none;
  font-weight: 600;
}

.wiki-source a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 960px) {
  .molecule-layout.has-wiki {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: static;
    order: -1;
  }
}

.related-browse {
  margin: 0.85rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-browse .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font: inherit;
  cursor: pointer;
}

.related-browse .btn.primary,
.related-browse .btn[aria-pressed="true"] {
  background: var(--copper);
  color: #fff;
  border-color: var(--copper);
}

.related-browse .btn:hover {
  border-color: var(--copper);
}

.search-form,
.study-search {
  display: flex;
  gap: 10px;
  margin: 28px 0 12px;
  max-width: 720px;
}

.search-form input,
.study-search input {
  flex: 1;
  font: inherit;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.place-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 8px;
  align-items: flex-start;
}

.filter-menu {
  min-width: 220px;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
}

.filter-menu[open] {
  z-index: 30;
}

.check-list {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 31;
  max-height: 260px;
  overflow: auto;
  padding: 4px 8px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #fff;
}

.check-unit {
  margin: 4px 6px 8px;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.filter-menu summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink);
}

.place-filters .check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
}

.place-filters .check-row input {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.chosen-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.sponsor-place,
.hq {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.92rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--copper);
  color: #fff;
}

.section {
  padding: 36px 0 80px;
}

.browse-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter,
.chip,
.pager button {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.letter[aria-current="true"],
.chip.is-on {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.sponsor-list,
.study-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.sponsor-list a,
.sponsor-card,
.study-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.sponsor-list a,
.sponsor-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.sponsor-card {
  flex-wrap: wrap;
  align-items: flex-start;
}

.sponsor-card-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  flex: 1 1 16rem;
  min-width: 0;
}

.sponsor-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  width: 100%;
  margin-top: 2px;
  font-size: 0.9rem;
}

.sponsor-card-links a {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--copper-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sponsor-card-links a:hover {
  color: var(--ink);
  border: 0;
}

.sponsor-list a:hover,
.sponsor-card:hover,
.study-card:hover {
  border-color: var(--copper);
}

.study-title-link {
  color: inherit;
  text-decoration: none;
}

.study-title-link:hover {
  color: var(--copper-deep);
}

.sponsor-inline,
.molecule-inline {
  color: var(--copper-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sponsor-inline:hover,
.molecule-inline:hover {
  color: var(--ink);
}

.molecules-line {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.sponsor-name {
  font-weight: 600;
}

.sponsor-card a.sponsor-name {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  text-decoration: none;
}

.sponsor-card a.sponsor-name:hover {
  color: var(--copper-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  border: 0;
}

.sponsor-count {
  color: var(--ink-soft);
  text-align: right;
  max-width: 14rem;
  line-height: 1.35;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 8px;
}

.modality-filters {
  margin-top: 0;
}

.mod-tag {
  display: inline-block;
  margin: 8px 8px 0 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(139, 90, 43, 0.12);
  color: var(--copper-deep);
  font-size: 0.78rem;
  font-weight: 650;
}

.modalities {
  margin: 4px 0 0;
}

.study-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.nct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--copper-deep);
}

.role-tag {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted, #5c564e);
  letter-spacing: 0.01em;
}

.status {
  font-size: 0.82rem;
  font-weight: 600;
}

.status-RECRUITING,
.status-NOT_YET_RECRUITING,
.status-ENROLLING_BY_INVITATION,
.status-ACTIVE_NOT_RECRUITING,
.status-AVAILABLE {
  color: var(--moss);
}

.study-card h2 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.study-meta,
.conditions,
.collaborators {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pager {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.more {
  margin-top: 18px;
}

.empty {
  color: var(--ink-soft);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

code {
  font-size: 0.88em;
}

.news-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 0.95;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.news-day {
  margin: 0 0 48px;
}

.news-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.news-day-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.65rem;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.news-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.news-kind {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--copper-deep);
}

.news-title {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
}

.news-title a {
  color: inherit;
  text-decoration: none;
}

.news-title a:hover {
  color: var(--copper-deep);
}

.news-change {
  margin: 0 0 8px;
  color: var(--ink-soft);
}

.news-change strong {
  color: var(--ink);
  font-weight: 600;
}

.news-was {
  display: block;
  font-size: 0.92rem;
}

.news-meta {
  margin: 0;
  font-size: 0.92rem;
}

.news-sponsor {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

a.news-sponsor:hover {
  color: var(--copper-deep);
}

@media (max-width: 700px) {
  .sponsor-list a,
  .sponsor-card,
  .sponsor-card-main {
    flex-direction: column;
  }

  .search-form {
    flex-direction: column;
  }

  .news-day-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
