/* ––––––––––––––––––––––––––––––––––––––––––––––––
   Celestial Navigation – tokens, layout, and figure
   styling. style-original.css, loaded after this,
   sets the page typography.
   –––––––––––––––––––––––––––––––––––––––––––––––– */

/* Figure face, bundled so the plates look the same on every device:
   Jost (SIL OFL, license beside the file), a Futura revival, for labels,
   values, controls and captions. Latin subset. */
@font-face {
  font-family: "Jost";
  src: url("assets/fonts/jost-variable-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}



/* Body face: Charter, which Bitstream gave away for any use
   (license beside the files). */
/* Lettering drawn inside the figures: Routed Gothic (SIL OFL, license
   beside the file), after Leroy stencil lettering. The whole font,
   unmodified, only recompressed as woff2. */
@font-face {
  font-family: "Routed Gothic";
  src: url("assets/fonts/routed-gothic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Emphasis inside the figures: National Park ExtraBold (SIL OFL, license
   beside the file), Latin subset. */
@font-face {
  font-family: "National Park";
  src: url("assets/fonts/national-park-extrabold-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Charter";
  src: url("assets/fonts/charter-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Charter";
  src: url("assets/fonts/charter-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Charter";
  src: url("assets/fonts/charter-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Charter";
  src: url("assets/fonts/charter-bold-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --ink: #111111;
  --faint: #6b6b6b;
  --hair: #dcdcdc;
  --codebg: #f3f3f3;
  --red: #a6192e;
  /* section 8 chart series, fixed order, never cycled */
  --s1: #a6192e;
  --s2: #16326b;
  --s3: #ee7203;
  --s4: #00857c;
  --s7: #4a9b25;
  --measured: var(--s2);
  --corrected: var(--s1);
  --ephemeris: var(--s4);
  --predicted: var(--faint);
  --constraint: var(--s1);
  --fix: var(--s7);
  --rhythm: 1.2rem;
  --half-rhythm: 0.6rem;
  --rule: 1px;
  --font-body: Charter, "Bitstream Charter", Georgia, serif;
  /* title block and section headings share the figures' face */
  --font-display: var(--font-plate);
  --font-caps: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-utility: "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* the faces drawn inside every plate (PLATE.font / PLATE.dataFont) */
  --font-plate: Jost, "Avenir Next Condensed", "Helvetica Neue", Helvetica, sans-serif;
  --font-plate-data: var(--font-plate);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131416;
    --ink: #d9d9d9;
    --faint: #969696;
    --hair: #333333;
    --codebg: #1d1e20;
    --red: #dc7684;
    --s1: #c23f52;
    --s2: #4d6fa8;
    --s3: #ee7203;
    --s4: #14a599;
    --s7: #63b833;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* the hidden attribute wins over any display rule (canvases are display: block) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 450;
  line-height: var(--rhythm);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "kern" 1, "liga" 1;
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ––––– header ––––– */

.home-link {
  color: var(--faint);
  text-decoration: none;
}
.home-link:hover { color: var(--ink); text-decoration: underline; }

.pixel-header {
  max-width: 66ch;
  margin: 0 auto;
  padding: calc(var(--rhythm) * 1.5) 2rem 0;
  text-align: left;
}

.pixel-title {
  grid-column: 1;
  font-family: var(--font-caps);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: calc(var(--rhythm) * 2);
  margin: 0;
  text-transform: uppercase;
}

.pixel-tagline {
  grid-column: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  line-height: var(--rhythm);
  color: var(--ink);
  max-width: 52ch;
  margin: var(--half-rhythm) 0 0;
}

.journal-byline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: var(--half-rhythm);
  font-family: var(--font-caps);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.075em;
  line-height: var(--rhythm);
}

.pixel-rule { display: none; }

/* ––––– article column ––––– */

.article {
  max-width: 66ch;
  margin: 0 auto;
  padding: 2.4rem 2rem 3rem;
}

.article p {
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
  text-wrap: pretty;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  hyphenate-limit-lines: 2;
  hanging-punctuation: first allow-end last;
  orphans: 3;
  widows: 3;
}

.article p + p {
  text-indent: 3ch;
}

.article h2 + p,
.article figure + p,
.article .fig-anchor + p,
.article .sight-log + p,
.article .prediction + p,
.article details + p {
  text-indent: 0;
}

.article .steps {
  margin: var(--half-rhythm) 0;
  padding-left: 3ch;
}
.article .steps li + li { margin-top: 0.35em; }
.article .steps + p { text-indent: 0; }
/* numbers in the prose that follow a figure as the reader drags it */
.article .live { font-variant-numeric: lining-nums tabular-nums; }
/* steps keyed to a figure: each number in the same small circle the
   drawing uses to mark that step */
.article .steps.keyed {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}
.article .steps.keyed li {
  counter-increment: step;
  position: relative;
  padding-left: 2.1em;
}
.article .steps.keyed li::before {
  content: counter(step);
  position: absolute;
  left: 0.15em;
  top: 0.2em;
  width: 1.3em;
  height: 1.3em;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 0.72em/1 var(--font-plate);
  font-variant-numeric: lining-nums tabular-nums;
}

.article .method-thesis {
  margin: var(--half-rhythm) 3ch var(--rhythm);
  padding: 0;
  border: 0;
  border-left: 0;
  font-size: 1rem;
  font-style: italic;
  line-height: var(--rhythm);
  text-indent: 0;
}

.beat-title {
  margin: var(--rhythm) 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  line-height: var(--rhythm);
  font-weight: 500;
  letter-spacing: 0;
  font-variant-caps: normal;
  text-transform: none;
}

.article .takeaway,
.article .method-close {
  margin: var(--half-rhythm) 3ch var(--rhythm);
  padding: 0;
  border: 0;
  font-style: italic;
  font-weight: 600;
  line-height: var(--rhythm);
  text-indent: 0;
}

.article .method-close {
  margin-top: var(--rhythm);
}

.article .reader-note {
  color: var(--faint);
  font-size: 0.875rem;
  line-height: var(--rhythm);
  margin: var(--rhythm) 0;
  padding-top: calc(var(--half-rhythm) - var(--rule));
  border-top: var(--rule) solid var(--hair);
  text-align: justify;
  text-indent: 0;
}

.prose-control {
  appearance: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-caps);
  font-size: 0.88em;
  font-weight: 400;
  letter-spacing: 0.015em;
  cursor: pointer;
}
.prose-control:hover { border-bottom-style: double; }
.prose-control:focus-visible,
.prediction button:focus-visible,
.technical-note summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.sight-log {
  margin: var(--rhythm) 0;
  border-top: var(--rule) solid var(--ink);
  border-bottom: var(--rule) solid var(--ink);
  padding: calc(var(--half-rhythm) - var(--rule)) 0 var(--half-rhythm);
  font-variant-numeric: lining-nums tabular-nums;
}
.sight-log__head {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  align-items: baseline;
  margin-bottom: var(--half-rhythm);
  padding-bottom: calc(var(--half-rhythm) - var(--rule));
  border-bottom: var(--rule) solid var(--hair);
}
.sight-log__head strong {
  font-family: var(--font-caps);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.025em;
}
.sight-log__head span {
  color: var(--faint);
  font-size: 0.75rem;
  font-style: italic;
}
.sight-log dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--half-rhythm) 2ch;
}
.sight-log dl > div {
  min-width: 0;
  padding-left: 0;
  border-left: 0;
}
.sight-log dt {
  color: var(--faint);
  font-family: var(--font-caps);
  font-size: 0.75rem;
  line-height: var(--rhythm);
  letter-spacing: 0.02em;
}
.sight-log dd {
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: var(--rhythm);
  overflow-wrap: anywhere;
}
.sight-log--split dl > .sight-log__result { grid-column: span 2; }
.sight-log--final dl > .sight-log__result {
  grid-column: 1 / -1;
}

.prediction {
  margin: var(--rhythm) 0;
  padding: calc(var(--half-rhythm) - var(--rule)) 0 var(--half-rhythm);
  border-top: var(--rule) solid var(--hair);
  border-bottom: var(--rule) solid var(--hair);
}
.prediction > p:first-child {
  margin-bottom: var(--half-rhythm);
  text-indent: 0;
}
.prediction-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2ch;
  counter-reset: prediction-option;
}
.prediction button {
  counter-increment: prediction-option;
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: 500 0.875rem/var(--rhythm) var(--font-body);
  font-variant-numeric: lining-nums;
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-underline-offset: 0.16em;
  cursor: pointer;
}
.prediction button::before {
  content: "(" counter(prediction-option, lower-alpha) ") ";
  text-decoration: none;
}
.prediction button:hover,
.prediction button[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
  text-decoration-color: var(--ink);
  font-weight: 700;
}
.prediction-feedback {
  margin: var(--half-rhythm) 0 0 !important;
  color: var(--faint);
  font-size: 0.875rem;
  line-height: var(--rhythm);
  text-indent: 0;
}
.prediction-feedback[data-correct="true"] { color: var(--fix); }
.prediction-feedback[data-correct="false"] { color: var(--corrected); }

.technical-note {
  margin: var(--rhythm) 0;
  padding: calc(var(--half-rhythm) - var(--rule)) 0 var(--half-rhythm);
  border-top: var(--rule) solid var(--hair);
  border-bottom: var(--rule) solid var(--hair);
  color: var(--faint);
  font-size: 0.875rem;
  line-height: var(--rhythm);
}
.technical-note summary {
  padding: 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0;
  font-variant-caps: normal;
  cursor: pointer;
  list-style: none;
}
.technical-note summary::-webkit-details-marker { display: none; }
.technical-note summary::before {
  display: inline-block;
  content: "»";
  margin-right: 0.5ch;
  font-style: normal;
  font-variant-caps: normal;
  letter-spacing: 0;
}
.technical-note[open] summary::before { transform: rotate(90deg); }
.technical-note[open] summary { border-bottom: 0; }
.technical-note p {
  margin: 0 !important;
  padding: var(--half-rhythm) 0 0 3ch;
  text-indent: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.article a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 2.5px;
}
.article a:hover { text-decoration-color: var(--ink); }

/* the two part openers */
h2.part-title {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  border-bottom: 0;
  border-top: 2px solid var(--ink);
  margin-top: calc(var(--rhythm) * 2.5);
  padding-top: var(--half-rhythm);
}
h2.part-title .part-no {
  display: block;
  font: 600 0.7rem/1.4 var(--font-plate);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.15rem;
}
h2.part-title + h2 { margin-top: var(--rhythm); }

.article .draft-note {
  color: var(--faint);
  font-style: italic;
  text-indent: 0;
}
.bench { margin-top: calc(var(--rhythm) * 3); }
.bench > p { text-indent: 0; margin-bottom: var(--half-rhythm); }
.bench > p + figure { margin-top: var(--half-rhythm); }

/* Chapter heads share the same rhythm and rule as the technical furniture. */
h2 {
  font-family: var(--font-caps);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: var(--rhythm);
  letter-spacing: 0.1em;
  font-variant-caps: normal;
  text-align: left;
  text-transform: uppercase;
  border: 0;
  border-bottom: var(--rule) solid var(--ink);
  margin: calc(var(--rhythm) * 1.5) 0 var(--half-rhythm);
  padding: 0 0 calc(var(--half-rhythm) - var(--rule));
  break-after: avoid;
}
h2 .sec-no {
  color: var(--ink);
  font-weight: 500;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0;
  line-height: var(--rhythm);
  font-variant-numeric: lining-nums tabular-nums;
  margin-right: 0.75ch;
  vertical-align: 0.08em;
}

em { font-style: italic; }
strong { font-weight: 800; }

.article .aside {
  font-size: 0.875rem;
  font-style: italic;
  line-height: var(--rhythm);
  color: var(--faint);
  margin: var(--rhythm) 3ch;
  text-align: justify;
  text-indent: 0;
}

/* inline measurements read as data */
.num {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.97em;
  font-weight: 400;
  background: transparent;
  padding: 0 0.04em;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: -0.025em;
  font-variant-numeric: lining-nums;
}

.divider { display: none; }

/* ––––– figures ––––– */


.demo { margin: var(--rhythm) 0; width: 100%; }

/* a photograph, set in a figure's panel like a plate */
.photo img { display: block; width: 100%; height: auto; }

.demo-panel {
  background: var(--paper);
  overflow: hidden;
  animation: figure-in 180ms ease-out;
}

@keyframes figure-in {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.demo canvas {
  display: block;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.demo canvas:focus-visible { outline: 1px solid var(--red); outline-offset: -2px; }
.demo canvas.grab { cursor: grab; }
.demo canvas.grabbing { cursor: grabbing; }

/* ––––– figure chrome –––––
   Everything under and beside a plate is set in the plate's own two
   faces: condensed tracked capitals for names, mono for numbers, ink on
   paper, rules instead of boxes. Shared by both typography modes. */

.demo-controls {
  --rule-dash: repeating-linear-gradient(to right,
      var(--ink) 0 8px, transparent 8px 13px);
  font-family: var(--font-plate);
  color: var(--ink);
  padding: 0 1rem;
  /* the same long-dash rule the plates draw, inset to the plate margin */
  background:
    var(--rule-dash) 1rem 0 / calc(100% - 2rem) 1px no-repeat,
    var(--paper);
}
.demo-controls:empty,
.demo-controls:not(:has(> :not(:empty))) { display: none; }

.ctl-rows:empty,
.ctl-actions:empty,
.ctl-readouts:empty { display: none; }

.ctl-label {
  font: 600 0.74rem/1.2 var(--font-plate);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.ctl-value {
  font: 500 0.86rem/1.35 var(--font-plate-data);
  letter-spacing: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* slider rows: NAME ──●── value */
.ctl-rows { padding: 0.55rem 0 0.35rem; }
.ctl {
  display: grid;
  grid-template-columns: minmax(7.5rem, max-content) minmax(90px, 1fr) minmax(5.5rem, max-content);
  align-items: center;
  column-gap: 1rem;
  min-height: 2rem;
}
.ctl .ctl-value { text-align: right; white-space: nowrap; }

/* buttons and toggles */
.ctl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
  padding: 0.55rem 0;
}
.ctl-rows:not(:empty) + .ctl-actions { padding-top: 0.15rem; }

.demo-btn {
  font: 600 0.74rem/1 var(--font-plate);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem 0.45rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
}
.demo-btn:hover { background: var(--ink); color: var(--paper); }
.demo-btn:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
.demo-btn:disabled {
  border-style: dashed;
  border-color: var(--faint);
  color: var(--faint);
  background: var(--paper);
  cursor: default;
}
.demo-btn.subtle { border-color: var(--hair); }
.demo-btn.subtle:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }

.ctl-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 0.74rem/1 var(--font-plate);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.ctl-check input {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.ctl-check input:checked {
  background: linear-gradient(var(--ink), var(--ink)) center / 7px 7px no-repeat var(--paper);
}
.ctl-check input:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

/* numeric readouts: a data strip of NAME over value cells, divided by
   hairlines like the plate's ruled tables */
/* the panel has no frame, so the strip sits inside the controls' inset
   like the dashed rule above it, with no outer edge lines */
.ctl-readouts {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  border-top: 1px solid var(--hair);
}
.ctl-readout {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.22rem;
  flex: 1 1 9.5rem;
  min-width: 0;
  padding: 0.55rem 1rem 0.6rem;
  box-shadow: -1px 0 0 var(--hair), 0 -1px 0 var(--hair);
}
.ctl-readout.wide { flex: 2 1 19rem; }
/* 6-1's three short readouts stay on one row on a phone */
#demo-motion .ctl-readout { flex-basis: 6rem; }
.ctl-readout:first-child { padding-left: 0; box-shadow: 0 -1px 0 var(--hair); }
.ctl-readout .ctl-label:empty { display: none; }
.ctl-readout .ctl-label { white-space: normal; }
.ctl-readout .ctl-value { overflow-wrap: anywhere; }
.ctl-readout.flagged .ctl-value { font-weight: 700; }

/* legends: the caption reads as the plate's own title block */
figcaption {
  font-family: var(--font-plate);
  max-width: none;
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.4;
  text-align: left;
  text-wrap: pretty;
}
figcaption[data-no]::before {
  content: "Figure " attr(data-no);
  font-weight: 600;
  font-size: 0.78em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0.8em;
}

/* ––––– sliders: a plate scale, hollow index mark ––––– */

input[type="range"] {
  --thumb: 13px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  min-width: 0;
  cursor: pointer;
  /* scale ticks: ten divisions under the track, aligned to thumb travel */
  background:
    linear-gradient(to right, var(--ink) 0 1px, transparent 1px)
      calc(var(--thumb) / 2) calc(50% + 6px) / calc((100% - var(--thumb)) / 10) 4px repeat-x;
}
input[type="range"]:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--ink);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  margin-top: calc(var(--thumb) / -2);
}
input[type="range"]:active::-webkit-slider-thumb { background: var(--ink); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
input[type="range"]::-moz-range-thumb {
  width: var(--thumb);
  height: var(--thumb);
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

/* a slider whose scale marks named stops instead of ten even divisions */
.ctl-scale {
  --thumb: 13px;
  position: relative;
  min-width: 0;
  padding-bottom: 1.05rem;
}
.ctl-scale input[type="range"] { display: block; background: none; }
.ctl-scale-mark {
  position: absolute;
  top: 19px;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at));
  pointer-events: none;
}
.ctl-scale-mark i {
  position: absolute;
  left: 0;
  width: 1px;
  height: 4px;
  background: var(--ink);
}
.ctl-scale-mark span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-family: var(--font-plate);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ctl-scale-mark.end span { transform: translateX(calc(-100% + var(--thumb) / 2)); }
/* its value ("10.1 billion miles") changes length as it runs, so its
   column is fixed and the scale keeps one width */
@media (min-width: 721px) {
  .ctl:has(> .ctl-scale) { grid-template-columns: minmax(7.5rem, max-content) minmax(90px, 1fr) 7rem; }
}

/* ––––– footer ––––– */

.footer {
  max-width: 66ch;
  margin: 3rem auto 0;
  padding: 1.05rem 2rem 3rem;
  font-family: var(--font-body);
}
.footer { border-top: none; }
.footer .sig {
  border-top: 1px solid var(--ink);
  padding-top: 1.05rem;
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 0.3rem;
}
.footer p { font-size: 0.84rem; color: var(--faint); margin: 0; }
.footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 2.5px;
}
.footer a:hover { text-decoration-color: var(--ink); }

/* ––––– phones ––––– */

@media (max-width: 720px) {
  body {
    font-size: 16px;
    line-height: var(--rhythm);
  }
  .pixel-header {
    display: block;
    padding: calc(var(--rhythm) * 2) 1.5ch 0;
  }
  .pixel-title { font-size: 1.75rem; }
  .pixel-tagline { max-width: 34ch; }
  .journal-byline { margin-top: var(--half-rhythm); }
  .article { padding: var(--rhythm) 1.5ch calc(var(--rhythm) * 2); }
  .footer { padding: 0 1.5ch calc(var(--rhythm) * 2); }
  .demo-controls { padding: 0 0.75rem; }
  .ctl {
    grid-template-columns: 1fr max-content;
    row-gap: 0;
    padding: 0.2rem 0;
  }
  .ctl input[type="range"],
  .ctl .ctl-scale { grid-column: 1 / -1; grid-row: 2; }
  .ctl-scale input[type="range"] { grid-column: auto; grid-row: auto; }
  .ctl-readouts { margin: 0; }
  .demo-controls { background-position: 0.75rem 0, 0 0; background-size: calc(100% - 1.5rem) 1px, auto; }
  .ctl-readout { padding: 0.5rem 0.75rem 0.55rem; }
  /* a wide readout takes a row of its own on a phone, flush with the strip's
     left edge like the first cell */
  .ctl-readout.wide { flex-basis: 100%; padding-left: 0; box-shadow: 0 -1px 0 var(--hair); }
  .sight-log dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sight-log--split dl > .sight-log__result,
  .sight-log--final dl > .sight-log__result { grid-column: auto; }
  .sight-log__head { align-items: flex-start; flex-direction: column; gap: 0.12rem; }
  .prediction-options { display: grid; grid-template-columns: 1fr; }
  .prediction button { text-align: left; }
  .article .method-thesis,
  .article .takeaway,
  .article .method-close {
    margin-left: 3ch;
    margin-right: 3ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-panel { animation: none; }
  html { scroll-behavior: auto; }
}

/* Detail A: your view of the star, a small drawing set in the caption.
   Under the figure number in the margin; floated beside the text on phones */
.caption-detail { display: block; margin: 0.2rem 0 0.6rem; touch-action: none; }
@media (max-width: 720px) {
  .caption-detail { float: right; margin: 0.15rem 0 0.4rem 0.8rem; }
}

/* a worked sum as an engineering data sheet, after a sight-reduction
   form. The printed form (title, labels, line numbers) is set in the plate
   face; the figures entered on it are typed in monospace, so degrees,
   minutes and N/S/E/W line up down each column. One frame, one rule under
   the title, hairlines between lines, and an ink rule over each result. */
.article .sheet {
  --sheet-pad: 0.8em;
  width: 100%;
  max-width: 30rem;
  margin: var(--half-rhythm) 0 var(--rhythm);
  border-collapse: collapse;
  border: 1px solid var(--ink);
  font-family: var(--font-plate);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.25;
}
.article .sheet caption {
  padding: 0.55em var(--sheet-pad) 0.5em;
  border: 1px solid var(--ink);
  border-bottom: 0;
  font: 600 0.66rem/1.2 var(--font-plate);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
}
.article .sheet caption span + span {
  float: right;
  margin-left: 2ch;
  font-weight: 500;
  color: var(--faint);
}
.article .sheet th,
.article .sheet td {
  padding: 0.5em 0 0.45em;
  border-top: 1px solid var(--hair);
  vertical-align: baseline;
}
.article .sheet caption + tbody tr:first-child > *,
.article .sheet thead th { border-top: 1px solid var(--ink); }
.article .sheet thead th {
  padding-top: 0.6em;
  padding-bottom: 0.3em;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  color: var(--faint);
}
/* the same insets as the figures below, which are set larger */
.article .sheet thead th:not(:first-child) {
  padding-left: calc(1.6 * 0.82rem);
  padding-right: calc(0.8 * 0.82rem);
  text-align: center;
}
.article .sheet thead + tbody tr:first-child > * { border-top: 0; }
.article .sheet .no {
  width: 1.4em;
  padding-left: var(--sheet-pad);
  padding-right: 0.8em;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--faint);
  text-align: left;
}
.article .sheet tbody th {
  padding-right: 1em;
  font-size: 0.8rem;
  font-weight: 450;
  text-align: left;
}
.article .sheet .op {
  width: 1.4em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
}
.article .sheet .val {
  width: 1%;
  padding-left: 1.6em;
  padding-right: var(--sheet-pad);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: -0.02em;
  text-align: right;
  white-space: nowrap;
}
.article .sheet .op + .val { padding-left: 0.3em; }
.article .sheet .ang { display: inline-flex; justify-content: flex-end; }
.article .sheet .deg { display: inline-block; min-width: 4ch; text-align: right; }
.article .sheet .min { display: inline-block; min-width: 6ch; text-align: right; }
.article .sheet .hem { display: inline-block; width: 2ch; text-align: right; }
.article .sheet tr.total > *,
.article .sheet tbody.result tr:first-child > * { border-top: 1px solid var(--ink); }
.article .sheet tr.total th,
.article .sheet tr.total .val,
.article .sheet tbody.result th,
.article .sheet tbody.result .val { font-weight: 700; }
.article .sheet tbody.result tr:first-child > * { padding-top: 0.7em; }
.article .sheet tbody.result { border-top: 3px double var(--ink); }
/* a sight not yet taken in the worked example's figure */
.article .sheet td.pending { position: relative; }
.article .sheet td.pending .ang { visibility: hidden; }
.article .sheet td.pending::after {
  content: "To measure";
  position: absolute;
  right: calc(0.8 * 0.82rem);
  top: 50%;
  transform: translateY(-50%);
  font: 500 0.6rem/1 var(--font-plate);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.article .sheet .sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.article .sheet + p { text-indent: 0; }
@media (max-width: 560px) {
  .article .sheet { --sheet-pad: 0.6em; }
  .article .sheet tbody th { font-size: 0.74rem; padding-right: 0.5em; }
  .article .sheet .val, .article .sheet .op { font-size: 0.76rem; }
  .article .sheet .val { padding-left: 1em; }
  .article .sheet thead th:not(:first-child) {
    padding-left: 0.76rem;
    padding-right: calc(0.6 * 0.76rem);
  }
  .article .sheet .no { padding-right: 0.6em; }
}

/* the worked example's five sheets as one sight reduction form (gathered
   by demos/worked.js). The form is printed whole; a block past the current
   step shows its labels with nothing entered. */
.article .sight-form {
  margin: var(--rhythm) 0 var(--half-rhythm);
  border: 1px solid var(--ink);
  container: sightform / inline-size;
}
.article .sight-form > header {
  display: flex; justify-content: space-between; gap: 2ch;
  padding: 0.6em 0.8em 0.55em;
  border-bottom: 1px solid var(--ink);
  font: 600 0.7rem/1.2 var(--font-plate);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.article .sight-form > header span + span { font-weight: 500; }
.article .sight-form .form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.article .sight-form .sheet { max-width: none; margin: 0; border: 0; align-self: start; }
.article .sight-form .cell { border-top: 1px solid var(--ink); }
.article .sight-form .cell:nth-child(-n+2) { border-top: 0; }
.article .sight-form .cell:nth-child(odd):not(.span) { border-right: 1px solid var(--ink); }
.article .sight-form .cell.span { grid-column: 1 / -1; }
.article .sight-form .cell.span + .cell { border-right: 1px solid var(--ink); }
.article .sight-form .cell.span + .cell + .cell { border-right: 0; }
.article .sight-form .sheet caption { border: 0; }
.article .sight-form .sheet caption span + span { color: var(--ink); }
.article .sight-form .cell.blank .val,
.article .sight-form .cell.blank .val > *,
.article .sight-form .cell.blank .op { color: transparent; }
.article .sight-form .cell.blank th,
.article .sight-form .cell.blank caption,
.article .sight-form .cell.blank caption span + span { color: var(--faint); }
.article .sight-form .cell.blank td.pending::after { content: none; }
.article .sight-form .cell.now caption span:first-child::before { content: "▸ "; color: var(--red); }
/* one column when the form itself is narrow, wherever the page puts it:
   two blocks side by side each need room for a Vega and an Arcturus column */
@container sightform (max-width: 660px) {
  .article .sight-form .form-grid { grid-template-columns: 1fr; }
  .article .sight-form .cell,
  .article .sight-form .cell.span + .cell,
  .article .sight-form .cell:nth-child(odd):not(.span) { border-right: 0; border-top: 1px solid var(--ink); }
  .article .sight-form .cell:first-child { border-top: 0; }
  /* the date and time are lines 02 and 03 of the first block */
  .article .sight-form > header span + span { display: none; }
}

/* an excerpt of the almanac's daily page, set in the body face as the
   book is, with the line the reader looks up marked */
.article .alm {
  margin: var(--half-rhythm) 0 var(--rhythm);
  max-width: 30rem;
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  font: 400 0.8rem/1.3 var(--font-body);
  font-variant-numeric: lining-nums tabular-nums;
}
.article .alm > header {
  display: flex; justify-content: space-between;
  padding: 0.35em 0.2em; border-bottom: 1px solid var(--ink);
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.article .alm > header span + span { font-weight: 400; font-style: italic; text-transform: none; }
.article .alm .cols { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
.article .alm .cols > table + table { border-left: 1px solid var(--ink); }
.article .alm table { width: 100%; border-collapse: collapse; }
.article .alm th, .article .alm td {
  padding: 0.08em 0.7em; text-align: right; font-weight: 400; white-space: nowrap;
}
.article .alm thead th {
  padding-top: 0.35em; padding-bottom: 0.3em;
  border-bottom: 1px solid var(--ink); font-weight: 700; text-align: center; text-transform: uppercase;
}
.article .alm thead th sup { text-transform: none; font-size: 0.7em; line-height: 0; }
.article .alm td:first-child, .article .alm th:first-child { text-align: left; }
.article .alm tr.dots td { text-align: center; color: var(--faint); letter-spacing: 0.3em; }
.article .alm tr.hit td { font-weight: 700; }
.article .alm tr.hit td:first-child::before { content: "▸"; color: var(--red); margin-left: -0.75em; margin-right: 0.15em; }
.article .alm + .alm-note {
  margin: calc(-1 * var(--half-rhythm)) 0 var(--half-rhythm);
  max-width: 30rem; text-indent: 0;
  font: 400 0.78rem/1.4 var(--font-plate); color: var(--faint);
}

/* the worked example's steps: one shows at a time, under its figure; the
   number sits in the same small circle the figure's tabs use */
.article .worked-stage > p:first-child { margin-top: 0; }
.article .stage-title {
  margin: var(--half-rhythm) 0 0;
  font-weight: 700;
  text-indent: 0;
}
.article .stage-title + p { text-indent: 0; }
.article .step-key {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  margin-right: 0.5em;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font: 700 0.7em/1 var(--font-plate);
  font-variant-numeric: lining-nums tabular-nums;
  vertical-align: 0.12em;
}
.demo-panel .worked-stages { padding: 0 0 var(--half-rhythm); }
#demo-worked .demo-controls,
#demo-twostar .demo-controls,
#demo-almanac .demo-controls { background: var(--paper); }
