/* /nonprofit-operations/ — the managed service page.
 *
 * Same palette as the rest of the site (The Ledger, unchanged) and the same band rhythm as
 * /consultants/: alternating light and dark full-width sections, mono for anything that is a label
 * or a number, Archivo for anything that carries an argument.
 *
 * What is specific to this page is the catalogue: ten <details> areas holding 198 lines of work. It
 * has to survive being long. Open one and the others close, the count sits in the summary so the
 * scale is visible before anything is opened, and the whole thing works with JavaScript blocked,
 * because <details> is not scripted here.
 *
 * Cyrillic: Archivo has no Cyrillic subset at all, so Russian is set in system-ui. All three
 * languages are the same size; the html[lang] rules at the end only widen the wrap, they never
 * shrink the type. See the note above those rules for why.
 */

:root {
  --bg: #FFFFFF; --dim: #F4F6F3;
  --ink: #0B0F0A; --variant: #4A5247; --muted: #5A6457;
  --outline: #E2E6DF; --outline-2: #C8CEC6;
  --primary: #155138; --on-primary: #FFFFFF; --primary-c: #E8EFE4;
  --highlight: #FAC700; --on-highlight: #0B0F0A;
  --deep: #0B0F0A; --deep-2: #18231C;
  --on-deep: #FFFFFF; --on-deep-variant: #A9BBAC;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 30px;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 40px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 40px; }

.band { padding: 88px 0; }
.band-dim { background: var(--dim); }
.band-dark { background: var(--deep); color: var(--on-deep); }
.band-dark h2 { color: var(--on-deep); }

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600; line-height: 14px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary);
  margin: 0 0 14px;
}
.band-dark .eyebrow { color: var(--highlight); }

h2 {
  font-size: 42px; font-weight: 800; line-height: 46px; letter-spacing: -0.02em;
  margin: 0 0 18px; max-width: 20ch;
}
.sub { font-size: 17px; line-height: 28px; color: var(--variant); margin: 0 0 34px; max-width: 62ch; }
.band-dark .sub { color: var(--on-deep-variant); }
.prose p { font-size: 17px; line-height: 29px; color: var(--variant); margin: 0 0 18px; }

/* ------------------------------------------------------------------ header and language */

.top {
  max-width: 1060px; margin: 0 auto 64px; padding: 26px 40px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--on-deep); text-decoration: none;
}
/* The switch sat here for a while and readers did not see it. Two changes: the inactive buttons
 * carry a border people can actually make out, and a handwritten note points at them. The note is
 * the part that does the work; the border is what stops it being needed twice.
 */
.lang-wrap { position: relative; }
.langs { display: flex; gap: 2px; }
.langs button {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  padding: 7px 11px; border: 1px solid rgba(255,255,255,0.42); background: transparent;
  color: #D6DED7; cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.langs button:hover { color: var(--on-deep); border-color: rgba(255,255,255,0.8); }
.langs button:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.langs button[aria-pressed="true"] { background: var(--highlight); color: var(--on-highlight); border-color: var(--highlight); }

/* Absolute, so the note never changes the height of the header and never moves the headline under
 * it. It is decorative and carries aria-hidden in the markup; the nav above it is the real control.
 */
.lang-note {
  position: absolute; top: 100%; right: 52px; margin: 18px 0 0;
  display: flex; align-items: flex-start; gap: 4px; white-space: nowrap;
  font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
  font-size: 23px; font-weight: 600; line-height: 1;
  color: var(--highlight); pointer-events: none;
}
.lang-note svg { width: 50px; height: 44px; margin-top: -12px; flex: none; }

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

.hero { padding: 0 0 0; }
.hero-in { max-width: 1060px; margin: 0 auto; padding: 0 40px 64px; }
.hero h1 {
  font-size: 88px; font-weight: 800; line-height: 86px; letter-spacing: -0.03em;
  margin: 0 0 28px; max-width: 16ch;
}
.hero h1 em { font-style: normal; color: var(--highlight); display: block; }
.lede { font-size: 20px; line-height: 32px; color: var(--on-deep-variant); margin: 0 0 26px; max-width: 58ch; }
.boundary {
  font-size: 19px; line-height: 29px; font-weight: 700; color: var(--on-deep);
  border-left: 3px solid var(--highlight); padding: 2px 0 2px 18px; margin: 0 0 34px; max-width: 46ch;
}

.btn {
  display: inline-block; font-size: 15px; font-weight: 600; line-height: 1;
  padding: 16px 28px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 3px 0 #000; transition: box-shadow 120ms ease, transform 120ms ease;
}
.btn-hi { background: var(--highlight); color: var(--on-highlight); }
.btn:hover { box-shadow: 0 5px 0 #000; transform: translateY(-2px); }
.cta-row { margin: 0; }

.scale {
  list-style: none; margin: 0; padding: 30px 40px 40px; max-width: 1060px;
  margin-inline: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  border-top: 1px solid rgba(255,255,255,0.14);
}
.scale li { display: flex; flex-direction: column; gap: 6px; }
.scale b {
  font-family: var(--mono); font-size: 40px; font-weight: 600; line-height: 1;
  color: var(--highlight); letter-spacing: -0.02em;
}
.scale span { font-size: 15px; line-height: 23px; color: var(--on-deep-variant); }

/* ------------------------------------------------------------------ the catalogue */

.areas { border-top: 1px solid var(--outline-2); }

.area { border-bottom: 1px solid var(--outline-2); }
.area summary {
  display: flex; align-items: baseline; gap: 18px; cursor: pointer;
  padding: 26px 4px; list-style: none;
}
.area summary::-webkit-details-marker { display: none; }
.area summary:hover .area-t { color: var(--primary); }
.area summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.area-n {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--muted); flex: 0 0 auto; padding-top: 6px;
}
.area-t {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 34px;
  flex: 1 1 auto; transition: color 120ms ease;
}
.area-c {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); flex: 0 0 auto; white-space: nowrap;
}
.area-c b { font-size: 17px; color: var(--primary); letter-spacing: -0.01em; }
/* The chevron is drawn rather than typed, so it never becomes a character the translation has to carry. */
.area-c::after {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 14px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 200ms ease;
}
.area[open] .area-c::after { transform: rotate(-135deg) translate(-3px, -3px); }
.area[open] .area-t { color: var(--primary); }

.area-body { padding: 0 4px 40px; display: grid; gap: 34px; }
.grp { border-left: 2px solid var(--primary-c); padding-left: 22px; }
.grp-h { font-size: 19px; font-weight: 700; line-height: 25px; margin: 0 0 8px; }
.grp-why { font-size: 15px; line-height: 25px; color: var(--muted); margin: 0 0 16px; max-width: 64ch; }
.grp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.grp-list li {
  position: relative; padding-left: 22px; font-size: 16px; line-height: 26px; color: var(--variant);
  max-width: 72ch;
}
.grp-list li::before {
  content: ''; position: absolute; left: 0; top: 11px; width: 9px; height: 2px; background: var(--primary);
}

/* ------------------------------------------------------------------ the boundary */

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.two h2 { font-size: 32px; line-height: 37px; }
.crossed, .kept { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.crossed li, .kept li {
  position: relative; padding-left: 28px; font-size: 16px; line-height: 26px; color: var(--variant);
}
.crossed li::before {
  content: ''; position: absolute; left: 0; top: 12px; width: 13px; height: 2px;
  background: var(--muted); transform: rotate(-20deg);
}
.kept li::before {
  content: ''; position: absolute; left: 1px; top: 8px; width: 8px; height: 8px;
  border: 2px solid var(--primary);
}

/* ------------------------------------------------------------------ how it runs */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.step { border-top: 2px solid var(--ink); padding-top: 16px; }
.step-n { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--primary); margin: 0 0 12px; }
.step-h { font-size: 18px; font-weight: 700; line-height: 25px; margin: 0 0 10px; }
.step-t { font-size: 15px; line-height: 25px; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------------ tiers */

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tier { background: var(--dim); padding: 28px; box-shadow: 6px 6px 0 var(--ink); }
.tier-n {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary); margin: 0 0 14px;
}
.tier-t { font-size: 16px; line-height: 26px; color: var(--variant); margin: 0; }

/* ------------------------------------------------------------------ close */

.close { padding-bottom: 0; }
.close h2 { max-width: 18ch; }
.close .cta-row { margin: 0 0 22px; }
.fine { font-family: var(--mono); font-size: 11px; line-height: 18px; letter-spacing: 0.06em; color: var(--on-deep-variant); margin: 0; }
.foot {
  max-width: 1060px; margin: 64px auto 0; padding: 22px 40px 30px;
  border-top: 1px solid rgba(255,255,255,0.14); display: flex; gap: 24px;
}
.foot a {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--on-deep-variant); text-decoration: none;
}
.foot a:hover { color: var(--highlight); }

/* ------------------------------------------------------------------ other languages
 *
 * All three languages are set at the same size. The first version stepped Spanish down to 72px and
 * Russian to 62px against English's 88px, on the theory that Spanish runs longer and Russian falls
 * back to system-ui, which is wider. Side by side the Russian headline simply read as a smaller,
 * weaker page, which is not a trade worth making on the one line that has to land. Both fit at full
 * size in the same three lines English uses; what they need is a little more room to wrap in, and
 * that is all these rules now give them.
 *
 * Archivo has no Cyrillic at all: the css2 endpoint serves it as latin, latin-ext and vietnamese
 * only. Russian headlines are therefore set in whatever system-ui resolves to. That is a real
 * difference in letterforms between the languages and it is accepted here, because the alternative
 * is carrying a second display face for one language.
 */

html[lang="es"] .hero h1 { max-width: 19ch; }
html[lang="ru"] .hero h1 { max-width: 20ch; }
html[lang="es"] h2, html[lang="ru"] h2 { max-width: 23ch; }
html[lang="ru"] .boundary, html[lang="es"] .boundary { max-width: 54ch; }

/* ------------------------------------------------------------------ narrow screens */

@media (max-width: 900px) {
  .two, .steps, .tiers { grid-template-columns: 1fr; }
  .steps { gap: 24px; }
  .hero h1 { font-size: 56px; line-height: 58px; }
  h2 { font-size: 34px; line-height: 38px; }
  .scale { grid-template-columns: 1fr; gap: 20px; }
  .scale b { font-size: 34px; }
}

@media (max-width: 640px) {
  body { font-size: 17px; line-height: 28px; }
  .wrap, .wrap-narrow, .hero-in, .scale, .top, .foot { padding-left: 16px; padding-right: 16px; }
  /* The note is absolute, so it does not push the header down: the room for it has to be made here,
   * or it lands on the eyebrow underneath. */
  .top { margin-bottom: 96px; }
  .lang-note { font-size: 19px; right: 36px; margin-top: 14px; }
  .lang-note svg { width: 40px; height: 35px; margin-top: -9px; }
  .band { padding: 56px 0; }
  .hero h1 { font-size: 40px; line-height: 43px; }
  .lede { font-size: 18px; line-height: 29px; }
  h2 { font-size: 27px; line-height: 32px; }
  /* The count moves under the title rather than being squeezed against it. */
  .area summary { flex-wrap: wrap; gap: 10px 14px; padding: 20px 0; }
  .area-t { font-size: 22px; line-height: 27px; flex: 1 1 100%; order: 2; }
  .area-n { order: 1; padding-top: 0; }
  .area-c { order: 3; flex: 1 1 100%; }
  .area-c::after { float: right; margin-top: 3px; }
  .grp { padding-left: 14px; }
  .area-body { padding-bottom: 28px; }
  .tier { box-shadow: 4px 4px 0 var(--ink); padding: 22px; }
}
