:root {
  --library-ivory: #f6f0e3;
  --library-parchment: #fffaf0;
  --library-paper: #fbf5e8;
  --library-sage: #9ead8a;
  --library-olive: #68734a;
  --library-green: #244b35;
  --library-walnut: #6b4a2f;
  --library-bronze: #b7894b;
  --library-charcoal: #282722;
  --library-muted: #6e6a5f;
  --library-line: rgba(78, 65, 45, 0.18);
  --library-shadow: 0 22px 55px rgba(61, 49, 32, 0.12);
  --library-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --library-sans: "Inter", "Source Sans Pro", "Avenir Next", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.library-body {
  margin: 0;
  color: var(--library-charcoal);
  font-family: var(--library-sans);
  background:
    radial-gradient(circle at 8% 6%, rgba(183, 137, 75, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(104, 115, 74, 0.16), transparent 24rem),
    linear-gradient(180deg, #f8f1e3 0%, #f4eddf 48%, #fbf6eb 100%);
}

body.library-body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(107, 74, 47, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 74, 47, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.library-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.library-header {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 16px;
  border: 1px solid var(--library-line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 16px 34px rgba(70, 55, 34, 0.1);
  backdrop-filter: blur(14px);
}

.library-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.library-brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(61, 49, 32, 0.12));
}

.library-brand-text {
  display: grid;
  gap: 2px;
}

.library-brand-text strong {
  font-family: var(--library-serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.library-brand-text span {
  color: var(--library-muted);
  font-size: 0.9rem;
}

.library-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.library-nav a {
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--library-muted);
  font-size: 0.94rem;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.library-nav a:hover,
.library-nav a:focus-visible {
  background: rgba(104, 115, 74, 0.12);
  color: var(--library-green);
  transform: translateY(-1px);
}

.library-main {
  display: grid;
  gap: 34px;
  padding-top: 28px;
}

.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(270px, 0.65fr);
  gap: 38px;
  align-items: end;
  min-height: 650px;
  padding: clamp(34px, 6vw, 72px);
  overflow: hidden;
  border: 1px solid rgba(107, 74, 47, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(34, 34, 27, 0.78), rgba(34, 34, 27, 0.34) 48%, rgba(246, 240, 227, 0.86)),
    linear-gradient(180deg, rgba(107, 74, 47, 0.12), rgba(36, 75, 53, 0.18)),
    url("images/heritage-library/running-waters-mount-hood.jpg") center / cover;
  color: #fffaf0;
  box-shadow: var(--library-shadow);
}

.library-hero::after {
  position: absolute;
  right: clamp(22px, 6vw, 74px);
  top: clamp(28px, 8vw, 96px);
  width: min(320px, 34vw);
  height: min(320px, 34vw);
  border: 1px solid rgba(255, 250, 240, 0.38);
  border-radius: 50%;
  content: "";
  opacity: 0.42;
}

.library-hero-copy,
.library-hero-aside {
  position: relative;
  z-index: 1;
}

.library-hero-copy {
  max-width: 790px;
}

.library-kicker,
.library-eyebrow {
  margin: 0 0 12px;
  color: var(--library-olive);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.library-hero .library-kicker {
  color: rgba(255, 250, 240, 0.86);
}

.library-hero h1,
.library-page-hero h1,
.library-section-heading h2,
.library-note h2,
.library-card h3,
.library-feature h2,
.library-shelf h2 {
  margin: 0;
  font-family: var(--library-serif);
  font-weight: 500;
  line-height: 1.04;
}

.library-hero h1 {
  max-width: 820px;
  font-size: clamp(3.2rem, 8vw, 6.7rem);
  letter-spacing: 0;
}

.library-lead {
  max-width: 68ch;
  margin: 22px 0 0;
  color: rgba(255, 250, 240, 0.9);
  font-size: clamp(1.06rem, 1.6vw, 1.26rem);
  line-height: 1.8;
}

.library-hero-aside {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
  color: var(--library-charcoal);
  box-shadow: 0 18px 42px rgba(34, 29, 21, 0.15);
}

.library-hero-aside p {
  margin: 0;
  color: var(--library-muted);
  line-height: 1.72;
}

.library-hero-aside strong {
  font-family: var(--library-serif);
  font-size: 1.42rem;
  font-weight: 500;
  color: var(--library-green);
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.library-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(36, 75, 53, 0.2);
  border-radius: 999px;
  background: var(--library-green);
  color: #fffaf0;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.library-button:hover,
.library-button:focus-visible {
  background: #1d3f2d;
  box-shadow: 0 14px 28px rgba(36, 75, 53, 0.2);
  transform: translateY(-2px);
}

.library-button.secondary {
  background: rgba(255, 250, 240, 0.74);
  color: var(--library-green);
}

.library-panel,
.library-note,
.library-identity,
.library-card,
.library-feature,
.library-shelf,
.library-callout,
.library-page-hero {
  border: 1px solid var(--library-line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.76);
  box-shadow: var(--library-shadow);
}

.library-note {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 28px;
  padding: clamp(28px, 5vw, 52px);
}

.library-note h2 {
  color: var(--library-green);
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.library-note p,
.library-section-heading p,
.library-card p,
.library-feature p,
.library-shelf p,
.library-page-hero p,
.library-footer p,
.library-list li {
  color: var(--library-muted);
  line-height: 1.76;
}

.library-note p {
  margin: 0 0 1rem;
  font-size: 1.04rem;
}

.library-identity {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  padding: clamp(28px, 5vw, 52px);
}

.library-identity-emblem {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 28px;
  border: 1px solid rgba(104, 115, 74, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(183, 137, 75, 0.12), transparent 52%),
    rgba(255, 250, 240, 0.68);
}

.library-identity-emblem img {
  width: min(100%, 460px);
}

.library-identity h2 {
  margin: 0;
  color: var(--library-green);
  font-family: var(--library-serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.06;
}

.library-identity p:not(.library-eyebrow) {
  margin: 16px 0 0;
  color: var(--library-muted);
  line-height: 1.76;
}

.library-section-heading {
  max-width: 760px;
  padding: 18px 0 0;
}

.library-section-heading h2 {
  color: var(--library-green);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.library-section-heading p {
  margin: 14px 0 0;
  font-size: 1.04rem;
}

.library-collections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.library-card {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 270px;
  padding: 26px;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.library-card:hover,
.library-card:focus-visible {
  border-color: rgba(183, 137, 75, 0.52);
  box-shadow: 0 26px 62px rgba(61, 49, 32, 0.17);
  transform: translateY(-4px);
}

.library-card h3 {
  color: var(--library-green);
  font-size: 1.74rem;
}

.library-card p {
  margin: 0;
}

.library-card small,
.library-meta {
  color: var(--library-walnut);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.library-card::before,
.library-feature::before,
.library-shelf::before {
  display: block;
  width: 52px;
  height: 2px;
  background: var(--library-bronze);
  content: "";
}

.library-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.library-feature,
.library-callout {
  padding: clamp(26px, 4vw, 44px);
}

.library-feature h2,
.library-shelf h2 {
  color: var(--library-green);
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.library-feature p,
.library-callout p {
  margin: 16px 0 0;
}

.library-feature img {
  width: 100%;
  max-height: 420px;
  margin-top: 24px;
  border: 1px solid rgba(107, 74, 47, 0.16);
  border-radius: 8px;
  object-fit: cover;
}

.library-callout {
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(104, 115, 74, 0.13), rgba(183, 137, 75, 0.09)),
    rgba(255, 250, 240, 0.82);
}

.library-callout blockquote {
  margin: 0;
  color: var(--library-green);
  font-family: var(--library-serif);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.15;
}

.library-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: 30px;
  align-items: center;
  padding: clamp(34px, 6vw, 66px);
}

.library-page-hero h1 {
  color: var(--library-green);
  font-size: clamp(3rem, 7vw, 6rem);
}

.library-page-hero p {
  max-width: 68ch;
  margin: 20px 0 0;
  font-size: 1.08rem;
}

.library-page-mark {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid rgba(104, 115, 74, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(183, 137, 75, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 250, 240, 0.96), rgba(232, 223, 204, 0.8));
}

.library-page-mark img {
  width: min(72%, 220px);
  filter: drop-shadow(0 18px 30px rgba(61, 49, 32, 0.14));
}

.library-shelves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.library-shelf {
  padding: 28px;
}

.library-shelf h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.library-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.library-list li {
  padding-left: 18px;
  border-left: 2px solid rgba(183, 137, 75, 0.42);
}

.library-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--library-line);
}

.library-footer p {
  margin: 0;
}

.library-footer a {
  color: var(--library-green);
  font-weight: 700;
  text-decoration: none;
}

.library-footer a:hover,
.library-footer a:focus-visible {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 880px) {
  .library-header,
  .library-note,
  .library-identity,
  .library-feature-grid,
  .library-page-hero {
    grid-template-columns: 1fr;
  }

  .library-header {
    position: static;
    align-items: flex-start;
  }

  .library-nav {
    justify-content: flex-start;
  }

  .library-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 86px;
  }

  .library-hero::after {
    width: 190px;
    height: 190px;
  }

  .library-collections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .library-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 12px;
  }

  .library-header {
    flex-direction: column;
    gap: 16px;
    padding: 12px;
  }

  .library-brand-mark {
    width: 46px;
    height: 46px;
  }

  .library-brand-text strong {
    font-size: 1.05rem;
  }

  .library-brand-text span {
    display: none;
  }

  .library-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .library-nav a {
    text-align: center;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .library-main {
    gap: 24px;
    padding-top: 18px;
  }

  .library-hero,
  .library-page-hero,
  .library-note,
  .library-identity,
  .library-feature,
  .library-callout,
  .library-shelf,
  .library-card {
    padding: 24px;
  }

  .library-hero {
    padding-top: 92px;
  }

  .library-hero h1 {
    font-size: clamp(2.7rem, 12vw, 3.5rem);
  }

  .library-identity-emblem {
    min-height: 190px;
    padding: 16px;
  }

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

  .library-collections,
  .library-shelves {
    grid-template-columns: 1fr;
  }

  .library-card {
    min-height: auto;
  }
}
