.library-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 8%, rgba(2, 149, 170, 0.1), transparent 30rem),
    var(--paper);
}

.library-main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(54px, 8vw, 104px) clamp(24px, 6vw, 88px) 90px;
}

.library-hero {
  max-width: 1040px;
  margin-bottom: clamp(44px, 6vw, 78px);
}

.library-hero h1 {
  margin: 18px 0 24px;
  font-size: clamp(3.4rem, 7vw, 7.8rem);
  font-weight: 860;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.library-hero h1 span {
  color: var(--teal);
}

.library-hero > p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
}

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

.story-card {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 18px 55px rgba(25, 34, 36, 0.055);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.story-card:hover {
  transform: translateY(-5px);
  border-color: rgba(2, 149, 170, 0.45);
  box-shadow: 0 26px 70px rgba(25, 34, 36, 0.09);
}

.story-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 44px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-card-topline > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  letter-spacing: 0;
}

.story-card h2 {
  margin: 14px 0 16px;
  font-size: clamp(1.75rem, 2.6vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.story-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.story-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 34px;
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.library-link,
.story-switch {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.78);
  padding: 0 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.story-switch {
  max-width: 170px;
  white-space: nowrap;
}

.story-context-mini {
  margin-top: auto;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.story-context-mini small,
.story-context-mini strong {
  display: block;
}

.story-context-mini small {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-context-mini strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1050px) {
  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    min-height: 290px;
  }
}

@media (max-width: 760px) {
  .library-main {
    padding-top: 42px;
  }

  .library-hero h1 {
    font-size: clamp(3rem, 15vw, 5.3rem);
  }

  .story-card {
    min-height: 310px;
  }

  .story-switch span {
    display: none;
  }

  .story-switch {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .story-context-mini {
    display: none;
  }
}
