/* The library follows the homepage's paper, ink, orange/blue and round-button system. */
.skip-link { position: absolute; top: -80px; right: 16px; z-index: 30; padding: 10px 18px; background: var(--ink); color: var(--paper); border-radius: 12px; }
.skip-link:focus { top: 12px; }
.current { color: var(--orange) !important; }
.library-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; padding-top: 52px; padding-bottom: 64px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; }
.eyebrow .dots { display: inline-flex; gap: 5px; }
h1 { font-size: clamp(48px, 6.1vw, 82px); line-height: 1.14; margin: 0 0 22px; }
.mark { color: var(--orange); }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 44ch; margin: 0 0 26px; }
.library-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-soft); font-size: 13px; }
.library-facts li { display: inline-flex; gap: 6px; align-items: center; }
.library-facts strong { font-size: 17px; color: var(--ink); }
.hero-preview { border: 1px solid var(--line); border-radius: 32px; background: #f7f6f2; padding: 26px; min-width: 0; overflow: hidden; }
.hero-label { display: inline-block; color: var(--ink-soft); font-size: 13px; padding-bottom: 22px; }
.hero-posters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: center; gap: 8px; min-height: 190px; }
.hero-posters img { width: 100%; height: 190px; object-fit: cover; border-radius: 15px; background: var(--line); box-shadow: 0 15px 28px -18px #1a1a1a66; }
.hero-posters img:first-child { transform: rotate(6deg) translateY(8px); }
.hero-posters img:nth-child(2) { height: 215px; position: relative; z-index: 1; }
.hero-posters img:last-child { transform: rotate(-6deg) translateY(8px); }
.hero-prompt { display: grid; width: 100%; gap: 7px; margin-top: 30px; text-align: right; border: 0; border-radius: 20px; padding: 18px 20px; background: var(--paper); color: var(--ink); cursor: pointer; }
.hero-prompt-kicker { color: var(--ink-soft); font-size: 12px; }
.hero-prompt strong { font-weight: 500; font-size: 15px; }
.hero-prompt-link { color: var(--orange); font-size: 13px; }
.library-section { background: var(--chrome); padding: 48px 0 60px; scroll-margin-top: 82px; }
.library-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; }
.section-kicker { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; margin: 0 0 10px; }
.section-kicker::before { content: ''; width: 26px; height: 2px; background: var(--orange); }
h2 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.25; margin: 0; }
.scope-picker { display: flex; padding: 4px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; }
.scope-picker button { min-height: 42px; padding: 7px 16px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.scope-picker button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.search-field { position: relative; }
.search-field svg { width: 21px; height: 21px; position: absolute; top: 18px; right: 18px; color: var(--ink-soft); pointer-events: none; }
.search-field input { width: 100%; min-width: 0; height: 58px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 12px 50px 12px 18px; color: var(--ink); font-size: 16px; }
.tech-field { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.tech-field select, .variant-field select { border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; background: var(--paper); color: var(--ink); max-width: 100%; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 18px 0 8px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.category-filters button { background: transparent; border: 1px solid #d8d5cf; border-radius: 999px; padding: 8px 15px; min-height: 42px; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.category-filters button[aria-pressed=true] { background: var(--paper); color: var(--orange); border-color: var(--orange); }
.complete-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.complete-filter input { width: 17px; height: 17px; accent-color: var(--orange); }
.results-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; color: var(--ink-soft); font-size: 13px; }
.results-row p { margin: 0; }
.results-row button { border: 0; background: transparent; color: var(--blue); text-decoration: underline; min-height: 44px; cursor: pointer; padding: 0 4px; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.prompt-card { border: 1px solid var(--line); border-radius: 22px; background: var(--paper); overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.poster-link { display: block; position: relative; aspect-ratio: 16 / 11; background: #e8e5df; overflow: hidden; }
.poster-link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.poster-link:hover img { transform: scale(1.035); }
.poster-fallback { display: grid; place-items: center; position: absolute; inset: 0; background: var(--chrome); color: var(--ink-soft); font-family: var(--display); font-size: 28px; padding: 20px; text-align: center; }
.example-count { position: absolute; bottom: 12px; right: 12px; border-radius: 999px; padding: 4px 11px; background: #fffffff0; font-size: 12px; color: var(--ink); }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-topline { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 11px; margin-bottom: 10px; color: var(--ink-soft); }
.quality { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-soft); }
.quality::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: none; }
.quality.partial::before { background: var(--orange); }
.card-title { font-family: var(--display); font-size: 25px; line-height: 1.35; margin: 0 0 8px; font-weight: 400; }
.card-title a { text-decoration: none; overflow-wrap: anywhere; }
.card-title a:hover { color: var(--orange); }
.card-description { margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-author { font-size: 12px; color: var(--ink-soft); max-width: 100%; overflow-wrap: anywhere; }
.card-open { font-size: 13px; color: var(--blue); text-decoration: none; padding: 4px 0; }
.load-more-row { display: flex; justify-content: center; margin-top: 32px; }
.empty-state, .load-error { text-align: center; padding: 50px 16px; border: 1px dashed #d8d5cf; border-radius: 22px; }
.empty-state h3 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0; }
.empty-state p, .load-error p { color: var(--ink-soft); margin: 8px 0 20px; }
.library-how { padding-top: 64px; padding-bottom: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.library-how > div p:last-child { max-width: 43ch; color: var(--ink-soft); }
.library-how ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.library-how li { display: flex; gap: 16px; align-items: flex-start; }
.library-how li > span { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--orange); color: var(--paper); font-family: var(--display); font-size: 26px; }
.library-how li:nth-child(2) > span { background: var(--blue); }
.library-how h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.library-how li p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.source-note { padding-bottom: 36px; font-size: 12px; color: var(--ink-soft); }
.source-note p { max-width: 95ch; }
.source-note a { color: var(--blue); text-underline-offset: 4px; }
.prompt-dialog { width: min(1080px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); overscroll-behavior: contain; }
.prompt-dialog::backdrop { background: #141414bd; backdrop-filter: blur(5px); }
.detail-top { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.detail-kicker { font-size: 13px; color: var(--ink-soft); }
.close-detail { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--chrome); cursor: pointer; }
.close-detail svg { width: 20px; height: 20px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.2fr); }
.detail-preview { padding: 24px; background: #f7f6f2; min-width: 0; }
.detail-image { aspect-ratio: 16 / 10; background: var(--line); border-radius: 16px; position: relative; overflow: hidden; }
.detail-image img { width: 100%; height: 100%; display: block; object-fit: contain; }
.detail-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); margin-top: 20px; }
.detail-preview h2 { font-size: 34px; margin-top: 10px; overflow-wrap: anywhere; }
.detail-author { font-size: 13px; color: var(--ink-soft); margin: 12px 0 20px; }
.detail-author a { color: var(--blue); text-decoration: none; overflow-wrap: anywhere; }
.detail-links { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-note { font-size: 11px; color: var(--ink-soft); margin: 12px 0 16px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.tech-tags span { padding: 3px 9px; border: 1px solid #d8d5cf; border-radius: 999px; font-size: 11px; }
.partial-note { padding: 12px; border-right: 3px solid var(--orange); font-size: 13px; background: var(--paper); }
.share-detail { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; font-size: 13px; min-height: 44px; margin-top: 12px; padding: 0; }
.variant-field { display: grid; gap: 7px; margin-top: 14px; font-size: 12px; }
.variant-field select { width: 100%; direction: ltr; font-size: 13px; }
.detail-content { padding: 24px; min-width: 0; }
.detail-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.detail-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 2px 12px; min-height: 44px; color: var(--ink-soft); cursor: pointer; font-size: 13px; }
.detail-tabs button[aria-selected=true] { color: var(--orange); border-bottom-color: var(--orange); }
.summary-text { margin: 0 0 28px; font-size: 16px; line-height: 2; }
.detail-content h3 { font-family: var(--display); font-weight: 400; font-size: 25px; margin: 0 0 12px; }
.guide-list { padding-right: 20px; font-size: 14px; color: var(--ink-soft); display: grid; gap: 12px; margin: 0 0 24px; }
.summary-note, .panel-intro { font-size: 12px; color: var(--ink-soft); margin: 0 0 20px; line-height: 1.9; }
.prompt-text { width: 100%; min-height: 310px; max-height: 55dvh; resize: vertical; padding: 16px; border: 1px solid var(--line); background: #faf9f6; border-radius: 14px; font-family: var(--body); font-size: 14px; line-height: 1.9; color: var(--ink); }
.prompt-text[dir=auto] { text-align: start; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 16px; }
.panel-actions a { color: var(--blue); font-size: 12px; }
.custom-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#custom-form label { display: grid; gap: 6px; font-size: 12px; margin-bottom: 14px; }
#custom-form input, #custom-form textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: var(--paper); font-size: 16px; }
#custom-form textarea { resize: vertical; }
.output-label { display: block; margin: 24px 0 8px; font-size: 12px; color: var(--ink-soft); }
#custom-prompt { min-height: 180px; }
#copy-custom { margin: 16px 0; }
.copy-status { min-height: 24px; color: var(--blue); font-size: 13px; margin: 20px 0 0; }
[hidden] { display: none !important; }
@media (max-width: 1000px) { .prompt-grid { gap: 16px; } .card-body { padding: 16px; } .nav a[href='/#work'] { display: none; } }
@media (max-width: 800px) {
  .library-hero { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; padding-bottom: 36px; }
  .lede { max-width: 55ch; }
  .hero-preview { max-width: 540px; width: 100%; justify-self: center; }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { grid-template-columns: minmax(0, 1fr); }
  .tech-field { justify-content: space-between; }
  .tech-field select { min-width: 160px; }
  .library-how { grid-template-columns: 1fr; gap: 28px; }
  .prompt-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 20px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-image { aspect-ratio: 16 / 8; }
}
@media (max-width: 560px) {
  .library-hero { padding-top: 24px; }
  h1 { font-size: 56px; }
  .lede { font-size: 16px; }
  .library-facts { font-size: 12px; gap: 6px 16px; }
  .hero-preview { border-radius: 24px; padding: 20px; }
  .hero-posters { min-height: 130px; }
  .hero-posters img { height: 130px; }
  .hero-posters img:nth-child(2) { height: 155px; }
  .hero-prompt { padding: 16px; }
  .library-section { padding-top: 32px; }
  .library-heading { gap: 18px; }
  .scope-picker { width: 100%; }
  .scope-picker button { flex: 1; }
  .category-filters { gap: 6px; }
  .category-filters button { padding: 7px 12px; }
  .prompt-grid { grid-template-columns: 1fr; gap: 20px; }
  .poster-link { aspect-ratio: 16 / 10; }
  .card-body { padding: 18px; }
  .library-how { padding-top: 40px; padding-bottom: 28px; }
  .detail-top { padding: 10px 16px; }
  .detail-preview, .detail-content { padding: 18px; }
  .detail-tabs { gap: 10px; }
  .detail-tabs button { font-size: 12px; }
  .detail-preview h2 { font-size: 30px; }
  .custom-fields { grid-template-columns: 1fr; gap: 0; }
  .detail-links .btn { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .poster-link img { transition: none; } }
