/* Latent Node — a laboratory's printed record.
   Warm paper, ink, one oxide red reserved for numbers and structural marks.
   Print conventions: dotted leaders, spec tables, rules top-and-bottom, no
   vertical rules, section marks hanging in the margin. */

:root {
  --paper:      #f3f0e9;
  --paper-2:    #eae6dc;
  --paper-3:    #e2ddd1;
  --ink:        #1b1a17;
  --ink-mid:    #56534c;
  --ink-faint:  #8b877e;
  --rule:       #cfc9bb;
  --rule-firm:  #8b877e;
  --oxide:      #ad3a1c;
  --oxide-pale: #ddc3b8;
  --measure:    34rem;
  --margin-col: 5.5rem;
  --page:       68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Literata', Charter, Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* paper tooth */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 2rem;
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============================== masthead ============================== */

.masthead { padding: clamp(3rem, 9vh, 6rem) 0 0; }

.imprint {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--ink-faint);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule-firm);
}
.imprint .oxide { color: var(--oxide); }

.wordmark {
  font-family: 'Zilla Slab', 'Literata', serif;
  font-weight: 600;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 2.5rem 0 0;
}
.wordmark .mark {
  color: var(--oxide);
  font-weight: 400;
}

.thesis {
  font-family: 'Zilla Slab', serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.35;
  color: var(--ink-mid);
  margin: 1.25rem 0 0;
  max-width: 32rem;
}

/* the double rule under the masthead is a print convention */
.double-rule {
  margin: 2.25rem 0 0;
  border: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 4px;
}

/* ============================== contents ============================== */

.contents-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding: 1rem 0 0.6rem;
  color: var(--ink-faint);
}
.contents-head .label { color: var(--oxide); }

.entry {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.5rem 0.75rem 1.5rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
  transition: background 200ms ease;
}
.entry:last-of-type { border-bottom: 1px solid var(--rule); }
a.entry:hover { background: var(--paper-2); }

.entry-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8125rem;
  color: var(--oxide);
  letter-spacing: 0.04em;
  padding-top: 0.35rem;
}
a.entry:hover .entry-num { text-decoration: underline; text-underline-offset: 3px; }

/* title, dotted leader, result — the contents-page device */
.entry-line {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
}
.entry-title {
  font-family: 'Zilla Slab', serif;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.1vw, 1.45rem);
  line-height: 1.25;
  margin: 0;
  flex: 0 1 auto;
}
.leader {
  flex: 1 1 auto;
  min-width: 1.5rem;
  height: 0.55em;
  border-bottom: 1px dotted var(--rule-firm);
  opacity: 0.7;
}
a.entry:hover .leader { border-bottom-style: solid; border-color: var(--oxide-pale); opacity: 1; }

.entry-result {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--oxide);
  white-space: nowrap;
  flex: 0 0 auto;
}

.entry-blurb {
  margin: 0.6rem 0 0;
  color: var(--ink-mid);
  font-size: 0.9875rem;
  line-height: 1.6;
  max-width: 42rem;
}

.entry-meta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--ink-faint);
}
.entry-meta .go { color: var(--oxide); }
.entry-meta .pending { font-style: normal; }

@media (prefers-reduced-motion: no-preference) {
  .stagger > * {
    opacity: 0;
    animation: fade 520ms ease forwards;
  }
  @keyframes fade { to { opacity: 1; } }
}

/* ============================== notice ============================== */

.notice {
  margin: 4rem 0 3rem;
  border: 1px solid var(--ink);
  background: var(--paper-2);
}
.notice-bar {
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.notice-body { padding: 1.75rem 1.75rem 1.9rem; }
.notice-lede {
  font-family: 'Zilla Slab', serif;
  font-weight: 500;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 0.9rem;
}
.notice-body > p {
  margin: 0 0 1.75rem;
  color: var(--ink-mid);
  max-width: 40rem;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 1.9rem;
}
.spec th, .spec td {
  text-align: left;
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
.spec tr:first-child th, .spec tr:first-child td { border-top: 1px solid var(--rule-firm); }
.spec th {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  color: var(--oxide);
  white-space: nowrap;
  width: 8.5rem;
  font-size: 0.875rem;
}
.spec td { color: var(--ink-mid); }

.cta {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--oxide);
  padding: 0.85rem 1.6rem;
  text-decoration: none;
  border: 1px solid var(--oxide);
  transition: background 160ms ease, color 160ms ease;
}
.cta:hover { background: var(--ink); border-color: var(--ink); }

/* ============================== colophon ============================== */

.colophon {
  border-top: 3px solid var(--ink);
  margin-top: 1rem;
  padding: 1rem 0 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  justify-content: space-between;
  color: var(--ink-faint);
}
.colophon a { color: var(--ink-mid); text-decoration: none; border-bottom: 1px solid var(--rule-firm); }
.colophon a:hover { color: var(--oxide); border-color: var(--oxide); }

/* ============================== article ============================== */

.runhead {
  border-bottom: 1px solid var(--ink);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 50;
}
.runhead .wrap { display: flex; justify-content: space-between; gap: 1.5rem; align-items: baseline; }
.runhead a { text-decoration: none; color: var(--ink-mid); }
.runhead a:hover { color: var(--oxide); }
.runhead .home { color: var(--ink); }

.article-head { padding: clamp(2.5rem, 7vh, 4.5rem) 0 0; }
.article-title {
  font-family: 'Zilla Slab', serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0.9rem 0 0;
  max-width: 22ch;
}
.article-standfirst {
  font-family: 'Zilla Slab', serif;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--ink-mid);
  max-width: 38rem;
  margin: 1.25rem 0 2rem;
}
.article-spec { max-width: 34rem; margin-bottom: 3rem; }

.hero { margin: 0 0 3rem; border: 1px solid var(--rule-firm); }
.hero img { display: block; width: 100%; height: auto; background: #fff; }

/* reading column, with a margin lane for section marks */
.prose {
  max-width: var(--measure);
  margin-left: var(--margin-col);
  padding-bottom: 4rem;
  font-size: 1.1875rem;
  line-height: 1.72;
}
@media (max-width: 60rem) { .prose { margin-left: 0; } }

.prose > p:first-of-type { font-size: 1.25rem; line-height: 1.6; }

.prose h2 {
  font-family: 'Zilla Slab', serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 3rem 0 1rem;
  position: relative;
}
/* the oxide mark hanging in the margin lane */
.prose h2::before {
  content: '';
  position: absolute;
  left: calc(var(--margin-col) * -1);
  top: 0.72em;
  width: 2.25rem;
  height: 3px;
  background: var(--oxide);
}
@media (max-width: 60rem) { .prose h2::before { display: none; } }

.prose h3 {
  font-family: 'Zilla Slab', serif;
  font-weight: 600;
  font-size: 1.18rem;
  margin: 2.25rem 0 0.6rem;
}
.prose h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oxide);
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}

.prose p { margin: 0 0 1.3rem; }
.prose strong { font-weight: 600; }

.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--oxide);
  transition: background 160ms ease;
}
.prose a:hover { background: var(--oxide-pale); }

.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--oxide); }

.prose blockquote {
  margin: 1.9rem 0;
  padding: 0 0 0 1.4rem;
  border-left: 3px solid var(--oxide-pale);
  color: var(--ink-mid);
}

.prose hr { border: 0; height: 1px; background: var(--rule); margin: 2.75rem 0; }

.prose code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.84em;
  background: var(--paper-3);
  padding: 0.1em 0.35em;
  color: #7a2d13;
}
.prose pre {
  background: var(--paper-2);
  border-top: 1px solid var(--rule-firm);
  border-bottom: 1px solid var(--rule-firm);
  padding: 1.15rem 1.3rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: var(--ink); font-size: inherit; }

/* figures break right, into the wide margin */
.prose figure {
  margin: 2.5rem 0;
  width: min(48rem, calc(100vw - 4rem));
}
.prose figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--rule-firm);
}
.prose figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-top: 0.6rem;
  line-height: 1.5;
}

/* data tables: heavy top and bottom, no vertical rules */
.table-scroll { overflow-x: auto; margin: 0 0 1.7rem; width: min(48rem, calc(100vw - 4rem)); }
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}
.prose thead { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.prose tbody { border-bottom: 2px solid var(--ink); }
.prose th, .prose td { padding: 0.55rem 1rem 0.55rem 0; text-align: left; vertical-align: top; }
.prose th {
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.prose tbody tr + tr { border-top: 1px solid var(--rule); }

.endnote {
  border-top: 3px solid var(--ink);
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.endnote p { margin: 0; color: var(--ink-mid); max-width: 26rem; font-size: 1rem; }

@media (max-width: 46rem) {
  .wrap { padding: 0 1.25rem; }
  .entry { grid-template-columns: 2.75rem minmax(0, 1fr); padding: 1.25rem 0 1.25rem 0; }
  .entry-line { flex-wrap: wrap; }
  .leader { display: none; }
  .entry-result { order: -1; }
  .prose figure, .table-scroll { width: 100%; }
}
