:root {
  --paper: #f5efe3;
  --paper-2: #fbf8f1;
  --ink: #2b2219;
  --ink-2: #4a3d30;
  --muted: #85735f;
  --rule: #ddd0b9;
  --rubric: #8e2b1d;
  --rubric-2: #b5492f;
  --gold: #a97c2f;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 30px -18px rgba(60,40,20,.35);
  --radius: 10px;
  --serif: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --caps: "Cormorant SC", "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 19px/1.55 var(--serif);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fffaf0 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #efe4cf 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 3rem; }
a { color: var(--rubric); text-decoration-color: rgba(142,43,29,.35); text-underline-offset: 2px; }
a:hover { color: var(--rubric-2); text-decoration-color: currentColor; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3 { font-family: var(--caps); font-weight: 600; letter-spacing: .01em; color: var(--ink); }
h1 { font-size: 2.6rem; line-height: 1.05; margin: .2rem 0 .4rem; }
h2 { font-size: 1.45rem; margin: 0 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .3rem; color: var(--ink-2); }
.sc { font-family: var(--caps); font-weight: 600; letter-spacing: .03em; }

/* masthead */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245,239,227,.88);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.mast-inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-title { display: block; font-family: var(--caps); font-size: 1.35rem; font-weight: 700; line-height: 1; }
.brand-sub { display: block; font-size: .78rem; color: var(--muted); font-style: italic; letter-spacing: .02em; }
.nav { display: flex; gap: 1.1rem; margin-left: .5rem; }
.nav a { font-family: var(--caps); font-size: 1.08rem; text-decoration: none; color: var(--ink-2); padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav a[aria-current] { color: var(--rubric); border-color: var(--rubric); }
.search { margin-left: auto; position: relative; width: min(280px, 40vw); }
.search input {
  width: 100%; font: inherit; font-size: .95rem; padding: .4rem .75rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper-2); color: var(--ink);
}
.search input:focus { outline: 2px solid rgba(142,43,29,.25); border-color: var(--rubric); }
#q-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-height: 60vh; overflow: auto;
  list-style: none; margin: 0; padding: .3rem; background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: 0 18px 40px -20px rgba(40,25,10,.45);
}
#q-results li a { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
#q-results li a:hover, #q-results li a.on { background: #efe5d2; }
#q-results .g { color: var(--muted); font-size: .85rem; font-variant-numeric: oldstyle-nums; }

/* hero & panels */
.hero { padding: 3.2rem 0 1.6rem; text-align: center; }
.eyebrow { font-family: var(--caps); color: var(--rubric); letter-spacing: .12em; font-size: .95rem; margin: 0; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 4.4rem); margin: .3rem 0 .6rem; }
.hero h1::after {
  content: ""; display: block; width: 120px; height: 9px; margin: .7rem auto 0;
  background:
    radial-gradient(circle, var(--rubric) 2.5px, transparent 3px) center/9px 9px no-repeat,
    linear-gradient(var(--rule), var(--rule)) left center/45% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) right center/45% 1px no-repeat;
}
.lede { max-width: 46rem; margin: 0 auto; font-size: 1.12rem; color: var(--ink-2); }
.stats { display: flex; justify-content: center; gap: 2.4rem; margin: 2rem 0 0; flex-wrap: wrap; }
.stats div { text-align: center; }
.stats dt { font-family: var(--caps); color: var(--muted); font-size: .9rem; letter-spacing: .06em; }
.stats dd { margin: 0; font-size: 1.9rem; font-variant-numeric: oldstyle-nums; }

.panel {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; box-shadow: var(--shadow); margin-top: 1.4rem;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hint, .caveat { color: var(--muted); font-size: .9rem; font-style: italic; }
.caveat { margin: 1rem 0 0; border-top: 1px dotted var(--rule); padding-top: .6rem; }
.btn, .chip {
  font: inherit; font-size: .88rem; cursor: pointer; border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink-2); border-radius: 999px; padding: .2rem .8rem; text-decoration: none; display: inline-block;
}
.btn:hover, .chip:hover { border-color: var(--rubric); color: var(--rubric); }
.tools { display: flex; gap: .4rem; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip b { font-weight: 500; color: var(--muted); margin-left: .15rem; font-variant-numeric: oldstyle-nums; }
.chip[aria-pressed="true"] { background: var(--rubric); border-color: var(--rubric); color: #fff8ee; }
.chip[aria-pressed="true"] b { color: #f3d9c8; }

/* tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 1.05rem; padding-left: 1.1rem; border-left: 1px solid var(--rule); }
.tree .t-node { position: relative; }
.tree ul > .t-node::before {
  content: ""; position: absolute; left: -1.1rem; top: 1.05rem; width: .9rem; border-top: 1px solid var(--rule);
}
.t-row { display: flex; align-items: baseline; gap: .5rem; padding: .22rem .4rem; border-radius: 6px; cursor: default; flex-wrap: wrap; }
summary.t-row { cursor: pointer; list-style: none; }
summary.t-row::-webkit-details-marker { display: none; }
summary.t-row::before {
  content: "▸"; color: var(--rubric); font-size: .8rem; width: .7rem; transition: transform .15s; display: inline-block;
}
details[open] > summary.t-row::before { transform: rotate(90deg); }
.t-node > .t-row::before { content: ""; width: .7rem; display: inline-block; }
.t-row:hover { background: #f1e8d6; }
.t-gen { font-family: var(--caps); color: var(--rubric); font-size: .85rem; min-width: 2.1rem; text-align: right; }
.t-name { font-weight: 600; text-decoration: none; color: var(--ink); }
.t-name:hover { color: var(--rubric); text-decoration: underline; }
.t-ep { font-style: italic; color: var(--ink-2); }
.t-ls { color: var(--muted); font-variant-numeric: oldstyle-nums; font-size: .95rem; }
.t-src {
  font-size: .72rem; color: var(--gold); border: 1px solid #e3cf9f; border-radius: 999px; padding: 0 .45rem; line-height: 1.5;
  font-variant-numeric: lining-nums;
}
.t-pending .t-name { color: var(--muted); font-weight: 400; font-style: italic; }
.t-pending .t-name:hover { color: var(--muted); text-decoration: none; }
.t-ext {
  display: inline-flex; align-items: center; gap: .2rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .68rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.6;
  color: #2f6b4f; background: #e7f0e9; border: 1px dashed #8db59c; border-radius: 4px; padding: 0 .4rem;
  text-decoration: none; font-style: normal;
}
.t-ext:hover { color: #fff; background: #2f6b4f; border-style: solid; border-color: #2f6b4f; }
.t-ext-arrow { font-size: .85rem; line-height: 1; }
.hint .t-ext-demo { font-style: normal; vertical-align: 1px; }
.offsite { color: var(--muted); font-style: italic; }
li > .t-ext { vertical-align: 1px; margin-left: .15rem; }

/* person */
.crumbs { margin-top: 1.6rem; font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--rubric); }
.crumbs .sep { color: var(--rule); margin: 0 .25rem; }
.person-head { padding: 1rem 0 .2rem; }
.person-head .ep { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.4rem; color: var(--ink-2); }
.person-head .life { margin: 0; font-size: 1.3rem; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.person-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.4rem; align-items: start; }
.person-side { position: sticky; top: 80px; }
.side ul { list-style: none; padding: 0; margin: 0 0 .4rem; }
.side li { padding: .22rem 0; border-bottom: 1px dotted var(--rule); }
.side li:last-child { border: 0; }
.side h3:first-child { margin-top: 0; }
.side .pending a { color: var(--muted); }
.ls { color: var(--muted); font-size: .9rem; font-variant-numeric: oldstyle-nums; }
.why { font-size: .82rem; color: var(--ink-2); font-style: italic; }
.ids p { margin: .2rem 0; font-size: .95rem; }

.entry .lg-entry { font-size: 1.12rem; line-height: 1.7; margin: 0; text-align: justify; hyphens: auto; }
.lg-name { font-family: var(--caps); font-weight: 700; font-size: 1.22rem; letter-spacing: .03em; }
.lg-entry a, .lg-issue a { color: var(--ink); text-decoration-color: rgba(142,43,29,.5); }
.lg-entry span[title] { border-bottom: 1px dotted var(--gold); cursor: help; }
.lg-issue { margin: .8rem 0 0; padding-left: 1.4rem; text-indent: -1.4rem; }
.prose p { margin: 0 0 .85rem; }
sup.fn { font-size: .68em; line-height: 0; margin-left: .08em; font-variant-numeric: lining-nums; }
sup.fn a { text-decoration: none; color: var(--rubric); padding: 0 .1em; border-radius: 3px; }
sup.fn a:hover { background: #f1dfd6; }
sup.fn-q { color: #b0361f; font-weight: 700; cursor: help; }
.fns { margin: 1rem 0 0; padding: .7rem 0 0 1.6rem; border-top: 1px solid var(--rule); font-size: .88rem; color: var(--ink-2); columns: 2 22rem; column-gap: 2rem; }
.fns li { break-inside: avoid; margin-bottom: .25rem; }
.fns li::marker { color: var(--rubric); font-variant-numeric: lining-nums; }
.fns li:target { background: #f6e9cf; }
.fn-src { all: unset; cursor: pointer; font-weight: 600; color: var(--rubric); }
.fn-src:hover { text-decoration: underline; }
.prose p:first-child::first-letter {
  font-family: var(--caps); float: left; font-size: 3.1rem; line-height: .82; padding: .3rem .4rem 0 0; color: var(--rubric);
}
.about p:first-child::first-letter, .s-sec .prose p:first-child::first-letter { all: unset; }
blockquote.longden { margin: 0; padding: 0 0 0 1rem; border-left: 3px solid var(--rule); }
blockquote.longden p:first-child::first-letter { all: unset; }

/* sources list */
.srcs { list-style: none; margin: .6rem 0 0; padding: 0; }
.src { display: grid; grid-template-columns: 4.2rem 1fr; gap: .9rem; padding: .75rem 0; border-top: 1px solid var(--rule); }
.src[hidden] { display: none; }
.src-year { font-size: 1.3rem; color: var(--rubric); font-variant-numeric: oldstyle-nums; text-align: right; line-height: 1.3; }
.src-meta { display: flex; gap: .4rem; align-items: center; margin-bottom: .1rem; }
.kind { font-family: var(--caps); font-size: .78rem; letter-spacing: .08em; padding: 0 .45rem; border-radius: 4px; border: 1px solid; }
.kind-record { color: #6e2a17; border-color: #d8b2a3; background: #f7e7df; }
.kind-calendar { color: #5b4a1a; border-color: #dcc996; background: #f6eed6; }
.kind-secondary { color: #33503b; border-color: #b6ccb9; background: #e8f0e6; }
.kind-index { color: #4a4f63; border-color: #c2c6d6; background: #ecedf3; }
.ref { font-size: .85rem; color: var(--ink-2); font-variant-numeric: lining-nums; letter-spacing: .02em; }
.src-title {
  all: unset; cursor: pointer; font-weight: 600; font-size: 1.05rem; line-height: 1.35; color: var(--ink);
}
.src-title:hover, .src-title:focus-visible { color: var(--rubric); text-decoration: underline; }
.src-sum { margin: .2rem 0 0; font-size: .95rem; color: var(--ink-2); }
.empty { color: var(--muted); font-style: italic; padding: 1rem 0; }

/* source dialog & page */
dialog#src-dialog {
  width: min(900px, 94vw); max-height: 88vh; padding: 0; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--paper-2); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(30,15,5,.55);
}
dialog::backdrop { background: rgba(43,34,25,.45); backdrop-filter: blur(2px); }
.dlg-head { position: sticky; top: 0; background: var(--paper-2); padding: 1rem 1.4rem .8rem; border-bottom: 1px solid var(--rule); z-index: 1; }
.dlg-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin: .3rem 0 .4rem; }
.dlg-bar { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.dlg-bar .sp { flex: 1; }
.dlg-x { all: unset; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--muted); position: absolute; right: 1rem; top: .7rem; }
.dlg-x:hover { color: var(--rubric); }
.dlg-body { padding: .4rem 1.4rem 1.4rem; overflow: auto; }
.s-sec h3 { font-size: 1rem; letter-spacing: .06em; color: var(--rubric); border-bottom: 1px solid var(--rule); padding-bottom: .15rem; }
.why-box { background: #f3ead8; border-left: 3px solid var(--gold); padding: .5rem .8rem; font-size: .95rem; margin-top: .8rem; }
pre.latin {
  font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; white-space: pre-wrap; margin: 0;
  background: #fffdf8; border: 1px solid var(--rule); border-radius: 8px; padding: .8rem 1rem .8rem 3.2rem;
  counter-reset: ln; font-style: italic; color: #3b2f22;
}
pre.latin span { display: block; position: relative; }
pre.latin span::before {
  counter-increment: ln; content: counter(ln); position: absolute; left: -2.6rem; width: 2rem; text-align: right;
  font-style: normal; font-size: .75rem; color: #b8a78c; top: .25rem; font-variant-numeric: lining-nums;
}
pre.latin.nowrap { white-space: pre; overflow-x: auto; }
.cite { font-size: .92rem; color: var(--ink-2); word-break: break-word; }
.src-h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; line-height: 1.2; }
.links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }

/* sources index */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.filters input, .filters select {
  font: inherit; font-size: .95rem; padding: .35rem .7rem; border: 1px solid var(--rule); border-radius: 8px; background: #fffdf8; color: var(--ink);
}
.filters input { flex: 1; min-width: 220px; }
.count { color: var(--muted); font-size: .9rem; }
.stable { width: 100%; border-collapse: collapse; font-size: .97rem; }
.stable th { font-family: var(--caps); text-align: left; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--rule); padding: .3rem .5rem; }
.stable th .sort {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: .3rem;
}
.stable th .sort::after { content: "↕"; font-family: var(--serif); font-size: .8em; opacity: .35; }
.stable th .sort:hover { color: var(--rubric); }
.stable th .sort:hover::after { opacity: .7; }
.stable th[aria-sort="ascending"] .sort, .stable th[aria-sort="descending"] .sort { color: var(--rubric); }
.stable th[aria-sort="ascending"] .sort::after { content: "▲"; opacity: 1; font-size: .65em; }
.stable th[aria-sort="descending"] .sort::after { content: "▼"; opacity: 1; font-size: .65em; }
.stable td { border-bottom: 1px solid var(--rule); padding: .45rem .5rem; vertical-align: top; }
.stable td:first-child { color: var(--rubric); font-variant-numeric: oldstyle-nums; white-space: nowrap; }
.stable td:nth-child(2) { white-space: nowrap; font-size: .88rem; }
.stable tr:hover td { background: #f6eedf; }
.stable .who a { color: var(--ink-2); }

.footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: .88rem; padding: 1.2rem 0 2rem; }
.footer a { color: var(--ink-2); }

@media (max-width: 900px) {
  .person-grid { grid-template-columns: 1fr; }
  .person-side { position: static; }
  .brand-sub { display: none; }
  .mast-inner { gap: 1rem; }
  h1 { font-size: 2.1rem; }
  .stable td:nth-child(4), .stable th:nth-child(4) { display: none; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .brand-title { font-size: 1.1rem; }
}
@media print {
  .masthead, .footer, .chips, .tools, .person-side .ids { display: none; }
  body { background: #fff; font-size: 12pt; }
  .panel { box-shadow: none; border: 0; padding: 0; }
}

.mast-full { padding: 0 1.25rem; }

