/*
 * Give-Kit — a fundraising-platform system: white ground, one near-black ink,
 * colour arriving as blocks rather than as a wash, pill actions, soft-cornered
 * cards ringed by a hairline instead of lifted by a shadow, and large display
 * type set light and tight.
 *
 * Derived from the shape of consumer fundraising sites rather than copied from
 * one. The transferable part is the SYSTEM — near-black instead of black,
 * layered near-whites, accent blocks paired with a dark tonal text colour,
 * rings not shadows, and a compressed scale that jumps from a big display size
 * straight to 16px. The hues, the wordmark and the typeface are Give-Kit's own.
 *
 * Plain CSS, one file, no build step. Cloudflare Pages serves site/ exactly as
 * it is committed, so a bundler would exist only to be forgotten before a
 * deploy. There is no JavaScript anywhere on this site — the mobile menu is a
 * native <details> disclosure — which is what lets _headers keep
 * `script-src 'none'`.
 *
 * Type is Figtree, self-hosted from site/fonts/ under the SIL Open Font
 * License (see fonts/OFL.txt). `font-src 'self'` is unchanged and nothing is
 * fetched from a third party — but this IS the first font the site has ever
 * shipped: 20 KB over the wire. font-display:swap means a donor on rural LTE
 * reads the page on the first paint in the system fallback and reflows into
 * Figtree when it arrives, rather than waiting on it.
 */

/* Figtree 300–800, latin subset, variable. One file covers every weight the
   system uses, so a light display heading and a 600 label cost nothing extra. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/figtree.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ----------
 * One palette, declared in full on :root. There is no dark override any more:
 * this site has no theme toggle, so the only thing that ever selected dark was
 * the visitor's operating system, and a donor-facing page that changes ground
 * colour depending on a setting nobody here can see is a liability — the signs
 * and flyers it describes are printed on white paper. Dark in the Rails app is
 * a separate, opt-in thing and is unaffected. */

:root {
  color-scheme: light;

  --paper: #ffffff;        /* page ground — white now, not warm paper */
  --paper-raised: #fafafa; /* cards, the sign mock */
  --paper-sunk: #f0efed;   /* the empty half of a progress bar */
  --ink: #1f2022;          /* primary text — near-black, never pure black */
  --ink-soft: #55585c;     /* secondary text — 7.6:1 on paper */
  --ink-faint: #6b6f74;    /* metadata, footer — 5.4:1 on paper */
  --rule: #e4e4e2;         /* hairline rings and separators */

  --accent: #1F4E79;       /* brand navy — 9.3:1 on white */
  --accent-on-accent: #ffffff;

  /* Colour blocks: a light ground with a dark tonal partner meant to sit ON
     it. Never --ink on a block, never a block behind running body text. Both
     pairs clear AA for normal text, so a block can carry a full sentence. */
  --block-cool: #e9f0f7;
  --on-cool: #16364f;
  --block-warm: #fdeedc;
  --on-warm: #6a3c08;

  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Shape. Pills for actions, 12px for cards, 16px for the largest panels.
     A ring is an inset box-shadow rather than a border, so adding one never
     moves the box by a pixel. */
  --r-pill: 9999px;
  --r-card: 12px;
  --r-panel: 16px;
  --r-sm: 8px;
  --ring: inset 0 0 0 1px var(--rule);
}

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

html {
  font-family: var(--sans);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);   /* explicit, in both themes */
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* Keyboard users get the nav once and then a way past it. */
.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: var(--accent-on-accent);
  font-family: var(--sans);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Horizontal padding as longhands. The `padding` shorthand here beats every
   element selector that sets vertical padding on the same box — `main` and the
   header `nav` both carry .wrap — and silently zeroes it. */
.wrap { margin: 0 auto; max-width: 42rem; padding-left: 1.5rem; padding-right: 1.5rem; width: 100%; }
.wrap-wide { max-width: 52rem; }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
/* Position context for the disclosure summary: it is a sibling of the nav row,
   not a child, so the row itself cannot grow when the panel opens. */
.site-header nav { position: relative; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }

.wordmark {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; font-family: var(--sans); font-size: 13px; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-on-accent);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.375rem;
  text-decoration: none;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.button:hover { background: var(--ink); color: var(--paper-raised); }
/* `.site-nav a` is more specific than `.button`, so the header CTA needs its
   colour restated or it inherits ink-soft — near-invisible on the accent. */
.site-nav a.button { padding: 0.5rem 1.125rem; color: var(--accent-on-accent); }
.site-nav a.button:hover { color: var(--paper-raised); }

/* ---------- main ---------- */

main { flex: 1 0 auto; padding-top: 3.5rem; padding-bottom: 3.5rem; }

/* The compressed scale: a big light display size, then a step down, then
   straight to body. Weight goes DOWN as size goes up — a 500 at 2.6rem reads
   as confident where a 700 reads as shouting. */
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 2.9rem); font-weight: 500; line-height: 1.08; letter-spacing: -0.025em; margin: 0; }
h2 { font-size: 1.5rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; margin: 2.75rem 0 0; }
h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.005em; margin: 2rem 0 0; }

p, ul, ol, dl { line-height: 1.65; margin: 1.25rem 0 0; }
li { margin-top: 0.5rem; }
li:first-child { margin-top: 0; }
ul, ol { padding-left: 1.25rem; }

.lede { margin-top: 1.25rem; color: var(--ink-soft); font-size: 1.0625rem; }
.muted { color: var(--ink-soft); }
.small { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-faint); line-height: 1.6; }
.small a { color: var(--ink-faint); }
.small strong { color: var(--ink-soft); }

strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.875em; background: var(--paper-sunk); box-shadow: var(--ring); border-radius: var(--r-sm); padding: 0.1em 0.35em; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0 0; }

/* A note set off by a hairline in the accent — the draft banner, a caveat, a
   disclosure. Never a card. */
.note {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1.75rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.note strong { color: var(--ink); }
.note p { margin-top: 0.75rem; font-family: inherit; }
.note p:first-child { margin-top: 0; }

/* Definition lists carry the question-and-answer sections. */
dt { font-weight: 600; margin-top: 1.75rem; }
dd { margin: 0.5rem 0 0; color: var(--ink-soft); }

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

.hero-title { font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4rem); font-weight: 500; line-height: 1.04; letter-spacing: -0.032em; }
.hero-title .dot { color: var(--accent); }
.hero-lede { margin-top: 1.5rem; font-size: 1.1875rem; line-height: 1.6; color: var(--ink-soft); }

/* Small accent squares rather than bullets — the one place the accent is a
   shape instead of text. */
.marks { list-style: none; padding: 0; margin-top: 2rem; font-family: var(--sans); font-size: 0.9375rem; }
.marks li { display: flex; align-items: baseline; gap: 0.75rem; margin-top: 0.875rem; line-height: 1.5; }
.marks li::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: var(--r-pill);
  transform: translateY(-0.1em);
}

.actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.875rem 1.5rem; margin-top: 2.25rem; }
.action-link {
  font-family: var(--sans);
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 4px;
}
.action-link:hover { text-decoration-color: var(--accent); }

/* ---------- numbered steps ---------- */

.steps { list-style: none; padding: 0; margin-top: 2rem; counter-reset: step; }
.steps > li { counter-increment: step; padding-left: 2.5rem; position: relative; margin-top: 1.75rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--on-cool);
  background: var(--block-cool);
  border-radius: var(--r-pill);
  font-weight: 600;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 { margin-top: 0; }
.steps p { margin-top: 0.5rem; }

/* ---------- panels ---------- */

.panel { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 2rem; }
.panel-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* ---------- worked examples ----------
 * Used where a neutral explanation needs to be shown landing on two different
 * kinds of campaign. A hairline in the rule colour rather than the accent: the
 * accent marks a caveat, this is only an illustration. */

.eg { margin-top: 1.5rem; border-left: 2px solid var(--rule); padding-left: 1rem; }
.eg dt {
  margin-top: 1.125rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.eg dt:first-child { margin-top: 0; }
.eg dd { margin-top: 0.375rem; font-size: 0.9375rem; }

/* ---------- the counter sign mock ----------
 * A plain bordered block, not an image: it stays legible in both themes and
 * needs nothing of img-src beyond 'self' for the example QR.
 *
 * Two of them sit side by side on the home page, because one sign reads as
 * "this is what Give-Kit makes" and two read as "this is what YOUR campaign
 * would make" — which is the argument the page has to win. */

.signs { display: grid; gap: 1.25rem; margin-top: 0.875rem; }
.signs .sign { margin-top: 0; }
.signs .sign-qr { width: 4.5rem; height: 4.5rem; }
.signs .sign-business { font-size: 1.3125rem; }

@media (min-width: 40rem) {
  .signs { grid-template-columns: 1fr 1fr; }
}

.sign {
  margin-top: 0.875rem;
  background: var(--paper-raised);
  box-shadow: var(--ring);
  border-radius: var(--r-card);
  padding: 1.5rem;
  text-align: center;
}
.sign-org { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 0; }
.sign-business { font-size: 1.5rem; line-height: 1.2; margin: 0.625rem 0 0; }
.sign-ask { margin: 0.375rem 0 0; color: var(--ink-soft); font-size: 0.9375rem; }
.sign .meter { margin-top: 1.25rem; }
/* The example QR carries its own white quiet zone. That was originally to stop
   it inverting into light-on-dark noise; with the dark theme gone it still
   earns its place, because a QR without a quiet zone does not reliably scan. */
.sign-qr { margin: 1.25rem auto 0; display: block; width: 5.5rem; height: 5.5rem; }
.sign-scan { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; margin: 0.75rem 0 0; }
.sign-tagline { font-size: 0.9375rem; font-style: italic; color: var(--ink-soft); margin: 1.25rem 0 0; }

/* ---------- progress ---------- */

.meter { margin-top: 1.5rem; }
.meter-track {
  height: 0.75rem;
  background: var(--paper-sunk);
  box-shadow: var(--ring);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.meter-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); }
/* Widths as classes rather than a style="" attribute. An inline style would
   force `style-src 'unsafe-inline'` back into _headers for the sake of two
   numbers on a marketing page, which is a bad trade. */
.w-50 { width: 50%; }
.w-62 { width: 62%; }
.w-71 { width: 71%; }
.meter-caption {
  margin: 0.625rem 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: center;
}
.meter-caption strong { color: var(--ink); font-weight: 600; }

/* ---------- figures ---------- */

.figures { list-style: none; padding: 0; margin-top: 2rem; display: grid; gap: 1.5rem; }
.figures > li { margin: 0; border-top: 1px solid var(--rule); padding-top: 0.875rem; }
.figure-n { display: block; font-size: 1.75rem; line-height: 1.1; color: var(--accent); }
.figure-l { display: block; margin-top: 0.375rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.5; }

@media (min-width: 34rem) {
  .figures { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- the arithmetic block ---------- */

.sum { margin-top: 2rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.25rem 0; }
.sum p { margin: 0.5rem 0 0; font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 1rem; }
.sum p:first-child { margin-top: 0; }
.sum .total { color: var(--ink); font-weight: 600; border-top: 1px solid var(--rule); padding-top: 0.75rem; margin-top: 0.75rem; }

/* ---------- tables ---------- */

table { border-collapse: collapse; width: 100%; margin-top: 1.75rem; font-family: var(--sans); font-size: 0.875rem; }
th, td { text-align: left; padding: 0.625rem 0.75rem 0.625rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); }
caption { text-align: left; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-faint); padding-bottom: 0.5rem; }

/* ---------- the contact block ---------- */

.contact-block { margin-top: 2rem; background: var(--paper-raised); box-shadow: var(--ring); border-radius: var(--r-panel); padding: 1.5rem; }
.contact-block p { margin-top: 0.75rem; }
.contact-block .address { font-size: 1.25rem; margin-top: 0.875rem; word-break: break-word; }

/* ---------- mobile menu ----------
 * A native <details> disclosure. No JavaScript, so nothing for the CSP to
 * allow. Hidden entirely once the full navigation fits. */

.menu { display: none; }
.menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--ink);
  /* A 44px target — the point of the exercise is thumbs. The padding IS the
     target; the offsets below account for it. */
  padding: 0.625rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu svg { width: 1.5rem; height: 1.5rem; display: block; }
.menu .i-close, .menu[open] .i-open { display: none; }
.menu[open] .i-close { display: block; }

.menu-panel {
  display: flex;
  flex-direction: column;
  margin-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.menu-panel a {
  border-bottom: 1px solid var(--rule);
  padding: 0.875rem 0;
  color: var(--ink);
  text-decoration: none;
}
.menu-panel a[aria-current="page"] { color: var(--ink-faint); }
.menu-panel a.button {
  align-self: flex-start;
  margin-top: 1.25rem;
  border-bottom: 0;
  padding: 0.625rem 1.25rem;
  color: var(--accent-on-accent);
}

@media (max-width: 40rem) {
  .site-nav { display: none; }
  .menu { display: block; }
  /* Sit the trigger in the header row at a FIXED top offset. Anchoring it to
     the middle (top: 50%) drifts it downwards as the open panel makes its
     container taller. The offsets subtract the 0.625rem tap padding so the icon
     lines up with the wordmark and the content edge. */
  .menu summary { position: absolute; top: 0.75rem; right: 0.875rem; }
}

/* ---------- house ad ---------- */

.house-ad { border-top: 1px solid var(--rule); }
.house-ad .wrap { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.house-ad-body { margin: 0.75rem 0 0; line-height: 1.6; }
.house-ad-name { font-weight: 600; }
.house-ad-name .dot { color: var(--accent); }
.house-ad-body .muted { color: var(--ink-soft); }
.house-ad-link { margin: 1rem 0 0; font-family: var(--sans); font-size: 0.875rem; }

@media (min-width: 40rem) {
  .house-ad .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; }
  .house-ad-col { flex: 1 1 auto; }
  .house-ad-body { max-width: 32rem; }
  .house-ad-link { margin-top: 0; flex: 0 0 auto; }
}

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-top: 2rem; padding-bottom: 2rem; font-family: var(--sans); font-size: 13px; color: var(--ink-faint); }
.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .grow { flex: 1 1 auto; }

/* ---------- 404 ---------- */

.centred { display: flex; align-items: center; min-height: 60vh; }

@media (max-width: 32rem) {
  h1 { font-size: 1.75rem; }
  .hero-title { font-size: 2rem; }
  main { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .sign { padding: 1.25rem 1rem; }
}
