/* Space Progress Initiative
   ---------------------------------------------------------------------------
   Seven colours, and no eighth. Each token below carries the job it is allowed
   to do; if something needs a colour that is not on this list, the answer is a
   different weight or a different size, not a new colour.

   Ground     #0B0B09   page, nothing else
   Raised     #14130F   panels, table bodies, cards
   Shade      #1E1C18   table headers, code, hover
   Rule       #2E2C27   hairlines and axes, 1px only
   Ink        #F0EDE6   headings, body, figures
   Ink muted  #8F8A7E   labels, sources, estimates
   Signal     #D98A45   links, spokes, live figure
   --------------------------------------------------------------------------- */

:root {
  --ground:    #0B0B09;
  --raised:    #14130F;
  --shade:     #1E1C18;
  --rule:      #2E2C27;
  --ink:       #F0EDE6;
  --ink-muted: #8F8A7E;
  --signal:    #D98A45;

  --display: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 68ch;
  --page-max: 1080px;
  --gutter: clamp(20px, 5vw, 56px);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
}

/* ---------------------------------------------------------------- structure */

.page { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--gutter); }

section { padding-block: clamp(40px, 6vw, 68px); }
section + section { border-top: 1px solid var(--rule); }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose > * + h3 { margin-top: 1.9em; }

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

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-block: 22px;
  border-bottom: 1px solid var(--rule);
}

.masthead__logo { display: block; line-height: 0; border-bottom: 0; }
/* Sized by width, not height. The lockup is a wide wordmark with a small line
   beneath it, so height-constrained sizing shrinks the wordmark itself and lets
   the figure scale beneath it out-measure the identity. */
.masthead__logo img { display: block; width: clamp(212px, 28vw, 340px); height: auto; }

.nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 26px);
  flex-wrap: wrap;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav a { color: var(--ink-muted); text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* Second tier: the sections that belong to the Report. Shown only on Report
   pages, so the header states which part of the site you are in. */
.subnav-bar { background: var(--raised); border-bottom: 1px solid var(--rule); }

.subnav {
  display: flex;
  gap: clamp(14px, 2.6vw, 30px);
  flex-wrap: wrap;
  padding-block: 12px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.subnav a { color: var(--ink-muted); text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.subnav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* --------------------------------------------------------------------- type */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: 0.005em;
  font-weight: 300;
}

h2 {
  font-size: clamp(21px, 2.5vw, 27px);
  line-height: 1.22;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin-bottom: 0.9em;
}

h3 {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.6em;
}

.eyebrow {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 18px;
}

.lede { font-size: 20px; line-height: 1.55; max-width: var(--measure); margin: 22px 0 0; }

a { color: var(--signal); text-decoration: none; border-bottom: 1px solid rgba(217, 138, 69, 0.35); }
a:hover { border-bottom-color: var(--signal); }

strong, b { font-weight: 600; }

/* Focus is visible and uses signal, which is already the interactive colour. */
a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ------------------------------------------------------------------- figures */

.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(30px, 5vw, 52px) clamp(26px, 4vw, 40px);
}

.figure__label {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 14px;
}

/* The live figure — the only place signal is used at size. */
.figure__value {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.015em;
  color: var(--signal);
  display: block;
  font-variant-numeric: tabular-nums;
}

.figure__unit {
  font-family: var(--display);
  font-size: clamp(15px, 1.7vw, 19px);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-left: 0.35em;
}

.figure__note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  margin: 16px 0 0;
  line-height: 1.5;
}

/* Keeps a figure without a scale aligned with one that has it. */
.figure__spacer { height: 72px; }

/* Position of the current reading on the permanent scale. Axis is 1px rule. */
.scale { margin-top: 22px; max-width: 228px; }
.scale__track { position: relative; height: 26px; border-bottom: 1px solid var(--rule); }
.scale__tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  background: var(--rule);
}
.scale__here {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 20px;
  background: var(--signal);
}
.scale__labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 7px;
}

.edition {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0;
  padding-bottom: 6px;
}

/* The finding — the line meant to be quoted. */
.finding {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(22px, 3.3vw, 34px);
  line-height: 1.3;
  letter-spacing: 0.002em;
  max-width: 24ch;
  margin: 0;
  text-wrap: balance;
}

.finding + .finding-sub {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-muted);
  margin: 22px 0 0;
}

/* A paragraph that introduces the table or panel directly beneath it. */
.intro { margin-bottom: 26px; }

/* A second table stacked under the note belonging to the first. */
.table-wrap--next { margin-top: 38px; }

/* The standing note on a permanent edition page. */
.edition--note { padding-top: 10px; }

/* ------------------------------------------------------------------ equation */

.equations { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; }

.equation {
  background: var(--raised);
  border: 1px solid var(--rule);
  padding: 22px 26px;
  flex: 1 1 260px;
  min-width: 0;
}

.equation__math {
  font-family: var(--mono);
  font-size: clamp(19px, 2.4vw, 25px);
  color: var(--ink);
  margin: 0 0 14px;
  white-space: nowrap;
  overflow-x: auto;
}

.equation dl { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
.equation dt { display: inline; color: var(--ink); }
.equation dd { display: inline; margin: 0; color: var(--ink-muted); }
.equation dd::after { content: ""; display: block; }

/* -------------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--rule);
  background: var(--raised);
  overscroll-behavior-x: contain;
}

table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 15px; }

/* A table scrolls inside its wrapper; it must never widen the page. */
.page, section, main { min-width: 0; }

caption {
  text-align: left;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 0 12px;
}

thead th {
  background: var(--shade);
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

tbody td, tbody th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
  font-weight: 400;
  color: var(--ink);
}

tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td, tbody tr:hover th { background: var(--shade); }

td.num, th.num { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.muted { color: var(--ink-muted); }
td.yes { color: var(--ink); }
td.no { color: var(--ink-muted); }

.table-note { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); margin: 12px 0 0; }

/* status pills on the data page — form as well as colour */
.status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  display: inline-block;
  line-height: 1.4;
}
.status--verified { color: var(--ink); border-color: var(--ink-muted); }
.status--estimated { color: var(--ink-muted); }
.status--checking { color: var(--signal); border-color: rgba(217, 138, 69, 0.45); }

/* --------------------------------------------------------------- limitations */

.limits { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.limit { background: var(--raised); padding: 22px 24px; }
.limit h3 { color: var(--ink); margin-bottom: 0.45em; }
.limit p { margin: 0; font-size: 16px; color: var(--ink); }
.limit p + p { margin-top: 0.8em; }

/* ---------------------------------------------------------------- colophon */
/* The maintainer, credited the way a publication credits its editor: small,
   factual, and monochrome — a photograph must not introduce an eighth colour. */

.colophon { display: flex; gap: clamp(20px, 3vw, 30px); align-items: center; flex-wrap: wrap; }

.portrait { margin: 0; flex: none; }

.portrait__frame {
  position: relative;
  width: clamp(148px, 18vw, 200px);
  aspect-ratio: 1 / 1;
  background: var(--shade);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* The photograph is painted as a layer rather than an <img>: a missing file
   paints nothing at all, where a broken <img> still draws a placeholder glyph.
   The frame carries the accessible name, so nothing is lost. */
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/founder.jpg?v=da6d64f0");
  background-image: image-set(url("assets/founder.webp?v=18001c21") type("image/webp"),
                              url("assets/founder.jpg?v=da6d64f0") type("image/jpeg"));
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  filter: grayscale(1) sepia(0.18) contrast(1.06) brightness(0.94);
}

/* Shows through if the photograph is absent, so the page never renders broken. */
.portrait__fallback {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(26px, 3.4vw, 32px);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--ink-muted);
}

.colophon__body { flex: 1 1 340px; min-width: 0; }

.colophon__name {
  font-family: var(--display);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
}

/* ------------------------------------------------------------------- archive */

.editions { list-style: none; margin: 0 0 34px; padding: 0; border-top: 1px solid var(--rule); }
.editions li { border-bottom: 1px solid var(--rule); }
.editions a, .editions .pending {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 20px 4px;
  border-bottom: 0;
  flex-wrap: wrap;
}
.editions a:hover { background: var(--shade); }
.editions .pending { color: var(--ink-muted); }
.editions .year { font-family: var(--mono); font-size: 15px; letter-spacing: 0.04em; min-width: 5ch; }
.editions .title { font-family: var(--display); font-size: 16px; font-weight: 400; }
.editions .figs { font-family: var(--mono); font-size: 12.5px; color: var(--ink-muted); margin-left: auto; }

.empty {
  background: var(--raised);
  border: 1px solid var(--rule);
  padding: 26px;
  font-size: 16px;
  color: var(--ink-muted);
  margin: 0;
}

/* -------------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--rule); padding-block: 40px 60px; margin-top: 0; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 34px 60px; justify-content: space-between; }
.footer h4 {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 12px;
}
.footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--display); font-size: 14px; line-height: 2; }
.footer ul a { color: var(--ink); border-bottom: 0; }
.footer ul a:hover { border-bottom: 1px solid var(--rule); }
.footer__next { font-family: var(--mono); font-size: 12.5px; color: var(--ink-muted); margin: 34px 0 0; }

/* ------------------------------------------------------------------ sources */

.sources { font-size: 15px; color: var(--ink-muted); }
.sources li { margin-bottom: 0.9em; }
.sources cite { font-style: italic; color: var(--ink); }

/* ------------------------------------------------------------------- utility */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--shade);
  color: var(--ink);
  padding: 10px 16px;
  font-family: var(--display);
  font-size: 13px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

@media (max-width: 640px) {
  /* The spacer only exists to align two side-by-side figures. Stacked, it is dead space. */
  .figure__spacer { display: none; }
  table { min-width: 420px; font-size: 14px; }
  thead th, tbody td, tbody th { padding: 11px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .nav, .footer { display: none; }
}
