/* ============================================================
   Willow Initiative — design tokens + base
   ============================================================ */

:root {
  /* Palette */
  --bg:           #F1EDE4;     /* warm paper */
  --bg-2:         #E8E3D7;     /* slightly darker paper */
  --surface:      #FBF9F3;     /* card surface */
  --surface-2:   #FFFFFFEE;
  --ink:          #0F1410;     /* near-black, green-tinged */
  --ink-2:        #2A302B;
  --ink-soft:     #5A625C;
  --ink-mute:     #8B928D;
  --line:         rgba(15, 20, 16, 0.08);
  --line-strong:  rgba(15, 20, 16, 0.14);

  --sage:         #5C7C5F;     /* primary muted green */
  --sage-deep:    #2C3D2E;
  --sage-soft:    #C5D2BE;
  --sage-tint:    #E3EADD;
  --moss:         #7A9277;

  --danger:       #B85847;     /* used sparingly for problem accents */
  --gold:         #C8A560;

  /* Type scale */
  --f-sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-mono: "Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Radii */
  --r-pill: 999px;
  --r-card: 28px;
  --r-card-lg: 36px;
  --r-card-sm: 20px;
  --r-input: 14px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(15,20,16,0.04), 0 2px 8px rgba(15,20,16,0.04);
  --shadow-2: 0 4px 14px rgba(15,20,16,0.06), 0 14px 40px rgba(15,20,16,0.06);
  --shadow-3: 0 8px 30px rgba(15,20,16,0.10), 0 24px 80px rgba(15,20,16,0.10);
  --shadow-glow: 0 0 0 1px rgba(92,124,95,0.18), 0 12px 40px rgba(92,124,95,0.22);

  /* Motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --t-slow: 600ms;

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
}

/* Dark mode */
.theme-dark {
  --bg:           #0C100D;
  --bg-2:         #11161200;
  --surface:      #161B17;
  --surface-2:    #1B211D;
  --ink:          #F1EDE4;
  --ink-2:        #DDD8CD;
  --ink-soft:     #A2A89F;
  --ink-mute:     #707771;
  --line:         rgba(241, 237, 228, 0.10);
  --line-strong:  rgba(241, 237, 228, 0.18);
  --sage:         #91B093;
  --sage-deep:    #B7CFB8;
  --sage-soft:    #2A3A2C;
  --sage-tint:    #1A221C;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.4), 0 14px 40px rgba(0,0,0,0.4);
  --shadow-3: 0 8px 30px rgba(0,0,0,0.5), 0 24px 80px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(145,176,147,0.25), 0 12px 40px rgba(145,176,147,0.28);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: hidden; }
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--sage); color: var(--bg); }

/* ============================================================
   Type
   ============================================================ */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--sage);
  display: inline-block;
}
.eyebrow.no-dot::before { display: none; }

.display {
  font-family: var(--f-sans);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.96;
  font-size: clamp(44px, 8vw, 124px);
}
.display .ital { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.display .sage { color: var(--sage); }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.025em; }
h2 { font-size: clamp(34px, 5vw, 72px); line-height: 1.02; }
h3 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
h4 { font-size: 18px; letter-spacing: -0.01em; }
p  { margin: 0; }
.lede { font-size: clamp(18px, 1.6vw, 22px); color: var(--ink-soft); line-height: 1.45; max-width: 60ch; }
.muted { color: var(--ink-mute); }

.serif-ital { font-family: var(--f-serif); font-style: italic; font-weight: 400; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --pad-y: 14px;
  --pad-x: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  will-change: transform;
  white-space: nowrap;
  position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, var(--shadow-1);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, var(--shadow-2); }

.btn-sage {
  background: var(--sage);
  color: #fff;
  box-shadow: var(--shadow-1);
}
.btn-sage:hover { background: var(--sage-deep); box-shadow: var(--shadow-glow); }

.theme-dark .btn-sage { color: #0C100D; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }

.btn-soft {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-soft:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }

.btn-lg { --pad-y: 18px; --pad-x: 28px; font-size: 16px; }
.btn-sm { --pad-y: 10px; --pad-x: 16px; font-size: 14px; }

.btn .arrow { display: inline-block; transition: transform var(--t-med) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   Cards & containers
   ============================================================ */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-fast) var(--ease);
}
.card.interactive { cursor: pointer; }
.card.interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.chip.sage { color: var(--sage-deep); background: var(--sage-tint); border-color: transparent; }
.theme-dark .chip.sage { color: var(--sage-deep); }

/* ============================================================
   Sections
   ============================================================ */
section { padding: clamp(80px, 11vw, 160px) 0; position: relative; }
section.tight { padding: clamp(60px, 8vw, 110px) 0; }

.section-head { display: flex; flex-direction: column; gap: 20px; max-width: 800px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head h2 .ital { font-family: var(--f-serif); font-style: italic; font-weight: 400; }

/* ============================================================
   Navbar
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
  transition: backdrop-filter var(--t-med), background var(--t-med);
}
.nav.scrolled { background: rgba(241, 237, 228, 0.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.theme-dark .nav.scrolled { background: rgba(12,16,13,0.72); }

.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 8px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-pill {
  display: flex; align-items: center;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  gap: 2px;
}
.nav .links { display: flex; align-items: center; }
.nav .links button {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--ink-soft);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav .links button:hover { color: var(--ink); background: var(--bg-2); }
.nav .links button.active { color: var(--ink); background: var(--bg-2); }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; letter-spacing: -0.015em;
  font-size: 18px;
}
.logo .mark {
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--ink);
  display: grid; place-items: center;
  color: var(--bg);
  position: relative;
  overflow: hidden;
}

/* mobile nav */
.nav-mobile-btn { display: none; }
@media (max-width: 880px) {
  .nav .links { display: none; }
  .nav-mobile-btn { display: inline-flex; }
  .nav-pill { padding: 6px; }
  .nav-ctas-desktop { display: none; }
}

.nav-sheet {
  position: fixed; inset: 0;
  background: rgba(15,20,16,0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 20px 20px;
  animation: fade var(--t-med) var(--ease);
}
.nav-sheet-inner {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-3);
  animation: slideDown var(--t-med) var(--ease);
}
.nav-sheet-inner button {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--r-input);
  font-size: 18px;
}
.nav-sheet-inner button:hover { background: var(--bg-2); }
.nav-sheet-inner button.active { background: var(--sage-tint); color: var(--sage-deep); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(48px, 6vw, 96px) 0 clamp(80px, 10vw, 140px);
  overflow: hidden;
}
.hero-inner { max-width: var(--maxw); margin-inline: auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
.hero-eyebrow-row { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; flex-wrap: wrap; }
.hero-headline { margin-bottom: 36px; }
.hero-sub { font-size: clamp(18px, 1.7vw, 22px); color: var(--ink-soft); max-width: 56ch; line-height: 1.45; margin-bottom: 40px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-meta {
  display: flex; gap: 32px; margin-top: clamp(56px, 7vw, 96px);
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-meta .item { display: flex; flex-direction: column; gap: 4px; }
.hero-meta .item .v { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.hero-meta .item .l { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }

/* Hero ambient — particles & sage glow */
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg .glow {
  position: absolute;
  width: 800px; height: 800px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(92,124,95,0.22), transparent 60%);
  filter: blur(20px);
  top: -200px; right: -200px;
  animation: float 18s ease-in-out infinite;
}
.hero-bg .glow.two {
  width: 600px; height: 600px;
  background: radial-gradient(circle at center, rgba(200,165,96,0.10), transparent 60%);
  top: 40%; left: -200px;
  animation-duration: 22s; animation-delay: -8s;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(40px,-30px) scale(1.08); }
}

.particle-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.6; }

/* ============================================================
   Stats / Impact numbers
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(24px, 3vw, 48px) clamp(24px, 4vw, 64px);
}
.stat {
  grid-column: span 4;
  display: flex; flex-direction: column;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.stat:nth-child(1), .stat:nth-child(2), .stat:nth-child(3) { border-top: 1px solid var(--line); }
.stat .num {
  font-size: clamp(64px, 11vw, 156px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 4px;
}
.stat .num .plus { font-size: 0.55em; color: var(--sage); margin-left: 4px; transform: translateY(-0.4em); }
.stat .label { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); margin-top: 12px; }
.stat .desc  { font-size: 14px; color: var(--ink-soft); margin-top: 8px; max-width: 28ch; }

@media (max-width: 860px) {
  .stat { grid-column: span 6; }
  .stat .num { font-size: clamp(56px, 16vw, 96px); }
}
@media (max-width: 520px) {
  .stat { grid-column: span 12; }
}

/* Big impact figure (single huge counter on hero of Impact page) */
.mega-num {
  font-size: clamp(120px, 22vw, 320px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Problem cards
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ============================================================
   Bento grid (OurWork page)
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 300px 340px auto;
  gap: 10px;
}
@media (max-width: 860px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .bento-grid > * {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 240px;
  }
  .bento-grid > *:nth-child(1),
  .bento-grid > *:nth-child(5) { min-height: 340px; }
}
@media (max-width: 540px) {
  .bento-grid { grid-template-columns: 1fr; }
}

.problem-card {
  padding: 32px;
  display: flex; flex-direction: column;
  gap: 24px;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.problem-card .stat-mini {
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.problem-card .stat-mini .unit { font-size: 0.35em; color: var(--ink-mute); margin-left: 6px; font-weight: 400; }
.problem-card h3 { color: var(--ink); }
.problem-card .desc { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.problem-card .src { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.08em; margin-top: auto; }
.problem-card::before {
  content: "";
  position: absolute; right: -120px; top: -120px;
  width: 280px; height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(184,88,71,0.10), transparent 60%);
  transition: transform var(--t-slow) var(--ease);
}
.problem-card:hover::before { transform: scale(1.15) translate(-20px, 20px); }

/* ============================================================
   Solution tiles
   ============================================================ */
.sol-list { display: flex; flex-direction: column; gap: 14px; }
.sol-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
  background: var(--surface);
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all var(--t-med) var(--ease);
  position: relative;
  overflow: hidden;
}
.sol-row:hover {
  border-color: transparent;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.sol-row .idx {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  transition: color var(--t-fast);
}
.sol-row:hover .idx { color: var(--sage-soft); }
.sol-row .body { display: flex; flex-direction: column; gap: 6px; }
.sol-row .title { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; }
.sol-row .sub { font-size: 14px; color: var(--ink-soft); transition: color var(--t-fast); }
.sol-row:hover .sub { color: rgba(241, 237, 228, 0.6); }
.sol-row .cta {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--bg-2);
  display: grid; place-items: center;
  transition: all var(--t-med) var(--ease);
}
.sol-row:hover .cta { background: var(--sage); color: var(--bg); transform: rotate(-45deg); }

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  padding: 20px 0;
}
.marquee-track {
  display: flex; gap: 64px;
  animation: marq 36s linear infinite;
  width: max-content;
}
.marquee-track .m-item { display: flex; align-items: center; gap: 14px; font-family: var(--f-mono); letter-spacing: 0.04em; color: var(--ink-soft); font-size: 15px; white-space: nowrap; }
.marquee-track .m-item .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--sage); }
@keyframes marq {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   Stories / quotes
   ============================================================ */
.story {
  padding: clamp(28px, 3.4vw, 44px);
  display: flex; flex-direction: column;
  gap: 28px;
  min-height: 360px;
}
.story .quote {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.story .quote::before { content: "“"; margin-right: -0.1em; }
.story .quote::after  { content: "”"; }
.story .meta { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.story .meta .avatar {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--sage-tint);
  display: grid; place-items: center;
  color: var(--sage-deep);
  font-weight: 500;
}
.story .meta .name { font-weight: 500; font-size: 15px; }
.story .meta .role { font-size: 13px; color: var(--ink-mute); }

/* ============================================================
   Footer CTA
   ============================================================ */
.cta-block {
  margin: clamp(60px, 8vw, 120px) var(--gutter) clamp(40px, 5vw, 80px);
  border-radius: var(--r-card-lg);
  background: linear-gradient(160deg, var(--sage-deep) 0%, #1B2A1D 100%);
  color: var(--bg);
  padding: clamp(48px, 7vw, 110px);
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: "";
  position: absolute; right: -200px; bottom: -200px;
  width: 600px; height: 600px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(145,176,147,0.4), transparent 60%);
}
.cta-block h2 { font-size: clamp(40px, 6vw, 88px); letter-spacing: -0.03em; line-height: 1.0; max-width: 16ch; position: relative; }
.cta-block h2 .ital { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--sage-soft); }
.cta-block .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; position: relative; }
.cta-block .btn-primary { background: var(--bg); color: var(--ink); }
.cta-block .btn-ghost   { box-shadow: inset 0 0 0 1px rgba(241,237,228,0.3); color: var(--bg); }
.cta-block .btn-ghost:hover { background: rgba(241,237,228,0.08); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 60px var(--gutter) 32px;
  max-width: 1480px;
  margin-inline: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid h4 { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 18px; font-weight: 500; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { font-size: 14.5px; color: var(--ink-soft); transition: color var(--t-fast); }
.footer-grid a:hover { color: var(--ink); }

.footer-base { padding-top: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--ink-mute); }

/* ============================================================
   Page header
   ============================================================ */
.page-head {
  padding: clamp(48px, 7vw, 110px) 0 clamp(40px, 5vw, 80px);
}
.page-head h1 {
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.96;
  margin-bottom: 32px;
}
.page-head h1 .ital { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.page-head .lede { font-size: clamp(18px, 1.8vw, 24px); }

/* ============================================================
   Timeline (About)
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 40px;
  display: flex; flex-direction: column;
  gap: 12px;
}
.timeline::before {
  content: "";
  position: absolute; left: 11px; top: 12px; bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 10%, var(--line-strong) 90%, transparent);
}
.t-item {
  position: relative;
  padding: 24px 28px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all var(--t-med) var(--ease);
  cursor: pointer;
}
.t-item:hover { transform: translateX(6px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.t-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 28px;
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 2px solid var(--sage);
  transition: all var(--t-med) var(--ease);
}
.t-item:hover::before { background: var(--sage); box-shadow: 0 0 0 6px rgba(92,124,95,0.18); }
.t-item .date { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--sage); }
.t-item h3 { margin-top: 8px; font-size: 22px; }
.t-item p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; max-width: 60ch; }

/* ============================================================
   Program card
   ============================================================ */
.program-card {
  display: flex; flex-direction: column;
  padding: 36px;
  gap: 24px;
  min-height: 480px;
  position: relative;
  overflow: hidden;
}
.program-card .badge {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--sage-tint);
  color: var(--sage-deep);
  display: grid; place-items: center;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 30px;
  transition: all var(--t-med) var(--ease);
}
.program-card:hover .badge { background: var(--sage); color: #fff; transform: rotate(-6deg) scale(1.05); }
.program-card .req { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.program-card .req-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--ink-soft); }
.program-card .req-row .check { color: var(--sage); flex-shrink: 0; margin-top: 2px; }
.program-card .impact-row { padding: 16px; background: var(--bg-2); border-radius: var(--r-card-sm); display: flex; align-items: center; justify-content: space-between; }
.program-card .impact-row .v { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.program-card .impact-row .l { font-size: 12px; font-family: var(--f-mono); color: var(--ink-mute); letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================================================
   Impact dashboard
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.dash-card { padding: 28px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.dash-card.span-3 { grid-column: span 3; }
.dash-card.span-4 { grid-column: span 4; }
.dash-card.span-5 { grid-column: span 5; }
.dash-card.span-6 { grid-column: span 6; }
.dash-card.span-7 { grid-column: span 7; }
.dash-card.span-8 { grid-column: span 8; }
.dash-card.span-12 { grid-column: span 12; }
.dash-card .head { display: flex; align-items: center; justify-content: space-between; }
.dash-card .head .l { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.dash-card .head .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--sage-tint); color: var(--sage-deep); font-family: var(--f-mono); }
.dash-card .val { font-size: clamp(48px, 5.4vw, 80px); font-weight: 500; letter-spacing: -0.03em; line-height: 0.96; font-variant-numeric: tabular-nums; }
.dash-card .sub { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 980px) {
  .dash-card.span-3, .dash-card.span-4, .dash-card.span-5, .dash-card.span-6, .dash-card.span-7, .dash-card.span-8 { grid-column: span 12; }
}

.bar-row { display: flex; flex-direction: column; gap: 10px; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: 13px; }
.bar-row .bar-head .l { color: var(--ink); font-weight: 500; }
.bar-row .bar-head .v { font-family: var(--f-mono); color: var(--ink-soft); }
.bar-row .bar {
  height: 10px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-row .bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--sage-deep));
  border-radius: 999px;
  transition: width 1.2s var(--ease-out);
}

/* Spark/line chart vibe */
.spark { width: 100%; height: 110px; }

/* US states grid */
.states-map {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
}
.states-map .cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink-mute);
  display: grid; place-items: center;
  transition: all var(--t-fast);
  cursor: default;
}
.states-map .cell.active { background: var(--sage); color: var(--bg); }
.states-map .cell.active:hover { background: var(--sage-deep); transform: scale(1.1); }
.states-map .cell:hover { transform: scale(1.1); }

/* ============================================================
   Partners
   ============================================================ */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line);
}
@media (max-width: 720px) { .partner-grid { grid-template-columns: repeat(2, 1fr); } }

.partner-cell {
  background: var(--surface);
  padding: 36px;
  display: grid; place-items: center;
  aspect-ratio: 16/9;
  transition: background var(--t-fast);
  position: relative;
}
.partner-cell:hover { background: var(--bg-2); }
.partner-cell .name { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); text-align: center; }
.partner-cell .role { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; position: absolute; top: 14px; left: 14px; }

/* ============================================================
   Resources
   ============================================================ */
.res-card { padding: 28px; display: flex; flex-direction: column; gap: 18px; min-height: 240px; }
.res-card .kind { font-family: var(--f-mono); font-size: 11px; color: var(--sage); text-transform: uppercase; letter-spacing: 0.12em; }
.res-card h3 { font-size: 22px; }
.res-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; font-size: 13px; color: var(--ink-mute); }
.res-card .meta .dl { display: inline-flex; align-items: center; gap: 6px; transition: gap var(--t-fast); }
.res-card:hover .meta .dl { gap: 10px; color: var(--ink); }

/* ============================================================
   Donate
   ============================================================ */
.donate-card {
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 24px;
}
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .amounts { grid-template-columns: repeat(2, 1fr); } }
.amount-btn {
  padding: 18px 12px;
  border-radius: var(--r-card-sm);
  background: var(--bg-2);
  border: 1px solid transparent;
  font-size: 18px; font-weight: 500;
  letter-spacing: -0.01em;
  transition: all var(--t-fast);
}
.amount-btn:hover { border-color: var(--line-strong); }
.amount-btn.active { background: var(--ink); color: var(--bg); border-color: transparent; }
.amount-btn .label { display: block; font-size: 11px; color: var(--ink-mute); font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; font-weight: 400; }
.amount-btn.active .label { color: rgba(241,237,228,0.5); }
.custom-amount {
  margin-top: 10px;
  min-height: 58px;
  border-radius: var(--r-card-sm);
  background: var(--bg-2);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ink);
  transition: all var(--t-fast);
}
.custom-amount:hover,
.custom-amount:focus-within { border-color: var(--line-strong); }
.custom-amount.active {
  background: var(--ink);
  color: var(--bg);
  border-color: transparent;
}
.custom-amount span {
  font-size: 18px;
  font-weight: 500;
  color: inherit;
  opacity: 0.72;
}
.custom-amount input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
}
.custom-amount input::placeholder { color: var(--ink-mute); opacity: 1; }
.custom-amount.active input::placeholder { color: rgba(241,237,228,0.55); }

.donate-impact {
  padding: 22px;
  background: var(--sage-tint);
  border-radius: var(--r-card-sm);
  display: flex; gap: 14px; align-items: flex-start;
}
.theme-dark .donate-impact { background: var(--sage-tint); color: var(--ink); }
.donate-impact .icon {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--sage); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--f-serif); font-style: italic;
}
.donate-impact .txt { font-size: 14px; line-height: 1.45; color: var(--sage-deep); }
.donate-impact .txt b { font-weight: 500; }

.progress-block {
  padding: 22px;
  border-radius: var(--r-card-sm);
  background: var(--bg-2);
  display: flex; flex-direction: column; gap: 12px;
}
.progress-block .row { display: flex; justify-content: space-between; }
.progress-block .raised { font-size: 36px; font-weight: 500; letter-spacing: -0.02em; }
.progress-block .goal  { color: var(--ink-mute); font-size: 14px; }

/* ============================================================
   Join / Application
   ============================================================ */
.path-card {
  padding: 32px;
  display: flex; flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.path-card .icon-square {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  transition: transform var(--t-med);
}
.path-card:hover .icon-square { transform: rotate(-8deg); }
.path-card .commitment { display: flex; gap: 14px; font-size: 13px; color: var(--ink-mute); }
.path-card .commitment span { display: inline-flex; align-items: center; gap: 6px; }

.form-section { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.form-row input, .form-row select, .form-row textarea {
  padding: 14px 16px;
  border-radius: var(--r-input);
  background: var(--surface);
  border: 1px solid var(--line);
  font: inherit;
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(92,124,95,0.12);
}

/* ============================================================
   Reveal animations
   ============================================================ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

.stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.stagger.in > * { opacity: 1; transform: translateY(0); }
.stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.stagger.in > *:nth-child(2) { transition-delay: 60ms; }
.stagger.in > *:nth-child(3) { transition-delay: 120ms; }
.stagger.in > *:nth-child(4) { transition-delay: 180ms; }
.stagger.in > *:nth-child(5) { transition-delay: 240ms; }
.stagger.in > *:nth-child(6) { transition-delay: 300ms; }

/* ============================================================
   Misc utilities
   ============================================================ */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.divider { height: 1px; background: var(--line); margin: 80px 0; }

.icon-sm { width: 16px; height: 16px; display: inline-block; }
.icon-md { width: 22px; height: 22px; display: inline-block; }
.icon-lg { width: 28px; height: 28px; display: inline-block; }

/* Inline link */
.link-inline { color: var(--sage); border-bottom: 1px solid currentColor; transition: color var(--t-fast); }
.link-inline:hover { color: var(--sage-deep); }
.theme-dark .link-inline:hover { color: var(--sage-soft); }

/* hide scrollbar trail when overlay-scrolling */
.no-scroll { overflow: hidden; }

/* Page transition wrapper */
.page-wrap { animation: pageIn .42s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Mobile — comprehensive responsive overrides
   ============================================================ */
@media (max-width: 640px) {
  /* Hero: no forced min-height when content stacks, tighter padding */
  .hero-section {
    min-height: unset !important;
    padding: 48px 0 56px !important;
    align-items: flex-start !important;
  }

  /* Hero carousel: wider ratio saves ~70px of vertical space */
  .hero-slide-right > div { aspect-ratio: 16/9 !important; }

  /* Hero CTA buttons: full-width stacked */
  .hero-ctas-row { flex-direction: column !important; }
  .hero-ctas-row .btn { width: 100%; justify-content: center !important; }

  /* About portrait image: switch to landscape on mobile */
  .about-img-wrap { aspect-ratio: 4/3 !important; }

  /* Sections tighter on mobile */
  section { padding: clamp(48px, 12vw, 80px) 0; }
  section.tight { padding: clamp(36px, 10vw, 64px) 0; }

  /* Page headers */
  .page-head { padding: 40px 0 32px; }
  .page-head h1 { font-size: clamp(40px, 12vw, 72px); margin-bottom: 20px; }

  /* Sol rows — stack number and text on narrow screens */
  .sol-row { grid-template-columns: 40px 1fr auto; gap: 14px; padding: 20px; }
  .sol-row .title { font-size: clamp(18px, 5vw, 24px); }
  .sol-row .cta { width: 36px; height: 36px; }

  /* Program cards — reduce padding */
  .program-card { min-height: auto; padding: 24px; }

  /* CTA block — tighter */
  .cta-block { padding: clamp(32px, 8vw, 56px); margin: 40px var(--gutter) 32px; }
  .cta-block h2 { font-size: clamp(32px, 9vw, 56px); }

  /* Footer — single column on mobile */
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer { padding: 40px var(--gutter) 24px; }

  /* Hero buttons — stack on mobile */
  .hero-ctas { flex-direction: column; align-items: flex-start; }

  /* Forms — full width inputs */
  .form-row input, .form-row textarea, .form-row select { width: 100%; }
  .grid-2.form-grid { grid-template-columns: 1fr; }

  /* Nav CTA buttons already hidden at 880px */

  /* Story cards — reduce min-height */
  .story { min-height: auto; padding: 24px; }

  /* Cards — reduce padding */
  .card { border-radius: var(--r-card-sm); }

  /* Chips row — allow wrapping */
  .chip { font-size: 11px; padding: 4px 10px; }

  /* Section head — smaller bottom margin */
  .section-head { margin-bottom: clamp(32px, 8vw, 56px); }

  /* Don't animate stagger delays on mobile (feels slow) */
  .stagger.in > *:nth-child(n) { transition-delay: 0ms !important; }
}

@media (max-width: 480px) {
  /* Hero headline on very small phones */
  h2 { font-size: clamp(28px, 8vw, 48px); }
  h3 { font-size: clamp(20px, 6vw, 28px); }

  /* Buttons full-width in hero */
  .btn-lg { padding: 16px 20px; font-size: 15px; }

  /* Sol rows — hide index number */
  .sol-row .idx { display: none; }
  .sol-row { grid-template-columns: 1fr auto; }

  /* Popup: smaller padding, scrollable if needed */
  .join-popup-overlay { padding: 12px !important; }
  .join-popup-card { padding: 28px 20px 24px !important; }
}

/* ============================================================
   Hero animations
   ============================================================ */

/* ============================================================
   Chapters page — dark nav + pulse animation
   ============================================================ */
@keyframes chapterPulse {
  0%   { transform: scale(1);   opacity: 0.65; }
  70%  { transform: scale(2.4); opacity: 0;    }
  100% { transform: scale(2.4); opacity: 0;    }
}

.chapters-page footer { display: none !important; }

.chapters-page .nav {
  background: rgba(4, 10, 5, 0.88) !important;
  backdrop-filter: saturate(160%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(160%) blur(20px) !important;
}
.chapters-page .nav-pill {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.10) !important;
}
.chapters-page .nav .logo { color: rgba(241,237,228,0.9) !important; }
.chapters-page .nav .mark { background: rgba(241,237,228,0.15) !important; color: rgba(241,237,228,0.9) !important; }
.chapters-page .nav .links button { color: rgba(241,237,228,0.6) !important; }
.chapters-page .nav .links button:hover,
.chapters-page .nav .links button.active { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
.chapters-page .nav-inner > div:first-child > button { color: rgba(241,237,228,0.6) !important; }
.chapters-page .nav-inner > div:first-child > button:hover { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
.chapters-page .nav .btn-ghost { color: rgba(241,237,228,0.75) !important; box-shadow: inset 0 0 0 1px rgba(241,237,228,0.22) !important; }
.chapters-page .nav .btn-ghost:hover { background: rgba(255,255,255,0.08) !important; }
.chapters-page .nav .nav-mobile-btn { color: rgba(241,237,228,0.8) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18) !important; }

/* Typewriter cursor */
.tw-cursor {
  display: inline-block;
  width: 3px;
  background: var(--sage-soft);
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
  vertical-align: baseline;
  height: 0.85em;
  border-radius: 2px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* Animated line that draws in from left */
.hero-line {
  height: 2px;
  background: linear-gradient(90deg, var(--sage-soft), var(--sage));
  border-radius: 999px;
  width: 0;
  animation: drawLine 1s var(--ease-out) 0.3s forwards;
}
@keyframes drawLine { to { width: clamp(48px,8vw,96px); } }

/* Slide in from left */
.hero-slide-left {
  animation: slideFromLeft 0.9s var(--ease-out) both;
}
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
.hero-slide-right {
  animation: slideFromRight 0.9s var(--ease-out) 0.15s both;
}
@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Fade up for sub-elements */
.hero-fade-up {
  animation: heroFadeUp 0.8s var(--ease-out) 0.6s both;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide from left for reveals */
.reveal-left { opacity: 0; transform: translateX(-32px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-left.in { opacity: 1; transform: translateX(0); }

/* Slide from right for reveals */
.reveal-right { opacity: 0; transform: translateX(32px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-right.in { opacity: 1; transform: translateX(0); }

/* Mobile: replace slide animations with simple fade — translateX bleeds off right edge */
@media (max-width: 768px) {
  .hero-slide-left,
  .hero-slide-right { animation: heroFadeUp 0.8s var(--ease-out) both !important; animation-delay: 0s !important; }
  .reveal-left  { transform: translateY(20px) !important; }
  .reveal-right { transform: translateY(20px) !important; }
  .reveal-left.in  { transform: translateY(0) !important; }
  .reveal-right.in { transform: translateY(0) !important; }
}
