/* RecipeMend — shared design system. BEM naming; no inline styles. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: optional;
}

:root {
  /* brand palette — extends the holding-page leaf/cream palette */
  --color-ink: #26302b;
  --color-ink-soft: #4c5850;
  --color-cream: #faf7f0;
  --color-cream-deep: #f2ecdc;
  --color-card: #ffffff;
  --color-leaf: #2e6b4f;
  --color-leaf-deep: #1f4a37;
  --color-leaf-pale: #e6f0ea;
  --color-line: #8f8265;
  --color-gold: #6b4316;
  --color-gold-pale: #fbeed7;

  /* editorial kitchen-journal extension (grafted from competitor-A) — same
     hues, deepened for an ink-and-cream engraved feel. Used by the footer
     ground, hero photo grade, and gold hairline/ornament layer only; body
     sections keep the original tokens above untouched. NOTE: master already
     owns --color-gold-bright (#e8b54a) for the accent-frame + footer sweep,
     so A's darker engraving gold is named --color-gold-mid / -hairline here
     to avoid clobbering it. */
  --color-ink-deep: #171f1a;
  --color-parchment: #f6f1e4;
  --color-gold-mid: #b6821f;      /* engraving gold (A's gold-bright) */
  --color-gold-hairline: #cfa752; /* thin gold rule / footer labels (A's gold-line) */
  --color-berry: #7a2b3a;

  /* semantic status (never gray = actionable) */
  --color-safe: #1f6d43;
  --color-safe-bg: #e5f3ea;
  --color-caution: #8a5a12;
  --color-caution-bg: #fbf0d9;
  --color-urgent: #9c2f2f;
  --color-urgent-bg: #fbe8e6;
  --color-unknown: #4c5399;
  --color-unknown-bg: #ececf7;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1160px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.25rem;
  --space-6: 5rem;

  --radius: 12px;
  --radius-sm: 8px;

  /* ---------- editorial type + rhythm tokens (owner round 4) ---------- */
  --text-body: 22px;
  --leading-body: 36px;

  --text-list: 22px;
  --leading-list: 36px;

  /* Small/caption tier (owner ④): a dedicated step between body and the
     micro UI tier, ~17px with proportional ~1.45 leading + its own spacing.
     ALL small text (tool-card disclaimer, footer note, credits, source
     lines, image captions) uses this so smaller text never inherits the
     body's fixed 36px leading. */
  --text-sm: 17px;
  --leading-sm: 25px;      /* 25/17 ≈ 1.47 */
  --space-sm-gap: 12px;    /* default vertical rhythm for small-text blocks */

  --text-caption: 16px;
  --leading-caption: 22px;

  --text-h1: 52px;
  --leading-h1: 58px;

  --text-h2: 38px;
  --leading-h2: 44px;

  --text-h3: 29px;
  --leading-h3: 35px;

  --text-h4: 23px;
  --leading-h4: 30px;

  --text-ui: 17px;
  --leading-ui: 24px;

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  --gutter: clamp(20px, 4vw, 48px);

  --width-prose: 720px;
  --width-wide: 960px;
  --width-full: 1160px;

  /* ---------- 2026 motion-forward layer tokens ---------- */
  --color-gold-bright: #e8b54a;
  --color-leaf-bright: #3f8f68;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --z-header: 40;
  --z-chip: 5;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--color-cream);
  color: var(--color-ink);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--color-leaf-deep); text-underline-offset: 0.15em; }
a:hover { color: var(--color-leaf); }

:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-leaf-deep);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  margin-block: 0 var(--space-xl);
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  margin-block: var(--space-4xl) var(--space-lg);
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  margin-block: var(--space-3xl) var(--space-md);
}

h4 {
  font-size: var(--text-h4);
  line-height: var(--leading-h4);
  margin-block: var(--space-2xl) var(--space-sm);
}

/* Sibling-aware rhythm: a heading directly following another block
   already carries its own top margin — a paragraph/list directly under
   a heading should not add a second gap under the heading's own margin. */
h1 + p, h2 + p, h3 + p, h4 + p,
h1 + ul, h2 + ul, h3 + ul, h4 + ul,
h1 + ol, h2 + ol, h3 + ol, h4 + ol,
h1 + .fact-block, h2 + .fact-block, h3 + .fact-block {
  margin-top: 0;
}

/* The first heading in a prose flow (directly after the hero, or first
   child of a section) shouldn't carry a top margin either. */
.section > .container > h2:first-child,
.section > .container > h3:first-child,
.section > .container > h4:first-child {
  margin-top: 0;
}

p, li {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

p + p, p + ul, p + ol, ul + p, ol + p {
  margin-top: var(--space-lg);
}

ul, ol {
  font-size: var(--text-list);
  line-height: var(--leading-list);
  padding-left: 1.35em;
  margin-block: 0 var(--space-xl);
}

li + li { margin-top: var(--space-md); }

/* Small/caption tier (owner ④) — the single home for ALL small text. Every
   selector here gets an EXPLICIT line-height so no small element can inherit
   the body's 36px fixed leading. Grouped so the tier is auditable in one place:
   captions, footer note, disclaimers, source/citation lines, credits, tool
   micro-copy, badge text, and result-row metadata. */
.caption,
figcaption,
small,
.card__desc,
.site-footer__note,
.db-badge,
.disclaimer-strip,
.fact-block__source,
.mend-strip__cite,
.results__recipe-title,
.results__stat-label,
.ing-row__meta,
.ing-row__why,
.tool__privacy-note,
.tool__sample-link,
.fakedoor__note {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.1rem;
}

/* ---------- editorial breakout grid ----------
   Applies only to .section > .container (content surfaces). Header bar,
   hero__inner, and site-footer__grid keep their own plain full-width
   .container — they are NOT .section children, so this rule doesn't
   touch them (they stay at the Full tier per the component map). */
.section > .container {
  display: grid;
  grid-template-columns:
    [full-start] minmax(0, 1fr)
    [wide-start] minmax(0, 120px)
    [prose-start] minmax(0, var(--width-prose))
    [prose-end] minmax(0, 120px)
    [wide-end] minmax(0, 1fr)
    [full-end];
  padding-inline: 0;
}

.section > .container > * {
  grid-column: prose-start / prose-end;
}

.section > .container > .breakout-wide,
.section > .container > .card-grid,
.section > .container > .results,
.section > .container > .sources-table,
.section > .container > .table-wrap,
.section > .container > table {
  grid-column: wide-start / wide-end;
  max-width: var(--width-wide);
  width: 100%;
  justify-self: center;
}

.section > .container > .breakout-full {
  grid-column: full-start / full-end;
  max-width: var(--width-full);
}

/* Below tablet, the 120px shoulder tracks would eat into the prose
   measure on narrow viewports (owner risk-flag #5) — collapse to a
   single prose-width column so nothing steals width at 375px. */
@media (max-width: 768px) {
  .section > .container {
    grid-template-columns: [full-start prose-start] 1fr [prose-end full-end];
    padding-inline: 1.1rem;
  }
  .section > .container > * ,
  .section > .container > .breakout-wide,
  .section > .container > .card-grid,
  .section > .container > .results,
  .section > .container > .sources-table,
  .section > .container > .table-wrap,
  .section > .container > table,
  .section > .container > .breakout-full {
    grid-column: prose-start / prose-end;
    max-width: none;
  }
}

/* ---------- site header / nav ---------- */
/* Single-bar header: brand left, nav right, one row, vertically centered.
   First/last nav-link text edges align exactly with the shared .container
   edges — compensated via negative margin equal to the link's own inline
   padding (measured with Playwright boundingBox, see DESIGN notes). */

.site-header {
  border-bottom: 1px solid rgba(143, 130, 101, 0.35);
  background: rgba(250, 247, 240, 0.78);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: box-shadow 0.4s var(--ease-out-quart), border-color 0.4s var(--ease-out-quart);
}
/* Glassy layered header: once the page scrolls, the bar gains a soft
   elevation shadow so the blur reads as a floating layer rather than a
   flat bar (site.js toggles this on scroll > 8px). Transform/opacity +
   shadow only — no layout properties animate. */
.site-header.is-scrolled {
  box-shadow: 0 18px 40px -28px rgba(31, 74, 55, 0.45);
  border-color: rgba(143, 130, 101, 0.5);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--color-cream); }
}
/* Grafted from A: a fine gold hairline drawn just under the bar, echoing the
   footer's closing gold seal so header + footer read as one engraved family
   (design-guide point 11). Sits over the existing 1px border, tapered at the
   ends so it reads as an ornamental rule, not a hard divider. Decorative. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold-hairline) 18%, var(--color-gold-hairline) 82%, transparent);
  opacity: 0.7;
  pointer-events: none;
}

.site-header__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  min-height: 64px;
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-leaf-deep);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.site-header__brand:hover { color: var(--color-leaf); }
.site-header__brand:hover .site-header__brand-mark {
  transform: rotate(-6deg) scale(1.06);
}
.site-header__brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: transform 0.35s var(--ease-out-back, var(--ease-out-quart));
}
@media (prefers-reduced-motion: reduce) {
  .site-header__brand-mark { transition: none; }
  .site-header__brand:hover .site-header__brand-mark { transform: none; }
}
.site-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
/* Tagline under the wordmark (owner round-5 #6). Sans, muted, small —
   --color-ink-soft measures 6.96:1 against the header's --color-cream
   background, comfortably passing WCAG AA (>=4.5:1) for this text size. */
.site-header__brand-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: var(--color-ink-soft);
}
/* Bar height is driven by .site-header__bar's min-height (64px) plus
   vertical padding, not by brand content — the tagline adds line-height
   only, so it doesn't grow the bar. At 375px there's real width pressure
   from the hamburger + brand mark, so the tagline hides there rather than
   wrapping or truncating awkwardly. */
@media (max-width: 400px) {
  .site-header__brand-tagline { display: none; }
}

.site-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.site-header__toggle:hover {
  border-color: var(--color-leaf);
  color: var(--color-leaf-deep);
}

/* Mobile/tablet (<800px): nav is a disclosure panel that drops below the
   bar, full width — positioned absolutely so it doesn't disturb the bar's
   own flex layout (brand + toggle). */
.site-nav {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 1.1rem 1rem;
  border-top: 1px solid var(--color-line);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-cream);
  box-shadow: 0 14px 24px -18px rgba(38, 48, 43, 0.35);
}
.site-nav.is-open { display: flex; }

.site-nav__link {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.3rem;
  min-height: 44px;
  color: var(--color-ink);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid var(--color-line);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.18s ease, color 0.18s ease;
}
/* Hover highlights the whole item with a subtle bg tint — no underline —
   distinctly lighter than the active pill (--color-leaf-pale) so active
   always reads stronger than hover (owner round-5 #7). Reduced-motion
   users still get the color/bg change, just instantly (no transition). */
.site-nav__link:hover {
  color: var(--color-leaf-deep);
  background: rgba(46, 107, 79, 0.08);
}
.site-nav__link[aria-current="page"] {
  color: var(--color-leaf-deep);
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .site-nav__link { transition: none; }
}

/* Desktop/tablet-wide (>=800px): nav joins the brand row, flush right. */
@media (min-width: 800px) {
  .site-header__toggle { display: none; }

  .site-header__bar {
    /* nav lives inside the bar row now (see markup), so the bar itself
       no longer needs to justify space-between against a lone brand —
       nav's own margin-left:auto handles that push. */
    padding-top: 0;
    padding-bottom: 0;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.9rem;
    padding: 0;
    border-top: none;
    position: static;
    box-shadow: none;
    background: transparent;
    margin-left: auto;
    /* Compensate the last link's own right padding so its TEXT ends
       flush with the container's right edge, not the link's hit-box. */
    margin-right: -0.55rem;
  }
  .site-nav__link {
    position: relative;
    border-bottom: none;
    min-height: 44px;
    padding: 0.55rem;
    border-radius: var(--radius-sm);
  }
  /* Underline sweep: a pseudo-element scaled from 0, transform-only so it
     never affects layout. Grows on hover/focus, stays full on the active
     page. */
  .site-nav__link::after {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.3rem;
    height: 2px;
    background: var(--color-leaf);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out-quart);
  }
  .site-nav__link:hover::after,
  .site-nav__link:focus-visible::after {
    transform: scaleX(1);
  }
  .site-nav__link[aria-current="page"] {
    background: var(--color-leaf-pale);
  }
  .site-nav__link[aria-current="page"]::after {
    transform: scaleX(1);
    background: var(--color-gold);
  }
  @media (prefers-reduced-motion: reduce) {
    .site-nav__link::after { transition: none; }
  }
}

/* ---------- nav dropdown: Sweetener guides (owner ⑥) ----------
   A disclosure listing all five guide articles. Keyboard-operable
   (button toggles aria-expanded; Escape closes; focus-within keeps it open
   for tab-through) and hover-intent on desktop. On mobile it renders as a
   plain always-visible list inside the hamburger panel (no button chrome). */
.site-nav__group { position: relative; }
.site-nav__group-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}
.site-nav__group-caret {
  width: 0.7em;
  height: 0.7em;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out-quart);
}
.site-nav__group-toggle[aria-expanded="true"] .site-nav__group-caret {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .site-nav__group-caret { transition: none; }
}

/* Mobile (<800px): the group is a plain labelled list — the toggle reads as
   a section label, the menu is always shown, links indented slightly. */
.site-nav__group-label {
  display: block;
  padding: 0.7rem 0.3rem 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}
.site-nav__group-toggle { display: none; }
.site-nav__menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-nav__menu .site-nav__link { padding-left: 1rem; }

@media (min-width: 800px) {
  .site-nav__group-label { display: none; }
  .site-nav__group-toggle {
    display: flex;
    width: auto;
    position: relative;
    min-height: 44px;
    padding: 0.55rem;
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    transition: color 0.2s ease;
  }
  .site-nav__group-toggle:hover { color: var(--color-leaf-deep); }
  /* Underline sweep to match the sibling nav links. */
  .site-nav__group-toggle::after {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.3rem;
    height: 2px;
    background: var(--color-leaf);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out-quart);
  }
  .site-nav__group:hover .site-nav__group-toggle::after,
  .site-nav__group-toggle:focus-visible::after,
  .site-nav__group-toggle[aria-current="page"]::after { transform: scaleX(1); }
  .site-nav__group-toggle[aria-current="page"] {
    background: var(--color-leaf-pale);
    color: var(--color-leaf-deep);
    font-weight: 700;
  }
  .site-nav__group-toggle[aria-current="page"]::after { background: var(--color-gold); }
  @media (prefers-reduced-motion: reduce) {
    .site-nav__group-toggle::after { transition: none; }
  }

  .site-nav__menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 230px;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem;
    background: var(--color-cream);
    border: 1px solid rgba(143, 130, 101, 0.4);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -22px rgba(38, 48, 43, 0.45);
    /* A thin gold hairline atop the panel, echoing the header rule. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s var(--ease-out-quart), transform 0.22s var(--ease-out-quart), visibility 0s linear 0.22s;
    z-index: var(--z-header);
  }
  .site-nav__menu::before {
    content: "";
    position: absolute;
    top: 0; left: 0.75rem; right: 0.75rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-hairline), transparent);
  }
  /* Open on hover (desktop intent) OR when focus is inside the group
     (keyboard) OR when JS sets aria-expanded="true" (click/Enter/Space). */
  .site-nav__group:hover .site-nav__menu,
  .site-nav__group:focus-within .site-nav__menu,
  .site-nav__group-toggle[aria-expanded="true"] + .site-nav__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.22s var(--ease-out-quart), transform 0.22s var(--ease-out-quart), visibility 0s;
  }
  .site-nav__menu .site-nav__link {
    padding-left: 0.6rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
  @media (prefers-reduced-motion: reduce) {
    .site-nav__menu { transition: visibility 0s linear 0s; transform: none; }
    .site-nav__group:hover .site-nav__menu,
    .site-nav__group:focus-within .site-nav__menu,
    .site-nav__group-toggle[aria-expanded="true"] + .site-nav__menu { transform: none; }
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(640px 420px at 88% -10%, rgba(232, 181, 74, 0.22), transparent 65%),
    radial-gradient(720px 520px at -10% 15%, rgba(46, 107, 79, 0.24), transparent 60%),
    linear-gradient(160deg, var(--color-leaf-pale) 0%, var(--color-cream) 55%);
  padding: var(--space-4) 0 var(--space-4);
}
/* Gradient-mesh bloom layer: a second, softer set of blooms that drift
   very slowly (60s loop) for ambient life without ever distracting from
   the tool. Purely decorative, aria-hidden host, opacity/transform only. */
.hero__mesh {
  position: absolute;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 420px at 20% 80%, rgba(232, 181, 74, 0.14), transparent 70%),
    radial-gradient(480px 480px at 80% 30%, rgba(63, 143, 104, 0.16), transparent 70%);
  animation: rm-mesh-drift 50s var(--ease-out-quart) infinite alternate;
}
@keyframes rm-mesh-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, -3%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__mesh { animation: none; }
}

/* Homepage variant: hero copy + the tool itself share the fold so the
   product is never below-the-fold (defect 4). Single column, tool
   directly under the copy, at every width up to desktop; two-column
   side-by-side once there's room. */
.hero--split .hero__inner {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}
@media (min-width: 960px) {
  .hero--split .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-5);
  }
}

.hero__ornament {
  position: absolute;
  top: -40px;
  right: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.16;
  pointer-events: none;
}

/* Engraved botanical ornament layer (grafted from A): a clean single-weight
   wheat sprig that etches itself in via stroke-dashoffset, then sits as page
   furniture at low opacity. Placed in the hero's lower-left margin so it never
   collides with B's floating ingredient chips (top/right) or the tool card.
   Decorative, aria-hidden host, stroke-only motion with reduced-motion safety. */
.hero__linework {
  position: absolute;
  pointer-events: none;
  color: var(--color-leaf-deep);
  opacity: 0.2;
  z-index: 0;
}
.hero__linework--wheat {
  bottom: 4%;
  left: 1.5%;
  width: 92px;
  height: auto;
}
.hero__linework-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  animation: rm-draw 2.4s var(--ease-out-quart) 0.3s forwards;
}
@keyframes rm-draw { to { stroke-dashoffset: 0; } }
@media (max-width: 700px) {
  .hero__linework--wheat { width: 64px; opacity: 0.14; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__linework-path { animation: none; stroke-dashoffset: 0; }
}
/* Content-hero variant: the wheat sits in the column-gap between the copy and
   the accent plate, filling what would otherwise read as dead space. */
.hero__linework--content.hero__linework--wheat {
  top: 50%;
  bottom: auto;
  left: 100%;
  transform: translateY(-50%);
  width: 34px;
  opacity: 0.32;
}
@media (max-width: 900px) {
  .hero__linework--content.hero__linework--wheat { display: none; }
}

.hero__inner {
  position: relative;
  z-index: 1;
}

/* Content-page hero (not the homepage split hero): align its copy to
   the same prose measure as the section body below it, so the page
   title/lede don't sit at a different left edge than the h2s/lists
   that follow (owner round-4 fix — /sources/ was the clearest case).
   Centered via margin-inline: auto — confirmed still centered at every
   width from 1024–2560px; owner round-5 #4's "left-stuck" complaint was
   really the empty-right-half perception #5 solves via the two-column
   split below, not a centering bug. */
.hero:not(.hero--split):not(.hero--content-split) .hero__inner {
  max-width: var(--width-prose);
  margin-inline: auto;
}

/* Resolver/guide pages that carry a dessert accent image: mirror the
   homepage's split hero so the image fills the empty right half at wide
   viewports instead of floating as a lone orphan between hero and first
   fact-block (owner round-5 #4 + #5 — same fix serves both). Mobile/
   tablet stays single column, image collapsing below the intro.

   Owner fix 2026-07-22 (post-merge regression): the round-6 approach below
   reused the .section > .container prose/wide/full breakout grid inside the
   hero so the copy's left edge matched the prose column beneath it — but
   .hero__inner is NOT a .section > .container (see the note above .container
   at the top of this sheet: header bar, hero__inner, and site-footer__grid
   keep the PLAIN container). Nesting that grid here re-added a wide/prose
   left shoulder track the plain container doesn't have, so the copy started
   ~300px right of the logo instead of matching the header edge. Design-guide
   point 12 ("hero = header width on every page") wins: hero canvas is just
   the plain .container width (identical to the header), with a simple two-
   column split inside it — copy starts flush at the container's own left
   edge, accent plate fills the right column. */
.hero--content-split .hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  column-gap: var(--space-5);
}
.hero--content-split .hero__copy {
  grid-column: 1 / 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 420px;
  position: relative;
}
/* Fills the canvas rather than leaving the copy column's lower half bare
   on short-copy pages (About): a swap-motif strip anchored to the bottom
   of the column, always present regardless of copy length, so the fold
   never ends in dead space (owner follow-up, content-hero balance). */
.hero--content-split .hero__copy-foot {
  margin-top: var(--space-4);
}
.hero--content-split .hero__accent {
  grid-column: 2 / 3;
  grid-row: 1;
  align-self: stretch;
  min-height: 420px;
  position: relative;
}
/* Ornamental ghost numeral fills the accent column's own margin behind
   the framed photo, so the wide right-hand gutter reads as composed
   negative space rather than an empty band (owner follow-up: "ornament
   may deliberately occupy margins"). Decorative only. */
.hero--content-split .hero__accent::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -6%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(232, 181, 74, 0.16), transparent 70%);
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 768px) {
  .hero--content-split .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero--content-split .hero__copy,
  .hero--content-split .hero__accent {
    grid-column: 1 / 2;
    min-height: 0;
  }
}

.hero__accent {
  margin-top: var(--space-3);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
}
.js-hero-anim .hero__accent {
  animation: rm-accent-in 0.8s var(--ease-out-expo) 0.25s forwards;
}
@keyframes rm-accent-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__accent { opacity: 1; transform: none; animation: none; }
}
.hero__accent .accent-frame {
  margin-bottom: 0;
}
@media (min-width: 769px) {
  .hero__accent {
    margin-top: 0;
  }
  .hero__accent .accent-frame,
  .hero__accent .accent-frame__inner {
    height: 100%;
  }
  .hero__accent .accent-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
/* Mobile/tablet: plate reads as a landscape strip under the copy rather than
   stretching to the source image's native (sometimes portrait) ratio. */
@media (max-width: 768px) {
  .hero__accent .accent-photo {
    aspect-ratio: 3 / 2;
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

.hero__eyebrow {
  display: inline-block;
  max-width: 42ch;
  font-size: 0.85rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-leaf);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(10px);
}

.hero__title {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  max-width: 16ch;
  margin-block: 0 var(--space-md);
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(14px);
}
.hero__lede {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
  max-width: 34ch;
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(14px);
}
.hero--split .hero__copy { min-width: 0; }

/* Staggered entrance choreography (design-guide point 13 + brief #3):
   eyebrow → title → lede → microcopy/badge, each offset ~110ms so the
   copy assembles top-to-bottom instead of arriving as one flat block.
   transform/opacity only. */
.js-hero-anim .hero__eyebrow,
.js-hero-anim .hero__title,
.js-hero-anim .hero__lede {
  animation: rm-rise 0.6s var(--ease-out-quart) forwards;
}
.js-hero-anim .hero__title { animation-delay: 0.1s; }
.js-hero-anim .hero__lede { animation-delay: 0.2s; }
.js-hero-anim .hero__microcopy,
.js-hero-anim .hero__inner .db-badge {
  opacity: 0;
  transform: translateY(10px);
  animation: rm-rise 0.6s var(--ease-out-quart) 0.3s forwards;
}

/* ---------- MEND STRIP: the one shared swap grammar (Sol graft) ----------
   The single signature component of the site. Every "swap" motif — the
   homepage hero repair card, the tool's result rows, the content-hero chip
   rows, and the footer ledger — now speaks ONE grammar through ONE BEM
   component, so a struck original always becomes a cited substitute the
   same way everywhere:

       [ original ingredient ]  →  [ cited substitute ]
        struck-through, blush        gold pill
              pill (__from)     bridge     (__to)
              ── citation / ratio line under it (__cite) ──

   Variants by modifier (never a separate component):
     .mend-strip                 base inline strip (content heroes, footer)
     .mend-strip--card           framed card (homepage hero repair moment)
     .mend-strip--row            tool result row (per swapped ingredient)
   The old .swap-card / .swap-mini variants are removed — this replaces them.

   Computed contrast (pills carry their OWN light backgrounds, so they pass
   on any ground incl. the ink footer): __from text #7a4f48/urgent-bg 5.85:1,
   __to text gold/gold-pale 7.51:1, __cite ink-soft/card 7.45:1 — all ≥4.5:1.
   (owner fix 2026-07-22: struck pill was bold + 2px strike = illegible;
   __from now regular weight, muted brownish ink, thinner 1.5px strike line —
   the pill keeps presence via shape/color, not font weight.) */
.mend-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.mend-strip__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}
.mend-strip__swap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.mend-strip__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
}
.mend-strip__from {
  background: var(--color-urgent-bg);
  color: #7a4f48;
  font-weight: 400;
  border-color: #f0c9c5;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: #7a5a52;
}
.mend-strip__to {
  background: var(--color-gold-pale);
  color: var(--color-gold);
  border-color: #e8cfa0;
}
/* Repair bridge: the arrow/stitch that carries one ingredient into the next.
   Single-weight linework in leaf, drawing itself once under .js-hero-anim
   (stroke-dash reveal), else static. */
.mend-strip__bridge {
  flex-shrink: 0;
  width: 34px;
  height: 18px;
  color: var(--color-leaf);
}
.mend-strip__bridge svg { display: block; width: 100%; height: 100%; }
.js-hero-anim .mend-strip__bridge-path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: rm-arrow-draw 0.6s var(--ease-out-quart) 0.9s forwards;
}
.js-hero-anim .mend-strip--card .mend-strip__to {
  opacity: 0;
  transform: scale(0.9);
  animation: rm-chip-pop 0.45s var(--ease-out-back, var(--ease-out-quart)) 1.35s forwards;
}
@keyframes rm-arrow-draw { to { stroke-dashoffset: 0; } }
@keyframes rm-chip-pop { to { opacity: 1; transform: scale(1); } }
/* Citation / ratio line — the source behind the swap, always under the row. */
.mend-strip__cite {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}
.mend-strip__cite strong { color: var(--color-leaf-deep); }

/* Card variant: the homepage hero's repair-in-progress moment. */
.mend-strip--card {
  position: relative;
  z-index: var(--z-chip);
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 24px 50px -28px rgba(38, 48, 43, 0.4);
  padding: var(--space-3);
  margin-top: var(--space-3);
  overflow: hidden;
}

/* Inline variant sizing for tight placements (content heroes, footer ledger):
   a single row with the label inline, smaller pills, cite line under. */
.mend-strip--inline {
  gap: var(--space-xs);
}
.mend-strip--inline .mend-strip__swap {
  gap: 0.5rem;
}
.mend-strip--inline .mend-strip__pill {
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
}
.mend-strip--inline .mend-strip__bridge {
  width: 20px;
  height: 12px;
}
.mend-strip--inline .mend-strip__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* Row variant: the product moment — each swapped ingredient the matcher
   returns renders as a Mend Strip inside its result row (see .ing-row). */
.mend-strip--row {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-line);
}

@media (prefers-reduced-motion: reduce) {
  .mend-strip__bridge-path,
  .js-hero-anim .mend-strip__bridge-path {
    stroke-dasharray: none; stroke-dashoffset: 0; animation: none;
  }
  .js-hero-anim .mend-strip--card .mend-strip__to {
    opacity: 1; transform: none; animation: none;
  }
}

/* Living Mend Strip chips (owner ⑧): the White sugar → Erythritol pair,
   anchored to the hero__inner box (a max-width:1160px centered .container),
   NOT to the viewport — so at >=1600px they stay pinned to the content
   canvas and never drift into empty side gutters. They read as ONE
   transformation story: the sugar chip strikes through + fades, the motion
   hands off to the erythritol chip which settles and glows — a living
   version of the site's Mend Strip. Fired ONCE on load/scroll via
   .js-chips-run (site.js), transform/opacity only. Reduced-motion and
   no-JS both land on the static END state (sugar struck+dim, erythritol
   settled) so the story still reads without animation.
   Desktop-only decoration (aria-hidden); hidden below 1180px where the
   split hero has no spare margin. */
.hero__chips {
  display: none;
  pointer-events: none;
}
@media (min-width: 1180px) {
  .hero__chips {
    display: block;
    position: absolute;
    inset: 0;
    z-index: var(--z-chip);
    pointer-events: none;
  }
  .chip-float {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--color-card);
    border: 1px solid var(--color-line);
    box-shadow: 0 10px 24px -16px rgba(38, 48, 43, 0.35);
  }
  /* Anchored to the hero__inner's own top-right margin region (above the
     tool column), a fixed offset from the content box's right edge — since
     hero__inner is centered and width-capped, these track the content, not
     the viewport. The two chips sit close together so the strike→glow
     handoff reads as one motion. */
  .chip-float--from {
    top: 2%;
    right: 3%;
    color: var(--color-gold);
  }
  .chip-float--to {
    top: 2%;
    right: 3%;
    /* offset right-and-down from the "from" chip so the handoff has travel */
    transform: translate(0, 3.4rem);
    color: var(--color-leaf-deep);
    border-color: #cfe0d5;
  }
  .chip-float__strike {
    position: relative;
  }
  /* The struck line is drawn with a pseudo-element scaled on the X axis
     (transform-only) rather than text-decoration, so it can animate in. */
  .chip-float__strike::after {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: 50%;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
  }

  /* --- Static END state (default; also the reduced-motion / no-JS state) ---
     sugar already struck + dimmed, erythritol already settled + lit. */
  .chip-float--from { opacity: 0.55; }
  .chip-float--from .chip-float__strike::after { transform: scaleX(1); }
  .chip-float--to {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(63, 143, 104, 0.16), 0 12px 26px -16px rgba(31, 74, 55, 0.5);
  }

  /* --- Animated run: only when JS adds .js-chips-run (once), and only if
     the user hasn't asked to reduce motion. Start full/lit sugar + hidden
     erythritol, then play the transformation to the END state above. --- */
  .js-chips-run .chip-float--from {
    opacity: 1;
    animation: rm-chip-strike 2.4s var(--ease-out-quart) 0.2s forwards;
  }
  .js-chips-run .chip-float--from .chip-float__strike::after {
    transform: scaleX(0);
    animation: rm-chip-strikethrough 0.5s var(--ease-out-quart) 1.1s forwards;
  }
  .js-chips-run .chip-float--to {
    opacity: 0;
    transform: translate(-1.2rem, 3.4rem) scale(0.9);
    animation: rm-chip-settle 0.7s var(--ease-out-back, var(--ease-out-quart)) 1.5s forwards;
  }
}
@keyframes rm-chip-strike {
  /* sugar chip fades from full to the dimmed end state as the swap resolves */
  0%, 45% { opacity: 1; }
  100% { opacity: 0.55; }
}
@keyframes rm-chip-strikethrough {
  to { transform: scaleX(1); }
}
@keyframes rm-chip-settle {
  60% {
    opacity: 1;
    transform: translate(0, 3.4rem) scale(1.04);
    box-shadow: 0 0 0 6px rgba(63, 143, 104, 0.22), 0 12px 26px -16px rgba(31, 74, 55, 0.5);
  }
  100% {
    opacity: 1;
    transform: translate(0, 3.4rem) scale(1);
    box-shadow: 0 0 0 3px rgba(63, 143, 104, 0.16), 0 12px 26px -16px rgba(31, 74, 55, 0.5);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* ignore .js-chips-run entirely — hold the static end state */
  .js-chips-run .chip-float--from,
  .js-chips-run .chip-float--from .chip-float__strike::after,
  .js-chips-run .chip-float--to {
    animation: none;
  }
  .js-chips-run .chip-float--from { opacity: 0.55; }
  .js-chips-run .chip-float--from .chip-float__strike::after { transform: scaleX(1); }
  .js-chips-run .chip-float--to { opacity: 1; transform: translate(0, 3.4rem) scale(1); }
}

/* ---------- hero photo ---------- */

/* Desktop: photo sits under the hero copy, in the copy column — so the
   tool column stays untouched and fully visible in the first viewport.
   Mobile/tablet (<960px, single column): a short strip below the tool,
   never pushing the tool itself down the page. */
/* Grafted from A: the hero photo becomes a duotone-graded engraved plate
   (double-frame hairline + leaf→gold→ink color-blend grade + "before the
   repair" corner tag), matching the content-hero accent treatment so the
   before-state photo reads as designed furniture, not dropped-in stock. */
.hero__photo-wrap {
  position: relative;
  margin-top: var(--space-3);
  display: none;
}
.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-gold-hairline);
  box-shadow: 0 16px 36px -20px rgba(23, 31, 26, 0.5);
  filter: grayscale(0.24) sepia(0.26) saturate(1.3) brightness(0.96) contrast(1.05);
}
.hero__photo-wrap::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(246, 241, 228, 0.55);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
  z-index: 2;
}
.hero__photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(31, 74, 55, 0.7) 0%, rgba(182, 130, 31, 0.32) 50%, rgba(23, 31, 26, 0.56) 100%);
  mix-blend-mode: color;
  pointer-events: none;
}
.hero__photo-tag {
  position: absolute;
  bottom: -10px;
  left: 14px;
  z-index: 3;
  background: var(--color-parchment);
  border: 1px solid var(--color-gold-hairline);
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px -10px rgba(23, 31, 26, 0.4);
}
@media (min-width: 960px) {
  .hero__photo-wrap {
    display: block;
    height: 220px;
  }
}

.hero__photo-wrap--mobile {
  display: block;
  margin-top: var(--space-3);
  height: 140px;
}
@media (min-width: 960px) {
  .hero__photo-wrap--mobile { display: none; }
}

/* ---------- resolver accent photo ---------- */

/* Brand-adapted photo frame (design guide point 15): every accent photo
   is composed inside a bordered, gradient-lipped frame with a color-grade
   overlay so it reads as tinted-for-RecipeMend rather than a dropped-in
   stock rectangle. The overlay is a multiply-blend leaf/gold duotone wash;
   a thin gold hairline sits just inside the border for an ornamental lip. */
.accent-frame {
  position: relative;
  border-radius: var(--radius);
  padding: 6px;
  background: linear-gradient(155deg, var(--color-gold-bright) 0%, var(--color-leaf) 100%);
  box-shadow: 0 20px 44px -24px rgba(38, 48, 43, 0.45);
  margin-bottom: var(--space-3);
}
.accent-frame__inner {
  position: relative;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  isolation: isolate;
}
/* Duotone color-grade (grafted from A): a mix-blend-mode:color wash grades
   the photo's own luminance toward the leaf → gold → ink palette, so it reads
   as a designed plate tinted FOR RecipeMend rather than a dropped-in stock
   rectangle. Stronger than the old multiply overlay, and hue-locked. */
.accent-frame__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(31, 74, 55, 0.72) 0%, rgba(182, 130, 31, 0.34) 50%, rgba(23, 31, 26, 0.58) 100%);
  mix-blend-mode: color;
  z-index: 1;
  pointer-events: none;
}
/* Engraved double-frame (grafted from A): a fine parchment hairline set just
   inside the gradient-lip border, giving the plate an etched, framed feel. */
.accent-frame__inner::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(246, 241, 228, 0.55);
  border-radius: calc(var(--radius) - 8px);
  z-index: 2;
  pointer-events: none;
}
/* Corner tag (grafted from A): a small italic parchment label pinned to the
   plate, the engraved-journal detail that integrates the photo as furniture.
   Contrast: ink-soft #4c5850 on parchment #f6f1e4 = 6.7:1, passes 4.5:1.
   Owner fix 2026-07-22: "the before" tag made no sense without a paired
   "after" on content pages (no real before/after pair exists there — the
   Mend Strip chip row below the badge already carries that motif), so the
   markup was removed from all 9 content-hero accent plates. Rule kept for
   the homepage pairing (photo "before the repair" + repair card "in
   progress") and any future genuine before/after use. */
.accent-frame__tag {
  position: absolute;
  bottom: -10px;
  left: 14px;
  z-index: 3;
  background: var(--color-parchment);
  border: 1px solid var(--color-gold-hairline);
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px -10px rgba(23, 31, 26, 0.4);
}
.accent-frame { position: relative; }
.accent-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  margin-bottom: 0;
  filter: grayscale(0.28) sepia(0.3) saturate(1.35) brightness(0.95) contrast(1.05);
}
.accent-photo--float {
  margin-bottom: var(--space-4);
}
@media (min-width: 700px) {
  .accent-photo--float {
    float: right;
    width: 320px;
    margin: 0 0 var(--space-3) var(--space-4);
  }
}

/* Shared rise keyframe used across the staggered hero choreography above
   (eyebrow/title/lede/microcopy/badge/accent). Kept as one definition. */
@keyframes rm-rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title, .hero__lede, .hero__eyebrow, .hero__microcopy, .hero__inner .db-badge {
    opacity: 1 !important; transform: none !important; animation: none !important;
  }
}

.hero__microcopy {
  font-size: 0.95rem;
  color: var(--color-leaf-deep);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- sections ---------- */

.section {
  padding-block: var(--space-4xl);
}
.section--alt {
  background: var(--color-cream-deep);
}

/* .section__title is always an h2 in the markup — inherit the h2 rule's
   size/line-height/margin (editorial hierarchy) rather than the old
   one-size-fits-all clamp() (spec violation #5); only override color
   inheritance concerns here, none needed. */
.section__lede {
  color: var(--color-ink-soft);
  margin-top: 0;
  margin-bottom: var(--space-lg);
  max-width: 34ch;
}
.section__more-link { margin-top: var(--space-lg); }

/* ---------- db version badge ---------- */

.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-gold-pale);
  color: var(--color-gold);
  border: 1px solid #e8cfa0;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.db-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 0 0 rgba(107, 67, 22, 0.35);
  animation: rm-dot-pulse 2.6s ease-out infinite;
}
@keyframes rm-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(107, 67, 22, 0.35); }
  70% { box-shadow: 0 0 0 7px rgba(107, 67, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(107, 67, 22, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .db-badge__dot { animation: none; }
}

/* ---------- tool ---------- */

.tool {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 10px 30px -20px rgba(38, 48, 43, 0.35);
}

.tool__label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.tool__textarea {
  width: 100%;
  min-height: 220px;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-ink);
  resize: vertical;
  line-height: 1.55;
}
.tool__textarea:focus-visible { outline-offset: 0; }

.tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-3);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out-quart), background-color 0.2s ease, box-shadow 0.25s var(--ease-out-quart);
  will-change: transform;
}
/* Magnetic micro-lift: buttons rise + gain a soft brand-colored glow on
   hover/focus, settle back on release. Transform/shadow only. */
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 0.2s ease; }
  .btn:hover, .btn:focus-visible, .btn:active { transform: none; }
}
.btn--primary {
  background: var(--color-leaf-deep);
  color: #fff;
}
.btn--primary:hover { background: var(--color-leaf); color: #fff; box-shadow: 0 14px 28px -16px rgba(31, 74, 55, 0.55); }
.btn--ghost {
  background: transparent;
  border-color: var(--color-line);
  color: var(--color-ink);
}
.btn--ghost:hover { border-color: var(--color-leaf); color: var(--color-leaf-deep); }
.btn--gold {
  background: var(--color-gold);
  color: #fff;
}
.btn--gold:hover { background: #8f5c1f; color: #fff; box-shadow: 0 14px 28px -16px rgba(107, 67, 22, 0.5); }

.tool__sample-link {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
}

.tool__privacy-note {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}

/* ---------- results ---------- */

.results {
  margin-top: var(--space-4);
}
.results[hidden] { display: none; }

.results__summary {
  background: var(--color-leaf-pale);
  border: 1px solid #c9ddd0;
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.results__summary-title {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.results__stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.results__stat {
  min-width: 130px;
}
.results__stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-leaf-deep);
}
.results__stat-label {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}
/* Recipe title echoed above the repair summary (⑨ parser: "Repairing: X"). */
.results__recipe-title {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
  margin-bottom: var(--space-2xs);
}
.results__recipe-title strong { color: var(--color-leaf-deep); }

.ing-row {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  padding: var(--space-2) var(--space-3);
  margin-bottom: 0.75rem;
}

.ing-row__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
}

.ing-row__name {
  font-weight: 700;
  font-size: 1.05rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge--low { background: var(--color-safe-bg); color: var(--color-safe); }
.badge--moderate { background: var(--color-caution-bg); color: var(--color-caution); }
.badge--high { background: var(--color-urgent-bg); color: var(--color-urgent); }
.badge--unknown { background: var(--color-unknown-bg); color: var(--color-unknown); }

.ing-row__meta {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
  margin-top: 0.35rem;
}

.ing-row__swap {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-line);
  font-size: 0.95rem;
}
.ing-row__swap strong { color: var(--color-leaf-deep); }

.ing-row__why {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
  margin-top: 0.35rem;
}
.ing-row__why a { color: var(--color-leaf-deep); }

.ing-row__confidence {
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ing-row--unknown {
  border-color: #c7c9e3;
  background: var(--color-unknown-bg);
}

/* ---------- repaired recipe: before/after comparison (owner 2026-07-22) ------
   The signature moment — the Mend Strip grammar at recipe scale. Two columns
   at desktop (original left, struck in the blush idiom; repaired right,
   substitutes in gold), stacked before-then-after at mobile. Rows line up 1:1
   so the eye pairs each swap across the columns.

   Computed contrast (AA): struck before text #7a5a52 on card #fff = 5.98:1;
   gold after text --color-gold #6b4316 on gold-pale #fbeed7 = 7.51:1 (same
   pair the Mend Strip already ships); heading/leaf-deep on cream passes; all
   ≥4.5:1. New pairs verified via the node contrast one-liner. */
.results__section-heading {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  line-height: var(--leading-h4);
  color: var(--color-leaf-deep);
  margin-block: var(--space-3) var(--space-md);
}
.compare {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-card);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.compare > .results__section-heading:first-child { margin-top: 0; }

/* Desktop: three-track grid — before | bridge | after — with the header row
   and every pair sharing the same columns so rows align across the divide. */
.compare__cols {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: var(--space-md);
  row-gap: var(--space-xs);
  align-items: stretch;
}
.compare__head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  padding-bottom: var(--space-2xs);
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-2xs);
}
.compare__head--spacer { border-bottom: none; }
.compare__head--after { color: var(--color-gold); }

/* Each pair is its own 3-track subgrid row so before/after cells stay aligned
   even when one wraps to two lines. */
.compare__row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
}
.compare__line {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
}
.compare__line--before { color: var(--color-ink); }
.compare__line--struck {
  background: var(--color-urgent-bg);
  color: #7a5a52;
  border-color: #f0c9c5;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: #7a5a52;
}
.compare__line--after { color: var(--color-ink); }
.compare__line--gold {
  background: var(--color-gold-pale);
  color: var(--color-gold);
  border-color: #e8cfa0;
  font-weight: 700;
}
.compare__line--unknown {
  background: var(--color-unknown-bg);
  color: var(--color-unknown);
  border-color: #c7c9e3;
}
.compare__bridge {
  align-self: center;
  width: 34px;
  height: 18px;
  color: var(--color-leaf);
}
.compare__bridge svg { display: block; width: 100%; height: 100%; }
.compare__footref {
  font-size: 0.7em;
  color: var(--color-gold);
  font-weight: 700;
}

/* Numbered bake-behavior footnotes under the after-list. */
.compare__notes {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-line);
}
.compare__notes-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-bottom: var(--space-xs);
}
.compare__notes-list {
  margin: 0;
  padding-left: 1.4em;
}
.compare__note {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}
.compare__note + .compare__note { margin-top: var(--space-xs); }

/* Mobile: stack before-then-after in one column. The bridge arrow collapses
   (it reads as a downward hand-off between the stacked lines). */
@media (max-width: 700px) {
  .compare__cols {
    grid-template-columns: 1fr;
    row-gap: var(--space-sm);
  }
  .compare__head--before,
  .compare__head--spacer,
  .compare__head--after { display: none; }
  .compare__row {
    grid-template-columns: 1fr;
    gap: var(--space-2xs);
    padding-bottom: var(--space-sm);
    border-bottom: 1px dashed var(--color-line);
  }
  .compare__bridge {
    width: 18px;
    height: 12px;
    transform: rotate(90deg);
    margin: 0 auto;
  }
  /* Label the stacked lines so the pairing still reads without columns. */
  .compare__line--before::before,
  .compare__line--gold::before,
  .compare__line--after.compare__line--unknown::before {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-ink-soft);
    margin-bottom: 2px;
  }
  .compare__line--before::before { content: "Original"; }
  .compare__line--gold::before { content: "Repaired"; color: var(--color-gold); }
}

/* ---------- about: designed editorial blocks (owner ②) ----------
   Composes the About body's believe / not / database-status text into
   designed blocks: a leading pull-quote, a two-column belief ledger with a
   gold ornament, and a bordered "where the database stands" stat panel. No
   new claims — layout of the existing copy only. */
.pull-quote {
  position: relative;
  margin: var(--space-2xl) 0;
  padding: var(--space-lg) 0 var(--space-lg) var(--space-2xl);
  border-left: 3px solid var(--color-gold);
}
.pull-quote__mark {
  position: absolute;
  top: -0.3em;
  left: 0.1em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 5rem;
  line-height: 1;
  color: var(--color-gold);
  opacity: 0.28;
  pointer-events: none;
}
.pull-quote__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  color: var(--color-leaf-deep);
  font-style: italic;
}
@media (max-width: 700px) {
  .pull-quote { padding-left: var(--space-xl); }
}

.belief {
  position: relative;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  overflow: hidden;
}
/* Engraved wheat ornament tucked into the block's corner as furniture. */
.belief__ornament {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 96px;
  height: auto;
  color: var(--color-leaf);
  opacity: 0.1;
  pointer-events: none;
}
.belief__label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}
.belief__body { position: relative; z-index: 1; }

/* Two belief blocks sit side by side on wide screens (believe / not). */
.belief-pair {
  display: grid;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}
@media (min-width: 760px) {
  .belief-pair { grid-template-columns: 1fr 1fr; }
  .belief-pair .belief { margin: 0; }
}

/* Database-status stat panel: the 88/13/21 counts as a small figure row. */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-lg) 0 var(--space-md);
}
.about-stat {
  text-align: center;
  background: var(--color-parchment);
  border: 1px solid var(--color-gold-hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-sm);
}
.about-stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--color-leaf-deep);
}
.about-stat__label {
  display: block;
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  line-height: 1.3;
  color: var(--color-ink-soft);
}

/* ---------- sweetener snapshot (owner ⑤b, build-time rendered) ----------
   A definition list rendered FROM diabetic.json by generate.js — one cited
   fact per sweetener. Two columns on wide screens, a card per entry. */
.snapshot__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-md);
}
@media (min-width: 720px) {
  .snapshot__list { grid-template-columns: 1fr 1fr; }
}
.snapshot__item {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-leaf);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-md);
}
.snapshot__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h4);
  line-height: var(--leading-h4);
  color: var(--color-leaf-deep);
  margin-bottom: var(--space-2xs);
}
.snapshot__fact {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink);
}
.snapshot__cite {
  display: block;
  margin-top: var(--space-xs);
  color: var(--color-ink-soft);
}
.snapshot__foot { margin-top: var(--space-md); }

/* ---------- corrections ledger (owner ⑦, /sources/) ----------
   Real verification-pass corrections rendered as Mend Strips (struck wrong
   value → sourced value). Not decorative — these carry content, so unlike
   the footer ledger they are NOT aria-hidden. */
.corrections {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin: var(--space-lg) 0 var(--space-xl);
}
.corrections .mend-strip {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
}

/* ---------- how-to (numbered practical steps, owner ①) ----------
   The net-carbs guide's practical "how to count carbs" section: an ordered
   list of rule cards on the card ground, each with a bold rule line, detail
   prose, an optional nested list, and a cited source line (small tier). */
.howto {
  list-style: none;
  counter-reset: howto;
  padding: 0;
  margin: var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.howto__step {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-leaf);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-lg);
  margin: 0;
}
.howto__rule {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-leaf-deep);
  font-size: var(--text-h4);
  line-height: var(--leading-h4);
  margin-bottom: var(--space-sm);
}
.howto__detail { margin-top: var(--space-sm); }
.howto__step ul {
  margin-top: var(--space-md);
  margin-bottom: 0;
}
.howto__source {
  display: block;
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}
/* Closing CTA tile beneath the steps: paste-into-the-tool call to action. */
.howto__cta {
  background: var(--color-leaf-pale);
  border: 1px solid #c9ddd0;
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
}
.howto__cta-text { margin-bottom: var(--space-md); }

/* ---------- more-guides cross-link block (owner ⑥) ----------
   Sibling links at the foot of every resolver/guide page (excluding self),
   so the five articles interlink. Styled per the design system: a labelled
   card list on the parchment ground with the gold-hairline eyebrow. */
.more-guides {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(143, 130, 101, 0.4);
}
.more-guides__title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-md);
}
.more-guides__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-sm);
}
@media (min-width: 700px) {
  .more-guides__list { grid-template-columns: repeat(2, 1fr); }
}
.more-guides__item {
  margin: 0;
}
.more-guides__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-leaf-deep);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out-quart);
}
.more-guides__link::after {
  content: "→";
  margin-left: auto;
  color: var(--color-gold);
  transition: transform 0.2s var(--ease-out-quart);
}
.more-guides__link:hover {
  border-color: var(--color-leaf);
  transform: translateX(2px);
}
.more-guides__link:hover::after { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .more-guides__link,
  .more-guides__link::after { transition: border-color 0.2s ease; }
  .more-guides__link:hover,
  .more-guides__link:hover::after { transform: none; }
}

/* ---------- fake door / cta card ---------- */

.fakedoor {
  border: 2px solid var(--color-gold);
  background: var(--color-gold-pale);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-top: var(--space-4);
  text-align: left;
  overflow-wrap: break-word;
}
.fakedoor__title {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--color-ink);
}
.fakedoor__price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-gold);
  margin: 0.3rem 0 0.7rem;
}
/* The body copy paragraph directly before the CTA button had no bottom
   margin of its own (base p+p/p+ul rule doesn't cover p+button), so the
   button sat crammed against it (owner round-5 #1). Give the button a
   proper space-scale gap above regardless of what precedes it. */
.fakedoor .btn {
  margin-top: var(--space-lg);
}
.fakedoor__note {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
  margin-top: 0.6rem;
}

/* resolver-page CTA variant reuses .fakedoor with a modifier */
.fakedoor--resolver {
  margin-top: var(--space-5);
}

/* ---------- facts / one-fact blocks (GEO) ---------- */

.fact-block {
  background: var(--color-card);
  border-left: 4px solid var(--color-leaf);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
/* .fact-block__q is marked up as h2 (repeated per-fact subheads on
   resolver pages) but reads as a sub-heading — sized at the h3 tier so
   it doesn't compete with the page's real section h2s, while still
   getting Fraunces + balanced margins from the base h1-h4 rule. */
.fact-block__q {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  margin-block: 0 var(--space-md);
}
.fact-block + .fact-block .fact-block__q,
.fact-block__q {
  margin-top: 0;
}
.fact-block__a { color: var(--color-ink); }
.fact-block__source {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-ink-soft);
}

.range-note {
  display: inline-block;
  background: var(--color-caution-bg);
  color: var(--color-caution);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 700;
}

/* ---------- data bars (visualized data, point 13) ---------- */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-xl);
}
.bar-chart__row {
  display: grid;
  grid-template-columns: 11rem 1fr 6rem;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-body);
  line-height: 1.3;
}
.bar-chart__label { color: var(--color-ink-soft); }
.bar-chart__track {
  background: var(--color-line);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.bar-chart__fill {
  height: 100%;
  background: var(--color-leaf);
  border-radius: 999px;
  width: 0;
  transition: width 1s ease;
}
.bar-chart__fill--gold { background: var(--color-gold); }
.bar-chart__fill--urgent { background: var(--color-urgent); }
/* Owner round-6 #2: "GI 56-69" wrapped to two lines under the fixed 4.5rem
   column and looked centered next to the shorter single-line values.
   Widen the column to fit the longest label, force one line, and align
   all three values to the same left edge (not right) so they read as a
   single consistent column instead of each drifting to its own width. */
.bar-chart__value {
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  color: var(--color-ink);
}

/* ---------- ghost numerals ornament ---------- */

.ghost-numeral {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 9rem;
  color: var(--color-leaf);
  opacity: 0.06;
  z-index: 0;
  pointer-events: none;
  line-height: 1;
}

/* ---------- cards / grids ---------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .card-grid--tri { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--color-ink);
  display: block;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -22px rgba(38, 48, 43, 0.4);
  border-color: var(--color-leaf);
}
.card__title { transition: color 0.2s ease; }
.card:hover .card__title { color: var(--color-leaf); }
.card__title {
  color: var(--color-leaf-deep);
  /* Card titles are h3-tagged but live in a compact grid component, not
     the prose flow — a self-contained size instead of the full h3
     editorial scale (29px) keeps 3-up cards from feeling oversized. */
  font-size: var(--text-h4);
  line-height: var(--leading-h4);
  margin-block: 0 var(--space-xs);
}
.card__desc { color: var(--color-ink-soft); }

/* ---------- card icons + step flow (owner scope addition, round B) ----------
   Stroke-icon system in the entry's own language: 48px inline SVGs, 2.5px
   round-capped strokes, leaf-deep primary lines with gold accent strokes —
   the same vocabulary as the hero swap-card arrow. Colors are applied via
   these classes (never inline style attrs): leaf-deep 10.0:1 and gold
   8.6:1 on the white card bg, both far past the 3:1 non-text floor. */
.card__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-sm);
  color: var(--color-leaf-deep);
  transition: transform 0.3s var(--ease-out-quart);
}
.card__icon svg { display: block; width: 100%; height: 100%; }
.card__icon .icon-accent { color: var(--color-gold); }
.card:hover .card__icon {
  transform: translateY(-3px) rotate(-3deg);
}
@media (prefers-reduced-motion: reduce) {
  .card__icon { transition: none; }
  .card:hover .card__icon { transform: none; }
}

/* Staggered reveal: the three step cards / guide cards enter with a small
   per-card delay so the row assembles left-to-right instead of arriving
   as one block. Reduced-motion inherits the .reveal override (no
   transition at all), so the delays are inert there. */
.card-grid .card.reveal:nth-child(2) { transition-delay: 0.1s; }
.card-grid .card.reveal:nth-child(3) { transition-delay: 0.2s; }
.card-grid .card.reveal:nth-child(4) { transition-delay: 0.1s; }
.card-grid .card.reveal:nth-child(5) { transition-delay: 0.2s; }
.card-grid .card.reveal:nth-child(6) { transition-delay: 0.3s; }

/* Connecting flow line between the three steps (desktop 3-up only): a
   dashed gold line at icon height running behind the cards — visible in
   the two gaps, echoing the swap-card's before→after arrow direction. */
@media (min-width: 1000px) {
  .card-grid--steps {
    position: relative;
  }
  .card-grid--steps::before {
    content: "";
    position: absolute;
    top: 56px;
    left: 12%;
    right: 12%;
    /* #a06a1e measures 3.89:1 against the section--alt cream-deep bg —
       past the 3:1 non-text floor (gold-bright only managed 1.6:1). */
    border-top: 2px dashed #a06a1e;
    opacity: 0.85;
    z-index: 0;
  }
  .card-grid--steps .card {
    position: relative;
    z-index: 1;
  }
}

/* Ghost numeral on the step cards (grafted from A): a large translucent
   numeral behind each step's icon for rhythm. Grafts cleanly onto B's icon
   system — it sits BEHIND the icon (z-index/opacity) and never fights it.
   The card is made a positioning context and clips the overflowing numeral. */
.card--step {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.card--step .card__icon,
.card--step .card__title,
.card--step .card__desc {
  position: relative;
  z-index: 1;
}
.card--step .ghost-numeral {
  top: -0.6rem;
  right: 0.6rem;
  font-size: 6rem;
  opacity: 0.07;
}

/* CTA tile: fills the 5-cards-in-a-2-col-grid orphan slot with the one action
   the whole page funnels toward. Grafted from A: a dark-green FILLED tile (not
   B's cream tile) so it reads as a deliberate destination, the leaf-deep ground
   echoing the footer/CTA register. Computed contrast on leaf-deep #1f4a37:
   white title 10.0:1, desc #cfe0d5 7.3:1, gold-bright arrow 5.3:1 — all pass. */
.card--cta {
  background: var(--color-leaf-deep);
  border: 2px solid var(--color-leaf-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xs);
}
.card--cta .card__title { color: #fff; }
.card--cta .card__desc { color: #cfe0d5; }
.card--cta:hover {
  border-color: var(--color-gold-hairline);
  box-shadow: 0 14px 30px -22px rgba(23, 31, 26, 0.6);
}
.card--cta:hover .card__title { color: #fff; }
.card--cta .card__icon { color: #fff; }
.card--cta .card__icon .icon-accent { color: var(--color-gold-bright); }
.card--cta .card__arrow {
  display: inline-block;
  font-size: 1.3rem;
  color: var(--color-gold-bright);
  transition: transform 0.3s var(--ease-out-quart);
}
.card--cta:hover .card__arrow { transform: translateX(5px); }
@media (prefers-reduced-motion: reduce) {
  .card--cta:hover .card__arrow { transform: none; }
}

/* ---------- footer: engraved ink plate (grafted from competitor-A) ----------
   Ink-dark ground (not the old leaf gradient), a gold "closing seal" hairline
   across the top edge that echoes the header's gold hairline, a low-opacity
   engraved wheat ornament in the corner, and per-link underline-DRAW hover
   (a gold rule that grows left→right on hover) mirroring the header nav so
   the nav/footer system (design-guide point 11) reads as one engraved family.
   Computed contrast on the ink-deep (#171f1a) ground: gold-hairline label
   7.46:1, body text 13.5:1, links 11.4:1, hover white 16.8:1 — all pass 4.5:1. */
.site-footer {
  position: relative;
  background: var(--color-ink-deep);
  background-image: radial-gradient(ellipse 800px 400px at 90% 0%, rgba(207, 167, 82, 0.08), transparent 60%);
  color: #dfe9e2;
  padding: var(--space-6) 0 var(--space-4);
  margin-top: var(--space-6);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold-hairline) 20%, var(--color-gold-hairline) 80%, transparent);
}
/* Engraved wheat sprig in the corner as page furniture — low opacity so it
   never competes with the link columns. Decorative, aria-hidden host. */
.site-footer__mark {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 84px;
  height: auto;
  color: var(--color-gold-hairline);
  opacity: 0.16;
  pointer-events: none;
}
@media (max-width: 560px) {
  .site-footer__mark { width: 60px; opacity: 0.12; }
}
.site-footer__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 700px) {
  .site-footer__grid { grid-template-columns: repeat(4, 1fr); }
}
/* Eyebrow-style label tier in gold — reads as the label, not a link peer. */
.site-footer__col-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-hairline);
  margin-bottom: var(--space-md);
}
.site-footer__link {
  position: relative;
  display: block;
  width: fit-content;
  color: #c9d8cd;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.3;
  padding: 0.3rem 0;
  min-height: 32px;
  background-image: linear-gradient(var(--color-gold-hairline), var(--color-gold-hairline));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s var(--ease-out-quart), color 0.2s ease;
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: #fff;
  background-size: 100% 1px;
}
@media (prefers-reduced-motion: reduce) {
  .site-footer__link { transition: color 0.2s ease; }
}
.site-footer__note { color: #c9d8cd; font-size: var(--text-sm); line-height: var(--leading-sm); }
.site-footer__bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(207, 167, 82, 0.2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  font-size: 0.85rem;
  color: #b7c7bc;
  text-align: center;
}
/* Footer ledger: a single Mend Strip above the © line — the one repair
   grammar closing the page. See the Mend Strip component section. */
.site-footer__ledger {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}
.site-footer__ledger .mend-strip {
  align-items: center;
}
/* The Mend Strip label's default ink-soft only reaches 2.26:1 on the ink
   footer ground — recolor it to the gold-hairline (7.46:1 on ink-deep) so
   the label passes AA even though the ledger is aria-hidden/decorative. */
.site-footer__ledger .mend-strip__label {
  color: var(--color-gold-hairline);
  text-align: center;
}

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.print-only { display: none; }

@media print {
  .site-header, .site-footer, .tool__actions, .fakedoor, .site-nav,
  .hero__tool, .hero__chips, .hero__photo-wrap { display: none !important; }
  .print-only { display: block; }
  body { font-size: 14px; }

  /* Print-friendly repaired recipe: keep both lists, the bake-behavior
     footnotes, and the disclaimer; drop shadows/decoration and let columns
     print side by side. The per-ingredient analysis prints below as the
     "citations" layer (each row carries its source + confidence). */
  .compare, .ing-row {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .compare__line--struck,
  .compare__line--gold,
  .compare__line--unknown {
    background: transparent !important;
    border-color: #bbb !important;
    color: #000 !important;
  }
  .compare__line--gold { font-weight: 700; }
  .compare__bridge { color: #000 !important; }
  .results, .results[hidden] { display: block !important; }
}

.disclaimer-strip {
  background: var(--color-caution-bg);
  border: 1px solid #ecd8ac;
  color: var(--color-caution);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin: var(--space-3) 0;
}

/* ---------- editorial responsive type scale (owner round 4) ----------
   Below 700px, drop to the spec's mobile scale — still comfortably above
   the 16px floor, and the .section > .container grid already collapsed
   to a single column at 768px above. */
@media (max-width: 700px) {
  :root {
    --text-body: 20px;
    --leading-body: 32px;
    --text-list: 20px;
    --leading-list: 32px;
    --text-h1: 40px;
    --leading-h1: 46px;
    --text-h2: 32px;
    --leading-h2: 38px;
    --text-h3: 26px;
    --leading-h3: 32px;
    --text-h4: 22px;
    --leading-h4: 28px;
  }

  .section {
    padding-block: var(--space-3xl);
  }
}

/* Results wrapper contributes no empty band before a repair is run */
.section:has(> .container > #tool-results[hidden]) {
  display: none;
}
