/* Page-specific chapter styling for the complete project library. */
.library-page {
  background: #eff6f5;
}

.library-page .site-header {
  border-bottom-color: rgba(16, 28, 41, 0.12);
}

.library-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 5vw, 70px) 0 clamp(108px, 10vw, 160px);
  background:
    radial-gradient(circle at 83% 17%, rgba(34, 156, 145, 0.24), transparent 27rem),
    radial-gradient(circle at 4% 94%, rgba(215, 155, 71, 0.13), transparent 25rem),
    #101c29;
  color: #fff;
}

.library-hero::after {
  content: "";
  position: absolute;
  right: -8rem;
  bottom: -17rem;
  width: min(54vw, 42rem);
  aspect-ratio: 1;
  border: 1px solid rgba(168, 225, 216, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(168, 225, 216, 0.025), 0 0 0 10rem rgba(168, 225, 216, 0.018);
  pointer-events: none;
}

.library-hero > .container {
  position: relative;
  z-index: 1;
}

.library-chapter-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(62px, 7vw, 100px);
  padding-top: 16px;
  border-top: 1px solid rgba(179, 220, 216, 0.27);
  color: #a2e0d8;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-chapter-line span:last-child {
  color: #c7d9de;
  font-weight: 750;
}

.library-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
  align-items: end;
  gap: clamp(48px, 7vw, 112px);
}

.library-hero .section-header {
  max-width: 930px;
  margin: 0;
}

.library-hero .eyebrow {
  margin-bottom: 24px;
  color: #9ae6d9;
}

.library-hero .section-title {
  max-width: 15ch;
  font-size: clamp(3.4rem, 7vw, 7.25rem);
  line-height: 0.99;
  letter-spacing: -0.07em;
}

.library-hero .section-title span {
  color: #a2e0d8;
}

.library-hero .section-lede {
  max-width: 53ch;
  margin-top: 30px;
  color: #d2e1e7;
  font-size: clamp(1.05rem, 1.55vw, 1.25rem);
  line-height: 1.65;
}

.library-hero-aside {
  max-width: 340px;
  padding: 23px 0 2px 26px;
  border-left: 1px solid rgba(179, 220, 216, 0.37);
}

.library-aside-number {
  color: #d7a85e;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-hero-aside p {
  margin: 22px 0 26px;
  color: #d2e1e7;
  line-height: 1.7;
}

.library-hero-aside a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #a2e0d8;
  color: #e5f9f5;
  font-weight: 800;
}

.library-hero-aside a:hover {
  color: #fff;
  border-color: #fff;
}

.library-hero-aside svg {
  width: 17px;
  height: 17px;
}

.library-catalog {
  position: relative;
  z-index: 2;
  margin-top: -32px;
  padding: clamp(70px, 7vw, 108px) 0 115px;
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 3% 22%, rgba(8, 127, 121, 0.065), transparent 34rem),
    linear-gradient(180deg, #eaf3f2 0%, #f6faf9 30%, #f6faf9 100%);
  box-shadow: 0 -24px 70px rgba(16, 28, 41, 0.12);
}

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

.library-catalog-intro .eyebrow {
  margin-bottom: 10px;
}

.library-catalog-intro h2 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.15rem, 3.4vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.library-catalog-intro > p {
  max-width: 33ch;
  margin: 0 0 5px;
  padding-left: 22px;
  border-left: 2px solid rgba(8, 127, 121, 0.4);
  color: var(--muted);
  line-height: 1.65;
}

.library-page .filters {
  gap: 9px;
  margin-bottom: 22px;
}

.library-page .filter-chip {
  min-height: 46px;
  padding-inline: 17px;
  border-color: #c7dddb;
  background: rgba(255, 255, 255, 0.74);
  color: #31515a;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.library-page .filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.library-page .filter-chip:hover:not(.active) {
  border-color: var(--primary);
  background: #e2f1ee;
  color: var(--ink);
}

.library-page .filter-chip:active {
  background: var(--primary-dark);
}

.library-page .search-row {
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid #d4e5e4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 40px rgba(16, 28, 41, 0.045);
}

.library-page .search-box {
  display: block;
}

.library-page .search-box svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 16px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--primary-dark);
  pointer-events: none;
}

.library-page .search-box input {
  min-height: 56px;
  border-color: #cbdedc;
  border-radius: 11px;
  background: #fff;
  font-size: 1rem;
}

.library-page .search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(8, 127, 121, 0.13);
}

.library-page .count-pill[role="status"] {
  justify-content: flex-end;
  min-width: 170px;
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.library-page .projects-grid {
  gap: 18px;
}

.library-page .project-card {
  border-color: #d5e5e3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(16, 28, 41, 0.07);
}

.library-page .project-card:hover {
  border-color: rgba(8, 127, 121, 0.48);
  box-shadow: 0 27px 65px rgba(16, 28, 41, 0.13);
}

.library-page .project-image {
  background: #dce9e8;
}

.library-page .project-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  background: linear-gradient(transparent, rgba(16, 28, 41, 0.12));
  pointer-events: none;
}

.library-page .project-body {
  padding: clamp(21px, 2.1vw, 28px);
}

.library-page .project-body h3 {
  margin-top: 12px;
  font-size: clamp(1.28rem, 1.5vw, 1.5rem);
  line-height: 1.15;
}

.library-page .project-body > p {
  line-height: 1.6;
}

.library-page .project-stat {
  color: var(--primary-dark);
  line-height: 1.4;
}

.library-page .project-tags span {
  border-color: #d8e5e3;
  background: #f3f8f7;
  color: #34535b;
}

.library-page .project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.library-page .project-actions .button {
  min-height: 44px;
  margin: 0;
}

.library-page .empty-state {
  padding: 54px 28px;
  border: 1px dashed #b7d0ce;
  border-radius: 18px;
  background: #fff;
}

.library-page .empty-state h2 {
  margin: 0 0 8px;
}

.library-page .empty-state p {
  max-width: 42ch;
  margin: 0 auto;
  color: var(--muted);
}

.library-contact {
  position: relative;
  overflow: hidden;
  padding: clamp(90px, 9vw, 130px) 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(20, 133, 124, 0.24), transparent 29rem),
    radial-gradient(circle at 94% 89%, rgba(215, 155, 71, 0.13), transparent 25rem),
    #101c29;
  color: #fff;
}

.library-contact::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #4ec3b6, var(--accent));
}

.library-contact .contact-band {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(44px, 7vw, 96px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.library-contact .eyebrow {
  color: #9ae6d9;
}

.library-contact .contact-copy h2 {
  max-width: 12ch;
  font-size: clamp(3.15rem, 5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.library-contact .contact-copy h2 span {
  color: #a2e0d8;
}

.library-contact .contact-copy > p {
  max-width: 45ch;
  margin-top: 24px;
  color: #d2e1e7;
  font-size: 1.1rem;
  line-height: 1.65;
}

.library-contact .contact-icon-link {
  border-color: rgba(205, 238, 234, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.library-contact .contact-icon-link:hover {
  border-color: #9ae6d9;
  background: rgba(255, 255, 255, 0.13);
}

.library-contact .contact-icon-link img {
  filter: brightness(0) invert(1);
}

.library-contact .contact-form {
  padding: clamp(24px, 3.2vw, 42px);
  border-color: #c4d9da;
  border-radius: 20px;
  background: #f9fcfc;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}

.library-page .site-footer {
  border-top-color: rgba(205, 238, 234, 0.18);
  background: #101c29;
  color: #c8dadd;
}

.library-page .site-footer a:hover {
  color: #fff;
}

.library-page .footer-links a {
  min-height: 44px;
}

@media (max-width: 980px) {
  .library-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .library-hero-aside {
    max-width: 580px;
  }

  .library-contact .contact-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-contact .contact-form {
    width: 100%;
    max-width: 720px;
  }
}

@media (max-width: 680px) {
  .library-hero {
    padding: 36px 0 93px;
  }

  .library-chapter-line {
    margin-bottom: 62px;
  }

  .library-chapter-line span:last-child {
    display: none;
  }

  .library-hero .section-title {
    font-size: clamp(3.05rem, 11vw, 4.3rem);
  }

  .library-hero .section-lede {
    margin-top: 24px;
  }

  .library-hero-aside {
    padding: 5px 0 0 20px;
  }

  .library-catalog {
    margin-top: -23px;
    padding: 74px 0 82px;
    border-radius: 23px 23px 0 0;
  }

  .library-catalog-intro {
    display: block;
    margin-bottom: 30px;
  }

  .library-catalog-intro > p {
    max-width: 45ch;
    margin-top: 24px;
  }

  .library-page .filters {
    margin-right: -14px;
    padding-right: 14px;
    scrollbar-width: none;
  }

  .library-page .filters::-webkit-scrollbar {
    display: none;
  }

  .library-page .search-row {
    gap: 0;
    padding: 10px;
  }

  .library-page .count-pill[role="status"] {
    justify-content: flex-start;
    min-height: 38px;
    padding-inline: 4px;
  }

  .library-contact {
    padding: 82px 0 88px;
  }

  .library-contact .contact-band {
    gap: 38px;
  }

  .library-contact .contact-copy h2 {
    font-size: clamp(3rem, 11vw, 4.1rem);
  }

  .library-contact .contact-form {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-page .filter-chip {
    transition: none;
  }
}

/* The full archive is quicker to scan than the image-led homepage highlights. */
.library-page .projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.library-page .library-project-card {
  display: grid;
  grid-template-columns: clamp(180px, 35%, 320px) minmax(0, 1fr);
  min-height: 260px;
  align-items: stretch;
}

.library-page .library-project-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  aspect-ratio: auto;
}

.library-page .library-project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 561px) {
  .library-page .library-project-image img[src$="warehouse2.webp"],
  .library-page .library-project-image img[src$="support2.webp"] {
    object-position: 42% center;
  }

  .library-page .library-project-image img[src$="emergency.webp"],
  .library-page .library-project-image img[src$="timor.webp"] {
    object-position: 38% center;
  }
}

.library-page .library-project-body {
  min-width: 0;
  padding: 19px 21px;
}

.library-project-category {
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.library-page .library-project-body h3 {
  margin: 7px 0 8px;
  font-size: clamp(1.18rem, 1.45vw, 1.4rem);
  line-height: 1.18;
}

.library-page .library-project-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.library-project-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
}

.library-page .library-project-stat {
  width: auto;
  max-width: 24ch;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.library-page .library-project-stat svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.library-page .library-project-actions {
  margin: 0;
  padding: 0;
}

.library-page .library-project-actions .button {
  min-height: 44px;
  padding-inline: 13px;
}

@media (max-width: 980px) {
  .library-page .projects-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-page .library-project-card {
    grid-template-columns: clamp(180px, 32%, 240px) minmax(0, 1fr);
    min-height: 222px;
  }

  .library-page .library-project-image {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .library-page .library-project-card {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .library-page .library-project-image {
    width: 108px;
  }

  .library-page .library-project-body {
    padding: 15px;
  }

  .library-page .library-project-body h3 {
    font-size: 1.08rem;
  }

  .library-page .library-project-summary {
    font-size: 1rem;
  }

  .library-project-footer {
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .library-page .library-project-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .library-page .library-project-image {
    width: 90px;
  }
}
