/* The record is drawn like a seven-lead heartbeat strip: white ground, rose grid, one
   crimson for the thing that matters, steel blue for the rest. */

@font-face { font-family: Archivo; font-weight: 400; src: url(fonts/archivo-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Archivo; font-weight: 600; src: url(fonts/archivo-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Archivo; font-weight: 700; src: url(fonts/archivo-700.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "STIX Two Text"; font-weight: 400; src: url(fonts/stix-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "STIX Two Text"; font-weight: 400; font-style: italic; src: url(fonts/stix-400i.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "STIX Two Text"; font-weight: 600; src: url(fonts/stix-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Source Code Pro"; font-weight: 400; src: url(fonts/sourcecode-400.woff2) format("woff2"); font-display: swap; }

:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #56616d;
  --crimson: #b3152f;
  --rose: #fbeaec;
  --grid: #f0c4cb;
  --steel: #2c5378;
  --pale: #e6edf3;
  --rule: #c9d1d9;
  --sans: Archivo, "Helvetica Neue", Arial, sans-serif;
  --text: "STIX Two Text", "Times New Roman", serif;
  --mono: "Source Code Pro", Consolas, monospace;
  --gutter: max(20px, 5vw, (100vw - 1140px) / 2);
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: #fff; color: var(--ink); font: 18px/1.55 var(--text); }
::selection { background: var(--grid); }
:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }

a { color: var(--steel); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--crimson); }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.012em; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: 0.82em; }
pre { margin: 0 0 1.2em; padding: 14px 16px; background: var(--pale); line-height: 1.5; overflow-x: auto; }
pre code { font-size: 14.5px; }
p code, li code { overflow-wrap: anywhere; }
svg { display: block; max-width: 100%; height: auto; margin-inline: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 2; }

/* Header and footer */

.masthead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 32px; padding: 18px var(--gutter); font-family: var(--sans); font-size: 16px; }
.masthead .name { color: var(--ink); font-weight: 700; text-decoration: none; }
.masthead nav { display: flex; gap: 24px; }
.masthead nav a { color: var(--ink); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.masthead nav a:hover { border-color: var(--grid); }
.masthead nav a[aria-current] { border-color: var(--crimson); font-weight: 600; }
.footer { padding: 28px var(--gutter) 36px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 16px; }
.footer p { margin: 0 0 4px; }

/* Sections of the landing page */

.section { padding: clamp(44px, 6vw, 80px) var(--gutter); }
.section > h2 { margin-bottom: 18px; }
.section > p:not(.actions) { padding-right: max(0px, calc(100% - 44em)); }
.pale { background: var(--pale); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px 64px; align-items: start; }
.split h2 { margin-bottom: 18px; }
.split > div > :last-child { margin-bottom: 0; }

.opening { padding: clamp(20px, 3.5vw, 44px) var(--gutter) 30px; }
.opening .split { align-items: end; }
.opening p:not(.actions) { font-size: 19px; }
.authors { display: flex; flex-wrap: wrap; gap: 4px 28px; list-style: none; margin: 20px 0 0; padding: 0; font: 600 19px/1.35 var(--sans); }
.opening .authors, .document .authors { display: grid; grid-template-columns: max-content max-content; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 0; font-family: var(--sans); font-size: 16px; }
.button { display: inline-block; background: var(--crimson); color: #fff; padding: 11px 18px; text-decoration: none; font-weight: 600; }
.button:hover { background: #8c0f24; color: #fff; }

/* The record */

.record-trace {
  position: relative;
  padding: 10px var(--gutter);
  border-block: 1px solid var(--grid);
  background-color: #fff;
  background-image: url(grid.svg);
}
.trace { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; }
.trace span { font: 600 15px var(--sans); background: #fff; justify-self: start; padding: 1px 6px 1px 0; }
.trace svg { width: 100%; height: clamp(34px, 5.4vh, 50px); }
.trace path { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }


.record-note { margin: 0; padding: 18px var(--gutter) 0; }

/* Tables and figures */

.scroll { overflow-x: auto; margin: 0 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: 18px; line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
th, td { text-align: left; vertical-align: top; padding: 9px 20px 9px 0; border-bottom: 1px solid var(--rule); }
th:last-child, td:last-child { padding-right: 0; }
thead th { font: 600 15px/1.3 var(--sans); border-bottom: 2px solid var(--ink); }
tbody th { font: 600 16px/1.4 var(--sans); white-space: nowrap; }
.pale th, .pale td { border-color: #b9c5d0; }
.pale thead th { border-color: var(--ink); }
.stages { margin-top: 44px; }
.section > :last-child, .split > :last-child { margin-bottom: 0; }
.formula { white-space: nowrap; }
sub, sup { font-size: 0.72em; line-height: 0; }
th code, h2 code, h3 code { font-weight: 400; }
.scroll a:focus-visible, .contents a:focus-visible { outline-offset: -2px; }
figure { margin: 0 0 1.6em; }
figcaption { margin-top: 10px; font-size: 16px; color: var(--muted); text-align: center; text-wrap: balance; }
.narrow-only { display: none; }

/* Pages to read: specification and instructions */

.reading { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 72px; padding: clamp(24px, 4vw, 52px) var(--gutter) 80px; }
.reading > nav { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }
.contents { list-style: none; margin: 0; padding: 0; font: 15px/1.35 var(--sans); }
.contents li { margin: 0 0 9px; }
.contents .level-3 { padding-left: 16px; }
.contents a { color: var(--ink); text-decoration: none; }
.contents a:hover { color: var(--crimson); text-decoration: underline; }
.prose { max-width: 41em; }
.prose h1 { margin-bottom: 0.6em; }
.prose h2 { margin: 2em 0 0.6em; }
.prose h3 { margin: 1.7em 0 0.5em; }
.prose li { margin-bottom: 0.45em; }
.prose > ul, .prose > ol { padding-left: 1.3em; }
.prose li > .math.block { margin-left: -1.3em; }
.math.block { display: block; overflow-x: auto; overflow-y: hidden; margin: 1em 0; padding: 2px 0; }
.math.block .katex-display { margin: 0; }
.katex { font-size: 1.08em; }

@media (max-width: 900px) {
  .reading { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .reading > nav { position: static; max-height: none; border-block: 1px solid var(--rule); padding: 14px 0 6px; }
  .split, .opening .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .prose table:has(thead th:nth-child(3)) { min-width: 620px; }
}
@media (max-width: 620px) {
  .wide-only { display: none; }
  .narrow-only { display: block; max-width: 420px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .opening .authors, .document .authors { display: block; }
  .masthead nav { gap: 18px; }
  .trace { grid-template-columns: 24px minmax(0, 1fr); }
  .trace span { font-size: 0; padding: 0 3px 0 0; }
  .trace span::after { content: attr(data-n); font-size: 15px; }
  .trace svg { height: 36px; }
  .trace path { stroke-width: 1; }
  table { font-size: 16px; }
  th, td { padding-right: 12px; }
  tbody th { white-space: normal; }
  table:not(:has(th:nth-child(3))) td code { overflow-wrap: anywhere; }
  .parts thead { display: none; }
  .parts tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .parts th, .parts td { display: block; border: 0; padding: 0 0 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* The documents, on screen */

.document .cover { padding: clamp(28px, 5vw, 64px) var(--gutter) 26px; }
.document .cover p { margin: 0 0 12px; }
.document .cover .name { font: 600 18px var(--sans); }
.document .contents .level-1 { font-weight: 700; margin-top: 18px; }
.document .contents .level-1:first-child { margin-top: 0; }
.document .prose h1 { font-size: clamp(30px, 4vw, 42px); margin-top: 1.6em; }
.document .prose h1:first-child { margin-top: 0; }
.document .prose > h2:first-child { margin-top: 0; }
