.scoring-library-page {
  background: #e8e3d8;
}

.scoring-library-page .site-nav a[aria-current="page"] {
  color: var(--forest);
}

.library-main {
  width: min(1440px, calc(100% - 48px));
  margin: 32px auto 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.library-main .button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--forest);
  border-radius: 2px;
  background: var(--forest);
  color: #fffdf8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.library-main .eyebrow {
  color: var(--brass);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.library-main h1,
.library-main h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
}

.library-main .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr);
  gap: clamp(42px, 7vw, 100px);
  padding: clamp(64px, 8vw, 112px) clamp(28px, 7vw, 104px);
  background: var(--forest);
  color: #fffdf8;
}

.library-main .hero .eyebrow {
  color: #d4b673;
}

.library-main .hero h1 {
  max-width: 900px;
  margin: 10px 0 28px;
  font-size: clamp(54px, 6.6vw, 92px);
  line-height: .94;
}

.library-main .hero > div > p:last-child {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.65;
}

.library-main .hero aside {
  align-self: center;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .32);
}

.library-main .hero aside strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}

.library-main .hero li {
  margin: 14px 0;
}

.systems {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.systems article {
  padding: 40px clamp(24px, 4vw, 54px);
  border-right: 1px solid var(--line);
  background: #fffdf8;
}

.systems article:last-child {
  border-right: 0;
}

.systems span {
  color: var(--brass);
  font-weight: 700;
  letter-spacing: 1px;
}

.systems h2 {
  margin: 10px 0;
  font-size: 30px;
}

.systems a {
  color: var(--forest);
  font-weight: 700;
}

.library {
  padding: clamp(64px, 8vw, 104px) clamp(24px, 6vw, 92px);
}

.library-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.library-intro h2,
.score-to-story h2 {
  margin: 8px 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters input,
.filters select {
  min-width: 180px;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
}

.species-layout {
  display: grid;
  grid-template-columns: minmax(280px, .65fr) minmax(0, 1.35fr);
  min-height: 600px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.species-index {
  max-height: 720px;
  overflow: auto;
  border-right: 1px solid var(--line);
}

.species-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.species-button:hover,
.species-button[aria-pressed="true"] {
  background: #e5e0d4;
}

.species-button strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.species-button span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.species-detail {
  padding: clamp(30px, 5vw, 68px);
}

.species-detail h2 {
  margin: 10px 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
}

.latin {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 35px 0;
  border-top: 1px solid var(--line);
}

.detail-facts div {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.detail-facts div:nth-child(odd) {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.detail-facts div:nth-child(even) {
  padding-left: 20px;
}

.detail-facts span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.measure-box {
  padding: 24px;
  border-left: 4px solid var(--brass);
  background: #eee9de;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.source-links a {
  padding: 10px 13px;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.score-to-story {
  padding: 86px max(24px, 12vw);
  background: #ded6c4;
  text-align: center;
}

.score-to-story > div {
  max-width: 850px;
  margin: auto;
}

.score-to-story > div > p:not(.eyebrow) {
  max-width: 650px;
  margin: 0 auto 28px;
}

.score-to-story > div > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.scoring-library-page > footer {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 25px max(24px, calc((100vw - 1440px) / 2));
  background: var(--ink);
  color: #fffdf8;
  font-size: 12px;
}

@media (max-width: 900px) {
  .library-main .hero,
  .species-layout {
    grid-template-columns: 1fr;
  }

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

  .systems article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .species-index {
    max-height: 330px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .library-intro {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .scoring-library-page .header-meta {
    display: none;
  }

  .library-main {
    width: calc(100% - 20px);
    margin: 10px auto 28px;
  }

  .library-main .hero {
    padding: 54px 20px;
  }

  .library-main .hero h1 {
    font-size: clamp(46px, 14vw, 62px);
  }

  .library {
    padding-right: 14px;
    padding-left: 14px;
  }

  .filters > * {
    width: 100%;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .detail-facts div:nth-child(odd) {
    padding-right: 0;
    border-right: 0;
  }

  .detail-facts div:nth-child(even) {
    padding-left: 0;
  }

  .score-to-story {
    padding: 62px 20px;
  }

  .score-to-story > div > div {
    align-items: stretch;
    flex-direction: column;
  }

  .scoring-library-page > footer {
    flex-direction: column;
  }
}
