/* vilbert.net - one stylesheet, no build step. Tokens first; light is the default, dark by preference. */

@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f3f5f6;        /* cool print paper, not cream */
  --paper-2: #e8ecee;      /* bands: før 2.07, table heads */
  --ink: #132029;
  --ink-2: #34434f;
  --muted: #55636f;
  --rule: #c3ccd2;
  --grid: #dbe1e5;
  --brass: #9a6b0c;        /* the balance line: gold, used once */
  --brass-text: #7a5409;   /* brass as text (stamp, section codes), AA on paper */
  --gain: #0f7d5a;
  --loss: #c63c2c;
  --hatch: #55636f;
  --tip-bg: #ffffff;
  --focus: #1c5db8;
  --shadow: 0 1px 2px rgba(19, 32, 41, .08), 0 6px 18px rgba(19, 32, 41, .08);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #10171d;      /* deep slate, not black */
    --paper-2: #18222a;
    --ink: #e6ebee;
    --ink-2: #bcc7ce;
    --muted: #96a3ad;
    --rule: #303d47;
    --grid: #222e37;
    --brass: #b8892f;
    --brass-text: #d4aa58;
    --gain: #2b9f7c;
    --loss: #e0604f;
    --hatch: #96a3ad;
    --tip-bg: #1b262e;
    --focus: #8ab8ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-kerning: normal;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
img, svg { display: block; max-width: 100%; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 10; background: var(--ink); color: var(--paper); padding: 8px 12px; font: 500 .875rem var(--mono); }
.skip:focus { top: 8px; }

.wrap { max-width: 76rem; margin-inline: auto; padding-inline: clamp(16px, 4vw, 44px); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ masthead: a log header */
.mast { border-top: 4px solid var(--brass); border-bottom: 1px solid var(--rule); }
.mast-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 .8125rem/1 var(--mono); letter-spacing: .16em; }
.brand-mark { width: 20px; height: 20px; }
.mast-meta { margin: 0; font: 400 .8125rem/1.4 var(--mono); color: var(--ink-2); }
.mast-kind { text-transform: uppercase; letter-spacing: .12em; }
.mast-sep { color: var(--muted); margin-inline: 4px; }
#stand { white-space: nowrap; }
@media (max-width: 480px) { .mast-kind, .mast-sep { display: none; } }

/* ------------------------------------------------------------------ hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: clamp(28px, 6vw, 64px) clamp(40px, 6vw, 72px); }
.stamp {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0;
  padding: 5px 10px 4px; border: 1.5px solid var(--brass-text); color: var(--brass-text);
  font: 400 .8125rem/1.3 var(--mono);
}
.stamp strong { font-weight: 500; text-transform: uppercase; letter-spacing: .14em; }
.stamp span { color: var(--ink-2); }
h1 { font: 600 clamp(3.5rem, 11vw, 7rem)/.92 var(--sans); letter-spacing: -.035em; margin: 18px 0 18px; }
.lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.55; max-width: 40rem; margin: 0; color: var(--ink-2); }

.ledger-wrap { width: 100%; }
.ledger { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ledger th, .ledger td { padding: 9px 0; vertical-align: top; border-top: 1px solid var(--rule); }
.ledger thead th { border-top: 0; padding-top: 0; padding-bottom: 10px; text-align: right; font: 500 .75rem/1.35 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
.ledger thead th:first-child { width: 31%; }
@media (max-width: 520px) { .ledger thead th:first-child { width: 25%; } .ledger td { padding-left: 8px; } }
.ledger thead .sub { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-top: 2px; }
.ledger thead .sub .wd { white-space: nowrap; }
.ledger tbody th { text-align: left; font-weight: 400; color: var(--ink-2); font-size: .9375rem; padding-right: 10px; }
.ledger td { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .9375rem; padding-left: 12px; }
.ledger tbody tr:last-child th, .ledger tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
.ledger td { overflow-wrap: normal; }
.ledger .l1 { display: block; white-space: nowrap; }
.ledger tr.ci .l1 { white-space: normal; }
.ledger .l2 { display: block; color: var(--muted); font-size: .8125rem; }
.ledger tr.big td { font-size: clamp(1.375rem, 2.2vw, 1.875rem); font-weight: 500; line-height: 1.15; padding-block: 12px 14px; }
.ledger tr.big th { padding-block: 16px 14px; }
.ledger-note { font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 12px 0 0; max-width: 38rem; }
.noscript { font: 400 .875rem/1.5 var(--mono); border-left: 3px solid var(--brass); padding-left: 10px; color: var(--ink-2); }

.ci-fig { margin: 0; align-self: end; }
.ci-fig figcaption { font-size: .875rem; color: var(--muted); margin-top: 8px; max-width: 30rem; }
.caveat { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: .9375rem; color: var(--ink-2); max-width: 40rem; }
.caveat strong { color: var(--ink); font-weight: 600; }

@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "head ledger" "ci ledger";
          grid-template-rows: auto 1fr; column-gap: clamp(48px, 6vw, 96px); row-gap: 36px; }
  .hero-head { grid-area: head; }
  .hero-ledger { grid-area: ledger; padding-top: 10px; }
  .ci-fig { grid-area: ci; align-self: start; }
}

/* phones: each key figure gets its own label line above the two values (explicit roles keep the table semantics) */
@media (max-width: 520px) {
  .ledger, .ledger thead, .ledger tbody { display: block; }
  .ledger tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .ledger thead th:first-child { display: none; }
  .ledger thead th { padding-bottom: 8px; }
  .ledger thead .sub { white-space: nowrap; font-size: .6875rem; }
  .ledger thead .sub .wd { display: none; }
  .ledger tbody tr { border-top: 1px solid var(--rule); }
  .ledger tbody tr:last-child { border-bottom: 1px solid var(--rule); }
  .ledger tbody th, .ledger tbody td, .ledger tbody tr:last-child th, .ledger tbody tr:last-child td { border: 0; }
  .ledger tbody th { grid-column: 1 / -1; width: auto; padding: 9px 0 1px; font-size: .875rem; }
  .ledger tbody td { padding: 0 0 9px; }
  .ledger tr.big th { padding-block: 12px 0; }
  .ledger tr.big td { padding-block: 2px 12px; }
}
@media (max-width: 360px) { .ledger tr.big td { font-size: 1.25rem; } }

/* ------------------------------------------------------------------ sections: a log with a gutter */
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: clamp(36px, 6vw, 64px); border-top: 1px solid var(--rule); }
.rail .code { margin: 0; font: 500 .8125rem/1 var(--mono); color: var(--brass-text); letter-spacing: .08em; }
.rail-note { display: none; margin: 10px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); max-width: 12rem; }
h2 { font: 600 clamp(1.5rem, 3vw, 2rem)/1.15 var(--sans); letter-spacing: -.015em; margin: 0 0 10px; }
.h3 { font: 500 .8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; margin: 36px 0 10px; color: var(--ink); }
.sec-lede { margin: 0 0 22px; color: var(--ink-2); max-width: 44rem; }
@media (min-width: 900px) {
  .sec { grid-template-columns: 11rem minmax(0, 1fr); column-gap: 40px; }
  .rail { padding-top: 6px; }
  .rail-note { display: block; }
  .body { border-left: 1px solid var(--rule); padding-left: 40px; min-width: 0; }
}

/* ------------------------------------------------------------------ charts */
.chart-fig { margin: 0; }
.chart { position: relative; width: 100%; }
.chart svg { overflow: visible; touch-action: pan-y; }
.chart svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.chart-balance { min-height: 240px; }
.chart-weeks { min-height: 240px; }
.chart text { font-family: var(--mono); fill: var(--muted); font-size: 11px; }
.chart .t-ink { fill: var(--ink); }
.chart .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart .t-ink2 { fill: var(--ink-2); }
.chart .t-strong { fill: var(--ink); font-weight: 500; font-size: 12px; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-zero { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ref { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; }
.chart .vline { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .band-pre { fill: var(--paper-2); }
.chart .hatch-line { stroke: var(--hatch); stroke-width: 1; opacity: .45; }
.chart .line { fill: none; stroke: var(--brass); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { fill: var(--brass); stroke: var(--paper); stroke-width: 2; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hover-dot { fill: var(--brass); stroke: var(--paper); stroke-width: 2; }
.chart .bar-gain { fill: var(--gain); }
.chart .bar-loss { fill: var(--loss); }
.chart .bar.open { opacity: .8; }
.chart .bar.on { stroke: var(--ink); stroke-width: 2px; paint-order: stroke; }
.chart .hit { fill: transparent; cursor: default; }
.chart .ci-line { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .ci-dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.chart .ci-dot.neg { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }

.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 9rem; max-width: 16rem;
  background: var(--tip-bg); color: var(--ink); border: 1px solid var(--rule); box-shadow: var(--shadow);
  padding: 8px 10px; font: 400 .75rem/1.45 var(--mono); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip .tv { font-size: .9375rem; font-weight: 500; }
.tip .tk { color: var(--muted); }
.tip .row { display: flex; gap: 8px; align-items: center; }
.tip .key { width: 12px; height: 0; border-top: 2px solid var(--brass); flex: none; }

/* ------------------------------------------------------------------ tables */
.tablebox { margin-top: 18px; }
.tablebox summary { cursor: pointer; font: 500 .8125rem/1.4 var(--mono); color: var(--ink-2); width: max-content; max-width: 100%; }
.tablebox[open] summary { margin-bottom: 10px; }
.tablescroll { width: 100%; overflow-x: auto; }
.tablescroll:focus-visible { outline-offset: 2px; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data caption { text-align: left; }
table.data th, table.data td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: baseline; }
table.data thead th { font: 500 .6875rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-top: 0; }
table.data td.n, table.data th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.n:last-child, table.data th.n:last-child { padding-right: 0; }
table.data tr.muted td, table.data tr.muted th { color: var(--muted); }
table.data .rule-code { font-family: var(--mono); font-weight: 500; }
table.data .rule-pool { font-weight: 500; }
table.data .grp { display: block; font-size: .75rem; color: var(--muted); }
table.data td.barcell { width: 26%; padding-right: 14px; }
.mini { position: relative; height: 10px; }
.mini .zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-2); }
.mini i { position: absolute; top: 0; height: 10px; }
.mini i.g { background: var(--gain); border-radius: 0 2px 2px 0; }
.mini i.l { background: var(--loss); border-radius: 2px 0 0 2px; }
table.data tfoot td, table.data tfoot th { border-bottom: 0; border-top: 1px solid var(--rule); font-weight: 500; color: var(--ink); }
.tnote { font-size: .8125rem; color: var(--muted); margin: 10px 0 0; max-width: 44rem; }
table.data .grp.show-s, table.data .show-c { display: none; }
@media (max-width: 640px) {
  table.data .hide-s { display: none; }
  table.data .show-c { display: table-cell; }
  table.data .grp.show-s { display: block; font-size: .6875rem; line-height: 1.3; }
  table.data tbody th, table.data tfoot th { min-width: 6rem; }
  table.data { font-size: .8125rem; }
  table.data thead th { letter-spacing: .02em; font-size: .6875rem; }
  table.data th, table.data td { padding-right: 6px; }
}
@media (max-width: 400px) { table.data tbody th, table.data tfoot th { min-width: 5rem; } }

/* ------------------------------------------------------------------ definitions */
.defs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; margin: 0; }
.defs > div { padding: 14px 0 16px; border-top: 1px solid var(--grid); }
.defs dt { font: 500 .8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.defs dd { margin: 0; color: var(--ink-2); font-size: .9688rem; }
@media (min-width: 760px) { .defs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ versions timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.timeline li { position: relative; padding: 0 0 26px 26px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: -8px; width: 1px; background: var(--rule); }
.timeline li:last-child::before { display: none; }
.timeline .node { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; background: var(--ink); }
.timeline li.next .node { background: var(--paper); border: 1.5px dashed var(--ink-2); }
.timeline li.next::before { display: none; }
.timeline .vname { font: 500 1.125rem/1.2 var(--mono); margin: 0; }
.timeline .vdate { font: 400 .8125rem/1.4 var(--mono); color: var(--muted); margin: 4px 0 8px; }
.timeline .vfig { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.timeline .vfig .num { color: var(--ink); }
.timeline .vstat { display: inline-block; font: 400 .75rem/1.3 var(--mono); color: var(--ink-2); border: 1px solid var(--rule); padding: 1px 6px; margin-left: 8px; vertical-align: 2px; }
@media (min-width: 760px) {
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; }
  .timeline li { padding: 26px 0 0; }
  .timeline li::before { left: 0; right: -24px; top: 4px; bottom: auto; width: auto; height: 1px; }
  .timeline li.cur::before { background: linear-gradient(90deg, var(--rule) 0 60%, transparent 60%); background-size: 8px 1px; }
  .timeline .node { top: 0; }
}

/* ------------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--rule); margin-top: 24px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 40px; padding-block: 28px 44px; font-size: .875rem; color: var(--ink-2); }
.foot-grid p { margin: 0; max-width: 40rem; }
.foot-main { color: var(--ink); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ 404 */
.lost { padding-block: 72px 96px; }
.lost h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); }
.lost p { max-width: 36rem; color: var(--ink-2); }

/* without JavaScript (or before the data has loaded) the chart sections would be empty boxes: hide them;
   the static key figures, the definitions and the footer stay. A failed load sets data-ready="error" and shows them. */
html:not([data-ready]) .js-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
