/* ══════════════════════════════════════════════════════════════
   The Henrietta Foundation
   Cream paper, brick-dust ink. Colours sampled from the hero film:
   fired clay, deep ochre, and the warm black of a Kisumu evening.

   Sections that invert (.section--dark) simply re-declare the text
   tokens below, so every component inside them flips automatically.
   ══════════════════════════════════════════════════════════════ */

:root {
  --cream:      #F7F2E8;
  --cream-2:    #F0E9DB;
  --ink:        #17130F;
  --ink-2:      #221C17;

  --text:       #17130F;
  --text-dim:   rgba(23, 19, 15, 0.66);
  --text-faint: rgba(23, 19, 15, 0.60);
  --rule:       rgba(23, 19, 15, 0.14);

  --clay:       #B4512A;
  --ochre:      #96690F;
  --ochre-lit:  #E3A93C;
  --leaf:       #4E6B3F;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --wrap:   1320px;
  --head-h: 5rem;               /* measured and rewritten by main.js */
  --ease:   cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--clay); color: var(--cream); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.85rem;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* ══════════ SHARED ══════════ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
}

.h2 {
  margin: 0 0 clamp(2rem, 4vw, 3.25rem);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.lead {
  font-size: clamp(1.12rem, 1.65vw, 1.4rem);
  line-height: 1.6;
  color: var(--text);
}

.lead--wide { max-width: 46ch; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.section { padding-block: clamp(5rem, 11vw, 9.5rem); }

.section--rule { border-top: 1px solid var(--rule); }

/* ── inverted panel ── */

.section--dark {
  background: var(--ink);
  color: var(--cream);

  --text:       #F1EBE0;
  --text-dim:   rgba(241, 235, 224, 0.66);
  --text-faint: rgba(241, 235, 224, 0.42);
  --rule:       rgba(241, 235, 224, 0.16);
  --clay:       #D9865E;
  --ochre:      var(--ochre-lit);
}

/* ── buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
              border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.btn--solid {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--cream);
}
.btn--solid:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }

.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { border-color: var(--text); transform: translateY(-2px); }

.btn--sm { padding: 0.6rem 1.35rem; font-size: 0.8rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.link-arrow {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--clay);
  transition: color 0.3s var(--ease);
}
.link-arrow span { display: inline-block; transition: transform 0.35s var(--ease); }
.link-arrow:hover { color: var(--text); }
.link-arrow:hover span { transform: translateX(6px); }

/* ══════════ HEADER ══════════ */

.site-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.15rem var(--gutter);
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
}

/* Height stays fixed so the hero can be sized against it exactly. */
.site-head.is-stuck {
  background: rgba(247, 242, 232, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  text-decoration: none;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--ochre-lit), var(--clay) 62%, #7A3218);
  flex: none;
}

.brand__text { display: flex; flex-direction: column; line-height: 1; }

.brand__name {
  font-family: var(--serif);
  font-size: 1.22rem;
  letter-spacing: 0.005em;
}

.brand__sub {
  margin-top: 0.22rem;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.site-nav { display: flex; gap: 2rem; }

.site-nav a {
  position: relative;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.burger {
  display: none;
  width: 40px;
  height: 34px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 8px;
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 20px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 var(--gutter);
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: clamp(2rem, 9vw, 3rem);
  text-decoration: none;
  padding-block: 0.35rem;
}
.mobile-menu__cta { color: var(--clay); }

/* ══════════ HERO ══════════
   Rule of this page: nothing is ever layered on top of the film.
   No scrim, no gradient, no vignette, no text over frame. The band
   fills the viewport beneath the header; the 16:9 source is cropped
   to fit by object-fit, never letterboxed. */

.hero { padding-top: var(--head-h); }

.hero__band {
  position: relative;
  width: 100%;
  height: calc(100svh - var(--head-h));
  overflow: hidden;
  background: var(--cream-2);
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.hero__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.95rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.hero__place {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sound {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.sound:hover { color: var(--text); border-color: var(--text-faint); }

.sound__icon {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 13px;
}
.sound__icon i {
  width: 2px;
  height: 3px;
  background: currentColor;
  border-radius: 1px;
  transition: height 0.3s var(--ease);
}
.sound[aria-pressed="true"] { color: var(--clay); border-color: var(--clay); }
.sound[aria-pressed="true"] .sound__icon i { animation: bars 1.1s var(--ease) infinite; }
.sound[aria-pressed="true"] .sound__icon i:nth-child(2) { animation-delay: 0.18s; }
.sound[aria-pressed="true"] .sound__icon i:nth-child(3) { animation-delay: 0.36s; }
.sound[aria-pressed="true"] .sound__icon i:nth-child(4) { animation-delay: 0.12s; }

@keyframes bars {
  0%, 100% { height: 3px; }
  50%      { height: 13px; }
}

.hero__type {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 7.4vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
}
.hero__title em {
  font-style: italic;
  color: var(--ochre);
}

.hero__lead {
  margin: 0 0 1.75rem;
  max-width: 44ch;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  color: var(--text-dim);
}

/* ══════════ TICKER ══════════ */

.ticker {
  overflow: hidden;
  padding-block: 1.1rem;
  border-block: 1px solid var(--rule);
  background: var(--cream-2);
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  width: max-content;
  animation: marquee 34s linear infinite;
}

.ticker__track span {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  color: var(--text-dim);
  white-space: nowrap;
}
.ticker__track i { color: var(--clay); font-style: normal; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ══════════ ABOUT ══════════ */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}

.about .lead { max-width: 30ch; }

.about__body p {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  max-width: 52ch;
}

/* ══════════ PROGRAM CARDS ══════════ */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.card {
  padding: clamp(2rem, 3.2vw, 3rem);
  background: var(--cream);
  transition: background 0.5s var(--ease);
}
.card:hover { background: var(--cream-2); }

.card__num {
  display: block;
  margin-bottom: 2.5rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--clay);
  letter-spacing: 0.1em;
}

.card h3 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.1;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

/* ══════════ IMPACT ══════════ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--rule);
}

.stat__num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 20ch;
  color: var(--text-dim);
}

.quote {
  margin: clamp(3rem, 6vw, 5rem) 0 0;
  max-width: 34ch;
}
.quote p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1.22;
  font-style: italic;
}
.quote cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ══════════ DONATE ══════════ */

.give {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.give__card {
  padding: clamp(1.75rem, 2.6vw, 2.4rem);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease);
}
.give__card:hover { border-color: var(--clay); transform: translateY(-3px); }

.give__card h3 {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clay);
}
.give__card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}
.give__card strong { color: var(--text); font-weight: 500; }

/* ══════════ CONTACT ══════════ */

.contact {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.contact__block { margin-bottom: 2.25rem; }

.contact__block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact__block p { margin: 0; color: var(--text-dim); }
.contact__block a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.contact__block a:hover { color: var(--clay); border-bottom-color: var(--clay); }

.contact__form { display: grid; gap: 1.25rem; }

.contact__form label { display: grid; gap: 0.5rem; }

.contact__form label > span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: 0.9rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  resize: vertical;
  transition: border-color 0.35s var(--ease);
}
.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-bottom-color: var(--clay);
}

.contact__form .btn { justify-self: start; margin-top: 0.75rem; }

.form-note {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.86rem;
  color: var(--leaf);
}
.form-note.is-error { color: var(--clay); }

/* ══════════ FOOTER ══════════ */

.site-foot {
  padding-block: 2.5rem;
  border-top: 1px solid var(--rule);
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.site-foot__line { font-family: var(--serif); font-size: 1rem; color: var(--text-dim); }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--clay); }

/* ══════════ REVEALS ══════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ══════════ RESPONSIVE ══════════ */

@media (max-width: 1000px) {
  .about,
  .contact { grid-template-columns: 1fr; }
  .cards,
  .give,
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* Three items in two columns leaves a hole; let the last one fill it,
     otherwise the grid's hairline backing shows through as a grey slab. */
  .cards .card:last-child,
  .give__card:last-child { grid-column: 1 / -1; }
  .hero__type { grid-template-columns: 1fr; align-items: start; }
  .hero__lead { max-width: 52ch; }
}

@media (max-width: 760px) {
  .site-nav,
  .head-cta { display: none; }
  .burger { display: block; }

  .hero__place { font-size: 0.58rem; letter-spacing: 0.12em; }

  .cards,
  .give,
  .stats { grid-template-columns: 1fr; }

  .card { padding: 2rem 1.5rem; }
  .card__num { margin-bottom: 1.5rem; }

  .btn { flex: 1 1 auto; justify-content: center; }
  .site-foot__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  /* Keep the location line on one row beside the sound pill. */
  .hero__place .opt { display: none; }
}

/* Landscape phones: a full-height band would leave no room to breathe. */
@media (max-height: 520px) and (orientation: landscape) {
  .hero__band { height: calc(100svh - var(--head-h)); min-height: 260px; }
}

/* ══════════ REDUCED MOTION ══════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .ticker__track { animation: none; }
}
