:root {
  --paper: #f3f4f1;
  --ink: #161616;
  --muted: #3a3a38;
  --faint: #6b6b67;
  --grid: #dcddd8;
  --rule: #c9cac4;
  --expected: #b23a17;
  --fortune: #2a5caa;
  --tension: #b4500f;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--expected); }
button { font: inherit; cursor: pointer; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 28px; padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.top a { font-family: var(--mono); font-size: 14px; padding: 12px 0; display: inline-block; }
.top .brand { font-size: 14px; font-weight: 500; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 28px; }

h1 { margin: 0; font-size: clamp(44px, 7vw, 96px); line-height: 0.95; font-weight: 750; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: clamp(32px, 4vw, 44px); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--ink); }
.lede { margin: 0; font-size: 18px; line-height: 1.5; color: var(--muted); }
.intro { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-end; padding: 64px 0 40px; }
.intro h1 { flex: 3 1 520px; }
.intro .lede { flex: 2 1 300px; }

/* charts */
svg { display: block; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 10px; }
.figure { margin: 0; padding: 28px 0 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.figure-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 12px; }
.figure-head .name { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }

/* result */
.result { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); border-top: 1px solid var(--ink); margin-top: 36px; }
.result > div { padding: 32px 0; display: flex; flex-direction: column; gap: 14px; }
.result > div:first-child { padding-right: 40px; border-right: 1px solid var(--ink); }
.result > div:last-child { padding-left: 40px; }
.kicker { font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.big { font-size: clamp(80px, 11vw, 120px); line-height: 0.9; font-weight: 800; letter-spacing: -0.04em; }
.big small { font-size: 1em; font-weight: 400; color: var(--faint); }
.result p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--muted); }
@media (max-width: 700px) {
  .result > div:first-child { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--ink); }
  .result > div:last-child { padding-left: 0; }
}

/* groups of books */
.group { display: flex; flex-direction: column; gap: 20px; margin-top: 52px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.group-head h3 { margin: 0; font-size: 24px; font-weight: 700; }
.group-head .count { margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px 28px; }
.card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; padding: 4px; margin: -4px; }
.card:hover h4 { text-decoration: underline; }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.card h4 { margin: 0; font-size: 18px; line-height: 1.15; font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.card .meta, .card .status { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card svg.mini { overflow: hidden; }
.card svg.mini { border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }

/* book page */
.facts { margin: 0; display: grid; grid-template-columns: auto auto; gap: 6px 20px; font-family: var(--mono); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.moments { display: flex; flex-wrap: wrap; gap: 8px; }
.moments button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--ink); border-radius: 0; background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; }
.moments button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.moments .n { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.chart { display: flex; gap: 12px; }
.axis { flex: 0 0 92px; position: relative; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.axis span { position: absolute; right: 0; transform: translateY(-50%); text-align: right; white-space: nowrap; }
.plot { flex: 1 1 auto; min-width: 0; position: relative; }
.chapters { position: relative; height: 22px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.chapters span { position: absolute; transform: translateX(-50%); }
.marker { position: absolute; transform: translate(-50%, -150%); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.scrub { display: flex; flex-direction: column; gap: 6px; padding-left: 104px; }
.scrub input { width: 100%; height: 44px; margin: 0; accent-color: var(--ink); }
.reader { display: flex; flex-wrap: wrap; gap: 40px; border-top: 1px solid var(--ink); padding-top: 28px; }
.reader blockquote { margin: 0; flex: 3 1 460px; display: flex; flex-direction: column; gap: 12px; }
.reader blockquote p { margin: 0; font-size: 24px; line-height: 1.45; }
.answer { flex: 2 1 300px; display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; }
.bar .track { height: 14px; background: #e2e3de; }
.bar .fill { height: 14px; }
.bar .pct { text-align: right; }
@media (max-width: 700px) {
  .axis { flex-basis: 72px; }
  .scrub { padding-left: 0; }
}

footer { border-top: 1px solid var(--ink); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 40px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
