/*
  The design system: a surveyor's register.

  Paper, ink and one signal colour. The signal (vermilion) is kept for what is still open,
  which is also what a visitor can do something about.

  The kind of line says how much is known, as on a technical drawing:
    solid   proved in Lean
    dashed  claimed in the literature, not proved here
    dotted  open
  A status is never shown by colour alone: it always has a shape and a word.
*/

:root {
  --paper: #f3f0e8;
  --sheet: #fbf9f4;
  --sunk: #e9e5da;
  --ink: #14161b;
  --ink-2: #474c57;
  --ink-3: #6f7480;
  --line: rgba(20, 22, 27, 0.15);
  --line-2: rgba(20, 22, 27, 0.34);
  --grid: rgba(20, 22, 27, 0.04);
  --signal: #d9391f;
  --signal-ink: #b22a12;
  --signal-wash: rgba(217, 57, 31, 0.075);
  --on-signal: #fff;
  --proved: #17734a;
  --proved-wash: rgba(23, 115, 74, 0.09);
  --claimed: #b9820c;
  --claimed-ink: #7d5600;
  --claimed-wash: rgba(185, 130, 12, 0.12);
  --shadow: rgba(20, 22, 27, 0.12);
  --kw: #2a48ad;
  --attr: #7b3f9e;
  --str: #17734a;
  --lit: #8a5200;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1014;
    --sheet: #15181e;
    --sunk: #090b0e;
    --ink: #ece8de;
    --ink-2: #aeb2bb;
    --ink-3: #868b96;
    --line: rgba(236, 232, 222, 0.15);
    --line-2: rgba(236, 232, 222, 0.34);
    --grid: rgba(236, 232, 222, 0.035);
    --signal: #ff6b4a;
    --signal-ink: #ff8a6e;
    --signal-wash: rgba(255, 107, 74, 0.1);
    --on-signal: #1a0a05;
    --proved: #5ccb94;
    --proved-wash: rgba(92, 203, 148, 0.1);
    --claimed: #e8b04a;
    --claimed-ink: #efc06a;
    --claimed-wash: rgba(232, 176, 74, 0.11);
    --shadow: rgba(0, 0, 0, 0.5);
    --kw: #93abff;
    --attr: #cda2f2;
    --str: #84d6a8;
    --lit: #e8b04a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1014;
  --sheet: #15181e;
  --sunk: #090b0e;
  --ink: #ece8de;
  --ink-2: #aeb2bb;
  --ink-3: #868b96;
  --line: rgba(236, 232, 222, 0.15);
  --line-2: rgba(236, 232, 222, 0.34);
  --grid: rgba(236, 232, 222, 0.035);
  --signal: #ff6b4a;
  --signal-ink: #ff8a6e;
  --signal-wash: rgba(255, 107, 74, 0.1);
  --on-signal: #1a0a05;
  --proved: #5ccb94;
  --proved-wash: rgba(92, 203, 148, 0.1);
  --claimed: #e8b04a;
  --claimed-ink: #efc06a;
  --claimed-wash: rgba(232, 176, 74, 0.11);
  --shadow: rgba(0, 0, 0, 0.5);
  --kw: #93abff;
  --attr: #cda2f2;
  --str: #84d6a8;
  --lit: #e8b04a;
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 1px; }
::selection { background: var(--ink); color: var(--paper); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0 0 12px; }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--sunk); padding: 1px 5px; border-radius: 2px; }
.muted { color: var(--ink-2); }
.tag { font: 500 11px/1.3 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.fine { font-size: 13.5px; color: var(--ink-2); }
.empty { color: var(--ink-2); font-style: italic; font-family: var(--serif); font-size: 17px; }

/* Notation: arrows are drawn, not typeset, so that they look the same in every face. */
.arr { white-space: nowrap; }
.arr i {
  display: inline-block; overflow: hidden; text-indent: -9em;
  width: 0.34em; height: 0.74em; margin: 0 0.035em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 22'%3E%3Cpath d='M5 21V2.4M1.3 7.2 5 2l3.7 5.2' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 22'%3E%3Cpath d='M5 21V2.4M1.3 7.2 5 2l3.7 5.2' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dg { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.dg span + span { margin-left: 0.16em; }
sub { font-size: 0.62em; line-height: 0; vertical-align: -0.28em; font-variant-numeric: lining-nums; }

/* ---------- status ---------- */

.st { display: inline-flex; align-items: center; gap: 7px; font: 500 13px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; }
.st::before { content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%; }
.st.proved::before { background: var(--proved); }
.st.claimed::before { border: 1.5px dashed var(--claimed); }
.st.open::before { border: 2px dotted var(--signal); }
.st.nonstandard::before { border: 1.5px solid var(--signal); border-radius: 1px; transform: rotate(45deg) scale(0.8); }
.st.proved { color: var(--ink); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 14.5px/1 var(--sans); padding: 12px 18px; border-radius: 2px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line-2); }
.btn:active { transform: none; box-shadow: none; }
.btn.signal { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; }

/* A line to copy: what you hand to an agent. */
.cmd { display: flex; align-items: stretch; border: 1px solid var(--ink); background: var(--sheet); border-radius: 2px; max-width: 100%; }
.cmd::before { content: "›"; flex: none; display: grid; place-items: center; padding: 0 2px 2px 14px; font: 700 16px var(--mono); color: var(--signal-ink); }
.cmd code { flex: 1; min-width: 0; padding: 12px 12px 12px 8px; white-space: nowrap; overflow-x: auto; font-size: 13px; background: none; scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.cmd button { flex: none; border: 0; border-left: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 500 13px var(--sans); padding: 0 16px; cursor: pointer; }
.cmd button:hover { background: var(--signal); color: var(--on-signal); }

/* ---------- header and footer ---------- */

.bar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
.bar .wrap { display: flex; align-items: center; gap: 8px 26px; min-height: 60px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 21px/1 var(--serif); letter-spacing: -0.01em; }
.wordmark svg { width: 26px; height: 26px; }
.bar nav { display: flex; gap: 22px; flex: 1; font-size: 14.5px; }
.bar nav a { color: var(--ink-2); text-decoration: none; padding: 19px 0 17px; border-bottom: 2px solid transparent; white-space: nowrap; }
.bar nav a:hover { color: var(--ink); }
.bar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.bar .tools { display: flex; align-items: center; gap: 8px; }
.search-btn { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--sheet); color: var(--ink-3); font: 13.5px var(--sans); cursor: pointer; }
.search-btn:hover { border-color: var(--line-2); color: var(--ink); }
.search-btn svg { width: 14px; height: 14px; }
kbd { display: inline-block; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: 11px; line-height: 17px; color: var(--ink-2); background: var(--paper); }

main { min-height: 62vh; padding-bottom: 40px; }
.foot { margin-top: 96px; border-top: 1px solid var(--ink); background: var(--sheet); padding: 34px 0 44px; font-size: 14px; color: var(--ink-2); }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.foot .colophon { font: 400 17px/1.5 var(--serif); color: var(--ink); max-width: 46ch; }
.foot nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; align-content: start; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }

/* ---------- section head: a ruled edge with tick marks ---------- */

.sec { position: relative; margin: 92px 0 30px; padding-top: 22px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 20px; align-items: baseline; }
.sec::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 8px) top left / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 40px) top left / 100% 9px no-repeat;
}
.sec .no { font: 500 12px/1 var(--mono); letter-spacing: 0.06em; color: var(--signal-ink); }
.sec h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; }
.sec p { grid-column: 2; margin: 10px 0 0; color: var(--ink-2); max-width: 64ch; }
.sec.first { margin-top: 28px; }

/* ---------- sheets ---------- */

.sheet { background: var(--sheet); border: 1px solid var(--line-2); border-radius: 2px; padding: 20px 22px 22px; min-width: 0; }
.sheet > .tag { display: block; margin-bottom: 12px; }
.sheet h3 { font-size: 23px; line-height: 1.2; margin-bottom: 8px; }
.sheet > :last-child { margin-bottom: 0; }
.sheet.open { border: 1.5px dotted var(--signal); background: linear-gradient(var(--signal-wash), var(--signal-wash)), var(--sheet); }
.sheet.open > .tag { color: var(--signal-ink); }
.sheet.ink { border-color: var(--ink); box-shadow: 6px 6px 0 var(--shadow); }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.cols.three { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.cols.two { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 3px; font: 500 12px var(--mono); color: var(--signal-ink); }
.steps li:last-child { padding-bottom: 0; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin-bottom: 8px; }

/* ---------- hero ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 48px; align-items: start; padding: 64px 0 44px; }
.hero .eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.hero .eyebrow::before { content: ""; width: 36px; border-top: 1px solid var(--ink); }
.hero h1 { font-size: clamp(44px, 6.6vw, 86px); line-height: 0.97; letter-spacing: -0.028em; }
.hero h1 em { display: block; color: var(--signal-ink); font-style: italic; font-weight: 400; }
.hero .lede { font: 400 21px/1.5 var(--serif); color: var(--ink-2); margin: 26px 0 28px; max-width: 34em; }
.hero .lede b { color: var(--ink); font-weight: 500; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero .fine { margin: 10px 0 0; max-width: 56ch; }

/* The comparator: pick two numbers, get the proof or the task. */
.cmp { padding: 0; }
.cmp .head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.cmp .picks { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 18px 18px 6px; }
.cmp .picks .vs { font: italic 400 17px var(--serif); color: var(--ink-3); }
.cmp select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  font: 500 17px/1.2 var(--serif); color: var(--ink); background-color: var(--paper);
  border: 1px solid var(--line-2); border-radius: 2px; padding: 11px 30px 11px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 10px 6px; text-overflow: ellipsis;
}
.cmp .quick { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 18px 0; font-size: 13px; }
.cmp .quick button { border: 0; background: none; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.cmp .quick button:hover { color: var(--ink); }
.verdict { margin: 16px 18px 18px; padding: 18px; border: 1px solid var(--line-2); border-left: 3px solid var(--proved); background: var(--paper); }
.verdict.claimed { border: 1px dashed var(--claimed); border-left: 3px dashed var(--claimed); background: linear-gradient(var(--claimed-wash), var(--claimed-wash)), var(--paper); }
.verdict.open { border: 1.5px dotted var(--signal); border-left: 3px dotted var(--signal); background: linear-gradient(var(--signal-wash), var(--signal-wash)), var(--paper); }
.verdict .big { font: 500 clamp(25px, 2.8vw, 34px)/1.15 var(--serif); letter-spacing: -0.015em; margin-bottom: 10px; text-wrap: balance; }
.verdict .big .sym { font-family: var(--mono); font-weight: 400; font-size: 0.8em; padding: 0 0.28em; color: var(--ink-3); }
.verdict.open .big .sym { color: var(--signal-ink); font-weight: 700; }
.verdict p { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-2); }
.verdict .go { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chain { font: 400 17px/1.8 var(--serif); margin-top: 10px; }
.chain .n { white-space: nowrap; }
.chain a.rel { font: 500 13px var(--mono); padding: 2px 5px; margin: 0 1px; border-radius: 2px; text-decoration: none; background: var(--proved-wash); color: var(--proved); }
.chain a.rel.claimed { background: var(--claimed-wash); color: var(--claimed-ink); outline: 1px dashed var(--claimed); }
.chain a.rel:hover { background: var(--ink); color: var(--paper); }
.chain span.rel { font: 500 13px var(--mono); padding: 2px 5px; margin: 0 1px; color: var(--ink-3); }

/* The title block: the figures, laid out as on a drawing. */
.block { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.7fr); border: 1px solid var(--ink); background: var(--sheet); }
.block > div { padding: 14px 18px 16px; border-left: 1px solid var(--line); min-width: 0; }
.block > div:first-child { border-left: 0; }
.block .v { font: 500 42px/1.05 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums; margin-top: 8px; }
.block .v small { font-size: 0.5em; color: var(--ink-3); letter-spacing: 0; }
.block .d { font-size: 13px; line-height: 1.4; color: var(--ink-2); margin-top: 4px; }
.meter { display: flex; gap: 2px; height: 12px; margin: 14px 0 10px; }
.meter i { display: block; min-width: 4px; }
.meter .p { background: var(--ink); }
.meter .c { background: repeating-linear-gradient(135deg, var(--claimed) 0 2px, transparent 2px 5px); outline: 1px dashed var(--claimed); outline-offset: -1px; }
.meter .o { outline: 1.5px dotted var(--signal); outline-offset: -1.5px; background: var(--signal-wash); }
.key { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- the ladder ---------- */

.ladder-wrap { overflow-x: auto; padding: 6px 0 10px; }
.ladder { display: grid; column-gap: 34px; min-width: min-content; }
.spine { grid-column: 1; position: relative; border-left: 2px solid var(--ink); margin-left: 6px; pointer-events: none; }
.spine::before { content: ""; position: absolute; top: -1px; left: -7px; border: 6px solid transparent; border-top: 0; border-bottom: 11px solid var(--ink); }
.zone { grid-column: 1; min-height: 44px; padding-left: 40px; display: flex; align-items: center; }
.rung { grid-column: 1; position: relative; padding: 2px 0 2px 40px; min-width: 0; }
.rung::before { content: ""; position: absolute; left: 6px; top: 50%; width: 24px; border-top: 2px solid var(--ink); }
.rung .name { font: 500 26px/1.2 var(--serif); letter-spacing: -0.012em; }
.rung .name a { text-decoration: none; }
.rung .name a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.rung .alias { font: 400 17px/1.4 var(--serif); color: var(--ink-2); }
.rung .alias a { text-decoration: none; }
.rung .alias a:hover { text-decoration: underline; }
.rung .alias .eq { font-family: var(--mono); font-size: 13px; color: var(--ink-3); padding: 0 6px; }
.step { grid-column: 1; position: relative; padding-left: 40px; min-height: 38px; display: flex; align-items: center; }
.step::before { content: ""; position: absolute; left: 6px; top: 50%; width: 9px; border-top: 1px solid var(--ink-2); }
.step a { font: 400 12px/1 var(--mono); color: var(--ink-3); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.step a b { font-weight: 500; color: var(--proved); background: var(--proved-wash); padding: 3px 5px; border-radius: 2px; }
.step a:hover { color: var(--ink); }
.dim { position: relative; display: block; min-width: 0; padding: 0 0 0 20px; color: inherit; text-decoration: none; }
.dim::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; border-left: 1.5px solid var(--ink-2); }
.dim.no-top::before { top: 0; -webkit-mask: linear-gradient(to bottom, transparent, #000 44px); mask: linear-gradient(to bottom, transparent, #000 44px); }
.dim.no-bot::before { bottom: 0; -webkit-mask: linear-gradient(to top, transparent, #000 44px); mask: linear-gradient(to top, transparent, #000 44px); }
.dim.no-top.no-bot::before { -webkit-mask: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.dim .cap { position: absolute; left: 0; width: 9px; border-top: 1.5px solid var(--ink-2); }
.dim .cap.t { top: 6px; }
.dim .cap.b { bottom: 6px; }
.dim .text { display: block; padding: 6px 0 10px; }
.dim .text b { display: block; font: 500 19px/1.25 var(--serif); }
.dim .text .ln { display: block; margin-top: 5px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.dim:hover .text b { text-decoration: underline; text-decoration-thickness: 1px; }
.claim-range { position: relative; pointer-events: none; }
.claim-range i { position: absolute; left: 10px; top: 6px; bottom: 6px; border-left: 2px dashed var(--claimed); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 9px; }
.legend i { display: inline-block; width: 30px; border-top: 2px solid var(--ink); }
.legend i.c { border-top: 2px dashed var(--claimed); }
.legend i.o { border-top: 2px dotted var(--signal); }

/* ---------- the map: every pair ---------- */

.matrix-wrap { overflow-x: auto; padding-bottom: 6px; }
.matrix { border-collapse: separate; border-spacing: 0; }
.matrix th { font-weight: 400; }
/* A column head is set flat and then turned as a whole, so that arrows and digits turn with it. */
.matrix th.col { position: relative; height: 196px; padding: 0; width: 42px; min-width: 42px; }
.matrix th.col > span { position: absolute; left: 50%; bottom: 10px; transform-origin: 0 50%; transform: rotate(-90deg); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font: 400 15px/1.2 var(--serif); color: var(--ink-2); }
.matrix th.row { text-align: right; padding: 0 14px 0 0; white-space: nowrap; font: 500 16px/1 var(--serif); position: sticky; left: 0; background: var(--paper); z-index: 1; }
.matrix th.row a { text-decoration: none; }
.matrix td { padding: 0; width: 42px; height: 42px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--sheet); }
.matrix tbody tr:first-child td { border-top: 1px solid var(--line-2); }
.matrix td:first-of-type { border-left: 1px solid var(--line-2); }
.matrix td:last-child { border-right-color: var(--line-2); }
.matrix tbody tr:last-child td { border-bottom-color: var(--line-2); }
.matrix td a { display: grid; place-items: center; width: 100%; height: 100%; text-decoration: none; font: 500 15px/1 var(--mono); color: var(--ink); }
.matrix td.claimed a { color: var(--claimed-ink); background: var(--claimed-wash); outline: 1.5px dashed var(--claimed); outline-offset: -6px; }
.matrix td.open a { color: var(--signal-ink); background: var(--signal-wash); outline: 1.5px dotted var(--signal); outline-offset: -6px; font-weight: 700; }
.matrix td.self { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 5px); }
.matrix td a:hover, .matrix td a:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.matrix .hot, .matrix .hot span, .matrix .hot a { color: var(--signal-ink); }
.matrix-note { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 40px; align-items: start; }
.readout { position: sticky; top: 84px; }
.readout .big { font: 500 24px/1.2 var(--serif); margin: 10px 0 8px; min-height: 2.4em; }
.readout .big .sym { font: 400 0.8em var(--mono); padding: 0 0.3em; color: var(--ink-3); }

/* ---------- lists of pairs and tasks ---------- */

.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 4px; text-decoration: none; }
.rows .pair { font: 500 19px/1.3 var(--serif); min-width: 0; }
.rows .pair .sym { font: 400 14px var(--mono); color: var(--ink-3); padding: 0 8px; }
.rows .go { font: 500 13px var(--sans); color: var(--signal-ink); opacity: 0; transform: translateX(-4px); transition: opacity 0.12s, transform 0.12s; }
.rows a:hover .go, .rows a:focus-visible .go { opacity: 1; transform: none; }
.rows a:hover .pair { text-decoration: underline; text-decoration-thickness: 1px; }
.side .rows a { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 11px 2px; }
.side .rows .go { display: none; }
.side .rows .pair { font-size: 17.5px; }
.more { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 500; }

/* Every other number against this one. */
.versus { list-style: none; margin: 0; padding: 0; }
.versus li { border-top: 1px solid var(--line); }
.versus li:first-child { border-top: 0; }
.versus a, .versus li.me > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 4px; text-decoration: none; }
.versus .sym { font: 500 15px var(--mono); text-align: center; color: var(--ink-3); }
.versus .nm { font: 400 18px/1.3 var(--serif); }
.versus a:hover .nm { text-decoration: underline; text-decoration-thickness: 1px; }
.versus li.me { border-top: 0; }
.versus li.me > div { background: var(--ink); color: var(--paper); padding: 9px 12px; margin: 0 -8px; }
.versus li.me + li { border-top: 0; }
.versus li.me .nm { font-weight: 500; }
.versus li.me .sym, .versus li.me .tag { color: inherit; opacity: 0.7; }
.versus .open .sym { color: var(--signal-ink); font-weight: 700; }

/* ---------- number cards ---------- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ncard { display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--sheet); border: 1px solid var(--line-2); border-radius: 2px; padding: 16px 18px 14px; min-height: 190px; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s; }
.ncard:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--shadow); border-color: var(--ink); }
.ncard .top { display: flex; justify-content: space-between; gap: 10px; }
.ncard .name { font: 500 30px/1.1 var(--serif); letter-spacing: -0.018em; margin-top: 6px; }
.ncard .blurb { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ncard .counts { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---------- pages ---------- */

.page-head { padding: 44px 0 30px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: 0.5; }
.page-head h1 { font-size: clamp(38px, 5.6vw, 70px); line-height: 1.02; letter-spacing: -0.025em; }
.page-head h1 .sym { font: 400 0.62em var(--mono); color: var(--ink-3); padding: 0 0.26em; letter-spacing: 0; }
.page-head h1 .sym.open { color: var(--signal-ink); font-weight: 700; }
.page-head .lede { font: 400 21px/1.5 var(--serif); color: var(--ink-2); margin: 18px 0 0; max-width: 40em; }
.page-head .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 20px; }
.banner { padding: 14px 18px; border: 1px solid var(--line-2); border-left: 3px solid var(--proved); background: var(--sheet); margin-bottom: 20px; }
.banner.open { border: 1.5px dotted var(--signal); border-left: 3px dotted var(--signal); background: linear-gradient(var(--signal-wash), var(--signal-wash)), var(--sheet); }
.banner.claimed { border: 1px dashed var(--claimed); border-left: 3px dashed var(--claimed); }
.banner strong { font-weight: 600; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 22px; align-items: start; }
.detail > .col { display: grid; gap: 20px; min-width: 0; }
.detail > .col.side { position: sticky; top: 82px; }
.prose p { font: 400 19.5px/1.62 var(--serif); margin: 0 0 14px; max-width: 38em; }
.prose p.drop::first-letter { font-size: 3.1em; float: left; line-height: 0.82; padding: 0.08em 0.1em 0 0; font-weight: 500; }
.prose p:last-child { margin-bottom: 0; }
.prose code { font-size: 0.78em; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 14px; }
.facts dt { font: 500 11px/1.9 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts dd code { background: none; padding: 0; }

/* The proof path: one theorem per step. */
.path { list-style: none; margin: 0; padding: 0; }
.path li.node { position: relative; padding: 0 0 0 34px; font: 500 23px/1.25 var(--serif); }
.path li.node::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 22px; border-top: 2px solid var(--ink); }
.path li.node a { text-decoration: none; }
.path li.node a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.path li.via { padding: 14px 0 14px 34px; border-left: 2px solid var(--ink); font-size: 14.5px; color: var(--ink-2); }
.path li.via.claimed { border-left: 2px dashed var(--claimed); }
.path li.via .how { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.path li.via .sym { font: 500 14px var(--mono); color: var(--proved); background: var(--proved-wash); padding: 3px 7px; border-radius: 2px; }
.path li.via.claimed .sym { color: var(--claimed-ink); background: var(--claimed-wash); }
.path li.via p { margin: 6px 0 0; font: 400 16.5px/1.5 var(--serif); color: var(--ink-2); max-width: 44em; }

/* ---------- code ---------- */

.code { border: 1px solid var(--line-2); border-radius: 2px; background: var(--sunk); min-width: 0; }
.code .cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--line); }
.code .cap a { text-decoration: none; text-transform: none; letter-spacing: 0.02em; }
.code .cap a:hover { text-decoration: underline; }
.code .cap button { border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; cursor: pointer; }
.code .cap button:hover { color: var(--ink); border-color: var(--line-2); }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 400 13.5px/1.65 var(--mono); tab-size: 2; }
.code pre code { font-size: inherit; }
.sheet .code + * { margin-top: 12px; }
.sheet * + .code { margin-top: 12px; }
.t-kw { color: var(--kw); font-weight: 500; }
.t-at { color: var(--attr); }
.t-str { color: var(--str); }
.t-num { color: var(--lit); }
.t-com { color: var(--ink-3); font-style: italic; }
.t-sorry { color: var(--signal-ink); font-weight: 700; text-decoration: underline wavy var(--signal); text-underline-offset: 4px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: left; padding: 0 16px 8px 4px; border-bottom: 1px solid var(--ink); }
table.list td { padding: 11px 16px 11px 4px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.stmt { font: 400 18px/1.35 var(--serif); }
table.list td.stmt a { text-decoration: none; }
table.list tr:hover td.stmt a { text-decoration: underline; text-decoration-thickness: 1px; }
table.list td code { background: none; padding: 0; color: var(--ink-2); }

/* ---------- search ---------- */

dialog#search { width: min(660px, calc(100vw - 32px)); margin-top: 11vh; padding: 0; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); color: var(--ink); box-shadow: 10px 10px 0 var(--shadow); }
dialog#search::backdrop { background: rgba(8, 9, 12, 0.5); backdrop-filter: blur(3px); }
dialog#search input { width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: inherit; font: 400 22px/1.2 var(--serif); padding: 18px 20px; outline: none; }
dialog#search input::placeholder { color: var(--ink-3); }
dialog#search ul { list-style: none; margin: 0; padding: 6px 0; max-height: min(56vh, 460px); overflow-y: auto; }
dialog#search li a { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 20px; text-decoration: none; }
dialog#search li a .t { font: 400 18px/1.3 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog#search li a code { background: none; color: var(--ink-3); font-size: 12px; }
dialog#search li[aria-selected="true"] a { background: var(--ink); color: var(--paper); }
dialog#search li[aria-selected="true"] a .tag, dialog#search li[aria-selected="true"] a code { color: inherit; opacity: 0.75; }
dialog#search .hint { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
dialog#search .none { padding: 18px 20px; margin: 0; }

#error { margin: 60px 0; padding: 18px 20px; border: 1.5px dotted var(--signal); background: var(--sheet); }

/* ---------- motion ---------- */

::view-transition-old(root) { animation: 0.14s ease both vt-out; }
::view-transition-new(root) { animation: 0.22s ease both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 1020px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 44px; }
  .block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block > div { border-top: 1px solid var(--line); }
  .block > div:nth-child(-n + 2) { border-top: 0; }
  .block > div:nth-child(odd) { border-left: 0; }
  .block > div:last-child { grid-column: 1 / -1; }
  .matrix-note { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .readout { position: static; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail > .col.side { position: static; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .bar .wrap { padding-top: 10px; row-gap: 0; }
  .bar nav { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; gap: 20px; }
  .bar nav::-webkit-scrollbar { display: none; }
  .bar nav a { padding: 12px 0 10px; }
  .bar .tools { margin-left: auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { padding: 0 9px; }
  .sec { grid-template-columns: minmax(0, 1fr); margin-top: 68px; }
  .sec .no { margin-bottom: 8px; }
  .sec p { grid-column: 1; }
  .cmp .picks { grid-template-columns: minmax(0, 1fr); }
  .cmp .picks .vs { text-align: center; }
  .matrix th.row { font-size: 14px; max-width: 116px; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
  .matrix th.col, .matrix td { width: 38px; min-width: 38px; }
  .matrix td { height: 38px; }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .rows a { grid-template-columns: minmax(0, 1fr) auto; }
  .rows .go { display: none; }
  .prose p { font-size: 18px; }
  .rung .name { font-size: 22px; }
}
