/* ═══════════════════════════════════════════════════════════════════
   RESEARCH LIBRARY  (library.html and the library-*.html articles)
   Generated by scripts/build-library.js. Uses the site's tokens only. Article text sits on a white card so every colour
   meets contrast on any part of the page background.
   ═══════════════════════════════════════════════════════════════════ */
.lib-section { padding: 4px 0 72px; }
.lib-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 14px; }
.lib-filters[hidden] { display: none; }
.lib-chip { min-height: 44px; padding: 0 20px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--bg-card); color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.lib-chip:hover { border-color: var(--accent-bright); }
.lib-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.lib-chip:focus-visible, .lib-card:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.lib-count { margin: 0 0 24px; text-align: center; font-size: 14px; color: var(--text); }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lib-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; }
a.lib-card:hover { border-color: var(--accent-bright); }
.lib-card[hidden] { display: none; }
.lib-card-cat { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-bright); }
.lib-card-title { margin: 0; font-family: var(--display); font-size: 19.5px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.lib-card-sum { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.55; color: var(--text-dim); }
.lib-card-meta { font-size: 13px; color: var(--text-dim); }
.lib-cta { margin-top: 56px; }

/* article */
.lib-wrap { max-width: 800px; }
.lib-crumbs { padding: 36px 0 6px; font-size: 14px; color: var(--text); }
.lib-crumbs a { color: var(--accent-bright); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lib-head { padding: 6px 0 26px; }
.lib-head .lib-card-cat { font-size: 12.5px; }
.lib-head h1 { margin: 12px 0 14px; font-family: var(--display); font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.lib-meta { margin: 0 0 18px; font-size: 14.5px; color: var(--text); }
.lib-lead { margin: 0; font-size: 18.5px; line-height: 1.65; }
.lib-body { background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 36px 30px; font-size: 16.5px; line-height: 1.75; color: var(--text); }
.lib-body h2 { margin: 34px 0 10px; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.lib-body h2:first-child { margin-top: 24px; }
.lib-body p { margin: 0 0 16px; }
.lib-body ul, .lib-body ol { margin: 0 0 18px; padding-left: 22px; }
.lib-body li { margin-bottom: 8px; padding-left: 4px; }
.lib-body a { color: var(--accent-bright); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lib-note { margin: 22px 0 0 !important; padding: 14px 18px; border-radius: 10px; background: var(--bg-elevated); font-size: 15px; line-height: 1.6; }
.lib-table-wrap { margin: 8px 0 18px; overflow-x: auto; }
.lib-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; font-size: 15.5px; line-height: 1.55; }
.lib-table th, .lib-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.lib-table tr:last-child th, .lib-table tr:last-child td { border-bottom: 0; }
.lib-table thead th { background: var(--bg-elevated); font-weight: 700; }
.lib-table tbody th { width: 30%; font-weight: 700; background: var(--bg-elevated); }
.lib-mono { font-family: var(--mono); font-size: 14px; word-break: break-word; }
.lib-studies { list-style: none; margin: 0 0 18px; padding: 0 !important; display: grid; gap: 14px; }
.lib-studies li { padding: 16px 18px !important; margin: 0 !important; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elevated); }
.lib-design { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lib-studies p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.6; }
.lib-related { margin-top: 28px; padding: 22px 28px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; }
.lib-related h2 { margin: 0 0 10px; font-family: var(--display); font-size: 19px; font-weight: 800; }
.lib-related ul { margin: 0; padding-left: 20px; line-height: 1.8; font-size: 16px; }
.lib-related a { color: var(--accent-bright); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lib-notice { margin: 22px 0 56px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.lib-notice a { color: var(--accent-bright); text-decoration: underline; }
@media (max-width: 960px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .lib-grid { grid-template-columns: minmax(0, 1fr); } .lib-body { padding: 6px 20px 24px; font-size: 16px; } .lib-lead { font-size: 17px; } .lib-related { padding: 18px 20px; } }
@media (prefers-reduced-motion: no-preference) { .lib-chip, .lib-card { transition: border-color .15s ease, background-color .15s ease, color .15s ease; } }
