/* Shared design for paper, report and talk pages. Matches the homepage:
   Lora for titles, Inter for text, Oxygen Mono for small labels. Article
   bodies keep their original markup (Bootstrap-era .row/.col-md-12 wrappers,
   figure.captioned_img, hr.divider), so those classes are styled here rather
   than rewritten in every page. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: #1f1f1f;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ===== Navigation ===== */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; }
.nav-brand, .nav-back {
  font-family: 'Oxygen Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
  text-decoration: none;
}
.nav-brand { color: #444; }
.nav-brand:hover, .nav-back:hover { color: #1f1f1f; }

.eyebrow {
  font-family: 'Oxygen Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
}

/* ===== Header ===== */
.paper-header { padding: 72px 0 40px; }
.paper-header h1 {
  margin: 16px 0 0;
  font-family: 'Lora', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: #111;
}
.paper-header .dek { margin: 16px 0 0; font-size: 18px; font-weight: 400; line-height: 1.5; color: #555; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin: 40px 0 0;
  padding-top: 20px;
  border-top: 1px solid #e6e6e6;
}
.meta dt { margin: 0 0 6px; }
.meta dd { margin: 0; font-size: 14px; line-height: 1.5; color: #1f1f1f; }
.meta dd span { display: block; color: #6b6b6b; }
.meta a { text-decoration: underline; text-decoration-color: #bbb; text-underline-offset: 3px; }
.meta a:hover { text-decoration-color: #1f1f1f; }

/* ===== Slide previews (talk pages) ===== */
.slides { margin: 16px 0 0; }
.slide-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.slide-pair a { display: block; }
.slide-pair img { width: 100%; border: 1px solid #e6e6e6; }
.slides figcaption { max-width: 720px; margin: 16px auto 0; font-size: 13px; line-height: 1.6; color: #6b6b6b; }

/* ===== Short pages: labelled sections ===== */
section { padding-top: 56px; }
section h2 { margin: 0 0 16px; }
section p, section li { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; line-height: 1.65; color: #1a1a1a; }
section p { margin: 0 0 18px; }
section ol, section ul { margin: 0; padding-left: 1.25em; }
section li { margin-bottom: 6px; padding-left: 4px; }
section li b { font-weight: 600; color: #111; }
section a, .article a { text-decoration: underline; text-decoration-color: #bbb; text-underline-offset: 3px; }
section a:hover, .article a:hover { text-decoration-color: #1f1f1f; }
.note { margin-top: 16px; font-size: 14px; color: #6b6b6b; }

pre.bibtex, .article pre.bibtex-block {
  margin: 0;
  padding: 20px 24px;
  background: #f6f6f6;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  white-space: pre;
  font-family: 'Oxygen Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #333;
}
pre code { font-family: inherit; font-size: inherit; background: none; padding: 0; color: inherit; }

/* ===== Long-form articles ===== */
.article { counter-reset: fig; }
.article p, .article li { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; line-height: 1.65; color: #1a1a1a; }
.article p { margin: 0 0 18px; }
.article ol, .article ul { margin: 0 0 18px; padding-left: 1.25em; }
.article li { margin-bottom: 8px; padding-left: 4px; }
.article strong, .article b { font-weight: 600; color: #111; }
.article h2 {
  margin: 0 0 20px;
  font-family: 'Lora', serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.3;
  color: #111;
}
.article h3 { margin: 32px 0 12px; font-family: 'Lora', serif; font-weight: 400; font-size: 20px; line-height: 1.35; color: #111; }
.article h4 { margin: 24px 0 10px; font-size: 16px; font-weight: 600; color: #111; }
.article hr.divider { margin: 56px 0; border: 0; border-top: 1px solid #e6e6e6; }

/* Abstract block at the top of long articles */
.article .abstract { padding: 0; margin: 0 0 8px; }
.article h2.eyebrow { margin: 0 0 16px; font-family: 'Oxygen Mono', monospace; font-size: 11px; line-height: 1.4; color: #6b6b6b; }

/* Figures */
.article figure.captioned_img, .paper-header + figure.captioned_img { counter-increment: fig; margin: 32px 0; }
.article img { margin-left: auto; margin-right: auto; }
.article > .text-center { margin: 32px 0; }
.article .row.captioned_img > div > br { display: none; }
.article figcaption.caption, figure.captioned_img figcaption.caption {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #666;
  text-align: left;
}
.article figure.captioned_img figcaption::before {
  content: "Figure " counter(fig) ". ";
  font-weight: 600;
  color: #333;
}

/* Callouts */
.article .definition-box {
  margin: 28px 0;
  padding: 20px 24px;
  background: #f6f6f6;
  border: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  color: #1a1a1a;
}
.article .tldr-box {
  margin: 28px 0;
  padding: 4px 24px 8px;
  border: 1px solid #e6e6e6;
}
.article .tldr-box li { font-size: 17px; }
.article .tldr-box h4 {
  margin: 20px 0 12px;
  font-family: 'Oxygen Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.article .pull-quote {
  margin: 36px 0;
  padding: 0 0 0 20px;
  border-left: 2px solid #1f1f1f;
  font-family: 'Lora', serif;
  font-size: 22px;
  line-height: 1.45;
  color: #111;
}
.article blockquote {
  margin: 28px 0;
  padding: 0 0 0 20px;
  border-left: 2px solid #d0d0d0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  color: #333;
}

/* Tables */
.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.article th, .article td { padding: 10px 12px 10px 0; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; line-height: 1.55; color: #333; }
.article thead th {
  border-bottom: 1px solid #ccc;
  font-family: 'Oxygen Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.article td.knob { font-weight: 500; color: #111; white-space: nowrap; }

/* References */
.article .references ul, .article ul.references { list-style: none; padding-left: 0; }
.article .references li, .article ul.references li { font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.6; color: #555; }

/* Older articles use h1 for section headings, side-by-side image rows and a waitlist box */
.article h1 { margin: 0 0 20px; font-family: 'Lora', serif; font-weight: 400; font-size: 26px; line-height: 1.3; color: #111; }
.article figure .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.article figure .row > div > br { display: none; }
.article .full-width-figure { width: auto; left: auto; transform: none; padding: 0; }
.article pre:not(.bibtex-block) {
  margin: 0 0 18px;
  padding: 16px 20px;
  background: #f6f6f6;
  overflow-x: auto;
  font-family: 'Oxygen Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
}
.article .cta-container { margin: 0; padding: 24px; border: 1px solid #e6e6e6; }
.article .cta-container p { margin: 0 0 14px; font-family: 'Inter', sans-serif; font-size: 15px; }
.article .primary-button {
  display: inline-block;
  padding: 9px 16px;
  background: #111;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}
.article .primary-button:hover { background: #333; }
.paper-header .header-note { margin: 20px 0 0; font-size: 13px; line-height: 1.5; color: #6b6b6b; }

/* ===== Footer ===== */
footer.site { margin-top: 96px; border-top: 1px solid #e6e6e6; }
footer.site p { margin: 0; padding: 24px 0 40px; font-size: 11px; color: #6b6b6b; }

@media (max-width: 640px) {
  .paper-header { padding: 40px 0 28px; }
  .paper-header h1 { font-size: 28px; }
  .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .slide-pair { grid-template-columns: 1fr; }
  section { padding-top: 44px; }
  .article h1, .article h2 { font-size: 22px; }
  .article hr.divider { margin: 44px 0; }
  section p, section li, .article p, .article li { font-size: 17px; }
  .article .pull-quote { font-size: 19px; }
}
