/* ===========================================================================
   OPTIMIZATION AUDIT — design system

   Maestro palette, deliberately complementary to evolvelaw.ai rather than
   identical. EvolveLaw is dark navy with Anton, a condensed poster display
   face. This is a long-form reference, so it inverts to a light editorial base
   with Archivo for display, Source Sans 3 for body copy and Roboto Mono for
   data — then earns its edge from layout and restraint rather than from weight.

   EVERY color pair is measured, not chosen by eye:
       python tools/contrast.py
   33 pairs, light and dark, each against its stated WCAG requirement.

   Logged departure (DECISIONS.md D3): inline body links are #b800d6 (5.04:1),
   not Vivid Magenta #d900ff, which measures 3.74:1 on this background and fails
   AA for normal text. #d900ff is kept at full strength for large display type,
   gradients and accents, and on dark surfaces where it measures 4.87:1.

   No JavaScript is required by anything in this file.
   =========================================================================== */

:root {
  color-scheme: light;

  /* ── surfaces ───────────────────────────────────────────────────────── */
  --base:        #fbfafd;
  --surface:     #ffffff;
  --surface-alt: #f5f3fa;
  --code-bg:     #f4f2f9;
  --deep:        #1a1033;
  --deep-2:      #2c008c;

  /* ── ink ────────────────────────────────────────────────────────────── */
  --text:        #2a2a2a;
  --text-soft:   #555555;
  --heading:     #2c008c;
  --on-deep:     #e7e3f2;
  --on-deep-soft:#b8a9d9;

  /* ── accents ────────────────────────────────────────────────────────── */
  --link:        #b800d6;
  --link-hover:  #8a2be2;
  --vivid:       #d900ff;
  --indigo:      #443673;
  --indigo-mid:  #6b5a99;
  --indigo-soft: #b8a9d9;
  --indigo-pale: #e7e3f2;
  --focus:       #531fff;

  /* ── lines ──────────────────────────────────────────────────────────── */
  --rule:        #ece9f5;
  --rule-strong: #ddd7ec;
  --border-ui:   #8f9090;

  /* ── evidence grades ────────────────────────────────────────────────── */
  --g-doc-ink: #0b5e3a;  --g-doc-bg: #e6f4ec;
  --g-con-ink: #6b4a00;  --g-con-bg: #fdf3d8;
  --g-spe-ink: #8a1c3b;  --g-spe-bg: #fdeaf0;

  --mark-bg:   #ffe9b8;  --mark-ink: #2a2a2a;

  /* ink that must flip with the theme, as tokens rather than as
     element rules inside the dark media query -- a bare rule there
     leaks when the theme is overridden, and white-on-white is the
     result. */
  --strong-ink: #2c008c;
  --h3-ink:     #443673;
  --h4-ink:     #6b5a99;
  --answer-ink: #2c008c;
  --figure-ink: #2c008c;

  /* ── elevation ──────────────────────────────────────────────────────── */
  --sh-1: 0 1px 2px rgba(26,16,51,.05), 0 2px 8px rgba(26,16,51,.04);
  --sh-2: 0 2px 4px rgba(26,16,51,.06), 0 12px 28px rgba(26,16,51,.09);
  --glass: rgba(251,250,253,.82);

  /* ── type ───────────────────────────────────────────────────────────── */
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --mono:    'Roboto Mono', ui-monospace, Consolas, monospace;

  /* ── metrics ────────────────────────────────────────────────────────── */
  --measure: 72ch;
  --shell:   1280px;
  --gutter:  24px;
  --rail:    226px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --base:        #120d24;
    --surface:     #1b1438;
    --surface-alt: #191232;
    --code-bg:     #191232;
    --deep:        #0c0818;
    --deep-2:      #241a52;

    --text:        #e4e0f0;
    --text-soft:   #a79cc4;
    --heading:     #c9b8ff;
    --on-deep:     #e4e0f0;
    --on-deep-soft:#a79cc4;

    --link:        #e879ff;
    --link-hover:  #ffffff;
    --indigo-pale: #221a44;
    --indigo-soft: #6b5a99;
    --rule:        #241c48;
    --rule-strong: #2e2458;
    --border-ui:   #6b5a99;

    --g-doc-ink: #7fe0b0;  --g-doc-bg: #10301f;
    --g-con-ink: #f0cf7a;  --g-con-bg: #33280a;
    --g-spe-ink: #ff9bb8;  --g-spe-bg: #36131f;

    --mark-bg:   #f0cf7a;  --mark-ink: #1a1033;

    --strong-ink: #ffffff;
    --h3-ink:     #b8a9d9;
    --h4-ink:     #a79cc4;
    --answer-ink: #ffffff;
    --figure-ink: #ffffff;

    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 2px 4px rgba(0,0,0,.4), 0 14px 32px rgba(0,0,0,.45);
    --glass: rgba(18,13,36,.82);
  }
}

/* ===== reset ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--deep); color: #fff; padding: 14px 22px;
  font-family: var(--display); font-weight: 700; letter-spacing: .03em;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* ===== layout =========================================================== */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: none; }
.prose > * { max-width: var(--measure); }
.prose > .tablewrap,
.prose > .grid,
.prose > pre { max-width: none; }

/* ===== header =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule-strong);
}
.site-header .shell { display: flex; align-items: center; gap: 30px; min-height: 66px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--heading); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--link); }
/* The mark is inline SVG filled with currentColor, so it themes with the
   wordmark and needs no second file for dark mode. Geometry is the brand
   kit's, redrawn in assets/img/logo-mark.svg. */
.brand-glyph { width: 26px; height: 26px; flex: 0 0 auto; display: block; }
.brand-word { display: inline-flex; align-items: baseline; }
.brand-thin {
  font-family: var(--body); font-weight: 400; font-size: .9375rem;
  letter-spacing: .17em; text-transform: uppercase;
}
.brand-bold {
  font-family: var(--display); font-weight: 800; font-size: .9375rem;
  letter-spacing: .055em; text-transform: uppercase; margin-left: .34em;
}
.nav { display: flex; gap: 26px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a {
  position: relative; font-size: .875rem; font-weight: 600; letter-spacing: .005em;
  color: var(--text-soft); text-decoration: none; padding: 7px 0;
  transition: color .16s ease;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--vivid), var(--focus));
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav a:hover { color: var(--link); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.nav a[aria-current] { color: var(--heading); }

/* ===== breadcrumbs ====================================================== */
.crumbs { font-size: .78125rem; padding: 22px 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.crumbs li { color: var(--text-soft); }
.crumbs li::after { content: "/"; margin-left: 7px; color: var(--indigo-soft); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--text-soft); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }

/* ===== hero (home) ====================================================== */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 420px at 88% -10%, rgba(217,0,255,.28), transparent 60%),
    radial-gradient(820px 380px at 8% 108%, rgba(83,31,255,.34), transparent 62%),
    linear-gradient(160deg, var(--deep) 0%, var(--deep-2) 140%);
  color: #fff; padding: clamp(56px, 7vw, 104px) 0 clamp(48px, 6vw, 88px);
  margin-bottom: 8px;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--vivid), var(--focus), transparent);
}
.hero .eyebrow { color: #c9b8ff; }
.hero h1 {
  color: #fff; max-width: 23ch;
  font-size: clamp(2.3rem, 1.1rem + 4.6vw, 4.1rem);
  letter-spacing: -.028em; line-height: 1.04;
}
.hero h1 .accent {
  background: linear-gradient(95deg, var(--vivid), #9c80ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .standfirst { color: #cfc7e6; max-width: 58ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: .8125rem;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 14px 26px; text-decoration: none; border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn-primary { background: linear-gradient(95deg, var(--vivid), #7a2bff); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(217,0,255,.34); color: #fff; }
.btn-ghost { border-color: rgba(231,227,242,.42); color: #e7e3f2; }
.btn-ghost:hover { border-color: var(--vivid); color: #fff; transform: translateY(-2px); }

/* ===== typography ======================================================= */
h1, h2, h3, h4 { font-family: var(--display); color: var(--heading); line-height: 1.16; margin: 0; }
h1 { font-size: clamp(2rem, 1.35rem + 2.5vw, 3rem); font-weight: 800; letter-spacing: -.024em; }
h2 {
  font-size: clamp(1.4rem, 1.14rem + 1vw, 1.85rem); font-weight: 700;
  letter-spacing: -.014em; margin-top: 2.6em; padding-top: .15em;
}
h3 { font-size: 1.1875rem; font-weight: 700; margin-top: 2em; color: var(--h3-ink); letter-spacing: -.008em; }
h4 { font-size: 1rem; font-weight: 700; margin-top: 1.7em; color: var(--h4-ink); letter-spacing: .01em; }
.prose > h2:first-child { margin-top: 0; }

.standfirst {
  font-size: clamp(1.09rem, 1.03rem + .3vw, 1.235rem); line-height: 1.55;
  color: var(--text-soft); max-width: 62ch; margin: 16px 0 0; font-weight: 400;
}
.eyebrow {
  font-family: var(--mono); font-size: .6875rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--indigo-mid);
  margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
}
.eyebrow::after {
  content: ""; flex: 0 0 40px; height: 1px;
  background: linear-gradient(90deg, var(--vivid), transparent);
}

p, ul, ol { margin: 1.1em 0; }
.prose > p:first-child { margin-top: 0; }
ul, ol { padding-left: 1.3em; }
li { margin: .45em 0; }
li::marker { color: var(--vivid); }
strong { font-weight: 600; color: var(--strong-ink); }
hr { border: 0; height: 1px; background: linear-gradient(90deg, var(--rule-strong), transparent); margin: 3.2em 0; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .14s ease; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a.gloss { text-decoration-style: dotted; text-underline-offset: 4px; }

/* ===== page head + article grid ========================================= */
.page-head { padding: 30px 0 10px; }
.article-grid { display: grid; gap: 56px; grid-template-columns: minmax(0, 1fr); justify-content: space-between; }
@media (min-width: 1080px) {
  .article-grid { grid-template-columns: minmax(0, 1fr) var(--rail); }
  .article-grid--wide { grid-template-columns: minmax(0, 1fr); }
}

/* ===== in-page contents rail =========================================== */
.toc { position: sticky; top: 92px; align-self: start; font-size: .8125rem; }
.toc h2 {
  font-family: var(--mono); font-size: .625rem; font-weight: 500; margin: 0 0 14px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--indigo-mid);
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule-strong); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -1px;
  color: var(--text-soft); text-decoration: none; border-left: 2px solid transparent;
  line-height: 1.4;
}
.toc a:hover { color: var(--link); border-left-color: var(--vivid); }
@media (max-width: 1079px) { .toc { display: none; } }

/* ===== byline + provenance ============================================= */
.byline {
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  font-size: .8125rem; color: var(--text-soft);
  padding: 16px 0; margin: 26px 0 0;
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
}
.byline .who { font-weight: 600; color: var(--text); }

.reviewbox {
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 3px; box-shadow: var(--sh-1);
  padding: 24px 26px; margin: 3.4em 0 0; font-size: .9375rem;
  position: relative; overflow: hidden;
}
.reviewbox::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--vivid), var(--focus));
}
.reviewbox h2 {
  font-size: .625rem; font-family: var(--mono); font-weight: 500; margin: 0 0 14px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--indigo-mid);
}
.reviewbox dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.reviewbox dt { font-weight: 600; color: var(--text-soft); }
.reviewbox dd { margin: 0; }

/* ===== evidence grade =================================================== */
.grade {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .625rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 100px; border: 1px solid currentColor;
}
.grade::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.grade-documented  { color: var(--g-doc-ink); background: var(--g-doc-bg); }
.grade-consensus   { color: var(--g-con-ink); background: var(--g-con-bg); }
.grade-speculative { color: var(--g-spe-ink); background: var(--g-spe-bg); }
.grade-why { font-size: .875rem; color: var(--text-soft); margin: 12px 0 0; max-width: var(--measure); }
.grade-block { margin: 2em 0 2.4em; }

/* ===== answer / takeaways / stat / note ================================ */
.answer {
  position: relative; background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 3px;
  box-shadow: var(--sh-1);
  padding: 26px 30px; margin: 2em 0;
}
.answer::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--vivid), var(--focus));
  border-radius: 3px 0 0 3px;
}
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer h2 { margin: 0 0 .7em; font-size: 1.25rem; letter-spacing: -.01em; }
.answer > p:first-of-type { font-size: 1.09rem; font-weight: 600; color: var(--answer-ink); line-height: 1.55; }

.takeaways {
  background: linear-gradient(140deg, var(--indigo-pale), var(--surface-alt));
  border: 1px solid var(--indigo-soft); border-radius: 3px;
  padding: 26px 30px; margin: 2.4em 0;
}
.takeaways h2 {
  font-family: var(--mono); font-size: .625rem; font-weight: 500; margin: 0 0 16px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--heading);
}
.takeaways ul { margin: 0; }
.takeaways li { margin: .6em 0; }

.stat {
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 3px; box-shadow: var(--sh-1);
  padding: 22px 26px; margin: 2.2em 0; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--vivid), var(--focus)); }
.stat .figure {
  font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.3rem);
  color: var(--figure-ink); line-height: 1.05; letter-spacing: -.02em;
}
.stat .claim { margin: 10px 0 0; }
.stat .cite { font-size: .8125rem; color: var(--text-soft); margin: 12px 0 0; }
.stat .cite a { color: var(--text-soft); }

blockquote { margin: 2em 0; padding: 2px 0 2px 24px; border-left: 2px solid var(--indigo-soft); color: var(--text-soft); }
blockquote.expert { font-style: italic; color: var(--text); }
blockquote.expert footer { font-style: normal; font-size: .875rem; color: var(--text-soft); margin-top: 12px; }

.note {
  background: var(--surface-alt); border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--indigo-mid); border-radius: 3px;
  padding: 20px 24px; margin: 2.2em 0; font-size: .9375rem;
}
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.draft-banner { border-left-color: var(--g-spe-ink); background: var(--g-spe-bg); }

/* ===== tables =========================================================== */
.tablewrap {
  overflow-x: auto; margin: 2.4em 0;
  border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: var(--sh-1);
}
table { border-collapse: collapse; width: 100%; font-size: .9375rem; background: var(--surface); }
caption { text-align: left; font-size: .8125rem; color: var(--text-soft); padding: 14px 18px 0; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table { min-width: 560px; }
td { min-width: 128px; }
thead th {
  font-family: var(--display); font-size: .6875rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--heading); background: var(--indigo-pale);
  border-bottom: 2px solid var(--indigo-soft); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
td.unverified { color: var(--text-soft); font-style: italic; }
.dodont td:first-child { box-shadow: inset 3px 0 0 var(--g-doc-ink); }
.dodont td:last-child  { box-shadow: inset 3px 0 0 var(--g-spe-ink); }

/* ===== code ============================================================= */
code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .14em .42em; border-radius: 3px; }
pre {
  font-family: var(--mono); font-size: .8125rem; line-height: 1.65;
  background: var(--code-bg); border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 20px 22px; overflow-x: auto; margin: 2.2em 0;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* ===== cards ============================================================ */
.grid { display: grid; gap: 20px; margin: 2.4em 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(282px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  position: relative; background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 24px 26px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sh-1); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--vivid), var(--focus));
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--indigo-soft); }
.card:hover::before { transform: scaleX(1); }
.card h3 { margin: 0; font-size: 1.0625rem; color: var(--heading); letter-spacing: -.008em; }
.card h3 a { color: inherit; text-decoration: none; }
.card:hover h3 a { color: var(--link); }
.card p { margin: 0; font-size: .9375rem; color: var(--text-soft); line-height: 1.6; }
.card .meta {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--indigo-mid); margin-top: auto; padding-top: 6px;
}

.cluster { margin: 4em 0 0; padding-top: 2.4em; border-top: 1px solid var(--rule-strong); }
.cluster h2 { margin-top: 0; font-size: 1.3rem; }

/* ===== answer search ==================================================== */
.searchbox { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; margin: 1.8em 0 .6em; }
.searchbox label {
  flex: 0 0 100%; font-family: var(--mono); font-size: .625rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--indigo-mid); margin-bottom: 4px;
}
.searchbox input[type="search"] {
  flex: 1 1 340px; min-width: 0; font-family: var(--body); font-size: 1.0625rem;
  padding: 15px 18px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-ui); border-radius: 3px; box-shadow: var(--sh-1);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.searchbox input[type="search"]:focus-visible { border-color: var(--vivid); box-shadow: 0 0 0 3px rgba(217,0,255,.16); }
.searchbox input[type="search"]:disabled { background: var(--surface-alt); color: var(--text-soft); }
.searchbox button {
  flex: 0 0 auto; cursor: pointer; border: 0; border-radius: 3px;
  padding: 15px 30px; background: linear-gradient(95deg, var(--vivid), #7a2bff); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: .8125rem;
  letter-spacing: .09em; text-transform: uppercase;
  transition: transform .16s ease, box-shadow .16s ease;
}
.searchbox button:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217,0,255,.3); }
.search-status { font-size: .875rem; color: var(--text-soft); margin: 0 0 1.8em; min-height: 1.3em; }
#search-results .answer > p:first-of-type { font-weight: 400; color: var(--text); }
#search-results .answer .cite { font-size: .8125rem; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
#search-results h2 { margin-top: 2.4em; }
mark { background: var(--mark-bg); color: var(--mark-ink); padding: .05em .22em; border-radius: 2px; }

/* ===== call to action (one snippet, see site.json audit) ================ */
.cta {
  position: relative; background: var(--surface); border: 1px solid var(--indigo-soft);
  border-radius: 3px; padding: 28px 30px; margin: 3.4em 0 0; overflow: hidden;
}
.cta::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--vivid), var(--focus)); }
.cta h2 { font-size: 1.1875rem; margin: 0 0 10px; }
.cta p { margin: 0 0 12px; font-size: .9375rem; color: var(--text-soft); }
.cta .inert {
  font-family: var(--mono); font-size: .75rem; line-height: 1.6; color: var(--text-soft);
  background: var(--surface-alt); border: 1px dashed var(--border-ui);
  border-radius: 3px; padding: 12px 16px; margin: 0;
}
.cta-live .btn { margin-top: 4px; }

/* ===== newsletter (inert — DECISIONS.md D9) ============================ */
.newsletter {
  position: relative; background: var(--surface); border: 1px solid var(--indigo-soft);
  border-radius: 3px; padding: 28px 30px; margin: 3.4em 0 0; overflow: hidden;
}
.newsletter::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--vivid), var(--focus)); }
.newsletter h2 { font-size: 1.1875rem; margin: 0 0 10px; }
.newsletter p { margin: 0 0 14px; font-size: .9375rem; color: var(--text-soft); }
.newsletter .inert {
  font-family: var(--mono); font-size: .75rem; line-height: 1.6; color: var(--text-soft);
  background: var(--surface-alt); border: 1px dashed var(--border-ui);
  border-radius: 3px; padding: 12px 16px; margin: 0;
}

/* ===== footer =========================================================== */
/* ── The end band ────────────────────────────────────────────────────────────
   Closes every page. Two cards: the audit, which is the only thing this site
   sells, and consulting, which is a different business and links off-site.
   Built from the tokens already used elsewhere so the contrast pairs the build
   verifies do not change.                                                    */
.endband {
  background: var(--surface-alt); border-top: 1px solid var(--rule-strong);
  margin-top: 5em; padding: 54px 0;
}
.endcards {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.endcard {
  position: relative; background: var(--surface); border: 1px solid var(--indigo-soft);
  border-radius: 3px; padding: 28px 30px; overflow: hidden;
}
.endcard::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--indigo-soft);
}
.endcard-audit::before { background: linear-gradient(90deg, var(--vivid), var(--focus)); }
.endcard h2 { font-size: 1.1875rem; margin: 0 0 10px; }
.endcard p { margin: 0 0 16px; font-size: .9375rem; color: var(--text-soft); }
.endcard .btn { margin-top: 2px; }

/* The compact consulting line that sits under an inline audit CTA. */
.cta-alt {
  margin: 14px 0 0 !important; padding-top: 14px;
  border-top: 1px solid var(--rule); font-size: .875rem !important;
}

.site-footer {
  background: var(--surface); border-top: 1px solid var(--rule-strong);
  margin-top: 0; padding: 52px 0 60px; font-size: .875rem; color: var(--text-soft);
}
.site-footer .cols { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.site-footer h2 {
  font-family: var(--mono); font-size: .625rem; font-weight: 500; margin: 0 0 14px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--indigo-mid);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .45em 0; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }
.colophon { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: .8125rem; max-width: 76ch; }

/* ===== print ============================================================ */
@media print {
  .site-header, .site-footer, .newsletter, .cluster, .skip-link, .toc, .hero-actions { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { background: none; color: #000; padding: 0; }
  .hero h1, .hero h1 .accent { color: #000; -webkit-text-fill-color: #000; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  .answer, .takeaways, .stat, .card, .tablewrap { border: 1px solid #999; box-shadow: none; }
  .article-grid { display: block; }
}

/* ===== small screens ==================================================== */
@media (max-width: 680px) {
  :root { --gutter: 18px; }
  body { font-size: 1rem; }
  .site-header .shell { min-height: 0; padding-top: 12px; padding-bottom: 12px; gap: 14px; }
  .nav { margin-left: 0; gap: 18px; }
  .nav a { font-size: .8125rem; }
  .answer, .takeaways, .newsletter, .reviewbox { padding-left: 20px; padding-right: 20px; }
  .reviewbox dl { grid-template-columns: 1fr; gap: 2px 0; }
  .reviewbox dd { margin-bottom: 12px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
}
