/* Local Diplomacy Lab
   Palette sampled from the lab's mosaic artwork. One accent (terracotta) for
   everything interactive; teal, ochre and plum appear only in art and diagrams.
   Shape rule: controls are pills, surfaces and images are 14px, nothing else. */

:root {
  --bg: #f6efe4;
  --bg-2: #efe5d5;
  --surface: #fbf7f0;
  --ink: #2a2238;
  --ink-2: #4e4458;
  --muted: #6b6072;
  --line: rgb(42 34 56 / 0.14);
  --line-strong: rgb(42 34 56 / 0.28);
  --accent: #b5532f;
  --accent-ink: #9e4424;
  --on-accent: #fff8f0;
  --teal: #1f5c6b;
  --ochre: #d9a441;
  --peach: #e8c9b5;
  --plum: #6b4c7e;
  --grout: #2a2238;
  --shadow: 0 1px 2px rgb(42 34 56 / 0.06), 0 12px 32px -12px rgb(42 34 56 / 0.18);

  /* map */
  --map-ocean: #e6dccb;
  --map-land: #f1e7d6;
  --map-border: #c9b99f;
  --map-grat: rgb(42 34 56 / 0.06);
  /* policy types, validated for colour-vision deficiency on --map-land */
  --cat-1: #209ead; /* Action Plan */
  --cat-2: #c0340e; /* Ordinance */
  --cat-3: #077753; /* Other */
  --cat-4: #921b80; /* Resolution */
  --cat-5: #b88526; /* Decree */
  --cat-6: #6478eb; /* Motion / Procedural Effort */

  --font: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --header-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1726;
    --bg-2: #231c2f;
    --surface: #2a2337;
    --ink: #f3ebdd;
    --ink-2: #d6ccd9;
    --muted: #ab9fb3;
    --line: rgb(243 235 221 / 0.13);
    --line-strong: rgb(243 235 221 / 0.26);
    --accent: #e07a55;
    --accent-ink: #ee9270;
    --on-accent: #1c1726;
    --teal: #5fa8b8;
    --ochre: #e3b55a;
    --peach: #6b4f4a;
    --plum: #b48fca;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
    --map-ocean: #211a2c;
    --map-land: #342b42;
    --map-border: #56496a;
    --map-grat: rgb(243 235 221 / 0.05);
    --cat-1: #1b9cb3;
    --cat-2: #c1420d;
    --cat-3: #237c53;
    --cat-4: #943a99;
    --cat-5: #ad8d41;
    --cat-6: #5c66e2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1726;
  --bg-2: #231c2f;
  --surface: #2a2337;
  --ink: #f3ebdd;
  --ink-2: #d6ccd9;
  --muted: #ab9fb3;
  --line: rgb(243 235 221 / 0.13);
  --line-strong: rgb(243 235 221 / 0.26);
  --accent: #e07a55;
  --accent-ink: #ee9270;
  --on-accent: #1c1726;
  --teal: #5fa8b8;
  --ochre: #e3b55a;
  --peach: #6b4f4a;
  --plum: #b48fca;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
  --map-ocean: #211a2c;
  --map-land: #342b42;
  --map-border: #56496a;
  --map-grat: rgb(243 235 221 / 0.05);
  --cat-1: #1b9cb3;
  --cat-2: #c1420d;
  --cat-3: #237c53;
  --cat-4: #943a99;
  --cat-5: #ad8d41;
  --cat-6: #5c66e2;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--peach); color: var(--ink); }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.08; letter-spacing: -0.012em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 4.2vw + 1rem, 4.4rem); }
h2 { font-size: clamp(1.9rem, 2.2vw + 1rem, 2.8rem); }
h3 { font-size: clamp(1.3rem, 0.6vw + 1rem, 1.55rem); line-height: 1.18; }
p { margin: 0 0 1em; text-wrap: pretty; }
code { font-size: 0.88em; background: var(--bg-2); padding: 0.1em 0.35em; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: 66ch; }
.prose p, .prose li { color: var(--ink-2); }
.lede { font-size: clamp(1.25rem, 0.6vw + 1.05rem, 1.5rem); line-height: 1.5; color: var(--ink); max-width: 46ch; }
.muted { color: var(--muted); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section--alt { background: var(--bg-2); }
.section + .section--flush { padding-top: 0; }
.placeholder { border-bottom: 1px dashed var(--accent); color: var(--accent-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  min-height: 48px; padding: 0.7em 1.4em;
  border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease-out), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--small { min-height: 40px; padding: 0.55em 1.05em; font-size: 0.98rem; }
.btn .icon { width: 1.1em; height: 1.1em; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.35em; font-weight: 700; text-decoration: none; }
.link-arrow .icon { transition: transform 0.25s var(--ease-out); }
.link-arrow:hover .icon { transform: translate(2px, -2px); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: border-color 0.2s, transform 0.2s var(--ease-out);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.95); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-strong); }
.brand__name { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.brand__name span { font-size: 0.86rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 1.02rem;
  padding: 8px 11px; border-radius: 999px; transition: background-color 0.2s, color 0.2s;
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }
.nav .nav__map { background: var(--accent); color: var(--on-accent); font-weight: 700; margin-left: 6px; display: inline-flex; gap: 6px; align-items: center; padding-inline: 14px; }
.nav .nav__map:hover, .nav .nav__map[aria-current="page"] { background: var(--accent-ink); color: var(--on-accent); }
.header-tools { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .icon-moon { display: none; }
}

@media (max-width: 1080px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 39;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 24px; background: var(--bg);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.3s var(--ease-out), visibility 0.25s;
  }
  .nav a { font-size: 1.25rem; padding: 12px 14px; border-radius: var(--radius); }
  .nav .nav__map { margin: 8px 0 0; justify-content: center; border-radius: 999px; }
  .site-header.menu-open .nav { transform: none; opacity: 1; visibility: visible; }
}
@media (max-width: 420px) { .brand__name span { display: none; } }

/* ---------- footer ---------- */
.site-footer { background: var(--grout); color: #efe6d8; padding-block: 64px 40px; margin-top: 0; }
.site-footer a { color: #f3c9a8; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-grid h2 { font-size: 1rem; text-transform: none; letter-spacing: 0; color: #cfc3d4; margin-bottom: 12px; font-weight: 700; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { width: 72px; height: 72px; border-radius: 50%; }
.footer-brand p { color: #d9cfdc; font-size: 1rem; }
.footer-legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgb(239 230 216 / 0.15); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 0.95rem; color: #b9adbe; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- hero (home) ---------- */
.hero { padding-block: clamp(32px, 5vw, 72px) clamp(48px, 7vw, 96px); }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 88px); align-items: center; min-height: min(calc(100dvh - var(--header-h) - 80px), 760px); }
.hero h1 { font-size: clamp(3rem, 5.4vw + 1rem, 5.6rem); line-height: 0.98; margin-bottom: 0.35em; }
.hero h1 span { display: block; font-weight: 500; color: var(--teal); font-size: 0.56em; line-height: 1.15; margin-top: 0.25em; letter-spacing: 0; }
.hero__sub { font-size: clamp(1.25rem, 0.7vw + 1.05rem, 1.55rem); line-height: 1.45; color: var(--ink-2); max-width: 30ch; margin-bottom: 1.6em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.arch { position: relative; margin: 0; }
.arch__frame {
  aspect-ratio: 4 / 5; border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden; background: var(--grout); box-shadow: var(--shadow);
}
.arch__frame img { width: 100%; height: 100%; object-fit: cover; }
.arch figcaption { font-size: 0.92rem; color: var(--muted); margin-top: 12px; }
.arch__tile { position: absolute; width: 22%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); left: -9%; bottom: 14%; border: 4px solid var(--bg); }
.arch__tile img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .js .arch__frame { animation: arch-in 1.4s var(--ease-out) both; }
  .js .arch__tile { animation: tile-in 1.1s 0.6s var(--ease-out) both; }
  .js .hero__copy > * { animation: rise 1s var(--ease-out) both; }
  .js .hero__copy > :nth-child(2) { animation-delay: 0.12s; }
  .js .hero__copy > :nth-child(3) { animation-delay: 0.24s; }
}
@keyframes arch-in { from { clip-path: inset(100% 0 0 0 round 999px 999px 14px 14px); } to { clip-path: inset(0 0 0 0 round 999px 999px 14px 14px); } }
@keyframes tile-in { from { opacity: 0; transform: translate(-16px, 16px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; min-height: 0; }
  .arch { max-width: 420px; justify-self: center; width: 86%; }
}

/* ---------- home: map story (sticky map, scrolling text) ---------- */
.story { position: relative; padding-block: clamp(48px, 6vw, 96px) 0; }
.story__head { margin-bottom: 24px; }
.story__grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); }
.story__map { position: sticky; top: calc(var(--header-h) + 16px); height: calc(100dvh - var(--header-h) - 32px); max-height: 720px; display: grid; align-items: center; }
.story__frame { position: relative; width: 100%; aspect-ratio: 1.7; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.story__frame .pm { position: absolute; inset: 0; }
.story__steps { padding-block: 22vh 30vh; }
.story-step { min-height: 70vh; display: flex; align-items: center; }
.story-step:last-child { min-height: 50vh; }
.story-step__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); opacity: 0.45; transition: opacity 0.5s, transform 0.6s var(--ease-out); }
.story-step.is-active .story-step__card { opacity: 1; }
.story-step__card p:last-child { margin-bottom: 0; }
.story-step__card p { color: var(--ink); }
.story-count { font-weight: 800; font-size: 1.5rem; line-height: 1.2; margin-top: 8px; }
.story-year {
  position: absolute; left: 20px; bottom: 16px; z-index: 2; pointer-events: none;
  font-weight: 800; font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1; color: var(--ink); opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 860px) {
  .story__grid { grid-template-columns: 1fr; }
  .story__map { top: var(--header-h); height: auto; max-height: none; margin-inline: calc(var(--gutter) * -1); z-index: 1; }
  .story__frame { aspect-ratio: 1.55; border-radius: 0; border-inline: 0; box-shadow: none; }
  .story__steps { padding-block: 8vh 20vh; position: relative; z-index: 2; }
  .story-step { min-height: 60vh; }
  .story-step__card { opacity: 0.94; }
  .story-year { font-size: 2.2rem; left: 16px; bottom: 10px; }
}

/* ---------- home: pathways bento ---------- */
.bento { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.bento__cell {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 280px; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  text-decoration: none; color: #fbf3e8; padding: 28px; background: var(--grout);
}
.bento__cell:first-child { grid-row: span 2; min-height: 560px; }
.bento__cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease-out); }
.bento__cell::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(28 23 38 / 0.1) 0%, rgb(28 23 38 / 0.62) 38%, rgb(28 23 38 / 0.92) 100%); }
.bento__cell:first-child::after { background: linear-gradient(180deg, rgb(28 23 38 / 0) 35%, rgb(28 23 38 / 0.9) 100%); }
.bento__cell h3, .bento__cell p { text-shadow: 0 1px 12px rgb(28 23 38 / 0.6); }
.bento__cell:hover img { transform: scale(1.04); }
.bento__cell h3 { font-size: clamp(1.5rem, 1.2vw + 1rem, 2.1rem); margin-bottom: 6px; color: #fff8ef; }
.bento__cell p { margin: 0; max-width: 34ch; color: #efe3d3; }
.bento__cell .link-arrow { margin-top: 14px; color: #f3c9a8; }
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; }
  .bento__cell:first-child { grid-row: auto; min-height: 380px; }
}

/* ---------- join band ---------- */
.band-cta { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 0; border-radius: var(--radius); overflow: hidden; background: var(--teal); color: #f6efe4; }
.band-cta__art { min-height: 300px; position: relative; }
.band-cta__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band-cta__copy { padding: clamp(28px, 4vw, 56px); align-self: center; }
.band-cta__copy h2 { color: #fff8ef; }
.band-cta__copy p { color: #e4eef0; max-width: 46ch; }
.band-cta .btn--primary { background: #fff8ef; color: #1f3d45; }
.band-cta .btn--primary:hover { background: #fde9d6; }
:root[data-theme="dark"] .band-cta { background: #193f49; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band-cta { background: #193f49; } }
@media (max-width: 760px) { .band-cta { grid-template-columns: 1fr; } .band-cta__art { min-height: 180px; } }

/* ---------- interior page header ---------- */
.page-head { position: relative; }
.page-head__band { height: clamp(150px, 20vw, 260px); overflow: hidden; background: var(--grout); }
.page-head__band img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .page-head__band img { animation: band-drift linear both; animation-timeline: scroll(root); animation-range: 0 60vh; }
  }
}
@keyframes band-drift { to { transform: scale(1.12) translateY(6%); } }
.page-head__card {
  position: relative; margin-top: calc(clamp(56px, 6vw, 88px) * -1);
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 3vw, 44px) 0; max-width: 980px;
}
.page-head__card h1 { margin-bottom: 0.25em; }
.page-head__card .lede { color: var(--ink-2); }
@media (max-width: 640px) { .page-head__card { margin-inline: calc(var(--gutter) * -0.5); } }

/* ---------- figures ---------- */
.fig { margin: 0; }
.fig img { border-radius: var(--radius); width: 100%; }
.fig figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.fig--missing .fig__placeholder {
  aspect-ratio: 4 / 3; border-radius: var(--radius); display: grid; place-items: center; padding: 16px; text-align: center;
  background: var(--grout) url("../img/tesserae-tile.svg") center / cover; color: #fff8ef; font-size: 0.95rem;
}
.fig--missing .fig__placeholder span { background: rgb(28 23 38 / 0.82); padding: 8px 12px; border-radius: 10px; }
.fig--missing code { background: none; color: #f3c9a8; }
.fig--wide .fig__placeholder { aspect-ratio: 16 / 9; }
.fig--tall .fig__placeholder { aspect-ratio: 3 / 4; }

/* ---------- article layout with sticky contents ---------- */
.article { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); font-size: 0.98rem; }
.toc p { font-weight: 700; color: var(--muted); margin-bottom: 8px; font-size: 0.95rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.3; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { border-left-color: var(--accent); color: var(--ink); font-weight: 700; }
@media (max-width: 960px) { .article { grid-template-columns: 1fr; } .toc { display: none; } }
.chapter { padding-block: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.chapter:first-child { border-top: 0; padding-top: 0; }
.chapter > h2 { max-width: 22ch; }
.sub { margin-top: 2.2em; }
.sub h3 { margin-bottom: 0.45em; }

/* local diplomacy: initiative tiles */
.initiatives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.initiative { position: relative; padding: 24px 24px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.initiative h3 { font-size: 1.3rem; margin-bottom: 0.35em; }
.initiative p { margin: 0; color: var(--ink-2); font-size: 1.06rem; }
.initiative::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tone, var(--accent)); }
.initiatives { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.initiative--photo { grid-row: span 3; padding: 0; display: flex; flex-direction: column; }
.initiative--photo img { flex: 1; min-height: 220px; object-fit: cover; width: 100%; }
.initiative--photo .initiative__body { padding: 22px 24px; }
@media (max-width: 700px) { .initiatives { grid-template-columns: 1fr; } .initiative--photo { grid-row: auto; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.split--flip { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split, .split--flip { grid-template-columns: 1fr; } }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); }
@media (max-width: 760px) { .two-up { grid-template-columns: 1fr; } }

.reasons { display: grid; gap: 0; counter-reset: reason; }
.network-list { display: grid; gap: 14px; margin-top: 24px; }
.network { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.network:nth-child(2) { margin-left: clamp(0px, 4vw, 48px); }
.network:nth-child(3) { margin-left: clamp(0px, 8vw, 96px); }
.network .icon { width: 44px; height: 44px; color: var(--teal); }
.network h3 { font-size: 1.25rem; margin-bottom: 0.3em; }
.network p { margin: 0; color: var(--ink-2); font-size: 1.06rem; }
.barriers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.barrier { padding: 24px; border-radius: var(--radius); background: var(--bg); border-top: 4px solid var(--ochre); }
.barrier:first-child { grid-column: span 2; }
.barrier h3 { font-size: 1.25rem; }
.barrier p { margin: 0; color: var(--ink-2); font-size: 1.06rem; }
@media (max-width: 760px) { .barriers { grid-template-columns: 1fr; } .barrier:first-child { grid-column: auto; } }

/* ---------- scrollytelling diagrams ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(24px, 4vw, 64px); }
.scrolly__sticky { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; height: calc(100dvh - var(--header-h) - 48px); max-height: 640px; display: grid; place-items: center; }
.scrolly__steps { padding-block: 18vh 26vh; }
.scrolly__step { min-height: 62vh; display: flex; align-items: center; }
.scrolly__step > div { opacity: 0.35; transition: opacity 0.5s; }
.scrolly__step.is-active > div { opacity: 1; }
.scrolly__step h3 { display: flex; align-items: center; gap: 10px; }
.scrolly__step p { color: var(--ink-2); }
@media (max-width: 860px) {
  .scrolly { grid-template-columns: 1fr; }
  .scrolly__sticky { top: var(--header-h); height: auto; max-height: none; padding-block: 10px; background: var(--bg); z-index: 2; }
  .scrolly__sticky::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 20px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
  .section--alt .scrolly__sticky { background: var(--bg-2); }
  .scrolly__step { min-height: 48vh; }
  .scrolly__step > div { opacity: 1; }
}
[data-show-at], [data-only-at] { transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out); }
.js [data-show-at]:not(.is-on), .js [data-only-at]:not(.is-on) { opacity: 0; }
.js [data-keep-visible]:not(.is-on) { opacity: 1; }
.js .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--ease-out), opacity 0.4s; }
.js .draw.is-on { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  [data-show-at], [data-only-at], .js .draw { transition: none !important; }
}

/* boomerang diagram */
.diagram { width: 100%; height: auto; max-height: 100%; overflow: visible; font-family: var(--font); }
.diagram text { fill: var(--ink); font-size: 19px; }
.diagram .d-label { font-weight: 700; }
.diagram .d-note { fill: var(--muted); font-size: 17px; font-style: italic; }
.diagram .d-node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .d-node--intl { fill: color-mix(in srgb, var(--teal) 16%, var(--surface)); stroke: var(--teal); }
.diagram .d-node--state { fill: var(--surface); stroke: var(--ink-2); }
.diagram .d-node--city { fill: var(--surface); stroke: var(--accent); stroke-width: 2; transition: fill 0.6s; }
.diagram .d-node--civil { fill: color-mix(in srgb, var(--ochre) 22%, var(--surface)); stroke: var(--ochre); }
.diagram .is-lit .d-node--city, .diagram .d-node--city.is-lit { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.diagram .d-state-reformed { fill: color-mix(in srgb, var(--accent) 28%, var(--surface)); stroke: var(--accent); stroke-width: 2.5; }
.diagram .d-flow { fill: none; stroke: var(--ink-2); stroke-width: 2.5; stroke-linecap: round; }
.diagram .d-flow--intl { stroke: var(--teal); }
.diagram .d-flow--local { stroke: var(--accent); stroke-width: 3; }
.diagram .d-flow--blocked { stroke: var(--muted); stroke-dasharray: 6 7; }
.diagram .d-block { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.diagram .d-arrowhead { fill: var(--ink-2); }
.diagram .d-arrowhead--intl { fill: var(--teal); }
.diagram .d-arrowhead--local { fill: var(--accent); }
.diagram .d-title { font-size: 16px; font-weight: 700; fill: var(--muted); letter-spacing: 0.04em; }

/* WPS timeline */
.timeline { position: relative; margin: 40px 0 0; }
.timeline__list { list-style: none; margin: 0; padding: 0; }
.timeline::before, .timeline__progress { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--line); border-radius: 3px; }
.timeline__progress { background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 1)); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline__progress { animation: grow-y linear both; animation-timeline: view(); animation-range: entry 30% exit 60%; }
  }
}
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding-block: 18px; }
.tl-item__body { grid-column: 1; text-align: right; }
.tl-item:nth-child(even) .tl-item__body { grid-column: 2; text-align: left; }
.tl-item::after { content: ""; position: absolute; left: 50%; top: 30px; width: 18px; height: 18px; margin-left: -9px; border-radius: 5px; transform: rotate(45deg); background: var(--bg); border: 3px solid var(--accent); }
.tl-item--wps::after { border-color: var(--teal); }
.tl-item--local::after { background: var(--accent); }
.tl-year { display: block; font-weight: 800; font-size: clamp(2rem, 2.4vw + 1rem, 3rem); line-height: 1; color: var(--teal); font-variant-numeric: tabular-nums; }
.tl-item--local .tl-year { color: var(--accent-ink); }
.tl-item h3 { font-size: 1.3rem; margin: 6px 0 4px; }
.tl-item p { margin: 0; color: var(--ink-2); font-size: 1.06rem; }
@media (max-width: 760px) {
  .timeline::before, .timeline__progress { left: 9px; }
  .tl-item { grid-template-columns: 1fr; gap: 0; padding-left: 40px; }
  .tl-item__body, .tl-item:nth-child(even) .tl-item__body { grid-column: 1; text-align: left; }
  .tl-item::after { left: 9px; }
}

/* four pillars */
.pillars-diagram { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 460px); position: relative; }
.pillar-tile {
  aspect-ratio: 1; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 18px; border: 2px solid var(--tone); color: var(--tone); background: var(--surface);
  transition: background-color 0.5s, color 0.5s, transform 0.6s var(--ease-out);
}
/* labels sit in each tile's outer corner, clear of the centre disc */
.pillar-tile:nth-child(1) { justify-content: flex-start; align-items: flex-start; }
.pillar-tile:nth-child(2) { justify-content: flex-start; align-items: flex-end; text-align: right; }
.pillar-tile:nth-child(3) { justify-content: flex-end; align-items: flex-start; }
.pillar-tile:nth-child(4) { justify-content: flex-end; align-items: flex-end; text-align: right; }
.pillar-tile .icon { width: 40px; height: 40px; }
.pillar-tile span { font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.pillar-tile.is-on { background: var(--tone); color: var(--on-tone, #fff8ef); transform: scale(1.03); }
.pillars-diagram__core {
  position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center; text-align: center; line-height: 1.1;
  background: var(--bg); border: 3px solid var(--ink); font-weight: 800; font-size: 1rem; padding: 8px; color: var(--ink);
}
.pillars-diagram__core small { display: block; font-weight: 500; font-size: 0.82rem; color: var(--muted); }
.tone-1 { --tone: var(--teal); }
.tone-2 { --tone: var(--accent); }
.tone-3 { --tone: #a87414; }
.tone-4 { --tone: var(--plum); }
:root[data-theme="dark"] .tone-3 { --tone: var(--ochre); --on-tone: #1c1726; }
:root[data-theme="dark"] .tone-1, :root[data-theme="dark"] .tone-2, :root[data-theme="dark"] .tone-4 { --on-tone: #1c1726; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tone-3 { --tone: var(--ochre); --on-tone: #1c1726; }
  :root:not([data-theme="light"]) .tone-1, :root:not([data-theme="light"]) .tone-2, :root:not([data-theme="light"]) .tone-4 { --on-tone: #1c1726; }
}
.pillar-step h3 .chip-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--tone); transform: rotate(45deg); flex: none; }
@media (max-width: 860px) {
  .pillars-diagram { grid-template-columns: repeat(4, 1fr); width: 100%; gap: 6px; }
  .pillar-tile, .pillar-tile:nth-child(n) { aspect-ratio: auto; padding: 10px 6px; align-items: center; justify-content: center; text-align: center; }
  .pillar-tile .icon { width: 26px; height: 26px; }
  .pillar-tile span { font-size: 0.85rem; }
  .pillars-diagram__core { display: none; }
}

/* WPS: grassroots feature */
.feature-photo { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.feature-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.feature-photo__body { padding: clamp(24px, 4vw, 56px); align-self: center; }
@media (max-width: 760px) { .feature-photo { grid-template-columns: 1fr; } }

/* ---------- research ---------- */
.cohort { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(24px, 4vw, 48px); align-items: end; }
@media (max-width: 860px) { .cohort { grid-template-columns: 1fr; } }
.projects { display: grid; gap: 14px; margin-top: 40px; }
.project { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.3s, box-shadow 0.3s; }
.project[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.project summary { list-style: none; cursor: pointer; padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; }
.project summary::-webkit-details-marker { display: none; }
.project summary h3 { margin: 0; font-size: clamp(1.3rem, 0.8vw + 1rem, 1.7rem); }
.project__meta { grid-column: 1; margin: 0; color: var(--muted); font-size: 1.02rem; }
.project__meta strong { color: var(--ink-2); font-weight: 700; }
.project__teaser { grid-column: 1; margin: 6px 0 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project[open] .project__teaser { display: none; }
.project__toggle { grid-column: 2; grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink); transition: transform 0.4s var(--ease-out), background-color 0.2s; }
.project[open] .project__toggle { transform: rotate(45deg); background: var(--bg-2); }
.project summary:hover .project__toggle { border-color: var(--ink); }
.project__body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(20px, 3vw, 40px); padding: 0 clamp(20px, 3vw, 32px) clamp(20px, 3vw, 32px); }
.project__body .prose p { color: var(--ink-2); }
.project__body .fig img { box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) {
  .project[open] .project__body { animation: rise 0.6s var(--ease-out); }
}
@media (max-width: 760px) { .project__body { grid-template-columns: 1fr; } }

/* ---------- people ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.person { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.avatar {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; position: relative; overflow: hidden;
  font-weight: 800; font-size: 1.35rem; color: #fff8ef; background: var(--grout);
}
.avatar::before { content: ""; position: absolute; inset: 0; background: url("../img/tesserae-tile.svg") var(--ap, 50% 50%) / 260% auto; opacity: 0.85; }
.avatar span { position: relative; text-shadow: 0 1px 6px rgb(28 23 38 / 0.7); }
.person h3 { font-size: 1.15rem; margin: 0 0 2px; }
.person p { margin: 0; font-size: 0.98rem; color: var(--muted); line-height: 1.35; }
.person a { font-size: 0.98rem; }
.faculty { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line-strong); }
.faculty .avatar { width: 160px; height: 160px; border-radius: var(--radius); font-size: 2.6rem; }
@media (max-width: 600px) { .faculty { grid-template-columns: 1fr; } }

/* ---------- data page ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 32px; border-top: 1px solid var(--line); }
.stat { padding: 20px 20px 4px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(2.2rem, 3vw + 1rem, 3.4rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 1rem; }
.stat b.is-loading { color: transparent; background: var(--bg-2); border-radius: 8px; width: 2.4em; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { padding-left: 0; border-left: 0; } }
.codebook { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.codebook section { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.codebook h3 { font-size: 1.2rem; }
.codebook dl { margin: 0; display: grid; gap: 10px; }
.codebook dt { font-weight: 700; font-size: 1rem; }
.codebook dd { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
@media (max-width: 900px) { .codebook { grid-template-columns: 1fr; } }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin-top: 24px; }
.type-def { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 14px; align-content: start; }
.type-def .swatch { margin-top: 7px; }
.type-def h3 { font-size: 1.15rem; margin: 0; display: flex; gap: 10px; align-items: baseline; }
.type-def h3 small { font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.type-def p { grid-column: 2; margin: 0; color: var(--ink-2); font-size: 1.04rem; }
@media (max-width: 760px) { .types { grid-template-columns: 1fr; } }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--map-land); flex: none; }
.bars { display: grid; gap: 8px; margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 14px; align-items: center; font-size: 1rem; }
.bar-row__label { color: var(--ink-2); }
.bar-row__track { display: flex; align-items: center; gap: 10px; }
.bar-row__bar { height: 18px; background: var(--teal); border-radius: 0 4px 4px 0; transform-origin: left; transition: transform 1s var(--ease-out); }
.bar-row__value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.js .bars:not(.is-in) .bar-row__bar { transform: scaleX(0); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr; gap: 2px; } }
.notes { display: grid; gap: 14px; margin-top: 20px; padding: 0; list-style: none; }
.notes li { padding-left: 18px; border-left: 3px solid var(--ochre); color: var(--ink-2); }
.code-block { position: relative; background: var(--grout); color: #f1e7d6; border-radius: var(--radius); padding: 18px 20px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92rem; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.cite p { margin-bottom: 14px; color: var(--ink); }

/* ---------- join ---------- */
.steps-list { display: grid; gap: 0; margin: 24px 0 0; padding: 0; list-style: none; }
.steps-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps-list .icon { width: 36px; height: 36px; color: var(--accent); }
.steps-list h3 { font-size: 1.2rem; margin-bottom: 4px; }
.steps-list p { margin: 0; color: var(--ink-2); }
.contact-card { padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--bg-2); }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; align-content: center; }
