/* Page typography: the web-first presentation. Loaded after style.css,
   and every rule is scoped under `html` so it wins over the base rules
   there at equal class weight. */



html body {
  font: 1rem/1.6 var(--font-body);
  font-variant-numeric: normal;
  font-feature-settings: normal;
  font-optical-sizing: auto;
  font-synthesis: weight style;
  text-rendering: auto;
  -webkit-font-smoothing: auto;
}

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

html .home-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2.5px;
}

/* title block: sits at the head of the text column and scrolls away with
   it. Set in the article's face; the byline under a long-dash rule borrows
   the figure frame, so the page opens with the same drafting voice. */
html .pixel-header {
  display: block;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3.4rem 2rem 0;
  text-align: left;
}

/* the title takes the plates' tracked capitals */
html .pixel-title {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.08;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

html .pixel-tagline {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.38;
  color: var(--ink);
  max-width: 31rem;
  text-wrap: balance;
  margin: 0 0 1.5rem;
}

html .journal-byline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding-top: 0.7rem;
  font: 600 0.74rem/1.2 var(--font-plate);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}

html .pixel-rule {
  display: none;
}

html .article {
  max-width: 40rem;
  padding: 2.4rem 2rem 3rem;
}

html .article p {
  margin: 0 0 0.85rem;
  text-align: left;
  text-align-last: auto;
  text-wrap: wrap;
  -webkit-hyphens: manual;
  hyphens: manual;
  hanging-punctuation: none;
  orphans: 2;
  widows: 2;
}

html .article p + p {
  text-indent: 0;
}

html .article .steps {
  margin: 0 0 0.85rem;
  padding-left: 1.4rem;
}

html .article .method-thesis {
  margin: 1.15rem 0 1.2rem;
  padding: 0 0 0 0.85rem;
  border: 0;
  border-left: 2px solid var(--red);
  font-size: inherit;
  font-style: normal;
  line-height: inherit;
}

html .beat-title {
  margin: 1.55rem 0 0.45rem;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.055em;
  font-variant-caps: normal;
  text-transform: uppercase;
}

html .article .takeaway,
html .article .method-close {
  margin: 1.1rem 0 1.3rem;
  padding: 0 0 0 0.85rem;
  border: 0;
  border-left: 2px solid var(--constraint);
  font-style: normal;
  font-weight: 600;
  line-height: inherit;
}

html .article .method-close {
  margin-top: 1.5rem;
  border-left-color: var(--fix);
}

html .article .reader-note {
  color: var(--faint);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.55;
  margin: 1rem 0 1.4rem;
  padding-top: 0;
  border: 0;
  text-align: left;
}

html .prose-control {
  border-bottom: 1px solid currentColor;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

html .prose-control:hover {
  color: var(--ink);
  border-bottom-style: solid;
}

html .sight-log {
  margin: 1.3rem 0 1.45rem;
  padding: 0.7rem 0 0.8rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}

html .sight-log__head {
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0;
  border: 0;
}

html .sight-log__head strong {
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

html .sight-log__head span {
  font-size: 0.72rem;
  font-style: normal;
}

html .sight-log dl {
  gap: 0.55rem 1rem;
}

html .sight-log dl > div {
  padding-left: 0.52rem;
  border-left: 2px solid var(--hair);
}

html .sight-log dt {
  font-family: var(--font-body);
  font-size: 0.68rem;
  line-height: 1.25;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

html .sight-log dd {
  margin-top: 0.14rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.35;
}

html .sight-log dl > div:first-child {
  border-left-color: var(--measured);
}

html .sight-log--split dl > div:nth-child(2),
html .sight-log--split dl > div:nth-child(3),
html .sight-log--split dl > div:nth-child(4) {
  border-left-color: var(--ephemeris);
}

html .sight-log dl > .sight-log__result {
  border-left-color: var(--corrected);
}

html .sight-log--final dl > .sight-log__result {
  border-left-color: var(--fix);
}

html .prediction {
  margin: 1.25rem 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

html .prediction > p:first-child {
  margin-bottom: 0.65rem;
}

html .prediction-options {
  gap: 0.45rem;
}

html .prediction button {
  border: 1px solid var(--ink);
  padding: 0.34rem 0.65rem;
  background: var(--paper);
  color: var(--ink);
  font: 700 0.76rem/1.35 var(--font-body);
  font-variant-numeric: normal;
  text-decoration: none;
}

html .prediction button::before {
  content: none;
}

html .prediction button:hover,
html .prediction button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

html .prediction-feedback {
  margin: 0.65rem 0 0 !important;
  font-size: 0.82rem;
  line-height: inherit;
}

html .technical-note {
  margin: 0.95rem 0 1.25rem;
  padding: 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-size: 0.82rem;
  line-height: inherit;
}

html .technical-note summary {
  padding: 0.58rem 0;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0;
  font-variant-caps: normal;
  list-style: disclosure-closed;
}

html .technical-note summary::-webkit-details-marker {
  display: inline;
}

html .technical-note summary::before {
  content: none;
  transform: none;
}

html .technical-note[open] summary {
  border-bottom: 1px solid var(--hair);
  list-style: disclosure-open;
}

html .technical-note p {
  padding: 0.72rem 0 0.8rem;
}

html h2 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  font-variant-caps: normal;
  text-align: left;
  text-transform: none;
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 2.3rem 0 0.85rem;
  padding: 1.05rem 0 0;
}

html h2.part-title {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  border-top-width: 3px;
  margin-top: 3.2rem;
  padding-top: 1.05rem;
}

/* the article's first part opens right under the title block */
html .article > h2.part-title:first-child {
  margin-top: 0;
}

html h2.part-title + h2 {
  margin-top: 1.2rem;
}

html h2 .sec-no {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: inherit;
  letter-spacing: 0;
  margin-right: 0.55rem;
  vertical-align: 0;
  font-variant-numeric: lining-nums tabular-nums;
}

html h2 .sec-no[data-original] {
  font-size: 0;
}

html h2 .sec-no[data-original]::before {
  content: attr(data-original);
  font-size: 1rem;
}

html strong {
  font-weight: 700;
}

html .article .aside {
  color: var(--faint);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.55;
  margin: 1.1rem 0;
  text-align: left;
}

/* worked numbers in the prose are typeset, not boxed: the body face with
   lining figures, the way a NASA technical report sets a value or a short
   sum in running text */
html .num {
  font-family: var(--font-body);
  font-size: 1em;
  font-weight: 400;
  background: none;
  padding: 0;
  font-variant-numeric: lining-nums tabular-nums;
}

/* a displayed equation, NASA report style: set on its own line, centered
   in the text column, numbered in parentheses at the right margin */
html .article { counter-reset: equation; }
html .equation {
  counter-increment: equation;
  display: grid;
  grid-template-columns: minmax(2rem, 1fr) minmax(0, auto) minmax(2rem, 1fr);
  align-items: baseline;
  margin: 0.3rem 0 1.5rem;
  font-family: var(--font-body);
  font-variant-numeric: lining-nums tabular-nums;
}
/* on a narrow screen the equation breaks after "=", never inside a side */
html .equation .eq-body { grid-column: 2; text-align: center; }
html .equation .eq-body > span { white-space: nowrap; }
html .equation::after {
  content: "(" counter(equation) ")";
  grid-column: 3;
  justify-self: end;
}

html .article code {
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: 0;
}

html .demo {
  margin: 1.4rem 0;
}


html .footer {
  max-width: 40rem;
  font-family: var(--font-body);
}

@media (max-width: 720px) {
  html body {
    font-size: 1rem;
    line-height: 1.58;
  }

  html .pixel-header {
    padding: 2.6rem 1.1rem 0;
  }

  html .pixel-title {
    font-size: 1.75rem;
  }

  html .pixel-tagline {
    font-size: 1.08rem;
    margin-bottom: 1.25rem;
  }

  html .article {
    padding: 1.6rem 1.1rem 2rem;
  }

  html .footer {
    padding: 0 1.1rem 2.2rem;
  }

  html .sight-log__head {
    gap: 0.12rem;
  }

  html .article .method-thesis,
  html .article .takeaway,
  html .article .method-close {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ––––––––––––––––––––––––––––––––––––––––––––––––
   Document layout: one column on every screen, set like an engineering
   handbook. A margin column on the left carries section numbers, term
   definitions and figure captions; paragraphs keep a reading measure in
   the text column; figures run a little wider, out to the right.
   –––––––––––––––––––––––––––––––––––––––––––––––– */

:root {
  --m: 9.75rem;          /* margin column */
  --m-gap: 1.6rem;
  --text: 1fr;           /* text column */
  --over: 0rem;          /* how far figures reach past the text */
  --page: 47rem;         /* margin + gap + widest figure */
}

html .pixel-header,
html .article,
html .footer {
  max-width: calc(var(--page) + 4rem);
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

html .article {
  display: grid;
  grid-template-columns:
    [margin-start] var(--m) [margin-end] var(--m-gap)
    [text-start] minmax(0, var(--text)) [text-end] minmax(0, var(--over)) [wide-end];
  align-items: start;
  padding-top: 2.4rem;
}

html :is(.article, .bench) > * { grid-column: text-start / text-end; }

html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench) {
  grid-column: margin-start / wide-end;
  display: grid;
  grid-template-columns: subgrid;
}

html .bench { margin-top: 3rem; }

/* section heads: number in the margin, title in the text column, the
   plates' long-dash rule across the full width */
html .article :is(h2, h3) {
  align-items: baseline;
  margin: 2.6rem 0 1rem;
  padding: 0.9rem 0 0;
  border: 0;
  background: repeating-linear-gradient(to right, var(--ink) 0 8px, transparent 8px 13px) 0 0 / 100% 1px no-repeat;
  font: 600 1.15rem/1.3 var(--font-display);
  letter-spacing: 0;
}

html .article :is(h2, h3) .sec-no {
  grid-column: margin-start / margin-end;
  margin: 0;
  font: inherit;
  color: var(--red);
  letter-spacing: 0.02em;
}

html .article :is(h2, h3) .sec-title { grid-column: text-start / text-end; }

html .article h2.part-title {
  margin-top: 3.4rem;
  padding-top: 1rem;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2px no-repeat;
  font-size: 1.5rem;
}

/* the opening part needs no rule: the title block above already sets it off */
html .article > h2.part-title:first-child {
  margin-top: 0.4rem;
  padding-top: 0;
  background: none;
}
html .article h2.part-title + h2 {
  margin-top: 1.1rem;
  padding-top: 0;
  background: none;
}

html .article h2.part-title .sec-no {
  font: 600 0.72rem/2.6 var(--font-plate);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

html .article h3.sub {
  margin: 2.2rem 0 0.9rem;
  font-size: 1rem;
  /* only sections take the long-dash rule; a sub-section sits under its own */
  background: none;
  padding-top: 0;
}

/* term definitions sit beside the paragraph that introduces them */
html .gloss {
  grid-column: margin-start / margin-end;
  margin-top: 0.3rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--ink);
  font: 400 0.875rem/1.4 var(--font-plate);
  color: var(--ink);
}

html .gloss-term {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* a checklist-style NOTE box holds each takeaway */
html .article .note {
  position: relative;
  margin: 1.2rem 0 1.4rem;
  padding: 0.9rem 1rem 0.25rem;
  border: 1px solid var(--ink);
}

html .article .note p { margin: 0 0 0.6rem; }

html .note-label {
  position: absolute;
  top: -0.55rem;
  left: 0.8rem;
  padding: 0 0.4rem;
  background: var(--paper);
  font: 600 0.72rem/1 var(--font-plate);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* figures: drawing from the text column outward, caption in the margin */
html .article figure.demo {
  align-items: start;
  margin: 1.4rem 0 1.8rem;
}

html .article figure.demo > .demo-panel { grid-column: text-start / wide-end; grid-row: 1; }
/* a small figure that keeps to the text column */
html .article figure.demo.in-text > .demo-panel { grid-column: text-start / text-end; }

html .article figure.demo > figcaption {
  grid-column: margin-start / margin-end;
  grid-row: 1;
  margin: 0.3rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ink);
  font-size: 0.875rem;
  line-height: 1.4;
}

html .article figure.demo > figcaption[data-no]::before {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
}

/* the figure's title opens its caption, under the number, the way a
   technical report sets "Figure 2-4. Title" */
html .article figure.demo .fig-title {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 700;
  line-height: 1.3;
}

/* wide screens: a reading measure for text, figures reach 8rem past it */
@media (min-width: 1100px) {
  :root {
    --text: 37rem;
    --over: 8rem;
    --page: calc(var(--m) + var(--m-gap) + 45rem);
  }
}

/* big monitors: everything is in rem, so one step scales the whole page */
@media (min-width: 1600px) {
  html { font-size: 17px; }
}

/* ––––– spacing scale –––––
   One set of steps for every vertical gap. Grid items' margins do not
   collapse, so each gap is the margin below one block plus the margin
   above the next; the sibling rules below keep each pairing on the scale.
   Phones use the same single-column grid so the arithmetic matches. */
:root {
  --para: 0.85rem;     /* between paragraphs and list items' blocks */
  --line: 1.6rem;      /* one body line: around a NOTE box, head to figure */
  --block: 2.4rem;     /* around a figure */
  --section: 3.2rem;   /* above a section rule */
  --part: 4.8rem;      /* above a part, and between the title block and the text */
}

html .article { padding-top: var(--part); }
html .article > h2.part-title:first-child { margin-top: 0; }

html .article :is(p, ul, ol) { margin-top: 0; margin-bottom: var(--para); }
html .article .note p { margin-bottom: 0.6rem; }

html .article figure.demo { margin: calc(var(--block) - var(--para)) 0 var(--block); }
html .article .note { margin: calc(var(--line) - var(--para)) 0 var(--line); }
html .article .note + figure.demo { margin-top: calc(var(--block) - var(--line)); }

html .article :is(h2, h3) { margin-top: calc(var(--section) - var(--para)); margin-bottom: 1rem; }
html .article figure.demo + :is(h2, h3) { margin-top: calc(var(--section) - var(--block)); }
html .article .note + :is(h2, h3) { margin-top: calc(var(--section) - var(--line)); }
html .article :is(h2, h3) + figure.demo { margin-top: calc(var(--line) - 1rem); }

html .article h2.part-title { margin-top: calc(var(--part) - var(--para)); }
html .article figure.demo + h2.part-title { margin-top: calc(var(--part) - var(--block)); }
html .article h2.part-title + h2 { margin-top: calc(var(--line) - 1rem); }

html .bench { margin-top: 0; }
html .bench > h2,
html .article h3.sub { margin-top: calc(var(--section) - var(--para)); margin-bottom: 1rem; }

/* margin notes hang from the top of what they annotate: a definition's
   term sits on its paragraph's first baseline, a caption's rule meets the
   top of its figure */
html .gloss { margin-top: 0; }
html .article figure.demo > figcaption { margin-top: 0; font-weight: 400; }

/* title block: subtitle tucked under the title, byline one line below */
html .pixel-tagline { margin-bottom: var(--line); }
html .journal-byline { padding-top: 0; }

/* wide screens: a step larger body type keeps the 37rem measure near
   70 characters a line */
@media (min-width: 1100px) {
  html body { font-size: 1.0625rem; }
}

/* phones: one plain column; definitions and captions fold inline */
@media (max-width: 720px) {
  html .pixel-header,
  html .article,
  html .footer {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  html .article { display: block; padding-top: 1.6rem; }
  html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench) { display: block; }
  /* heads keep their own two-column grid; the selector has to match the
     subgrid rule's weight to replace it */
  html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench):is(h2, h3) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 0.7rem;
  }
  html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench):is(h2.part-title) {
    grid-template-columns: minmax(0, 1fr);
  }
  html .article :is(h2, h3) .sec-no { grid-column: 1; }
  html .article :is(h2, h3) .sec-title { grid-column: 2; }
  html .article h2.part-title :is(.sec-no, .sec-title) { grid-column: 1; }
  /* inline, a black rule would read as a section break: soften it */
  html .gloss { max-width: 24rem; margin: 0.2rem 0 0.9rem; padding-top: 0.35rem; border-top-color: var(--hair); }
  html .article figure.demo > figcaption {
    margin: 0.55rem 0 0;
    padding-top: 0;
    border-top: 0;
    font-size: 0.95rem;
  }
  html .article figure.demo > figcaption[data-no]::before {
    display: inline;
    margin: 0 0.8em 0 0;
    font-size: 0.78em;
  }
  html .article figure.demo .fig-title { display: inline; margin: 0; }
  html .article figure.demo .fig-title::after { content: "\A"; white-space: pre; }
}

/* phones, spacing: the same single-column grid as wider screens, so the
   spacing scale adds up the same way (block margins would collapse) */
@media (max-width: 720px) {
  :root { --block: 1.8rem; --section: 2.6rem; --part: 3.6rem; }
  html .article {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding-top: var(--section);
  }
  html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench):is(.bench) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  html :is(.article, .bench) > * { grid-column: 1 / -1; }
  html :is(.article, .bench) > :is(h2, h3, figure.demo, .bench) { grid-column: 1 / -1; }
  html .gloss { margin: 0 0 0.75rem; }
  html .article figure.demo > figcaption { margin-top: 0.55rem; }
}
