/* ryanjamesyork.com — library stylesheet
   Idiom: classic mathematical reference library (numbered chapters, § bars,
   numbered equations, sidebar index box, double rules). Type: RY editorial kit. */

/* Self-hosted type (SIL OFL): Archivo and Newsreader as variable fonts. */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-var.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic-var.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/spacemono-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/spacemono-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/spacemono-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/spacemono-bolditalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --paper: #F5F2EB;
  --ink: #141414;
  --ink-soft: #3a3a3a;
  --box: #e6e6d3;
  --box-edge: #b2b2a4;
  --bar-hi: #ebebd9;
  --bar-lo: #d6d6c1;
  --link: #0000EE;
  --visited: #6040B0;
  --hover: #A02030;
  --red: #E8402A;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Space Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
}

a:link    { color: var(--link); }
a:visited { color: var(--visited); }
a:hover, a:visited:hover { color: var(--hover); }
a:active  { color: var(--link); }
img { border: 0; max-width: 100%; height: auto; }
code, kbd, samp, pre { font-family: var(--mono); font-size: 0.82em; }
pre {
  background: var(--box);
  border: 1px solid var(--box-edge);
  padding: 0.6em 0.9em;
  overflow-x: auto;
  line-height: 1.45;
}
pre code { font-size: 12.5px; }
p code { padding: 0 0.15em; }
hr { border: 0; border-top: 1px solid var(--box-edge); }
sup, sub { line-height: 0; }
abbr { text-decoration: none; }

/* ---------- Skip link (keyboard users) ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--box); border: 1px solid var(--box-edge); padding: 6px 10px; font-family: var(--sans); font-size: 14px; }
.skip:focus { left: 170px; }

/* ---------- Sidebar index box (top-left) ---------- */
.sidebar {
  position: absolute;
  top: 0; left: 0;
  width: 110px;
  padding: 18px 10px 26px 20px;
  background: var(--box);
  border: 1px solid var(--box-edge);
  border-top: 0; border-left: 0;
  border-bottom-right-radius: 14px;
  box-shadow: 2px 2px 5px rgba(0,0,0,.22);
  font-family: var(--sans);
  font-variation-settings: "wdth" 90;
  font-size: 14.5px;
  line-height: 1.15;
}
.sidebar .monogram {
  display: block;
  font-family: var(--sans);
  font-variation-settings: "wdth" 125, "wght" 900;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  margin: 0 0 6px 0;
}
.sidebar .monogram:hover { color: var(--hover); }
.sidebar .monogram small {
  display: block;
  font-variation-settings: "wdth" 100, "wght" 500;
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}
.sidebar ul { list-style: none; margin: 60px 0 0 0; padding: 0; }
.sidebar li { margin: 0 0 1px 0; }
.sidebar a { text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }
.sidebar form { margin: 4px 0 6px 0; }
.sidebar input[type=search] {
  width: 74px; box-sizing: border-box;
  font: 12px var(--mono);
  padding: 2px 3px; margin: 3px 0 2px 0;
  border: 1px inset var(--box-edge);
  background: #fff; color: var(--ink);
  border-radius: 0;
}
.sidebar button {
  font: 700 12px var(--sans);
  padding: 1px 4px;
  border: 1px outset var(--box-edge);
  background: var(--paper); color: var(--ink);
  cursor: pointer; border-radius: 0;
}
.sidebar .about {
  margin-top: 26px;
  font-size: 11.5px;
  font-variation-settings: "wdth" 100;
}

/* ---------- Page frame ---------- */
.page {
  margin-left: 160px;
  padding: 18px 28px 0 10px;
  max-width: 1080px;
}
.page-header { text-align: center; margin: 0 0 8px 0; }
.page-header .up {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  text-decoration: none;
}
.page-header .up-sub {
  display: block;
  font-family: var(--sans);
  font-size: 15px;
  font-variation-settings: "wdth" 90;
  margin-top: 2px;
}
.prevnext {
  display: flex; justify-content: space-between; gap: 1em;
  font-family: var(--sans);
  font-variation-settings: "wdth" 90;
  font-size: 13px;
  padding: 2px 22px 5px 22px;
}
.prevnext a { text-decoration: none; }
.prevnext a:hover { text-decoration: underline; }
.rule-double { border: 0; border-top: 3px double var(--box-edge); margin: 0 0 14px 0; }

/* ---------- Titles ---------- */
h1.title {
  font-family: var(--sans);
  font-variation-settings: "wdth" 125, "wght" 900;
  font-weight: 900;
  font-size: 27px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  text-align: center;
  margin: 8px 0 8px 0;
}
h1.title .chapno {
  display: block;
  font-variation-settings: "wdth" 100, "wght" 500;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.standfirst {
  font-family: var(--serif);
  font-style: normal;
  font-size: 18.5px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 72ch;
  margin: 6px 0 10px 0;
  padding: 0 20px;
}
.standfirst .lead { font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.standfirst.center {
  text-align: center;
  font-family: var(--serif);
  font-size: 17px;
  max-width: none;
  padding: 0;
  margin: 4px 0 8px 0;
}
/* Subject classification line, in the manner of a catalogued reference work:
   monospaced small caps, framed by hairlines. Deliberately not a marketing tagline. */
.subjectline {
  display: block;
  margin: 6px auto 10px auto;
  padding: 7px 0 8px 0;
  max-width: 42rem;
  border-top: 0.5pt solid var(--box-edge);
  border-bottom: 0.5pt solid var(--box-edge);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
}
.subjectline .sep { color: var(--box-edge); margin: 0 0.5em; }
.byline { text-align: center; font-size: 15px; margin: 0 0 4px 0; }
.intro { max-width: 68ch; margin: 10px auto 4px auto; padding: 0 12px; font-size: 16px; line-height: 1.5; text-align: center; }
.byline a { font-family: var(--sans); font-weight: 700; text-decoration: none; }
.byline .affil { display: block; font-size: 13.5px; }
.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Section bars (§) ---------- */
h2.section, h3.subsection {
  font-family: var(--sans);
  letter-spacing: -0.005em;
  margin: 22px 0 10px 0;
  padding: 3px 8px;
  background: linear-gradient(to bottom, var(--bar-lo), var(--bar-hi));
  border-top: 1px solid var(--box-edge);
}
h2.section { font-size: 19px; font-weight: 700; }
h3.subsection {
  font-size: 16px; font-weight: 700;
  background: var(--bar-hi);
  border-top: 1px solid #d0d0bd;
  margin-top: 16px;
}
h4 { font-family: var(--sans); font-size: 15px; font-weight: 700; margin: 16px 0 4px 0; }
.secno { font-weight: 700; }
.anchor, a.anchor:link, a.anchor:visited { color: inherit; text-decoration: none; }
a.anchor:hover { color: var(--hover); }
a.bibref { text-decoration: none; }
a.bibref:hover { text-decoration: underline; }

/* ---------- Contents mini-TOC ---------- */
.contents { margin: 6px 0 14px 20px; }
.contents .label {
  font-weight: 700; font-style: italic;
  font-size: 16px; margin: 0 0 4px 0;
}
.contents table { border-collapse: collapse; }
.contents td { padding: 1px 12px 1px 0; vertical-align: top; }
.contents td.no { font-family: var(--sans); font-variation-settings: "wdth" 90; font-size: 15px; white-space: nowrap; }
.contents td.ti { font-family: var(--sans); font-variation-settings: "wdth" 90; font-size: 15.5px; }
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; }
.contents .sub td.no { padding-left: 1.4em; }

/* ---------- Body text ---------- */
.body { padding: 0 20px; }
.body p { margin: 0 0 0.9em 0; max-width: 72ch; }
.body ul, .body ol { max-width: 68ch; padding-left: 1.6em; }
.body li { margin-bottom: 0.25em; }
.body blockquote {
  margin: 0.6em 0 1em 0; padding: 0.2em 1em;
  border-left: 3px solid var(--box-edge);
  font-size: 16px;
  max-width: 68ch;
}
.body table { border-collapse: collapse; font-size: 14.5px; margin: 0.4em 0 1.2em 0; }
.body table th {
  font-family: var(--sans); font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: left; padding: 4px 10px 3px 4px;
  border-bottom: 1.2pt solid var(--ink);
}
.body table td {
  font-family: var(--serif); font-size: 15px; line-height: 1.4;
  padding: 3px 12px 3px 4px;
  border-bottom: 0.4pt solid var(--box-edge);
  vertical-align: top;
}
.body table td:first-child { white-space: nowrap; }
.body table td.num, .body table td[align=right] {
  text-align: right; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.tablewrap { overflow-x: auto; }
.body dl dt { font-family: var(--sans); font-weight: 700; }
.body dl dd { margin: 0 0 0.6em 1.4em; }

/* ---------- Numbered equations ---------- */
.equation {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  align-items: center;
  margin: 0.6em 0 0.9em 0;
}
.equation .eqno { font-family: var(--mono); font-size: 13px; padding-left: 4px; }
.equation .eqbody { text-align: center; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.equation .eqbody .katex-display { margin: 0; }
.equation .constraint {
  grid-column: 2; text-align: right; font-style: italic; font-size: 15px; padding-right: 1em;
}
.katex { font-size: 1em; }
.equation .katex { font-size: 1.08em; }

/* ---------- Figures ---------- */
figure.figure { margin: 1em 0 1.4em 0; text-align: center; }
figure.figure img { border: 1px solid var(--box-edge); background: #fff; padding: 3px; }
figure.figure figcaption {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.4;
  margin-top: 6px; text-align: left; max-width: 72ch; margin-left: auto; margin-right: auto;
}
figure.figure figcaption .figno { font-weight: 700; }

/* ---------- News / notice boxes ---------- */
.box {
  background: var(--box);
  border: 1px solid var(--box-edge);
  border-radius: 6px;
  box-shadow: inset 0 0 5px rgba(0,0,0,.28), 1px 1px 3px rgba(0,0,0,.15);
  padding: 8px 14px 9px 14px;
  margin: 14px 12px 22px 12px;
}
.box .label { font-weight: 700; font-style: italic; font-size: 16px; margin: 0 0 3px 0; }
.box table { border-collapse: collapse; margin-left: 12px; }
.box td { padding: 0 10px 1px 0; vertical-align: baseline; }
.box td.date { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.box td.item a { font-style: italic; }
.box .more { margin: 2px 0 0 12px; font-style: italic; font-size: 15px; }
.box.notice { font-size: 15px; }
.box.notice p { margin: 0.2em 0; }

/* ---------- Front-page table of contents ---------- */
.toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 0 40px;
  margin: 0 12px 26px 12px;
  font-family: var(--sans);
  font-variation-settings: "wdth" 90;
  font-size: 16.5px;
  line-height: 1.22;
}
.toc table { border-collapse: collapse; width: 100%; }
.toc td { padding: 1px 6px 1px 0; vertical-align: top; }
.toc td.no { text-align: right; width: 3.2em; white-space: nowrap; color: var(--ink); }
.toc td.no.wide { width: 4.6em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .part { font-weight: 700; padding-top: 6px; }
.toc .part a { color: var(--ink); }

.companion {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  margin: 8px 0 26px 24px;
}
.companion a { text-decoration: none; }
.companion a:hover { text-decoration: underline; }

/* ---------- Portrait ---------- */
.portrait { text-align: center; margin: 4px 0 10px 0; }
.portrait img {
  width: 172px; height: auto;
  border: 1px solid var(--box-edge);
  background: #fff; padding: 4px;
  box-shadow: 1px 1px 3px rgba(0,0,0,.15);
}
.portrait-side {
  float: right; width: 190px; margin: 0 0 12px 24px;
}
.portrait-side img {
  width: 100%; border: 1px solid var(--box-edge); background: #fff; padding: 4px; box-sizing: border-box;
}
.portrait-side figcaption { font-family: var(--mono); font-size: 11.5px; line-height: 1.35; margin-top: 5px; }

/* ---------- Finding metadata / citation ---------- */
.meta {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  margin: 0 0 12px 20px; color: var(--ink-soft);
}
.meta b { color: var(--ink); font-weight: 700; }
.meta b.claim { letter-spacing: .06em; }
.findings-list td.ti .where { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }
.cite {
  margin: 26px 12px 8px 12px;
}
.cite pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 4px 0 8px 0; }
.cite .label { font-weight: 700; font-style: italic; font-size: 16px; margin: 0 0 4px 0; }
.digest { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.status-draft { color: var(--red); font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Findings list ---------- */
.findings-list { border-collapse: collapse; margin: 6px 0 16px 20px; }
.findings-list td { padding: 3px 14px 3px 0; vertical-align: top; }
.findings-list td.no { font-family: var(--sans); font-variation-settings: "wdth" 90; white-space: nowrap; }
.findings-list td.date { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.findings-list td.ti a { text-decoration: none; font-family: var(--sans); font-variation-settings: "wdth" 90; font-size: 16px; }
.findings-list td.ti a:hover { text-decoration: underline; }
.findings-list td.ti .abs { display: block; font-size: 14.5px; max-width: 70ch; }

/* ---------- Index of sections ---------- */
.index-cols { columns: 2; column-gap: 40px; font-size: 14.5px; }
.index-cols .letter { font-family: var(--sans); font-weight: 700; font-size: 15px; margin: 10px 0 2px 0; break-after: avoid; }
.index-cols p { margin: 0 0 1px 0; break-inside: avoid; }
.index-cols a { text-decoration: none; }
.index-cols a:hover { text-decoration: underline; }
.index-cols .where { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.footer {
  margin: 30px 0 0 0;
  border-top: 3px double var(--box-edge);
  padding: 6px 0 30px 0;
  font-size: 13.5px;
}
.footer .copy { text-align: center; margin: 4px 0 2px 0; }
.footer .links {
  font-family: var(--mono); font-size: 11.5px; text-align: right;
  margin: 14px 0 0 0; line-height: 1.7;
}
.footer .links a { margin-left: 10px; }
.footer .mark {
  float: left; font-family: var(--sans);
  font-variation-settings: "wdth" 125, "wght" 900; font-weight: 900; font-size: 13px;
  letter-spacing: -0.01em; margin-top: 12px; text-decoration: none; color: var(--ink);
}

/* ---------- Search ---------- */
.search-form input[type=search] {
  font: 15px var(--mono); padding: 4px 6px; width: 24em; max-width: 100%;
  border: 1px inset var(--box-edge); background: #fff; border-radius: 0;
}
.search-form button {
  font: 700 14px var(--sans); padding: 3px 8px;
  border: 1px outset var(--box-edge); background: var(--box); cursor: pointer; border-radius: 0;
}
.results { margin: 12px 0 0 0; }
.results .hit { margin: 0 0 10px 0; }
.results .hit a { font-family: var(--sans); font-variation-settings: "wdth" 90; text-decoration: none; font-size: 16px; }
.results .hit a:hover { text-decoration: underline; }
.results .hit .ctx { font-size: 14.5px; }
.results .hit .where { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: static; width: auto;
    border-radius: 0; border-right: 0;
    padding: 12px 16px 10px 16px;
    box-shadow: none;
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  }
  .sidebar .monogram { margin: 0 8px 0 0; }
  .sidebar .monogram small { display: none; }
  .sidebar ul { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
  .sidebar form { margin: 0; display: inline-flex; gap: 4px; align-items: center; }
  .sidebar input[type=search] { margin: 0; width: 90px; }
  .sidebar .about { margin-top: 0; width: 100%; }
  .footer .links { text-align: left; }
  .footer .links a { margin-left: 0; margin-right: 10px; }
  .page { margin-left: 0; padding: 14px 16px 0 16px; }
  .toc { grid-template-columns: 1fr; }
  .body { padding: 0 4px; }
  .box { margin-left: 0; margin-right: 0; }
  .portrait-side { float: none; width: 172px; margin: 0 auto 14px auto; }
  .standfirst { padding: 0 4px; }
  .index-cols { columns: 1; }
  .equation { grid-template-columns: 4.5em 1fr; }
  .prevnext { padding-left: 4px; padding-right: 4px; }
}
@media print {
  .sidebar, .prevnext, .footer .links { display: none; }
  .page { margin: 0; max-width: none; }
  body { background: #fff; }
}
