/* ============================================================
   Mr Patches — picture-book publisher
   Palette + type pulled from the hand-drawn cover artwork.
   ============================================================ */

:root {
  --paper:      #FBF4E4;  /* warm book-stock background     */
  --paper-deep: #F3E8CE;  /* slightly deeper paper panels   */
  --ink:        #221D17;  /* near-black line-art ink        */
  --ink-soft:   #5b5345;  /* muted body text                */
  --lime:       #9FC93C;  /* chartreuse "Bored" field       */
  --lime-deep:  #6f942222; /* (unused placeholder)          */
  --lime-ink:   #5f7d1e;  /* readable lime for small text   */
  --yellow:     #F6C638;  /* "Bored" floor yellow           */
  --orange:     #EE6C2B;  /* the polka-dot vermilion        */
  --red:        #C42E2B;  /* "A Bite to Remember" theatre   */
  --red-deep:   #9c211f;
  --sky:        #9AD4DC;  /* mascot background blue          */
  --sky-deep:   #6fb6c1;

  --maxw: 1080px;
  --radius: 16px;
  --shadow: 0 14px 34px -18px rgba(34, 29, 23, 0.55);
  --hard-shadow: 5px 5px 0 var(--ink);

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(238, 108, 43, 0.08) 1.6px, transparent 1.7px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; margin: 0; }
p { margin: 0 0 1rem; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 0 0 10px 0; z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  text-decoration: none;
  padding: 0.7rem 1.35rem; border-radius: 999px;
  border: 2.5px solid var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn--sm { padding: 0.42rem 1rem; font-size: 0.95rem; }
.btn--primary { background: var(--orange); color: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost   { background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 rgba(34,29,23,0.18); }
.btn--yellow  { background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn:hover, .btn:active { transform: none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(251, 244, 228, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 2.5px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__mark { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--sky); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.2px; }
.site-nav { display: flex; gap: clamp(0.8rem, 2.5vw, 1.8rem); }
.site-nav a { font-family: var(--font-display); font-weight: 500; text-decoration: none; padding: 0.2rem 0; border-bottom: 2.5px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--orange); }

/* ---------- Layout helpers ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 5vw, 2.5rem); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.section-head { max-width: var(--maxw); margin: 0 auto 2.5rem; }

.eyebrow {
  font-family: var(--font-display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; color: var(--lime-ink); margin: 0 0 0.6rem;
}
.section-head h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); max-width: 18ch; }

/* ---------- Colour bands (full-bleed, ink-edged) ---------- */
.band { border-top: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); }
.band--lime   { background: var(--lime); }
.band--sky    { background: var(--sky); }
.band--yellow { background: var(--yellow); }
.band--red    { background: var(--red); color: var(--paper); }
.band--red .eyebrow { color: #ffd9a8; }

/* ---------- Tally-mark divider (the signature) ---------- */
.tally-divider {
  height: 40px;
  background: url("/assets/tally.svg") repeat-x center / 120px 40px;
  opacity: 0.85; margin: 0 auto; max-width: var(--maxw);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 28%, rgba(159,201,60,0.30), transparent 42%),
    radial-gradient(circle at 88% 75%, rgba(154,212,220,0.35), transparent 45%);
}
.hero__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero__text h1 { font-size: clamp(2.3rem, 1.4rem + 4vw, 4rem); font-weight: 700; margin: 0.3rem 0 1rem; }
.hero__wink { color: var(--orange); }
.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero__art img {
  border-radius: var(--radius); border: 3px solid var(--ink);
  box-shadow: var(--shadow); transform: rotate(-1.5deg); background: var(--lime);
}

/* ---------- Books (home) ---------- */
.books { max-width: var(--maxw); margin: 0 auto; }
.book {
  display: grid; grid-template-columns: 260px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.book--alt { grid-template-columns: 1fr 260px; }
.book--alt .book__cover { order: 2; }
.book__cover { display: block; }
.book__cover img {
  border: 3px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow);
  transform: rotate(-2deg); transition: transform 0.15s ease;
}
.book--alt .book__cover img { transform: rotate(2deg); }
.book__cover:hover img { transform: rotate(-2deg) scale(1.03); }
.book--alt .book__cover:hover img { transform: rotate(2deg) scale(1.03); }
.book__title { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); color: var(--red); text-decoration: none; }
.book__title:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.book--alt .book__title { color: var(--lime-ink); }
.book__meta { margin: 0.5rem 0 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  font-family: var(--font-display); font-weight: 500; font-size: 0.8rem;
  background: var(--paper-deep); border: 2px solid var(--ink);
  padding: 0.15rem 0.7rem; border-radius: 999px;
}
.book__credits { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }
.book__order { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.book__more { font-family: var(--font-display); font-weight: 600; text-decoration: none; border-bottom: 2.5px solid var(--orange); }

/* ---------- Stockists ("Where to find our books") ---------- */
.stockists__head { max-width: var(--maxw); margin: 0 auto 2rem; }
.stockists__head h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); }
.stockists__head .eyebrow { color: var(--red-deep); }
.stockist-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.stockist {
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 14px;
  overflow: hidden; box-shadow: var(--hard-shadow);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.stockist:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { a.stockist:hover { transform: none; } }
.stockist__img { width: 100%; height: 150px; object-fit: cover; display: block; border-bottom: 2.5px solid var(--ink); }
.stockist__text { padding: 1rem 1.1rem; }
.stockist h3 { font-size: 1.2rem; margin: 0.25rem 0 0.4rem; }
.stockist .city { font-family: var(--font-display); font-weight: 600; color: var(--orange); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stockist__map { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--lime-ink); }
.stockist--order { background: var(--yellow); justify-content: center; }
.stockist--order .city { color: var(--red-deep); }
.stockist--order .btn { margin-top: 0.5rem; }
.stockists__note { max-width: var(--maxw); margin: 1.6rem auto 0; }
.stockists__note .btn { margin-top: 0.4rem; }

/* ---------- Reviews ---------- */
.reviews { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); }
.reviews .wrap { display: contents; }
.review { margin: 0; max-width: 42ch; }
.review blockquote { margin: 0 0 0.8rem; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); line-height: 1.3; }
.review figcaption { font-weight: 700; }

/* ---------- Readings ---------- */
.readings__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.readings__art img { border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; transform: rotate(1.5deg); }
.readings__text h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); margin-bottom: 1rem; max-width: 16ch; }

/* ---------- About ---------- */
.about { max-width: var(--maxw); margin: 0 auto; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.person { background: var(--paper-deep); border: 2.5px solid var(--ink); border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 2rem); box-shadow: var(--hard-shadow); }
.person h3 { font-size: 1.5rem; }
.person__role { font-family: var(--font-display); font-weight: 600; color: var(--orange); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; margin: 0.2rem 0 0.9rem; }
.person p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 5vw, 2.5rem) 1.5rem; }
.footer__grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.brand--footer .brand__name { color: var(--paper); }
.footer__tag { color: #cfc6b3; max-width: 26ch; margin-top: 0.8rem; }
.footer__head { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.8rem; color: var(--lime); }
.footer__list { list-style: none; margin: 0; padding: 0; }
.footer__list li { margin-bottom: 0.5rem; }
.footer__list a { color: var(--paper); text-decoration: none; border-bottom: 1.5px solid transparent; }
.footer__list a:hover { border-bottom-color: var(--orange); }
.muted { color: #a99f8c; font-size: 0.92rem; }
.footer__base { max-width: var(--maxw); margin: 2.5rem auto 0; padding-top: 1.2rem; border-top: 1.5px solid #4a4338; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; font-size: 0.9rem; color: #a99f8c; }
.footer__minor { display: flex; gap: 1.3rem; }
.footer__minor a { color: #cfc6b3; text-decoration: none; border-bottom: 1.5px solid transparent; }
.footer__minor a:hover { border-bottom-color: var(--lime); }

/* ============================================================
   BOOK SUB-PAGES
   ============================================================ */
.book-hero { border-bottom: 2.5px solid var(--ink); }
.book-hero--bored { background: linear-gradient(180deg, var(--lime) 0%, var(--yellow) 100%); }
.book-hero--bite  { background: var(--red); color: var(--paper); }
.book-hero__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 320px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.book-hero__cover img { border: 3px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.book-hero__title { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); font-weight: 700; margin-bottom: 0.5rem; }
.book-hero__sub { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; margin-bottom: 1rem; }
.book-hero__meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.book-hero--bite .tag { background: rgba(0,0,0,0.18); color: var(--paper); border-color: var(--paper); }
.book-hero__order { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.book-hero--bite .price { color: var(--paper); }
.book-crumb { display: inline-block; margin-bottom: 1.2rem; font-family: var(--font-display); font-weight: 500; text-decoration: none; }
.book-hero--bite .book-crumb { color: var(--paper); }

.book-body { max-width: 720px; margin: 0 auto; }
.book-body p { font-size: 1.12rem; }
.book-body .lead { font-size: 1.28rem; font-family: var(--font-display); font-weight: 500; line-height: 1.4; }

/* media (video / audio) */
.media { max-width: 820px; margin: 0 auto; }
.media h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem); margin-bottom: 0.4rem; }
.media__frame {
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--hard-shadow); overflow: hidden; background: var(--ink);
}
.media__frame video { display: block; width: 100%; height: auto; }
.media__audio {
  display: flex; align-items: center; gap: 1.2rem;
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--hard-shadow); background: var(--paper); padding: 1.2rem;
}
.media__audio img { width: 110px; flex: none; border: 2.5px solid var(--ink); border-radius: 6px; }
.media__audio audio { width: 100%; }
.media__note { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.8rem; }

/* peek inside gallery */
.peek h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem); }
.peek__grid { max-width: var(--maxw); margin: 1.5rem auto 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.peek__grid figure { margin: 0; }
.peek__grid img { width: 100%; border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.peek__grid figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }

/* ---------- Generic sub-pages (Català / Terms) ---------- */
.page { max-width: 720px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 5vw, 2.5rem); }
.page h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); margin-bottom: 0.4rem; }
.page h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 2rem 0 0.6rem; color: var(--red); }
.page .eyebrow { color: var(--lime-ink); }
.page__back { display: inline-block; margin-bottom: 2rem; font-family: var(--font-display); font-weight: 500; text-decoration: none; }
.page__back:hover { color: var(--orange); }
.page__cover { float: right; width: 200px; margin: 0 0 1rem 1.5rem; border: 3px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow); transform: rotate(2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 460px; }
  .book, .book--alt { grid-template-columns: 1fr; justify-items: start; }
  .book__cover { max-width: 220px; }
  .book--alt .book__cover { order: 0; }
  .stockist-grid { grid-template-columns: 1fr 1fr; }
  .reviews { grid-template-columns: 1fr; }
  .readings__inner { grid-template-columns: 1fr; }
  .readings__art { max-width: 420px; }
  .people { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .book-hero__inner { grid-template-columns: 1fr; }
  .book-hero__cover { max-width: 260px; }
  .peek__grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .site-nav { gap: 0.9rem; font-size: 0.95rem; }
  .brand__name { font-size: 1.25rem; }
  .stockist-grid { grid-template-columns: 1fr; }
  .page__cover { float: none; width: 160px; margin: 0 0 1rem; }
  .media__audio { flex-direction: column; align-items: flex-start; }
}
