/* Brave to Feel: the one stylesheet. No inline styles anywhere (CSP style-src 'self').
   Palette from the Series 1 covers. Contrast notes (WCAG 2.x, computed on --cream #F9F8F2):
     --ink #2B2A26 13.5:1 · --ink-soft #5C5A52 6.5:1 · --focus #225682 7.3:1
     headings: everything #2A7ABE 4.3:1 (large text only), worry #62269E 8.6:1,
     anger #B62E06 5.8:1, sad #225682 7.3:1, excited #B34A06 5.1:1 (the cover's
     #FE7212 is 2.6:1, so it is used for shapes only, never text).
     Charcoal on every strip colour: 5.1:1 (anger) to 11.2:1 (everything). */

@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-700-normal.woff2") format("woff2");
}

:root {
  --cream: #F9F8F2;
  --cream-deep: #F1EEE2;
  --paper: #FFFFFF;
  --ink: #2B2A26;
  --ink-soft: #5C5A52;
  --line: #E2DED0;
  --focus: #225682;
  --sky: #B8D4EC;

  /* per book: strip (background, dark text on top) and ink (headings) */
  --everything-strip: #FEE429;
  --everything-ink: #2A7ABE;
  --worry-strip: #E9B4F8;
  --worry-ink: #62269E;
  --anger-strip: #FD6E38;
  --anger-ink: #B62E06;
  --sad-strip: #8FC0EE;
  --sad-ink: #225682;
  --excited-strip: #FDBC22;
  --excited-ink: #B34A06;
  --excited-bright: #FE7212;

  /* Fuzzy colours (rings only) */
  --glimmer: #F3E6A6;
  --wibble: #9577C1;
  --roar: #BF5328;
  --slump: #3780B0;
  --flutter: #FBAC1B;

  --serif: "PT Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --shadow: 0 0.6rem 1.6rem rgba(60, 50, 20, 0.14), 0 0.15rem 0.4rem rgba(60, 50, 20, 0.08);
  --gutter: 1rem;
  --measure: 38rem;

  /* page accent, overridden per book section */
  --accent: var(--everything-strip);
  --accent-ink: var(--ink);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}
@media (min-width: 48em) {
  body { font-size: 1.125rem; }
  :root { --gutter: 2rem; }
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem); }
h3 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.85rem); }
p, ul, ol { margin: 0 0 1em; }

a { color: var(--focus); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.3rem;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  padding: 1rem 0 0.5rem;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.brand {
  display: inline-block;
  border-radius: 0.5rem;
}
.brand img { width: 4.5rem; height: 4.5rem; }
@media (min-width: 48em) { .brand img { width: 5.5rem; height: 5.5rem; } }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
}
.site-nav a:hover { background: var(--cream-deep); }
/* current page: set by the body class, so the header markup stays identical */
.page-home .nav-home,
.page-books .nav-books,
.page-fuzzies .nav-fuzzies,
.page-resources .nav-resources,
.page-about .nav-about {
  border-color: var(--ink);
}
@media (max-width: 30em) {
  .site-header .wrap { justify-content: center; }
  .site-nav ul { justify-content: center; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.95rem; }
}

main { display: block; padding-bottom: 3rem; }

/* The collector's own unsubscribe confirm page (GET /api/unsubscribe) uses bare
   main > h1 / p / form / button with no classes and no header. Site pages never
   put these directly inside main, so these rules touch only that page. */
main > h1, main > p, main > form {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  text-align: center;
}
main > h1:first-child { margin-top: 3rem; }
main > form { margin-bottom: 1.5rem; }
button:not(.button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--everything-strip);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.0625rem;
  cursor: pointer;
  box-shadow: 0 0.2rem 0 var(--ink);
}

/* ── Buttons ──────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0.2rem 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 0.3rem 0 var(--ink); }
.button:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.button-quiet { background: var(--paper); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; }

/* ── Home ─────────────────────────────────────────────────── */
.hero { padding-top: 2rem; padding-bottom: 1.5rem; text-align: center; }
.hero h1 { max-width: 18ch; margin: 0 auto 0.5em; }
.hero .lede { max-width: 34rem; margin: 0 auto; font-size: 1.15em; color: var(--ink-soft); }
.hero .button-row { justify-content: center; }
.hero .button { --accent: var(--everything-strip); }
.hero .button-quiet { --accent: var(--paper); }

.shelf {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}
@media (min-width: 40em) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64em) { .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; } }
.shelf a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.shelf img {
  border-radius: 0.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.shelf a:hover img { transform: translateY(-4px) rotate(-0.6deg); }
.shelf .shelf-title {
  display: block;
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
}
.shelf .shelf-meta { display: block; font-size: 0.9rem; color: var(--ink-soft); }

.section { padding-top: 3rem; }
.section-title { text-align: center; }

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48em) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.75rem;
  border: 2px solid var(--line);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0.6rem;
  background: var(--accent);
}
.card h2, .card h3 { font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem); }
.card p:last-child { margin-bottom: 0; }
.card-link { font-weight: 700; }
.card-printables { --accent: var(--sad-strip); }
.card-fuzzies { --accent: var(--worry-strip); }
.card-fuzzies .fuzzy-strip {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.fuzzy-strip img { width: 3.25rem; height: 3.25rem; border-radius: 50%; }

/* ── Page intro ───────────────────────────────────────────── */
.page-intro { padding: 2rem 0 1rem; }
.page-intro .lede { font-size: 1.12em; color: var(--ink-soft); max-width: var(--measure); }

/* ── Books ────────────────────────────────────────────────── */
.series-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}
.series-head h2 { margin: 0; }
.series-head p { margin: 0; color: var(--ink-soft); }

.book {
  --accent: var(--everything-strip);
  --accent-ink: var(--everything-ink);
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 1.5rem 1.25rem 1.75rem 1.75rem;
  background: var(--paper);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  overflow: hidden;
  scroll-margin-top: 1rem;
}
.book::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0.75rem;
  background: var(--accent);
}
@media (min-width: 48em) {
  .book {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.5rem;
    padding: 2.25rem 2.25rem 2.25rem 3rem;
    align-items: start;
  }
}
.book-worry { --accent: var(--worry-strip); --accent-ink: var(--worry-ink); }
.book-anger { --accent: var(--anger-strip); --accent-ink: var(--anger-ink); }
.book-sad { --accent: var(--sad-strip); --accent-ink: var(--sad-ink); }
.book-excited { --accent: var(--excited-strip); --accent-ink: var(--excited-ink); }

.book-cover img {
  border-radius: 0.4rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}
.book h3 {
  color: var(--accent-ink);
  font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.2rem);
  margin-bottom: 0.4em;
}
.book-number {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.book-hook { font-weight: 700; font-size: 1.12em; }
.book-meta {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.book-meta li {
  font-size: 0.92rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
}
.book .button-row { align-items: center; }
.book .text-link { font-weight: 700; }

.whole-series {
  --accent: var(--excited-strip);
  text-align: center;
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  background: var(--cream-deep);
  margin: 0 0 2rem;
}
.whole-series .button-row { justify-content: center; }
.coming-next {
  text-align: center;
  padding: 1.5rem 1rem 0;
}
.coming-next p { color: var(--ink-soft); }

/* ── Feeling Fuzzies ──────────────────────────────────────── */
.fuzzies {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 44em) { .fuzzies { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70em) { .fuzzies { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fuzzy {
  --ring: var(--glimmer);
  --accent-ink: var(--everything-ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  scroll-margin-top: 1rem;
}
.fuzzy-glimmer { --ring: var(--glimmer); --accent-ink: var(--ink); }
.fuzzy-wibble { --ring: var(--wibble); --accent-ink: var(--worry-ink); }
.fuzzy-roar { --ring: var(--roar); --accent-ink: var(--anger-ink); }
.fuzzy-slump { --ring: var(--slump); --accent-ink: var(--sad-ink); }
.fuzzy-flutter { --ring: var(--flutter); --accent-ink: var(--excited-ink); }
.fuzzy-portrait {
  width: min(13rem, 70%);
  margin: 0 auto 1rem;
}
.fuzzy-portrait img {
  border-radius: 50%;
  box-shadow: 0 0 0 0.45rem var(--ring), var(--shadow);
}
.fuzzy h2 { color: var(--accent-ink); margin-bottom: 0.15em; }
.fuzzy-feeling {
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.fuzzy p { text-align: left; }
.fuzzy .fuzzy-book { text-align: center; font-size: 0.98rem; margin: 0; }

.pullquote {
  margin: 3rem auto 0;
  max-width: 36rem;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  border-left: 0.6rem solid var(--everything-strip);
  background: var(--paper);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.15em;
}
.pullquote p { margin: 0 0 0.5rem; }
.pullquote footer { font-size: 0.92rem; color: var(--ink-soft); }

.prompts { padding-left: 1.25rem; }
.prompts li { margin-bottom: 0.4rem; }

/* ── Resources ────────────────────────────────────────────── */
.printables {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 56em) { .printables { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.printable { display: flex; flex-direction: column; scroll-margin-top: 1rem; }
.printable .card-body { flex: 1; }
.printable-guides { --accent: var(--everything-strip); }
.printable-cards { --accent: var(--anger-strip); }
.printable-chart { --accent: var(--sad-strip); }
.printable-format { font-size: 0.95rem; color: var(--ink-soft); }
.printable .button { align-self: flex-start; margin-top: 0.5rem; }
.note {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--cream-deep);
}
.note p:last-child { margin-bottom: 0; }

/* ── Prose pages (about, legal, small notices) ────────────── */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.4rem, 1.25rem + 0.8vw, 1.75rem); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.effective { color: var(--ink-soft); }

.notice { padding-top: 3rem; padding-bottom: 1rem; text-align: center; }
.notice .prose { margin: 0 auto; }
.notice .button-row { justify-content: center; }
.notice .button { --accent: var(--everything-strip); }

/* ── Sign-up ──────────────────────────────────────────────── */
.signup {
  margin: 3rem auto 0;
  max-width: 44rem;
  padding: 1.75rem 1.25rem 1.5rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}
@media (min-width: 48em) { .signup { padding: 2.25rem 2.5rem 2rem; } }
.signup h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); margin-bottom: 0.3em; }
.signup-intro { color: var(--ink-soft); }
.signup label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.55rem 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
}
.signup input[type="email"]:focus-visible { border-color: var(--focus); }
.signup .button { --accent: var(--everything-strip); flex: 0 0 auto; }
.signup-consent { margin: 0.9rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
/* honeypot: off-screen for people, still in the form for bots */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  margin-top: 2rem;
  padding: 2.5rem 0 3rem;
  background: var(--cream-deep);
  border-top: 2px solid var(--line);
  font-size: 0.98rem;
}
.footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48em) { .footer-grid { grid-template-columns: auto 1fr auto; align-items: start; } }
.footer-logo img { width: 4rem; height: 4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.3rem; }
.site-footer a { color: var(--ink); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.footer-small { margin: 1.5rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .shelf a:hover img, .button:hover, .button:active { transform: none; }
}

@media print {
  .site-header nav, .signup, .skip-link { display: none; }
  body { background: #fff; }
}

/* printable previews (PNG renders of page 1, delivered with each PDF) */
.printable-thumb {
  display: block;
  margin: 0 0 1.25rem;
  border-radius: 0.4rem;
}
.printable-thumb img {
  width: 100%;
  max-width: 16rem;
  margin: 0 auto;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
