/* Kurrent Pages: typeset like a technical report. One serif family, rules
   instead of boxes, color only for links and for rows that are not ranked.

   Layout rules:
   - One text edge. Section numbers and list markers hang outside it on wide
     screens. On narrow screens they share one indent (--indent).
   - Four type sizes (--text-s to --text-xl). Do not add sizes inline.
   - Vertical space comes from the --space-* scale only. */

@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/stix-two-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/stix-two-text-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/stix-two-text-latin-600-normal.woff2") format("woff2"); }

:root {
  --paper: #ffffff;
  --ink: #1c2128;
  --muted: #5b6470;
  --hair: #d5d9de;
  --link: #1d4f91;
  --flag: #9a5b00;
  --flag-wash: #fbf6ec;

  --measure: 40rem;
  --wide: 60rem;
  --gutter: 1.25rem;
  --indent: 1.5rem;

  /* Type scale: secondary, body, heading, title. */
  --text-s: 0.9375rem;
  --text-m: 1.125rem;
  --text-l: 1.375rem;
  --text-xl: 2.5rem;

  /* Space scale. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
}

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "STIX Two Text", "STIX Two", Georgia, serif;
  font-size: var(--text-m);
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  font-kerning: normal;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
p, ul, ol, dl, pre { margin: 0; }
p + p { margin-top: var(--space-3); }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }

.page { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--space-4) var(--gutter) var(--space-6); }
.page.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }
.page.wide > main > .prose { max-width: var(--measure); }

/* Running head */
.running-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2) var(--space-4); flex-wrap: wrap; font-size: var(--text-s); padding-bottom: var(--space-2); border-bottom: 1px solid var(--hair); }
.running-head a { color: var(--ink); text-decoration: none; }
.running-head a:hover, .running-head a[aria-current="page"] { text-decoration: underline; }
.running-head nav { display: flex; gap: var(--space-4); }
.running-head .home { font-style: italic; }

/* Title block */
.title-block { padding-top: var(--space-6); }
h1 { margin: 0; font-size: var(--text-xl); line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
.subtitle { margin-top: var(--space-2); font-size: var(--text-l); line-height: 1.35; font-style: italic; color: var(--muted); }
.front-matter { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin-top: var(--space-4); font-size: var(--text-s); line-height: 1.5; }
.front-matter dt { color: var(--muted); }
.front-matter dd { margin: 0; }

.abstract { margin-top: var(--space-5); }
.abstract .run-in { font-weight: 600; margin-right: 0.4em; }

/* Sections */
section { margin-top: var(--space-5); }
h2 { position: relative; margin: 0 0 var(--space-3); font-size: var(--text-l); line-height: 1.3; font-weight: 600; }
h2 .num { display: inline-block; min-width: var(--indent); color: var(--muted); font-weight: 400; }
h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-m); font-weight: 600; }

.prose ul, .prose ol { padding-left: var(--indent); }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--text-s); }
p.note { margin-top: var(--space-3); font-size: var(--text-s); color: var(--muted); }

/* Tables set like a paper: thick top and bottom rules, thin rule under the head.
   Every table cell uses --text-s; secondary text is muted, not smaller. */
figure { margin: 0; }
figure + figure { margin-top: var(--space-5); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-s); line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
p.caption { padding-bottom: var(--space-2); font-size: var(--text-s); line-height: 1.5; }
p.caption b { font-weight: 600; margin-right: 0.35em; }
thead tr:first-child th { border-top: 2px solid var(--ink); }
thead th { border-bottom: 1px solid var(--ink); font-weight: 600; vertical-align: bottom; }
tbody:last-of-type tr:last-child td, tbody:last-of-type tr:last-child th { border-bottom: 2px solid var(--ink); }
th, td { padding: var(--space-2) 0.6rem; text-align: right; white-space: nowrap; }
td { vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th.l, td.l { text-align: left; }
td.rank { color: var(--muted); width: 2rem; }
td.engine { white-space: normal; min-width: 14rem; }
.engine .detail { display: block; color: var(--muted); }
td.best { font-weight: 600; }
thead small { display: block; font-size: inherit; font-weight: 400; color: var(--muted); }
th.indicative, td.indicative { color: var(--muted); }

tr.group th { padding-top: var(--space-3); border-top: 1px solid var(--hair); font-weight: 400; font-style: italic; text-align: left; white-space: normal; }
tr.group.flagged th { color: var(--flag); }
tbody.flagged td { background: var(--flag-wash); }
.mark { font-weight: 600; margin-left: 0.15em; }
.mark.flag { color: var(--flag); }
td.status { text-align: left; white-space: normal; padding: var(--space-3) 0; color: var(--muted); }

figcaption.notes { margin-top: var(--space-2); font-size: var(--text-s); line-height: 1.5; color: var(--muted); }
figcaption.notes p + p { margin-top: var(--space-1); }

/* Disclosure */
.disclosure { padding: var(--space-3); border-left: 3px solid var(--flag); background: var(--flag-wash); }

/* Citation */
.cite { position: relative; margin-top: var(--space-3); }
.cite pre { padding: var(--space-3) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); overflow-x: auto; line-height: 1.5; }
.cite button { position: absolute; top: var(--space-2); right: 0; font: inherit; font-size: var(--text-s); color: var(--link); background: var(--paper); border: 1px solid var(--hair); border-radius: 3px; padding: 0.1rem var(--space-2); cursor: pointer; }
.cite button:hover { border-color: var(--link); }

dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); }
dl.defs dt { font-weight: 600; }
dl.defs dd { margin: 0; }

footer { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--hair); font-size: var(--text-s); line-height: 1.5; color: var(--muted); }
footer p + p { margin-top: var(--space-1); }
footer a { color: var(--muted); }

/* Wide screens: hang numbers, markers, and the disclosure rule in the margin,
   so that all text starts on the same edge. */
@media (min-width: 64rem) {
  h2 .num { position: absolute; right: 100%; min-width: 0; padding-right: var(--space-3); }
  .prose ul, .prose ol { padding-left: 0; }
  .disclosure { margin-left: calc(-1 * var(--space-3) - 3px); }
}

@media (max-width: 40rem) {
  :root { --text-m: 1.0625rem; --text-l: 1.25rem; --text-xl: 2.125rem; }
  .title-block { padding-top: var(--space-5); }
  td.engine { min-width: 10rem; }
  .front-matter, dl.defs { grid-template-columns: 1fr; row-gap: 0; }
  .front-matter dd, dl.defs dd { margin-bottom: var(--space-2); }
}

@media print {
  .running-head nav, .cite button { display: none; }
  a { color: var(--ink); }
}
