/* =====================================================================
   The End Doesn't Happen All At Once — website design
   Colours and fonts carried over from the original Squarespace site.
   ===================================================================== */

:root {
  --beige: #e6dcc8;
  --cream: #f4f3e8;
  --ink: #212e21;
  --ink-soft: #3c4a3c;
  --sage: #aec0ab;
  --sage-deep: #5e7a59;
  --lime: #ebfc72;
  --ember: #e2412b;
  --line: rgba(33, 46, 33, 0.18);

  --font-display: "Syncopate", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 6px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--beige);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--ember); }

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

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 1.9rem;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { background: var(--ink-soft); transform: translateY(-1px); color: var(--cream); }
.button-small { font-size: 0.85rem; padding: 0.65rem 1.1rem; }
.buy { margin: 2rem 0 0; }

.text-link { font-weight: 500; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--beige) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; }

.site-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.8rem, 0.9vw + 0.4rem, 1.05rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.button) { text-decoration: none; font-size: 1rem; white-space: nowrap; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 2px;
}

.menu-toggle { display: none; }

@media (max-width: 1140px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; border: 0; background: transparent; cursor: pointer; flex-shrink: 0;
  }
  .menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
    display: block; width: 1.5rem; height: 2px; background: var(--ink); position: relative; transition: transform 0.2s ease;
  }
  .menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle-bars::before { top: -7px; }
  .menu-toggle-bars::after { top: 7px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--beige); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--gutter) 1.5rem; }
  .site-nav li a:not(.button) { display: block; padding: 0.85rem 0; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .nav-buy { margin-top: 1.25rem; }
  .nav-buy .button { display: block; text-align: center; font-size: 1rem; padding: 0.9rem; }
}

/* ---------- Section headings ---------- */
.section-heading, .page-heading {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(1.45rem, 2.6vw + 0.6rem, 2.5rem);
}

/* ---------- Prose (text from Markdown files) ---------- */
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose h2 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.05rem, 1vw + 0.8rem, 1.35rem); margin: 2.4em 0 0.8em;
}
.prose h3 { font-size: 1.2rem; margin: 1.8em 0 0.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--sage-deep); }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 3px solid var(--ember); }
.prose-large { font-size: 1.12em; }

/* ---------- Homepage: hero ---------- */
.hero { padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5.5rem); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-size: clamp(2rem, 3.6vw + 0.6rem, 3.6rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin-bottom: 0.5em;
}
.hero-byline { font-weight: 500; margin: 0 0 1.5rem; }
.hero-byline a { text-decoration-color: var(--sage-deep); }
.hero-intro { font-size: 1.12em; }
.hero-intro p { margin: 0 0 1em; }

.hero-cover {
  position: relative;
  background: var(--cream);
  border-radius: 4px;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  display: grid; place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.cover-glow {
  position: absolute; inset: 10%;
  background: radial-gradient(circle at 50% 45%, rgba(226, 65, 43, 0.38), rgba(226, 65, 43, 0.12) 40%, transparent 68%);
  filter: blur(12px);
  z-index: -1;
}
.hero-cover img { width: min(100%, 420px); mix-blend-mode: multiply; transition: transform 0.4s ease; }
.hero-cover a:hover img { transform: rotate(-1.5deg) scale(1.02); }

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cover { order: -1; padding: 1.5rem; }
  .hero-cover img { width: min(70%, 300px); }
}

/* ---------- Homepage: press strip ---------- */
.press-strip { background: var(--ink); color: var(--cream); padding: 1.1rem 0; font-size: 0.98rem; }
.press-strip p { margin: 0; text-align: center; line-height: 1.9; }
.press-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--lime); margin-right: 0.8rem;
}
.press-strip a { text-decoration: none; white-space: nowrap; }
.press-strip a:hover { text-decoration: underline; text-decoration-color: var(--lime); }
.press-strip .dot { opacity: 0.5; }

/* ---------- Homepage: praise ---------- */
.praise { position: relative; padding: clamp(3.5rem, 7vw, 6.5rem) 0; isolation: isolate; }
.praise-bg {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(230, 220, 200, 0.55), rgba(230, 220, 200, 0.55)), url("/images/desert.jpg") center / cover no-repeat;
}
.praise .section-heading { text-align: center; margin-bottom: 1.4em; }
.praise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.5rem); }
.quote-card {
  margin: 0; background: color-mix(in srgb, var(--cream) 94%, transparent);
  padding: clamp(1.4rem, 2.5vw, 2rem); border-radius: 4px;
  box-shadow: 0 1px 0 rgba(33, 46, 33, 0.08);
}
.quote-card blockquote { margin: 0 0 1rem; }
.quote-card blockquote p { margin: 0; font-size: 1.12rem; font-weight: 500; line-height: 1.45; }
.quote-card figcaption { font-size: 0.95rem; color: var(--ink-soft); }
.quote-card-featured { grid-column: span 2; background: var(--ink); color: var(--cream); }
.quote-card-featured blockquote p {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.1rem, 1.3vw + 0.6rem, 1.6rem); line-height: 1.3;
}
.quote-card-featured figcaption { color: var(--sage); font-size: 1rem; }
@media (max-width: 900px) {
  .praise-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .praise-grid { grid-template-columns: 1fr; }
  .quote-card-featured { grid-column: auto; }
}

/* ---------- Homepage: foreword ---------- */
.foreword { background: var(--cream); padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.foreword-inner { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.foreword-photo { position: sticky; top: 7rem; }
.foreword-photo img { width: 100%; max-width: 340px; box-shadow: 0 18px 40px -20px rgba(33, 46, 33, 0.45); transform: rotate(-1.2deg); }
.foreword-text { max-width: 44rem; }
.signature { margin-top: 1.5rem; }
.signature-name { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; }
@media (max-width: 820px) {
  .foreword-inner { grid-template-columns: 1fr; }
  .foreword-photo { position: static; }
  .foreword-photo img { max-width: 220px; max-height: 360px; object-fit: cover; object-position: top; margin: 0 auto; }
}

/* ---------- Email sign-up box ---------- */
.signup { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.signup-box {
  background: var(--lime); border-radius: 4px; padding: clamp(1.5rem, 4vw, 3rem);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem 3rem; align-items: center;
}
.signup-heading { font-family: var(--font-body); font-weight: 500; font-size: clamp(1.2rem, 1vw + 0.9rem, 1.6rem); line-height: 1.3; margin: 0; }
.signup-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.signup-form input[type="email"] {
  flex: 1 1 14rem; min-width: 0; font: inherit; padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.55); border: 0; border-bottom: 2px solid var(--ink); border-radius: 4px 4px 0 0; color: var(--ink);
}
.signup-form input::placeholder { color: rgba(33, 46, 33, 0.6); }
.signup-box > p { margin: 0; }
@media (max-width: 760px) { .signup-box { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding: 3rem 0 2.5rem; font-size: 0.95rem; }
.footer-inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem 3rem; }
.footer-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; margin: 0 0 0.6rem; }
.site-footer p { margin: 0 0 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.site-footer li { margin-bottom: 0.5rem; break-inside: avoid; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--lime); }
.footer-small { grid-column: 1 / -1; opacity: 0.65; font-size: 0.85rem; padding-top: 1.5rem; border-top: 1px solid rgba(244, 243, 232, 0.15); }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Standard pages ---------- */
.page { padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(1rem, 3vw, 2rem); }
.page-body { max-width: 46rem; }
.page-with-image .page-inner { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.page-image { margin: 0; position: sticky; top: 7rem; }
.page-image img { width: 100%; border-radius: 4px; }
.page-image figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem; }
@media (max-width: 820px) {
  .page-with-image .page-inner { grid-template-columns: 1fr; }
  .page-image { position: static; }
  .page-image img { max-height: 420px; object-fit: cover; }
}
.page-intro { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* Extras page boxes */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.cards .card { background: var(--cream); border-radius: 4px; padding: 1.6rem 1.6rem 0.6rem; }
.cards .card h2 { margin-top: 0; }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* Reading list contents */
.toc { margin: 0 0 2.5rem; }
.toc-label { font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.6rem; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc a {
  display: inline-block; text-decoration: none; font-size: 0.9rem; padding: 0.35rem 0.8rem;
  border: 1px solid var(--line); border-radius: 99px; background: rgba(244, 243, 232, 0.6);
}
.toc a:hover { background: var(--lime); border-color: var(--ink); }

/* ---------- Meet the authors ---------- */
.authors { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 3.5rem); }
.author-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; margin-bottom: 1.5rem; filter: grayscale(0.15); }
.author-name { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.1rem, 1vw + 0.8rem, 1.4rem); }
@media (max-width: 760px) { .authors { grid-template-columns: 1fr; } }

/* ---------- News & events ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.news-card { background: var(--cream); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.news-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.3s ease; }
.news-image { overflow: hidden; display: block; }
.news-card:hover .news-image img { transform: scale(1.03); }
.news-text { padding: 1.4rem 1.5rem 0.5rem; display: flex; flex-direction: column; flex: 1; }
.news-text > p:last-child { margin-top: auto; padding-bottom: 1rem; }
.news-outlet { font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage-deep); margin: 0 0 0.5rem; }
.news-title { font-size: 1.3rem; margin-bottom: 0.6rem; }
.news-title a { text-decoration: none; }
.news-title a:hover { text-decoration: underline; text-decoration-color: var(--ember); }
.news-card .prose { font-size: 0.98rem; }

.events { max-width: 52rem; }
.events-subheading { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.08em; color: var(--sage-deep); margin: 2rem 0 0.5rem; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.event p { margin: 0 0 0.25rem; }
.event-date { font-weight: 700; }
.event-who { font-size: 1.1rem; }
.event-notes p { margin: 0.35rem 0; }
.event-extra { margin-top: 0.5rem !important; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.event-price { font-size: 0.9rem; background: var(--cream); padding: 0.15rem 0.6rem; border-radius: 99px; }
.event-link { font-weight: 500; }
.event-list-past .event { opacity: 0.78; }
.no-events { padding: 1.4rem 0; border-top: 1px solid var(--line); }

/* ---------- Forms ---------- */
.form { margin-top: 2rem; display: grid; gap: 1.2rem; }
.field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field input:not([type="checkbox"]):not([type="file"]), .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); padding: 0.85rem 1rem;
  background: var(--cream); border: 0; border-bottom: 2px solid var(--ink); border-radius: 4px 4px 0 0;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input[type="file"] { font: inherit; font-size: 0.95rem; }
.field-check { display: flex; gap: 0.75rem; align-items: flex-start; }
.field-check input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--ink); flex-shrink: 0; }
.field-check label { font-weight: 400; font-size: 0.98rem; margin: 0; }
.req { color: var(--ember); }
.hint { font-weight: 400; font-size: 0.9rem; color: var(--ink-soft); }
.form .button { justify-self: start; }
.notice { background: var(--cream); border-left: 4px solid var(--ember); padding: 1rem 1.2rem; font-size: 0.95rem; }
.event-list-past .event-link, .event-list-past .event-price { display: none; }
.event-list-past .event-extra:not(:has(> :not(.event-link):not(.event-price))) { display: none; }

@media (max-width: 480px) {
  .button { white-space: normal; text-align: center; }
}

/* ---------- Homepage: short praise + "recommended on" ---------- */
.hero-quote { margin: 0 0 1.5rem; padding-left: 1rem; border-left: 3px solid var(--ember); }
.hero-quote blockquote { margin: 0; }
.hero-quote blockquote p { margin: 0; font-size: 1.15rem; font-weight: 500; line-height: 1.45; }
.hero-quote figcaption { margin-top: 0.35rem; font-size: 0.95rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.hero-actions .buy { margin: 0; }
.hero-badge { margin: 0; display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; font-weight: 500; }
.hero-badge::before { content: ""; flex-shrink: 0; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(226, 65, 43, 0.2); }
.hero-badge a { text-decoration-color: var(--sage-deep); }

/* ---------- Where to Buy / Leave a Review ---------- */
.page-image-cover { background: var(--cream); border-radius: 4px; padding: clamp(1.5rem, 3vw, 2.5rem); }
.page-image-cover img { mix-blend-mode: multiply; max-width: 340px; margin: 0 auto; border-radius: 0; }
.link-groups { display: grid; gap: 1.25rem; margin-top: 2rem; }
.link-group { background: var(--cream); border-radius: 4px; padding: 1.4rem 1.5rem 1.5rem; }
.link-group-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 1rem; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.06em; color: var(--sage-deep); }
.link-group-tag { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 0.8rem; color: var(--ink); background: var(--lime); padding: 0.15rem 0.6rem; border-radius: 99px; }
.link-group-tag[hidden] { display: none; }
.link-group-text p { margin: 0 0 1rem; }
.link-group-text p:last-child { margin-bottom: 0; }
.link-group-text + .link-list { margin-top: 1rem; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.store-link { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.9rem 1.1rem; background: var(--ink); color: var(--cream); border-radius: var(--radius); text-decoration: none; transition: transform 0.15s ease, background-color 0.15s ease; }
.store-link:hover { background: var(--ink-soft); color: var(--cream); transform: translateY(-1px); }
.store-name { font-weight: 700; }
.store-note { opacity: 0.75; font-size: 0.95rem; }
.store-arrow { margin-left: auto; }
.link-group-image { display: block; width: 200px; height: auto; margin-top: 1rem; border-radius: 4px; }
.site-nav .button[aria-current="page"] { text-decoration: none; }
