/* ==========================================================================
   thelastbites.com
   Same framework as the previous site, re-skinned. Palette comes from the
   logo: signage red on charred near-black, with bone for paper. The recurring
   texture is a fine spatter, which is the whole book in one motif: plated
   sauce from the front, a crime scene from the back.
   ========================================================================== */

/* Self-hosted variable font, latin subset only (~38KB each). The single
   file covers weights 500-700. Body text uses system serifs at zero cost. */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/playfair-display-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/playfair-display-latin-italic.woff2") format("woff2");
}

:root {
  --char: #16110f;         /* charred near-black, the dark sections */
  --char-soft: #2a1d19;    /* warmer top of the dark gradients */
  --ember: #d11617;        /* the logo red */
  --ember-bright: #ee3a34; /* hover */
  --ember-deep: #a5100f;   /* red that passes contrast on bone */
  --ember-light: #ff8f7d;  /* accent text on charcoal (6.7:1) */
  --bone: #f8f4ed;         /* page background */
  --bone-deep: #efe6d8;    /* alternate sections */
  --ink: #1f1a18;
  --ink-soft: #5c5049;
  --line: #e2d8c8;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spatter, tiled. Inline SVG costs a few hundred bytes and zero requests. */
  --spatter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><g fill="%23d11617" opacity=".16"><ellipse cx="34" cy="46" rx="5" ry="3.4" transform="rotate(-24 34 46)"/><circle cx="52" cy="63" r="1.5"/><circle cx="21" cy="70" r="1"/><ellipse cx="168" cy="28" rx="3.4" ry="2.4" transform="rotate(38 168 28)"/><circle cx="182" cy="44" r="1.2"/><circle cx="200" cy="96" r="2.2"/><circle cx="214" cy="110" r="1"/><ellipse cx="96" cy="150" rx="6" ry="3" transform="rotate(14 96 150)"/><circle cx="116" cy="166" r="1.6"/><circle cx="80" cy="172" r="1"/><ellipse cx="150" cy="206" rx="3" ry="2" transform="rotate(-40 150 206)"/><circle cx="30" cy="212" r="1.8"/><circle cx="228" cy="180" r="1.2"/><circle cx="128" cy="96" r="1"/></g></svg>');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--ink);
  background-color: var(--bone);
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--char);
  line-height: 1.18;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: .5rem; }
h3 { font-size: 1.3rem; }

p, ul, ol { margin-bottom: 1.1rem; }

a { color: var(--ember-deep); text-underline-offset: 3px; }
a:hover { color: var(--ember); }

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

.eyebrow {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ember-deep);
  margin-bottom: .75rem;
}

/* Layout ------------------------------------------------------------------ */

.container { max-width: 1060px; margin: 0 auto; padding: 3.5rem 1.5rem; }
.container.tight { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.prose { max-width: 46rem; }
.prose-center { max-width: 46rem; margin-left: auto; margin-right: auto; }

.section-alt { background-color: var(--bone-deep); }

.section-dark {
  background-color: var(--char);
  background-image: var(--spatter), linear-gradient(160deg, var(--char-soft), var(--char) 68%);
  color: #ece5df;
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--bone); }
.section-dark a { color: var(--ember-light); }
.section-dark .eyebrow { color: var(--ember-light); }

/* Header ------------------------------------------------------------------ */

.site-header {
  background-color: var(--char);
  background-image: linear-gradient(180deg, var(--char-soft), var(--char));
  border-bottom: 1px solid rgba(209, 22, 23, .38);
  padding: 1rem 1.5rem;
}

.site-header .inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
}

/* The wordmark is the logo itself, so it ships as one cached 10KB SVG. */
.wordmark { display: block; line-height: 0; flex-shrink: 0; }
.wordmark img { width: 108px; height: auto; }
.wordmark:hover { opacity: .85; }

.site-nav {
  font-family: var(--font-ui);
  font-size: .92rem;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem 1.4rem;
}
.site-nav a { color: #e0d7d1; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ember-light); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--ember); padding-bottom: 2px; }

/* Hero -------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 3.5rem;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.hero-mark img { width: 100%; }

.hero-text .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ember-light);
  margin-bottom: .75rem;
}

.hero-text h1 { color: var(--bone); margin-bottom: .35rem; }

.hero-text .byline {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  color: #d8c9c2;
  margin-bottom: 1.25rem;
}

.hero-text .accolade {
  font-family: var(--font-ui);
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ember-light);
  margin-bottom: 1.25rem;
}

.hero-text blockquote {
  border-left: 3px solid var(--ember);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: #ddd3cd;
}
.hero-text blockquote cite { display: block; font-style: normal; font-family: var(--font-ui); font-size: .85rem; color: var(--ember-light); margin-top: .4rem; }

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  padding: .85rem 1.6rem;
  border-radius: 6px;
  border: 2px solid var(--ember);
  background-color: var(--ember);
  color: var(--bone);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background-color: var(--ember-bright); border-color: var(--ember-bright); color: #fff; }

.btn-outline { background-color: transparent; color: var(--ember-light); }
.btn-outline:hover { background-color: var(--ember); border-color: var(--ember); color: var(--bone); }

/* Dark sections tint links salmon; buttons must keep their own colors.
   These selectors outrank the `.section-dark a` rule. */
.section-dark a.btn, .app-feature a.btn { color: var(--bone); }
.section-dark a.btn:hover, .app-feature a.btn:hover { color: #fff; }
.section-dark a.btn-outline, .app-feature a.btn-outline { color: var(--ember-light); }
.section-dark a.btn-outline:hover, .app-feature a.btn-outline:hover { color: var(--bone); }

/* Outline button for light backgrounds */
.btn-ghost { border-color: var(--ember-deep); background: transparent; color: var(--ember-deep); }
.btn-ghost:hover { background-color: var(--ember-deep); border-color: var(--ember-deep); color: #fff; }

.btn-solid { border-color: var(--ember-deep); background-color: var(--ember-deep); color: #fff; }
.btn-solid:hover { background-color: var(--ember); border-color: var(--ember); color: #fff; }

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .9rem; }

.micro {
  font-family: var(--font-ui);
  font-size: .85rem;
  color: var(--ink-soft);
}
.section-dark .micro, .hero .micro { color: #b8ada6; }

/* Cards -------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem;
  margin: 1.5rem 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(22, 17, 15, .05);
}
.card h3 { margin-bottom: .4rem; }
.card h3 a { color: var(--char); text-decoration: none; }
.card h3 a:hover { color: var(--ember-deep); text-decoration: underline; }
.card p { margin-bottom: .6rem; font-size: .98rem; }
.card .micro { margin-bottom: 0; }

/* Whole-card link: the card carries one link (the title). The stretched
   pseudo-element makes the entire card a click target, including the
   "Read the guide" cue, without adding a second link to the same URL. */
.card-link { position: relative; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card-link h3 a::after { content: ""; position: absolute; inset: 0; }
.card-link:hover { border-color: var(--ember); box-shadow: 0 6px 18px rgba(22, 17, 15, .14); transform: translateY(-2px); }
.card-link:hover h3 a { color: var(--ember-deep); text-decoration: none; }
.card-link:hover .micro { color: var(--ember-deep); }
.card-link .micro { transition: color .15s ease; }

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(22, 17, 15, .2);
}

/* Highlight and feature blocks --------------------------------------------- */

.highlight-box {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ember);
  border-radius: 8px;
  padding: 1.8rem 2rem;
  margin: 2rem 0;
}
.highlight-box h2, .highlight-box h3 { margin-top: 0; }

/* Dark featured-app block used at the bottom of articles */
.app-feature {
  background-color: var(--char);
  background-image: var(--spatter), linear-gradient(150deg, var(--char-soft), var(--char) 70%);
  color: #ece5df;
  border-radius: 10px;
  padding: 2.2rem 2rem;
  margin: 2.5rem 0;
}
.app-feature h2, .app-feature h3 { color: var(--bone); margin-top: 0; }
.app-feature a { color: var(--ember-light); }
.app-feature .app-feature-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.app-feature .app-feature-head img { width: 72px; height: 72px; border-radius: 16px; }
.app-feature .app-feature-head h2, .app-feature .app-feature-head h3 { margin-bottom: .1rem; }
.app-feature .micro { color: #b8ada6; }

/* Read-alike book entries --------------------------------------------------- */

.book-entry { margin-bottom: 2.2rem; }
.book-entry h2 { margin-bottom: .35rem; }
.book-entry .book-meta {
  font-family: var(--font-ui);
  font-size: .88rem;
  color: var(--ink-soft);
  margin-bottom: .7rem;
}
.book-entry.book-entry-featured {
  background: var(--bone-deep);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ember);
  border-radius: 8px;
  padding: 1.6rem 1.8rem;
}
.book-entry.book-entry-featured h2 { margin-top: 0; }

/* App page hero -------------------------------------------------------------- */

.app-hero { text-align: left; }
.app-hero .app-hero-head { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.app-hero .app-hero-head img { width: 108px; height: 108px; border-radius: 24px; box-shadow: 0 10px 26px rgba(0, 0, 0, .5); }
.app-hero h1 { margin-bottom: .2rem; }
.app-hero .tagline { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--ember-light); margin-bottom: 0; }

.badge-soon {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--ember);
  border-radius: 999px;
  padding: .3rem .9rem;
  margin-bottom: 1rem;
}

/* Notify form ----------------------------------------------------------------- */

.notify-form { margin: 1.2rem 0; max-width: 32rem; }
.notify-form .fields { display: flex; flex-wrap: wrap; gap: .7rem; }
.notify-form input[type="email"] {
  flex: 1 1 220px;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: .8rem 1rem;
  border: 2px solid #4a3730;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.notify-form input[type="email"]:focus { outline: 2px solid var(--ember); outline-offset: 1px; }
.notify-form button {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  padding: .8rem 1.5rem;
  border-radius: 6px;
  border: 2px solid var(--ember);
  background: var(--ember);
  color: var(--bone);
  cursor: pointer;
}
.notify-form button:hover { background: var(--ember-bright); border-color: var(--ember-bright); color: #fff; }
/* Honeypot field: hidden from people, tempting to bots */
.notify-form .hp { position: absolute; left: -6000px; }

/* Feature lists on app pages */
.feature-list { list-style: none; padding-left: 0; }
.feature-list li { padding-left: 1.6rem; position: relative; margin-bottom: .85rem; }
.feature-list li::before { content: "◆"; position: absolute; left: 0; color: var(--ember-deep); font-size: .8em; top: .15em; }
.section-dark .feature-list li::before, .app-feature .feature-list li::before { color: var(--ember-light); }

/* Checklist-style link lists (guides on the homepage etc.) */
.guide-list { list-style: none; padding-left: 0; }
.guide-list li { padding-left: 1.7rem; position: relative; margin-bottom: .7rem; }
.guide-list li::before { content: "→"; position: absolute; left: 0; color: var(--ember-deep); font-family: var(--font-ui); }
.section-dark .guide-list li::before { color: var(--ember-light); }

/* Numbered lists (the questions on the last-meal pieces) */
.question-list { counter-reset: q; list-style: none; padding-left: 0; }
.question-list li { counter-increment: q; margin-bottom: 1.3rem; padding-left: 3rem; position: relative; }
.question-list li::before {
  content: counter(q);
  position: absolute;
  left: 0;
  top: .1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ember);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.question-list li strong { font-family: var(--font-display); color: var(--char); }

/* Category jump-nav on the guides hub */
.cat-nav {
  font-family: var(--font-ui);
  font-size: .92rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  list-style: none;
  padding-left: 0;
  margin: 1.4rem 0 0;
}
.cat-nav li { margin: 0; }
.cat-nav a {
  display: inline-block;
  text-decoration: none;
  padding: .4rem .9rem;
  border: 1px solid rgba(255, 143, 125, .45);
  border-radius: 999px;
}
.cat-nav a:hover { background: var(--ember); color: var(--bone); border-color: var(--ember); }

/* Sample chapters ------------------------------------------------------------- */

.chapter { max-width: 38rem; margin: 0 auto; }
.chapter h2 {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember-deep);
  text-align: center;
  margin: 3.5rem 0 1.6rem;
}
.chapter h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--ember);
  margin: .8rem auto 0;
}
.chapter p { margin-bottom: 0; text-indent: 1.6em; }
.chapter p:first-of-type, .chapter h2 + p { text-indent: 0; }
.chapter .preamble { font-style: italic; color: var(--ink-soft); text-indent: 0; margin-bottom: 1.1rem; }

/* Footer ------------------------------------------------------------------------ */

.site-footer {
  background-color: var(--char);
  background-image: var(--spatter), linear-gradient(200deg, var(--char-soft), var(--char) 60%);
  color: #c6bab3;
  font-size: .95rem;
  margin-top: 3rem;
}
.site-footer .container { padding-top: 2.8rem; padding-bottom: 2.2rem; }
.site-footer .bio {
  max-width: 46rem;
  border-left: 3px solid var(--ember);
  padding-left: 1.2rem;
  margin-bottom: 1.6rem;
}
.site-footer a { color: var(--ember-light); }
.site-footer a:hover { color: #fff; }
.site-footer nav {
  font-family: var(--font-ui);
  font-size: .88rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin-bottom: 1.4rem;
}
.site-footer nav a { text-decoration: none; }
.site-footer .legal { font-family: var(--font-ui); font-size: .8rem; color: #93857e; margin-bottom: 0; }

/* Accessibility ------------------------------------------------------------------ */

:focus-visible { outline: 3px solid var(--ember-deep); outline-offset: 2px; }
.section-dark :focus-visible, .site-header :focus-visible, .site-footer :focus-visible,
.app-feature :focus-visible { outline-color: var(--ember-light); }

.skip-link {
  position: absolute;
  left: -6000px;
  font-family: var(--font-ui);
  background: var(--ember);
  color: var(--bone);
  padding: .6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* Responsive ---------------------------------------------------------------------- */

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 1.5rem; text-align: center; }
  .hero-mark img { max-width: 320px; margin: 0 auto; }
  .hero-text blockquote { text-align: left; }
  .cta-row { justify-content: center; }
  .cta-row .btn { flex: 1 1 100%; }
  .container { padding: 2.4rem 1.25rem; }
  .app-hero .app-hero-head { justify-content: flex-start; }
  .highlight-box, .app-feature { padding: 1.4rem 1.2rem; }
  .wordmark img { width: 88px; }
}

/* Print: used on the sample chapters so readers can take them offline.
   Pages mark non-essential blocks with class="no-print". */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .container { padding: 0; max-width: none; }
  a { color: #000; text-decoration: none; }
  .question-list li::before { background: #fff; color: #000; border: 1px solid #000; }
  .chapter h2 { color: #000; }
  .chapter h2::after { background: #000; }
  .print-credit { display: block !important; font-size: 9pt; margin-top: 2rem; border-top: 1px solid #000; padding-top: .5rem; }
}
/* --- Signup form: inline feedback and the download reveal -----------------
   All of this is only ever seen when notify.js is running. Without it the
   form posts and the browser changes page, and none of these rules apply. */

.notify-note {
  font-family: var(--font-ui);
  font-size: .9rem;
  line-height: 1.5;
  margin: .7rem 0 0;
  padding: .65rem .85rem;
  border-radius: 6px;
  border-left: 3px solid var(--line);
  background: var(--bone-deep);
  color: var(--ink);
}
/* Something needs their attention: a typo, a throwaway domain, a dud address. */
.notify-note-warn { border-left-color: var(--ember); background: #fdeceb; color: #6b1a14; }
.section-dark .notify-note { background: rgba(255,255,255,.09); color: var(--bone); }
.section-dark .notify-note-warn { background: rgba(255,255,255,.12); color: var(--bone); }

.notify-fix {
  font-family: var(--font-ui);
  font-size: .88rem;
  font-weight: 600;
  margin-left: .15rem;
  padding: .2rem .6rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.notify-fix:hover { background: rgba(0,0,0,.07); }
.section-dark .notify-fix:hover { background: rgba(255,255,255,.14); }

.notify-form button[disabled] { opacity: .65; cursor: default; }

.notify-reveal {
  margin: 1.2rem 0;
  max-width: 32rem;
  animation: notify-in .28s ease-out both;
}
.notify-reveal:focus { outline: none; }
.notify-reveal .notify-reveal-head {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0 0 .9rem;
}
.section-dark .notify-reveal .notify-reveal-head { color: var(--bone); }
.notify-reveal .cta-row { margin-bottom: .7rem; }

@keyframes notify-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .notify-reveal { animation: none; }
}

.print-credit { display: none; }
