:root {
  --paper: #F6F1E7;
  --card: #FCF9F2;
  --ink: #191410;
  --ink-2: #57503F;
  --ink-3: #8E8570;
  --rule: #D9D0BD;
  --rule-soft: #E7E0CF;
  --leather: #C1440E;
  --leather-deep: #9A3106;
  --blue: #005A9C;
  --blue-soft: rgba(0, 90, 156, 0.16);
  --gold: #B98A12;
  --sage: #5E7F63;
  --sans: 'Archivo', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --side-w: 340px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--appnav-h, 0px) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -12%, rgba(0, 90, 156, 0.06), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(25, 20, 16, 0.012) 3px 4px);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--blue); text-underline-offset: 3px; text-decoration-color: rgba(0, 90, 156, 0.35); }
a:hover { color: var(--leather); }
.nw { white-space: nowrap; }
.mono { font-family: var(--mono); letter-spacing: 0.07em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; line-height: 1; }
h1 em, h2 em { font-weight: 500; font-style: italic; color: var(--blue); }
:focus-visible { outline: 2px solid var(--leather); outline-offset: 2px; }
.ref {
  font: 600 0.62em/1 var(--mono); vertical-align: super; margin-left: 0.15em;
  text-decoration: none; color: var(--leather);
}

/* ── Layout: narrow side column, full-height picture ── */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
.side {
  position: sticky; top: var(--appnav-h, 0px);
  height: calc(100vh - var(--appnav-h, 0px)); height: calc(100dvh - var(--appnav-h, 0px));
  overflow-y: auto; background: var(--card); border-right: 3px double var(--ink);
}
.side-inner { padding: 22px 22px 26px; }
.kicker { font-size: 0.64rem; font-weight: 500; color: var(--leather); margin: 0 0 10px; }
.side h1 {
  font-weight: 900; font-size: 2.55rem; line-height: 0.95; letter-spacing: -0.03em;
  text-transform: uppercase; margin-bottom: 14px;
}
.lede { margin: 0 0 16px; font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; }

.box { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 6px 0 8px; margin-bottom: 14px; }
.box-head { font-size: 0.6rem; color: var(--ink-3); margin: 0 0 4px; }
/* Columns size to their numbers, so 2,855.1 never runs into 3,052 in a narrow column. */
.totals { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 6px 10px; margin: 0; }
.totals div { min-width: 0; }
.totals dt { font: 500 0.56rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.totals dd { margin: 0; font: 600 1.02rem/1.25 var(--mono); color: var(--ink); white-space: nowrap; }
.totals dd.hl { color: var(--blue); }

.readout {
  background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--blue);
  border-radius: 4px; padding: 10px 12px; font-size: 0.86rem; color: var(--ink-2); margin-bottom: 14px;
  min-height: 8.5rem;
}
.readout h3 { font: 800 1.05rem/1.2 var(--sans); color: var(--ink); text-transform: uppercase; letter-spacing: -0.01em; margin: 0 0 4px; }
.readout h3 small { font: 500 0.64rem var(--mono); color: var(--ink-3); letter-spacing: 0.06em; margin-left: 6px; }
.readout .line { font: 500 0.78rem/1.5 var(--mono); color: var(--ink); margin: 0 0 6px; }
.readout ul { list-style: none; margin: 0; padding: 0; }
.readout li { padding: 2px 0 2px 14px; position: relative; line-height: 1.4; }
.readout li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.readout li.gold::before { background: var(--gold); }
.readout li.blue::before { background: var(--blue); }
.readout li.red::before { background: var(--leather); border-radius: 0; width: 7px; height: 2px; top: 0.72em; }
.readout .hint { font: 0.66rem var(--mono); color: var(--ink-3); margin: 6px 0 0; letter-spacing: 0.04em; }

.toc { display: grid; gap: 2px; font-size: 0.66rem; margin: 0 0 16px; }
.toc a { color: var(--ink-2); text-decoration: none; padding: 3px 0; border-bottom: 1px dotted var(--rule); }
.toc a span { color: var(--leather); display: inline-block; width: 2.2em; }
.toc a:hover { color: var(--blue); }

.epigraph { margin: 0 0 14px; padding: 0 0 0 12px; border-left: 2px solid var(--gold); }
.epigraph p { margin: 0 0 4px; font-style: italic; font-size: 0.92rem; color: var(--ink); line-height: 1.45; }
.epigraph footer { font-size: 0.74rem; color: var(--ink-3); line-height: 1.45; }
.fine { font-size: 0.58rem; color: var(--ink-3); margin: 0; }

/* ── Main column ── */
.main { min-width: 0; }
.arc-wrap {
  margin: 0; position: relative; display: flex; flex-direction: column;
  height: calc(100vh - var(--appnav-h, 0px)); height: calc(100dvh - var(--appnav-h, 0px));
  min-height: 560px; padding: 10px 14px 8px 8px;
}
.fig-head { display: flex; align-items: baseline; gap: 10px; padding: 2px 0 0 10px; flex-wrap: wrap; }
.sec-no { font-size: 0.72rem; font-weight: 600; color: var(--leather); }
.fig-title { font-weight: 900; font-size: 1.05rem; text-transform: uppercase; letter-spacing: -0.01em; }
.fig-sub { font-size: 0.6rem; color: var(--ink-3); }
.chart { flex: 1; min-height: 0; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.6rem; color: var(--ink-2); padding: 6px 10px 0; }
.legend i { display: inline-block; width: 14px; height: 9px; vertical-align: -1px; margin-right: 5px; border-radius: 1px; }
.legend i.line { height: 0; border-top: 2px dashed var(--ink-2); width: 16px; vertical-align: 3px; }
.legend i.dot { width: 9px; height: 9px; border-radius: 50%; }
.legend i.ring { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: transparent; }

svg text { font-family: var(--mono); }
.ax text { font-size: 10.5px; fill: var(--ink-3); }
.ax line { stroke: var(--rule-soft); }
.ax .base { stroke: var(--ink-2); }
.ax .lbl { font-size: 10px; fill: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; }
.rowlbl { font-size: 9.5px; fill: var(--ink-2); letter-spacing: 0.05em; text-transform: uppercase; }
.rowline { stroke: var(--rule-soft); }
.yr { font-size: 11px; fill: var(--ink); font-weight: 600; }
.age { font-size: 9.5px; fill: var(--ink-3); }
.val { font-size: 10px; fill: var(--ink-2); }
.val.big { font-size: 10.5px; font-weight: 600; fill: var(--ink); }
.halo { paint-order: stroke; stroke: var(--paper); stroke-width: 3.5px; stroke-linejoin: round; }

.gap { fill: var(--blue-soft); }
.gap.worse { fill: rgba(193, 68, 14, 0.2); }
.lgline { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 4 3; }
.eraline { fill: none; stroke: var(--blue); stroke-width: 2.2; }
.eradot { fill: var(--blue); stroke: var(--paper); stroke-width: 1.5; }
.eradot.unq { fill: var(--paper); stroke: var(--blue); stroke-width: 1.8; }
.bar-ip { fill: var(--blue); }
.bar-k { fill: var(--leather); }
.bar-ip.short, .bar-k.short { opacity: 0.55; }

.badge rect { rx: 2px; }
.badge text { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-anchor: middle; dominant-baseline: central; }
.b-gold rect, .b-gold circle { fill: var(--gold); } .b-gold text { fill: #fff; }
.b-blue rect, .b-blue circle { fill: var(--blue); } .b-blue text { fill: #fff; }
.b-ink rect, .b-ink circle { fill: var(--ink); } .b-ink text { fill: var(--paper); }
.b-line rect, .b-line circle { fill: var(--card); stroke: var(--ink-2); stroke-width: 1; } .b-line text { fill: var(--ink); }
.b-star { fill: var(--blue); }
.il { stroke: var(--leather); stroke-width: 2; }
.mark-t { font-size: 9px; fill: var(--ink); font-weight: 600; text-anchor: middle; }
.mark-d { fill: var(--ink); }

.col { fill: transparent; cursor: pointer; }
.col.hot { fill: rgba(0, 90, 156, 0.06); }
.col.sel { fill: rgba(185, 138, 18, 0.11); }
.colg:focus { outline: none; }
.colg:focus-visible .col { stroke: var(--leather); stroke-width: 1.5; }

.tip {
  position: absolute; pointer-events: none; z-index: 20; background: var(--card); border: 1px solid var(--ink);
  border-radius: 3px; padding: 7px 9px; font: 11.5px/1.45 var(--mono); color: var(--ink);
  box-shadow: 3px 3px 0 rgba(25, 20, 16, 0.12); max-width: 270px;
}
.tip b { font-weight: 600; }
.tip .t-h { font: 800 12.5px/1.2 var(--sans); text-transform: uppercase; margin-bottom: 3px; }
.tip .t-s { color: var(--ink-3); font-size: 10.5px; }
.tip table { border-collapse: collapse; margin-top: 3px; }
.tip td { padding: 0 0 0 9px; text-align: right; white-space: nowrap; }
.tip td:first-child { padding: 0; text-align: left; }

/* ── Sections ── */
.panel { padding: 40px 30px 10px; border-top: 3px double var(--ink); }
.panel.wide { max-width: none; }
.panel > h2, .sec-head h2 {
  font-weight: 900; font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -0.02em; text-transform: uppercase;
}
.panel > h2 { margin-bottom: 14px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel h3 { font: 800 1rem/1.2 var(--sans); text-transform: uppercase; margin: 22px 0 8px; letter-spacing: 0.01em; }
.panel p, .prose p { max-width: 44rem; margin: 0 0 12px; }
.prose { max-width: 44rem; }
.panel b { font-family: var(--mono); font-weight: 600; font-size: 0.94em; }
.note { font-size: 0.84rem; color: var(--ink-2); }
.note.prose { max-width: 44rem; }

.fig { position: relative; margin: 18px 0 8px; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; padding: 8px 8px 8px; }
.chart-pitch { height: clamp(360px, 58vh, 560px); }
.chart-stand { min-height: 260px; }
.chart-oct { height: clamp(300px, 46vh, 420px); }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button {
  font: 500 0.6rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  background: transparent; color: var(--ink-2); border: 0; padding: 0.62em 1em; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.seg-pin { position: absolute; top: 8px; right: 10px; z-index: 5; }

.pt-ff { fill: var(--blue); } .pt-sl { fill: var(--leather); } .pt-cu { fill: var(--gold); }
.pt-ch { fill: var(--ink-2); } .pt-fs { fill: var(--sage); } .pt-ot { fill: var(--ink-3); }
.ln-ff { stroke: var(--blue); } .ln-sl { stroke: var(--leather); } .ln-cu { stroke: var(--gold); }
.ln-ch { stroke: var(--ink-2); } .ln-fs { stroke: var(--sage); }
.pline { fill: none; stroke-width: 2.2; }
.pdot { stroke: var(--card); stroke-width: 1.4; }
.seglbl { font-size: 9.5px; fill: #fff; text-anchor: middle; dominant-baseline: central; font-weight: 500; }
.eraDiv { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.eraDivT { font-size: 9.5px; fill: var(--ink-2); letter-spacing: 0.06em; }
.endlbl { font-size: 10.5px; font-weight: 600; }

.sw { fill: var(--ink-3); stroke: var(--card); stroke-width: 0.8; }
.sw.rp { fill: var(--card); stroke: var(--ink-3); stroke-width: 1.2; }
.sw.ck { fill: var(--blue); stroke: var(--card); stroke-width: 1.5; }
.sw.named { fill: var(--ink); }
.sw.rp.named { fill: var(--card); stroke: var(--ink); stroke-width: 1.6; }
.sw:hover, .sw.hot { stroke: var(--leather); stroke-width: 2; }
.swl { font-size: 10.5px; fill: var(--ink); }
.swl.ck { fill: var(--blue); font-weight: 600; font-size: 11.5px; }
.swleader { stroke: var(--ink-3); stroke-width: 0.8; }

.og-ip { fill: var(--blue); }
.og-ip.rel { fill: var(--card); stroke: var(--blue); stroke-width: 1.2; }
.og-er { fill: var(--leather); }
.og-ws { fill: rgba(185, 138, 18, 0.14); }
.og-yr { font-size: 10.5px; fill: var(--ink); font-weight: 600; text-anchor: middle; }
.og-rd { font-size: 8.5px; fill: var(--ink-3); text-anchor: middle; }
.og-won { font-size: 9.5px; fill: var(--gold); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.og-ref { stroke: var(--ink-2); stroke-dasharray: 3 3; stroke-width: 1; }

.table-scroll { overflow-x: auto; max-width: 100%; }
table.marks, table.rank { border-collapse: collapse; font-size: 0.86rem; margin: 6px 0 10px; min-width: 100%; }
table.rank { min-width: 0; width: 100%; max-width: 46rem; }
table caption { text-align: left; font-size: 0.6rem; color: var(--ink-3); padding: 0 0 4px; }
table th { text-align: left; font: 500 0.6rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 2px solid var(--ink); padding: 4px 8px 4px 0; }
table td { border-bottom: 1px solid var(--rule-soft); padding: 5px 8px 5px 0; vertical-align: top; }
table td.n, table th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
table td.d { font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }
table tr.ck td { background: var(--blue-soft); font-weight: 600; }
table.marks td:last-child { font-family: var(--mono); font-size: 0.78rem; }
.tag { font: 600 0.55rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-left: 6px; }

.sources { padding-bottom: 20px; }
.cites { padding-left: 22px; font-size: 0.88rem; color: var(--ink-2); max-width: 50rem; }
.cites li { margin-bottom: 10px; }
.cites code, .note code { font-size: 0.78em; word-break: break-all; }
.cites a { overflow-wrap: anywhere; }
.endpoints { margin: 6px 0 0; padding-left: 16px; }
.endpoints li { margin-bottom: 4px; }

.changelog { padding: 6px 30px 3rem; font: 0.64rem/1.7 var(--mono); letter-spacing: 0.03em; color: var(--ink-3); }
.changelog h2 { text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); margin: 0 0 0.4rem; font-size: 0.64rem; }
.changelog ul { list-style: none; margin: 0; padding: 0; }
.changelog time { color: var(--leather); margin-right: 0.5rem; }

@media (max-width: 1100px) { :root { --side-w: 300px; } .side h1 { font-size: 2.2rem; } }
@media (max-width: 860px) {
  .layout { display: block; }
  .side { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 3px double var(--ink); }
  .side-inner { padding: 20px 16px; }
  .side h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .readout { min-height: 0; }
  .arc-wrap { height: 92vh; min-height: 620px; padding: 8px 6px 6px 2px; }
  .panel { padding: 30px 16px 8px; }
  .changelog { padding: 6px 16px 3rem; }
  .fig { padding: 6px 4px; }
  .seg-pin { position: static; display: flex; width: max-content; max-width: 100%; margin: 0 0 6px auto; }
  .chart-pitch { height: 380px; }
}
@media (max-width: 420px) {
  .totals dd { font-size: 0.92rem; }
  table.marks, table.rank { font-size: 0.8rem; }
}

/* ── Photo (Wikimedia Commons; credited in the caption and Sources) ── */
.photo { margin: 0 0 14px; }
.photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
  object-fit: cover; object-position: 50% 10%;
  border: 1px solid var(--ink); background: var(--rule-soft);
}
.photo figcaption { margin-top: 5px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.02em; line-height: 1.5; color: var(--ink-3); }
.photo figcaption a { color: var(--ink-2); }
