/* TR-001: styled like a preprint that came off a LaTeX press. Serif body,
   justified text, numbered display equations, theorem environments. */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --grey: #666666;
  --grey-lt: #999999;
  --hair: #e4e4e2;
  --serif: 'STIX Two Text', 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }

.wp-bar {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 760px; margin: 0 auto;
  padding: 1.2rem 1.5rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .06em;
  color: var(--grey);
  border-bottom: 1px solid var(--hair);
}
.wp-back { text-decoration: none; }
.wp-back:hover { color: var(--ink); }

.wp {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.4rem 1.5rem 4rem;
}

/* ---- title block ---- */
.wp-head { text-align: center; margin-bottom: 3rem; }
.wp-head h1 {
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.35;
  margin-bottom: 1rem;
}
.wp-sub { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; color: var(--grey); margin-bottom: .5rem; }
.wp-auth { font-size: .95rem; font-style: italic; color: var(--grey); margin-bottom: 2rem; }
.wp-abstract {
  text-align: left;
  max-width: 58ch;
  margin: 0 auto;
  padding: 1.1rem 1.4rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.wp-abstract h3 {
  font-size: .8rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  text-align: center; margin-bottom: .6rem;
}
.wp-abstract p { font-size: .92rem; line-height: 1.6; text-align: justify; hyphens: auto; }

/* ---- sections ---- */
.wp section { margin-top: 2.6rem; }
.wp h2 {
  font-size: 1.18rem; font-weight: 600;
  margin-bottom: 1rem;
}
.wp h3 {
  font-size: 1.02rem; font-weight: 600;
  margin: 1.4rem 0 .7rem;
}
.wp p { text-align: justify; hyphens: auto; margin-bottom: .9rem; }
.wp ul, .wp ol { margin: 0 0 .9rem 1.6rem; }
.wp li { margin-bottom: .35rem; text-align: justify; }

/* inline + display math */
.m { font-style: italic; white-space: nowrap; }
.eq {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem;
  position: relative;
  font-style: italic;
  margin: 1.2rem 0;
  padding: 0 3.4rem;
  text-align: center;
}
.eq .eqno {
  position: absolute; right: 0;
  font-style: normal;
  font-size: .9rem; color: var(--grey);
}

/* theorem environments */
.thm { margin: 1.1rem 0; text-align: justify; }
.thm .thm-label { font-weight: 600; font-style: normal; }
.thm.def { }
.thm.theo, .thm.prop, .thm.lem { font-style: italic; }
.thm.theo .thm-label, .thm.prop .thm-label, .thm.lem .thm-label { font-style: normal; }
.thm.rem { font-size: .95rem; }
.proof { margin: .9rem 0 1.2rem; text-align: justify; }
.proof .thm-label { font-style: italic; font-weight: 400; }
.proof .qed { float: right; }

/* table */
.wp-table {
  border-collapse: collapse;
  margin: 1.4rem auto;
  font-size: .9rem;
}
.wp-table caption {
  caption-side: top;
  font-size: .84rem; color: var(--grey);
  margin-bottom: .5rem;
}
.wp-table th, .wp-table td {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: .45rem .9rem;
  text-align: left;
}
.wp-table thead th { border-bottom: 1px solid var(--ink); font-weight: 600; }
.wp-table tbody tr th, .wp-table tbody tr td { border-top: none; border-bottom: 1px solid var(--hair); }
.wp-table tbody tr:last-child th, .wp-table tbody tr:last-child td { border-bottom: 1px solid var(--ink); }

/* code */
pre.code {
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.55;
  background: #f6f6f4;
  border: 1px solid var(--hair);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.2rem 0;
}

/* footnotes + references */
sup.fn { font-size: .7em; }
.fnote { font-size: .82rem; color: var(--grey); border-top: 1px solid var(--hair); padding-top: .5rem; }
.refs { margin-left: 1.8rem; }
.refs li { font-size: .9rem; margin-bottom: .5rem; }

.wp-foot {
  max-width: 760px; margin: 0 auto;
  padding: 1.4rem 1.5rem 3rem;
  border-top: 1px solid var(--hair);
  font-family: var(--mono); font-size: .7rem; color: var(--grey-lt);
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wp p, .wp li, .thm, .proof { text-align: left; hyphens: none; }
  .eq { padding: 0 2.2rem; font-size: .95rem; }
}

@media print {
  .wp-bar, .wp-foot { display: none; }
  body { font-size: 11pt; }
  .wp { max-width: none; padding: 0; }
}
