:root {
  --paper: #faf7f2;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #57534e;  /* 7.4:1 on the paper background — AA and AAA for body sizes */
  --rule: #e7e1d8;
  --accent: #9a3412;
  --accent-soft: #fdf0e9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

.wrap { width: min(66rem, calc(100% - 2.5rem)); margin-inline: auto; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-top: 2.2em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 38rem; }
.subtitle { font-family: var(--serif); font-size: 1.2rem; color: var(--ink-soft); margin-top: -0.2em; }
.tagline { font-style: italic; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: 1.1rem 0; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: 0.01em;
}
/* The mark is a badge with its own white field and hairline; at 40px the text
   inside it is not meant to be read — the wordmark beside it does that job. */
.brand img { height: 40px; width: auto; display: block; flex: none; }
.site-header nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--accent); }

/* hero */
.hero { padding: 3.5rem 0 1rem; }
.hero h1 { max-width: 30ch; }

.section { padding: 2rem 0 3rem; }
.section-title { margin-top: 0; }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem;
  color: var(--muted); margin-bottom: 0.8em;
}

/* buttons */
.button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 0.7rem 1.3rem; border-radius: 4px; font-weight: 600; font-size: 0.98rem;
}
.button:hover { background: #7c2d12; }
.button.small { padding: 0.5rem 0.95rem; font-size: 0.9rem; }
.button.wide { display: block; text-align: center; }

/* feature */
.feature { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.feature-price { font-family: var(--serif); font-size: 1.3rem; margin-top: 1.2em; }
.feature-cover img, .book-cover, .card-cover {
  max-width: 100%; height: auto; border-radius: 3px;
  box-shadow: 0 10px 30px rgba(28, 25, 23, 0.14);
}

/* catalogue */
.book-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.card h2 { font-size: 1.2rem; margin-bottom: 0.3em; }
.card-meta { font-size: 0.9rem; color: var(--muted); }

/* book page */
.book { padding: 2.5rem 0 4rem; }
/* Mobile order: title, then the price and buy button, THEN the cover — a first
   screen with no price is a bounce. Desktop keeps the cover beside the title. */
.book-grid-2 {
  display: grid; gap: 2.5rem; grid-template-columns: 1fr;
  grid-template-areas: "head" "buy" "cover" "body";
}
.book-head { grid-area: head; }
.book-buy { grid-area: buy; }
.book-cover-wrap { grid-area: cover; }
.book-body { grid-area: body; }
.book-head h1 { margin-bottom: 0.2em; }
.book-buy {
  border: 1px solid var(--rule); background: #fff; border-radius: 6px;
  padding: 1.5rem; align-self: start;
}
.book-buy .price { font-family: var(--serif); font-size: 2rem; margin: 0; }
.bump { border-top: 1px solid var(--rule); margin-top: 1.2rem; padding-top: 1.2rem; }
.bump-title { margin-bottom: 0.4em; }
.notice {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 1.1rem 1.3rem; border-radius: 0 4px 4px 0; margin-bottom: 2rem;
}
.notice h2 { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.notice p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.chapters li { margin-bottom: 0.4em; }
.book-body { max-width: var(--measure); }

/* prose */
.prose { max-width: var(--measure); padding: 2.5rem 0 4rem; }
.prose h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.prose h2 { margin-top: 2.4em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { background: #f2ece2; }
.prose code { background: #f0eae0; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; }
.prose img { max-width: min(22rem, 100%); height: auto; }
.prose blockquote { margin: 1.4em 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--ink-soft); }
.legal-meta { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* principles */
.principles { padding-left: 1.2em; }
.principles li { margin-bottom: 0.9em; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 2.2rem 0 3rem; font-size: 0.88rem; color: var(--muted); }
.paddle-statement { max-width: 48rem; color: var(--ink-soft); }
/* The identity line is three separate elements, and the only thing between them
   is a flex gap. A column-gap exists only between two items on the same line, so
   at the wrap it is not drawn at all — unlike a " · " in the text, it cannot
   begin the wrapped line. The parts break rather than widen the page at 390px. */
.footer-identity {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: 1.1rem; row-gap: 0.25rem; margin-top: 1.4rem;
}
.footer-identity > * { min-width: 0; overflow-wrap: break-word; }
.footer-legal { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: 1rem 0; }
.footer-fine { max-width: 48rem; font-size: 0.82rem; }

@media (min-width: 46rem) {
  .feature { grid-template-columns: 1.4fr 1fr; }
  .book-grid-2 {
    grid-template-columns: 1.6fr 1fr;
    grid-template-areas: "head buy" "cover buy" "body body";
  }
  .book-buy { position: sticky; top: 1.5rem; align-self: start; }
}
