/* dumpingiron.com — book + landing layout.
   Mechanics from thenetworkstate.com (one centered column at every width,
   sticky breadcrumb bar, segmented per-part progress, next/prev footer);
   identity is ours: Source Serif 4 reading text, Cardo display, Inter UI,
   rust accent (iron oxide, matches the cover). Light-only. */

:root {
  --ink: #16181d;
  --ink-soft: #3a3d44;
  --muted: #6b6f76;
  --rust: #8c2f1b;
  --rust-dark: #6e2413;
  --rule: #e8e6e3;
  --bg: #ffffff;
  --bg-warm: #faf8f6;
  --col: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: #f3ded8; }
a { color: var(--rust); }

/* ---------- site header (landing + TOC) ---------- */

.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  max-width: 1120px; margin: 0 auto; padding: 0 18px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 20px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--rust); }
.site-head nav { display: flex; align-items: center; gap: 16px; }
.site-head nav a { font-size: 13.5px; font-weight: 500; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.site-head nav a:hover { color: var(--rust); }
.btn-pill { background: var(--rust); color: #fff !important; padding: 7px 15px; border-radius: 999px; font-weight: 600 !important; }
.btn-pill:hover { background: var(--rust-dark); }

/* ---------- reading bar ---------- */

.rbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(6px);
  padding: 10px 14px;
}
.rbtn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; transition: border-color .15s;
}
.rbtn:hover { border-color: var(--rust); color: var(--rust); }
.rbtn.copied { border-color: var(--rust); color: var(--rust); }
.crumb { text-align: center; min-width: 0; }
.crumb-part { font-size: 13px; font-weight: 600; }
.crumb-title { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress {
  position: sticky; top: 64px; z-index: 19;
  display: flex; gap: 6px; padding: 0 14px 8px;
  background: rgba(255,255,255,.94);
}
.pseg { flex: 1; height: 4px; border-radius: 2px; background: #e5e2de; overflow: hidden; }
.pfill { height: 100%; background: var(--rust); border-radius: 2px; width: 0; }

/* ---------- reading column ---------- */

.read {
  max-width: var(--col); margin: 0 auto; padding: 40px 22px 72px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18.5px; line-height: 1.72; color: var(--ink);
}
.read h1 {
  font-family: 'Cardo', Georgia, serif; font-style: italic; font-weight: 700;
  font-size: clamp(34px, 5vw, 46px); line-height: 1.12; margin-bottom: 30px;
}
.read h2 {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: 26px; line-height: 1.25; margin: 1.9em 0 .7em;
}
.read h3 { font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 21px; margin: 1.6em 0 .6em; }
.read p { margin-bottom: 1.35em; }
.read a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

sup.cite { font-size: 12px; line-height: 0; }
sup.cite a { text-decoration: none; font-family: 'Inter', sans-serif; font-weight: 500; padding: 0 1px; }
sup.cite a:hover { text-decoration: underline; }

.fig { margin: 2em 0; }
.fig img {
  display: block; max-width: 100%; height: auto; margin: 0 auto;
  border: 1px solid var(--rule); border-radius: 6px;
}

/* ---------- endnotes ---------- */

.endnotes { margin-top: 56px; border-top: 1px solid var(--rule); padding-top: 22px; }
.endnotes h2 { margin-top: 0; font-size: 22px; }
.endnotes ol {
  font-family: 'Inter', sans-serif; font-size: 13.5px; line-height: 1.6;
  color: var(--ink-soft); padding-left: 32px; margin-top: 12px;
}
.endnotes li { margin-bottom: 9px; padding-left: 4px; }
.endnotes li:target { background: #fdf3ef; outline: 5px solid #fdf3ef; border-radius: 2px; }
.endnotes a { color: var(--rust); text-decoration: none; overflow-wrap: anywhere; }
.endnotes a:hover { text-decoration: underline; }
.endnotes .back { font-size: 12px; }
.notes-legend { font-family: 'Inter', sans-serif; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.notemark { color: var(--muted); }

/* ---------- next/prev footer ---------- */

.nextbar { border-top: 1px solid var(--rule); background: var(--bg); }
.nb-inner {
  max-width: var(--col); margin: 0 auto; padding: 18px 22px calc(20px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; gap: 14px;
}
.nb-prev, .nb-next {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  color: var(--ink); min-width: 0; padding: 10px 4px; flex: 1;
}
.nb-next { text-align: right; align-items: flex-end; }
.nb-prev span, .nb-next span { font-size: 12.5px; font-weight: 600; color: var(--muted); font-family: 'Inter', sans-serif; }
.nb-prev strong, .nb-next strong {
  font-size: 14.5px; font-weight: 600; font-family: 'Inter', sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.nb-prev:hover strong, .nb-next:hover strong { color: var(--rust); }

/* ---------- book TOC page ---------- */

.toc-page { max-width: 760px; margin: 0 auto; padding: 48px 20px 40px; }
.cover {
  display: block; margin: 0 auto 28px; max-width: min(320px, 70vw); height: auto;
  border-radius: 6px; box-shadow: 0 10px 34px rgba(20, 18, 16, .18);
}
.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto 34px; }
.pill {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #ddd9d4; border-radius: 999px; padding: 12px 10px;
  font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 600;
  color: var(--ink); text-decoration: none; transition: border-color .15s;
}
.pill:hover { border-color: var(--rust); color: var(--rust); }
.toc-lede {
  font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; line-height: 1.65;
  color: var(--ink-soft); max-width: 620px; margin: 0 auto 38px; text-align: center;
}
.part-head {
  font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 24px;
  margin: 30px 0 12px;
}
.chcard { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.chrow {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; font-family: 'Inter', sans-serif; font-size: 15.5px;
  color: var(--ink); text-decoration: none; border-top: 1px solid var(--rule);
}
.chrow:first-child { border-top: 0; }
.chrow:hover { background: var(--bg-warm); color: var(--rust); }
.charrow {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--rule); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.chrow:hover .charrow { border-color: var(--rust); color: var(--rust); }
.toc-cite { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--muted); margin-top: 34px; text-align: center; }

/* ---------- landing ---------- */

.landing { max-width: 720px; margin: 0 auto; padding: 60px 20px 40px; text-align: center; }
/* Cover follows the headline: the first beat must stand on the reader's
   situation, not on our artifact (Island NOW doctrine). Smaller here because
   it is now supporting evidence rather than the hero. */
.landing .cover { max-width: min(190px, 44vw); margin: 4px auto 34px; }
.landing h1 {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.15; margin: 8px 0 16px;
}
.landing .lede {
  font-family: 'Source Serif 4', Georgia, serif; font-size: 18.5px;
  color: var(--ink-soft); margin-bottom: 36px;
}
.landing-cards { display: grid; gap: 14px; max-width: 520px; margin: 0 auto; text-align: left; }
.lcard {
  border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px;
  text-decoration: none; color: var(--ink); transition: border-color .15s;
  font-family: 'Inter', sans-serif;
}
.lcard:hover { border-color: var(--rust); }
.lcard strong { display: block; font-size: 16.5px; margin-bottom: 3px; }
.lcard:hover strong { color: var(--rust); }
.lcard span { font-size: 14px; color: var(--muted); line-height: 1.5; }

.site-foot {
  margin-top: 60px; border-top: 1px solid var(--rule);
  padding: 26px 20px 40px; text-align: center;
  font-family: 'Inter', sans-serif; font-size: 13.5px; color: var(--muted);
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .read { font-size: 17.5px; padding: 30px 18px 60px; }
  .read h1 { font-size: 30px; }
  .read h2 { font-size: 23px; }
  .pills { grid-template-columns: 1fr 1fr; }
  .site-head nav { gap: 11px; }
  .site-head nav a { font-size: 12.5px; }
  .brand { font-size: 17px; }
  .btn-pill { padding: 6px 12px; }
  .nb-prev span, .nb-next span { font-size: 12px; }
  .nb-prev strong, .nb-next strong { font-size: 13px; }
}

.fmt-line {
  margin: 22px auto 0; max-width: 520px; text-align: center;
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--muted);
}

/* ---------- paper page (reading shell + scholarly identity) ---------- */

.paper-byline { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--muted); margin: -14px 0 24px; }
.preamble {
  border: 1px solid var(--rule); background: var(--bg-warm); border-radius: 8px;
  padding: 16px 20px; margin-bottom: 28px;
  font-size: 16px; line-height: 1.65; color: var(--ink-soft);
}
.read .abstract { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 22px 0; margin-bottom: 26px; }
.read .ab-label, .read h2.ab-label {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}
.read .abstract p { font-size: 17.5px; line-height: 1.68; color: var(--ink-soft); margin-bottom: 0; }
.read .keywords { margin-top: 12px; font-size: 13.5px !important; color: var(--muted) !important; font-family: 'Inter', sans-serif; }
.paper-contents { margin-bottom: 34px; font-family: 'Inter', sans-serif; font-size: 14.5px; }
.paper-contents ol { padding-left: 22px; }
.paper-contents li { margin-bottom: 6px; }
.paper-contents a { text-decoration: none; }
.paper-contents a:hover { text-decoration: underline; }
.read a.cite { text-decoration: none; font-weight: 500; }
.read a.cite:hover { text-decoration: underline; }
.read .refs { font-family: 'Inter', sans-serif; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); padding-left: 32px; margin-top: 12px; }
.read .refs li { margin-bottom: 9px; padding-left: 4px; }
.read .refs li:target { background: #fdf3ef; outline: 5px solid #fdf3ef; border-radius: 2px; }
.read .ref-links a { color: var(--rust); text-decoration: none; }
.read .author-box {
  margin-top: 56px; border: 1px solid var(--rule); background: var(--bg-warm);
  border-radius: 8px; padding: 22px 26px; font-size: 15.5px; line-height: 1.7;
  color: var(--ink-soft); font-family: 'Inter', sans-serif;
}
.read .author-box h2 {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}
.read .cite-block {
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--rule);
  font-family: 'Inter', sans-serif; font-size: 13px; line-height: 1.7; color: var(--muted);
}

/* ---------- lists, quotes, video ---------- */

.read ul, .read ol { margin: 0 0 1.35em 26px; }
.read li { margin-bottom: 8px; }
.read li::marker { color: var(--rust); }
.read blockquote {
  margin: 1.6em 0 1.6em 6px; padding: 2px 0 2px 20px;
  border-left: 3px solid var(--rust);
  color: var(--ink-soft); font-style: italic;
}
.read blockquote p { margin-bottom: 0; }
.paper-video { margin: 0 0 30px; }
.vwrap { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); }
.vwrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.paper-video figcaption {
  margin-top: 10px; font-family: 'Inter', sans-serif;
  font-size: 13.5px; color: var(--muted);
}

/* ---------- newsletter signup (primary site-wide CTA) ---------- */

.signup {
  margin: 48px auto 0; max-width: 560px;
  border: 1px solid var(--rule); border-radius: 12px;
  background: var(--bg-warm); padding: 26px 28px;
  font-family: 'Inter', sans-serif;
}
.read .signup { margin: 52px 0 0; max-width: none; }
.signup h2 {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: 24px; line-height: 1.2; margin: 0 0 10px; color: var(--ink);
  border: 0; padding: 0;
}
.signup p {
  font-size: 15.5px; line-height: 1.6; color: var(--ink-soft);
  margin: 0 0 18px; font-family: 'Inter', sans-serif;
}
.signup.compact h2 { font-size: 21px; }
.signup.compact p { font-size: 14.5px; }
.signup-form { display: flex; gap: 10px; flex-wrap: wrap; }
.signup-form input {
  flex: 1 1 220px; min-width: 0;
  font-family: 'Inter', sans-serif; font-size: 15px;
  padding: 12px 14px; border: 1px solid #d6d2cd; border-radius: 8px;
  background: #fff; color: var(--ink);
}
.signup-form input:focus { outline: 2px solid var(--rust); outline-offset: 1px; border-color: var(--rust); }
.signup-form button {
  flex: 0 0 auto; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600;
  padding: 12px 22px; border: 0; border-radius: 8px;
  background: var(--rust); color: #fff;
}
.signup-form button:hover { background: var(--rust-dark); }
.signup-fine {
  font-size: 12.5px !important; color: var(--muted) !important;
  margin: 12px 0 0 !important;
}
.signup-fine a { color: var(--rust); }

@media (max-width: 480px) {
  .signup { padding: 20px 18px; }
  .signup-form button { width: 100%; }
}

/* ---------- "why care about iron?" landing section ---------- */

.why {
  max-width: 640px; margin: 40px auto 44px; text-align: left;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17.5px; line-height: 1.7; color: var(--ink);
}
.why h2 {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: 30px; line-height: 1.2; margin-bottom: 18px; text-align: center;
}
.why p { margin-bottom: 1.15em; }
.why-turn {
  border-left: 3px solid var(--rust); padding-left: 18px;
  color: var(--ink-soft);
}
.why-more {
  font-family: 'Inter', sans-serif; font-size: 14.5px; color: var(--muted);
  margin-top: 22px !important;
}
@media (max-width: 480px) {
  .why { font-size: 16.5px; margin: 30px auto 34px; }
  .why h2 { font-size: 25px; }
}

/* ---------- U-curve figure ---------- */

.curve { margin: 26px 0 24px; }
.curve svg { width: 100%; height: auto; display: block; }
.curve .cl {
  font-family: 'Inter', sans-serif; font-size: 13px; fill: var(--muted);
}
.curve .cl-b { font-weight: 600; fill: var(--ink-soft); }

/* ---------- cohort cards (personalization) ---------- */

.why-sub {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: 24px; margin: 34px 0 10px; text-align: center;
}
.why-lead { text-align: center; color: var(--ink-soft); }
.cohorts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 22px 0 8px;
}
.cohorts.four { grid-template-columns: repeat(2, 1fr); }

/* Ferritin placement tool */
.ftool {
  border: 1px solid var(--rule); border-radius: 12px;
  background: var(--bg-warm); padding: 22px 20px 18px;
  font-family: 'Inter', sans-serif; margin: 24px 0 8px;
}
.ftool-label { font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rust); margin: 0 0 10px; }
.ftool-row { display: flex; gap: 10px; }
.ftool-row input {
  flex: 1; min-width: 0; padding: 12px 14px; font-size: 18px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-family: inherit;
}
.ftool-row button {
  padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 8px; background: var(--rust); color: #fff;
  font-family: inherit; min-height: 44px;
}
.ftool-units { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0 0; }
.fscale { position: relative; height: 12px; border-radius: 6px; margin: 20px 0 4px;
  background: linear-gradient(90deg, #d8cfc6 0%, #d8cfc6 22%,
    #c8b39a 22%, #c8b39a 44%, #b07a5a 44%, #b07a5a 66%, #8c2f1b 66%);
  display: none; }
.fscale .fmark { position: absolute; top: -6px; width: 3px; height: 24px;
  background: var(--ink); border-radius: 2px; transition: left .4s ease; }
.fscale-ticks { display: none; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-soft); padding: 0 0 4px; }
.fres { margin: 14px 0 0; font-size: 15px; line-height: 1.6; display: none; }
.fres strong { color: var(--rust); }
.ftool.has-result .fscale, .ftool.has-result .fscale-ticks, .ftool.has-result .fres { display: flex; }
.ftool.has-result .fres { display: block; }
@media (max-width: 480px) { .ftool-row { flex-direction: column; } }
.cohort {
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg-warm); padding: 16px 16px 14px;
  font-family: 'Inter', sans-serif;
}
.cohort-who { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.cohort-num {
  font-family: 'Cardo', Georgia, serif; font-size: 30px; font-weight: 700;
  color: var(--rust); line-height: 1.1; margin: 8px 0 6px;
}
.cohort p { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.cohort-note {
  font-family: 'Inter', sans-serif; font-size: 12.5px !important;
  color: var(--muted) !important; text-align: center; margin-bottom: 22px !important;
}
.fig1 img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule); border-radius: 6px; background: #fff;
}
.fig1 figcaption {
  font-family: 'Inter', sans-serif; font-size: 13px; color: var(--muted);
  margin-top: 9px; text-align: center;
}
@media (max-width: 560px) {
  .cohorts { grid-template-columns: 1fr; }
  .cohort-num { font-size: 26px; }
}

/* ---------- /why standalone page ---------- */

.whypage { max-width: 660px; }
.whypage h1 {
  font-family: 'Cardo', Georgia, serif; font-style: normal; font-weight: 700;
  font-size: clamp(31px, 4.6vw, 42px); line-height: 1.15; margin-bottom: 26px;
  text-align: center;
}
.whypage p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17.5px; line-height: 1.7; margin-bottom: 1.15em;
}

/* ---------- contents drawer ---------- */

.drawer-bg {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 18, 22, .42);
  opacity: 0; transition: opacity .2s ease;
}
.drawer-bg.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(380px, 88vw);
  background: var(--bg);
  border-left: 1px solid var(--rule);
  box-shadow: -18px 0 44px rgba(20, 18, 16, .16);
  transform: translateX(101%);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
.drawer.is-open { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-bg { transition: none; }
}
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--rule);
}
.dh-cover { border-radius: 3px; box-shadow: 0 2px 8px rgba(20,18,16,.18); flex: 0 0 auto; }
.dh-meta { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.dh-title { font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.dh-author { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--muted); margin-top: 2px; }
.drawer-close {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink-soft);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.drawer-close:hover { border-color: var(--rust); color: var(--rust); }
.dh-cta {
  display: block; margin: 12px 16px 4px; text-align: center;
  background: var(--rust); color: #fff !important; text-decoration: none;
  font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 600;
  padding: 11px 16px; border-radius: 999px;
}
.dh-cta:hover { background: var(--rust-dark); }
.drawer-nav { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 28px; -webkit-overflow-scrolling: touch; }
.dn-part {
  font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 15px;
  color: var(--ink); padding: 16px 18px 6px;
}
.dn-item {
  display: block; padding: 11px 18px;
  font-family: 'Inter', sans-serif; font-size: 14.5px; line-height: 1.4;
  color: var(--ink-soft); text-decoration: none;
  border-left: 3px solid transparent;
}
.dn-item:hover { background: var(--bg-warm); color: var(--rust); }
.dn-item.is-current {
  color: var(--rust); font-weight: 600;
  border-left-color: var(--rust); background: var(--bg-warm);
}
.dn-quiet { color: var(--muted); font-size: 13.5px; }

/* ---------- reading bar: brand at wide widths ---------- */

.rbrand {
  display: none;
  font-family: 'Cardo', Georgia, serif; font-weight: 700; font-size: 17px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  flex: 0 0 auto; padding-left: 4px;
}
.rbrand:hover { color: var(--rust); }
.rslot { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.rtoc-wide { display: none; }

@media (min-width: 900px) {
  /* wordmark takes the left slot; contents moves right, beside share */
  .rbrand { display: block; }
  .rslot-left { display: none; }
  .rtoc-wide { display: block; }
  .rbar { padding-left: 20px; padding-right: 20px; }
}


/* ---------- site header: narrow widths ----------
   At 375px the four text links plus the pill overflowed by 49px and the brand
   sat flush against the nav with no gap. Below 640px the text links are
   dropped: the landing page repeats every one of them as a card, and /book/
   repeats them as pills, so nothing becomes unreachable. Brand + Subscribe
   stay, which is the hierarchy we actually want on a phone. */

.site-head .brand { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.site-head nav { flex: 0 0 auto; }

@media (max-width: 639px) {
  .site-head .wrap { padding: 0 16px; gap: 12px; }
  .site-head nav { gap: 0; }
  .site-head nav a:not(.btn-pill) { display: none; }
  .brand { font-size: 17px; }
  .btn-pill { padding: 8px 16px; font-size: 14px; }
}

@media (min-width: 640px) and (max-width: 860px) {
  .site-head nav { gap: 13px; }
  .site-head nav a { font-size: 13px; }
  .brand { font-size: 18px; }
}


/* ---------- touch targets ----------
   The Subscribe pill measured 30px tall, under the 44px Apple/WCAG comfortable
   minimum, and it is the primary CTA on every page. Sized here rather than by
   padding guesswork so it can't drift with font changes. */

.btn-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 18px;
}
@media (max-width: 639px) {
  .btn-pill { min-height: 44px; padding: 0 18px; }
}
.pill { min-height: 46px; }
.rbtn { min-width: 44px; min-height: 44px; }
.signup-form input, .signup-form button { min-height: 46px; }
.drawer-close { min-width: 40px; min-height: 40px; }
.dn-item { min-height: 44px; display: flex; align-items: center; }
.dh-cta { min-height: 46px; display: flex; align-items: center; justify-content: center; }


/* ---------- legibility floor ----------
   Audience is 45-70. Nothing on this site goes below 13.5px, and secondary
   copy sits at 14px+. Caught by the responsive audit 2026-08-15, which found
   fine print at 12.5px. */

.signup-fine { font-size: 13.5px !important; line-height: 1.55; }
.cohort-note { font-size: 13.5px !important; }
.read .keywords, .keywords { font-size: 14px !important; }
.read .cite-block { font-size: 13.5px; }
.read .endnotes ol, .read .refs { font-size: 14px; }
.endnotes ol { font-size: 14px; }
.paper-byline { font-size: 14.5px; }
.toc-cite, .site-foot, .fmt-line, .why-more { font-size: 14px; }
.cohort p { font-size: 14px; }
.dn-quiet { font-size: 14px; }
.lcard span { font-size: 14.5px; }

/* chrome labels the reader actually reads */
.crumb-part { font-size: 13.5px; }
.crumb-title { font-size: 13px; }
.cohort-who { font-size: 14px; }
.dh-author { font-size: 13.5px; }
.dh-title { font-size: 19px; }

.nb-prev span, .nb-next span { font-size: 13px; }
@media (max-width: 480px) { .nb-prev span, .nb-next span { font-size: 13px; } }
.nb-prev strong, .nb-next strong { font-size: 14.5px; }


/* ---------- long-URL wrapping in references ----------
   Several bibliography entries are bare URLs (labdiet, aafco, usda) with no
   break opportunity. `overflow-wrap` on the <a> alone did not constrain the
   list item's min-content width, so chapter 6 pushed the page 192px wide at
   320px. Applied at every level of the list, plus the breadcrumb. */

.endnotes, .endnotes ol, .endnotes li, .refs, .refs li,
.notes, .notes ol, .notes li {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.endnotes a, .refs a, .ref-links a { overflow-wrap: anywhere; word-break: break-word; }
.read, .whypage { min-width: 0; overflow-wrap: break-word; }
.crumb, .crumb-title, .crumb-part { min-width: 0; }

/* ================= skip link ================= */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--rust); color: #fff; padding: 12px 18px;
  border-radius: 0 0 8px 0; font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 2px; }

/* ================= book TOC title ================= */

.toc-h1 {
  font-family: 'Cardo', Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 4.5vw, 40px); line-height: 1.15;
  text-align: center; margin: 4px 0 8px;
}
.toc-sub {
  text-align: center; font-family: 'Inter', sans-serif;
  font-size: 14.5px; color: var(--muted); margin-bottom: 30px;
}
.nf .landing-cards { margin-top: 28px; }

/* ================= dark mode =================
   Charts are scans on white grounds. Line art (10 of 11) is inverted so it
   reads as native dark-mode artwork; the one colour chart keeps a light plate,
   because inverting it produces false colours. See COLOUR_FIGURES in
   _build/render_book.py. */

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e3;
    --ink-soft: #c3bfba;
    --muted: #98938c;
    --rust: #e0714f;
    --rust-dark: #f08c6b;
    --rule: #2c2f35;
    --bg: #14161a;
    --bg-warm: #1b1e23;
  }
  body { background: var(--bg); color: var(--ink); }
  ::selection { background: #4a2418; color: #fff; }

  .rbar, .progress { background: rgba(20, 22, 26, .94); }
  .rbtn, .drawer-close { background: var(--bg-warm); }
  .pseg { background: #2c2f35; }
  .signup-form input { background: #0f1114; color: var(--ink); border-color: #3a3e45; }
  .signup-form input::placeholder { color: #7d7871; }
  .btn-pill, .dh-cta, .signup-form button { color: #16181d !important; font-weight: 600; }
  .drawer { box-shadow: -18px 0 44px rgba(0, 0, 0, .5); }
  .drawer-bg { background: rgba(0, 0, 0, .6); }
  .cover { box-shadow: 0 10px 34px rgba(0, 0, 0, .5); }
  .endnotes li:target, .refs li:target { background: #33231c; outline-color: #33231c; }
  .why-turn { color: var(--ink-soft); }

  /* line-art scans: invert to dark, hue-rotate keeps any tint sane */
  .fig.invertible img { filter: invert(1) hue-rotate(180deg) brightness(.92); }
  .fig1 img { filter: invert(1) hue-rotate(180deg) brightness(.92); }
  .fig.invertible img, .fig1 img { border-color: var(--rule); background: transparent; }

  /* colour chart: keep it on its own light plate, slightly dimmed */
  .fig.plate img {
    background: #f1efec; padding: 10px; border-radius: 6px;
    filter: brightness(.93); border-color: #2c2f35;
  }

  .curve .cl { fill: var(--muted); }
  .curve .cl-b { fill: var(--ink-soft); }
}

/* ================= print ================= */

@media print {
  .rbar, .progress, .drawer, .drawer-bg, .nextbar, .signup, .site-head,
  .site-foot, .skip, .paper-video, .pills { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .read, .whypage { max-width: none; padding: 0; font-size: 11pt; }
  .read h1 { font-size: 20pt; }
  .read h2 { font-size: 14pt; page-break-after: avoid; }
  .read p { orphans: 3; widows: 3; }
  .fig, figure { page-break-inside: avoid; }
  .endnotes { font-size: 8pt; }
  .read a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
}


/* About page: before/after pair */
.pdpair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0 30px; }
.pdpair img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); }
.pdpair figcaption {
  grid-column: 1 / -1; text-align: center; font-family: 'Inter', sans-serif;
  font-size: 13px; color: var(--muted); margin-top: 2px;
}

/* Subordinate P.S. — sits below the signup so it cannot compete with it.
   Email subscribers are this site's number one job (Oli 2026-08-19); the
   coaching link is a quiet afterthought by design: muted, no button, no
   urgency, smaller than the body text. */
.read p.quiet-ps, .quiet-ps {
  max-width: var(--col); margin: 22px auto 0; padding: 0 22px;
  font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.6;
  color: var(--muted);
}
.read p.quiet-ps a, .quiet-ps a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.read p.quiet-ps a:hover, .quiet-ps a:hover { color: var(--rust); }
