.library-hero {
  background: radial-gradient(ellipse at 82% 26%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 50%);
}

.library-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
}

.library-intro {
  display: grid;
  justify-items: start;
  gap: 22px;
}

.skill-library h1 {
  text-wrap: wrap;
  overflow-wrap: anywhere;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.site .library-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.site .library-text-link:hover {
  text-decoration-color: currentColor;
}

.library-access-note {
  color: var(--text-muted);
  font-size: 14px;
}

.library-preview {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}

.library-preview-header,
.library-preview-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 20px;
}

.library-preview-header {
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.library-preview-header svg {
  color: var(--accent);
}

.skill-library .library-files {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.library-files li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.library-files strong {
  line-height: 1.25;
}

.library-file-mark,
.library-collection-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font: 700 15px/1 var(--mono);
}

.library-format {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font: 600 11px/1.2 var(--mono);
  white-space: nowrap;
}

.library-preview-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.library-preview-footer span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.library-catalog {
  scroll-margin-top: 84px;
}

.library-section-head {
  display: grid;
  gap: 14px;
  margin-bottom: 32px;
}

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

.library-collection {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.library-collection-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.library-collection-mark {
  background: var(--accent);
  color: var(--accent-ink);
}

.library-collection p {
  color: var(--text-muted);
}

.library-collection li {
  position: relative;
  padding: 10px 0 10px 15px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}

.library-collection li::before {
  position: absolute;
  top: 17px;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.library-join-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 48px;
  padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse at 92% 0%, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 68%);
}

.library-join-card .lede {
  margin-top: 16px;
}

.library-join-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
}

@media (max-width: 860px) {
  .library-hero-grid,
  .library-join-card {
    grid-template-columns: 1fr;
  }

  .library-preview {
    max-width: 600px;
  }

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

@media (max-width: 560px) {
  .library-collections {
    grid-template-columns: 1fr;
  }

  .library-files li {
    gap: 8px;
    padding: 8px;
  }

  .library-files strong {
    font-size: 14px;
  }

  .library-file-mark {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}
