/* Hog paper -- a document page inside the Jekyll site.
 *
 * GENERATED. build-html.js copies this over the site's assets/css/paper.css,
 * so edits made in the site repo are silently reverted on the next build.
 * Change this file instead.
 *
 * Everything is scoped under .paper so the site header, nav and every other
 * page keep their own styling untouched.
 *
 * The typography is deliberately not the site's: Charter, a 40em measure and a
 * formal title block make a paper read as a document rather than as another
 * page of the blog.
 *
 * Colour is the part that is shared. The tokens below are the light and dark
 * surfaces the plot itself is rendered against (see expected_score.py), so the
 * figure sits on the page with no visible edge in either mode.
 */

.paper {
  --ink: #0b0b0b;
  --soft: #52514e;
  --faint: #8a8880;
  --rule: #e6e5e0;
  --accent: #007acc; /* the site's link colour */

  /* The serif is the paper's own; the sans for metadata is the site's, taken
     from --font in style.css so there is one stack to maintain. */
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Source Serif Pro",
    Georgia, Cambria, "Times New Roman", serif;
  --sans: var(--font);

  max-width: 40em;
  margin-inline: auto;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* expected_score.py THEMES["dark"], except --ink: the figure's primary is
   #ffffff, right for 1.6pt plot lines and harsh over several pages of prose. */
@media (prefers-color-scheme: dark) {
  .paper {
    --ink: #ededea;
    --soft: #c3c2b7;
    --faint: #8a8880;
    --rule: #333330;
    --accent: #3987e5;
  }
}

/* ---------- title block: three levels, ranged left ---------- */

.paper-header {
  margin: 2.25rem 0 3.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.paper-title {
  margin: 0;
  /* style.css underlines every h1; the paper's title block has its own rule. */
  padding-bottom: 0;
  border-bottom: none;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.35rem + 2.9vw, 2.9rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

.paper-deck {
  margin: 0.85rem 0 0;
  max-width: 32em;
  color: var(--soft);
  font-size: clamp(1.08rem, 0.98rem + 0.45vw, 1.28rem);
  font-weight: 400;
  line-height: 1.44;
  text-wrap: pretty;
}

.paper-author,
.paper-date {
  margin: 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.775rem;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.paper-author { margin-top: 1.6rem; }
.paper-date { opacity: 0.78; }

/* ---------- PDF download ---------- */

.paper-links { margin: 1.5rem 0 0; }

.paper-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.36em 0.9em;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--soft);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.paper-links a:hover {
  border-color: var(--faint);
  color: var(--ink);
  text-decoration: none;
}

.paper-links svg {
  width: 0.95em;
  height: 0.95em;
  flex: none;
}

/* ---------- body ---------- */

.paper h2 {
  margin: 3rem 0 1rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.paper p { margin: 0 0 1.15rem; }

.paper a { color: var(--accent); }

.paper blockquote {
  background: none;
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--soft);
}

.paper blockquote p:last-child { margin-bottom: 0; }

.paper strong { font-weight: 650; }

/* ---------- figure ---------- */

.paper figure {
  width: 100%;
  margin: 2.75rem 0 2.5rem;
}

.paper figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
}

.paper figcaption {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.paper figcaption strong { color: var(--ink); font-weight: 650; }

/* ---------- math ---------- */

/* KaTeX draws in currentColor, so the formulas follow --ink into dark
 * mode with no override of their own. */

.paper .katex { font-size: 1.06em; }

/* Long display lines scroll on their own instead of widening the page.
 * See https://github.com/KaTeX/KaTeX/issues/1023 */
.paper .katex-display {
  margin: 1.5rem 0;
  padding: 0.35rem 0.15rem;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 34em) {
  .paper { font-size: 1rem; }
  .paper-header { margin-top: 1.5rem; }
}
