@font-face {
  font-family: "DM Serif Text";
  src: url("./fonts/dm-serif-text.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8f7ef;
  --surface: #fffef8;
  --ink: #1b3028;
  --forest: #183f32;
  --muted: #50625a;
  --rule: #ccd1bd;
  --tint: #e9ecdf;
  --lime: #d8eb98;
  --copper: #944c2a;
  --serif: "DM Serif Text", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --width: 78rem;
  --gutter: clamp(1rem, 4.5vw, 4.25rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-block-start: 1.5rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.6 var(--sans); }
body > main, .nav, footer { width: min(calc(100% - 2 * var(--gutter)), var(--width)); margin-inline: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #985128; outline-offset: 4px; }
::selection { color: var(--ink); background: var(--lime); }
a { color: inherit; text-underline-offset: .22em; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.skip, .sr-only:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: .6rem; left: .6rem; width: auto; height: auto; clip-path: none; background: var(--surface); padding: .65rem 1rem; }
header { border-bottom: 1px solid var(--rule); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5.15rem; }
.brand, .footbrand { text-decoration: none; font-weight: 700; letter-spacing: -.055em; }
.brand { display: inline-flex; align-items: center; gap: .35rem; font-size: 1.4rem; white-space: nowrap; }
.brand b { color: var(--muted); font-weight: 400; }
.mark { display: grid; place-items: center; width: 2.05rem; height: 2.05rem; margin-right: .27rem; color: var(--lime); background: var(--forest); font: 1.58rem/1 var(--serif); border-radius: 3px; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(.8rem, 3vw, 2.6rem); }
nav a { padding: .4rem .02rem; font-size: .91rem; font-weight: 650; text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 2px; }
.hero { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: center; gap: clamp(2rem, 6.5vw, 6.7rem); padding-block: clamp(2.75rem, 6.3vw, 5.8rem) clamp(3rem, 6.5vw, 6rem); }
.category { color: var(--copper); font-size: .72rem; line-height: 1.45; text-transform: uppercase; font-weight: 700; letter-spacing: .14em; }
.hero .category, .guide-head .category { display: flex; align-items: center; gap: .65rem; margin: 0 0 1.05rem; }
.hero .category::before, .guide-head .category::before { content: ""; width: 1.7rem; height: 2px; background: currentColor; }
h1, h2, h3, p, figure { margin: 0; }
.hero h1, .guide-head h1, .search-page h1, .section-head h2, .chapter h2, .sources h2 { font-family: var(--serif); font-weight: 400; }
.hero h1 { font-size: clamp(4.35rem, 7.15vw, 6.75rem); letter-spacing: -.065em; line-height: .94; }
.hero h1 span { color: var(--copper); }
.hero-text > p:not(.category), .guide-head > div > p:not(.category) { max-width: 41rem; margin-top: 1.2rem; font-size: clamp(1.03rem, 1.35vw, 1.2rem); color: var(--muted); line-height: 1.6; }
.hero .searchbar { margin-top: 1.7rem; max-width: 32rem; }
.searchbar { min-width: 0; }
.searchbar label { display: block; margin-bottom: .36rem; font-weight: 650; font-size: .85rem; }
.searchbar > div { display: flex; align-items: stretch; padding: .27rem; min-height: 3.12rem; background: var(--surface); border: 1px solid #939e8c; border-radius: .45rem; }
.searchbar > div:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.searchbar input { width: 100%; min-width: 0; padding: .36rem .65rem; border: 0; outline: none; background: transparent; appearance: none; }
.searchbar input::placeholder { color: #657369; }
.search-key { margin: auto .6rem auto 0; min-width: 1.25rem; padding: 0 .22rem; text-align: center; border: 1px solid var(--rule); border-radius: .2rem; color: var(--muted); font: .73rem/1.45 var(--sans); }
.searchbar:focus-within .search-key { visibility: hidden; }
@media (pointer: coarse), (max-width: 28rem) { .search-key { display: none; } }
.searchbar button, .pager button, .retry { padding: .5rem 1.05rem; flex: 0 0 auto; border: 1px solid var(--forest); color: var(--surface); background: var(--forest); font-weight: 650; border-radius: .28rem; }
.searchbar button:hover, .pager button:hover, .retry:hover { background: #295742; }
.hero figure { overflow: hidden; border: 1px solid #314b3d; background: var(--forest); color: var(--surface); border-radius: .28rem; }
.hero figure > a { display: block; }
.hero figure img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }
figcaption { display: flex; align-items: center; justify-content: space-between; gap: .65rem 1rem; padding: .85rem 1.1rem; }
figcaption a { color: var(--lime); font-weight: 650; text-decoration: none; }
figcaption a:hover { text-decoration: underline; }
figcaption span { font-size: .77rem; color: #e0e6d6; }
#library { border-top: 1px solid var(--rule); padding-block: clamp(1.8rem, 3vw, 3rem) 4rem; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem 1rem; }
.section-head h2 { font-size: clamp(2.3rem,4vw,3.6rem); letter-spacing: -.052em; line-height: 1.12; }
.section-head span { font-size: .82rem; color: var(--muted); }
.filters { margin-block: 1.35rem 1.9rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.filters button, .save-toggle, .page-num { border: 1px solid var(--rule); background: transparent; }
.filters button { padding: .43rem .88rem; border-radius: 2rem; font-size: .83rem; font-weight: 650; }
.filters button:hover, .save-toggle:hover, .page-num:hover { background: var(--tint); }
.filters button[aria-pressed="true"] { color: var(--surface); background: var(--forest); border-color: var(--forest); }
[data-family] { margin-top: 2.1rem; }
[data-family] h3 { padding-bottom: .57rem; border-bottom: 1px solid var(--rule); font-size: .88rem; font-weight: 700; letter-spacing: .02em; }
.entries { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); column-gap: clamp(.9rem, 2.1vw, 2rem); }
.entry-record, .entries > .entry { border-bottom: 1px solid var(--rule); }
.entry-record { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; }
.entry { min-width: 0; min-height: 5.8rem; display: flex; align-items: flex-start; gap: .85rem; padding: 1.05rem .1rem; text-decoration: none; }
.entry:hover strong, .entry:focus-visible strong { color: var(--copper); text-decoration: underline; text-underline-offset: .19em; }
.entry img { width: clamp(2.85rem, 4.4vw, 3.8rem); aspect-ratio: 1; object-fit: contain; flex: 0 0 auto; border: 1px solid var(--rule); border-radius: .25rem; background: var(--surface); }
.entry span { min-width: 0; }
.entry strong { display: block; font-weight: 700; line-height: 1.32; overflow-wrap: anywhere; }
.entry small { display: -webkit-box; margin-top: .33rem; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--muted); font-size: .83rem; line-height: 1.44; }
.save-toggle { min-height: 2.55rem; display: inline-flex; gap: .55rem; align-items: center; justify-content: center; padding: .4rem .8rem; border-radius: .28rem; font-size: .85rem; font-weight: 650; }
.entry-record .save-toggle { align-self: start; min-width: 2rem; min-height: 2.55rem; margin-top: .72rem; padding: .4rem; border-color: transparent; color: var(--muted); }
.save-toggle:before { content: ""; width: .8rem; height: 1.03rem; display: inline-block; background: currentColor; clip-path: polygon(0 0,100% 0,100% 100%,50% 72%,0 100%,0 0,14% 13%,14% 77%,50% 57%,86% 77%,86% 13%,14% 13%); }
.save-toggle[aria-pressed="true"]:before { clip-path: polygon(0 0,100% 0,100% 100%,50% 72%,0 100%); }
.save-toggle[aria-pressed="true"] { color: var(--forest); background: var(--tint); }
.crumb { padding-top: 1.8rem; display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.crumb a:hover, .sources a:hover, aside a:hover { color: var(--copper); }
.guide-head { display: flex; align-items: center; gap: clamp(1.2rem,3.5vw,3rem); padding-block: clamp(2rem,4.8vw,4.2rem); }
.guide-art { width: clamp(4rem,11vw,8.5rem); height: auto; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--rule); border-radius: .25rem; }
.guide-head h1, .search-page h1 { max-width: 17ch; font-size: clamp(2.5rem,5.6vw,5rem); line-height: 1.04; letter-spacing: -.055em; overflow-wrap: anywhere; }
.guide-head .save-toggle { margin-top: 1.1rem; }
.guide-head > div { min-width: 0; }
.guide-layout { display: grid; grid-template-columns: minmax(11rem, 16rem) minmax(0, 49rem); gap: clamp(2rem,6vw,6rem); border-top: 1px solid var(--rule); padding-block: 2rem 4rem; }
aside { position: sticky; top: 1.2rem; align-self: start; max-height: calc(100dvh - 2.4rem); overflow: auto; padding: .35rem 1.1rem .75rem .1rem; }
aside h2 { margin: 0 0 .75rem; color: var(--copper); font-size: .75rem; text-transform: uppercase; font-weight: 700; letter-spacing: .13em; }
aside a { display: block; padding: .3rem .6rem; margin-bottom: .12rem; border-left: 2px solid var(--rule); font-size: .87rem; line-height: 1.4; text-decoration: none; }
aside a[aria-current="location"] { color: var(--forest); background: var(--tint); border-left-color: var(--forest); font-weight: 700; }
.chapter { padding-block: 1.65rem; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.chapter:first-child { padding-top: 0; }
.chapter h2, .sources h2 { margin-bottom: .7rem; font-size: clamp(1.7rem,3vw,2.55rem); letter-spacing: -.045em; line-height: 1.22; }
.chapter p, .chapter li { max-width: 74ch; }
.chapter p + p { margin-top: .75rem; }
.chapter ul { margin: .8rem 0 .1rem; padding-left: 1.45rem; }
.chapter li { padding-left: .15rem; margin-block: .32rem; }
.chapter li::marker { color: var(--copper); }
.chapter code, .guide-head code { padding: .07em .28em; background: var(--tint); border-radius: .18rem; color: #374b39; font-size: .9em; }
.chapter details { margin-top: .9rem; background: #f0f1e7; border: 1px solid var(--rule); border-radius: .28rem; }
.chapter details summary { padding: .74rem .92rem; font-weight: 650; cursor: pointer; }
.chapter details[open] summary { border-bottom: 1px solid var(--rule); }
.chapter details ul { padding: 0 1rem .7rem 2.5rem; }
.search-target { outline: 2px solid #956137; outline-offset: 3px; background: #f3eacb; scroll-margin-block: 1.1rem; }
.sources { padding-top: 1.75rem; }
.sources > a { display: block; width: fit-content; padding-block: .18rem; }
.search-page { min-height: 68vh; padding-block: clamp(2.2rem, 5vw, 4.5rem); }
.search-page > h1 { margin-bottom: 1.4rem; }
.search-page .searchbar, #results, #status { max-width: 52rem; }
#status { margin-block: 1.25rem .6rem; color: var(--muted); }
.search-hit { display: block; padding-block: .95rem; border-top: 1px solid var(--rule); text-decoration: none; overflow-wrap: anywhere; }
.search-hit small { color: var(--copper); font-size: .77rem; font-weight: 700; letter-spacing: .02em; }
.search-hit strong { display: block; font-size: 1.06rem; line-height: 1.5; }
.search-hit span { display: block; color: var(--muted); font-size: .93rem; }
.search-hit:hover strong, .search-hit:focus-visible strong { color: var(--copper); text-decoration: underline; }
mark { background: #e5efb4; color: #1a3325; }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .88rem; }
.pager button:disabled { cursor: default; background: transparent; color: var(--muted); border-color: var(--rule); }
.empty-saved { padding: 1rem 0 2rem; color: var(--muted); }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.6rem; padding-block: 1.5rem 2rem; border-top: 1px solid var(--rule); font-size: .86rem; color: var(--muted); }
.footbrand { margin-right: auto; font-size: 1.1rem; color: var(--forest); }
@media(max-width: 65rem) { .entries { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media(max-width: 47rem) {
  .nav { min-height: 4rem; gap: .8rem; }
  .hero { grid-template-columns: minmax(0,1fr); gap: 1.65rem; padding-block: 2.3rem; }
  .hero h1 { font-size: clamp(3.9rem,13vw,5.3rem); }
  .hero-text { max-width: 36rem; }
  .hero figure { width: 100%; max-width: 42rem; }
  .hero .searchbar { max-width: none; }
  .guide-layout { grid-template-columns: minmax(0,1fr); gap: 1.5rem; padding-top: 1.1rem; }
  aside { position: static; max-height: none; padding: .6rem 0 .8rem; border-bottom: 1px solid var(--rule); }
  aside a { display: inline-block; margin: 0 .5rem .28rem 0; border: 0; padding: .23rem .48rem; text-decoration: underline; }
  .guide-head { align-items: start; }
}
@media(max-width: 35rem) {
  .brand { font-size: 1.1rem; }
  .mark { width: 1.68rem; height: 1.68rem; font-size: 1.26rem; margin-right: .1rem; }
  nav { gap: .58rem; }
  nav a { font-size: .78rem; }
  .entries { grid-template-columns: minmax(0,1fr); }
  .entry { min-height: 4.9rem; padding-block: .85rem; }
  .entry small { -webkit-line-clamp: 2; }
  .guide-head { flex-wrap: wrap; }
  .hero h1 { min-width: 0; }
  figcaption { padding: .65rem .78rem; flex-wrap: wrap; }
  .filters { gap: .35rem; }
  .filters button { padding: .4rem .66rem; }
}
@media(prefers-reduced-motion:no-preference) {
  button, a { transition: color .12s ease, background-color .12s ease, border-color .12s ease; }
}
@media print {
  body { background: white; color: black; font-size: 10pt; }
  body > main { width: auto; }
  header, footer, .filters, .searchbar, .save-toggle, aside, .pager { display: none !important; }
  .guide-layout { display: block; }
  .chapter { break-inside: auto; }
  .chapter h2 { break-after: avoid; }
  .entry { break-inside: avoid; }
}
