/* The browser's defaults, corrected only where they fail the reader. */
:root {
  color-scheme: light dark;
  --accent: light-dark(#8c2f1e, #e39a86);   /* the one deliberate colour: oxblood */
  --faint: color-mix(in oklab, CanvasText 55%, Canvas);
  --rule: color-mix(in oklab, CanvasText 18%, Canvas);
  accent-color: var(--accent);
}
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; max-width: 40em; margin: 2em auto; padding: 0 1.5em; line-height: 1.5; background: Canvas; color: CanvasText; }
h1 { font-size: 1.35em; line-height: 1.2; }
h2 { font-size: 1.15em; }
h3 { font-size: 1em; }
li { margin-bottom: 0.4em; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0 1em; }
/* The footer: one line under a short rule; on the home page it stands in the text column. */
footer { font-size: 0.85em; color: var(--faint); margin-top: 3em; padding-top: 0.9em; border-top: 1px solid var(--rule); max-width: calc(42em / 0.85); }
footer p { margin: 0 0 0.4em; }

/* The other forms of the name, in one sentence: a small note at the foot of the margin
   on the home page, and in the footer on the other pages. */
.aka { font-size: 0.78em; line-height: 1.5; color: var(--faint); }
.side .aka { margin: 1.4em 0 0; padding-top: 1.1em; border-top: 1px solid var(--rule); }
footer .aka { font-size: 1em; }
nav .who { margin-bottom: 0.25em; }
nav .who + p { margin-top: 0; }
summary { cursor: pointer; color: var(--faint); font-size: 0.9em; }
summary:hover { color: CanvasText; }
@media (max-width: 30em) { body { margin: 1.25em auto; padding: 0 1em; } ul, ol { padding-left: 1.3em; } }

/* Home page. The margin holds the name, the lines of work and the tags; the line
   being read is marked there, and its title stays at the top while its work
   scrolls under it. Each item begins with its year, newest first. */
.side h1 { font-size: 1.3em; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.35em; }
/* Who he is, under the name: post and university. */
.role { font-size: 0.85em; line-height: 1.4; color: var(--faint); margin: 0 0 1.5em; }
.toc ul { list-style: none; padding: 0; margin: 0 0 1.8em; }
.toc li { margin-bottom: 0.7em; line-height: 1.3; }
/* The line being read: a vertical bar in the accent colour and the text in full black. */
.toc a { color: var(--faint); text-decoration: none; display: block; padding-left: 0.7em; border-left: 3px solid transparent; }
.toc a:hover { color: CanvasText; }
.toc a[aria-current] { color: CanvasText; font-weight: 600; border-left-color: var(--accent); }

/* Tags: a small coloured dot and a grey word; pressed, the word takes the colour
   on a faint wash of it. --c comes from _data/tagColors.js. */
.tag {
  --ink: light-dark(color-mix(in oklab, var(--c) 70%, black), color-mix(in oklab, var(--c) 60%, white));
  font: inherit; font-size: 0.78em; line-height: 1.6; color: var(--faint);
  background: none; border: 0; border-radius: 0.3em; padding: 0 0.35em; margin: 0 0.15em 0 0;
  cursor: pointer; text-indent: 0; white-space: nowrap;
}
.tag::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: light-dark(var(--c), color-mix(in oklab, var(--c) 80%, white)); margin-right: 0.35em; vertical-align: 0.05em; }
.tag:hover { color: var(--ink); }
.tag[aria-pressed="true"] { color: var(--ink); background: color-mix(in oklab, var(--c) 16%, Canvas); }
.tag:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
.tags { margin-left: -0.35em; }
/* In the margin the tags are small capsules with a neutral border and the tag's dot,
   under a rule; pressed, a capsule takes the colour as under the works. The list
   shows about three rows; All tags opens the rest. Topics and persons are two groups. */
.alltags { margin: 2em 0 0; padding-top: 1.1em; border-top: 1px solid var(--rule); line-height: 1.95; }
.alltags .list { max-height: 7.4em; overflow: hidden; mask-image: linear-gradient(#000 65%, transparent); }
.alltags.open .list { max-height: none; mask-image: none; }
.alltags .list p { margin: 0 0 0.6em; }
.alltags .tag { font-size: 0.72em; color: var(--faint); border: 1px solid var(--rule); border-radius: 1em; padding: 0.05em 0.6em 0.05em 0.5em; margin: 0 0.2em 0 0; }
.alltags .tag:hover { color: var(--ink); border-color: color-mix(in oklab, var(--c) 60%, Canvas); }
.alltags .tag[aria-pressed="true"] { color: var(--ink); background: color-mix(in oklab, var(--c) 16%, Canvas); border-color: var(--c); }
.more { font: inherit; font-size: 0.8em; cursor: pointer; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; }
.filter { font-size: 0.85em; color: var(--faint); margin: 0 0 0.6em; }
.clear { font: inherit; cursor: pointer; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; }

/* The jump past the margin, for the keyboard: seen only when it has the focus. */
.skip { position: absolute; left: -999em; }
.skip:focus { position: static; display: inline-block; margin-bottom: 1em; }
/* Under a work shown in two lines, the other line. */
.also { font-size: 0.78em; color: var(--faint); }
.also a { color: inherit; }
/* On touch screens the small controls get a larger target. */
@media (pointer: coarse) {
  .tag, details.abs > summary { padding-top: 0.3em; padding-bottom: 0.3em; }
}
/* Text for screen readers only (what a link leads to, that it opens a new tab). */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* The jump from a line back to the list of lines: only on narrow screens, where the
   margin is above the text and not beside it. */
.lh .up { display: none; }

/* The label of a text that has not been reviewed yet (preview only). */
.draft { font-size: 0.62em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); border: 1px solid var(--rule); border-radius: 0.3em; padding: 0 0.35em; vertical-align: 0.15em; font-weight: 400; font-style: normal; }

section { margin-bottom: 3em; }
/* The header of a line stays at the top: its title and, under it, the kinds of work
   in the line with their number; the kind being read is underlined. */
section > .lh { position: sticky; top: 0; z-index: 1; background: Canvas; margin: 0 0 0.6em; padding: 0.6em 0 0.45em; border-bottom: 1px solid var(--rule); }
.lh h2 { margin: 0; font-weight: 600; }
.kinds { display: flex; flex-wrap: wrap; gap: 0 1.1em; font-size: 0.8em; margin-top: 0.25em; }
.kinds a { color: var(--faint); text-decoration: none; padding-bottom: 0.1em; border-bottom: 2px solid transparent; }
.kinds a:hover { color: CanvasText; }
.kinds a[aria-current] { color: CanvasText; border-bottom-color: var(--accent); }
.kinds .n { font-variant-numeric: tabular-nums; }
body.filtering .kinds .n { display: none; }
main h3 { scroll-margin-top: calc(var(--hh, 5em) + 0.5em); }
/* The description of a line: closed, it shows the first paragraph and the beginning
   of the next, fading out; More opens it and Less closes it. */
.desc { position: relative; }
.desc p { max-width: 38em; }
.desc.clip { max-height: var(--clip, 10em); overflow: hidden; mask-image: linear-gradient(#000 calc(100% - 3.4em), transparent); }
.desc-more { display: block; margin: 0.3em 0 0.2em; }
/* With a tag chosen, a line shows only its title and the works with that tag. */
body.filtering .desc, body.filtering .desc-more { display: none; }
main h3 { font-size: 0.75em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); margin: 2em 0 0.8em; }
ul.work { list-style: none; padding: 0; margin: 0; }
ul.work li { padding-left: 5.5em; text-indent: -5.5em; margin-bottom: 0.8em; }
.y { display: inline-block; width: calc(5.5em / 0.9); font-size: 0.9em; text-indent: 0; color: var(--faint); font-variant-numeric: tabular-nums; }
/* An entry: the title; under it, in small grey type, the co-authors and the place of
   publication with the link; then the abstract, which opens in small type, and the tags. */
.t { font-weight: 500; }
.meta, .foot { display: block; text-indent: 0; }
.meta { font-size: 0.85em; color: var(--faint); margin-top: 0.1em; }
.meta a { letter-spacing: 0.03em; }
.foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.9em; margin-top: 0.2em; }
details.abs > summary { font-size: 0.78em; }
details.abs[open] { flex-basis: 100%; }
.abs-text { font-size: 0.85em; line-height: 1.5; max-width: 36em; margin: 0.3em 0 0.4em; }
.abs-text p { margin: 0; }
ul.work details { text-indent: 0; }
details.earlier { margin: 0.4em 0 0.9em; }
details.earlier > summary { margin-bottom: 0.9em; }

@media (min-width: 62em) {
  body.home { max-width: 60em; }
  body.home .page { display: grid; grid-template-columns: 12em minmax(0, 42em); gap: 3.5em; }
  .side { position: sticky; top: 2em; align-self: start; max-height: calc(100vh - 4em); overflow-y: auto; font-size: 0.95em; }
  section > .lh { padding-top: 0.3em; }
  body.home > footer { margin-left: 15.5rem; }
  body.home > footer .aka { display: none; }
  .alltags .list { max-height: none; mask-image: none; }
}
@media (max-width: 62em) {
  .side { margin-bottom: 2em; padding-bottom: 1.5em; border-bottom: 1px solid var(--rule); }
  .toc ul { display: flex; flex-wrap: wrap; gap: 0.3em 1.2em; margin-bottom: 1em; }
  .toc a { padding-left: 0; margin-left: 0; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
  .lh h2 { font-size: 1em; }
  .kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  section > .lh { padding-right: 4.5em; }
  .lh .up { display: block; position: absolute; right: 0; top: 0.6em; font-size: 0.8em; white-space: nowrap; }
  /* The note on other forms of the name goes to the footer, so the work comes sooner. */
  .side .aka { display: none; }
}
@media (max-width: 30em) {
  ul.work li { padding-left: 0; text-indent: 0; }
  .y { display: inline; width: auto; margin-right: 0.5em; }
}
