/* ============================================================
   JHEP costume: the site rendered as a paper "Prepared for
   submission to JHEP", viewed in a PDF reader. Same content,
   same class vocabulary — the visual layer apes jheppub.sty.
   Self-hosted Computer Modern (serif, sans, typewriter).
   ============================================================ */

@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cmunrm.woff") format("woff");
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cmunti.woff") format("woff");
}
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/cmunbx.woff") format("woff");
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/cmunbi.woff") format("woff");
}
/* CMU Sans: the jheppub title/author face. */
@font-face {
  font-family: "CMU Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cmunss.woff") format("woff");
}
@font-face {
  font-family: "CMU Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/cmunsx.woff") format("woff");
}
/* CMU Typewriter: \texttt — e-mail lines, resource tags. */
@font-face {
  font-family: "CMU Typewriter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cmuntt.woff") format("woff");
}

:root {
  color-scheme: light;
  /* The reading environment (PDF-viewer chrome) */
  --backdrop: #50545a;
  --toolbar: #323639;
  --toolbar-text: #d9dbde;
  --toolbar-text-strong: #ffffff;
  --toolbar-line: rgba(0, 0, 0, 0.45);
  --toolbar-accent: #8ab4f8;
  /* The paper itself */
  --sheet: #ffffff;
  --text: #131313;
  --muted: #3f3f3f;
  --faint: #6e6e6e;
  --rule: #1a1a1a;                      /* \hrule black */
  --line: rgba(0, 0, 0, 0.16);          /* soft site hairlines */
  --accent: #1717c4;                    /* hyperref blue */
  --accent-hover: #0d0d86;
  --sheet-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 10px 34px rgba(0, 0, 0, 0.3);
  --max-width: 884px;
  --measure: 40rem;
  --mono-ui: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mono-paper: "CMU Typewriter", "JetBrains Mono", ui-monospace, monospace;
  --serif: "CMU Serif", "Latin Modern Roman", "Iowan Old Style", "Book Antiqua", Georgia, serif;
  --sans: "CMU Sans", "Latin Modern Sans", "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* Night viewer: dark sheet, inverted ink. */
  --backdrop: #141518;
  --toolbar: #232427;
  --toolbar-text: #b9bbbf;
  --toolbar-text-strong: #f2f3f5;
  --toolbar-line: rgba(0, 0, 0, 0.6);
  --toolbar-accent: #8ab4f8;
  --sheet: #1e1f23;
  --text: #e8e4dc;
  --muted: #b3afa6;
  --faint: #8b877f;
  --rule: #d6d2c9;
  --line: rgba(232, 228, 220, 0.16);
  --accent: #93a4ff;
  --accent-hover: #c0caff;
  --sheet-shadow:
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 12px 36px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: clamp(15.5px, 15.2px + 0.16vw, 17px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--serif);
  /* Paper body text: dense, book-like. */
  font-size: clamp(17px, 16.7px + 0.1vw, 18px);
  line-height: 1.52;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  background: var(--backdrop);
  transition: background-color 260ms ease, color 260ms ease;
}

::selection {
  background: rgba(23, 23, 196, 0.16);
}

:root[data-theme="dark"] ::selection {
  background: rgba(147, 164, 255, 0.28);
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

li::marker {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hyperref look: colored links, no underline; underline on hover only. */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

button,
input,
textarea,
select {
  font: inherit;
}

code,
pre {
  font-family: var(--mono-paper);
}

.container {
  width: min(1160px, 95vw);
  margin: 0 auto;
}

/* ------------------------------------------------------------
   Viewer chrome: the sticky header plays PDF-toolbar
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--toolbar-line);
  background: var(--toolbar);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 0;
}

.brand {
  color: var(--toolbar-text-strong);
  font-family: var(--mono-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand:hover,
.brand:focus-visible {
  color: var(--toolbar-text-strong);
  text-decoration: none;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.site-nav a {
  position: relative;
  color: var(--toolbar-text);
  font-family: var(--mono-ui);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a + a {
  padding-left: 1rem;
}

.site-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0.8rem;
  background: currentColor;
  opacity: 0.35;
  transform: translateY(-50%);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--toolbar-text-strong);
  text-decoration: none;
}

.site-nav a[aria-current="true"] {
  color: var(--toolbar-text-strong);
}

.site-nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.42em;
  height: 2px;
  background: var(--toolbar-accent);
}

.site-nav a + a[aria-current="true"]::after {
  left: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 1;
  color: transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.theme-toggle::before {
  content: "\263E";
  color: var(--toolbar-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", sans-serif;
  font-size: 0.95rem;
}

:root[data-theme="dark"] .theme-toggle::before {
  content: "\2600";
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------
   The sheet: every <main> is a page of the paper
   ------------------------------------------------------------ */
.page,
.article-shell {
  position: relative;
  width: min(var(--max-width), 100%);
  margin: 1.7rem auto 2.8rem;
  padding: clamp(2.4rem, 6vw, 4.6rem) clamp(1.35rem, 7.4vw, 5.6rem) 2.6rem;
  background: var(--sheet);
  box-shadow: var(--sheet-shadow);
  transition: background-color 260ms ease;
}

/* Centered page number at the sheet's foot, jheppub style. */
.page::after,
.article-shell::after {
  content: "– 1 –";
  display: block;
  margin-top: 2.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

/* The rotated arXiv stamp in the left margin of the first page. */
.arxiv-stamp {
  position: absolute;
  top: 23rem;
  left: 1.05rem;
  color: var(--faint);
  font-family: var(--mono-paper);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
  user-select: none;
}

@media (max-width: 1020px) {
  .arxiv-stamp {
    display: none;
  }
}

/* ------------------------------------------------------------
   JHEP title block
   ------------------------------------------------------------ */
.submit-note {
  margin: 0 0 3.2rem;
  font-size: 0.86rem;
  color: var(--text);
}

.paper-title {
  margin: 0 0 1.15rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 1.98rem);
  line-height: 1.28;
  letter-spacing: 0;
}

.title-rule {
  height: 0;
  margin: 0 0 1.9rem;
  border: 0;
  border-top: 1.5px solid var(--rule);
}

.paper-author {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
}

.paper-affil,
.paper-email,
.paper-eprint {
  margin: 0 0 0.45rem 1.1em;
  font-size: 0.98rem;
}

.paper-affil {
  font-style: italic;
}

.paper-email em,
.paper-eprint em {
  font-style: italic;
}

.paper-email a,
.paper-eprint a {
  font-family: var(--mono-paper);
  font-size: 0.94em;
}

.paper-abstract {
  margin-top: 1.7rem;
}

.paper-abstract p {
  margin: 0;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.paper-abstract p + p {
  text-indent: 1.55em;
}

.paper-keywords {
  margin: 1.15rem 0 0;
  text-align: justify;
}

/* Small-caps run-in labels: Abstract:, Keywords: */
.runin {
  font-variant-caps: small-caps;
  letter-spacing: 0.05em;
}

/* ------------------------------------------------------------
   Contents (both the hand-written homepage one and the
   enhance.js-built article one)
   ------------------------------------------------------------ */
.paper-toc,
.toc {
  margin: 2.3rem 0 0;
  padding: 1.05rem 0 1.25rem;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
  background: none;
}

.toc-title,
.toc-label {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.paper-toc ol,
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.paper-toc li,
.toc li {
  counter-increment: toc;
}

.paper-toc li + li,
.toc li + li {
  margin-top: 0.38rem;
}

.paper-toc a,
.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.85em;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.paper-toc a::before,
.toc a::before {
  content: counter(toc);
  min-width: 1.15em;
  font-weight: 700;
}

.toc li::before {
  content: none;
}

.paper-toc a:hover,
.paper-toc a:focus-visible,
.toc a:hover,
.toc a:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

/* ------------------------------------------------------------
   Numbered sections, LaTeX paragraph texture
   ------------------------------------------------------------ */
.page {
  counter-reset: sec;
}

.section {
  margin-top: 2.4rem;
  scroll-margin-top: 5rem;
}

/* The mono eyebrows break the costume; the paper carries numbers instead. */
.page > .section > .section-label {
  display: none;
}

.section h2 {
  margin-bottom: 0.85rem;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.page > .section h2::before {
  counter-increment: sec;
  content: counter(sec);
  display: inline-block;
  min-width: 1.6em;
}

.section h3,
.article h2 {
  margin-bottom: 0.55rem;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0;
}

.article h2 {
  margin-top: 1.9rem;
}

/* Justified prose with \parindent and \parskip=0 — the LaTeX texture. */
.section > p,
.article p,
.intro-copy p {
  max-width: none;
  margin-bottom: 0;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  -webkit-hyphenate-limit-before: 3;
  -webkit-hyphenate-limit-after: 3;
  -webkit-hyphenate-limit-lines: 2;
}

.section > p + p,
.article p + p {
  text-indent: 1.55em;
}

.section > p:last-child,
.article p:last-child {
  margin-bottom: 0;
}

/* Contact reads as an address block, not indented prose. */
#contact > p {
  text-indent: 0;
}

#contact > p + p {
  margin-top: 0.35rem;
}

/* Lists read as itemize: a bit of air above/below, none between items. */
.compact-list,
.simple-list {
  margin: 0.6rem 0 0.9rem;
  padding-left: 1.9em;
}

.compact-list li + li,
.simple-list li + li {
  margin-top: 0.28rem;
}

.compact-list .list-divider {
  list-style: none;
  height: 0;
  margin: 0.7rem 0 0.55rem;
  border-top: 1px solid var(--line);
}

.article ul,
.article ol {
  margin: 0.6rem 0 0.9rem;
  padding-left: 1.9em;
}

.article li + li {
  margin-top: 0.35rem;
}

.article li {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* ------------------------------------------------------------
   Figure 1: the author
   ------------------------------------------------------------ */
.paper-figure {
  float: right;
  width: 204px;
  margin: 0.3rem 0 1.1rem 2rem;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 0;
}

.paper-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.fig-label {
  font-weight: 700;
}

@media (max-width: 700px) {
  .paper-figure {
    float: none;
    width: min(232px, 72%);
    margin: 0.4rem auto 1.3rem;
  }
}

/* ------------------------------------------------------------
   Tables (interest columns as booktabs tabulars)
   ------------------------------------------------------------ */
.table-caption,
.section > p.table-caption {
  margin: 1.6rem auto 0.75rem;
  max-width: none;
  font-size: 0.9rem;
  text-align: center;
  text-indent: 0;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.table-caption::before {
  content: "Table 1.\00A0\00A0";
  font-weight: 700;
}

.interest-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 2.2rem;
  margin: 1.4rem 0 0;
  padding: 0.65rem 0.15rem 0.9rem;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
}

.table-caption + .interest-columns {
  margin-top: 0;
}

.interest-columns h3 {
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.interest-columns .compact-list {
  margin: 0;
  padding-left: 1.25em;
}

.interest-columns .compact-list li + li {
  margin-top: 0.3rem;
}

.interest-columns .compact-list .list-divider {
  border-top: 1px solid var(--line);
}

.interest-columns .link-label,
.interest-columns .link-label-placeholder {
  display: none;
}

.stack-block + .stack-block {
  margin-top: 1.5rem;
}

.interest-columns > .stack-block + .stack-block {
  margin-top: 0;
}

/* ------------------------------------------------------------
   Shared components restyled to paper
   ------------------------------------------------------------ */
.meta-line,
.section-label,
.eyebrow,
.post-date,
.kicker,
.link-label {
  color: var(--muted);
  font-family: var(--mono-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.link-label-placeholder {
  visibility: hidden;
}

/* Non-home pages keep serif titles but in the paper's sans-bold voice. */
.intro-title,
.page-title,
.article-title,
.title-serif {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.24;
}

.intro-title {
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 3.6vw, 2rem);
}

.page-title,
.article-title {
  margin-bottom: 0.9rem;
  padding-bottom: 1.15rem;
  border-bottom: 1.5px solid var(--rule);
  font-size: clamp(1.5rem, 3.8vw, 2.05rem);
}

.article-header {
  padding-top: 0.4rem;
}

.article-header .section-label {
  display: none;
}

.post-date {
  color: var(--text);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.lede,
.lead {
  max-width: none;
  color: var(--text);
  font-size: 1.02rem;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.4rem;
  margin-top: 1.2rem;
}

.inline-links a {
  font-family: var(--mono-paper);
  font-size: 0.9rem;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 2.2rem;
  align-items: start;
  margin-top: 1.4rem;
}

/* \fbox: framed remark */
.note {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  box-shadow: none;
  padding: 0.9rem 1rem;
}

.note p {
  margin-bottom: 0;
}

.note .link-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* Resource lists: arXiv-listing flavor */
.resource-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.resource-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: start;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.resource-item h3 {
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.resource-item h3 a {
  color: var(--accent);
}

.resource-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.resource-meta {
  color: var(--faint);
  font-family: var(--mono-paper);
  font-size: 0.8rem;
  white-space: nowrap;
}

.resource-meta::before {
  content: "[";
}

.resource-meta::after {
  content: "]";
}

.course-list {
  margin-top: 1.25rem;
}

.course-block + .course-block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.course-block h3 {
  margin-bottom: 0.65rem;
  font-size: 1.04rem;
  font-weight: 700;
}

.course-record-list li + li {
  margin-top: 0.45rem;
}

.section-divider {
  height: 0;
  margin: 2.25rem 0 1.75rem;
  border-top: 1px solid var(--line);
}

.section-divider-centered {
  width: min(82ch, 100%);
  margin-left: auto;
  margin-right: auto;
}

.current-affairs-experiments {
  margin-top: 0.25rem;
}

.back-link {
  display: inline-block;
  margin-top: 1.4rem;
  font-family: var(--mono-paper);
  font-size: 0.9rem;
}

.article p:has(> .back-link) {
  text-indent: 0;
}

/* ------------------------------------------------------------
   Footer: back to viewer chrome
   ------------------------------------------------------------ */
.site-footer {
  border-top: none;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 0 2.2rem;
}

.footer-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

:root[data-theme="dark"] .footer-row p {
  color: rgba(255, 255, 255, 0.4);
}

.footer-row a {
  color: rgba(255, 255, 255, 0.75);
}

.footer-row a:hover,
.footer-row a:focus-visible {
  color: #ffffff;
}

.page-top {
  padding-top: 3rem;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .two-column,
  .interest-columns,
  .resource-list li {
    grid-template-columns: 1fr;
  }

  .interest-columns {
    gap: 1.1rem;
  }

  .resource-meta {
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .page,
  .article-shell {
    margin: 0 auto 1.6rem;
    box-shadow: none;
  }

  .site-nav {
    gap: 0.55rem 0.85rem;
  }

  /* Ragged-right below the sheet's comfortable measure. */
  .section > p,
  .article p,
  .article li,
  .paper-abstract p,
  .paper-keywords,
  .lede,
  .lead {
    text-align: left;
  }

  .submit-note {
    margin-bottom: 2.2rem;
  }
}

/* ============================================================
   Article extras (math, sidenotes, anchors) on the sheet
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

.katex-display {
  margin: 1.5rem 0;
  max-width: var(--measure);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.article .katex {
  font-size: 1.03em;
}

.article > p:first-of-type {
  font-size: 1em;
}

.article h2 {
  position: relative;
  scroll-margin-top: 5.5rem;
}

/* Number article subsections like paper sections. */
.article {
  counter-reset: art-sec sidenote;
}

.article h2::before {
  counter-increment: art-sec;
  content: counter(art-sec);
  display: inline-block;
  min-width: 1.6em;
}

.head-anchor {
  position: absolute;
  left: -1.35em;
  top: 0.06em;
  display: inline-block;
  color: var(--faint);
  font-family: var(--mono-ui);
  font-weight: 400;
  font-size: 0.82em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 130ms ease;
}

.article h2:hover .head-anchor,
.head-anchor:focus-visible {
  opacity: 1;
}

@media (max-width: 760px) {
  .head-anchor {
    display: none;
  }
}

/* Sidenotes become footnote-style boxed asides on the sheet. */
.sidenote-ref {
  counter-increment: sidenote;
}

.sidenote-ref::after {
  content: counter(sidenote);
  margin-left: 1px;
  color: var(--accent);
  font-size: 0.62em;
  vertical-align: super;
  line-height: 0;
}

.sidenote {
  float: none;
  width: auto;
  margin: 0.9rem 0;
  padding-left: 0.95rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.5;
}

.sidenote::before {
  content: counter(sidenote);
  margin-right: 0.4em;
  color: var(--accent);
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
}

.footnotes {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9em;
}

.footnotes ol {
  padding-left: 1.1rem;
}

/* Hyperref doesn't decorate external links; neither do we here. */
.article a[data-external]::after,
.prose a[data-external]::after {
  content: none;
}

.aside-note {
  margin: 1.6rem 0;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-style: italic;
  max-width: none;
}

.aside-note p {
  margin-bottom: 0;
  text-indent: 0;
}

/* ------------------------------------------------------------
   Marginalia easter eggs: invisible until the cursor finds them
   ------------------------------------------------------------ */
.section {
  position: relative;
}

.margin-note,
.section > p.margin-note {
  position: absolute;
  width: 11.5rem;
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.4;
  text-align: left;
  text-indent: 0;
  -webkit-hyphens: manual;
  hyphens: manual;
  opacity: 0;
  transition: opacity 420ms ease;
  user-select: none;
}

.margin-note:hover {
  opacity: 1;
}

/* Referee scribbles: red pen in the right margin, slightly askew. */
.ref-note {
  left: calc(100% + 1rem);
  color: #b3372f;
  transform: rotate(-2deg);
}

.ref-note-one {
  transform: rotate(1.4deg);
}

:root[data-theme="dark"] .ref-note {
  color: #e0837a;
}

:root[data-theme="dark"] .ref-note-one {
  color: #9fbf8f;
}

.ref-note-one {
  color: #4a7c3f;
}

/* Fermat, cramped at the bottom of the left margin. */
.fermat-note {
  bottom: 4.2rem;
  right: calc(100% + 1rem);
  width: 10rem;
  color: #8a6a45;
  transform: rotate(-1.2deg);
}

:root[data-theme="dark"] .fermat-note {
  color: #c9b28e;
}

@media (max-width: 1280px) {
  .margin-note {
    display: none;
  }
}

/* --- Print: take the sheet back to actual paper --- */
@media print {
  :root,
  :root[data-theme="dark"] {
    --backdrop: #fff;
    --sheet: #fff;
    --text: #000;
    --muted: #333;
    --faint: #555;
    --rule: #000;
    --accent: #000;
    --accent-hover: #000;
    --line: rgba(0, 0, 0, 0.35);
    --sheet-shadow: none;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .site-header,
  .theme-toggle,
  .site-footer,
  .arxiv-stamp,
  .margin-note {
    display: none;
  }

  .page,
  .article-shell {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .page::after,
  .article-shell::after {
    content: none;
  }

  a {
    text-decoration: none;
  }

  h1,
  h2,
  h3,
  .section-label {
    break-after: avoid-page;
  }
}
