/* Demanding Strongmen — demandingstrongmen.com
   The palette and the rules are lifted from the printed cover: cream stock,
   true black display type, a deep oxblood band fenced by heavy rules. The page
   is set like the book's own pages, not like a product site. */

:root {
  color-scheme: light;

  --paper: #f7f6f4;
  --paper-sunk: #f0ede7;
  --ink: #000000;
  --text: #23201c;
  --muted: #6d5d47; /* the stones on the cover */
  --red: #990c0d;   /* the subtitle band */
  --red-deep: #7a0a0b;
  --hair: rgba(0, 0, 0, 0.14);

  --serif: 'EB Garamond', Garamond, 'Palatino Linotype', Palatino, Georgia, serif;

  --measure: 34rem;
  --wide: 52rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  font-size: 118.75%; /* 19px at browser default, and still scalable */
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.62;
  font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.055em;
  transition: text-decoration-thickness 90ms linear;
}
a:hover { text-decoration-thickness: 0.13em; }
a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  text-decoration: none;
}

cite { font-style: italic; }
code {
  font-family: 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
  font-size: 0.82em;
  background: var(--paper-sunk);
  padding: 0.08em 0.3em;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap > * { max-width: var(--measure); }
.wrap > .full { max-width: none; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  background: var(--paper);
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--ink);
}

/* ------------------------------------------------------------------- nav */

.masthead {
  border-bottom: 2px solid var(--ink);
}
.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.6rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  max-width: var(--wide);
}
.masthead .wrap > * { max-width: none; }

.masthead-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
}
.masthead-name:hover { color: var(--red); }

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.35rem;
  font-size: 0.87rem;
}
.masthead nav a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.masthead nav a:hover { color: var(--red); border-bottom-color: var(--red); }
.masthead nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 0;
}
.hero .wrap { max-width: var(--wide); }
.hero .wrap > * { max-width: none; }

.hero-grid {
  display: grid;
  gap: 2rem clamp(2rem, 5vw, 3.5rem);
}
@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 17rem;
    align-items: start;
  }
  .hero-head { grid-column: 1; grid-row: 1; }
  .hero-body { grid-column: 1; grid-row: 2; }
  .hero-aside { grid-column: 2; grid-row: 1 / span 2; }
}

.series {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 0.7rem;
  line-height: 1.4;
}

h1 {
  font-size: clamp(3rem, 9vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.021em;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

.question {
  font-size: clamp(1.7rem, 4.1vw, 2.7rem);
  line-height: 1.1;
  font-weight: 500;
  color: var(--red);
  margin: 0 0 1.5rem;
  max-width: 20ch;
  text-wrap: balance;
}

.hero-body p { max-width: var(--measure); }
.hero-body p:first-of-type { margin-top: 0; }

.hero-cover { margin: 0; }
.hero-cover img {
  display: block;
  width: 100%;
  max-width: 17rem;
  box-shadow: 0 1px 0 var(--hair), 0 14px 34px -18px rgba(0, 0, 0, 0.55);
}

/* The book's particulars, set beside the object like a catalogue entry. */
.hero-facts {
  max-width: 17rem;
  margin: 1.1rem 0 0;
  border-top: 1px solid var(--ink);
  font-size: 0.83rem;
  line-height: 1.45;
}
.hero-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--hair);
}
.hero-facts dt { color: var(--muted); margin: 0; }
.hero-facts dd { margin: 0; color: var(--ink); text-align: right; }

/* ------------------------------------------------------------------ band */

.band {
  background: var(--red);
  color: #fdfbf8;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1rem, 2.5vw, 1.5rem) 0;
}
.band p {
  margin: 0 auto;
  font-size: clamp(1.2rem, 3.1vw, 1.95rem);
  line-height: 1.16;
  max-width: 30ch;
  text-align: center;
  text-wrap: balance;
}

/* --------------------------------------------------------------- content */

main { padding-bottom: clamp(3rem, 8vw, 5rem); }
.page-body { padding-top: clamp(2.2rem, 6vw, 3.5rem); }

.page-title {
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1.6rem;
}

/* The section rule runs the full column, the way a running rule does in the
   book; the heading itself stays inside the measure. */
h2 {
  font-size: clamp(1.42rem, 3vw, 1.8rem);
  line-height: 1.18;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.006em;
  margin: 2.9rem 0 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ink);
}
.wrap > h2 { max-width: var(--wide); } /* beats the measure set on .wrap > * */
h3 {
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  margin: 1.9rem 0 0.5rem;
}

p { margin: 0 0 1.15rem; }

.lead {
  font-size: 1.24rem;
  line-height: 1.48;
  color: var(--ink);
  margin-bottom: 1.6rem;
}

.runin { margin: 0 0 1.1rem; }
.runin b { font-weight: 600; color: var(--ink); }

/* Links offered as a next step, set as a list of rules rather than buttons. */
.next {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.next li { border-bottom: 1px solid var(--hair); }
.next a {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.98rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.next a:hover { color: var(--red-deep); text-decoration: underline; }

/* ----------------------------------------------------------------- table */

.tbl { margin: 1.6rem 0 1.9rem; }
.tbl.full { max-width: var(--wide); }

.tbl-cap {
  font-size: 0.87rem;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.55rem;
  max-width: var(--measure);
}

.tbl table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 0.94rem;
  line-height: 1.42;
}
.tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  padding: 0.5rem 1.1rem 0.5rem 0;
  border-bottom: 1px solid var(--ink);
  vertical-align: bottom;
}
.tbl td {
  padding: 0.55rem 1.1rem 0.55rem 0;
  vertical-align: top;
  border-top: 1px solid var(--hair);
}
.tbl tbody tr:first-child td { border-top: none; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td:first-child { color: var(--ink); }

/* The hypothesis ledger: a hairline label column, the claim, then the verdict. */
@media (min-width: 46.01rem) {
  .tbl.ledger th:first-child,
  .tbl.ledger td:first-child { width: 2.4rem; color: var(--muted); }
  .tbl.ledger th:nth-child(2),
  .tbl.ledger td:nth-child(2) { width: 32%; }
}

/* A headless two-column table is a list of pairs. On a phone the label column
   collapses to one word per line, so stack the pairs instead. */
@media (max-width: 46rem) {
  .tbl.pairs table,
  .tbl.pairs tbody,
  .tbl.pairs tr,
  .tbl.pairs td { display: block; }
  .tbl.pairs tr {
    padding: 0.85rem 0;
    border-top: 1px solid var(--hair);
  }
  .tbl.pairs tbody tr:first-child { border-top: none; }
  .tbl.pairs td { width: auto; border: none; padding: 0; }
  .tbl.pairs td:first-child {
    color: var(--muted);
    font-size: 0.88rem;
    padding-bottom: 0.15rem;
  }
  .tbl.pairs .num { white-space: normal; }
}

/* Three columns will not fit a phone. Below the breakpoint each hypothesis
   becomes a stacked entry: label, claim, verdict. */
@media (max-width: 46rem) {
  .tbl.ledger table,
  .tbl.ledger tbody,
  .tbl.ledger tr,
  .tbl.ledger td { display: block; }
  .tbl.ledger thead { position: absolute; left: -9999px; }
  .tbl.ledger tr {
    padding: 1.1rem 0;
    border-top: 1px solid var(--hair);
  }
  .tbl.ledger tbody tr:first-child { border-top: none; }
  .tbl.ledger td {
    width: auto;
    border: none;
    padding: 0 0 0.5rem;
  }
  .tbl.ledger td:first-child {
    color: var(--red);
    font-weight: 600;
    padding-bottom: 0.25rem;
  }
  .tbl.ledger td:nth-child(2) { color: var(--muted); font-style: italic; }
  .tbl.ledger td:last-child { padding-bottom: 0; }
}

/* Estimate columns read as figures, not prose. */
.tbl .num {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.ns { color: var(--muted); font-style: italic; font-size: 0.9em; }
.tnote { color: var(--muted); font-size: 0.9em; }

.tbl-note {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.6rem 0 0;
  max-width: var(--measure);
}

.scroll-x { overflow-x: auto; }

/* --------------------------------------------------------------- extract */

.excerpt {
  border-left: 1px solid rgba(0, 0, 0, 0.28);
  padding-left: clamp(1rem, 3vw, 1.6rem);
  margin: 1.5rem 0 2rem;
  font-size: 0.98rem;
}
.excerpt p { margin: 0; }
.excerpt p + p { text-indent: 1.4em; }

.pq {
  margin: 1.6rem 0 1.8rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--ink);
}
.pq p { margin: 0; }
.pq cite {
  display: block;
  margin-top: 0.7rem;
  font-style: normal;
  font-size: 0.83rem;
  color: var(--muted);
}

.formula {
  margin: 1.5rem 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.6;
}
/* Function names upright, variables italic, subscripts upright — as set. */
.formula .eq { font-style: normal; }
.formula sub { font-style: normal; font-size: 0.7em; }
.formula .tbl-note { text-align: left; margin-top: 0.9rem; }

/* Survey items, quoted as asked. */
.items { margin: 1.4rem 0 1.9rem; border-top: 1px solid var(--hair); }
.item {
  display: grid;
  gap: 0.1rem 1.4rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hair);
}
@media (min-width: 40rem) {
  .item { grid-template-columns: 9.5rem 1fr; }
}
.item-code { font-size: 0.85rem; color: var(--muted); }
.item-label { font-weight: 600; color: var(--ink); font-size: 0.85rem; }
.item-text { font-style: italic; color: var(--ink); margin: 0; }
.item-note { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; }

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

.toc { margin: 1.8rem 0 0; max-width: var(--wide); }

.toc-ch {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr);
  gap: 0 1.1rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--hair);
}
.toc-ch:first-child { border-top: 2px solid var(--ink); }
.toc-ch:last-child { border-bottom: 2px solid var(--ink); }

.toc-n {
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--red);
  font-variant-numeric: lining-nums;
}
.toc-t {
  font-size: 1.12rem;
  line-height: 1.28;
  font-weight: 600;
  font-style: normal;
  color: var(--ink);
  margin: 0;
}
.toc-note {
  font-size: 0.92rem;
  color: var(--text);
  margin: 0.45rem 0 0;
  max-width: var(--measure);
}
.toc-secs {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.toc-secs li { padding: 0.1rem 0; }

.leader { display: flex; align-items: baseline; gap: 0.45rem; }
.leader .lt { flex: 0 1 auto; }
.leader .ld {
  flex: 1 1 auto;
  min-width: 1.5rem;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  transform: translateY(-0.28em);
}
.leader .lp {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums lining-nums;
}

/* ------------------------------------------------------------------- buy */

.buy {
  margin: 2rem 0 0;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}
.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0 0 0.7rem;
  padding: 0;
  list-style: none;
}
.buy-links a {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 0.5rem 1.5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}
.buy-links a:hover,
.buy-links a:focus-visible {
  background: var(--red);
  border-color: var(--red);
  color: #fdfbf8;
}
.buy-note { font-size: 0.87rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- footer */

.colophon {
  border-top: 3px solid var(--ink);
  background: var(--red);
  color: #fdfbf8;
  padding: clamp(1.6rem, 4vw, 2.4rem) 0;
  margin-top: clamp(2.5rem, 7vw, 4rem);
}
.colophon .wrap { max-width: var(--wide); }
.colophon .wrap > * { max-width: none; }
.colophon a { color: #fdfbf8; text-decoration-thickness: 0.05em; }
.colophon a:hover { color: #fff; }
.colophon a:focus-visible { outline-color: #fdfbf8; }

.colophon-grid {
  display: grid;
  gap: 1.4rem 2.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
@media (min-width: 44rem) {
  .colophon-grid { grid-template-columns: 1fr auto; align-items: start; }
}
.colophon p { margin: 0 0 0.35rem; }
.colophon-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.colophon-fine {
  margin-top: 1.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(253, 251, 248, 0.35);
  font-size: 0.8rem;
  opacity: 0.9;
}

/* ------------------------------------------------------------------- 404 */

.notfound { padding: clamp(3rem, 10vw, 6rem) 0; }

/* --------------------------------------------------------------- respect */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .masthead nav, .buy, .next { display: none; }
  body { background: #fff; font-size: 11pt; }
  .band, .colophon { background: #fff; color: #000; border-color: #000; }
  .colophon a { color: #000; }
  a { text-decoration: none; }
}
