/* peapod layout.
 *
 * One left edge, held from the wordmark to the footer. Everything that can align, aligns:
 * the headline, the band, the table's first column and the prose all start at the same x,
 * and every numeric column is right-aligned on tabular figures.
 *
 * Nothing here exists to look designed. No gradients, no shadows, no rounded corners, no
 * zebra striping, no sticky headers, no hover fills, no entrance animation. What was
 * removed was removed because space and alignment do the same work more quietly.
 *
 * Selectors are flat and each owns its own spacing, so no rule reaches across a section
 * boundary to correct another.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

a { color: inherit; text-decoration: none; }
.masthead-nav a { padding-bottom: var(--s-1); border-bottom: 1px solid transparent; }
.masthead-nav a:hover { border-bottom-color: var(--line); }
.masthead-nav [aria-current='page'] { border-bottom-color: var(--ink); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--paper); padding: var(--s-2) var(--s-3); }
.skip:focus { left: var(--s-3); top: var(--s-2); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  padding: var(--s-6) 0 var(--s-5);
}

.wordmark {
  margin: 0;
  font-size: var(--t-body);
  font-weight: var(--w-medium);
  letter-spacing: 0.01em;
}

.masthead-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-small);
  flex: 1 1 24ch;
}

.masthead-nav { display: flex; gap: var(--s-4); font-size: var(--t-small); }

/* -------------------------------------------------------------- provenance */
/* Every page carries this. A depth figure without its date is the thing this site
 * exists not to publish, and a reader arriving months later must meet the subsidy
 * caveat here rather than hunt for it in the method notes. No accent: the accent
 * has one referent and this is not it. */

.provenance {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-2) var(--s-4);
  border-top: 1px solid var(--line);
  padding: var(--s-4) 0 0;
  font-size: var(--t-micro);
  line-height: 1.5;
}

.prov-item { display: contents; }
.prov-key { color: var(--ink-2); }
.prov-value { max-width: 64ch; }

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

.hero { padding: var(--s-8) 0 var(--s-7); }

.hero-head {
  margin: 0 0 var(--s-7);
  max-width: 24ch;
  font-size: var(--t-lead);
  font-weight: var(--w-medium);
  line-height: var(--lh-tight);
  letter-spacing: -0.018em;
}

.band-figure { margin: 0; }

.band {
  display: flex;
  width: 100%;
  height: 64px;
  background: var(--line);
}

/* Width is the magnitude. Nothing else needs to encode it, so the segments carry
 * two values only: the pool the page is about, and everything else. */
.band-seg { min-width: 0; background: var(--fill); border-right: 1px solid var(--paper); }
.band-seg:last-child { border-right: 0; }
.band-seg[data-rank='1'] { background: var(--ink); }
.band-seg--rest { background: var(--line); }

/* The scale is drawn, so the band reads as a measurement rather than a graphic. */
.band-scale {
  position: relative;
  height: 1.5rem;
  margin-top: var(--s-2);
  font-size: var(--t-micro);
  color: var(--ink-2);
}
.band-tick { position: absolute; top: 0; padding-left: var(--s-1); }
.band-tick::before {
  content: '';
  position: absolute;
  left: 0;
  top: -0.5rem;
  width: 1px;
  height: 0.375rem;
  background: var(--line);
}
.band-tick--last { padding-left: 0; padding-right: 0; transform: translateX(-100%); }
.band-tick--last::before { left: auto; right: 0; }

/* One of the accent's two uses. */
.band-pointer {
  position: relative;
  height: 2.5rem;
  margin-top: var(--s-2);
  font-size: var(--t-micro);
}
.band-pointer-mark {
  position: absolute;
  transform: translateX(-50%);
  color: var(--accent);
  white-space: nowrap;
  line-height: 1.35;
}
.band-pointer-arrow { display: block; }

.hero-note {
  margin: var(--s-5) 0 0;
  max-width: var(--measure);
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- sections */

.section { padding: var(--s-7) 0 0; }

.section-head { margin: 0 0 var(--s-4); }
.section-head h2 {
  margin: 0;
  font-size: var(--t-body);
  font-weight: var(--w-medium);
}
.section-note { margin: var(--s-2) 0 0; color: var(--ink-2); font-size: var(--t-small); }

.prose { max-width: var(--measure); margin: 0; }
.prose p { margin: 0 0 var(--s-3); }
.prose p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; margin-top: var(--s-5); }

table.depth {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}

table.depth caption {
  caption-side: bottom;
  text-align: left;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: var(--t-micro);
  line-height: 1.5;
  padding-top: var(--s-4);
}

table.depth th {
  text-align: left;
  font-weight: var(--w-regular);
  color: var(--ink-2);
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--s-4) var(--s-2) 0;
  white-space: nowrap;
}

table.depth td {
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
  white-space: nowrap;
}

table.depth th:last-child, table.depth td:last-child { padding-right: 0; }

.num { text-align: right; }
.num-strong { text-align: right; font-weight: var(--w-medium); }
.rank { color: var(--ink-2); width: 3ch; }
.addr { color: var(--ink-2); }
.sub { color: var(--ink-2); }

/* Sign is the arrow, and only the arrow. */
.sign-mark { padding-right: 0.35em; }

/* The other accent use: the row the hero is pointing at. */
.subject .ticker { font-weight: var(--w-medium); }
.subject-mark { color: var(--accent); padding-right: 0.5em; }

/* ------------------------------------------------------------------ method */

.restatement { margin: 0 0 var(--s-5); max-width: var(--measure); }
.restatement:last-child { margin-bottom: 0; }
.restatement h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--t-small);
  font-weight: var(--w-regular);
  color: var(--ink-2);
}
.restatement p { margin: 0 0 var(--s-2); }
.restatement p:last-child { margin-bottom: 0; color: var(--ink-2); font-size: var(--t-small); }

.footer {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  padding: var(--s-4) 0 var(--s-7);
  font-size: var(--t-micro);
  color: var(--ink-2);
}
.footer p { margin: 0; }

/* -------------------------------------------------------------- calculator */

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--s-7);
  align-items: start;
  padding: var(--s-7) 0 0;
}

.controls { display: flex; flex-direction: column; gap: var(--s-4); margin: 0; }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field-label { font-size: var(--t-micro); color: var(--ink-2); }

.field select,
.field input {
  font: inherit;
  font-size: var(--t-small);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: var(--s-2) 0;
  width: 100%;
}

.snap-note { margin: 0; font-size: var(--t-small); color: var(--ink-2); max-width: 40ch; }
.snap-note[hidden] { display: none !important; }

.hist { display: flex; align-items: flex-end; gap: 2px; height: 160px; }
.hist-col { flex: 1 1 0; min-width: 0; background: var(--fill); }
.hist-zero { position: relative; height: 0; }
.hist-zero span { position: absolute; top: -160px; width: 1px; height: 160px; background: var(--ink); }

.hist-axis {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: var(--s-2);
  font-size: var(--t-micro);
  color: var(--ink-2);
}

.quantiles { display: flex; flex-wrap: wrap; gap: var(--s-5); margin-top: var(--s-5); font-size: var(--t-small); }
.quantile-key { display: block; color: var(--ink-2); font-size: var(--t-micro); }
.quantile-value { font-weight: var(--w-medium); }

.result-head { display: flex; flex-wrap: wrap; gap: var(--s-5); margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; gap: var(--s-1); }
.stat-key { font-size: var(--t-micro); color: var(--ink-2); }
.stat-value { font-size: var(--t-small); font-weight: var(--w-medium); }

.empty { color: var(--ink-2); font-size: var(--t-small); padding: var(--s-6) 0; margin: 0; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .shell { padding: 0 var(--s-4); }
  .calc-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .hero { padding: var(--s-7) 0 var(--s-6); }
  .hero-head { font-size: 1.75rem; margin-bottom: var(--s-6); }
  .band { height: 48px; }
  .section { padding-top: var(--s-6); }
}

@media (max-width: 560px) {
  .provenance { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .prov-key { margin-top: var(--s-2); }
  .hero-head { font-size: 1.5rem; }
}
