/* Sierra Leone Research and Evidence Network
   Brand colours come from the logo: Sierra Leone green and navy.
   Chart colours (--c1..--c3) are validated for colour-blind separation and contrast in light and dark mode. */
:root {
  --navy: #00285a; --navy-900: #001a3d; --navy-700: #0d3b75;
  --green: #1b6d1e; --green-700: #155a18; --green-300: #8cc79a; --green-100: #e7f2e9;
  --c1: #2e8540; --c2: #2f62a8; --c3: #c4841d;
  --ink: #10192b; --ink-2: #3b4658; --muted: #627083;
  --paper: #fff; --soft: #f3f6f4; --soft-2: #e5ebe7; --track: #d0dad3;
  --link: #1b6d1e; --focus: #2f62a8;
  --font: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: Cinzel, Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 5vw, 44px); --max: 1200px; --hdr: 78px; --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0c1f3f; --navy-900: #07142b; --navy-700: #16315e;
    --green-300: #8cc79a; --green-100: #142a1a;
    --c1: #3f9a50; --c2: #5585cc; --c3: #b47e22;
    --ink: #eef2f7; --ink-2: #c3cad6; --muted: #8f9bad;
    --paper: #0b1220; --soft: #111a2b; --soft-2: #1a2539; --track: #2a374c;
    --link: #74c483; --focus: #7aa7e6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0c1f3f; --navy-900: #07142b; --navy-700: #16315e;
  --green-300: #8cc79a; --green-100: #142a1a;
  --c1: #3f9a50; --c2: #5585cc; --c3: #b47e22;
  --ink: #eef2f7; --ink-2: #c3cad6; --muted: #8f9bad;
  --paper: #0b1220; --soft: #111a2b; --soft-2: #1a2539; --track: #2a374c;
  --link: #74c483; --focus: #7aa7e6;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--hdr) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.18; letter-spacing: -.015em; text-wrap: balance; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: underline 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shell { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: 0; left: -9999px; z-index: 100; background: var(--green); color: #fff; padding: .8rem 1.25rem; font-weight: 600; }
.skip:focus { left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.6rem; border: 2px solid transparent; border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-outline { color: #fff; border-color: #ffffffcc; }
.btn-outline:hover { background: #fff; color: var(--navy); }
.btn-light { background: #fff; color: #00285a; }
.btn-light:hover { background: var(--green-100); color: #00285a; }

/* Header: white, so the logo reads as designed */
.hdr { position: sticky; top: 0; z-index: 60; background: var(--paper); transition: box-shadow .25s; }
.hdr.scrolled { box-shadow: 0 6px 24px -12px #0010304d; }
.bar { display: flex; align-items: center; gap: 1.25rem; min-height: var(--hdr); }
.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; text-decoration: none; flex: none; }
.brand img { width: auto; height: 50px; }
.wordmark { display: grid; line-height: 1.1; }
.wordmark b { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; letter-spacing: .02em; color: #00285a; white-space: nowrap; }
/* the wordmark matches the logo's own green (logotypes are exempt from text contrast rules) */
.wordmark small { font-family: var(--serif); font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: #249a4b; white-space: nowrap; }
.nav-list { display: flex; align-items: center; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.nav-link { display: inline-flex; white-space: nowrap; padding: .55rem .6rem; border-bottom: 3px solid transparent; font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.nav-link:hover { color: var(--ink); border-bottom-color: var(--soft-2); }
.nav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }
.contact-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .6rem 1.6rem; border-radius: 999px; background: var(--green); color: #fff; font-size: .92rem; font-weight: 700; text-decoration: none; flex: none; }
.contact-btn:hover { background: var(--green-700); }
.burger { display: none; place-items: center; width: 44px; height: 44px; margin-right: -8px; padding: 0; background: none; border: 0; cursor: pointer; }
.bars { display: grid; gap: 4px; }
.bars i { display: block; width: 22px; height: 2px; background: var(--ink); }
.drawer { position: fixed; inset: var(--hdr) 0 0; overflow-y: auto; background: var(--paper); padding: 1.25rem 0 3rem; }
.drawer ul { margin: 0; padding: 0; list-style: none; }
.d-link { display: block; padding: .7rem 0; font-size: 1.15rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.d-link[aria-current="page"] { color: var(--green); }
.drawer .contact-btn { width: 100%; margin-top: 1.5rem; }
@media (max-width: 1160px) { .nav, .bar > .contact-btn { display: none; } .burger { display: grid; } }
@media (min-width: 1161px) { .drawer { display: none !important; } }
@media (max-width: 400px) { .brand img { height: 42px; } .wordmark b { font-size: 1rem; } .wordmark small { font-size: .56rem; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { padding: 3px; border-radius: 8px; background: #fff; } :root:not([data-theme="light"]) .wordmark b { color: #fff; } :root:not([data-theme="light"]) .wordmark small { color: var(--green-300); } }
:root[data-theme="dark"] .brand img { padding: 3px; border-radius: 8px; background: #fff; }
:root[data-theme="dark"] .wordmark b { color: #fff; }
:root[data-theme="dark"] .wordmark small { color: var(--green-300); }

/* Home hero, with an illustrative network meta-analysis */
.hero { background: var(--navy-900); color: #fff; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.4rem; font-size: clamp(2.3rem, 4.8vw, 3.9rem); font-weight: 800; line-height: 1.04; letter-spacing: -.035em; color: #fff; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--green-300); }
.lede { max-width: 54ch; margin-bottom: 2rem; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.6; color: #ffffffe0; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-meta { margin: 2rem 0 0; font-size: .85rem; color: #ffffffa6; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.nma { margin: 0; }
.nma svg { width: 100%; height: auto; overflow: visible; }
.nma .e { stroke: #7fc28a; stroke-width: var(--w); stroke-linecap: round; transition: stroke .25s, opacity .25s; }
.nma .ind { stroke: #f2c46b; stroke-width: 2; stroke-linecap: round; transition: opacity .25s; }
.nma .n { cursor: pointer; outline: none; }
.nma .n circle { fill: #fff; stroke: #2e8540; stroke-width: 4; transition: fill .25s; }
.nma .n text { fill: #ffffffe6; font: 600 14px var(--font); pointer-events: none; }
.nma .n:hover circle, .nma .n:focus-visible circle, .nma .n.hi circle { fill: var(--green-300); }
.nma.focus .e:not(.hi), .nma.focus .ind:not(.hi) { opacity: .2; }
.nma.focus .e.hi { stroke: #fff; }
.nma.focus .ind.hi { stroke: #fff; }
.nma figcaption { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1rem; font-size: .8rem; color: #ffffffbf; }
.key { display: inline-flex; align-items: center; gap: .5rem; }
.key i { display: inline-block; flex: none; }
.k-direct { width: 26px; height: 5px; border-radius: 3px; background: #7fc28a; }
.k-indirect { width: 26px; height: 2px; border-radius: 1px; background: #f2c46b; }
.nma .note { flex-basis: 100%; color: #ffffff8c; }

/* Inner page hero, with a faint network pattern */
.page-hero { position: relative; background: var(--navy-900); color: #fff; padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.75rem, 6vw, 4.25rem); overflow: hidden; }
.page-hero .shell { position: relative; z-index: 1; }
.ph-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.ph-net svg { max-height: 300px; margin-left: auto; }
.ph-net .n text { font-size: 13px; }
.page-hero h1 { max-width: 22ch; margin-bottom: 1.1rem; font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; color: #fff; }
.page-hero .lede { margin-bottom: 0; }
.page-hero a, .hero a:not(.btn) { color: var(--green-300); }
.page-hero .actions { margin-top: 2rem; }
.page-hero.tall { min-height: 60vh; display: grid; align-content: center; }
@media (max-width: 900px) { .ph-grid { grid-template-columns: minmax(0, 1fr); } .ph-net svg { max-width: 460px; max-height: none; margin: 0 auto; } }

/* Section rhythm */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section.soft { background: var(--soft); }
.section.navy { background: var(--navy); color: #ffffffd9; }
.section.navy h2, .section.navy h3 { color: #fff; }
.section.navy a:not(.btn) { color: var(--green-300); }
.head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.head.center { margin-inline: auto; text-align: center; }
.head h2 { margin-bottom: 1rem; font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -.025em; }
.head p, .sub-lead { margin: 0 0 1rem; font-size: 1.1rem; color: var(--ink-2); }
.navy .sub-lead { color: #ffffffd9; }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 4rem); }
.split > h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }

.statement { max-width: 32ch; margin: 0 0 1.5rem; font-size: clamp(1.5rem, 2.9vw, 2.3rem); font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.statement span { color: var(--link); }

.grid { display: grid; gap: clamp(1.75rem, 3.5vw, 3rem) clamp(1.5rem, 3.5vw, 3rem); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid h3 { margin-bottom: .5rem; font-size: 1.08rem; }
.grid p { margin: 0; color: var(--ink-2); }
.closing { align-self: start; padding: 1.5rem 1.6rem; border-radius: var(--r); background: var(--soft); font-size: 1.02rem; font-weight: 600; line-height: 1.55; color: var(--ink) !important; }
@media (max-width: 900px) { .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.c3, .grid.c2 { grid-template-columns: minmax(0, 1fr); } }

.also { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 4rem); }
.also .title { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -.02em; }
@media (max-width: 820px) { .also { grid-template-columns: minmax(0, 1fr); } }

.vis-note { margin: .75rem 0 0; font-size: .8rem; color: var(--muted); }

/* Home: doors to the inner pages */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.door { padding: clamp(1.5rem, 3vw, 2rem); border-radius: var(--r); background: var(--paper); }
.door h3 { margin-bottom: .6rem; font-size: 1.35rem; }
.door h3 a { color: var(--ink); text-decoration-color: var(--link); }
.door p { margin: 0; color: var(--ink-2); }
@media (max-width: 820px) { .doors { grid-template-columns: minmax(0, 1fr); } }

.founders-strip { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.founders-strip h2 { margin-bottom: 1rem; font-size: clamp(1.5rem, 2.8vw, 2.2rem); letter-spacing: -.025em; }
.faces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.faces figure { margin: 0; }
.faces img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); background: var(--soft-2); }
.faces figcaption { margin-top: .6rem; font-size: .9rem; font-weight: 600; }
@media (max-width: 820px) { .founders-strip { grid-template-columns: minmax(0, 1fr); } }

.quote-band > * { max-width: 52rem; }
.big-quote { margin-bottom: 1.25rem; font-size: clamp(1.8rem, 3.8vw, 3rem); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; color: #fff; }
.cta-inner { max-width: 46rem; }
.cta-inner h2 { margin-bottom: .6rem; font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -.025em; }
.cta-inner p { margin: 0; font-size: 1.08rem; color: var(--ink-2); }

/* Evidence gap map */
.egm-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.egm-text h2 { margin-bottom: 1rem; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.egm-text p { color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.egm { margin: 0; padding: clamp(1rem, 2.5vw, 1.5rem); border-radius: var(--r); background: var(--paper); }
.egm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.egm-table { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.egm-table thead th { padding: 0 .25rem .5rem; font-size: .74rem; font-weight: 600; line-height: 1.3; color: var(--ink-2); text-align: center; vertical-align: bottom; }
.egm-table thead th:first-child { width: 27%; }
.egm-table tbody th { padding: 0 .6rem 0 0; font-size: .82rem; font-weight: 600; line-height: 1.3; text-align: left; }
.egm-table td { height: 54px; border-radius: 8px; background: var(--soft); text-align: center; vertical-align: middle; }
.egm .b, .legend .b { position: relative; display: inline-block; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c1); box-shadow: 0 0 0 2px var(--paper); vertical-align: middle; }
.egm .gap, .legend .gap { position: relative; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--c3); border-radius: 50%; vertical-align: middle; }
.egm [data-tip] { cursor: pointer; outline-offset: 3px; }
.egm .tabs { margin: 0 0 1rem; background: var(--soft); }
.egm-table td { transition: background-color .2s, box-shadow .2s; }
.egm-table td.hl { background: var(--green-100); }
.egm-table th.hl { color: var(--link); }
.egm-table td.sel { box-shadow: inset 0 0 0 2px var(--c1); }
.egm .b, .egm .gap { transition: opacity .3s, transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.egm .b.thin, .legend .b.thin { background: var(--c3); }
.egm.gaps .b:not(.thin) { opacity: .14; }
.egm.gaps .b.thin, .egm.gaps .gap { box-shadow: 0 0 0 2px var(--paper), 0 0 0 6px #c4841d40; }
.egm-table tbody th .row-total { display: block; margin-top: .15rem; font-size: .72rem; font-weight: 500; color: var(--muted); text-decoration-color: var(--track); }
.egm-table tbody th .row-total:hover { color: var(--link); }
.egm .legend { margin-top: 1rem; }
.egm-source { margin: .75rem 0 0; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.egm-detail { min-height: 3.2em; margin: 1rem 0 0; font-size: .95rem; color: var(--ink-2); }
.egm-detail strong { color: var(--ink); }
.egm figcaption { margin-top: .5rem; font-size: .8rem; color: var(--muted); }
@media (max-width: 960px) { .egm-layout { grid-template-columns: minmax(0, 1fr); } }

/* Alternating timeline with a visual for each stage (What we do) */
.zig { --p: 0; position: relative; margin: 0; padding: 0; list-style: none; }
.zig::before, .zig::after, .alt::before, .alt::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--track); }
.zig::after, .alt::after { background: var(--c1); transform-origin: top; transform: scaleY(var(--p)); transition: transform .15s linear; }
.zig > li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 8vw, 6rem); align-items: center; padding: clamp(1.5rem, 3vw, 2.5rem) 0; }
.zig > li::before, .alt > li::before { content: ""; position: absolute; z-index: 1; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 4px solid var(--track); background: var(--paper); transition: border-color .4s, background-color .4s; }
.zig > li.reached::before { border-color: var(--c1); background: var(--c1); }
.zig-text { text-align: right; }
.zig > li:nth-child(even) .zig-text { order: 2; text-align: left; }
.zig-text h3 { margin-bottom: .6rem; font-size: clamp(1.3rem, 2.2vw, 1.6rem); letter-spacing: -.02em; }
.zig-text p { margin: 0; color: var(--ink-2); }
.zig-vis { padding: clamp(1.1rem, 2.5vw, 1.5rem); border-radius: var(--r); background: var(--soft); }
.loop { margin: 1.5rem 0 0; font-size: 1rem; font-weight: 600; color: var(--ink-2); text-align: center; }
@media (max-width: 860px) {
  .zig::before, .zig::after, .alt::before, .alt::after { left: 10px; }
  .zig > li { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; padding: 1.25rem 0 1.25rem 2.75rem; }
  .zig > li::before { top: 1.6rem; left: 10px; margin-top: 0; }
  .zig-text, .zig > li:nth-child(even) .zig-text { order: 0; text-align: left; }
  .loop { text-align: left; }
}

/* Stage visuals */
.pico { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.pico div { padding: .8rem .9rem; border-radius: 8px; background: var(--paper); }
.pico dt { margin-bottom: .15rem; font-size: .76rem; font-weight: 700; color: var(--link); }
.pico dd { margin: 0; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.funnel { display: grid; gap: .6rem; }
.funnel div { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 3.2rem; align-items: center; gap: .75rem; font-size: .84rem; }
.funnel span { color: var(--ink-2); line-height: 1.25; }
.funnel em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.funnel i, .meter i { display: block; height: 10px; border-radius: 5px; background: var(--soft-2); }
.funnel b, .meter b { display: block; height: 100%; width: max(4px, calc(var(--v) * 100%)); border-radius: 5px; background: var(--c1); }
@media (max-width: 460px) { .funnel div { grid-template-columns: 1fr 3rem; } .funnel i { grid-column: 1 / -1; grid-row: 2; } }

.forest, .living { width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.forest .lab, .living .lab { font-size: 11px; font-weight: 600; fill: var(--ink-2); }
.forest .ci, .living .ci { stroke: var(--ink); stroke-width: 1.6; }
.forest .pt, .living .pt { fill: var(--c2); stroke: var(--soft); stroke-width: 2; }
.forest .dia { fill: var(--c1); }
.forest .ref, .living .ref { stroke: var(--muted); stroke-width: 1; }
.forest .axis, .living .axis { stroke: var(--muted); stroke-width: 1; }
.forest .tick, .living .tick { font-size: 10px; fill: var(--muted); }
.forest .fav, .living .fav { font-size: 9.5px; fill: var(--muted); }

.brief { padding: 1.2rem 1.25rem; border-radius: 10px; background: var(--paper); box-shadow: 0 10px 30px -22px #00285a66; }
.brief-k { margin: 0 0 .4rem; font-size: .76rem; font-weight: 700; color: var(--muted); }
.brief-h { margin: 0 0 .9rem; font-size: 1rem; font-weight: 700; line-height: 1.35; }
.certainty { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-size: .84rem; font-weight: 600; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c1); }
.dots i.on { background: var(--c1); }
.brief-line { display: block; height: 8px; margin-top: .45rem; border-radius: 4px; background: var(--soft-2); }
.brief-line.short { width: 62%; }

/* Network meta-analysis explainer */
.nma-explain { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.nma-explain h2 { margin-bottom: 1rem; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.025em; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 1.25rem; padding: .3rem; border-radius: 999px; background: var(--paper); }
.tabs button { min-height: 40px; padding: .45rem 1.1rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s; }
.tabs button[aria-pressed="true"] { background: var(--green); color: #fff; }
.views p { min-height: 7.5em; margin: 0; color: var(--ink-2); }
.tri { margin: 0; padding: clamp(1rem, 3vw, 2rem); border-radius: var(--r); background: var(--paper); }
.tri svg { width: 100%; max-width: 380px; height: auto; margin-inline: auto; }
.tri line, .tri path { fill: none; stroke-linecap: round; transition: opacity .4s, stroke .4s; }
.t-ab, .t-ac { stroke: var(--c1); stroke-width: 7; }
.t-ind { stroke: var(--c3); stroke-width: 3; opacity: 0; }
.t-dir { stroke: var(--c2); stroke-width: 6; opacity: 0; }
.t-node circle { fill: var(--navy); stroke: var(--paper); stroke-width: 3; }
.t-node text { fill: #fff; font: 700 20px var(--font); }
.t-lab { font: 600 12.5px var(--font); fill: var(--ink-2); opacity: 0; transition: opacity .4s; }
.tri[data-view="indirect"] .t-ab, .tri[data-view="indirect"] .t-ac { opacity: .35; }
.tri[data-view="indirect"] .t-ind, .tri[data-view="consistency"] .t-ind { opacity: 1; }
.tri[data-view="indirect"] .t-lab-ind, .tri[data-view="consistency"] .t-lab-ind { opacity: 1; }
.tri[data-view="consistency"] .t-dir, .tri[data-view="consistency"] .t-lab-dir { opacity: 1; }
@media (max-width: 900px) { .nma-explain { grid-template-columns: minmax(0, 1fr); } }

/* Members web */
.member-web { margin: 0 0 clamp(2rem, 4vw, 3rem); }
.member-web svg { width: 100%; max-width: 900px; height: auto; margin-inline: auto; overflow: visible; }
.mw { stroke-width: 1.6; opacity: .55; }
.mw.p, .mn.p, .mh.p { stroke: var(--c1); }
.mw.i, .mn.i, .mh.i { stroke: var(--c2); }
.mw.u, .mn.u, .mh.u { stroke: var(--c3); }
.mx { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .45; }
.mn, .mh { stroke: var(--paper) !important; stroke-width: 2; }
.mn.p, .mh.p { fill: var(--c1); }
.mn.i, .mh.i { fill: var(--c2); }
.mn.u, .mh.u { fill: var(--c3); }
.m-lab { font: 700 16px var(--font); fill: var(--ink); }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.group { padding: clamp(1.4rem, 3vw, 1.9rem); border-radius: var(--r); background: var(--soft); }
.group h3 { margin-bottom: .2rem; font-size: clamp(1.25rem, 2.2vw, 1.55rem); letter-spacing: -.02em; }
.group .verb { display: block; margin-bottom: .9rem; font-size: .95rem; font-style: italic; font-weight: 500; color: var(--ink-2); }
.group p { margin: 0; color: var(--ink-2); }
@media (max-width: 820px) { .groups { grid-template-columns: minmax(0, 1fr); } }

/* Platforms */
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.platform { display: flex; flex-direction: column; padding: clamp(1.6rem, 3.5vw, 2.6rem); border-radius: var(--r); background: var(--soft); }
.platform h3 { margin-bottom: .3rem; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; }
.platform .gloss { margin-bottom: 1.1rem; font-size: .95rem; font-style: italic; font-weight: 500; color: var(--link); }
.platform p { color: var(--ink-2); }
.platform .owner { margin: auto 0 0; padding-top: 1rem; font-size: .85rem; color: var(--muted); }
.search { display: flex; align-items: flex-start; min-height: 4.4em; margin: .4rem 0 1.4rem; padding: .85rem 1.1rem; border-radius: 14px; background: var(--paper); font-size: .92rem; line-height: 1.4; color: var(--ink-2); }
.caret { display: inline-block; flex: none; width: 2px; height: 1.2em; margin-left: 2px; background: var(--c1); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.meter { display: grid; gap: .55rem; margin: .4rem 0 1.4rem; padding: 1rem 1.1rem; border-radius: var(--r); background: var(--paper); font-size: .85rem; }
.meter div { display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: .75rem; }
.meter span { color: var(--ink-2); }
@media (max-width: 820px) { .platforms { grid-template-columns: minmax(0, 1fr); } }

.loop-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.loop-layout h2 { margin-bottom: 1rem; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.025em; }
.loop-fig { margin: 0; }
.loop-fig svg { width: 100%; max-width: 480px; height: auto; margin-inline: auto; overflow: visible; }
.arc { fill: none; stroke: var(--track); stroke-width: 3; stroke-linecap: round; marker-end: url(#lp-arrow); transition: stroke .3s; }
.arc.on { stroke: var(--c1); marker-end: url(#lp-arrow-on); }
.arc.fresh { stroke-dasharray: 1 1; animation: draw .7s ease-out both; }
.mk { fill: var(--track); }
.mk-on { fill: var(--c1); }
.st circle { stroke-width: 4; }
.st.core circle { fill: var(--c1); stroke: var(--soft); }
.st.conf circle { fill: var(--soft); stroke: var(--c1); }
.st text { font: 700 15px var(--font); fill: var(--ink); }
.orbit { display: none; }
.hub-k { font: 700 17px var(--font); fill: var(--ink-2); }
.loop-fig figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; margin-top: 1rem; font-size: .82rem; color: var(--ink-2); }
.k-core, .k-conf { width: 14px; height: 14px; border-radius: 50%; }
.k-core { background: var(--c1); }
.k-conf { border: 3px solid var(--c1); }
.loop-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 1.5rem 0 0; }
.loop-steps dt { font-weight: 700; }
.loop-steps dd { margin: 0; font-size: .9rem; color: var(--ink-2); }
@media (max-width: 960px) { .loop-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .loop-steps { grid-template-columns: minmax(0, 1fr); } }

.centre { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.25rem, 4vw, 3rem); align-items: center; padding: clamp(1.6rem, 3.5vw, 2.6rem); border-radius: var(--r); background: var(--navy); color: #ffffffd6; }
.centre h2 { font-size: clamp(1.3rem, 2.3vw, 1.7rem); color: #fff; }
.centre small { display: block; margin-bottom: .5rem; font-size: .9rem; color: #ffffffad; }
.centre p { margin: 0; }
@media (max-width: 820px) { .centre { grid-template-columns: minmax(0, 1fr); } }

/* Governance: organisation chart. Lines carry arrowheads to show direction and a tag naming the relationship. */
.oc { --g: clamp(1.25rem, 3vw, 2.5rem); --sg: clamp(7.75rem, 10vw, 9rem); --ln: var(--c1); --ah: 9px; }
.oc-tier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); column-gap: var(--sg); align-items: stretch; }
.oc-node, .oc-side { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 1.15rem 1.3rem; border-radius: var(--r); background: var(--soft); text-align: center; }
.oc-node h3, .oc-side h3 { margin-bottom: .3rem; font-size: 1.08rem; }
.oc-node p, .oc-side p { margin: 0; font-size: .88rem; color: var(--ink-2); }
.oc-node.top { background: var(--navy); }
.oc-node.board { padding: 1.3rem 1.3rem 1.4rem; background: var(--green); }
.oc-node.top h3, .oc-node.board h3 { color: #fff; }
.oc-node.top p { color: #ffffffd0; }
.oc-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.oc-seats li { padding: .3rem .7rem; border-radius: 999px; background: #ffffff26; color: #fff; font-size: .8rem; font-weight: 600; }

/* relationship tags sit on the middle of each line */
.oc-tag, .oc-link span, .oc-branch span { position: absolute; z-index: 2; top: 50%; padding: .2rem .75rem; border: 2px solid var(--ln); border-radius: 999px; background: var(--paper); color: var(--link); font-size: .8rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.oc-link span, .oc-branch span { left: 50%; transform: translate(-50%, -50%); }

/* side boxes: horizontal line into the centre column, arrowhead at the centre box */
.oc-side::after { content: ""; position: absolute; top: 50%; width: calc(var(--sg) - var(--ah)); height: 2px; margin-top: -1px; background: var(--ln); }
.oc-side::before { content: ""; position: absolute; top: 50%; width: var(--ah); height: 12px; margin-top: -6px; background: var(--ln); }
.oc-side.left::after { left: 100%; }
.oc-side.left::before { left: calc(100% + var(--sg) - var(--ah)); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.oc-side.left .oc-tag { left: calc(100% + var(--sg) / 2); transform: translate(-50%, -50%); }
.oc-side.right::after { right: 100%; }
.oc-side.right::before { right: calc(100% + var(--sg) - var(--ah)); clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.oc-side.right .oc-tag { right: calc(100% + var(--sg) / 2); transform: translate(50%, -50%); }

/* down arrows between the levels */
.oc-link, .oc-branch { position: relative; height: 68px; }
.oc-link::before { content: ""; position: absolute; top: 0; bottom: var(--ah); left: 50%; width: 2px; margin-left: -1px; background: var(--ln); }
.oc-link::after, .oc-kids .oc-node::after { content: ""; position: absolute; left: 50%; width: 12px; height: var(--ah); margin-left: -6px; background: var(--ln); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.oc-link::after { bottom: 0; }
.oc-branch::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--ln); }
.oc-branch::after { content: ""; position: absolute; bottom: 0; height: 2px; left: calc((100% - 2 * var(--g)) / 6); right: calc((100% - 2 * var(--g)) / 6); background: var(--ln); }
.oc-kids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g); margin-top: 30px; }
.oc-kids .oc-node::before { content: ""; position: absolute; bottom: calc(100% + var(--ah)); left: 50%; width: 2px; height: calc(30px - var(--ah)); margin-left: -1px; background: var(--ln); }
.oc-kids .oc-node::after { bottom: 100%; }

@media (max-width: 1100px) {
  /* On smaller screens the chart runs top to bottom; government and partners follow underneath */
  .oc { display: flex; flex-direction: column; }
  .oc-tier { display: contents; }
  .oc-blank, .oc-side::after, .oc-side::before, .oc-tag, .oc-branch::after { display: none; }
  .oc-node.top { order: 1; } .oc-link { order: 2; } .oc-node.board { order: 3; } .oc-branch { order: 4; } .oc-kids { order: 5; }
  .oc-branch { height: 38px; }
  .oc-branch span { top: 45%; }
  .oc-side { order: 6; margin-top: 1rem; }
  .oc-side.left { margin-top: 2.25rem; }
  .oc-kids { grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 30px; max-width: 40rem; width: 100%; margin-inline: auto; }
  .oc-kids .oc-node:not(:first-child)::before, .oc-kids .oc-node:not(:first-child)::after { display: none; }
  .oc-node.top, .oc-node.board, .oc-side { width: 100%; max-width: 40rem; margin-inline: auto; }
}

/* Founders */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }
.person { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.person img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); background: var(--soft-2); }
.person h3 { font-size: 1.3rem; }
.person .role { margin: .2rem 0 .9rem; font-size: .92rem; font-weight: 600; color: var(--link); }
.person p { color: var(--ink-2); }
@media (max-width: 1050px) { .people { grid-template-columns: minmax(0, 1fr); max-width: 46rem; } }
@media (max-width: 560px) { .person { grid-template-columns: minmax(0, 1fr); } .person img { max-width: 240px; } }

/* Board seats */
.seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.seat { display: flex; flex-direction: column; padding: 1.5rem 1.4rem; border-radius: var(--r); background: var(--paper); transition: transform .25s, box-shadow .25s; }
.seat:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -26px #00285a59; }
.seat dt { margin-bottom: .5rem; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.seat dd { margin: 0; font-size: .92rem; color: var(--ink-2); }
.seat.ask { background: var(--green); }
.seat.ask dt { color: #fff; }
.seat.ask dd { color: #ffffffe6; }
.seat.ask a { font-weight: 700; color: #fff; }
@media (max-width: 1000px) { .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .seats { grid-template-columns: minmax(0, 1fr); } }

/* Alternating timeline: steps sit either side of a central line (road to the AGM) */
.alt { --p: 0; --cap: 1; position: relative; max-width: 60rem; margin: 0 auto; padding: 0; list-style: none; }
.alt > li { position: relative; width: 50%; padding: 0 3rem 2.25rem 0; text-align: right; }
.alt > li:nth-child(even) { margin-left: 50%; padding: 0 0 2.25rem 3rem; text-align: left; }
.alt > li:last-child { padding-bottom: 0; }
.alt > li + li { margin-top: -2.75rem; }
.alt > li::before { top: .45rem; left: 100%; margin: 0 0 0 -10px; }
.alt > li:nth-child(even)::before { left: 0; }
.alt > li.done::before { border-color: var(--c1); background: var(--c1); }
.alt > li.doing::before { border-color: var(--c1); }
.alt > li.now::before { border-color: var(--c1); background: var(--paper); box-shadow: 0 0 0 0 #2e854080; animation: ping 2.2s ease-out infinite; }
.alt > li.now::after { content: ""; position: absolute; top: calc(.45rem + 6px); left: 100%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--c1); }
.alt > li.now:nth-child(even)::after { left: 0; }
.alt .when { display: block; margin-bottom: .2rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.alt .done .when, .alt .doing .when, .alt .now .when { color: var(--link); }
.alt h3 { margin-bottom: .3rem; font-size: 1.15rem; }
.alt p { margin: 0; color: var(--ink-2); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 #2e854080; } 80%, 100% { box-shadow: 0 0 0 14px #2e854000; } }
@media (max-width: 860px) {
  .alt > li, .alt > li:nth-child(even) { width: auto; margin-left: 0; padding: 0 0 1.75rem 2.75rem; text-align: left; }
  .alt > li + li { margin-top: 0; }
  .alt > li::before, .alt > li:nth-child(even)::before { left: 10px; }
  .alt > li.now::after, .alt > li.now:nth-child(even)::after { left: 10px; }
}

/* Join */
.join { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.join h2 { margin-bottom: 1rem; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.intro-text p { color: var(--ink-2); }
.plain-list { margin: 0 0 1.25rem; padding-left: 1.2rem; color: var(--ink-2); }
.plain-list li { margin-bottom: .4rem; }
.contact { margin-top: 1.75rem; padding: 1.25rem 1.4rem; border-radius: var(--r); background: var(--paper); }
.contact p { margin: 0; }
.contact strong { display: block; }
.contact a { font-weight: 700; word-break: break-word; }
.panel { padding: clamp(1.4rem, 3.5vw, 2.4rem); border-radius: var(--r); background: var(--paper); box-shadow: 0 20px 50px -36px #00285a66; }
.interest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 700; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 48px; padding: .6rem .85rem; border: 1px solid transparent; border-radius: 8px; background: var(--soft); color: var(--ink); font: inherit; font-size: .95rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.interest .btn { justify-self: start; min-width: 10rem; }
.privacy { grid-column: 1 / -1; margin: 0; padding: .9rem 1rem; border-radius: 8px; background: var(--soft); font-size: .82rem; line-height: 1.55; color: var(--ink-2); }
.hp { position: absolute; left: -9999px; }
.thanks { display: none; font-weight: 600; }
.thanks.show { display: block; }
@media (max-width: 900px) { .join { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .interest { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.ftr { background: var(--navy-900); color: #ffffffc7; padding: clamp(2.75rem, 5vw, 4rem) 0 1.75rem; }
.ftr-top { display: grid; grid-template-columns: minmax(240px, .9fr) 2.4fr; gap: clamp(2rem, 5vw, 4rem); }
.ftr .brand { margin-bottom: 1.1rem; }
.emblem-tile { display: grid; place-items: center; width: 60px; height: 56px; border-radius: 10px; background: #fff; }
.ftr .brand img { height: 44px; padding: 0; background: none; }
.ftr .wordmark b { color: #fff; }
.ftr .wordmark small { color: var(--green-300); }
.blurb { max-width: 40ch; margin-bottom: 1.15rem; font-size: .875rem; }
.ftr address { font-style: normal; font-size: .875rem; line-height: 1.75; }
.ftr address a { color: var(--green-300); text-decoration: none; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem 1.5rem; }
.cols h2 { margin-bottom: .85rem; font-size: .875rem; color: #fff; }
.cols ul { margin: 0; padding: 0; list-style: none; }
.cols li { margin-bottom: .5rem; }
.cols a { font-size: .875rem; color: #ffffffc7; text-decoration: none; }
.cols a:hover { color: #fff; text-decoration: underline; }
.ftr-base { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin-top: 3rem; padding-top: 1.35rem; border-top: 1px solid #ffffff1f; font-size: .78rem; text-align: center; }
.ftr-base p { margin: 0; }
.ftr-base a { color: #ffffffd9; text-decoration-color: #ffffff66; }
.ftr-base a:hover { color: #fff; }
@media (max-width: 900px) { .ftr-top { grid-template-columns: minmax(0, 1fr); } }

/* Motion. Content is hidden only while JS runs (html.js), so it always shows without it. */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hero-copy > *, .page-hero .shell > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2), .page-hero .shell > :nth-child(2) { animation-delay: .12s; }
.hero-copy > :nth-child(3), .page-hero .shell > :nth-child(3) { animation-delay: .24s; }
.hero-copy > :nth-child(4) { animation-delay: .36s; }
.nma .e { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw .9s ease-out forwards; animation-delay: calc(.5s + var(--d) * .14s); }
.nma .n { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(.3s + var(--d) * .12s); }
.nma .ind { animation: fade .6s ease 1.7s both; }
.nma figcaption { animation: fade .8s ease 1.9s both; }

.js [data-reveal], .js [data-reveal-group] > * { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 100ms); }
.js [data-reveal].in, .js [data-reveal-group].in > * { opacity: 1; transform: none; }

.js .zig > li > * { transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .zig > li > .zig-vis { transition-delay: .12s; }
.js .zig > li:not(.in) > * { opacity: 0; }
.js .zig > li:not(.in) > .zig-text, .js .zig > li:nth-child(even):not(.in) > .zig-vis { transform: translateX(-36px); }
.js .zig > li:not(.in) > .zig-vis, .js .zig > li:nth-child(even):not(.in) > .zig-text { transform: translateX(36px); }
.js .alt > li { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .alt > li:not(.in) { opacity: 0; transform: translateX(-32px); }
.js .alt > li:nth-child(even):not(.in) { transform: translateX(32px); }
@media (max-width: 860px) {
  .js .zig > li:not(.in) > .zig-text, .js .zig > li:not(.in) > .zig-vis, .js .zig > li:nth-child(even):not(.in) > .zig-text, .js .zig > li:nth-child(even):not(.in) > .zig-vis,
  .js .alt > li:not(.in), .js .alt > li:nth-child(even):not(.in) { transform: translateY(24px); }
}

.js .forest .row, .js .living .row { opacity: 0; transition: opacity .5s ease; transition-delay: calc(.35s + var(--d) * .15s); }
.js .zig > li.in .row { opacity: 1; }
.js .forest .dia { transform-box: fill-box; transform-origin: center; transform: scaleX(0); transition: transform .6s cubic-bezier(.3, 1.3, .5, 1) 1.2s; }
.js .zig > li.in .forest .dia { transform: none; }
.js [data-meter] b { width: 0; transition: width 1.3s cubic-bezier(.4, 0, .2, 1); }
.js [data-meter] div:nth-child(2) b { transition-delay: .15s; }
.js [data-meter] div:nth-child(3) b { transition-delay: .3s; }
.js [data-meter] div:nth-child(4) b { transition-delay: .45s; }
.js [data-meter].in b, .js .zig > li.in [data-meter] b { width: max(4px, calc(var(--v) * 100%)); }

.js .egm .b { transform: scale(0); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(.2s + var(--d) * 22ms); }
.js .egm.in .b { transform: none; }

.js .member-web .mw, .js .member-web .mx { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease-out; transition-delay: calc(.2s + var(--d) * 60ms); }
.js .member-web.in .mw, .js .member-web.in .mx { stroke-dashoffset: 0; }
.js .member-web .mn, .js .member-web .mh { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); transition-delay: calc(.1s + var(--d) * 50ms); }
.js .member-web.in .mn, .js .member-web.in .mh { transform: none; }

.js .loop-fig .st { transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(.6); transition: opacity .5s ease, transform .5s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(.2s + var(--d) * 120ms); }
.js .loop-fig.in .st { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal], .js [data-reveal-group] > *, .js .zig > li > *, .js .alt > li, .js .forest .row, .js .living .row, .js .loop-fig .st { opacity: 1 !important; transform: none !important; }
  .nma .e, .js .member-web .mw, .js .member-web .mx { stroke-dashoffset: 0 !important; }
  .js .egm .b, .js .forest .dia, .js .member-web .mn, .js .member-web .mh { transform: none !important; }
  .js [data-meter] b { width: max(4px, calc(var(--v) * 100%)) !important; }
}

/* Shared tooltip, placed by main.js next to any element with data-tip */
.tip { position: fixed; z-index: 80; max-width: 240px; padding: .5rem .65rem; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: .78rem; font-weight: 500; line-height: 1.35; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .15s; }
.tip.show { opacity: 1; }

/* Home: where research sits, and where it needs to go */
.gap-band { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.gap-copy h2 { margin-bottom: 1rem; font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.025em; }
.gap-copy .tabs { background: var(--soft); }
.gap-note { min-height: 3.3em; font-weight: 600; color: var(--ink); }
.gapviz { margin: 0; padding: clamp(1rem, 2.5vw, 1.75rem); border-radius: var(--r); background: var(--soft); }
.gapviz svg { width: 100%; height: auto; overflow: visible; }
.gapviz .today, .gapviz .with { transition: opacity .5s; }
.gapviz[data-state="today"] .with, .gapviz[data-state="with"] .today { opacity: 0; }
.gapviz path { fill: none; stroke-linecap: round; }
.gapviz .chance { stroke: var(--c3); stroke-width: 2; }
.gapviz .gather { stroke: var(--c1); stroke-width: 1.3; opacity: .55; }
.gapviz .reach { stroke: var(--c1); stroke-width: 5; }
.gapviz .study { fill: var(--muted); opacity: .5; transition: fill .4s, opacity .4s; }
.gapviz .study.lit { fill: var(--c3); opacity: 1; }
.gapviz[data-state="with"] .study { fill: var(--c1); opacity: 1; }
.gapviz .hub { fill: var(--green); stroke: var(--soft); stroke-width: 4; }
.gapviz .dec { fill: var(--c2); stroke: var(--soft); stroke-width: 3; }
.gapviz .src-lab, .gapviz .dec-lab, .gapviz .hub-lab { font: 600 13px var(--font); fill: var(--ink-2); }
.gapviz .hub-lab { font-weight: 700; fill: var(--ink); }
.gapviz[data-state="today"] .chance, .gapviz[data-state="with"] .gather, .gapviz[data-state="with"] .reach { stroke-dasharray: 1 1; animation: draw .8s ease-out both; }
.gapviz[data-state="with"] .gather { animation-delay: calc(var(--d) * 35ms); }
.gapviz[data-state="with"] .reach { animation-duration: .7s; animation-delay: calc(.55s + var(--d) * .15s); }
@media (max-width: 900px) { .gap-band { grid-template-columns: minmax(0, 1fr); } }

/* Forest plot and living review interactions */
.forest .row[role="button"], .living .row { cursor: pointer; outline: none; }
.forest .hit, .living .hit { fill: transparent; }
.forest .row:hover .hit, .living .row:hover .hit, .forest .row:focus-visible .hit, .living .row:focus-visible .hit { fill: var(--soft-2); }
.forest .row:focus-visible .hit, .living .row:focus-visible .hit { stroke: var(--focus); stroke-width: 1.5; }
.forest .row.off .ci, .forest .row.off .pt { opacity: .2; }
.forest .row.off .lab { fill: var(--muted); text-decoration: line-through; }
.pooled-out { margin: .6rem 0 0; font-size: .9rem; font-weight: 600; }
.replay { min-height: 44px; margin-top: .75rem; padding: .4rem 1rem; border: 2px solid var(--c1); border-radius: 999px; background: none; color: var(--link); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.replay:hover { background: var(--green-100); }
.js .living.reset .row { opacity: 0 !important; transition: none !important; }
.funnel div { padding: .2rem .35rem; margin: 0 -.35rem; border-radius: 6px; cursor: default; outline: none; transition: background-color .2s; }
.funnel div:hover, .funnel div:focus-visible { background: var(--paper); }

/* Members web: focus one group */
.member-web .mw, .member-web .mn, .member-web .mh, .member-web .mx { transition: opacity .3s, stroke-dashoffset 1.2s ease-out, transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.member-web[data-focus] .mx { opacity: .12; }
.member-web[data-focus="p"] :is(.mw, .mn, .mh):not(.p),
.member-web[data-focus="i"] :is(.mw, .mn, .mh):not(.i),
.member-web[data-focus="u"] :is(.mw, .mn, .mh):not(.u) { opacity: .15; }
.member-web .mh { cursor: pointer; }
.group { cursor: pointer; outline: none; transition: background-color .25s, box-shadow .25s; }
.group.active, .group:focus-visible { background: var(--green-100); box-shadow: inset 0 0 0 2px var(--c1); }
.vis-note.center { text-align: center; }

/* Sabi Core loop: the stage the flow has reached */
.st { cursor: pointer; }
.st circle { transition: fill .3s, stroke .3s; }
.st.active circle { fill: var(--c2); stroke: var(--soft); }
.st.active text { fill: var(--link); }

/* Small screens: drawings scale down with the screen, so their labels are set larger to stay readable (at least ~11px) */
@media (max-width: 900px) {
  .ph-net .n text { font-size: 15px; }
  .nma .n text { font-size: 16px; }
  .gapviz .src-lab, .gapviz .dec-lab, .gapviz .hub-lab { font-size: 19px; }
  .m-lab { font-size: 26px; }
  .st text { font-size: 19px; }
  .hub-k { font-size: 20px; }
}
@media (max-width: 520px) {
  .forest .lab, .living .lab { font-size: 15px; }
  .forest .tick, .living .tick { font-size: 13px; }
  .forest .fav, .living .fav { font-size: 11px; }
  .egm-table { min-width: 520px; }
}
