/* Sovereign Funding Opportunity Agent: landing page.
   Palette taken from the continent's own materials, used with restraint:
   Sahel sand (ground), laterite (earth roads), ochre (savanna grass), indigo (adire and adinkra dyes),
   baobab bark (ink). Status uses lightness as well as hue, and always an icon and a word. */
:root {
  --sand: #F6F0E6; --sand-2: #EFE5D6; --paper: #FFFDF9;
  --ink: #1F1B16; --ink-2: #5C544A; --ink-3: #8A8075;
  --laterite: #A9432A; --ochre: #D59A2E; --indigo: #1E3557; --baobab: #6B5A48;
  --st-final: #1E3557; --st-combined: #B5492E; --st-first: #E0A93C; --st-none: #E6DAC6; --st-none-line: #CDBFA9;
  --line: rgba(31,27,22,.10); --glass: rgba(255,253,249,.72);
  --shadow: 0 1px 2px rgba(31,27,22,.06), 0 12px 32px rgba(31,27,22,.10);
  --r: 18px; --r-s: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, Arial, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--sand);
  -webkit-font-smoothing: antialiased; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--paper); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 6px; }

/* Woven strip: an abstract over-under weave, a hairline nod to strip-woven cloth */
.weave { height: 6px; background:
  repeating-linear-gradient(90deg, var(--laterite) 0 14px, transparent 14px 18px, var(--ochre) 18px 32px, transparent 32px 36px, var(--indigo) 36px 50px, transparent 50px 54px),
  repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.35) 7px 9px); opacity: .9; }

/* Navigation: translucent, out of the way */
.nav { position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 24px; height: 24px; color: var(--laterite); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; } .nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font: 500 13px var(--font); padding: 6px 12px; border-radius: 999px; cursor: default; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.ok .dot { background: #2E8B57; } .pill.bad .dot { background: var(--laterite); }
.search-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.search-btn svg { width: 16px; height: 16px; } kbd { font: 12px var(--font); color: var(--ink-3); }

/* Hero: the map is the interface */
.hero { max-width: 1280px; margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: minmax(380px, 11fr) 13fr; gap: 40px; align-items: center; }
.eyebrow { font: 600 13px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--laterite); margin: 0 0 14px; }
h1 { font: 700 clamp(34px, 3.9vw, 54px)/1.05 var(--display); letter-spacing: -.035em; margin: 0 0 18px; }
.lede { font-size: 20px; color: var(--ink-2); max-width: 30ch; margin: 0 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.btn { font: 600 15px var(--font); border-radius: 999px; padding: 12px 22px; cursor: pointer; border: 1px solid transparent; transition: transform .2s var(--ease), background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--sand); } .btn.primary:hover { background: var(--indigo); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: var(--paper); }
.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 32px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dt { color: var(--ink-3); font-size: 13px; } .stats dd { margin: 0; font: 700 32px/1 var(--display); letter-spacing: -.02em; }
.fine { color: var(--ink-3); font-size: 12.5px; max-width: 60ch; }

.map-wrap { position: relative; margin: 0; }
#africa { width: 100%; height: auto; max-height: calc(100vh - 250px); min-height: 420px; display: block; margin: 0 auto; overflow: visible;
  filter: drop-shadow(0 18px 40px rgba(169,67,42,.10)); }
.country { fill: var(--st-none); stroke: var(--paper); stroke-width: .8; transition: fill .3s var(--ease), transform .35s var(--ease), opacity .3s; transform-box: fill-box; transform-origin: center; cursor: pointer; }
.country.final { fill: var(--st-final); } .country.combined { fill: var(--st-combined); } .country.first { fill: var(--st-first); }
.country.disputed { fill: url(#hatch); cursor: default; stroke-dasharray: 3 2; stroke: var(--st-none-line); }
.country:hover, .country:focus-visible, .country.hot { transform: scale(1.035); filter: drop-shadow(0 6px 10px rgba(31,27,22,.25)); outline: none; }
.country.dim { opacity: .28; }
.country.theme-weak { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 3 2; }
.country.theme-exception { stroke: var(--ink); stroke-width: 1.6; }
.island { fill: var(--st-none); stroke: var(--st-none-line); }
.label { font: 600 11px var(--font); fill: var(--paper); pointer-events: none; letter-spacing: .02em; }
.label.dark { fill: var(--ink); }
.tooltip { position: absolute; pointer-events: none; min-width: 220px; max-width: 300px; padding: 12px 14px; border-radius: var(--r-s); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; }
.tooltip h4 { margin: 0 0 4px; font: 600 15px var(--display); } .tooltip p { margin: 0; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.final { background: var(--st-final); } .sw.combined { background: linear-gradient(135deg, var(--st-combined) 50%, color-mix(in srgb, var(--st-combined) 55%, white) 50%); } .sw.first { background: var(--st-first); border-radius: 50%; } .sw.none { background: var(--st-none); border: 1px solid var(--st-none-line); }

/* Sections */
section { scroll-margin-top: 80px; }
.section-head { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.section-head h2 { font: 700 34px/1.1 var(--display); letter-spacing: -.025em; margin: 0 0 8px; }
.section-head p { color: var(--ink-2); max-width: 62ch; margin: 0 0 24px; }
.themes, .window, .method, .runs { padding: 64px 0 24px; }
.chips { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font: 500 14px var(--font); color: var(--ink); cursor: pointer; transition: background .2s, transform .2s var(--ease); }
.chip:hover, .chip[aria-pressed="true"] { background: var(--ink); color: var(--sand); }
.chip small { color: var(--ink-3); margin-left: 6px; } .chip:hover small, .chip[aria-pressed="true"] small { color: var(--sand-2); }

/* Timeline */
.timeline { max-width: 1240px; margin: 0 auto; padding: 8px 24px 8px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; }
.event { scroll-snap-align: start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); position: relative; }
.event time { font: 600 13px var(--font); color: var(--laterite); }
.event p { margin: 6px 0 10px; font-size: 14px; }
.event .isos { display: flex; gap: 6px; }
.iso { font: 600 11px var(--font); padding: 2px 8px; border-radius: 999px; background: var(--sand-2); color: var(--ink-2); cursor: pointer; border: 0; }

/* Method */
.flow { list-style: none; max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font: 650 19px var(--display); letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.step { font: 600 12px var(--font); color: var(--ink-3); }
.gate { font: 600 12px var(--font); color: var(--indigo); background: color-mix(in srgb, var(--indigo) 10%, transparent); padding: 6px 10px; border-radius: 8px; }

.principles { max-width: 1240px; margin: 28px auto 0; padding: 0 24px; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 28px; color: var(--ink-2); font-size: 14px; }
.principles b { color: var(--ink); }

/* Runs */
.run-list { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; gap: 12px; }
.run { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.stages { display: flex; gap: 4px; flex-wrap: wrap; }
.stg { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; background: var(--sand-2); color: var(--ink-3); }
.stg.complete { background: color-mix(in srgb, #2E8B57 18%, transparent); color: #1F6B42; }
.stg.running { background: color-mix(in srgb, var(--ochre) 30%, transparent); color: var(--ink); }
.stg.pending { background: var(--indigo); color: #fff; } .stg.blocked { background: var(--laterite); color: #fff; }
.empty { color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r); padding: 24px; text-align: center; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(14,19,32,.28); z-index: 30; animation: fade .25s; }
.sheet { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100% - 24px)); background: var(--paper); border-radius: 22px; z-index: 31; box-shadow: var(--shadow); padding: 28px; overflow: auto; animation: slide .35s var(--ease); }
.sheet h2 { font: 700 34px/1.05 var(--display); letter-spacing: -.03em; margin: 6px 0 4px; }
.sheet .status { display: inline-flex; gap: 6px; font: 600 13px var(--font); padding: 4px 10px; border-radius: 999px; background: var(--sand-2); }
.sheet h3 { font: 600 13px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 22px 0 8px; }
.sheet ul { margin: 0; padding-left: 18px; } .sheet li { margin-bottom: 8px; }
.sheet .actions { display: grid; gap: 10px; margin-top: 22px; }
.choice { text-align: left; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--sand); padding: 12px 14px; cursor: pointer; color: var(--ink); }
.choice strong { display: block; font-size: 15px; } .choice span { color: var(--ink-2); font-size: 13px; }
.choice:hover { border-color: var(--ink); }
.close { position: absolute; top: 14px; right: 16px; border: 0; background: var(--sand-2); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--ink); }

/* Dialogs */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(14,19,32,.35); backdrop-filter: blur(4px); }
.modal form { width: min(680px, 94vw); background: var(--paper); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.modal h2 { margin: 0; font: 700 28px var(--display); letter-spacing: -.02em; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sand-2); padding: 4px; border-radius: 12px; margin: 16px 0 8px; }
.seg input { position: absolute; opacity: 0; } .seg span { display: block; text-align: center; padding: 8px 4px; border-radius: 9px; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 3px solid var(--ochre); }
.mode-help { color: var(--ink-2); font-size: 13.5px; min-height: 40px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid2 label { display: flex; flex-direction: column; font: 600 12.5px var(--font); color: var(--ink-2); gap: 6px; }
.grid2 .wide { grid-column: 1 / -1; }
input, select { font: 15px var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--sand); color: var(--ink); }
.toggles { display: grid; gap: 10px; margin: 16px 0; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; } .switch em { color: var(--ink-3); font-style: normal; font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; } .switch span { width: 40px; height: 24px; border-radius: 999px; background: var(--st-none-line); position: relative; flex: none; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + span { background: #2E8B57; } .switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.palette { margin-top: 12vh; }
.palette[open] { width: min(560px, 92vw); background: var(--glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 18px; padding: 16px 18px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; }
.palette li[aria-selected="true"], .palette li:hover { background: var(--ink); color: var(--sand); }
.palette li small { color: inherit; opacity: .6; }

.foot { margin-top: 64px; } .foot p { max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px; color: var(--ink-3); font-size: 12.5px; }

@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero-copy > * { animation: rise .6s var(--ease) both; } .hero-copy > *:nth-child(2) { animation-delay: .05s; } .hero-copy > *:nth-child(3) { animation-delay: .1s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; padding-top: 32px; } .flow { grid-template-columns: 1fr 1fr; } .principles { grid-template-columns: 1fr; } .nav-links { display: none; } }
@media (max-width: 560px) { .flow, .grid2 { grid-template-columns: 1fr; } .seg { grid-template-columns: 1fr 1fr; } .brand span { display: none; } }

.theme-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; justify-content: center; flex-wrap: wrap; }
.theme-label { font: 600 12px var(--font); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.theme-bar .chips { padding: 0; margin: 0; gap: 6px; justify-content: center; }
.theme-bar .chip { padding: 5px 10px; font-size: 13px; }
.theme-caption { text-align: center; color: var(--ink-2); font-size: 13.5px; min-height: 42px; margin: 10px auto 0; max-width: 60ch; }
.timeline { grid-auto-columns: minmax(250px, 1fr); align-items: start; }
.quarter { scroll-snap-align: start; display: grid; gap: 10px; }
.quarter header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; border-bottom: 2px solid var(--line); }
.quarter header strong { font: 700 20px var(--display); letter-spacing: -.01em; }
.quarter header span { font: 600 12px var(--font); color: var(--ink-3); }
.quarter.busy header { border-color: var(--ochre); } .quarter.busy header span { color: var(--laterite); }

.btn:disabled { opacity: .4; cursor: not-allowed; }
.seg { grid-template-columns: repeat(4, 1fr); }
#calNote, #seedNote { margin-top: 12px; } .window > #calNote { max-width: 1240px; margin: 12px auto 0; padding: 0 24px; }
