.library-page {
  background: #f7f5ef;
}

.library-header .header-inner {
  grid-template-columns: 1fr auto;
}

.context-return-bar {
  border-top: 1px solid rgba(23, 52, 58, 0.08);
  background: rgba(223, 236, 229, 0.94);
}

.context-return-bar[hidden] {
  display: none;
}

.context-return-bar .shell {
  display: flex;
  min-height: 44px;
  align-items: center;
}

.context-return-bar a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.context-return-bar a:hover,
.context-return-bar a:focus-visible {
  color: var(--copper);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.library-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 86px 0 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.58) 0 42%, transparent 68%),
    #f7f5ef;
}

.library-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 42%;
  background-image:
    linear-gradient(rgba(23, 108, 103, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 108, 103, 0.075) 1px, transparent 1px),
    linear-gradient(
      135deg,
      transparent 49.75%,
      rgba(169, 78, 43, 0.11) 50%,
      transparent 50.25%
    );
  background-size:
    82px 82px,
    82px 82px,
    100% 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26%);
  mask-image: linear-gradient(to right, transparent, #000 26%);
  transform: skewX(-7deg);
  transform-origin: top right;
}

.library-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 46%;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, var(--copper) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 17%, var(--teal) 0 5px, transparent 6px),
    radial-gradient(circle at 75% 38%, var(--teal) 0 4px, transparent 5px),
    radial-gradient(circle at 34% 63%, var(--copper) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 77%, var(--teal) 0 5px, transparent 6px);
  opacity: 0.48;
}

.library-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.75fr;
  gap: 100px;
  align-items: end;
}

.library-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3rem, 5.7vw, 6.1rem);
}

.library-intro {
  padding-bottom: 12px;
}

.library-intro p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}

.library-intro p:first-child {
  color: var(--ink);
  font-size: 1.08rem;
}

.library-intro .text-link {
  margin-top: 10px;
}

.library-summary {
  display: grid;
  grid-template-columns: 0.55fr 0.55fr 1fr;
  margin-top: 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.library-summary div {
  display: grid;
  min-height: 118px;
  align-content: center;
  padding: 18px 28px;
  border-right: 1px solid var(--line);
}

.library-summary div:last-child {
  border-right: 0;
}

.library-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  font-weight: 400;
}

.library-summary span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.library-section,
.evidence-bank,
.contact-section {
  padding: 98px 0;
}

.library-section-heading {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 50px;
}

.library-section-heading h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2.2rem, 3.8vw, 4rem);
}

.library-section-heading > p {
  margin: 0 0 8px;
  color: var(--ink-soft);
}

.library-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: 104px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
}

.filter-panel > p {
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.filter-list {
  display: grid;
  gap: 6px;
}

.filter-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.filter-button span {
  font-size: 0.78rem;
  font-weight: 750;
}

.filter-button small {
  color: inherit;
  font-size: 0.72rem;
}

.filter-button:hover,
.filter-button:focus-visible {
  background: rgba(23, 108, 103, 0.07);
  color: var(--ink);
}

.filter-button.is-active {
  background: var(--ink);
  color: var(--white);
}

.filter-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.filter-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.package-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  padding: 0 4px;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.package-toolbar p {
  margin: 0;
}

.collapse-all {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.package-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.package-card {
  position: relative;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.package-card:hover {
  border-color: rgba(23, 108, 103, 0.42);
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.package-card[hidden] {
  display: none;
}

.package-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.package-topline span {
  color: var(--copper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
}

.package-topline small {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint-light);
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.package-card h3 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.package-card > p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.package-toggle {
  display: inline-flex;
  min-height: 44px;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.package-toggle::after {
  content: "+";
}

.package-toggle[aria-expanded="true"]::after {
  content: "−";
}

.package-detail {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.package-detail ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
  list-style: none;
}

.package-detail li {
  position: relative;
  padding-left: 14px;
}

.package-detail li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper);
}

.evidence-bank {
  background: var(--ink);
  color: var(--white);
}

.evidence-bank .eyebrow {
  color: #97c9be;
}

.evidence-bank .library-section-heading > p {
  color: rgba(255, 255, 255, 0.62);
}

.evidence-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(151, 201, 190, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.025);
  list-style: none;
}

.evidence-path li {
  position: relative;
  display: grid;
  min-height: 102px;
  align-content: center;
  gap: 8px;
  padding: 20px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.evidence-path li:last-child {
  border-right: 0;
}

.evidence-path li:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: calc(50% - 5px);
  right: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  background: var(--ink);
  content: "";
  transform: rotate(45deg);
}

.evidence-path span {
  color: #9fcfc4;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.evidence-path strong {
  color: rgba(255, 255, 255, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 400;
}

.evidence-preview-grid h3 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.3vw, 2.35rem);
  font-weight: 400;
  line-height: 1.12;
}

.evidence-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 42px 0 0;
}

.evidence-story div {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 18px;
  margin: 0;
  padding: 24px 28px 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.evidence-story div:nth-child(even) {
  padding-right: 0;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.evidence-story div:last-child {
  grid-column: 1 / -1;
  padding-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.evidence-story dt {
  color: #9fcfc4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-story dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
}

.evidence-preview-grid {
  display: block;
}

.evidence-preview-grid article {
  display: grid;
  grid-template-columns: 1.05fr 0.8fr;
  column-gap: 90px;
  min-height: auto;
  padding: 42px 0 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.evidence-preview-grid article:last-child {
  border-bottom: 0;
}

.evidence-preview-meta {
  grid-column: 1 / -1;
  display: flex;
  min-height: auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.evidence-preview-meta span {
  color: #9fcfc4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.evidence-preview-meta strong {
  max-width: 230px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.evidence-preview-grid p {
  align-self: end;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
}

.evidence-preview-grid .evidence-details {
  grid-column: 1 / -1;
}

.evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
}

.evidence-links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.44);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  text-decoration: none;
}

.evidence-details {
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.evidence-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  list-style: none;
}

.evidence-details summary::-webkit-details-marker {
  display: none;
}

.evidence-details summary::after {
  color: #9fcfc4;
  content: "+";
  font-size: 1.1rem;
  font-weight: 400;
}

.evidence-details[open] summary::after {
  content: "−";
}

.evidence-details .evidence-story {
  margin-top: 4px;
}

.evidence-details-compact .evidence-story {
  grid-template-columns: 1fr;
}

.evidence-details-compact .evidence-story div,
.evidence-details-compact .evidence-story div:nth-child(even),
.evidence-details-compact .evidence-story div:last-child {
  grid-column: auto;
  grid-template-columns: 110px 1fr;
  padding: 18px 0;
  border-left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.evidence-details-compact .evidence-story div:last-child {
  border-bottom: 0;
}

.contact-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  scroll-margin-top: 80px;
  background: var(--mint-light);
}

.contact-grid {
  display: grid;
  grid-template-columns:
    minmax(250px, 0.78fr)
    minmax(210px, 0.58fr)
    minmax(300px, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.contact-grid h2 {
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 3.8vw, 4rem);
}

.contact-grid > div:first-child > p:last-child {
  max-width: 600px;
  color: var(--ink-soft);
}

.contact-portrait {
  width: 100%;
  max-width: 290px;
  margin: 0;
  justify-self: center;
}

.contact-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border: 6px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 55px rgba(23, 52, 58, 0.16);
}

.contact-card {
  display: grid;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.contact-card a {
  display: grid;
  gap: 5px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 180ms ease;
}

.contact-card a:last-child {
  border-bottom: 0;
}

.contact-card a:hover,
.contact-card a:focus-visible {
  background: rgba(255, 255, 255, 0.88);
}

.contact-card span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-card strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.library-footer {
  background: #f7f5ef;
}

@media (max-width: 1000px) {
  .library-header .header-inner {
    grid-template-columns: 1fr auto;
  }

  .library-hero-grid,
  .library-section-heading,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-portrait {
    width: min(100%, 280px);
    justify-self: start;
  }

  .library-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .filter-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .evidence-preview-grid article {
    grid-template-columns: 1fr;
    row-gap: 26px;
  }

  .evidence-preview-grid p {
    margin: 0;
  }

  .evidence-story {
    grid-template-columns: 1fr;
  }

  .evidence-story div,
  .evidence-story div:nth-child(even),
  .evidence-story div:last-child {
    grid-column: auto;
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }

  .evidence-story div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .library-hero {
    padding-top: 62px;
  }

  .library-hero::before {
    opacity: 0.55;
  }

  .library-hero::after {
    opacity: 0.28;
  }

  .library-summary {
    grid-template-columns: 1fr 1fr;
    margin-top: 48px;
  }

  .library-summary div {
    min-height: 96px;
    padding: 14px 18px;
  }

  .library-summary div:nth-child(2) {
    border-right: 0;
  }

  .library-summary div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .library-section,
  .evidence-bank,
  .contact-section {
    padding: 72px 0;
  }

  .filter-list,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .evidence-path {
    grid-template-columns: 1fr;
  }

  .evidence-path li {
    min-height: auto;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .evidence-path li:last-child {
    border-bottom: 0;
  }

  .evidence-path li::after {
    display: none;
  }

  .evidence-path strong {
    font-family: inherit;
  }

  .evidence-story div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .evidence-details-compact .evidence-story div,
  .evidence-details-compact .evidence-story div:nth-child(even),
  .evidence-details-compact .evidence-story div:last-child {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .evidence-preview-grid article {
    min-height: auto;
    padding: 32px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .evidence-preview-grid article:last-child {
    border-bottom: 0;
  }

  .evidence-preview-meta {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
  }

  .evidence-preview-meta strong {
    max-width: none;
    text-align: left;
  }

  .package-card {
    min-height: 320px;
  }
}
