:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #606060;
  --rule: #c9c9c9;
  --link: #143f86;
  --paper: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.08rem;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #dce5f5;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #0b2c64;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 10;
  padding: 0.45rem 0.65rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  width: min(65rem, calc(100% - 3rem));
  min-height: 5.4rem;
  margin: 0 auto;
  padding: 1.15rem 0 0.9rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.91rem;
  line-height: 1.35;
}

.author {
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.7rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
}

nav a:hover {
  color: var(--link);
  text-decoration: underline;
}

main {
  width: min(50rem, calc(100% - 3rem));
  margin: 0 auto;
}

.paper-header {
  padding: clamp(3.5rem, 8vw, 6.2rem) 0 2.4rem;
}

h1,
h2 {
  font-weight: 400;
}

h1 {
  margin: 0;
  max-width: 49rem;
  font-size: clamp(2.25rem, 5vw, 3.45rem);
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.date {
  margin: 1.55rem 0 0;
  color: var(--muted);
}

.status {
  max-width: 47rem;
  margin: 0.75rem 0 0;
  color: #3f3f3f;
  font-style: italic;
}

section {
  margin: 0;
  padding: 2.25rem 0 2.7rem;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 1.15rem;
  font-size: 1.55rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.math {
  font-style: italic;
  white-space: nowrap;
}

.theorem {
  margin: 2.2rem 0;
  text-align: center;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.2;
  font-style: italic;
  white-space: nowrap;
}

.theorem sub {
  font-size: 0.55em;
}

.theorem sup {
  font-size: 0.62em;
}

.primary-links {
  margin: 1.9rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  list-style: none;
}

.primary-links li {
  display: inline;
}

.primary-links li + li::before {
  content: "·";
  margin: 0 0.75rem;
  color: var(--muted);
}

.resources {
  margin: 1.4rem 0 0;
  border-top: 1px solid var(--rule);
}

.resources > div {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid #dddddd;
}

.resources dt,
.resources dd {
  margin: 0;
}

.references {
  margin: 0;
  padding-left: 1.45rem;
}

.references li {
  padding-left: 0.35rem;
}

.references li + li {
  margin-top: 0.85rem;
}

footer {
  width: min(65rem, calc(100% - 3rem));
  margin: 2rem auto 0;
  padding: 1rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.84rem;
}

footer span + span::before {
  content: "·";
  margin-right: 0.4rem;
}

@media (max-width: 42rem) {
  body {
    font-size: 1rem;
    line-height: 1.65;
  }

  .site-header,
  main,
  footer {
    width: min(50rem, calc(100% - 2rem));
  }

  .site-header {
    min-height: 0;
    padding: 1.1rem 0 0.8rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  nav {
    justify-content: flex-start;
    gap: 1.25rem;
  }

  .paper-header {
    padding: 2.8rem 0 2rem;
  }

  h1 {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
    line-height: 1.12;
  }

  section {
    padding: 1.9rem 0 2.2rem;
  }

  .primary-links {
    display: block;
  }

  .primary-links li {
    display: block;
  }

  .primary-links li + li {
    margin-top: 0.45rem;
  }

  .primary-links li + li::before {
    content: none;
  }

  .resources > div {
    grid-template-columns: 1fr;
    gap: 0.12rem;
    padding: 0.72rem 0;
  }

  .resources dt {
    font-weight: 600;
  }

  footer {
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
