@font-face {
  font-family: "Latin Modern Math";
  src: url("/assets/fonts/latinmodern-math.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: only light;
  --page: #efede6;
  --surface: #f8f6ef;
  --raised: #e6e1d5;
  --edge: #b8ad99;
  --edge-strong: #80725c;
  --text: #211f1a;
  --muted: #5d5a50;
  --hot: #735315;
  text-rendering: auto;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--hot);
  color: var(--surface);
}

html {
  scroll-padding-top: 12px;
}

body {
  margin: 0;
  background-color: var(--page);
  background-image: url("/assets/paper-grain.png");
  background-repeat: repeat;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.52;
}

a {
  color: var(--hot);
  text-decoration-color: var(--edge-strong);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
summary:focus-visible {
  outline: 1px solid var(--hot);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 10;
  padding: 5px 8px;
  border: 1px solid var(--edge-strong);
  background: var(--raised);
}

.skip-link:focus {
  top: 8px;
}

.masthead {
  padding: 14px;
  border-bottom: 1px solid var(--edge-strong);
  background: var(--surface);
}

.masthead-inner {
  width: min(960px, 100%);
  margin: 0 auto;
}

h1 {
  max-width: none;
  margin: 3px 0 6px;
  color: var(--hot);
  font-family: inherit;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

.publication-breadcrumb {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0 0.4em;
}

.publication-breadcrumb > a {
  color: var(--muted);
  font-size: clamp(13px, 2vw, 17px);
  font-weight: 700;
  line-height: 1.02;
}

.publication-breadcrumb > span {
  color: var(--edge-strong);
  font-size: clamp(16px, 2.5vw, 23px);
}

.publication-breadcrumb h1 {
  min-width: 0;
}

.byline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 22px;
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 48px;
}

.contents {
  position: sticky;
  top: 12px;
  align-self: start;
  padding-right: 12px;
  border-right: 1px solid var(--edge);
}

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

.contents > ol > li {
  counter-increment: toc;
}

.contents > ol > li > a {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 4px;
  padding: 2px 0;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.contents > ol > li > a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--hot);
}

.contents ol ol {
  margin: 1px 0 6px 24px;
  padding: 0 0 0 7px;
  border-left: 1px solid var(--edge);
  list-style: none;
}

.contents ol ol ol {
  margin: 0 0 2px 7px;
}

.contents ol ol a {
  display: block;
  padding: 1px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
  text-decoration: none;
}

.contents ol ol ol a {
  font-size: 11px;
}

.contents a:hover {
  color: var(--text);
}

#article,
article {
  min-width: 0;
}

section {
  scroll-margin-top: 12px;
  margin: 0 0 36px;
}

.major-section {
  margin-bottom: 12px;
}

.major-section[open] {
  padding-bottom: 24px;
}

.major-section > summary {
  padding: 2px 0 8px;
  color: var(--hot);
  cursor: pointer;
}

.major-section > summary::marker {
  color: var(--hot);
}

.major-section > summary h2 {
  display: inline;
  margin: 0 0 0 4px;
}

h2 {
  margin: 2px 0 12px;
  color: var(--hot);
  font-family: inherit;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

h3 {
  margin: 22px 0 7px;
  color: var(--hot);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

h4 {
  margin: 18px 0 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
}

h2[id],
h3[id],
h4[id] {
  scroll-margin-top: 12px;
}

p {
  margin: 0 0 11px;
}

strong {
  font-weight: 700;
}

code,
var {
  font-family: inherit;
}

code {
  color: var(--hot);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

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

sub,
sup {
  line-height: 0;
}

.definition,
.theorem,
.aside,
.technical-detail {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.definition {
  border-top-color: var(--edge-strong);
}

.theorem {
  border-left: 3px solid var(--hot);
}

.definition > :last-child,
.theorem > :last-child,
.aside > :last-child,
.technical-detail > :last-child {
  margin-bottom: 0;
}

.technical-detail summary {
  cursor: pointer;
  color: var(--hot);
  font-size: 11px;
  font-weight: 700;
}

.technical-detail[open] summary {
  margin-bottom: 8px;
}

.formula {
  overflow-x: auto;
  margin: 14px 0;
  padding: 8px 10px;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

.formula > math {
  min-width: max-content;
}

.formula.plain {
  padding-block: 3px;
  border: 0;
  background: transparent;
}

math {
  color: inherit;
  font-family: "Latin Modern Math", math;
}

mtext {
  font-family: "CMU Typewriter", ui-monospace, monospace;
}

.word {
  padding: 0 3px;
  border: 1px solid var(--edge);
  background: var(--raised);
  color: var(--hot);
  font-family: inherit;
  font-size: 0.9em;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.status-grid > div {
  padding: 8px 9px;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.status-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--hot);
  font-size: 11px;
}

.status-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.table-scroll {
  overflow-x: auto;
  margin: 14px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-transform: uppercase;
}

td {
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom-color: var(--edge-strong);
}

.status-table caption {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.status-table thead th:first-child {
  text-transform: none;
}

.status-table th:not(:first-child),
.status-table td {
  text-align: center;
}

.status-table tbody th {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.new-result {
  color: var(--hot);
  font-weight: 700;
}

.tile-table td:first-child {
  color: var(--hot);
}

.tile-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

.steps {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  counter-reset: proof-step;
}

.step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  counter-increment: proof-step;
}

.step::before {
  content: counter(proof-step);
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--edge-strong);
  color: var(--hot);
  font-size: 10px;
}

.step h5 {
  margin: 1px 0 3px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
}

.step p {
  margin-bottom: 5px;
}

.properties {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 12px 0;
}

.properties div {
  padding: 6px;
  border: 1px solid var(--edge);
  background: var(--surface);
  font-size: 10.5px;
  line-height: 1.3;
  text-align: center;
}

.properties math {
  margin-top: 5px;
  font-size: 1.15em;
}

.verdict {
  margin: 16px 0;
  padding: 11px 12px;
  border: 1px solid var(--edge-strong);
  background: var(--raised);
}

.verdict strong {
  display: block;
  margin-bottom: 4px;
  color: var(--hot);
  font-size: 18px;
  line-height: 1.15;
}

.verdict p {
  margin: 0;
}

.artifact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.artifact-list a {
  display: block;
  height: 100%;
  padding: 7px 8px;
  border: 1px solid var(--edge);
  background: var(--raised);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  text-decoration: none;
}

.artifact-list a:hover {
  border-color: var(--edge-strong);
}

.artifact-list b {
  display: block;
  margin-bottom: 2px;
  color: var(--hot);
  font-size: 11px;
}

.references {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ref;
}

.references li {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--muted);
  counter-increment: ref;
  font-size: 11px;
  line-height: 1.38;
}

.references li::before {
  content: "[" counter(ref) "]";
  color: var(--hot);
}

.references cite {
  color: var(--text);
  font-style: normal;
}

footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--edge);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
}

footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  width: min(960px, 100%);
  margin: 0 auto;
}

footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contents {
    position: static;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }

  .contents > ol {
    columns: 2;
    column-gap: 16px;
  }

  .contents > ol > li {
    break-inside: avoid;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .masthead {
    padding: 9px;
  }

  h1 {
    font-size: 28px;
  }

  .shell {
    width: calc(100% - 18px);
    padding-top: 9px;
  }

  .contents > ol {
    columns: 1;
  }

  section {
    margin-bottom: 28px;
  }

  h2 {
    font-size: 21px;
  }

  .status-grid,
  .artifact-list,
  .properties {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding-inline: 4px;
  }
}

@media print {
  :root {
    --page: #fff;
    --surface: #fff;
    --raised: #f2f2f2;
    --edge: #aaa;
    --edge-strong: #333;
    --text: #000;
    --muted: #333;
    --hot: #000;
    color-scheme: light;
  }

  body {
    background-image: none;
    font-size: 10pt;
  }

  .masthead {
    padding-inline: 0;
  }

  .masthead-inner,
  .shell {
    width: 100%;
  }

  .contents,
  footer {
    display: none;
  }

  .shell {
    display: block;
    padding-top: 18px;
  }

  .definition,
  .theorem,
  .aside,
  .technical-detail,
  .verdict {
    break-inside: avoid;
  }

  .technical-detail:not([open]) > :not(summary),
  .major-section:not([open]) > :not(summary) {
    display: block;
  }

  .technical-detail::details-content,
  .major-section::details-content {
    content-visibility: visible;
  }

  .major-section > summary {
    list-style: none;
  }

  .major-section > summary::-webkit-details-marker {
    display: none;
  }

  .major-section > summary h2 {
    display: block;
    margin: 2px 0 12px;
  }

  .formula {
    overflow: visible;
  }

  .formula > math {
    min-width: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
