*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  max-width: 48em;
  padding: 2rem 1.25rem 3rem;
  background-color: #faf7f1;
  line-height: 1.6;
  font-family: "Georgia", "Times New Roman", serif;
}

/* Headings: tight leading, more space above than below */
h1, h2, h3, h4 {
  color: #011111;
  font-family: "Avenir", "Arial", sans-serif;
  line-height: 1.2;
}
h1 { font-size: 36pt; margin: 0 0 0.5rem; text-align: center; }
h2 { font-size: 24pt; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.35rem; margin: 0rem 0 0.5rem; }
/* Seal: borderless SVG (no transparent margin), square, as tall as the capitals (~0.72em), bottom edge on the baseline.
   It hangs in the left gutter: margin-left cancels width + margin-right, so the title text starts on the margin. */
h2::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.3em;
  background: url("seal_borderless.svg") center / contain no-repeat;
  vertical-align: baseline; /* empty inline-block: its bottom edge sits on the text baseline */
}
/* Narrow screens have no gutter to hang in: put the seal back inline */
@media (max-width: 50em) {
  h2::before { margin-left: 0; }
}

/* A subsection hugs the title above it */
h2 + h3 { margin-top: 0.4rem; }

/* Text blocks */
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.5rem; }
li { margin-bottom: 0.5em; }
a { text-underline-offset: 0.15em; }

/* Quick-jump row under the title: one entry per h2, built from section.toc */
html { scroll-behavior: smooth; }
h2 { scroll-margin-top: 1rem; }
#toc ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  text-align: center;
}
#toc li {
  display: inline-block;
  margin: 0;
  padding: 0.25rem 0.6rem;
}

/* Quick-jump row and links inside h3 titles / intro: Avenir, normal weight, no underline at rest */
#toc a, .tl {
  font-family: "Avenir", "Arial", sans-serif;
  font-weight: normal;
  text-decoration: none;
}
#toc a:hover, .tl:hover { text-decoration: underline; }
#toc a { font-size: 1.1rem; }

/* Account links (config.toml [extra.links]): overlaid in the top-right corner of the page,
   out of the flow, so the title and text do not move. One label per line, right-aligned. */
#corner {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-style: normal;
  text-align: right;
}
#corner ul { list-style: none; margin: 0; padding: 0; }
#corner li { margin: 0; line-height: 1.6; }
#corner a {
  font-family: "Avenir", "Arial", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b8b0a3;
  text-decoration: none;
}
#corner a:hover { color: #011111; }
/* Phones: the title spans the full width, so an overlay would sit on it.
   Back in the flow as one centered row above the title.
   44em: below ~700px the overlay starts to sit on the end of the jump row. */
@media (max-width: 44em) {
  #corner { position: static; margin: -1rem 0 1rem; text-align: center; }
  #corner li { display: inline-block; margin: 0 0.4em; }
  #corner a { letter-spacing: 0.06em; }
}

/* Title links: "Title — Github · Homepage ▸Expand".
   The em-dash is drawn before the first link of the title (no need to type it). */
.tl { font-size: 0.95rem; }
h3 > .tl:first-of-type::before, h3 + p > .tl:first-of-type::before {
  content: "\2014";
  display: inline-block; /* inline-block: the hover underline does not run under the dash */
  margin: 0 0.4em 0 0.15em;
  color: #011111; /* title color, not the link's */
}
/* Paper metadata line: the paragraph right after an h3 that carries title links.
   Written in markdown as a plain line under the ### title: "with X, at VENUE'26 {% <link> %}..." */
h3 + p:has(> .tl) { margin: -0.3rem 0 0.9rem; font-size: 0.95rem; }
h3 + p:has(> .tl) .tri { display: none; } /* dot already separates; no triangle on paper lines */
/* Separator: a small round dot, {% <sep> %}{% </sep> %} between two links */
.sep {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  margin: 0 0.35em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.25em;
}
/* Expand toggle: disclosure triangle is a text glyph inside the link, so the hover underline runs under it */
.expand-toggle .tri::before { content: "\25B8"; font-size: 1.2em; margin-right: 0.1em; } /* ▸ closed */
.expand-toggle[aria-expanded="true"] .tri::before { content: "\25BE"; } /* ▾ open */
/* Expanded body: plain prose under the title */
.expand { margin: 0.25rem 0 0; }
.expand[hidden] { display: none; }
