* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 2.5rem; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.55 var(--body); }
main { min-height: 50vh; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--heading); line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.035em; }
h3 { font-size: 1.38rem; letter-spacing: -.035em; }
a { color: var(--link); text-underline-offset: .19em; }
a:hover { color: var(--link-hover); }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { color: var(--selection-text); background: var(--selection); }

.wrap { width: min(calc(100% - 64px), 1200px); margin-inline: auto; }
.skip-link { position: absolute; left: 1rem; top: .7rem; z-index: 6; padding: .7rem 1rem; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.masthead { border-bottom: 1px solid var(--edge); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 1.5rem; min-height: 74px; }
.wordmark { color: var(--ink); text-decoration: none; display: inline-flex; gap: .7rem; align-items: center; width: fit-content; font-weight: 730; letter-spacing: -.035em; line-height: 1.08; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; }
.main-nav { display: flex; align-items: center; gap: clamp(.8rem, 2.6vw, 2.35rem); }
.main-nav a, .header-about { color: var(--quiet); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current], .header-about:hover { color: var(--link); }
.header-about { justify-self: end; display: inline-flex; gap: .45rem; align-items: center; }
.arrow { font-family: var(--body); font-weight: 500; line-height: 1; }

.eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .13em; font-weight: 750; text-transform: uppercase; display: flex; align-items: center; gap: .6rem; }
.hero { padding: clamp(2.7rem, 5vw, 4.65rem) 0 2.55rem; }
.hero-grid { display: grid; align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.hero-copy { min-width: 0; }
.hero-copy h1 { margin-top: .8rem; font-size: clamp(2.6rem, 5.25vw, 4.85rem); letter-spacing: -.065em; line-height: 1.04; font-weight: 710; }
.hero-copy h1 span { display: block; color: var(--hero-accent); }
.hero-deck { color: var(--quiet); margin: 1.2rem 0 1.65rem; font-size: clamp(1rem, 1.5vw, 1.19rem); max-width: 46ch; }
.hero-media { overflow: hidden; min-width: 0; }
.hero-media img { height: 100%; width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.search-form { display: flex; align-items: center; gap: .65rem; background: var(--surface); border: 1px solid var(--strong-edge); max-width: 43rem; padding: .38rem; border-radius: var(--search-radius); }
.search-form:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus-wash); }
.search-icon { display: inline-block; margin-left: .7rem; width: 14px; height: 14px; border: 1.8px solid var(--quiet); border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ''; position: absolute; left: 9px; top: 10px; width: 6px; height: 1.6px; border-radius: 2px; background: var(--quiet); transform: rotate(45deg); transform-origin: left; }
.search-form input { width: 100%; min-width: 0; padding: .48rem .15rem; border: 0; outline: none; color: var(--ink); background: transparent; }
.search-form input::placeholder { color: var(--quiet); opacity: 1; }
.search-form input:focus-visible { outline: none; }
.search-examples { display: flex; font-size: .78rem; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; margin-top: .8rem; color: var(--quiet); }
.search-examples a { color: var(--quiet); text-decoration: none; border: 1px solid var(--edge); padding: .18rem .54rem; border-radius: 4px; }
.search-examples a:hover { color: var(--link); border-color: var(--strong-edge); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; border: 1px solid transparent; border-radius: var(--button-radius); padding: .55rem .9rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button.primary { color: var(--primary-text); background: var(--primary); }
.button.primary:hover { color: var(--primary-text); background: var(--primary-hover); }
.button.secondary { color: var(--link); background: var(--surface); border-color: var(--edge); }
.button.secondary:hover { background: var(--surface-hover); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1.3rem; margin-bottom: 1.1rem; }
.text-link { display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; font-size: .88rem; font-weight: 680; }
.text-link:hover { text-decoration: underline; }
.entry-grid, .entry-rows, .shortcut-list { list-style: none; margin: 0; padding: 0; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.entry { min-width: 0; }
.entry-link { display: grid; grid-template-rows: auto auto 1fr; text-decoration: none; min-height: 100%; color: var(--ink); border: 1px solid var(--edge); border-radius: var(--card-radius); padding: 1.1rem 1.2rem 1.28rem; background: var(--surface); transition: border-color .15s, background .15s; }
.entry-link:hover { color: var(--ink); background: var(--surface-hover); border-color: var(--strong-edge); }
.entry-meta { color: var(--accent); display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1.08rem; }
.entry-meta .arrow { opacity: .88; }
.type-tag { display: inline-flex; width: fit-content; align-items: center; gap: .34rem; color: var(--tag-text); background: var(--tag-bg); border: 1px solid var(--tag-border); border-radius: var(--pill-radius); padding: .16rem .55rem; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.entry h3 { margin-bottom: .45rem; }
.entry p { font-size: .92rem; color: var(--quiet); }
.shortcut-list li { border-bottom: 1px solid var(--edge); }
.shortcut-list a { text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: .8rem; color: var(--ink); padding: .9rem 0; font-weight: 630; line-height: 1.35; }
.shortcut-list a:hover { color: var(--link); }
.shortcut-list .arrow { color: var(--accent); }

.page-head { max-width: 54rem; margin: 0 0 2rem; }
.page-head h1, .article-head h1 { font-size: clamp(2.3rem, 5.2vw, 4.4rem); max-width: 23ch; letter-spacing: -.053em; margin: .55rem 0 .75rem; }
.page-head > p:not(.eyebrow), .article-deck { font-size: clamp(1.04rem, 1.8vw, 1.24rem); color: var(--quiet); max-width: 64ch; }
.listing, .about-page, .missing .page-head { padding-block: 3.55rem 5.4rem; }
.missing .button { margin-top: 1.3rem; }
.directory-controls { margin-bottom: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .48rem; margin-top: 1rem; }
.filter { color: var(--quiet); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--pill-radius); padding: .38rem .75rem; font-size: .84rem; }
.filter:hover { border-color: var(--strong-edge); color: var(--link); }
.filter[aria-pressed="true"] { background: var(--filter-active); border-color: var(--strong-edge); color: var(--link); font-weight: 670; }
.results-count { color: var(--quiet); font-size: .84rem; margin: .9rem 0 .35rem; }
.results-count:empty { display: none; }
.empty-results { padding: 1rem; margin: 1rem 0; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--card-radius); }

.breadcrumbs { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1.8rem; font-size: .85rem; color: var(--quiet); align-items: baseline; }
.breadcrumbs a { color: var(--quiet); }
.breadcrumbs a:hover { color: var(--link); }
.article-head { padding-block: 2rem 1.65rem; border-bottom: 1px solid var(--edge); }
.article-head h1 { margin: .75rem 0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.3rem; margin-top: 1rem; color: var(--quiet); font-size: .84rem; }
.article-layout { display: grid; align-items: start; gap: clamp(1.8rem, 5vw, 4.9rem); padding-block: 2.2rem 5rem; }
.article-prose { width: 100%; max-width: 51rem; min-width: 0; }
.article-sidebar { min-width: 0; }
.quick-facts, .article-nav { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--card-radius); padding: 1rem 1.1rem; }
.quick-facts h2, .article-nav h2 { font-size: 1.08rem; margin-bottom: .75rem; letter-spacing: -.02em; }
.quick-facts dt { color: var(--quiet); font-size: .77rem; padding-top: .5rem; }
.quick-facts dd { font-size: .91rem; margin-bottom: .48rem; }
.article-nav { display: grid; gap: .45rem; margin-top: .7rem; }
.article-nav h2 { margin-bottom: .25rem; }
.article-nav a { font-size: .84rem; text-decoration: none; color: var(--quiet); }
.article-nav a:hover { color: var(--link); }
.article-nav:first-child { margin-top: 0; }
.article-section { margin-bottom: 1.9rem; }
.article-section h2, .article-related h2 { font-size: clamp(1.38rem, 2.6vw, 1.85rem); margin-bottom: .55rem; }
.article-section p, .article-prose p { color: var(--prose); max-width: 76ch; }
.article-prose sup, .quick-facts sup, table sup { margin-left: .17em; font-size: .68em; }
.article-prose sup a, .quick-facts sup a, table sup a { text-decoration: none; font-weight: 730; }
.table-shell { overflow-x: auto; border: 1px solid var(--edge); border-radius: var(--card-radius); }
.table-shell table { width: 100%; min-width: 31rem; border-collapse: collapse; text-align: left; font-size: .88rem; }
.table-shell :is(td, th) { padding: .75rem .85rem; border-bottom: 1px solid var(--edge); vertical-align: top; }
.table-shell thead th { background: var(--surface); color: var(--ink); }
.table-shell tbody th { font-weight: 670; }
.table-shell td { color: var(--prose); }
.table-shell tbody tr:last-child :is(td, th) { border-bottom: 0; }
.sources ol { margin: .65rem 0 0; padding-left: 1.4rem; }
.sources li { padding: .5rem .2rem; }
.sources li a { font-size: .97rem; font-weight: 660; }
.sources li .arrow { margin-left: .4rem; }
.sources li p { font-size: .87rem; color: var(--quiet); margin-top: .16rem; }
.sources li:target { background: var(--filter-active); outline: 1px solid var(--edge); }
.download-box { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 1rem; align-items: center; margin: 0 0 1.9rem; padding: .95rem 1.15rem; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--card-radius); }
.download-box p { font-size: .87rem; }
.cite-box { margin-bottom: 1.8rem; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--card-radius); padding: .75rem 1rem; font-size: .88rem; }
.cite-box summary { cursor: pointer; font-weight: 680; }
.cite-box p { margin: .6rem 0; user-select: text; overflow-wrap: anywhere; }
.cite-box [data-copy-status] { margin-left: .6rem; color: var(--quiet); }
.article-related { margin-top: 1.9rem; }
.about .article-section p + p { margin-top: .8rem; }

.footer { border-top: 1px solid var(--edge); background: var(--footer); padding-block: 2.6rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.2rem; }
.footer a:not(.wordmark) { color: var(--quiet); font-size: .88rem; text-decoration: none; }
.footer a:hover { color: var(--link); text-decoration: underline; }
.footer nav, .footer-end { display: grid; gap: .4rem; align-content: start; }
.footer p { margin-top: .4rem; color: var(--quiet); font-size: .86rem; }

@media (max-width: 900px) {
  .wrap { width: min(calc(100% - 44px), 1200px); }
  .header-inner { grid-template-columns: 1fr auto; }
  .header-about { display: none; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  html { scroll-padding-top: 1.4rem; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { grid-template-columns: 1fr; row-gap: .65rem; min-height: 0; padding-block: .75rem; }
  .brand-mark { width: 31px; height: 31px; }
  .main-nav { gap: .75rem 1.15rem; flex-wrap: wrap; }
  .main-nav a { font-size: .81rem; }
  .hero { padding: 2.2rem 0 1.7rem; }
  .hero .hero-grid { grid-template-columns: 1fr; gap: 1.55rem; }
  .hero-copy h1 { font-size: clamp(2.4rem, 9.2vw, 3.2rem); }
  .hero-deck { margin: .8rem 0 1.1rem; }
  .hero-media img { aspect-ratio: 2 / 1; max-height: 15rem; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-link { padding: .95rem 1rem 1.1rem; }
  .entry-meta { margin-bottom: .75rem; }
  .section-head { align-items: start; flex-wrap: wrap; }
  .listing, .about-page, .missing .page-head { padding-block: 2.25rem 3.6rem; }
  .article-layout { display: flex; flex-direction: column; padding-block: 1.55rem 3.4rem; }
  .article-prose, .article-sidebar { width: 100%; }
  .article-nav:not(:first-child) { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.15rem; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .search-icon { display: none; }
  .search-form input { padding-left: .34rem; font-size: .9rem; }
  .search-form .button .arrow { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
