/* Rithi Africa. Tokens mirror the Rithi Africa Design System (tokens.json).
   Layout follows the "Rithi Africa Landing Redesign" canvas. */

/* Fonts: self-hosted Fontsource files, copied by scripts/build-assets.mjs. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/fraunces-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --surface: #F6F0E4;
  --surface-raised: #FFFDF8;
  --line: #E4DACA;
  --ink: #2E2118;
  --ink-muted: #6B5B4C;
  --leaf: #2F6B3A;
  --on-leaf: #FFFDF8;
  --forest: #1F4A28;
  --forest-raised: #2A5C34;
  --on-forest: #FFFDF8;
  --on-forest-muted: #D8E6CF;
  --leaf-soft: #9BC48A;
  --millet: #D9A441;
  --on-millet: #2E2118;
  --clay: #B5562B;
  --on-clay: #FFFDF8;
  --accent-text: #1F4A28;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --content: 1280px;
  --gutter: clamp(16px, 5.5vw, 80px);
  --section: clamp(64px, 9vw, 104px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #17120D;
    --surface-raised: #221A13;
    --line: #3A2E24;
    --ink: #F3ECE0;
    --ink-muted: #BFAF9C;
    --leaf: #7FB36E;
    --on-leaf: #17120D;
    --millet: #E0B25A;
    --on-millet: #17120D;
    --clay: #D9774B;
    --on-clay: #17120D;
    --accent-text: #9BC48A;
  }
}

/* Base */

html { scroll-padding-top: 96px; }

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2.75rem, 5.2vw + 1rem, 5.25rem); line-height: 1.05; }
h2 { font-size: clamp(2.25rem, 3vw + 1rem, 4rem); line-height: 1.07; }
h3 { font-size: clamp(1.75rem, 1.6vw + 1rem, 3rem); line-height: 1.1; }

p, ul, ol, dl, blockquote, figure { margin: 0; }

a { color: var(--leaf); text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lead { font-size: 1.125rem; line-height: 1.6; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 30;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-2); }

/* Buttons, tags, lists */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding-inline: 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible { border-radius: var(--radius-pill); }

.button-primary { background: var(--leaf); color: var(--on-leaf); }
.button-primary:hover { background: var(--forest); color: var(--on-forest); }
.button-cream { background: #FFFDF8; color: #1F4A28; }
.button-cream:hover { background: #D8E6CF; }
.button-ghost { border-color: #FFFDF8; color: #FFFDF8; }
.button-ghost:hover { background: rgba(255, 253, 248, 0.14); }
.button-forest { background: #1F4A28; color: #FFFDF8; }
.button-forest:hover { background: #2E2118; }

.button-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-inline: 14px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
}
.tag-millet { background: var(--millet); color: var(--on-millet); }
.tag-clay { background: var(--clay); color: var(--on-clay); }

.ticks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  list-style: none;
}
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks svg { flex-shrink: 0; margin-top: 1px; color: var(--leaf); }
.ticks-clay svg { color: var(--clay); }
.ticks-soft svg { color: var(--leaf-soft); }

.disc {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #FFFDF8;
  border: 8px solid var(--surface);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 48px; height: 48px; }
.brand-name { display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.brand-name strong { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; }
.brand-name span { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.32em; color: var(--ink-muted); }

.site-nav { display: flex; align-items: center; gap: var(--space-2); }
.site-nav ul { display: none; list-style: none; padding: 0; }
.site-nav ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.site-nav ul a:hover { color: var(--leaf); }
.site-nav .button { padding-inline: 22px; }

@media (min-width: 900px) {
  .site-nav ul { display: flex; }
  .site-nav .button { margin-left: var(--space-3); }
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  background: #1F4A28;
  color: #FFFDF8;
}
.hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-photo {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 70% 40%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(31, 74, 40, 0.15) 0%, rgba(31, 74, 40, 0.35) 30%, rgba(31, 74, 40, 0.9) 58%, rgba(31, 74, 40, 0.98) 100%);
}
.hero .container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(640px, 88vh, 720px);
  padding-block: 200px 104px;
}
.hero-copy { display: flex; flex-direction: column; gap: var(--space-4); max-width: 660px; }
.hero .eyebrow { color: #D8E6CF; }
.hero h1 { color: #FFFDF8; }
.hero .lead { max-width: 540px; color: #FFFDF8; }
.hero .button-row { margin-top: var(--space-3); }

.hero-chip {
  position: absolute;
  right: var(--gutter);
  top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-radius: var(--radius-pill);
  background: #FFFDF8;
  color: #2E2118;
  font-size: 0.875rem;
  font-weight: 600;
}
.hero-chip svg { color: #2F6B3A; }

.hero-seedling {
  position: absolute;
  right: var(--gutter);
  bottom: -56px;
  width: 112px;
  height: 112px;
}
.hero-seedling img { width: 68px; height: 68px; }

@media (min-width: 900px) {
  .hero::before {
    background: linear-gradient(90deg, rgba(31, 74, 40, 0.97) 0%, rgba(31, 74, 40, 0.92) 38%, rgba(31, 74, 40, 0.4) 62%, rgba(31, 74, 40, 0) 84%);
  }
  .hero .container { justify-content: center; padding-block: 112px 120px; }
  .hero-chip { top: auto; bottom: var(--space-5); }
  .hero-seedling {
    right: auto;
    left: 57%;
    bottom: -84px;
    width: 168px;
    height: 168px;
    border-width: 10px;
  }
  .hero-seedling img { width: 104px; height: 104px; }
}

/* About */

.about { padding-block: calc(var(--section) + 40px) var(--section); }
.about .container { display: grid; gap: var(--space-5); align-items: start; }

.about-main { display: flex; flex-direction: column; gap: var(--space-4); }
.about-quote {
  position: relative;
  padding: 32px 0 0 60px;
  border-top: 2px solid var(--leaf-soft);
}
.about-quote::before {
  content: "\201C";
  position: absolute;
  left: -6px;
  top: 8px;
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--millet);
}
.about-quote p:first-child {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.625rem, 1.6vw + 1rem, 2.5rem);
  line-height: 1.25;
  color: var(--accent-text);
}
.about-quote p + p { margin-top: 20px; color: var(--ink-muted); }

.about-side { display: flex; flex-direction: column; gap: var(--space-5); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.facts div { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); border-top: 2px solid var(--ink); }
.facts dd { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 1vw + 1rem, 2rem); font-weight: 600; line-height: 1.2; }

@media (min-width: 900px) {
  .about .container { grid-template-columns: 7fr 5fr; column-gap: var(--space-4); }
  .about-main { gap: var(--space-5); padding-right: var(--space-5); }
  .about-side { padding-top: 112px; }
}

/* Our work: zigzag rows */

.work { padding-bottom: var(--section); }
.work .container { display: flex; flex-direction: column; gap: clamp(72px, 7vw, 104px); }

.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.work-head > div { display: flex; flex-direction: column; gap: var(--space-3); }
.work-head .tags { flex-direction: row; gap: var(--space-2); }

.work-row { display: grid; gap: var(--space-6); align-items: center; }
.work-copy { display: flex; flex-direction: column; gap: 20px; }
.work-copy .lead { color: var(--ink-muted); }
.work-copy .ticks { margin-top: var(--space-2); }

.work-media { position: relative; margin: 0 24px 32px 0; }
.work-media::before {
  content: "";
  position: absolute;
  inset: 32px -24px -32px 24px;
  border-radius: var(--radius-lg);
  background: var(--millet);
}
.work-row-clay .work-media::before { background: var(--clay); }
.work-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--line);
}

.work-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.375rem, 1vw + 1rem, 1.75rem);
  line-height: 1.3;
  text-align: center;
  color: var(--accent-text);
}
.work-more::before, .work-more::after {
  content: "";
  flex: 0 0 48px;
  height: 2px;
  background: var(--leaf-soft);
}

@media (min-width: 900px) {
  .work-row { grid-template-columns: 640fr 528fr; gap: 112px; }
  .work-row-clay { grid-template-columns: 528fr 640fr; }
  .work-media { margin: 0; }
  .work-media::before { inset: 32px 24px -32px -24px; }
  .work-row-clay .work-media { order: 2; }
  .work-row-clay .work-media::before { inset: 32px -24px -32px 24px; }
}

/* Photo strip */

.strip {
  padding-block: 72px 80px;
  background: var(--surface-raised);
  border-block: 1px solid var(--line);
  overflow: hidden;
}
.strip .container { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
.strip h2 { font-size: clamp(2rem, 2vw + 1rem, 3rem); }

.strip-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  padding-block: 20px;
}
.strip-viewport::-webkit-scrollbar { display: none; }
.strip-track { display: flex; width: max-content; padding-inline: var(--gutter) calc(var(--gutter) + 32px); }
.strip-set { display: flex; align-items: center; }
.strip-set[aria-hidden="true"] { display: none; }
.strip img {
  flex-shrink: 0;
  width: clamp(260px, 30vw, 440px);
  aspect-ratio: 3 / 2;
  margin-right: -32px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 8px solid var(--surface-raised);
  scroll-snap-align: start;
  position: relative;
  background: var(--line);
}
.strip img:nth-child(odd) { transform: rotate(-2deg); z-index: 1; }
.strip img:nth-child(even) { transform: rotate(2deg); z-index: 2; }

/* How we work */

.how { padding-block: var(--section); }
.how .container { display: flex; flex-direction: column; gap: 56px; }
.how-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: 720px; }

.timeline { position: relative; }
.timeline-curve { display: none; }
.steps {
  position: relative;
  display: grid;
  gap: var(--space-5);
  padding: 0 0 0 28px;
  list-style: none;
  border-left: 3px dotted var(--leaf-soft);
}
.steps li { display: flex; flex-direction: column; gap: var(--space-3); }
.step-photo {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--surface-raised);
  box-shadow: 0 0 0 1px var(--line);
  background: var(--line);
}
.steps h3 { font-size: clamp(1.5rem, 0.8vw + 1rem, 2rem); line-height: 1.2; }
.steps p { max-width: 340px; color: var(--ink-muted); }

@media (min-width: 900px) {
  .timeline-curve { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 240px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; border: 0; }
  .steps li:nth-child(2) { padding-top: 56px; }
  .steps li:nth-child(3) { padding-top: 112px; }
  .step-photo { width: 136px; height: 136px; }
}

/* Get involved */

.involved {
  position: relative;
  overflow: hidden;
  padding-block: var(--section);
  background: #1F4A28;
  color: #FFFDF8;
}
.involved-leaf {
  position: absolute;
  left: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  opacity: 0.18;
  pointer-events: none;
}
.involved .container { position: relative; display: grid; gap: var(--space-5); align-items: start; }
.involved-intro { display: flex; flex-direction: column; gap: var(--space-4); }
.involved-intro .eyebrow, .involved-intro .lead { color: #D8E6CF; }
.involved-intro h2 { color: #FFFDF8; font-size: clamp(2.5rem, 3.5vw + 1rem, 4.5rem); }

.contact-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); padding: 0; list-style: none; }
.contact-list li { display: flex; align-items: center; gap: var(--space-3); }
.contact-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.12);
  color: #FFFDF8;
}
.contact-list div span { display: block; font-size: 0.875rem; color: #D8E6CF; }
.contact-list a { font-size: 1.25rem; font-weight: 600; color: #FFFDF8; overflow-wrap: anywhere; }

.paths { display: flex; flex-direction: column; gap: var(--space-4); }
.path {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 28px var(--space-4);
  border-radius: var(--radius-lg);
}
.path-body { display: flex; flex-direction: column; gap: var(--space-3); }
.path h3 { font-size: clamp(1.75rem, 1vw + 1rem, 2.25rem); line-height: 1.15; }
.path .lead { font-size: 1.0625rem; }
.path-partner { background: #D9A441; color: #2E2118; }
.path-volunteer { background: var(--forest-raised); color: #FFFDF8; }
.path-volunteer .lead { color: #D8E6CF; }
.path .button-row { margin-top: var(--space-2); }
.involved :focus-visible { outline-color: #FFFDF8; }
.path-partner :focus-visible { outline-color: #2E2118; }

@media (min-width: 720px) {
  .path { padding: 36px 40px; }
}
@media (min-width: 1024px) {
  .involved .container { grid-template-columns: 5fr 7fr; column-gap: var(--space-4); }
  .involved-intro { padding-right: var(--space-5); }
  .path-volunteer { margin-left: 48px; }
}

/* Footer */

.site-footer { padding-block: 72px 48px; }
.site-footer .container { display: flex; flex-direction: column; gap: 48px; }
.footer-top { display: grid; gap: var(--space-5); }
.footer-brand { display: flex; flex-direction: column; gap: var(--space-3); color: var(--ink-muted); }
.footer-brand .brand img { width: 56px; height: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h2 { font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; padding: 0; list-style: none; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-muted);
}
.footer-bottom a { color: var(--ink-muted); }
.footer-bottom .credits { max-width: 900px; }

@media (min-width: 720px) {
  .footer-top { grid-template-columns: 6fr 3fr 3fr; }
  .footer-bottom .credits { text-align: right; }
}

/* Motion. Decoration only: the page is complete without any of it. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero-photo { animation: hero-zoom 20s ease-in-out infinite alternate; }
  .hero-seedling { animation: float 6s ease-in-out infinite; }

  /* Photo strip marquee on larger screens; phones keep swipe and snap. */
  @media (min-width: 900px) {
    .strip-viewport { overflow: hidden; scroll-snap-type: none; }
    .strip-track { padding-inline: 0; animation: marquee 60s linear infinite; }
    .strip-set[aria-hidden="true"] { display: flex; }
    .strip-viewport:hover .strip-track,
    .strip-viewport:focus-within .strip-track { animation-play-state: paused; }
  }

  /* Scroll-driven reveals and parallax, only where the browser supports them. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 25%;
    }
    .work-photo {
      animation: drift-up linear both;
      animation-timeline: view();
    }
    .work-media::before {
      animation: drift-down linear both;
      animation-timeline: view();
    }
  }
}

@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes rise { from { translate: 0 20px; } to { translate: 0 0; } }
@keyframes drift-up { from { translate: 0 20px; } to { translate: 0 -20px; } }
@keyframes drift-down { from { translate: 0 -20px; } to { translate: 0 20px; } }
