/* ============================================================
   Quant etc. — long-form article styles
   Loaded after site.css. Same language as the home page: bold
   Satoshi, flush left, nothing but text and underlines.
   ============================================================ */

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 8vh 4vw 0;
}

/* Wide elements break the measure without breaking the flow. */
.article > .wide {
  width: min(1100px, 92vw);
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}

/* ---- Masthead ---- */
.home {
  display: inline-block;
  margin-bottom: 12vh;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  letter-spacing: -0.03em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: opacity 140ms linear;
}
.home:hover { opacity: 0.6; }

.article-kicker {
  display: block;
  color: var(--ink-3);
  font-weight: 500;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.4em;
}

.article-title {
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

.article-standfirst {
  margin-top: 1.2rem;
  color: var(--ink-2);
  font-weight: 300;
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
  line-height: 1.24;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

.article-meta {
  display: flex;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: 2.6rem;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 1.02rem;
}
.article-meta .author { color: var(--ink-2); }
.article-meta time { font-variant-numeric: tabular-nums; }

/* Placeholder notice */
.article-status {
  margin-top: 2.2rem;
  color: var(--ink-3);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 60ch;
  text-wrap: pretty;
}

/* ============================================================
   Body type
   ============================================================ */

.article-body {
  margin-top: 8vh;
  font-weight: 400;
  font-size: clamp(1.14rem, 1.35vw, 1.28rem);
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.003em;
}

.article-body > * + * { margin-top: 1.5em; }

.article-body p { text-wrap: pretty; }

.article-body .lede {
  font-size: 1.16em;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
}

.article-body strong { font-weight: 700; color: var(--ink); }
.article-body em { font-style: italic; }

.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-thickness 140ms linear;
}
.article-body a:hover { text-decoration-thickness: 3px; }

/* ---- Headings ---- */
.article-body h2 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-top: 2.6em;
  text-wrap: balance;
}
.article-body h3 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin-top: 2.2em;
}
.article-body h4 {
  color: var(--ink-3);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-top: 2.2em;
}

.article-body :is(h2, h3, h4) + * { margin-top: 0.8em; }

/* ---- Lists ---- */
.article-body ul,
.article-body ol { padding-left: 1.3em; }
.article-body li + li { margin-top: 0.6em; }
.article-body li::marker { color: var(--ink-3); }
.article-body li > ul,
.article-body li > ol { margin-top: 0.6em; }

/* ---- Quotes ---- */
.article-body blockquote {
  color: var(--ink);
  font-weight: 500;
  font-style: italic;
  font-size: 1.06em;
  line-height: 1.5;
}
.article-body blockquote cite {
  display: block;
  margin-top: 0.9em;
  font-style: normal;
  font-weight: 500;
  font-size: 0.85em;
  color: var(--ink-3);
}
.article-body blockquote cite::before { content: "— "; }

.article-body .pull-quote {
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* ---- Result passage: a heading and prose, not a card ---- */
.article-body .callout { margin-top: 2.4em; margin-bottom: 2.4em; }
.article-body .callout > * + * { margin-top: 0.9em; }
.article-body .callout-title {
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

/* ---- Pending fields: the blank waiting to be filled ---- */
.article-body .pending {
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

/* ---- Companion repository ---- */
.article-body .repo { margin-top: 3em; color: var(--ink-2); }
.repo-name { color: var(--ink); font-weight: 700; }

/* ---- Repository specification ---- */
.article-body details.spec { margin-top: 1.2em; }
.article-body details.spec > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: opacity 140ms linear;
}
.article-body details.spec > summary::-webkit-details-marker { display: none; }
.article-body details.spec > summary:hover { opacity: 0.6; }
.article-body details.spec > p {
  margin-top: 1.3em;
  color: var(--ink-2);
  font-size: 0.98em;
  line-height: 1.62;
}
.article-body details.spec > p:first-of-type { margin-top: 1.8em; }

/* ---- Figures ---- */
.article-body figure { margin-top: 2.4em; margin-bottom: 2.4em; }
.article-body figure img,
.article-body figure svg { display: block; width: 100%; height: auto; }
.article-body figcaption {
  margin-top: 0.9em;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---- Data table: the header sits on its underline ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.article-body thead th {
  text-align: left;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 1.6em 0.7em 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}
.article-body tbody td { padding: 0.8em 1.6em 0.8em 0; color: var(--ink-2); }
.article-body tbody tr:first-child td { padding-top: 1.1em; }
.article-body td.num, .article-body th.num { text-align: right; padding-right: 0; }

/* ---- Code and formulas: same face as the prose ---- */
.article-body code { font-family: inherit; font-weight: 700; color: var(--ink); }
.article-body pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.2em 0;
  font-family: inherit;
  color: var(--ink-2);
  line-height: 1.65;
  tab-size: 2;
}
.article-body .formula {
  padding: 1.2em 0;
  color: var(--ink);
  font-weight: 500;
  overflow-x: auto;
}

/* ---- Breaks ---- */
.article-body hr { border: 0; height: 0; margin-top: 2.6em; margin-bottom: 2.6em; }
.article-body hr.dinkus { color: var(--ink-3); }
.article-body hr.dinkus::before {
  content: "* * *";
  letter-spacing: 0.6em;
  font-size: 1.1rem;
}

/* ---- Footnotes ---- */
.article-body .footnotes {
  margin-top: 3.5em;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-3);
}
.article-body .footnotes ol { padding-left: 1.3em; }
.article-body .footnotes li + li { margin-top: 0.7em; }
.article-body sup a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.72em; }

/* ---- Sources ---- */
.article-body .sources { margin-top: 3.5em; }
.article-body .sources h2 {
  margin-top: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.025em;
}
.article-body .sources ul { margin-top: 1.2em; padding-left: 1.3em; }
.article-body .sources li { font-size: 1rem; line-height: 1.6; }

/* ---- Next reads ---- */
.more-reading {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 12vh 4vw 0;
}
.more-reading h2 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 3rem;
}
.more-list { list-style: none; display: grid; gap: 2.2rem; }
.more-list a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
  transition: opacity 140ms linear;
}
.more-list a:hover {
  opacity: 0.6;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .article { padding: 6vh 6vw 0; }
  .home { margin-bottom: 9vh; }
  .article-body { margin-top: 6vh; font-size: 1.08rem; }
  .article > .wide { width: 100%; margin-left: 0; transform: none; }
  .more-reading { padding: 9vh 6vw 0; }
}
