/* =========================================================
   Home page hero (2026-11-21): headline with the price, the search
   box, today's example card and the trial strip.

   2026-11-22: the headline size is set for a headline of about ten
   words ("Find the foundations that fund organizations like yours."),
   which is three lines on a desktop and keeps the search box on
   screen on a 1366 x 768 laptop. Text widths are in em, so they do
   not move when the text font changes (static/fonts/type.css).

   Loaded by templates/home.html after the site bundle. Two parts:

   1. A palette for the home page only, set on body.home-page, so the
      header, the buttons and the sections further down pick up the
      logo's teal and navy on this page and nothing changes anywhere
      else. To take it site-wide later, move the --brand-a, --brand-b,
      --cta-ink and --focus lines to the :root and
      html[data-theme="light"] blocks of the bundle.
   2. The hero itself. Every class is new (.hh-*), so no other page
      and no other section is affected.

   Site-wide rules that are deliberately out-ranked below:
     main                       { text-align: center }
     a                          { color: var(--primary) }
     button                     { gradient pill, 13px, weight 900 }
     input[type="text"]         { font-size: 14px }
     form:not(.js-filter-form)  { flex-wrap: wrap; gap: 10px }
     a, button, input           { 600ms color transitions for the theme fade }
   ========================================================= */

/* ── 1. Palette, this page only ───────────────────────────── */
body.home-page {
  /* The logo */
  --hh-navy: #1A262F;
  --hh-teal: #52B5AE;
  --hh-teal-soft: #94C0C5;
  --hh-coral: #FC3C46;

  /* What the rest of the page reads. Dark text on teal is 7.3:1; white on teal would be 2.5:1. */
  --brand-a: var(--hh-teal);
  --brand-b: var(--hh-teal-soft);
  --cta-ink: #10191F;
  --home-cta-grad: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  --home-brand-text: #7FD0C9;
  --focus: var(--hh-teal);

  /* The hero's own. These are the dark theme's; the light theme follows. */
  --hh-ink: var(--ink);
  --hh-soft: var(--muted);
  --hh-field-bg: rgba(255, 255, 255, .06);
  --hh-field-line: rgba(255, 255, 255, .46);
  --hh-go-bg: var(--hh-teal);
  --hh-go-bg-hover: #6FC6BF;
  --hh-go-ink: #10191F;
  --hh-go-ring: #10191F;
  --hh-sheet: rgba(255, 255, 255, .38);
  --hh-sheet-line: transparent;
  --hh-card-line: transparent;
  --hh-card-shadow: 0 30px 60px -28px rgba(0, 0, 0, .7);
}

html[data-theme="light"] body.home-page {
  --home-brand-text: #1B6F68;          /* teal dark enough for small text: 5.6:1 on the page */
  --focus: var(--hh-navy);

  --hh-ink: var(--hh-navy);
  --hh-soft: #4A5964;
  --hh-field-bg: #fff;
  --hh-field-line: var(--hh-navy);
  --hh-go-bg: var(--hh-navy);
  --hh-go-bg-hover: #2B3D4A;
  --hh-go-ink: #fff;
  --hh-go-ring: var(--hh-teal);
  --hh-sheet: #fff;
  --hh-sheet-line: #D5DCE1;
  --hh-card-line: #D5DCE1;
  --hh-card-shadow: 0 30px 50px -30px rgba(26, 38, 47, .45);
}

/* The site's two blurred background shapes take the brand colors. The one at the top left would
   sit right behind the headline and the search box, so it is left out on this page. */
body.home-page .app-blob.blob-a { display: none; }

/* The "Funders" tab in the sample panel further down the page was white on the brand gradient. */
body.home-page .home-mock-pill--active { color: var(--cta-ink); }

/* Feature and audience icons: home.css colors them with --cta-ink, which this page sets to
   near-black for the teal buttons. Use the page's teal text color instead (set per theme above). */
body.home-page .home-icon .home-feature-svg { color: var(--home-brand-text); }

/* ── 2. Layout ────────────────────────────────────────────── */
.hh-hero {
  position: relative;
  z-index: 2;                           /* the suggestions list opens over the next section */
  text-align: left;
  padding: clamp(26px, 5vw, 64px) 0 clamp(40px, 6vw, 76px);
}
.hh-inner {
  width: min(1120px, 100% - 48px);
  margin: 0 auto;
}
.hh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(36px, 5.5vw, 76px);
  align-items: start;                   /* top-aligned, so a message under the search box moves nothing else */
}
.hh-grid--solo { grid-template-columns: minmax(0, 720px); }
.hh-lead { min-width: 0; padding-top: clamp(0px, 2.2vw, 30px); }

/* ── 3. Headline and price ────────────────────────────────── */
.hh-title {
  margin: 0 0 18px;
  color: var(--hh-ink);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.3rem + 2.3vw, 3rem);    /* 35px on a phone, 48px on a desktop */
  line-height: 1.06;
  letter-spacing: -.02em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.hh-sub {
  margin: 0 0 30px;
  max-width: 21.5em;
  color: var(--hh-ink);
  font-size: clamp(1.14rem, 1rem + .75vw, 1.42rem);
  font-weight: 500;
  line-height: 1.4;
  text-wrap: pretty;
}

/* ── 4. Search ────────────────────────────────────────────── */
.hh-search {
  display: block;                       /* out-ranks the site-wide form rule */
  position: relative;
  max-width: 590px;
  margin: 0;
}
.hh-label {
  display: block;
  margin: 0 0 8px;
  color: var(--hh-soft);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .005em;
}
.hh-field {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--hh-field-line);
  border-radius: 12px;
  background: var(--hh-field-bg);
  transition: box-shadow .15s ease;
}
.hh-field:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.hh-search .hh-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 58px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: transparent;
  color: var(--hh-ink);
  font-family: inherit;
  font-size: 1.06rem;                   /* 16px or more: no zoom on focus on iPhone */
  font-weight: 500;
  outline: none;                        /* the ring is drawn on .hh-field */
}
.hh-search .hh-input::placeholder {
  color: var(--hh-soft);
  opacity: 1;
  font-weight: 400;
}
.hh-search .hh-input:placeholder-shown { text-overflow: ellipsis; }
.hh-search .hh-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 26px;
  border: 0;
  border-radius: 0 9px 9px 0;
  background: var(--hh-go-bg);
  color: var(--hh-go-ink);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease;
}
.hh-search .hh-go:hover { background: var(--hh-go-bg-hover); }
.hh-search .hh-go:focus-visible {
  outline: 3px solid var(--hh-go-ring);
  outline-offset: -6px;
}

/* Suggestions */
.hh-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--dropdown-bg);
  box-shadow: var(--dropdown-shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.hh-list[hidden], .hh-none[hidden] { display: none; }
.hh-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--hh-ink);
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
}
.hh-opt-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.hh-opt-meta { flex: 0 0 auto; color: var(--hh-soft); font-size: .86rem; white-space: nowrap; }
.hh-opt[aria-selected="true"] {
  background: color-mix(in srgb, var(--hh-teal) 24%, transparent);
  box-shadow: inset 3px 0 0 var(--hh-ink);      /* not color alone */
}
.hh-opt-all {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}
.hh-opt-all .hh-opt-name { font-weight: 500; }
.hh-none {
  margin: 10px 0 0;
  color: var(--hh-soft);
  font-size: .95rem;
  line-height: 1.5;
}

.hh-proof {
  max-width: 32em;
  margin: 16px 0 0;
  color: var(--hh-soft);
  font-size: .97rem;
  line-height: 1.55;
}

/* ── 5. Today's example ───────────────────────────────────── */
/* The card is paper in both themes, like the embed badge it shares its figures with. The two
   sheets behind it are decoration: one page out of a very large stack. */
.hh-stack {
  position: relative;
  min-width: 0;
  margin: 6px 22px 26px 0;
  container: hh-card / inline-size;     /* lets the rows drop their small print when the card is narrow */
}
.hh-stack::before,
.hh-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hh-sheet-line);
  border-radius: 14px;
  background: var(--hh-sheet);
}
.hh-stack::before { transform: translate(18px, 20px) rotate(2.6deg); opacity: .5; }
.hh-stack::after  { transform: translate(9px, 10px) rotate(1.3deg); opacity: .78; }

.hh-card {
  /* Same three colors as the profile card and the badge (color-blind safe). */
  --c-prog: #0072B2;
  --c-mgmt: #E69F00;
  --c-fund: #CC79A7;
  --hh-paper-ink: #1A262F;
  --hh-paper-soft: #55626C;
  --hh-paper-line: #D5DCE1;
  --focus: #1A262F;                     /* the page's teal ring would be too faint on white */

  position: relative;
  z-index: 1;
  padding: 26px 28px 24px;
  border: 1px solid var(--hh-card-line);
  border-radius: 14px;
  background: #fff;
  color: var(--hh-paper-ink);
  box-shadow: var(--hh-card-shadow);
}
.hh-card-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--hh-paper-soft);
  font-size: .88rem;
  font-weight: 600;
}
.hh-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hh-coral);
}
.hh-card-name {
  margin: 0;
  color: var(--hh-paper-ink);
  font-size: clamp(1.45rem, 1.2rem + .9vw, 1.8rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.hh-card .hh-card-name a { color: inherit; text-decoration: none; }
.hh-card .hh-card-name a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hh-card-place {
  margin: 6px 0 0;
  color: var(--hh-paper-soft);
  font-size: .97rem;
}
.hh-card-lede {
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--hh-paper-line);
  font-size: .97rem;
  font-weight: 600;
}

.hh-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
}
/* The one moving part: the bar draws itself in once. The class is added by the script in home.html
   only when the page is actually on screen, so without JavaScript, in a background tab or in a
   page snapshot the bar is simply there. */
.hh-bar--in { animation: hh-reveal .9s cubic-bezier(.2, .7, .2, 1) .15s backwards; }
.hh-seg { flex: 0 0 auto; min-width: 3px; }
.hh-c-prog { background: var(--c-prog); }
.hh-c-mgmt { background: var(--c-mgmt); }
.hh-c-fund { background: var(--c-fund); }
@keyframes hh-reveal {
  from { clip-path: inset(0 100% 0 0 round 999px); }
  to   { clip-path: inset(0 0 0 0 round 999px); }
}

.hh-ledger { margin: 14px 0 0; }
.hh-row {
  display: flex;
  align-items: baseline;
  padding: 7px 0;
}
.hh-row dt {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}
.hh-row dt::after {                     /* dot leader, as on a form */
  content: "";
  flex: 1 1 24px;
  min-width: 18px;
  margin: 0 10px;
  border-bottom: 2px dotted #9AA7B0;
  transform: translateY(-4px);
}
.hh-dot {
  flex: 0 0 auto;
  align-self: center;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 3px;
}
.hh-note {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--hh-paper-soft);
  font-weight: 400;
  text-overflow: ellipsis;
}
@container hh-card (max-width: 450px) {
  .hh-note { display: none; }           /* "Programs ...... $87" without ", the work itself" */
}
.hh-row dd {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.16rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hh-card-foot {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--hh-paper-line);
  color: var(--hh-paper-soft);
  font-size: .9rem;
  line-height: 1.5;
}
.hh-card .hh-card-foot a {
  color: var(--hh-paper-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.hh-card .hh-card-foot a:hover { text-decoration-thickness: 2.5px; }

/* ── 6. Price and trial ───────────────────────────────────── */
.hh-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin-top: clamp(38px, 5vw, 62px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hh-strip-text {
  flex: 1 1 420px;
  max-width: 46em;
  margin: 0;
  color: var(--hh-soft);
  font-size: .98rem;
  line-height: 1.55;
}
.hh-strip-text strong { color: var(--hh-ink); font-weight: 700; }
.hh-strip-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.hh-strip .hh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 2px solid var(--hh-ink);
  border-radius: 10px;
  background: transparent;
  color: var(--hh-ink);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.hh-strip .hh-btn:hover {
  background: var(--hh-ink);
  color: var(--page-bg);
}
.hh-strip .hh-link {
  color: var(--hh-ink);
  font-size: .97rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.hh-strip .hh-link:hover { text-decoration-thickness: 2.5px; }

/* ── 7. Smaller screens ───────────────────────────────────── */
@media (max-width: 920px) {
  .hh-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hh-lead { padding-top: 0; }
  .hh-sub { max-width: 23.5em; }
  .hh-stack { max-width: 540px; margin: 0 18px 20px 0; }
}
@media (max-width: 768px) {
  .hh-inner { width: calc(100% - 36px); }
  .hh-hero { padding-top: 18px; }
  .hh-sub { margin-bottom: 24px; }
}
@media (max-width: 520px) {
  .hh-search .hh-input { height: 54px; padding: 0 12px 0 14px; font-size: 1rem; }
  .hh-search .hh-go { padding: 0 16px; }
  .hh-card { padding: 22px 20px 20px; }
  .hh-stack { margin-right: 12px; }
  .hh-stack::before { transform: translate(11px, 13px) rotate(2deg); }
  .hh-stack::after  { transform: translate(6px, 7px) rotate(1deg); }
  .hh-note { display: none; }
  .hh-opt { flex-direction: column; gap: 2px; }
  .hh-opt-meta { white-space: normal; }
  .hh-strip-actions { width: 100%; }
  .hh-strip .hh-btn { flex: 1 1 auto; }
}
