@font-face {
  font-family: 'Young Serif';
  src: url('fonts/young-serif-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('fonts/nunito-sans-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --notes-serif: 'Young Serif', Georgia, serif;
  --notes-sans: 'Nunito Sans', system-ui, sans-serif;
  --notes-type-title: clamp(2.5rem, 5.6vw, 4.75rem);
  --notes-type-section: clamp(1.5rem, 2.85vw, 2.25rem);
  --notes-type-component: clamp(1.25rem, 1.8vw, 1.5rem);
  --notes-type-deck: clamp(1.125rem, 1.8vw, 1.375rem);
  --notes-type-reading: clamp(1rem, 1.48vw, 1.1875rem);
  --notes-type-note: 1rem;
  --notes-reading-leading: 1.65;
  --notes-serif-leading: 1.16;
  --notes-type-target: 2.75rem;
}

body { font-family: var(--notes-sans); }

.wn-chrome,
.wn-author {
  --wn-serif: var(--notes-serif);
  --wn-sans: var(--notes-sans);
}

.wn-top .wn-mast { padding-block: .25rem 0; }
.wn-top .wn-tagline { font-size: var(--wn-body); line-height: 1.25; }

.wn-top .wn-rail-wide { display: none; }
.wn-top .wn-menu { border-block-start: 1px solid var(--wn-rule); }
.wn-menu summary {
  min-block-size: var(--wn-target);
  padding-block: var(--wn-s2);
  color: var(--wn-secondary);
  font-weight: 600;
  cursor: pointer;
}

.wn-menu summary:is(:hover, :active) { color: var(--wn-olive); }
.wn-menu summary:focus-visible { outline: 2px solid var(--wn-ink); outline-offset: 2px; }
.wn-menu .wn-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-block: var(--wn-s1);
  border-block-start: 1px solid var(--wn-rule);
}
.wn-menu .wn-links li:last-child { grid-column: 1 / -1; }
.wn-menu .wn-links a { inline-size: 100%; }

@media (min-width: 64rem) {
  .wn-top .wn-menu { display: none; }
  .wn-top .wn-rail-wide { display: block; }
  .wn-top .wn-rail-wide .wn-links { padding-block: .25rem; }
}

.wn-post-page {
  --article-paper: #f1f1e8;
  --article-surface: #fafaf3;
  --article-ink: #292d22;
  --article-muted: #41482d;
  --article-accent: #58603e;
  --article-rule: #7b8060;
  --article-reading: clamp(1.0625rem, 1.48vw, 1.25rem);
  --article-gutter: clamp(1rem, 5vw, 4rem);
  --article-s1: .5rem;
  --article-s2: .75rem;
  --article-s3: 1rem;
  --article-s4: 1.5rem;
  --article-s5: 2rem;
  --article-s6: 3rem;
  margin: 0;
  background: var(--article-paper);
  color: var(--article-ink);
}

.wn-post-page .skip {
  position: absolute;
  z-index: 2;
  inset-block-start: var(--article-s1);
  inset-inline-start: var(--article-s2);
  display: inline-flex;
  align-items: center;
  min-block-size: var(--notes-type-target);
  padding-inline: var(--article-s3);
  color: var(--article-ink);
  background: var(--article-surface);
}

.wn-post-page .skip:not(:focus) { transform: translateY(-200%); }

.article-page {
  box-sizing: border-box;
  font: 400 var(--article-reading)/var(--notes-reading-leading) var(--notes-sans);
  inline-size: min(68ch, calc(100% - 2 * var(--article-gutter)));
  margin-inline: auto;
  padding-block: clamp(var(--article-s4), 4vw, var(--article-s6));
  overflow-wrap: break-word;
}

.article-page *, .article-page *::before, .article-page *::after { box-sizing: border-box; }
.article-page :where(h1, h2, h3, p, ul, ol, figure, blockquote) { margin: 0; }
.article-page > * + * { margin-block-start: var(--article-s3); }

.wn-post-page .skip:focus-visible,
.article-page :focus-visible { outline: 2px solid var(--article-ink); outline-offset: 3px; }

.article-page :where(h1, h2, h3) {
  font-family: var(--notes-serif);
  font-weight: 400;
  line-height: var(--notes-serif-leading);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.article-page h1 { font-size: clamp(1.625rem, 6.5vw, 4rem); line-height: 1.04; letter-spacing: -.045em; }
.article-page h2 { font-size: var(--notes-type-section); margin-block-start: var(--article-s6); }
.article-page h3 { font-size: var(--notes-type-component); margin-block-start: var(--article-s5); }

.article-page .lede,
.article-page .article-lede {
  color: var(--article-muted);
  font: inherit;
}

.article-page :where(ul, ol) { padding-inline-start: 0; }
.article-page li + li { margin-block-start: var(--article-s2); }
.article-page figure img { display: block; inline-size: 100%; block-size: auto; }
.article-page .post-hero { margin-block: var(--article-s4); }

.article-page :is(.vis-quote, .vis-formula, .vis-metrics) {
  margin-block: var(--article-s4);
  border-block: 1px solid var(--article-rule);
}

.article-page :is(.vis-quote, .vis-formula, .vis-metrics p) { padding-block: var(--article-s3); }
.article-page .vis-metrics p + p { border-block-start: 1px solid var(--article-rule); }
.article-page .vis-formula { position: relative; }
.article-page .vis-formula span { position: absolute; inset-inline-start: -.8em; color: var(--article-accent); }

.article-page :where(table, .vis-table, .vis-formula, .vis-timeline) {
  font-family: var(--notes-sans);
  font-variant-numeric: tabular-nums;
}

.article-page :where(.vis-quote p, .vis-metrics p) {
  font: 400 var(--notes-type-component)/1.35 var(--notes-serif);
}

.article-page :where(figcaption, .vis-caption, .byline, .author-box) {
  font-family: var(--notes-sans);
  font-variant-numeric: tabular-nums;
}

.article-page :where(figcaption, .vis-caption) { font-size: var(--notes-type-note); }
.article-page :where(.author-box h2, .author-box h3, .author-box-name) { font-family: var(--notes-serif); }

.article-page > .byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  margin-block: var(--article-s1) var(--article-s2);
  color: var(--article-muted);
  font-size: .95rem;
}

.article-page .byline :where(time, .byline-updated) { white-space: nowrap; }

.article-page .byline a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--notes-type-target);
  min-inline-size: var(--notes-type-target);
  color: inherit;
  text-underline-offset: .15em;
}

.article-page .byline a:is(:hover, :active) { color: var(--article-accent); }
.article-page .vis-table-card { --notes-table-label: 6.5rem; margin-block: var(--article-s4); container-type: inline-size; }
.article-page .vis-table { overflow-x: auto; background: var(--article-surface); }
.article-page .vis-table table { border-collapse: separate; border-spacing: 0; inline-size: 100%; }
.article-page .vis-table :is(th, td) { padding: var(--article-s2) var(--article-s3); text-align: start; vertical-align: top; }
.article-page .vis-table thead { color: var(--article-surface); background: var(--article-muted); }
.article-page .vis-table tbody tr + tr > * { border-block-start: 1px solid var(--article-rule); }
.article-page .table-cue { display: none; color: var(--article-muted); font-size: var(--notes-type-note); margin-block-end: var(--article-s1); }

.article-page .vis-table :is(tbody th, thead th:first-child) {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  border-inline-end: 2px solid var(--article-rule);
}

.article-page .vis-table tbody th { background: var(--article-surface); }
.article-page .vis-table thead th:first-child { background: var(--article-muted); }

@container (max-width: 36.125rem) {
  .article-page .vis-table table { table-layout: fixed; }
  .article-page .vis-table :is(thead th:first-child, tbody th) { inline-size: var(--notes-table-label); min-inline-size: 0; }
  .article-page .vis-table :is(th, td) { padding-inline: .625rem; overflow-wrap: break-word; }
}

@container (max-width: calc(26rem - .5px)) {
  .article-page .table-cue { display: block; }
  /* At the end of a pan, the third column fills the space beside the pinned label. */
  .article-page .vis-table table {
    inline-size: 26rem;
    inline-size: max(26rem, calc(200cqi - var(--notes-table-label)));
  }
}
