/* ============================================================
   GrantField · Explore (editorial + liquid glass)
   Light and dark themes via [data-theme]. Shares the landing's
   tokens, type, ledger labels, hairlines, and glass primitive.
   No em dashes.
   ============================================================ */

:root, [data-theme="light"] {
  --paper: #F1EFE9; --paper-2: #E8E5DC; --paper-3: #DEDACE;
  --ink: #171710; --ink-2: #56544A; --ink-3: #6E6C61; --ink-4: #A8A69A;
  --hair: rgba(23,23,16,0.16); --hair-2: rgba(23,23,16,0.08);
  --accent: #0E5A42; --accent-2: #157A59;
  --row-hover: rgba(23,23,16,0.025);
  --glass-bg: rgba(241,239,233,0.55); --glass-bd: rgba(255,255,255,0.55); --glass-hi: rgba(255,255,255,0.6);
  --panel: #FBFAF7;
  /* --idle (archived dot) and --forecast (forecast dot/score) darkened from
     #A8A69A / #E0A500 so the status dots meet WCAG 3:1 non-text contrast on
     the light paper/panel (were 2.13 / 1.91). Dark theme already passes. */
  --ok: #157A59; --warn: #80621D; --idle: #7A7869; --forecast: #8A6D00;
}
[data-theme="dark"] {
  --paper: #0D110D; --paper-2: #121712; --paper-3: #19201A;
  --ink: #ECEAE2; --ink-2: #9DA89E; --ink-3: #79847A; --ink-4: #586058;
  --hair: rgba(236,234,226,0.14); --hair-2: rgba(236,234,226,0.07);
  --accent: #4FB484; --accent-2: #62C895;
  --row-hover: rgba(236,234,226,0.04);
  --glass-bg: rgba(18,24,18,0.5); --glass-bd: rgba(120,200,160,0.22); --glass-hi: rgba(180,220,196,0.25);
  --panel: #141A14;
  --ok: #4FB484; --warn: #D7A748; --idle: #586058; --forecast: #F2C84B;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: "Geist", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .4s ease, color .4s ease;
  overflow-x: hidden; }
::selection { background: rgba(21,122,89,0.2); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input, select { font-family: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 6px; }

.mono { font-family: "Geist Mono", ui-monospace, monospace; }
.lbl { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.lbl.sm { font-size: 10px; letter-spacing: 0.1em; }
.tnum { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1600px; margin: 0 auto; padding: 0 clamp(22px, 5vw, 68px); }

/* liquid-glass primitive */
.glass { background: var(--glass-bg); backdrop-filter: blur(14px) saturate(1.7); -webkit-backdrop-filter: blur(14px) saturate(1.7);
  border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0,0,0,0.08);
  will-change: backdrop-filter; backface-visibility: hidden; }

/* theme toggle */
.xp-toggle { display: inline-flex; border: 1px solid var(--hair); border-radius: 20px; overflow: hidden; }
.xp-toggle button { padding: 6px 11px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.xp-toggle button svg { width: 13px; height: 13px; }
.xp-toggle button.on { background: var(--ink); color: var(--paper); }

.btn { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; font-size: 13px; border: 1px solid var(--ink); border-radius: 2px; transition: background .15s, color .15s, transform .15s; white-space: nowrap; cursor: pointer; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: transparent; color: var(--accent); }
/* primary run action: evergreen, weightier, arrow nudges on hover */
/* Run button: the site-standard primary (dark ink, hover to accent) from
   .btn.solid, just larger. It was a one-off solid green, out of step with every
   other primary CTA (the home "Match my organization" is .btn.solid). */
.btn.mt-run { padding: 12px 22px; font-size: 14px; font-weight: 500; }
.btn.mt-run svg { transition: transform .15s; }
.btn.mt-run:hover svg { transform: translateX(3px); }

/* ---- masthead ---- */
.xp-mast { padding: 40px 0 22px; position: relative; z-index: 1; }
.xp-mast .sec-num { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.1em; color: var(--accent); }
.xp-mast h1 { font-weight: 650; letter-spacing: -0.035em; line-height: 0.98; font-size: clamp(39px, 5.7vw, 69px); margin: 12px 0 0; text-wrap: balance; }
.xp-mast .lede { margin: 16px 0 0; max-width: 54ch; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

/* ---- toolbar (liquid glass) ---- */
/* sticky below the sticky header (z-40); own stacking context via isolation so
   the blur/transform does not jitter against the rows underneath. The glass box
   is always on (paper-tinted frosted panel), not only when pinned. */
.xp-toolbar { position: sticky; top: 58px; z-index: 30; isolation: isolate; border-radius: 12px; margin-top: 10px;
  background: var(--glass-bg); backdrop-filter: blur(14px) saturate(1.7); -webkit-backdrop-filter: blur(14px) saturate(1.7);
  border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0,0,0,0.08);
  will-change: backdrop-filter; backface-visibility: hidden; }
/* deepen the lift once it pins under the header (JS adds .stuck) */
.xp-toolbar.stuck { box-shadow: inset 0 1px 0 var(--glass-hi), 0 14px 40px rgba(0,0,0,0.13); }
.xp-toolbar-in { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 0; }
.xp-cell { border-right: 1px solid var(--hair-2); padding: 12px 15px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.xp-cell:last-child { border-right: 0; }
.xp-cell .search { display: flex; align-items: center; gap: 9px; }
.xp-cell .search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.xp-cell input { background: none; border: 0; outline: 0; color: var(--ink); font-size: 14.5px; width: 100%; }
.xp-cell input::placeholder { color: var(--ink-3); }
.xp-sel { position: relative; }
.xp-sel select { appearance: none; -webkit-appearance: none; background: none; border: 0; outline: 0; color: var(--ink); font-size: 13.5px; width: 100%; padding: 1px 18px 1px 0; cursor: pointer; }
.xp-sel select option { background: var(--panel); color: var(--ink); }
.xp-sel::after { content: ""; position: absolute; right: 2px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-65%) rotate(45deg); pointer-events: none; }

/* ---- focus indicators (keyboard) ---- */
.xp-cell input:focus-visible, .xp-sel select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.btn:focus-visible, .xp-nav a:focus-visible, .xp-signlink:focus-visible,
.xp-toggle button:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* row acts as a button: show the accent left-bar plus a ring on keyboard focus */
.xp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--row-hover); }
.xp-row:focus-visible::before { transform: scaleY(1); }

.xp-resultline { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px 2px 10px; flex-wrap: wrap; }
.xp-count { display: flex; align-items: baseline; gap: 9px; }
.xp-count .n { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- rows ---- */
.xp-rows { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.xp-row { display: grid; grid-template-columns: 20px minmax(0,1fr) 140px 150px 22px; gap: 18px; align-items: center;
  padding: 18px 4px; border-bottom: 1px solid var(--hair); cursor: pointer; position: relative; transition: none; }
.xp-row:hover { background: var(--row-hover); }
.xp-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: -1px; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .18s cubic-bezier(.2,.7,.3,1); }
.xp-row:hover::before { transform: scaleY(1); }
.xp-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-open { background: var(--ok); } .dot-forecasted { background: var(--forecast); } .dot-closed { background: #C0353A; } .dot-archived { background: var(--idle); }
.xp-row .rt { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 6px; text-wrap: pretty; }
.xp-row .rm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--ink-3); }
.xp-row .rm .pipe { color: var(--hair); }
/* long source/agency names must shrink and break inside the title cell */
.xp-row .rm span { min-width: 0; overflow-wrap: anywhere; }
.xp-chips { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.xp-chip { font-family: "Geist Mono", ui-monospace, monospace; font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--hair); border-radius: 3px; padding: 2px 6px; white-space: nowrap; }
.xp-col .l { font-family: "Geist Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 4px; }
.xp-col .v { font-size: 14px; font-variant-numeric: tabular-nums; }
.xp-when { font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; margin-top: 3px; }
.xp-when.soon { color: var(--warn); } .xp-when.urgent { color: #C0353A; } .xp-when.normal { color: var(--ink-3); }
.xp-row .chev { color: var(--ink-3); justify-self: end; }
.xp-row .chev svg { width: 16px; height: 16px; display: block; }

.xp-empty { padding: 60px 20px; text-align: center; color: var(--ink-3); border-bottom: 1px solid var(--hair); }
.xp-more { display: flex; justify-content: center; padding: 26px 0 8px; }
.xp-more .btn { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.xp-more .tnum { color: var(--ink-3); }

/* ---- detail: liquid-glass slide-over over an oblong ---- */
.xp-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,8,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); will-change: backdrop-filter; backface-visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .25s; display: grid; place-items: center; padding: 28px; }
.xp-scrim.in { opacity: 1; pointer-events: auto; }
.xp-modal { width: min(860px, 100%); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--hair); border-radius: 14px; box-shadow: 0 40px 110px rgba(0,0,0,0.45); transform: translateY(12px) scale(0.98); opacity: 0; transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .28s; }
.xp-scrim.in .xp-modal { transform: none; opacity: 1; }
.xp-modal:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xp-modal .ph { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 15px 24px; border-bottom: 1px solid var(--hair); background: var(--panel); }
.xp-mbody { padding: 22px 26px 30px; }
.xp-pmeta { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); letter-spacing: 0.03em; }
.xp-modal h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 12px 0 0; text-wrap: pretty; }
.xp-agency { color: var(--ink-3); font-size: 13px; margin-top: 10px; }
.xp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.xp-fact { border: 1px solid var(--hair); border-radius: 8px; padding: 12px 14px; }
.xp-fact .fv { font-size: 16px; font-weight: 500; margin-top: 8px; }
.xp-sec-t { margin: 22px 0 10px; }
.xp-modal p { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 0; }
.xp-metarow { display: flex; flex-wrap: wrap; gap: 20px 36px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); }
.xp-metarow .mi { display: flex; flex-direction: column; gap: 6px; }
.xp-metarow .mi .mv { font-size: 14px; color: var(--ink-2); }

.xp-foot { border-top: 1px solid var(--hair); margin-top: 40px; }
.xp-foot-in { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; flex-wrap: wrap; gap: 10px; }

/* reduced motion: disable the decorative brand pulse and the modal/row
   transitions so no continuous or large-area motion plays */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .xp-row, .xp-row::before, .xp-modal, .xp-scrim, .xp-toolbar { transition: none; }
}

@media (max-width: 920px) {
  .xp-toolbar-in { grid-template-columns: 1fr 1fr; }
  .xp-cell { border-bottom: 1px solid var(--hair-2); }
  .xp-row { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .xp-row .xp-col.fund, .xp-row .chev { display: none; }
}
/* the 2-up toolbar still crowds the search + selects at phone widths; go 1-up */
@media (max-width: 520px) {
  .xp-toolbar-in { grid-template-columns: 1fr; }
}

/* Reduce motion (Settings pref; gf-api sets data-reduce-motion on <html> on every page). */
html[data-reduce-motion="true"] *, html[data-reduce-motion="true"] *::before, html[data-reduce-motion="true"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }

/* ============================================================
   Pre-paint list (.pp-*). Static, crawlable above-the-fold content baked into
   #root by prepaint-explore.mjs for Bing / LLM crawlers and the pre-hydration
   paint. React replaces #root on mount, so these rules only ever style the
   brief pre-hydration window (and the no-JS / crawler view). Kept minimal and
   reusing the page's CSS variables.
   ============================================================ */
.pp-list { margin: 18px 0 0; }
.pp-list ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair-2); }
.pp-row { border-bottom: 1px solid var(--hair-2); }
.pp-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 14px 2px; color: var(--ink); text-decoration: none; }
.pp-link:hover .pp-title { color: var(--accent); }
.pp-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; flex: 1 1 60%; min-width: 0; }
.pp-agency { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pp-deadline { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.04em; color: var(--ink-2); margin-left: auto; white-space: nowrap; }
