@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --paper: #f3f2ed;
  --surface: #fffefa;
  --ink: #1d2927;
  --muted: #687571;
  --line: #dedfd7;
  --forest: #174b43;
  --forest-deep: #103b35;
  --coral: #d7664d;
  --mint: #e4eee8;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.65 var(--font-body);
}

a { color: var(--forest); }
a:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.site-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 76px);
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 38px clamp(22px, 4vw, 64px) 72px;
}

.site-sidebar { align-self: start; position: sticky; top: 28px; min-width: 0; }

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  color: var(--ink);
  text-decoration: none;
}

.site-brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: white;
  background: var(--forest);
  font: 700 14px var(--font-display);
}

.site-brand-name { display: block; font: 600 14px/1.25 var(--font-display); }
.site-brand-caption { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.site-nav-group + .site-nav-group { margin-top: 25px; }

.site-nav-label {
  margin: 0 0 9px 12px;
  color: #84908b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.site-nav-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.site-nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  color: #52615c;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}

.site-nav-list a:hover { color: var(--forest-deep); background: #e7e9e1; }
.site-nav-list a[aria-current="page"] { color: var(--forest-deep); background: var(--mint); font-weight: 700; }

.site-main { min-width: 0; }
.page-hero { margin-bottom: 18px; }

.legacy-content {
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.legacy-content :where(h1, h2, h3, h4) {
  color: var(--ink);
  font-family: var(--font-display) !important;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: left;
}

.legacy-content h1, .legacy-content h2 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--coral);
  font-size: clamp(25px, 3vw, 36px) !important;
}

.legacy-content h3 { margin: 30px 0 14px; font-size: 21px !important; }
.legacy-content h4 { margin: 24px 0 10px; font-size: 17px !important; }

.legacy-content :where(p, li, td, th, span, b, strong, em) {
  max-width: 100%;
  color: #43504b;
  font-family: var(--font-body) !important;
  line-height: 1.75 !important;
  text-align: left;
}

.legacy-content p { margin: 0 0 16px; }
.legacy-content ul, .legacy-content ol { padding-left: 24px; }
.legacy-content li { margin-bottom: 7px; }
.legacy-content a { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }
.legacy-content a:hover { color: #a94331; }
.legacy-content img { max-width: 100%; height: auto; border-radius: 6px; }
.legacy-content table { max-width: 100%; border-color: var(--line); }
.legacy-content :where(td, th) { padding: 8px; }

.home-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 24vw, 260px);
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
}

.profile-details p { margin: 0 0 10px; color: #43504b; font-size: 15px; line-height: 1.7; }
.profile-photo { justify-self: end; width: min(100%, 240px); margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 28px rgba(29, 41, 39, .12); }
.profile-photo img { display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; object-position: center 38%; }

.project-lists { display: grid; gap: 34px; }
.project-list-group h2 { margin: 0 0 16px; color: var(--forest); font: 600 22px/1.25 var(--font-display); }
.project-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.project-entry { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.project-period { color: var(--coral); font: 700 13px/1.5 var(--font-display); }
.project-entry h3 { margin: 0 0 7px; color: var(--ink); font: 600 16px/1.4 var(--font-display); }
.project-entry p { margin: 0; color: #4a5752; font-size: 13px; line-height: 1.75; }
.project-entry a { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }
.project-entry a:hover { color: #a94331; }

.site-footer { grid-column: 2; padding-top: 22px; color: #85908b; font-size: 11px; }

/* Shared project-detail components */
.project-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 10px;
  color: #f7f7f1;
  background-color: var(--forest-deep);
  background-image: linear-gradient(115deg, rgba(16, 59, 53, .98) 15%, rgba(23, 75, 67, .92) 68%, rgba(37, 94, 79, .84));
}

.project-hero::after {
  position: absolute;
  right: -72px;
  bottom: -132px;
  width: 360px;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255,255,255,.035), 0 0 0 66px rgba(255,255,255,.025);
  content: "";
  pointer-events: none;
}

.project-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0;
  color: #f7f7f1;
  font: 600 clamp(34px, 4vw, 54px)/1.08 var(--font-display);
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: #c6ddd1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.eyebrow::before { width: 20px; height: 2px; background: var(--coral); content: ""; }

.project-facts {
  display: grid;
  grid-template-columns: minmax(110px, .65fr) minmax(210px, 1.4fr) minmax(145px, .8fr) minmax(180px, 1.1fr);
  gap: 1px;
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.project-facts div { min-width: 0; padding: 17px 20px; background: var(--surface); }
.project-facts dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.project-facts dd { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.project-facts .funding-value { color: var(--forest); font: 700 20px/1.25 var(--font-display); white-space: nowrap; }

.content-section { padding: 38px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font: 600 22px/1.25 var(--font-display); letter-spacing: 0; }
.section-index { color: var(--coral); font: 600 12px var(--font-display); }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.team-panel { padding: 22px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.team-panel h3 { margin: 0 0 14px; color: var(--forest); font: 600 16px/1.35 var(--font-display); }
.team-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.team-list li { padding: 10px 0; border-top: 1px solid #ecece6; color: #43504b; font-size: 13px; }
.text-block { max-width: 900px; }
.text-block p { margin: 0; color: #4a5752; font-size: 14px; line-height: 1.85; }
.text-block + .text-block { margin-top: 25px; }
.language-label { margin-bottom: 8px; color: var(--forest); font: 600 15px var(--font-display); }

.report-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #cbd9d0;
  border-radius: 7px;
  color: var(--forest-deep);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}

.report-link::after { color: var(--coral); content: "↗"; font-size: 17px; }
.report-link:hover { border-color: var(--forest); background: var(--mint); }
.report-note { display: inline-block; margin: 0 0 0 10px; color: var(--muted); font-size: 12px; }
.results-placeholder { padding: 28px 0 0; color: #84908b; }
.results-placeholder .section-heading { margin: 0; }
.results-placeholder h2 { color: #65726d; font-size: 17px; }
.page-footer { padding-top: 24px; color: #85908b; font-size: 11px; }

@media (max-width: 1050px) {
  .site-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 28px; padding-right: 28px; padding-left: 28px; }
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .site-layout { grid-template-columns: 1fr; gap: 22px; padding-top: 22px; }
  .site-sidebar { position: static; }
  .site-brand { margin-bottom: 18px; }
  .site-nav-group + .site-nav-group { margin-top: 15px; }
  .site-nav-label { margin-left: 0; }
  .site-nav-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .site-nav-list a { padding: 7px 10px; background: rgba(255,255,255,.52); }
  .site-footer { grid-column: 1; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .site-layout { gap: 20px; padding: 16px 16px 42px; }
  .site-brand { margin-bottom: 16px; }
  .site-nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav-list a { display: flex; min-height: 42px; align-items: center; padding: 8px 10px; font-size: 12px; }
  .legacy-content { padding: 22px 18px; }
  .home-profile { grid-template-columns: 1fr; gap: 24px; }
  .profile-photo { grid-row: 1; justify-self: start; width: min(220px, 72%); }
  .project-lists { gap: 26px; }
  .project-entry { grid-template-columns: 1fr; gap: 3px; padding: 16px 0; }
  .project-hero { padding: 28px 22px; border-radius: 8px; }
  .project-hero h1 { font-size: 34px; }
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-facts div { padding: 14px; }
  .project-facts .funding-value { font-size: 19px; }
  .content-section { padding: 28px 0; }
  .section-heading h2 { font-size: 20px; }
  .team-grid { grid-template-columns: 1fr; }
  .team-panel { padding: 18px; }
  .text-block p { font-size: 13px; }
  .report-note { margin: 8px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}