/* Pebblehill Press. River-stone palette, pebble shapes, one serif for reading. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --stone: #E4E8E2;     /* page */
  --paper: #F3F5F1;     /* raised surfaces */
  --slate: #24313A;     /* text, buttons */
  --lichen: #4A6957;    /* links, secondary text */
  --pebble: #B9C2BA;    /* rules */
  --marigold: #E3A33A;  /* focus and the sun, nothing else */
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --measure: 34em;
  --gutter: clamp(16px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--stone); color: var(--slate);
  font: 400 1.125rem/1.65 var(--text);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lichen); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--slate); }
:focus-visible { outline: 3px solid var(--slate); outline-offset: 2px; box-shadow: 0 0 0 5px var(--marigold); border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.6rem); font-weight: 760; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 680; }
h3 { font-size: 1.3rem; font-weight: 650; }
p { margin: 0 0 1em; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--slate); color: var(--paper); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; z-index: 10; }

/* header and footer */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--slate); text-decoration: none;
  font: 700 1.2rem/1 var(--display); letter-spacing: -0.01em; }
.mark { width: 40px; height: 34px; }
nav { display: flex; gap: 22px; font: 560 1rem/1 var(--display); }
nav a { color: var(--slate); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--slate); }
.foot { padding: 40px var(--gutter) 48px; border-top: 1px solid var(--pebble); margin-top: 72px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .95rem; color: var(--lichen); }
.foot p { margin: 0; }

/* home */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: clamp(16px, 4vw, 48px);
  padding: clamp(24px, 6vw, 72px) var(--gutter) 0;
}
.hero h1 { max-width: 12ch; margin-bottom: .45em; }
.lede { font-size: 1.25rem; line-height: 1.55; }
.hill { width: 100%; max-width: 460px; justify-self: end; }
.shelf { padding: 0 var(--gutter); }
.shelf > h2 {
  padding-top: 28px; margin-bottom: 28px; border-top: 2px solid var(--slate);
}
.book-row {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(20px, 4vw, 48px);
  align-items: start; padding-bottom: 48px;
}
.book-row + .book-row { padding-top: 40px; border-top: 1px solid var(--pebble); }
.book-row h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.book-row h3 a { color: var(--slate); text-decoration: none; }
.book-row h3 a:hover { text-decoration: underline; }
.cover { border-radius: 3px 6px 6px 3px; box-shadow: 0 1px 0 rgba(36,49,58,.18), 0 18px 32px -14px rgba(36,49,58,.45); background: var(--paper); }
.subtitle { font-size: 1.15rem; font-style: italic; margin: .35em 0 .2em; }
.byline { color: var(--lichen); margin-bottom: 1.1em; }
.free { margin-top: .8em; }

/* buttons: pebble-shaped */
.btn {
  display: inline-flex; align-items: center; gap: .35em; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--slate); color: var(--paper); text-decoration: none; font: 620 1rem/1 var(--display);
  border: 2px solid var(--slate);
}
.btn:hover { background: var(--lichen); border-color: var(--lichen); color: var(--paper); }
.btn-quiet { background: transparent; color: var(--slate); }
.btn-quiet:hover { background: var(--slate); color: var(--paper); border-color: var(--slate); }
.btn .size { font-weight: 400; opacity: .8; }
.btn:hover .size { opacity: 1; }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.buy-format { font: 600 .95rem/1 var(--display); min-width: 6.5em; }
.soon {
  display: inline-block; padding: 12px 20px; border-radius: 999px; background: var(--paper);
  border: 1px dashed var(--lichen); font: 560 1rem/1 var(--display); color: var(--lichen);
}

/* book page */
.book {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px);
  padding: clamp(16px, 4vw, 48px) var(--gutter) 0; align-items: start;
}
.book-cover { position: sticky; top: 24px; }
.series { font: 560 1rem/1.3 var(--display); color: var(--lichen); margin-bottom: .6em; }
.book h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.book h2 { margin: 1.6em 0 .6em; }
.inside { padding-left: 1.1em; max-width: var(--measure); }
.inside li { margin-bottom: .45em; }
.inside li::marker { color: var(--lichen); }
.note { font-size: 1rem; color: var(--lichen); }
.printables, .review { margin-top: 2.4em; padding: 28px; background: var(--paper); border-radius: 28px; max-width: 40em; }
.printables h2, .review h2 { margin-top: 0; }
.download { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--pebble); }
.download h3 { margin-bottom: .2em; }
.download p { margin: 0; font-size: 1rem; }

/* simple pages */
.page { padding: clamp(24px, 5vw, 64px) var(--gutter) 0; max-width: 54rem; }
.page h1 { margin-bottom: .4em; }
.dl-book { margin-top: 40px; padding: 28px; background: var(--paper); border-radius: 28px; }
.dl-book h2 a { color: var(--slate); }
.dl-book .download:first-of-type { margin-top: 16px; }
.prose p { font-size: 1.15rem; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hill { max-width: 260px; justify-self: start; order: -1; }
  .book-row { grid-template-columns: 1fr; }
  .book-row .cover-link { max-width: 200px; }
  .book { grid-template-columns: 1fr; }
  .book-cover { position: static; max-width: 240px; }
  .buy-format { min-width: 100%; }
  .printables, .review, .dl-book { padding: 22px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
