/* ============================================================
   Bookkeeping Etc., Inc. (BE4tax)
   Design system — "institutional editorial"
   Palette derived from the logo: Old Glory Blue + Old Glory Red
   ============================================================ */

:root {
  /* Brand */
  --navy:        #0A3161;
  --navy-deep:   #071F3E;
  --navy-ink:    #051529;
  --crimson:     #B31942;
  --crimson-dk:  #8E0F33;

  /* Paper & neutrals */
  --paper:       #F6F4EF;
  --paper-2:     #EFEBE3;
  --white:       #FFFFFF;
  --rule:        #D6D0C4;
  --rule-soft:   #E5E0D6;
  --slate:       #4A5A66;
  --muted:       #63707C;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans:  "Public Sans", "Helvetica Neue", Helvetica, sans-serif;

  /* Metrics */
  --wrap: 1180px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --hair: 1px solid var(--rule);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy-ink);
  font-family: var(--sans);
  /* rem, not px, so the large-screen tiers below scale body copy along with
     everything else rather than leaving it stranded at 17px. */
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Ledger texture — hairline rules, like accounting paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(10, 49, 97, 0.045) 0 1px,
    transparent 1px 34px
  );
  opacity: .9;
}
body > * { position: relative; z-index: 1; }

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

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--crimson); }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.06;
  margin: 0 0 .6em;
  color: var(--navy-ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.05rem); }
h2 { font-size: clamp(1.95rem, 3.9vw, 3rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.2; }
h4 { font-size: 1.06rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.1em; }
.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.32rem);
  line-height: 1.55;
  color: var(--slate);
  max-width: 62ch;
}
em, .it { font-family: var(--serif); font-style: italic; }

/* Eyebrow / section marker */
.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--crimson);
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.4rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 120px;
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::after, .eyebrow.bare::after { display: none; }

.num {
  font-family: var(--sans);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--crimson);
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.section + .section { border-top: var(--hair); }
.section.tight { padding: clamp(2.5rem, 4vw, 4rem) 0; }
.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.75rem); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.split.rev { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.stack-sm > * + * { margin-top: .55rem; }

/* ---------- Header ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 239, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: var(--hair);
}
.masthead__bar {
  max-width: var(--wrap); margin: 0 auto; padding: .85rem var(--gut);
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 42px; width: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(.8rem, 1.9vw, 1.7rem); }
.nav a {
  font-size: .875rem; font-weight: 600; color: var(--navy-ink);
  text-decoration: none; padding: .3rem 0; position: relative; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--crimson); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--navy); }
.nav .btn::after { display: none; }

/* Buttons in the nav keep their own colors — `.nav a` outranks `.btn` on
   specificity and would otherwise paint the CTA label navy on crimson. */
.nav a.btn, .nav a.btn:hover { color: var(--white); }

/* Header CTA: compact, with a solid bottom edge that depresses on click. */
.masthead .btn {
  padding: .66rem 1.2rem;
  font-size: .79rem;
  letter-spacing: .085em;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
}
.masthead .btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .24), 0 5px 14px rgba(179, 25, 66, .3);
}
.masthead .btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .24);
}

/* Visible keyboard focus, since the CTA is the primary action on every page. */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.band a:focus-visible, .cta a:focus-visible, .pagehead a:focus-visible, .foot a:focus-visible {
  outline-color: #fff;
}
.nav-toggle {
  display: none; margin-left: auto; background: none; border: var(--hair);
  padding: .5rem .7rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
  color: var(--navy-ink); letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-size: .87rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .82rem 1.4rem; border: 1px solid var(--crimson);
  background: var(--crimson); color: var(--white);
  text-decoration: none; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--crimson-dk); border-color: var(--crimson-dk); color: var(--white); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--onnavy { background: var(--white); border-color: var(--white); color: var(--navy); }
.btn--onnavy:hover { background: var(--crimson); border-color: var(--crimson); color: var(--white); }
.btn--wire { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.btn--wire:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.9rem; }

.arrow-link {
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); text-decoration: none; display: inline-flex; align-items: center; gap: .45rem;
  border-bottom: 1px solid var(--rule); padding-bottom: .3rem;
}
.arrow-link span { transition: transform .2s ease; }
.arrow-link:hover { color: var(--crimson); border-color: var(--crimson); }
.arrow-link:hover span { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 4.5vw, 4rem) 0 0; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.1rem; }
.hero h1 .accent { color: var(--crimson); font-style: italic; }
.reveal { opacity: 0; transform: translateY(14px); animation: rise .85s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal:nth-child(1) { animation-delay: .05s; }
.reveal:nth-child(2) { animation-delay: .16s; }
.reveal:nth-child(3) { animation-delay: .27s; }
.reveal:nth-child(4) { animation-delay: .38s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Ledger card — the hero's right-hand object */
.ledger {
  background: var(--white);
  border: 1px solid var(--rule);
  box-shadow: 14px 14px 0 rgba(10, 49, 97, .08);
}
.band .ledger { border-color: rgba(255,255,255,.25); box-shadow: 14px 14px 0 rgba(0, 0, 0, .18); }
.ledger__head {
  background: var(--navy); color: #fff; padding: .9rem 1.25rem;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.ledger__head span:first-child {
  font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.ledger__head span:last-child { font-family: var(--serif); font-style: italic; font-size: .92rem; opacity: .8; }
.ledger__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.25rem; border-bottom: 1px dashed var(--rule-soft);
}
.ledger__row:last-child { border-bottom: 0; }
.ledger__row dt { font-size: .92rem; color: var(--slate); margin: 0; }
.ledger__row dd {
  margin: 0; font-family: var(--serif); font-size: 1.72rem; font-weight: 600;
  color: var(--navy); line-height: 1; letter-spacing: -.02em;
}
.ledger__row dd small { font-size: .74rem; font-family: var(--sans); font-weight: 700; letter-spacing: .05em; color: var(--crimson); display: block; margin-top: .3rem; text-transform: uppercase; }
.ledger__foot { padding: .85rem 1.25rem; background: var(--paper-2); font-size: .8rem; color: var(--muted); }

/* Hero art — image slot with a proof strip under it. Replace .heroart__ph with
   an <img>; the frame crops to a consistent shape either way. */
.heroart { }
.heroart__frame {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  box-shadow: 14px 14px 0 rgba(10, 49, 97, .08);
  overflow: hidden;
}
.heroart__frame img { width: 100%; height: 100%; object-fit: cover; }
.heroart__ph {
  height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: .5rem; text-align: center; padding: 1.5rem;
  background-image:
    repeating-linear-gradient(135deg, rgba(10,49,97,.05) 0 10px, transparent 10px 20px);
}
.heroart__ph span {
  font-size: .72rem; font-weight: 700; letter-spacing: .17em;
  text-transform: uppercase; color: var(--crimson);
}
.heroart__ph p { margin: 0; font-size: .88rem; color: var(--muted); max-width: 26ch; }
.heroart__proof {
  display: flex; flex-wrap: wrap; gap: 0 1.6rem;
  margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--rule);
}
.heroart__proof span { font-size: .88rem; color: var(--slate); }
.heroart__proof b {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--navy); letter-spacing: -.02em; margin-right: .3rem;
}

/* Bio portrait — 4:5, framed to match the hero */
.portrait {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 14px 14px 0 rgba(10, 49, 97, .08);
}
/* Same frame on a navy surface needs the light border instead */
.band .portrait, .pagehead .portrait {
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 14px 14px 0 rgba(0, 0, 0, .18);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

/* ---------- Assurance strip (navy band) ---------- */
.band { background: var(--navy); color: #fff; }
.band--deep { background: var(--navy-deep); }
.band h2, .band h3, .band h4 { color: #fff; }
.band .lede { color: rgba(255,255,255,.78); }
.band-inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(2.2rem, 4vw, 3.2rem) var(--gut); }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.pillar { padding: 0 clamp(1rem, 2vw, 1.9rem); border-left: 1px solid rgba(255,255,255,.18); }
.pillar:first-child { padding-left: 0; border-left: 0; }
.pillar h4 { font-size: .95rem; margin: 0 0 .45rem; letter-spacing: .01em; }
.pillar p { font-size: .89rem; color: rgba(255,255,255,.72); margin: 0; line-height: 1.55; }
.pillar .ico { display: block; margin-bottom: .8rem; }
.pillar .ico svg { width: 26px; height: 26px; stroke: #fff; opacity: .85; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--rule);
  padding: clamp(1.4rem, 2.2vw, 1.9rem);
  display: flex; flex-direction: column;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.card:hover { border-color: var(--navy); box-shadow: 10px 10px 0 rgba(10,49,97,.07); transform: translateY(-2px); }
.card__ico { margin-bottom: 1rem; }
.card__ico svg { width: 30px; height: 30px; stroke: var(--crimson); }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .95rem; color: var(--slate); margin-bottom: 1.1rem; }
.card .arrow-link { margin-top: auto; align-self: flex-start; }
/* .card is a flex column, so buttons would stretch full width without this. */
.card .btn { align-self: flex-start; }
.card--flag { border-top: 4px solid var(--crimson); }
.card--quiet { background: transparent; }

/* Numbered list of services */
.rows { border-top: var(--hair); }
.row {
  display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 2.6vw, 2.1rem) 0;
  border-bottom: var(--hair);
  align-items: start;
}
.row:hover { background: rgba(255,255,255,.55); }
.row h3 { margin: 0; }
.row p { margin: 0; font-size: .96rem; color: var(--slate); }
.row ul { margin: .7rem 0 0; padding-left: 1.1rem; font-size: .92rem; color: var(--slate); }
.row ul li { margin-bottom: .25rem; }

/* Checklist */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 2rem; margin-bottom: .85rem; font-size: .97rem; color: var(--slate); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .38em; width: 13px; height: 8px;
  border-left: 2.5px solid var(--crimson); border-bottom: 2.5px solid var(--crimson);
  transform: rotate(-45deg);
}
.checks strong { color: var(--navy-ink); display: block; font-size: 1rem; }
/* Checklists on any dark surface, not just .band. Scoping this to .band alone
   left the closing CTA rendering navy-ink headings on a navy background. */
.band .checks li, .cta .checks li, .pagehead .checks li { color: rgba(255,255,255,.76); }
.band .checks strong, .cta .checks strong, .pagehead .checks strong { color: #fff; }
.band .checks li::before, .cta .checks li::before, .pagehead .checks li::before { border-color: #fff; }

/* Contact details list — icon + label + value, no checkmark bullets */
.contactlist { list-style: none; margin: .4rem 0 0; padding: 0; }
.contactlist li { display: grid; grid-template-columns: 1.7rem 1fr; gap: .9rem; padding: .7rem 0; border-bottom: 1px dashed var(--rule-soft); }
.contactlist li:last-child { border-bottom: 0; padding-bottom: 0; }
.contactlist svg { width: 20px; height: 20px; stroke: var(--crimson); fill: none; margin-top: .2rem; }
.contactlist b { display: block; font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--navy); margin-bottom: .2rem; }
.contactlist span { font-size: .96rem; color: var(--slate); }

/* Stat row */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.stat { padding: 0 clamp(1rem, 2vw, 2rem); border-left: 1px solid rgba(255,255,255,.2); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.stat span { display: block; margin-top: .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.62); }

/* Pull quote */
.pull {
  border-left: 3px solid var(--crimson);
  padding: .4rem 0 .4rem 1.6rem;
  font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.3; letter-spacing: -.015em; color: var(--navy);
  max-width: 40ch;
}
.pull cite { display: block; margin-top: 1rem; font-family: var(--sans); font-style: normal; font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }

/* Two-column compare (fiscal vs program) */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1rem, 2.5vw, 2rem); align-items: stretch; }
.compare__col { background: var(--white); border: 1px solid var(--rule); padding: clamp(1.3rem, 2vw, 1.8rem); }
.compare__col h4 { color: var(--navy); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .9rem; }
.compare__col ul { margin: 0; padding-left: 1.1rem; font-size: .93rem; color: var(--slate); }
.compare__col li { margin-bottom: .4rem; }
.compare__seam { display: grid; place-items: center; }
.compare__seam span {
  width: 42px; height: 42px; border-radius: 50%; background: var(--crimson); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
}
.compare + .compare-out {
  margin-top: 1.25rem; background: var(--navy); color: #fff;
  padding: 1.1rem clamp(1.3rem, 2vw, 1.8rem); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.compare-out strong { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.compare-out p { margin: 0; font-family: var(--serif); font-size: 1.18rem; }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.tl li { position: relative; padding: 0 0 1.9rem 1.9rem; }
.tl li::before {
  content: ""; position: absolute; left: -7px; top: .42em; width: 12px; height: 12px;
  background: var(--crimson); border: 2px solid var(--paper);
}
.tl h4 { margin: 0 0 .2rem; }
.tl p { margin: 0; font-size: .94rem; color: var(--slate); }
.tl .when { font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--crimson); display: block; margin-bottom: .35rem; }

/* ---------- Page header ---------- */
.pagehead { background: var(--navy); color: #fff; padding: clamp(3rem, 6vw, 5rem) 0 clamp(2.6rem, 5vw, 4rem); position: relative; overflow: hidden; }
.pagehead::after {
  content: ""; position: absolute; right: -8%; top: -40%; width: 46%; height: 190%;
  background: linear-gradient(135deg, rgba(179,25,66,.28), rgba(179,25,66,0) 62%);
  transform: rotate(14deg); pointer-events: none; z-index: 0;
}
/* Keep the headline above the decorative wash so type never tints. */
.pagehead .wrap { position: relative; z-index: 1; }
.pagehead h1 { color: #fff; max-width: 22ch; }
.pagehead .lede { color: rgba(255,255,255,.8); }
.pagehead .eyebrow { color: rgba(255,255,255,.7); }
.pagehead .eyebrow::after { background: rgba(255,255,255,.28); }
.crumbs { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 1.6rem; }
.crumbs a { color: rgba(255,255,255,.8); text-decoration: none; }
.crumbs a:hover { color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.05rem; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .76rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--navy); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .97rem; padding: .78rem .9rem;
  border: 1px solid var(--rule); background: var(--white); color: var(--navy-ink);
  border-radius: 0; width: 100%;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,49,97,.12);
}
.field .hint { font-size: .82rem; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
.checkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .9rem; }
.checkgrid label { display: flex; gap: .55rem; align-items: flex-start; font-size: .93rem; color: var(--slate); text-transform: none; letter-spacing: 0; font-weight: 400; }
.checkgrid input { width: auto; accent-color: var(--crimson); margin-top: .28rem; }
.formnote { font-size: .84rem; color: var(--muted); }

/* ---------- Success modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 21, 41, .62);
  backdrop-filter: blur(3px);
  animation: modalFade .2s ease forwards;
}
.modal__panel {
  position: relative;
  width: 100%; max-width: 40rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--navy);
  border-top: 4px solid var(--crimson);
  box-shadow: 0 30px 70px -20px rgba(5, 21, 41, .55);
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  animation: modalIn .28s cubic-bezier(.2, .7, .2, 1) forwards;
}
.modal__panel--sm { max-width: 32rem; }
.modal__panel h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .4rem; }
.modal__panel .lede { font-size: 1.05rem; margin-bottom: .6rem; }
.modal__panel .btn-row { margin-top: 1.6rem; }
.modal__x {
  position: absolute; top: .55rem; right: .55rem;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 1.5rem; line-height: 1;
  background: none; border: 0; cursor: pointer;
  color: var(--muted);
}
.modal__x:hover { color: var(--crimson); }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal__backdrop, .modal__panel { animation: none; }
}
body.modal-open { overflow: hidden; }

/* ---------- Self-check widget ---------- */
.selfcheck { background: var(--white); border: 1px solid var(--rule); box-shadow: 14px 14px 0 rgba(10,49,97,.07); }
.selfcheck__head { background: var(--navy); color: #fff; padding: 1.1rem 1.4rem; }
.selfcheck__head h3 { color: #fff; margin: 0 0 .2rem; }
.selfcheck__head p { margin: 0; font-size: .88rem; color: rgba(255,255,255,.72); }
.selfcheck__body { padding: .4rem 1.4rem 1.4rem; }
.q { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px dashed var(--rule-soft); cursor: pointer; font-size: .96rem; color: var(--slate); }
.q input { accent-color: var(--crimson); margin-top: .32rem; width: auto; }
.q:hover { color: var(--navy-ink); }
/* The score pins to the bottom of the viewport while the list scrolls past, so
   the result is visible from the first checkbox rather than only at the end. */
.score {
  position: sticky; bottom: 0; z-index: 2;
  padding: 1.2rem 1.4rem; background: var(--paper-2);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -8px 18px -12px rgba(10, 49, 97, .35);
}
.score__bar { height: 8px; background: var(--rule); margin: .7rem 0 .9rem; }
.score__fill { height: 100%; width: 0; background: var(--crimson); transition: width .45s cubic-bezier(.2,.7,.2,1); }
.score b { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); }
.score p { margin: 0; font-size: .92rem; color: var(--slate); }

/* Self-check: keep the intro and its CTA in view while the list is scrolled.
   Only above 1000px, where .split is still two columns. */
@media (min-width: 1001px) {
  .sticky-col { position: sticky; top: 6.5rem; }
}

/* Self-check result carried onto the contact page */
.prefill {
  border: 1px solid var(--navy); border-left: 4px solid var(--crimson);
  background: var(--white); padding: 1.1rem 1.3rem; margin-bottom: 1.5rem;
}
.prefill h4 { margin: 0 0 .35rem; }
.prefill p { margin: 0 0 .5rem; font-size: .94rem; color: var(--slate); }
.prefill ul { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .92rem; color: var(--slate); }
.prefill li { margin-bottom: .2rem; }
.prefill .score-chip {
  display: inline-block; font-family: var(--serif); font-size: 1.15rem;
  color: var(--navy); font-weight: 600;
}
.prefill button {
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; background: none; border: 0; padding: 0;
  color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: .8rem;
}
.prefill button:hover { color: var(--crimson); }

/* ---------- CTA block ---------- */
.cta { background: var(--navy-deep); color: #fff; position: relative; overflow: hidden; }
.cta::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--crimson) 0 33%, #fff 33% 66%, var(--navy) 66% 100%);
  opacity: .85;
}
.cta__inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(3rem, 6vw, 4.6rem) var(--gut); display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.cta h2 { color: #fff; margin-bottom: .5rem; }
.cta p { color: rgba(255,255,255,.78); margin: 0; }

/* ---------- Footer ---------- */
.foot { background: var(--navy-ink); color: rgba(255,255,255,.7); font-size: .9rem; }
.foot__inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(2.6rem, 5vw, 3.6rem) var(--gut) 1.6rem; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: clamp(1.5rem, 3vw, 2.5rem); }
.foot h4 { color: #fff; font-size: .74rem; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 1rem; }
.foot a { color: rgba(255,255,255,.7); text-decoration: none; }
.foot a:hover { color: #fff; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .5rem; }
.foot__mark { font-family: var(--serif); font-size: 1.5rem; color: #fff; letter-spacing: -.02em; margin: 0 0 .1rem; }
.foot__mark b { font-family: var(--sans); font-weight: 800; letter-spacing: -.01em; }
.foot__mark i { color: var(--crimson); font-style: italic; }
.foot__tag { font-size: .84rem; color: rgba(255,255,255,.5); margin-bottom: 1.1rem; }
.foot__bar { border-top: 1px solid rgba(255,255,255,.14); max-width: var(--wrap); margin: 0 auto; padding: 1.2rem var(--gut) 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: rgba(255,255,255,.45); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1rem; } .mt2 { margin-top: 2rem; } .mt3 { margin-top: 3rem; }
.maxch { max-width: 66ch; }
.small { font-size: .88rem; color: var(--muted); }
.tagpill {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; padding: .3rem .6rem; border: 1px solid var(--rule);
  color: var(--navy); background: var(--white); margin: 0 .35rem .35rem 0;
}
.band .tagpill { border-color: rgba(255,255,255,.3); background: transparent; color: rgba(255,255,255,.85); }

/* ---------- Responsive ---------- */

/* Large screens. Every clamp() in this file tops out around a 1280px viewport,
   so without these tiers a 1920px monitor shows the same type inside the same
   1180px column — 370px of dead gutter on each side, reading as "zoomed out".
   Scaling the root font size lifts every rem-based size and space at once, and
   widening --wrap keeps the measure in proportion. */
@media (min-width: 1400px) {
  :root { --wrap: 1280px; }
  html { font-size: 17px; }
}
@media (min-width: 1650px) {
  :root { --wrap: 1360px; }
  html { font-size: 18px; }
}
@media (min-width: 1900px) {
  :root { --wrap: 1460px; }
  html { font-size: 19px; }
}
@media (min-width: 2300px) {
  :root { --wrap: 1620px; }
  html { font-size: 20.5px; }
}

@media (max-width: 1000px) {
  .hero__grid, .split, .split.rev, .cta__inner { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 0; }
  .pillar:nth-child(3) { padding-left: 0; border-left: 0; }
  .foot__inner { grid-template-columns: 1fr 1fr; }
}
/* Six full-word nav labels plus the CTA need breathing room; tighten before
   they can collide, then collapse to the hamburger rather than wrapping. */
@media (max-width: 1200px) {
  .nav { gap: clamp(.7rem, 1.25vw, 1.15rem); }
  .nav a { font-size: .83rem; }
  .masthead .btn { padding: .6rem .95rem; font-size: .74rem; letter-spacing: .06em; }
}
@media (max-width: 1080px) {
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: var(--hair);
    flex-direction: column; align-items: stretch; padding: 1rem var(--gut) 1.5rem; gap: .2rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--rule-soft); font-size: 1rem; }
  /* The collapsed menu's CTA inherits the compact desktop padding; restore a
     full-size tap target now that it is a full-width row. */
  .nav .btn,
  .masthead .btn { justify-content: center; margin-top: .8rem; border-bottom: 0;
    padding: 1rem 1.2rem; font-size: .82rem; letter-spacing: .08em; }
  .nav-toggle { padding: .7rem .9rem; }
  .nav-toggle { display: block; }
  .masthead { position: relative; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }

  /* Thumb targets. Footer links and inline "Details" links were 17–18px tall;
     padding lifts them toward the 44px guideline without changing the look. */
  .foot li { margin-bottom: 0; }
  .foot ul a { display: inline-block; padding: .6rem 0; }
  .checks a, .contactlist a, .arrow-link { display: inline-block; padding: .3rem 0; }
  .crumbs a, .foot__bar a { display: inline-block; padding: .35rem 0; }

  /* Primary actions get a larger label and a taller hit area on small screens. */
  .btn { font-size: .82rem; padding: .95rem 1.35rem; }
  .tagpill { font-size: .74rem; padding: .4rem .7rem; }
  .eyebrow { font-size: .78rem; }
  .q { padding: 1rem 0; }
  /* The wrapping label is already a large target; this is about visibility. */
  .q input, .checkgrid input { width: 18px; height: 18px; }
  .g2, .g3, .g4, .field-row, .checkgrid, .stats { grid-template-columns: 1fr; }
  .stat { padding: 1.2rem 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .stat:first-child { padding-top: 0; border-top: 0; }
  .row { grid-template-columns: 1fr; gap: .6rem; }
  .row > .num { margin-bottom: -.4rem; }
  .compare { grid-template-columns: 1fr; }
  .compare__seam span { margin: .2rem 0; }
  .foot__inner { grid-template-columns: 1fr; }
  .ledger { box-shadow: 8px 8px 0 rgba(10,49,97,.08); }
}

/* ---------- Self-check funding picker ----------
   Federal, state, and philanthropic awards are held to different standards, so
   the question list is filtered rather than showing items that cannot apply.
   Without this, a foundation-funded org would score badly on procurement and
   subrecipient questions that were never relevant to them. */
.fundpick {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 1rem 1.4rem 0;
}
.fundpick__btn {
  font: inherit; font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .6rem 1rem; cursor: pointer;
  background: transparent; color: var(--navy);
  border: 1px solid var(--rule);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.fundpick__btn:hover { border-color: var(--navy); }
.fundpick__btn[aria-pressed="true"] {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.fundpick__hint { margin: .9rem 0 .2rem; font-size: .92rem; color: var(--muted); }
.selfcheck .q[hidden] { display: none; }

@media (max-width: 720px) {
  .fundpick { padding: .9rem 1.1rem 0; }
  .fundpick__btn { flex: 1 1 auto; text-align: center; padding: .7rem .8rem; }
}

/* The self-check CTA lives inside the sticky score block, so the invitation is
   next to the result rather than stranded in a column the reader has scrolled
   past. Hidden until a funding type is chosen. */
.score__cta { width: 100%; justify-content: center; margin-top: .9rem; }
.score__cta[hidden] { display: none; }
@media (max-width: 720px) {
  /* The button matters more than the explanation in a sticky bar, so the note
     is clamped to two lines. Otherwise the block ate a third of the screen. */
  .score { padding: .8rem 1.1rem .9rem; }
  .score b { font-size: 1.12rem; }
  .score__bar { margin: .5rem 0 .6rem; }
  .score p[data-score-note] {
    font-size: .84rem; line-height: 1.4; margin-bottom: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .score__cta {
    margin-top: .7rem; padding: .75rem .7rem;
    font-size: .74rem; letter-spacing: .04em;
  }
}

/* ---------- FAQ (Resources) ----------
   Native <details> so the answers are in the HTML for search engines and work
   with no JavaScript at all. */
.faq { border-top: var(--hair); }
.faq__item { border-bottom: var(--hair); }
.faq__item summary {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.15rem 0; cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.3; letter-spacing: -.012em; color: var(--navy-ink);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; flex: 0 0 auto; margin-left: auto; margin-top: .45em;
  width: 10px; height: 10px;
  border-right: 2px solid var(--crimson); border-bottom: 2px solid var(--crimson);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__item summary:hover { color: var(--navy); }
.faq__item summary:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.faq__a { padding: 0 3rem 1.3rem 0; max-width: 72ch; }
.faq__a p { margin: 0; color: var(--slate); }
.faq__note {
  margin-top: 1.6rem; padding-top: 1rem; border-top: var(--hair);
  font-size: .86rem; color: var(--muted); max-width: 78ch;
}
@media (prefers-reduced-motion: reduce) {
  .faq__item summary::after { transition: none; }
}
@media (max-width: 720px) {
  .faq__item summary { padding: 1rem 0; gap: .7rem; }
  .faq__a { padding: 0 0 1.1rem; }
}

/* ---------- Contact form card ----------
   Modelled on the My Command Center pattern: one centred card with a capped
   width, stacked fields, full-width submit. Replaces the old full-width
   two-column layout, which sprawled down the page. */
.formcard {
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--crimson);
  box-shadow: 0 24px 50px -32px rgba(5, 21, 41, .28);
  padding: clamp(1.6rem, 3.5vw, 2.6rem);
}
.formcard__head { text-align: center; margin-bottom: 1.6rem; }
.formcard__head h2 { font-size: clamp(1.7rem, 2.8vw, 2.2rem); margin-bottom: .35rem; }
.formcard__head p { margin: 0; color: var(--slate); font-size: 1rem; }
.formcard .form { gap: 1.15rem; }
.formcard__submit { width: 100%; justify-content: center; margin-top: .3rem; }
.formcard__note {
  margin: .8rem 0 0; text-align: center;
  font-size: .84rem; color: var(--muted);
}
.formcard .prefill { margin-bottom: 1.3rem; }

/* Contact details as a compact strip under the card, rather than a sidebar */
.reachrow {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  max-width: 940px; margin-left: auto; margin-right: auto;
  padding-top: clamp(1.6rem, 3vw, 2.4rem); border-top: var(--hair);
}
.reachrow__item { display: grid; grid-template-columns: 1.5rem 1fr; gap: .7rem; align-items: start; }
.reachrow__item svg { width: 19px; height: 19px; stroke: var(--crimson); fill: none; margin-top: .2rem; }
.reachrow__item b {
  display: block; font-size: .7rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--navy); margin-bottom: .25rem;
}
.reachrow__item span { font-size: .92rem; color: var(--slate); line-height: 1.45; }

@media (max-width: 860px) {
  .reachrow { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
}
@media (max-width: 720px) {
  .formcard { padding: 1.4rem 1.2rem; }
  .formcard .field-row { grid-template-columns: 1fr; }
  .reachrow { grid-template-columns: 1fr; }
}

/* Smaller variant for the checklist request form, which sits in a column */
.formcard--sm { max-width: none; padding: clamp(1.4rem, 2.6vw, 2rem); }
.formcard--sm .formcard__head { margin-bottom: 1.2rem; }
.formcard--sm .formcard__head h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: .3rem; }
.formcard--sm .formcard__head p { font-size: .94rem; }

/* Netlify honeypot — present in the DOM, never seen. Uses the standard
   visually-hidden clip pattern rather than a -9999px offset, which sits outside
   the viewport and trips layout audits. */
.hp {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* Inline form failure — never let a lead disappear silently */
.formerr {
  margin: .9rem 0 0; padding: .8rem 1rem;
  border-left: 3px solid var(--crimson); background: var(--paper-2);
  font-size: .9rem; color: var(--navy-ink);
}
.formerr[hidden] { display: none; }

/* Skip link — visible only when focused by keyboard */
.skiplink {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  z-index: 100; padding: .7rem 1.2rem;
  background: var(--navy); color: #fff; text-decoration: none;
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: top .18s ease;
}
.skiplink:focus { top: 0; color: #fff; }

/* ---------- Blog: post cards ----------
   Same construction as the service cards elsewhere on the site — white panel,
   crimson top rule, arrow link pinned to the bottom — so the blog reads as
   part of the site rather than a bolted-on section. */
.postcard {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--crimson);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.postcard:hover {
  border-color: var(--navy);
  border-top-color: var(--crimson);
  box-shadow: 10px 10px 0 rgba(10, 49, 97, .07);
  transform: translateY(-2px);
}
.postcard__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--rule); }
.postcard__media img { width: 100%; height: 100%; object-fit: cover; }
.postcard__body {
  display: flex; flex-direction: column; flex: 1;
  padding: clamp(1.3rem, 2vw, 1.7rem);
}
.postcard__date {
  margin: 0 0 .7rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--crimson);
}
.postcard__title {
  font-size: clamp(1.18rem, 1.6vw, 1.42rem); line-height: 1.18;
  margin: 0 0 .55rem;
}
.postcard__title a { color: var(--navy-ink); text-decoration: none; }
.postcard:hover .postcard__title a { color: var(--navy); }
.postcard__desc { margin: 0 0 1rem; font-size: .95rem; color: var(--slate); }
.postcard__tags { margin: 0 0 1.1rem; }
.postcard__more { margin-top: auto; align-self: flex-start; }

/* ---------- Blog: article body ---------- */
.prose { max-width: 68ch; }
.prose__cover { margin: 0 0 2rem; border: 1px solid var(--rule); }
.prose h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 2.2rem 0 .7rem;
}
.prose h3 { font-size: clamp(1.15rem, 1.7vw, 1.35rem); margin: 1.8rem 0 .5rem; }
.prose p { color: var(--slate); }
.prose ul, .prose ol { color: var(--slate); padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  margin: 1.6rem 0; padding: .3rem 0 .3rem 1.4rem;
  border-left: 3px solid var(--crimson);
  font-family: var(--serif); font-size: 1.2rem; color: var(--navy);
}
.prose code {
  font-size: .92em; background: var(--paper-2);
  padding: .1em .35em; border: 1px solid var(--rule-soft);
}
.prose__by {
  margin-top: 2.4rem; padding-top: 1rem; border-top: var(--hair);
  font-size: .84rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}

@media (max-width: 720px) {
  .postlist__item { grid-template-columns: 1fr; gap: .5rem; }
  .postlist__date { padding-top: 0; }
}
