/* Shared look for every page: ledger paper, one type family, blue for money in, orange for money out. */
:root {
  color-scheme: light;
  --page: #eef3ee;
  --surface: #fafcfa;
  --ink: #10231c;
  --ink-2: #44554d;
  --muted: #64726b;
  --rule: #d3ddd5;
  --rule-strong: #a9b9ae;
  --wash: #e2ebe4;
  --in: #1f6fd0;        /* money promised to a company, and where a thread lands */
  --out: #d9541e;       /* money a company has promised, and where a thread leaves */
  --thread: #9fb0a6;
  --related: #7d8a84;
  --dot: #3c4f47;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

.page { max-width: 1680px; margin: 0 auto; padding: 26px 28px 96px; }

/* Masthead: the same title and the same three pages, on one row */
.masthead { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.masthead h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 800;
  font-stretch: 122%;
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.masthead h1 a { text-decoration: none; }
.sitenav { display: flex; flex-wrap: wrap; gap: 6px; }
.sitenav a {
  padding: 5px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.sitenav a:hover { background: var(--wash); }
.sitenav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.standfirst { margin: 14px 0 0; max-width: 118ch; font-size: 1rem; color: var(--ink-2); }
.masthead .standfirst { flex-basis: 100%; margin-top: 4px; }

.find-note { margin: 8px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.find-note:empty { display: none; }

.colophon { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule-strong); font-size: 0.8125rem; color: var(--ink-2); max-width: 100ch; }
.colophon p { margin: 0 0 6px; }

/* Tooltip */
#tip {
  position: fixed;
  z-index: 20;
  max-width: 300px;
  padding: 10px 12px;
  background: var(--ink);
  color: #f2f7f3;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 90ms;
}
#tip.on { opacity: 1; }
#tip .t-name { font-weight: 700; font-size: 0.875rem; font-stretch: 90%; }
#tip .t-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 4px; }
#tip .t-row b { font-weight: 700; color: #fff; }
#tip .t-key { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
#tip .t-deal { margin-top: 6px; padding-top: 6px; border-top: 1px solid #3a4f46; color: #cfdcd4; }
#tip .t-hint { margin-top: 6px; color: #a9bcb1; }

/* The two-step guide to the two chart pages: a small note under a tab. It does not cover or dim the page. */
.guide {
  position: absolute;
  z-index: 30;
  width: min(330px, calc(100vw - 24px));
  padding: 13px 40px 11px 15px;
  background: var(--ink);
  color: #f2f7f3;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(16, 35, 28, 0.3);
  font-size: 0.9063rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 240ms, transform 240ms, left 420ms cubic-bezier(.3, .7, .2, 1), top 420ms cubic-bezier(.3, .7, .2, 1);
  pointer-events: none;
}
.guide.is-open { opacity: 1; transform: none; pointer-events: auto; }
.guide::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--caret, 50%);
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
  transition: left 420ms cubic-bezier(.3, .7, .2, 1);
}
.guide-text { margin: 0; }
.guide-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.guide-count { color: #a9bcb1; font-size: 0.8125rem; }
.guide-next { padding: 4px 16px; border: 0; border-radius: 999px; background: #f2f7f3; color: var(--ink); font-size: 0.875rem; font-weight: 650; }
.guide-next:hover { background: #fff; }
.guide-close { position: absolute; top: 6px; right: 7px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #cfdcd4; font-size: 1.25rem; line-height: 1; }
.guide-close:hover { background: #2a4036; color: #fff; }
.guide :focus-visible { outline-color: #fff; }
.sitenav a.guide-target { outline: 2px solid var(--ink); outline-offset: 3px; animation: guide-ring 1.5s ease-out 2; }
@keyframes guide-ring { from { box-shadow: 0 0 0 0 rgba(16, 35, 28, 0.32); } to { box-shadow: 0 0 0 12px rgba(16, 35, 28, 0); } }

@media (max-width: 860px) { .page { padding: 20px 16px 110px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
