
:root {
  --paper: #faf9f7; --ink: #1c1b19; --ink-soft: #444038; --rule: #e2ddd3;
  --accent: #1f7a54; --accent-soft: #eaf5ef; --link: #1f7a54;
  --measure: 52rem;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #efece6; color: var(--ink);
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  font-size: 18px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Reading column: centre every top-level block on one measure. tex4ht emits a
   flat sequence of top-level blocks, so each is centred with an auto left/right
   margin and shares the same padding, so nothing (paragraphs, the draft box,
   headings) escapes or mis-aligns. */
body > * {
  max-width: var(--measure);
  margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px;
}
.paper-topbar { max-width: none; padding: 0;
  background: #fff; border-bottom: 1px solid var(--rule);
  font-family: 'Inter', system-ui, sans-serif;
}
.paper-topbar-inner {
  max-width: var(--measure); margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.paper-topbar a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.paper-topbar a:hover { text-decoration: underline; }
.paper-topbar .brand { color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }
.paper-topbar .brand span { color: var(--accent); }

body { padding-bottom: 80px; }

/* Typography. Horizontal centring/padding comes from `body > *`; paragraphs set
   only vertical rhythm and alignment here (a `margin` shorthand would wipe out
   the auto centring). */
p, p.indent, p.noindent {
  margin-top: 0; margin-bottom: 1.1em;
  text-align: justify; text-justify: inter-word; hyphens: auto;
}
/* The abstract and bibliography read better ragged-right */
.abstract p, .thebibliography p, .abstract p.indent, .abstract p.noindent {
  text-align: left; hyphens: manual;
}
.titleHead {
  font-size: 2em; line-height: 1.15; font-weight: 700; text-align: center;
  margin-top: 0.6em; margin-bottom: 0.2em; padding-top: 8px; letter-spacing: -0.01em;
}
h2.titleHead br + * { font-size: 0.6em; }
.author, .date { text-align: center; font-family: 'Inter', system-ui, sans-serif; }
.author { font-size: 0.9em; color: var(--ink-soft); margin-top: 0.6em; }
.date { font-size: 0.8em; color: var(--ink-soft); margin-top: 0.4em; }

.sectionHead, h3, .likesectionHead {
  font-family: 'Inter', system-ui, sans-serif; font-weight: 700;
  font-size: 1.3em; line-height: 1.25; margin-top: 1.8em; margin-bottom: 0.6em;
  color: var(--ink); letter-spacing: -0.01em;
  scroll-margin-top: 72px;
}
/* Section anchor: a faint '#' that appears on hover, giving the reader the
   section's link. The heading carries a readable id (e.g. #falsifiability). */
.headlink {
  margin-left: 0.4em; color: var(--accent); text-decoration: none;
  font-weight: 400; opacity: 0; transition: opacity 0.15s;
}
.sectionHead:hover .headlink, .subsectionHead:hover .headlink,
.subsubsectionHead:hover .headlink, .paragraphHead:hover .headlink,
.headlink:focus { opacity: 0.6; }
.headlink:hover { opacity: 1; text-decoration: underline; }

/* Abstract and DRAFT notice. Both are nested inside a tex4ht .center wrapper,
   which `body > *` already centres on the measure, so they fill their container
   (margin 0) rather than trying to re-centre on a narrower max-width -- that
   mismatch is what left the draft box off-centre. */
.abstracttitle { font-family: 'Inter', system-ui, sans-serif; font-weight: 700; text-align: center; }
.abstract {
  font-size: 0.96em; color: var(--ink-soft); background: var(--accent-soft);
  border: 1px solid var(--rule); border-radius: 10px;
  padding: 20px 28px; margin-top: 1.4em; margin-bottom: 2em; text-align: left;
}
.abstract p { text-align: left; }
.fbox, div.fbox {
  display: block; width: auto;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.8em; line-height: 1.55;
  color: var(--ink-soft); background: #fdf6e3; border: 1px solid #e6dcc0;
  border-radius: 10px; padding: 14px 20px; margin-top: 0; margin-bottom: 1.8em; text-align: left;
}
/* tex4ht wraps the notice/abstract in div.center (text-align:center,
   margin:1em) and its own thin border/table display; neutralise those so our
   card centres on the reading column and inter-word spaces are not eaten by the
   table box (that was the "companionto" fusion). Match tex4ht's specificity. */
div.center { text-align: left; margin-left: auto; margin-right: auto; }
div.center div.fbox { text-align: left; border: 1px solid #e6dcc0; }

/* Theorem-like environments */
.newtheorem {
  background: #fff; border-left: 3px solid var(--accent);
  padding: 2px 24px 2px 22px; margin-top: 1.2em; margin-bottom: 1.2em;
}

/* Links */
a { color: var(--link); text-decoration-thickness: 0.06em; text-underline-offset: 2px; }
a.xref-ext { font-weight: 600; white-space: nowrap; }

/* Math: display centred with horizontal scroll on overflow; inline baseline-aligned */
.math-display { text-align: center; margin-top: 1.3em; margin-bottom: 1.3em; overflow-x: auto; }
.math-display img, .math-display svg { max-width: 100%; height: auto; }
img { max-width: 100%; }
p img, td img, li img { vertical-align: middle; }

/* Figures */
/* Figures. tex4ht wraps the figure image in a <p class="noindent">, which the
   body-paragraph rule would justify (left-aligning a lone image); force figure
   content and its paragraphs back to centred, above that rule's specificity. */
.figure, figure { text-align: center; margin-top: 1.6em; margin-bottom: 1.6em; }
.figure p, figure p, .figure p.indent, .figure p.noindent { text-align: center; }
.figure img, figure img { max-width: 100%; height: auto; display: inline-block; }
.caption, figcaption, .figure .caption { font-family: 'Inter', system-ui, sans-serif; font-size: 0.82em; color: var(--ink-soft); text-align: center; }

/* Lists */
ul, ol { margin: 0 auto 1.1em; }
li { margin-bottom: 0.3em; }

/* Bibliography */
.thebibliography { font-size: 0.86em; color: var(--ink-soft); margin-top: 2.4em; border-top: 1px solid var(--rule); padding-top: 1.4em; }
.thebibliography p { text-align: left; }

/* Tables */
.tabular, table { border-collapse: collapse; margin: 1.4em auto; font-size: 0.9em; max-width: 100%; }
.tabular td, .tabular th, table td, table th { border: 1px solid var(--rule); padding: 6px 12px; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  body > * { padding-left: 18px; padding-right: 18px; }
  .paper-topbar { padding: 0; }
  .paper-topbar-inner { padding: 12px 18px; }
}
