/* ===== KM360 — Editorial Agritech Design System ===== */

:root {
  /* KM360 brand palette
     ─ derived from KME pitch deck ─
     Navy   #04215E   primary brand · ink-tier
     Royal  #00227C
     Forest #134E1A
     Emerald#06A05F   secondary brand
     Lime   #7ECD26   highlight only
  */

  /* paper — warm off-white kept; pairs cleanly with deep navy ink */
  --paper:        oklch(0.972 0.011 90);
  --paper-2:      oklch(0.945 0.013 88);
  --paper-3:      oklch(0.910 0.014 86);

  /* ink shifted to deep KM360 navy (#04215E) — used for body copy + headings */
  --ink:          oklch(0.225 0.115 264);
  --ink-2:        oklch(0.345 0.085 262);
  --sub:          oklch(0.520 0.045 258);
  --rule:         oklch(0.820 0.018 258);
  --rule-2:       oklch(0.885 0.014 258);

  /* brand tokens for direct use */
  --km-navy:      oklch(0.225 0.115 264); /* #04215E */
  --km-royal:     oklch(0.275 0.165 266); /* #00227C */
  --km-forest:    oklch(0.380 0.110 145); /* #134E1A */
  --km-emerald:   oklch(0.595 0.155 152); /* #06A05F */
  --km-lime:      oklch(0.815 0.205 132); /* #7ECD26 */

  /* per-product accent — overridden on each page */
  --accent:       var(--km-emerald);
  --accent-ink:   oklch(0.30 0.10 152);
  --accent-soft:  oklch(0.92 0.06 152);
  --accent-fg:    var(--paper);

  /* type */
  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --sans:  'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper grain — subtle film */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }

/* ───────── nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.nav__mark {
  width: 22px; height: 22px;
  background: var(--ink);
  position: relative;
  border-radius: 2px;
}
.nav__mark::before, .nav__mark::after {
  content: ""; position: absolute;
  background: var(--paper);
}
.nav__mark::before { left: 4px; right: 4px; top: 10px; height: 2px; }
.nav__mark::after { top: 4px; bottom: 4px; left: 10px; width: 2px; }
.nav__crumb {
  display: flex; gap: 18px;
  color: var(--sub);
}
.nav__crumb b { color: var(--ink); font-weight: 600; }
.nav__cta {
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 600;
  background: var(--ink); color: var(--paper);
  transition: background 0.18s, color 0.18s;
}
.nav__cta:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* ───────── shared layout ───────── */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}
.wrap--wide { max-width: 1440px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sub);
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  display: inline-block;
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sub);
}

.h-display {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(72px, 13vw, 200px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.h-display em, .h-display .roman { font-style: normal; }
.h-display .accent { color: var(--accent); }

.h-1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.h-1 .roman { font-style: normal; }

.h-2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 64ch;
  text-wrap: pretty;
}

/* ───────── hero ───────── */
.hero {
  position: relative;
  padding: 56px 0 72px;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: end;
}
.hero__meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sub);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-top: 56px;
}
.hero__meta dt {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sub);
  font-weight: 500;
  margin-bottom: 6px;
}
.hero__meta dd {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

/* photo plate — placeholder for real imagery */
.plate {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  aspect-ratio: 4/5;
  overflow: hidden;
  background-image:
    linear-gradient(135deg,
      color-mix(in oklch, var(--accent) 18%, var(--paper-2)) 0%,
      var(--paper-2) 60%,
      color-mix(in oklch, var(--accent) 8%, var(--paper-2)) 100%
    ),
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 8px,
      color-mix(in oklch, var(--accent) 7%, transparent) 8px,
      color-mix(in oklch, var(--accent) 7%, transparent) 9px
    );
}
.plate__caption {
  position: absolute;
  left: 16px; bottom: 16px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sub);
  background: color-mix(in oklch, var(--paper) 80%, transparent);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border: 1px solid var(--rule);
}
.plate__tag {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  padding: 6px 10px;
}
.plate--landscape { aspect-ratio: 3/2; }
.plate--square { aspect-ratio: 1/1; }

/* ───────── sections ───────── */
section { padding: 96px 0; border-bottom: 1px solid var(--rule); }
section.tight { padding: 64px 0; }
section.dark {
  background: var(--ink);
  color: var(--paper);
  border-bottom-color: var(--ink);
}
section.dark .kicker, section.dark .eyebrow { color: color-mix(in oklch, var(--paper) 60%, transparent); }
section.dark .lede { color: color-mix(in oklch, var(--paper) 80%, transparent); }
section.dark .h-1, section.dark .h-2, section.dark .h-display { color: var(--paper); }

section.accent {
  background: var(--accent);
  color: var(--accent-fg);
  border-bottom-color: var(--accent);
}
section.accent .kicker, section.accent .eyebrow { color: color-mix(in oklch, var(--accent-fg) 70%, transparent); }
section.accent .lede { color: color-mix(in oklch, var(--accent-fg) 88%, transparent); }
section.accent .h-1, section.accent .h-2 { color: var(--accent-fg); }

.section__head {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 56px;
  margin-bottom: 56px;
  align-items: end;
}
.section__head .eyebrow { align-self: start; padding-top: 8px; }

/* ───────── numbered features ───────── */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
.feature {
  border-bottom: 1px solid var(--rule);
  padding: 36px 32px 36px 0;
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
}
.feature:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 56px; }
.feature:nth-child(even) { padding-left: 56px; padding-right: 0; }
.feature__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--sub);
  padding-top: 6px;
}
.feature__num b {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
  font-weight: 400;
  margin-bottom: 8px;
}
.feature__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.feature__copy {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  max-width: 44ch;
}

/* ───────── steps ───────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.step {
  background: var(--paper);
  padding: 36px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 320px;
}
.step__num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sub);
  letter-spacing: 0.08em;
}
.step__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  margin: 0;
  font-weight: 400;
}
.step__copy { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; flex: 1; }
.step__channel {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  display: flex; gap: 14px; flex-wrap: wrap;
}

/* ───────── stat strip ───────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.stat {
  padding: 32px 24px 28px;
  border-right: 1px solid color-mix(in oklch, currentColor 20%, transparent);
  display: flex; flex-direction: column; gap: 8px;
}
.stat:last-child { border-right: none; }
.stat__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat__label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* ───────── pull quote ───────── */
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 22ch;
}
.quote::before { content: "“"; color: var(--accent); }
.quote::after { content: "”"; color: var(--accent); }

/* ───────── cta strip ───────── */
.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  padding: 80px 0 80px;
}
.cta__buttons { display: flex; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.16s ease, background 0.18s, color 0.18s, border-color 0.18s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn .arrow { display: inline-block; transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ───────── footer ───────── */
.footer {
  padding: 56px 0 36px;
  background: var(--ink);
  color: color-mix(in oklch, var(--paper) 80%, transparent);
  font-family: var(--mono);
  font-size: 12px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  border-bottom: 1px solid color-mix(in oklch, var(--paper) 20%, transparent);
  padding-bottom: 36px;
  margin-bottom: 24px;
}
.footer__col h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: color-mix(in oklch, var(--paper) 60%, transparent);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer__col a { display: block; padding: 4px 0; color: color-mix(in oklch, var(--paper) 92%, transparent); }
.footer__col a:hover { color: var(--accent); }
.footer__sig {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--paper);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.footer__small {
  display: flex; justify-content: space-between;
  color: color-mix(in oklch, var(--paper) 50%, transparent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ───────── ecosystem cards (used on index) ───────── */
.eco {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.eco__card {
  background: var(--paper);
  padding: 36px 32px 32px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: start;
  position: relative;
  transition: background 0.2s;
}
.eco__card:hover { background: var(--paper-2); }
.eco__card:hover .eco__arrow { transform: translate(4px, -4px); }
.eco__num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sub);
  padding-top: 4px;
}
.eco__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 38px;
  line-height: 0.95;
  margin: 0 0 10px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.eco__name .swahili { color: var(--accent-c); }
.eco__cat {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sub);
  margin-bottom: 14px;
}
.eco__desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; max-width: 38ch; }
.eco__arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  font-family: var(--mono);
  color: var(--ink);
}
.eco__card:hover .eco__arrow { background: var(--accent-c); border-color: var(--accent-c); color: var(--paper); }

/* ───────── small bits ───────── */
.tag-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tag {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--paper);
}
.tag.is-accent { border-color: var(--accent); color: var(--accent); }
.tag.is-filled { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.divider {
  height: 1px; background: var(--rule); margin: 0;
}

/* responsive */
@media (max-width: 980px) {
  .nav { padding: 14px 20px; }
  .wrap { padding: 0 20px; }
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__meta { grid-template-columns: repeat(2, 1fr); }
  .section__head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .features { grid-template-columns: 1fr; }
  .feature:nth-child(odd) { border-right: none; padding-right: 0; }
  .feature:nth-child(even) { padding-left: 0; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid color-mix(in oklch, currentColor 20%, transparent); }
  .stat:nth-child(odd) { border-right: 1px solid color-mix(in oklch, currentColor 20%, transparent); }
  .cta { grid-template-columns: 1fr; }
  .eco { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  section { padding: 64px 0; }
}

/* page-load reveal */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both; }
.rise.d1 { animation-delay: 0.05s; }
.rise.d2 { animation-delay: 0.15s; }
.rise.d3 { animation-delay: 0.25s; }
.rise.d4 { animation-delay: 0.35s; }
.rise.d5 { animation-delay: 0.45s; }
