/* ════════════════════════════════════════════════════════════
   JNF Beneficiary Dashboard — Evolved design system
   Same brutalist DNA (cream, amber, mono labels, offset shadow)
   refined for hierarchy + readability. Navy added as anchor.
   ════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=JetBrains+Mono:wght@400;500;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&display=swap');

:root {
  /* —— Brand palette ——————————————————————————— */
  --cream:     #faf8eb;
  --cream-2:   #f3efdd;   /* slightly deeper cream for bands */
  --amber:     #f0af3c;
  --amber-deep:#d98e1f;
  --gold:      #edd093;
  --lavender:  #d4c4d0;
  --lavender-2:#e7dde3;
  --navy:      #252d5e;   /* NEW anchor — official JNF secondary */
  --navy-2:    #353f77;
  --ink:       #2b2520;
  --ink-light: #6b5d56;
  --ink-faint: #9a8c83;
  --white:     #ffffff;
  --green:     #4f8a3d;
  --red:       #c0392b;
  --line:      #e4dcc9;   /* quiet hairline on cream */
  --line-2:    #efe9d8;

  /* —— Pillar hues ————————————————————————————— */
  --p-empowered: #d98e1f;  /* amber-deep */
  --p-matatag:   #5a8a3a;  /* moss */
  --p-maginhawa: #8a6aa0;  /* plum/lavender */
  --p-panatag:   #2f6f9e;  /* steel blue */

  /* —— Type families ——————————————————————————— */
  --font-display: 'Archivo Black', sans-serif;
  --font-body:    'Newsreader', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* —— Type scale —————————————————————————————— */
  --fs-hero:      72px;
  --fs-display-l: 44px;
  --fs-display-m: 30px;
  --fs-heading-l: 22px;
  --fs-heading-m: 17px;
  --fs-body:      16px;
  --fs-small:     14px;
  --fs-label:     11px;

  /* —— Spacing (4px base) ——————————————————————— */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px;
  --sp-5:24px; --sp-6:32px; --sp-7:48px; --sp-8:64px; --sp-9:88px;

  /* —— Brutalist signatures (reserved for tier-1) ——— */
  --border-w: 2.5px;
  --shadow:        5px 5px 0 var(--ink);
  --shadow-navy:   5px 5px 0 var(--navy);
  --shadow-sm:     3px 3px 0 var(--ink);
  --shadow-press:  1px 1px 0 var(--ink);

  --ls-label: 0.14em;
  --ls-kicker: 0.2em;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 200ms;

  --content-max: 1240px;
  --content-px: 32px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--amber); color: var(--ink); }

/* —— Typography utilities —————————————————————— */
.t-hero {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.t-display-l { font-family: var(--font-display); font-size: var(--fs-display-l); line-height: 0.95; letter-spacing: -0.02em; }
.t-display-m { font-family: var(--font-display); font-size: var(--fs-display-m); line-height: 1; letter-spacing: -0.01em; }
.t-serif-l   { font-family: var(--font-body); font-weight: 600; font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.t-heading   { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-heading-l); line-height: 1.2; letter-spacing: -0.01em; }
.t-heading-m { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-heading-m); line-height: 1.25; }
.t-body      { font-size: var(--fs-body); }
.t-small     { font-size: var(--fs-small); line-height: 1.5; }
.t-label {
  font-family: var(--font-mono); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-light);
}
.t-kicker {
  font-family: var(--font-mono); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: var(--ls-kicker);
  text-transform: uppercase; color: var(--amber-deep);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-light); }
.faint { color: var(--ink-faint); }

/* —— Layout ——————————————————————————————————— */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-px); }
.section { margin-bottom: var(--sp-8); }
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3); border-bottom: 2.5px solid var(--ink);
}
.section__title { font-family: var(--font-display); font-size: var(--fs-heading-l); letter-spacing: -0.01em; margin: 0; }
.section__meta { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ink-light); white-space: nowrap; }

/* ════════════════════════════════════════════════════════════
   TOP BAR
   ════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: var(--white);
  border-bottom: 2.5px solid var(--ink);
}
.topbar__inner {
  max-width: var(--content-max); margin: 0 auto; padding: 14px var(--content-px);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand__logo {
  width: 40px; height: 40px; object-fit: contain;
  background: var(--white); border-radius: 50%; padding: 4px;
}
.brand__name { font-family: var(--font-display); font-size: 16px; letter-spacing: -0.01em; line-height: 1; }
.brand__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-top: 3px; }
.topbar__meta { display: flex; align-items: center; gap: var(--sp-6); }
.topbar__stat { text-align: right; }
.topbar__stat-v { font-family: var(--font-mono); font-weight: 700; font-size: 15px; white-space: nowrap; }
.topbar__stat-l { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.55); }

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero { padding: var(--sp-8) 0 var(--sp-7); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--sp-8); align-items: center; }
.hero__num { font-family: var(--font-display); font-size: clamp(80px, 11vw, 132px); line-height: 0.86; letter-spacing: -0.04em; color: var(--ink); }
.hero__num span { color: var(--amber-deep); }
.hero__lead { font-family: var(--font-body); font-size: 21px; line-height: 1.45; color: var(--ink); max-width: 30ch; margin: var(--sp-4) 0 0; }
.hero__lead em { font-style: italic; color: var(--amber-deep); }

/* reach-by-pillar proportion bar */
.proportion { }
.proportion__bar {
  display: flex; height: 64px; border: 2.5px solid var(--ink);
  box-shadow: var(--shadow); overflow: hidden; background: var(--white);
}
.proportion__seg { display: flex; align-items: flex-end; padding: 8px 10px; color: var(--white); position: relative; min-width: 2px; transition: filter var(--dur); }
.proportion__seg:hover { filter: brightness(1.08); }
.proportion__seg:not(:last-child) { border-right: 2px solid var(--ink); }
.proportion__legend { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-4); }
.proportion__item { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-small); }
.proportion__dot { width: 11px; height: 11px; flex-shrink: 0; border: 1.5px solid var(--ink); align-self: center; }
.proportion__item-n { font-family: var(--font-mono); font-weight: 700; margin-left: auto; }
.proportion__item-pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-light); width: 38px; text-align: right; }

/* ════════════════════════════════════════════════════════════
   YEAR FILTER
   ════════════════════════════════════════════════════════════ */
.controlbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; margin-bottom: var(--sp-7);
  padding: var(--sp-4) var(--sp-5);
  background: var(--cream-2); border: 2.5px solid var(--ink);
}
.controlbar__label { display: flex; align-items: center; gap: var(--sp-3); }
.year-seg { display: inline-flex; border: 2px solid var(--ink); background: var(--white); }
.year-seg button {
  font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 8px 16px; background: transparent; color: var(--ink);
  border: none; cursor: pointer; transition: background var(--dur), color var(--dur);
}
.year-seg button:not(:last-child) { border-right: 2px solid var(--ink); }
.year-seg button:hover { background: var(--gold); }
.year-seg button.active { background: var(--navy); color: var(--white); }
.controlbar__note { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-light); }

/* ════════════════════════════════════════════════════════════
   PILLAR CARDS
   ════════════════════════════════════════════════════════════ */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.pillar {
  background: var(--white); border: 2.5px solid var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pillar:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.pillar__top { height: 8px; }
.pillar__body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.pillar__name { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.01em; line-height: 1; }
.pillar__tag { font-family: var(--font-body); font-style: italic; font-size: var(--fs-small); color: var(--ink-light); margin-top: 4px; }
.pillar__big {
  font-family: var(--font-display); font-size: 46px; line-height: 1; letter-spacing: -0.02em;
  margin: var(--sp-5) 0 2px;
}
.pillar__big-l { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ink-light); }
.pillar__sub { display: flex; gap: var(--sp-4); margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1.5px solid var(--line); }
.pillar__sub-v { font-family: var(--font-mono); font-weight: 700; font-size: 18px; }
.pillar__sub-l { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-light); margin-top: 2px; }
.pillar__progs { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1.5px solid var(--line); }
.pillar__progs-t { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-2); }
.prow { display: grid; grid-template-columns: 112px 1fr 40px; align-items: center; gap: var(--sp-3); padding: 5px 0; font-size: 12.5px; }
.prow__name { line-height: 1.25; }
.prow__track { height: 6px; background: var(--line-2); position: relative; }
.prow__fill { position: absolute; inset: 0 auto 0 0; }
.prow__n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-light); text-align: right; }

/* ════════════════════════════════════════════════════════════
   GENERIC CARD (tier-2, quiet)
   ════════════════════════════════════════════════════════════ */
.card { background: var(--white); border: 2px solid var(--ink); padding: var(--sp-5); }
.card--pad0 { padding: 0; }

/* ════════════════════════════════════════════════════════════
   GROWTH (column chart)
   ════════════════════════════════════════════════════════════ */
.growth { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-6); align-items: stretch; }
.colchart { display: flex; align-items: flex-end; gap: var(--sp-4); height: 240px; padding-top: var(--sp-4); }
.colchart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.colchart__bar-wrap { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; flex: 1; }
.colchart__val { font-family: var(--font-mono); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.colchart__bar { width: 100%; max-width: 68px; background: var(--navy); border: 2px solid var(--ink); border-bottom: none; transition: height 600ms var(--ease); min-height: 3px; }
.colchart__bar--peak { background: var(--amber); }
.colchart__x { font-family: var(--font-mono); font-size: 12px; margin-top: 8px; padding-top: 8px; border-top: 2.5px solid var(--ink); width: 100%; text-align: center; }
.growth__notes { display: flex; flex-direction: column; gap: var(--sp-4); justify-content: center; }
.gnote { }
.gnote__v { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.gnote__v span { color: var(--amber-deep); }
.gnote__l { font-size: var(--fs-small); color: var(--ink-light); margin-top: 4px; max-width: 34ch; }

/* ════════════════════════════════════════════════════════════
   PROGRAM PERFORMANCE
   ════════════════════════════════════════════════════════════ */
.flagship {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  padding: var(--sp-5); background: var(--navy); color: var(--white);
  border: 2.5px solid var(--ink); box-shadow: var(--shadow); margin-bottom: var(--sp-5);
}
.flagship__l { display: flex; flex-direction: column; gap: 4px; }
.flagship__name { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.01em; }
.flagship__desc { font-size: var(--fs-small); color: rgba(255,255,255,0.7); max-width: 48ch; }
.flagship__r { text-align: right; }
.flagship__n { font-family: var(--font-display); font-size: 52px; line-height: 0.9; letter-spacing: -0.02em; color: var(--amber); }
.flagship__nl { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label); text-transform: uppercase; color: rgba(255,255,255,0.6); }

.hbars { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: var(--sp-4); padding: 9px 0; border-bottom: 1px solid var(--line); }
.hbar:last-child { border-bottom: none; }
.hbar__name { font-size: var(--fs-small); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); }
.hbar__pdot { width: 9px; height: 9px; flex-shrink: 0; border: 1.5px solid var(--ink); }
.hbar__track { height: 18px; background: var(--line-2); position: relative; border: 1.5px solid var(--ink); }
.hbar__fill { position: absolute; inset: 0 auto 0 0; transition: width 500ms var(--ease); }
.hbar__n { font-family: var(--font-mono); font-weight: 700; font-size: 13px; text-align: right; }

/* ════════════════════════════════════════════════════════════
   COMMUNITIES
   ════════════════════════════════════════════════════════════ */
.commbars { display: flex; flex-direction: column; gap: 2px; }
.commbar { display: grid; grid-template-columns: 220px 1fr 48px; align-items: center; gap: var(--sp-4); padding: 7px 0; }
.commbar__name { font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commbar__track { height: 22px; background: var(--lavender-2); border: 1.5px solid var(--ink); position: relative; }
.commbar__fill { position: absolute; inset: 0 auto 0 0; background: var(--amber); transition: width 500ms var(--ease); }
.commbar__n { font-family: var(--font-mono); font-weight: 700; font-size: 13px; text-align: right; }

/* ════════════════════════════════════════════════════════════
   DATA EXPLORER
   ════════════════════════════════════════════════════════════ */
.explorer-filters {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end;
  padding: var(--sp-5); background: var(--cream-2); border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-sm); margin-bottom: var(--sp-5);
}
.filt { display: flex; flex-direction: column; gap: 6px; }
.filt > label { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-light); }
.filt select {
  font-family: var(--font-body); font-size: var(--fs-small); padding: 9px 12px;
  border: 2px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; min-width: 180px;
  border-radius: 0; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232b2520' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.filt select:focus { outline: none; border-color: var(--amber-deep); box-shadow: var(--shadow-press); }
.btn-reset {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 16px; background: var(--white); border: 2px solid var(--ink); cursor: pointer;
  transition: background var(--dur);
}
.btn-reset:hover { background: var(--lavender); }

.explorer-result {
  display: grid; grid-template-columns: 0.9fr 1fr 1fr 1fr; gap: var(--sp-4); align-items: stretch;
}
.exsum { background: var(--navy); color: var(--white); border: 2.5px solid var(--ink); box-shadow: var(--shadow); padding: var(--sp-5); display: flex; flex-direction: column; justify-content: center; }
.exsum__n { font-family: var(--font-display); font-size: 52px; line-height: 0.9; letter-spacing: -0.02em; color: var(--amber); }
.exsum__l { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--ls-label); text-transform: uppercase; color: rgba(255,255,255,0.7); margin-top: var(--sp-2); }
.exsum__row { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid rgba(255,255,255,0.2); }
.exsum__sv { font-family: var(--font-mono); font-weight: 700; font-size: 20px; }
.exsum__sl { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-top: 2px; }
.exbreak { background: var(--white); border: 2px solid var(--ink); padding: var(--sp-4); }
.exbreak__t { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1.5px solid var(--line); }
.exrow { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center; padding: 5px 0; font-size: var(--fs-small); }
.exrow__bar { grid-column: 1 / -1; height: 4px; background: var(--line-2); position: relative; margin-top: -2px; }
.exrow__bar > span { position: absolute; inset: 0 auto 0 0; background: var(--lavender); }
.exrow__n { font-family: var(--font-mono); font-weight: 700; font-size: 12px; }

/* badge */
.badge {
  display: inline-block; font-family: var(--font-mono); font-weight: 500; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border: 1.5px solid var(--ink);
  color: var(--white);
}

/* footer */
.footer { padding: var(--sp-7) 0 var(--sp-8); border-top: 2.5px solid var(--ink); margin-top: var(--sp-7); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE (desktop-first; graceful down to tablet)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .explorer-result { grid-template-columns: 1fr 1fr; }
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .growth { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --content-px: 18px; --fs-hero: 52px; }
  .pillars { grid-template-columns: 1fr; }
  .explorer-result { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 44px; }
  .commbar { grid-template-columns: 130px 1fr 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
