html:has(.resources-page) { overflow: auto; height: auto; scroll-behavior: smooth; scroll-padding-top: 110px; }
body.resources-page { height: auto; min-height: 100vh; overflow: visible; background: #050505; }
.resources-hud { background: rgba(5,5,5,.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(20px); }
.resources-hud .hud-brand { text-decoration: none; }
.resources-main { width: min(1180px, calc(100% - 80px)); margin: 0 auto; padding-top: 156px; }
.resources-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding-bottom: 54px; border-bottom: 1px solid var(--border-bright); }
.eyebrow { font: 400 10px/1.5 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--g4); }
.resources-intro h1 { font-size: clamp(44px, 6.5vw, 80px); font-weight: 400; letter-spacing: -.065em; line-height: 1.1; margin: 22px 0 24px; }
.resources-intro h1 > span { color: var(--g5); }
.intro-copy { font-size: 15px; line-height: 1.7; color: #999; }
.index-note { font: 10px/2 var(--mono); color: var(--g4); text-align: right; }
.index-total { display: block; font-size: 32px; color: #ddd; margin-bottom: 14px; letter-spacing: -.05em; }
.index-total > span { font-size: 10px; color: var(--g4); letter-spacing: .08em; }
.index-note a { color: #bbb; }
.directory { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 52px; padding-top: 36px; }
.directory-sidebar { position: sticky; top: 108px; align-self: start; }
.directory-sidebar h2 { margin: 0 0 22px; }
.categories { display: flex; flex-direction: column; gap: 3px; }
.category { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px; border: 1px solid transparent; border-left: 1px solid var(--border); background: transparent; color: #999; text-align: left; font: 11px/1.5 var(--mono); cursor: pointer; }
.category > span:last-child { color: var(--g5); font-size: 10px; }
.category:hover { color: #fff; background: #0d0d0d; }
.category.active { color: #fff; background: #111; border-color: var(--border); border-left-color: #fff; }
.category.active > span:last-child { color: #bbb; }
.sidebar-note { font: 10px/1.8 var(--mono); color: #666; margin-top: 32px; }
.directory-toolbar { display: flex; gap: 12px; }
.search-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-bright); padding: 0 16px; color: var(--g4); }
.search-box input { width: 100%; min-width: 0; height: 48px; border: 0; outline: none; background: none; color: #fff; font: 11px var(--mono); border-radius: 0; }
.search-box input::placeholder { color: #777; }
.search-box:focus-within { border-color: #fff; }
.sort-box { position: relative; display: flex; flex: none; }
.sort-box::after { content: ""; position: absolute; top: 50%; right: 16px; width: 6px; height: 6px; border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sort-box select { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 145px; height: 50px; padding: 0 36px 0 16px; border: 1px solid var(--border-bright); border-radius: 0; background: #080808; color: #aaa; font: 10px var(--mono); cursor: pointer; color-scheme: dark; }
.directory-caption { display: flex; justify-content: space-between; gap: 16px; padding: 26px 0 16px; color: #777; font: 9px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.directory-caption p { color: #aaa; }
.resource-list { list-style: none; border-top: 1px solid var(--border-bright); }
.resource { border-bottom: 1px solid var(--border); }
.resource-link { display: grid; grid-template-columns: 26px minmax(0,1fr) 58px 16px; gap: 18px; align-items: center; min-height: 93px; padding: 20px 8px 20px 0; text-decoration: none; transition: background .2s; }
.resource-link:hover { background: #101010; }
.resource-number { font: 9px var(--mono); color: #555; }
.resource-name { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.resource-title { font-size: 14px; line-height: 1.55; color: #dedede; overflow-wrap: anywhere; }
.resource-domain { font: 9px/1.5 var(--mono); color: #777; overflow-wrap: anywhere; }
.resource-note { font: 12px/1.65 var(--font); color: #999; max-width: 52ch; }
.resource-access { display: block; font: 10px/1.6 var(--font); color: #999; }
.reading-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 0 18px 44px; font: 10px/1.6 var(--font); }
.reading-links a { color: #aaa; text-underline-offset: 3px; }
.reading-links a:hover { color: #fff; }
.cover-shelf .reading-links { padding: 0; }
.resource-type { justify-self: start; font: 9px var(--mono); color: #999; text-transform: uppercase; letter-spacing: .04em; }
.resource-arrow { font: 17px var(--mono); color: #666; transition: transform .2s, color .2s; }
.resource-link:hover .resource-arrow { color: #fff; transform: translate(2px,-2px); }
.resource-link:hover .resource-title { color: #fff; }
.resources-page :focus-visible { outline: 1px solid #fff; outline-offset: 4px; }
.resources-page input:focus-visible { outline: none; }
.empty-state { border-top: 1px solid var(--border); padding: 60px 0; }
.empty-state h2 { font-size: 22px; font-weight: 400; margin-bottom: 14px; }
.empty-state p { font-size: 13px; color: #999; margin-bottom: 24px; }
.resources-footer { display: flex; justify-content: space-between; gap: 24px; padding: 36px 0; margin-top: 64px; border-top: 1px solid var(--border-bright); font: 10px/1.8 var(--mono); color: #777; }
.resources-footer a { color: #aaa; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 20px; top: -80px; z-index: 100; padding: 12px; background: white; color: black; font: 12px var(--mono); }
.skip-link:focus { top: 12px; }
.noscript-note { padding: 24px 0; color: #999; font-size: 13px; }
@media (max-width: 850px) {
  .resources-hud .hud-center { display: none; }
  .resources-main { width: calc(100% - 40px); padding-top: 128px; }
  .directory { grid-template-columns: 140px minmax(0,1fr); gap: 24px; }
  .resource-link { grid-template-columns: 22px minmax(0,1fr) 44px 14px; gap: 12px; }
}
@media (max-width: 600px) {
  .resources-main { width: calc(100% - 32px); padding-top: 112px; }
  .resources-intro { align-items: start; flex-direction: column; gap: 26px; padding-bottom: 30px; }
  .resources-intro h1 { font-size: 56px; margin: 16px 0 18px; }
  .intro-copy { font-size: 13px; }
  .index-note { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; text-align: left; font-size: 9px; }
  .index-total { font-size: 20px; margin: 0; }
  .index-total > span { font-size: 8px; }
  .directory { grid-template-columns: 1fr; gap: 24px; padding-top: 26px; }
  .directory-sidebar { position: static; }
  .directory-sidebar h2 { margin-bottom: 14px; }
  .categories { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .category { width: auto; padding: 8px 10px; gap: 12px; font-size: 10px; border: 1px solid var(--border); }
  .sidebar-note { display: none; }
  .directory-toolbar { gap: 8px; }
  .search-box { padding: 0 10px; gap: 8px; }
  .sort-box::after { right: 12px; }
  .sort-box select { width: 112px; font-size: 9px; padding: 0 30px 0 10px; }
  .resource-link { min-height: 88px; gap: 10px; padding: 18px 4px 18px 0; }
  .resource-title { font-size: 13px; }
  .resource-type { font-size: 8px; }
  .resources-footer { flex-direction: column; margin-top: 40px; padding: 28px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.resources-page) { scroll-behavior: auto; }
  .resource-link, .resource-arrow { transition: none; }
}

.resource-detail { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* Books and films become shelves; the rest of the index stays a reading list. */
.resource-cover { display: none; }
.cover-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); column-gap: 28px; row-gap: 36px; padding-top: 24px; }
.cover-shelf .resource { border: 0; min-width: 0; }
.cover-shelf .resource[hidden] { display: none; }
.cover-shelf .resource-link { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0 0 16px; min-height: 0; }
.cover-shelf .resource-link:hover { background: none; }
.cover-shelf .resource-cover { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; aspect-ratio: 2 / 3; flex: none; margin-bottom: 14px; }
.cover-shelf .resource-cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: brightness(.94); transition: filter .2s ease; }
.cover-shelf .resource-cover img[hidden] { display: none; }
.cover-shelf .resource-link:hover img { filter: brightness(1); }
.cover-shelf .resource-name { gap: 6px; }
.cover-shelf .resource-title { font-size: 12px; line-height: 1.5; }
.cover-shelf .resource-domain { font-size: 9px; line-height: 1.6; }
.cover-shelf .resource-number { order: -1; margin-bottom: 10px; font-size: 8px; }
.cover-shelf .resource-type, .cover-shelf .resource-arrow { display: none; }
.cover-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 18px; border: 1px solid #333; border-left: 3px solid #555; background: #101010; color: #aaa; font: 13px/1.5 var(--font); overflow: hidden; }
.cover-placeholder > span:last-child { font: 8px/1.6 var(--mono); color: #666; }
.has-artwork .cover-placeholder { display: none; }
.watch-shelf { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.watch-shelf .resource-cover { aspect-ratio: 16 / 9; }
.watch-shelf .resource-cover img { object-fit: cover; object-position: center; }
.watch-shelf .resource-title { font-size: 14px; }
.watch-shelf .resource-domain { font-size: 10px; }
@media (max-width: 850px) {
  .cover-shelf { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 30px 20px; }
  .watch-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cover-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .watch-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-shelf .resource-title { font-size: 12px; }
  .watch-shelf .resource-domain { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-shelf .resource-cover, .cover-shelf .resource-cover img { transition: none; }
  .cover-shelf .resource-link:hover .resource-cover { transform: none; }
}
