:root {
  /* ── CHANGE THIS ONE LINE to your brand colour ── */
  --brand:     #00539F;

  --brand-ink: #003A6E;
  --brand-bg:  #EAF1F8;
  --teal:      #0F8B8D;
  --orange:    #EF6C00;
  --red:       #C62828;
  --green:     #2E7D32;
  --amber:     #F9A825;
  --ink:       #0F172A;
  --ink-2:     #475569;
  --ink-3:     #94A3B8;
  --line:      #E2E8F0;
  --bg:        #F8FAFC;
  --card:      #FFFFFF;
  --dark:      #0F172A;
  --warn-bg:   #FEF3C7;
  --warn-ink:  #92400E;
  --warn-line: #FCD34D;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

/* ── masthead ─────────────────────────────────────── */

header.mast {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}

.mast-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; color: var(--ink);
  text-decoration: none; letter-spacing: -0.02em;
}

.brand img { height: 30px; width: auto; display: block; }
.brand .divider { color: var(--ink-3); font-weight: 300; }
.brand .proj { color: var(--ink-2); font-weight: 400; font-size: 15px; }

nav.pages { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; align-items: center; }

nav.pages a {
  padding: 8px 14px; border-radius: 8px; font-size: 15px;
  color: var(--ink-2); text-decoration: none; transition: all .15s;
}

nav.pages a:hover { background: var(--bg); color: var(--ink); }
nav.pages a.on { color: var(--brand); font-weight: 500; background: var(--brand-bg); }

.cta {
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  background: var(--brand); color: #fff !important; text-decoration: none;
  margin-left: 8px; white-space: nowrap;
}
.cta:hover { background: var(--brand-ink); }

/* ── synthetic-data banner ────────────────────────── */

.synthetic {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn-ink); font-size: 14px;
}
.synthetic .inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; }
.synthetic strong { font-weight: 600; }
.synthetic a { color: var(--warn-ink); font-weight: 500; }

/* ── layout ───────────────────────────────────────── */

main { max-width: 1200px; margin: 0 auto; padding: 48px 24px 80px; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 10px;
}

h1 { font-size: 42px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.03em; font-weight: 600; }
h2 { font-size: 26px; margin: 56px 0 6px; letter-spacing: -0.02em; font-weight: 600; }
h3 { font-size: 16px; margin: 22px 0 6px; font-weight: 600; }

.sub { color: var(--ink-2); margin: 0 0 8px; font-size: 18px; max-width: 62ch; line-height: 1.6; }
.note { color: var(--ink-2); font-size: 15px; }
.small { font-size: 13px; color: var(--ink-3); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; margin: 18px 0;
}

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ── KPI strip ────────────────────────────────────── */

.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px; margin: 32px 0 10px;
}

.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
}

.kpi .lab { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.kpi .val { font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.1; letter-spacing: -0.03em; }
.kpi .foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.kpi .foot.bad  { color: var(--red); font-weight: 500; }
.kpi .foot.good { color: var(--green); font-weight: 500; }

/* ── charts ───────────────────────────────────────── */

.chartbox { position: relative; height: 340px; }
.chartbox.tall { height: 440px; }

/* ── tables ───────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 15px; }

th {
  text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2);
  padding: 10px 12px; border-bottom: 2px solid var(--line);
  white-space: nowrap; cursor: pointer; user-select: none;
}
th.num, td.num { text-align: right; }
th:hover { color: var(--brand); }

td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--bg); }

.bar {
  display: inline-block; height: 6px; border-radius: 3px;
  background: var(--brand); vertical-align: middle; margin-left: 10px; opacity: .8;
}

.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 500; }

/* ── controls ─────────────────────────────────────── */

.controls { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }

select, input[type=search] {
  font: inherit; font-size: 15px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); min-width: 165px;
}
select:focus, input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

/* ── findings ─────────────────────────────────────── */

.finding {
  background: var(--brand-bg); border-radius: 14px;
  padding: 18px 22px; margin: 20px 0; font-size: 16px; line-height: 1.6;
  color: var(--brand-ink);
}
.finding strong { color: var(--brand-ink); font-weight: 600; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; font-size: 15px; }
dl.kv dt { color: var(--ink-2); }
dl.kv dd { margin: 0; font-weight: 500; }

/* ── footer ───────────────────────────────────────── */

footer.foot {
  background: var(--dark); color: #94A3B8;
  margin: 72px -24px -80px; padding: 40px 24px;
  font-size: 14px; line-height: 1.7;
}
footer.foot .inner { max-width: 1200px; margin: 0 auto; }
footer.foot a { color: #CBD5E1; }
footer.foot strong { color: #F1F5F9; }

ol.lim > li { margin-bottom: 12px; }

/* ── project cards (portfolio landing) ────────────── */

.projects {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px; margin: 32px 0;
}

.project {
  display: block; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 26px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}

.project:hover { border-color: var(--brand); transform: translateY(-2px); }
.project.soon { opacity: .6; cursor: default; }
.project.soon:hover { border-color: var(--line); transform: none; }

.project-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}

.project .sector {
  font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--brand);
}

.project .badge {
  font-size: 12px; font-weight: 500; padding: 3px 10px;
  border-radius: 10px; background: var(--bg); color: var(--ink-2);
}

.project h3 { font-size: 21px; margin: 0 0 8px; letter-spacing: -0.02em; }
.project .blurb { color: var(--ink-2); font-size: 15px; margin: 0 0 20px; line-height: 1.6; }

.project-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 18px 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
}

.project-stats .v {
  display: block; font-size: 19px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.02em;
}
.project-stats .k { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.project .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.project .tags span {
  font-size: 12px; padding: 4px 10px; border-radius: 8px;
  background: var(--bg); color: var(--ink-2);
}

.project .go { font-size: 15px; font-weight: 500; color: var(--brand); }

/* ── responsive ───────────────────────────────────── */

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  .sub { font-size: 16px; }
  main { padding: 32px 16px 56px; }
  .mast-inner, .synthetic .inner { padding: 12px 16px; }
  .chartbox { height: 280px; }
  footer.foot { margin: 48px -16px -56px; padding: 32px 16px; }
  .cta { display: none; }
  .projects { grid-template-columns: 1fr; }
  .project { padding: 20px; }
  .project-stats { grid-template-columns: 1fr; gap: 10px; }
}