/* ============ YAPA — shared styles v1.1 ============ */
:root{
  --ivory:        #FAFAF8;
  --ivory-2:      #F4F3EE;
  --ivory-3:      #EFEDE6;
  --rule:         #E8E6DF;
  --rule-soft:    #EFEDE6;

  --ink:          #1F1F1F;
  --ink-2:        #2B2D28;
  --muted:        #6B6D64;
  --muted-2:      #8A8C82;
  --muted-3:      #B4B5AC;

  /* Brand orange — CTAs, buttons, primary action. */
  --orange:       #FF4500;
  --orange-2:     #E13C00;
  --orange-soft:  #FFD6C4;
  --orange-tint:  #FFF3EC;

  /* Deep green — meaning, continuity, Ndonga connection moments. */
  --green:        #1F3D2E;
  --green-2:      #2E5A45;
  --green-soft:   #9FC2A8;
  --green-tint:   #E9EFE8;

  /* Newsreader — warmer, more open than Instrument Serif; easy on the eyes. */
  --serif: "Newsreader", "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1240px;
  --gutter: clamp(24px, 5vw, 80px);
}

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

body{
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection{ background: var(--orange); color: var(--ivory); }
a{ color: inherit; text-decoration: none; }

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

h1,h2,h3,h4{
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

.italic{ font-style: italic; }

/* ============ NAV ============ */
header.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--ivory) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
header.nav.scrolled{ border-bottom-color: var(--rule); }

.nav-inner{
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand{
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.brand .mark{
  width: 22px; height: 24px; display: block;
}
.brand .word{
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.nav-links{
  display: flex; gap: 36px;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a{ position: relative; transition: color .2s ease; }
.nav-links a:hover, .nav-links a.current{ color: var(--ink); }
.nav-links a::after{
  content: "";
  position: absolute; left: 0; right: 0; bottom: -8px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover::after, .nav-links a.current::after{ transform: scaleX(1); }

.nav-cta{
  font-size: 14px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.nav-cta .arrow{
  width: 14px; height: 1px; background: currentColor; position: relative;
  transition: width .3s ease;
}
.nav-cta .arrow::after{
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.nav-cta:hover .arrow{ width: 22px; }
@media (max-width: 760px){ .nav-links{ display: none; } }

/* ============ NDONGA THREAD — global continuity line ============
   A 1px line that lives behind the page and is "drawn" as the user scrolls.
   It travels down the left margin, threading every page in the system.
*/
.ndonga-thread{
  position: fixed;
  top: 0; bottom: 0;
  left: clamp(20px, 3.6vw, 56px);
  width: 1px;
  z-index: 1;
  pointer-events: none;
}
.ndonga-thread .line{
  position: absolute; left: 0; top: 0;
  width: 1px;
  height: 0;          /* grows with scroll progress */
  background: linear-gradient(
    to bottom,
    transparent 0,
    color-mix(in oklab, var(--green) 60%, transparent) 12%,
    var(--green) 50%,
    color-mix(in oklab, var(--green) 60%, transparent) 88%,
    transparent 100%
  );
  opacity: .42;
  transition: height .12s linear;
}
.ndonga-thread .head{
  position: absolute; left: -2px; top: 0;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--green) 16%, transparent);
  transform: translateY(-3px);
  opacity: 0;
  transition: opacity .4s ease, transform .12s linear;
}
.ndonga-thread.live .head{ opacity: .85; }

/* Knots — small dots placed at section transitions, drawn through.
   Sections use class="ndonga-knot" to register one. */
.ndonga-knot{
  position: relative;
}
.ndonga-knot::before{
  content: "";
  position: fixed;            /* aligns with thread visually */
  pointer-events: none;
  display: none;              /* turned on by JS once measured */
}

/* Inline thread variants — used inside hero / section frames for local emphasis */
.thread-mark{
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--green);
  font-family: var(--serif); font-style: italic;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.thread-mark::before{
  content: ""; width: 28px; height: 1px; background: var(--green);
  opacity: .8;
}

@media (max-width: 720px){
  .ndonga-thread{ left: 14px; }
}
@media (prefers-reduced-motion: reduce){
  .ndonga-thread .line{ transition: none; height: 100% !important; opacity: .25; }
  .ndonga-thread .head{ display: none; }
}

/* ============ REVEAL ============ */
.reveal{
  opacity: 0; transform: translateY(14px);
  transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1);
}
.reveal.in{ opacity: 1; transform: none; }
.reveal.d1{ transition-delay: .08s; }
.reveal.d2{ transition-delay: .16s; }
.reveal.d3{ transition-delay: .24s; }
.reveal.d4{ transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* ============ TYPE ============ */
.eyebrow{
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .tick{ width: 18px; height: 1px; background: var(--muted-2); }

p.body{
  font-size: 16.5px; line-height: 1.7; color: var(--muted); max-width: 56ch;
}

.sec-index{
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.sec-index .num{
  font-family: var(--serif); font-style: italic;
  color: var(--orange); font-size: 15px; letter-spacing: 0;
}

/* ============ FOOTER ============ */
footer.foot{
  border-top: 1px solid var(--rule);
  padding: 56px 0 44px;
  color: var(--muted);
  font-size: 13.5px;
}
.foot-grid{
  display: grid; grid-template-columns: 1fr; gap: 36px; align-items: start;
}
@media (min-width: 780px){
  .foot-grid{ grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}
.foot .brand{ margin-bottom: 14px; }
.foot .brand .word{ font-size: 26px; }
.foot .tag{
  font-family: var(--serif); font-style: italic;
  color: var(--muted); max-width: 32ch; font-size: 16px; line-height: 1.45;
}
.foot h4{
  margin: 0 0 14px;
  font-family: var(--sans);
  font-weight: 500; font-size: 11.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
.foot ul{ list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot li a{ color: var(--muted); transition: color .2s ease; }
.foot li a:hover{ color: var(--ink); }
.foot-bottom{
  margin-top: 56px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted-2);
  border-top: 1px solid var(--rule); padding-top: 24px;
}
.foot-bottom .ony{ font-family: var(--serif); font-style: italic; }

/* ============ LINK-CTA ============ */
.link-cta{
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink); font-size: 15px;
  padding: 6px 0;
}
.link-cta .arrow{
  width: 16px; height: 1px; background: currentColor; position: relative;
  transition: width .3s ease;
}
.link-cta .arrow::after{
  content: ""; position: absolute; right: 0; top: -3px;
  width: 8px; height: 8px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.link-cta:hover .arrow{ width: 26px; }
.link-cta.orange{ color: var(--orange-2); }
.link-cta.green{ color: var(--green); }

/* Primary button — orange, for CTAs */
.btn{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: var(--orange);
  color: #fff;
  font-family: var(--sans);
  font-size: 14.5px; font-weight: 500;
  letter-spacing: 0.005em;
  border: 0; border-radius: 999px;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.btn:hover{ background: var(--orange-2); transform: translateY(-1px); }
.btn .arrow{
  width: 14px; height: 1px; background: currentColor; position: relative;
  transition: width .3s ease;
}
.btn .arrow::after{
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow{ width: 20px; }
.btn.ghost{
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule);
}
.btn.ghost:hover{ background: var(--ivory-2); border-color: #D7D4CA; }
