/* ==========================================================================
   Design tokens.

   Light is the base. Dark redefines only the tokens, never the rules, so a
   colour can never exist in one theme and not the other. Nothing here loads
   over the network: no web fonts, no CDN, no external stylesheet. That keeps
   the page fast, keeps it working inside a strict content policy, and means a
   visitor on a charity's locked-down desktop gets exactly what we designed.
   ========================================================================== */

:root {
  --ground: #fbfaf7;
  --ground-warm: #f2efe8;
  --ground-deep: #10302a;
  --surface: #ffffff;
  --ink: #17201d;
  --ink-soft: #4c5a55;
  --ink-faint: #6d7a75;
  --rule: #e0dbd1;
  --rule-strong: #cdc6b8;
  --brand: #15594a;
  --brand-bright: #1d7a64;
  --brand-wash: #e8f1ed;
  --accent: #a8551f;
  --on-deep: #f4f7f5;
  --on-deep-soft: #c3d6cf;
  --focus: #a8551f;
  --shadow: 0 1px 2px rgba(23, 32, 29, 0.05), 0 8px 24px rgba(23, 32, 29, 0.06);
  --radius: 10px;
  --wrap: 68rem;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1614;
    --ground-warm: #14201d;
    --ground-deep: #0a1a17;
    --surface: #16211e;
    --ink: #edf2f0;
    --ink-soft: #b3c2bd;
    --ink-faint: #8b9994;
    --rule: #293833;
    --rule-strong: #3a4c46;
    --brand: #6fc9ae;
    --brand-bright: #8fdcc3;
    --brand-wash: #16302a;
    --accent: #e0955f;
    --on-deep: #edf2f0;
    --on-deep-soft: #a9bfb8;
    --focus: #e0955f;
    --shadow: none;
  }
}

/* --------------------------------------------------------------------------
   Reset and base
   -------------------------------------------------------------------------- */

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

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

body {
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.3rem); }
h3 { font-size: 1.2rem; font-weight: 600; }

p, li { text-wrap: pretty; }
a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-bright); }

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

strong { font-weight: 650; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 50;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 4px;
  background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--ground), inset 0 0 0 4px var(--brand);
  flex: none;
}
.menu { margin-left: auto; }
.menu-btn { display: none; }
.nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding-block: 0.75rem;
  display: inline-block;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand); }

/* Round 8 (R5_FOLD_3 item 34): on a phone the six links sit behind a menu
   button, so Pricing is one tap away instead of off the right-hand edge of a
   scrolling row. It is a details element, so it opens and closes with no
   script and no framework. On a wide screen the button is hidden and the row
   is shown whatever the open state is, which is why display and
   content-visibility are both forced here: a closed details element is
   hidden by the browser's own stylesheet in two different ways. */
.menu > .nav {
  display: block;
  content-visibility: visible;
}

@media (max-width: 60rem) {
  .topbar { position: static; }
  .topbar-inner { min-height: 3.4rem; gap: 0.75rem; }
  .menu { margin-left: auto; position: relative; }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    list-style: none;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--ground);
  }
  .menu-btn::-webkit-details-marker { display: none; }
  .menu-btn::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }
  .menu[open] .menu-btn::after { transform: translateY(2px) rotate(225deg); }
  .menu:not([open]) > .nav { display: none; content-visibility: hidden; }
  .menu[open] > .nav {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 30;
    min-width: 14rem;
    padding: 0.4rem 1rem;
    background: var(--ground);
    border: 1px solid var(--rule);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
  .menu[open] .nav ul { flex-direction: column; gap: 0; }
  .menu[open] .nav li { border-bottom: 1px solid var(--rule); }
  .menu[open] .nav li:last-child { border-bottom: 0; }
  .menu[open] .nav a { display: block; padding-block: 0.7rem; }
  .nav-cta { order: 3; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-sm { min-height: 2.4rem; padding: 0.4rem 0.85rem; font-size: 0.92rem; }
.btn-primary { background: var(--brand); color: #ffffff; }
.btn-primary:hover { background: var(--brand-bright); color: #ffffff; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #06120f; }
  .btn-primary:hover { color: #06120f; }
}

/* On a dark band the brand green sits too close to the ground behind it, so
   the primary button inverts. Checked both ways: #f4f7f5 on #10302a is 13.4:1
   for the button face, and #0d241f text on that face is 13.1:1. */
.hero .btn-primary,
.band-deep .btn-primary {
  background: var(--on-deep);
  color: #0d241f;
}
.hero .btn-primary:hover,
.band-deep .btn-primary:hover {
  background: #ffffff;
  color: #0d241f;
}

/* --------------------------------------------------------------------------
   Hero and bands
   -------------------------------------------------------------------------- */

.hero {
  background: var(--ground-deep);
  color: var(--on-deep);
  padding-block: clamp(3rem, 1.5rem + 7vw, 6rem);
  border-bottom: 1px solid var(--rule);
}
.hero h1 { max-width: 20ch; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--on-deep-soft);
  margin-bottom: 0.9rem;
}
.hero-intro {
  margin-top: 1.4rem;
  max-width: 46rem;
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.28rem);
  color: var(--on-deep-soft);
}
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero .btn-ghost { color: var(--on-deep); }
.hero-note {
  margin-top: 1.6rem;
  font-size: 0.92rem;
  color: var(--on-deep-soft);
  max-width: 46rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.hero a { color: var(--on-deep); }

.band { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.band-warm { background: var(--ground-warm); border-block: 1px solid var(--rule); }
.band-deep { background: var(--ground-deep); color: var(--on-deep); border-block: 1px solid var(--rule); }
.band-deep h2 { color: var(--on-deep); }
.band-deep p { color: var(--on-deep-soft); }
.band + .band:not(.band-warm):not(.band-deep) { padding-top: 0; }

.band > .wrap > h2 + p,
.band > .wrap > .kicker + h2 + p { margin-top: 1rem; }
.band p { max-width: 46rem; }
.band p + p { margin-top: 1rem; }
.band h3 { margin-top: 2rem; }
.band h3 + p { margin-top: 0.6rem; }

.lead { font-size: 1.15rem; color: var(--ink-soft); }
.band-deep .lead { color: var(--on-deep-soft); }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */

.crumbs { border-bottom: 1px solid var(--rule); background: var(--ground); }
.crumbs ol {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--rule-strong); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Cards, steps, stats
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin-top: 0.55rem; color: var(--ink-soft); font-size: 0.98rem; }

.steps { list-style: none; padding: 0; margin-top: 2rem; display: grid; gap: 1.5rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-n {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-wash);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--rule);
}
.step h3 { margin-top: 0.15rem; }
.step p { margin-top: 0.4rem; color: var(--ink-soft); }

.stats {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.stats dt {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.1;
}
.stats dd { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-scroll { overflow-x: auto; margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
caption {
  text-align: left;
  font-size: 0.88rem;
  color: var(--ink-faint);
  padding-bottom: 0.6rem;
}
th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
thead th, thead td {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  font-weight: 700;
}
tbody th { font-weight: 600; }
.detail { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.25rem; }
.prices .price { white-space: nowrap; font-weight: 650; }
.table-note { margin-top: 0.9rem; font-size: 0.92rem; color: var(--ink-soft); }
.compare td { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Callouts, lists, disclosures
   -------------------------------------------------------------------------- */

.callout {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
}
.callout-warn { border-left-color: var(--accent); }
.callout h3 { margin-top: 0; }
.callout p { margin-top: 0.7rem; color: var(--ink-soft); }
.band-deep .callout { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.16); }
.band-deep .callout p { color: var(--on-deep-soft); }

.bullets { margin-top: 1.2rem; padding-left: 1.15rem; display: grid; gap: 0.6rem; max-width: 46rem; }
.bullets li { padding-left: 0.25rem; }
.bullets-check { list-style: none; padding-left: 0; }
.bullets-check li { padding-left: 1.75rem; position: relative; }
.bullets-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--brand);
}
.bullets-cross { list-style: none; padding-left: 0; }
.bullets-cross li { padding-left: 1.75rem; position: relative; }
.bullets-cross li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--accent);
}

.faqs { margin-top: 2rem; border-top: 1px solid var(--rule); max-width: 52rem; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-weight: 600;
  position: relative;
  min-height: 2.75rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 1.5rem;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: rotate(45deg);
}
.faq[open] summary::after { transform: rotate(-135deg); top: 1.7rem; }
/* The question is an h3 (fold 10) but looks exactly as the summary text did. */
.faq summary h3 {
  display: inline;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-wrap: pretty;
}
.faq-body { padding-bottom: 1.2rem; }
.faq-body p { color: var(--ink-soft); }

.closer { text-align: left; max-width: 46rem; }
.closer p { margin-top: 1rem; }
.closer .btn { margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.form { margin-top: 2rem; max-width: 42rem; display: grid; gap: 1.35rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 1rem; }
.field .hint { font-size: 0.9rem; color: var(--ink-faint); font-weight: 400; }
.field .optional { font-weight: 400; color: var(--ink-faint); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  min-height: 2.9rem;
  width: 100%;
}
textarea { min-height: 9rem; resize: vertical; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem; }
legend { font-weight: 600; padding-inline: 0.35rem; }
.radio-row { display: grid; gap: 0.7rem; margin-top: 0.4rem; }
.radio-row label { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.radio-row input { width: auto; min-height: auto; margin-top: 0.35rem; }
.hp { position: absolute; left: -9999px; }
.form-status {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
  font-size: 0.96rem;
}
.form-status[hidden] { display: none; }
.error { color: var(--accent); font-size: 0.9rem; }

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

.footer {
  border-top: 1px solid var(--rule);
  background: var(--ground-warm);
  padding-block: 3rem 2.5rem;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.footer h2 {
  font-family: inherit;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
  font-weight: 700;
}
.footer ul { list-style: none; padding: 0; margin-top: 0.8rem; display: grid; gap: 0.5rem; }
.footer a { color: var(--ink-soft); text-decoration: none; font-size: 0.96rem; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.75rem;
}
.footer-foot p { font-size: 0.88rem; color: var(--ink-faint); max-width: 52rem; }

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .topbar, .footer, .hero-actions, .closer { display: none; }
  body { background: #fff; color: #000; }
  .band { padding-block: 1rem; }
}

/* --------------------------------------------------------------------------
   Round 5 additions: the quotable definition paragraph, card CTAs, and the
   letter's enquiry block.
   -------------------------------------------------------------------------- */

.definition {
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
  margin-top: 1.2rem;
  font-size: 1.08rem;
}
.band-deep .definition { border-left-color: var(--on-deep-soft); }
.card-cta { margin-top: 0.8rem; font-weight: 600; }
.card-cta a { text-decoration: none; }
.card-cta a::after { content: " \2192"; }
.card-cta a:hover { text-decoration: underline; }
.enquiry-block .form { margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   Round 14: drawn diagrams and pull quotes.

   The diagrams are inline SVG written by lib/diagrams.mjs. Not one colour is
   set in the markup: every fill and stroke is a class here reading the same
   tokens as the rest of the page, so a diagram follows the light and the
   dark theme without a second drawing, and no inline style attribute is
   needed, which matters because the content policy sets style-src to 'self'
   with no unsafe-inline.

   Sizing. Each diagram is drawn in a 400 unit viewBox and capped at 30rem.
   At a 390px viewport the wrap leaves 350px, so it renders at about 0.88 and
   a 15px label lands near 13px. On a wide screen it renders at about 1.2 and
   the same label lands near 18px. Both are legible, which is the point.
   -------------------------------------------------------------------------- */

/* Bottom margin as well as top: the element after a figure or a pull quote
   is usually a paragraph, and a paragraph only gets a top margin when it
   follows another paragraph, so without this the copy butts against the
   drawing. Adjacent block margins collapse, so a list after a figure still
   gets one gap and not two. */
.figure { margin: 2rem 0 1.6rem; max-width: 30rem; }
.dgm { display: block; width: 100%; height: auto; }
.dgm-panel { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1; }
.dgm-panel-key { fill: var(--brand-wash); stroke: var(--brand); stroke-width: 1; }
.dgm-frame { fill: none; stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.dgm-line { stroke: var(--rule-strong); stroke-width: 2; }
.dgm-arrow { fill: var(--ink-faint); }
.dgm-dot { fill: var(--brand); }
.dgm-head {
  fill: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.dgm-t { fill: var(--ink); font-size: 15px; }
.dgm-b { fill: var(--ink); font-size: 15px; font-weight: 650; }
.dgm-key { fill: var(--brand); font-size: 15px; font-weight: 650; }
.dgm-s { fill: var(--ink-faint); font-size: 13px; }

.pull {
  margin: 2rem 0 1.6rem;
  padding: 0.15rem 0 0.15rem 1.15rem;
  border-left: 3px solid var(--accent);
  max-width: 40rem;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}
.band-warm .pull { border-left-color: var(--brand); }

@media print {
  .figure { break-inside: avoid; }
}
