/* APS project website: one stylesheet. Tokens first. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-italic-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap;
}

:root {
  --ink: #111417;
  --ink-2: #3b4148;
  --ink-3: #5f6770;
  --rule: #d9dde1;
  --paper: #ffffff;
  --tint-grey: #eeeeee;
  --tint-teal: #cfe5e6;
  --tint-blue: #c1d9f7;
  --tint-lilac: #dee2f5;
  --accent: #0d5c63;
  --accent-ink: #0a474c;

  /* Four APS profiles: same colours in every chart, card and the video */
  --p1: #b5482a; /* Broadly low */
  --p2: #c08a1c; /* Near average, social weakness */
  --p3: #3b7dbb; /* Broadly high */
  --p4: #1c3354; /* Very high */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 56rem;
  --wide: 1160px;
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.4vw, 2.7rem);
  --space: clamp(1rem, 0.8rem + 1vw, 1.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
  font-variation-settings: "wdth" 100;
  hyphens: manual; -webkit-hyphens: manual;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); font-weight: 700; font-variation-settings: "wdth" 92; }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.6em; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
.small { font-size: var(--step--1); color: var(--ink-3); }
blockquote .small, .callout .small { color: var(--ink-2); }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: none; }
.eyebrow { font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 0.6em; }

/* Layout */
.wrap { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }
.wrap.wide, .wide { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
main { display: block; padding-bottom: 4rem; }
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--rule); }
.grid { display: grid; gap: var(--space); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; grid-template-columns: repeat(4, 6px); gap: 3px; align-items: end; height: 26px; }
.brand-mark i { display: block; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 9px; background: var(--p1); }
.brand-mark i:nth-child(2) { height: 14px; background: var(--p2); }
.brand-mark i:nth-child(3) { height: 20px; background: var(--p3); }
.brand-mark i:nth-child(4) { height: 26px; background: var(--p4); }
.brand-text { font-weight: 700; font-size: 1.02rem; line-height: 1.15; font-variation-settings: "wdth" 90; }
.brand-text span { display: block; font-weight: 400; font-size: 0.8rem; color: var(--ink-3); font-variation-settings: "wdth" 100; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 1.1rem; }
.site-nav li + li { margin-top: 0; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.93rem; padding: 0.4rem 0; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.nav-toggle { display: none; font: inherit; font-size: 0.9rem; background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 0.35rem 0.8rem; color: var(--ink); cursor: pointer; }
@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem 1.25rem 1rem; }
  .site-nav a { padding: 0.55rem 0; width: 100%; }
  .no-js .site-nav { display: block; position: static; border: 0; }
  .no-js .nav-toggle { display: none; }
  .no-js .header-inner { flex-wrap: wrap; }
}

/* Footer */
.site-footer { background: #f6f7f7; border-top: 1px solid var(--rule); padding: 2.5rem 0 1.2rem; font-size: 0.93rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: start; }
.footer-title { font-weight: 650; color: var(--ink); }
.footer-logos { display: flex; flex-direction: column; align-items: flex-end; gap: 1.2rem; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.5rem; }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-logos { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Components */
.callout { background: var(--tint-teal); padding: 1.1rem 1.3rem; border-radius: 6px; margin: 1.5rem 0; }
.callout.blue { background: var(--tint-blue); }
.callout.lilac { background: var(--tint-lilac); }
.callout.grey { background: var(--tint-grey); }
.callout > :last-child { margin-bottom: 0; }
.card { border: 1px solid var(--rule); border-radius: 8px; padding: 1.2rem 1.25rem 1.1rem; background: var(--paper); }
.card h3 { margin-top: 0; font-size: 1.08rem; }
.card > :last-child { margin-bottom: 0; }
.profile-card { border-top: 6px solid var(--pc, var(--ink)); }
.profile-card[data-p="P1"] { --pc: var(--p1); }
.profile-card[data-p="P2"] { --pc: var(--p2); }
.profile-card[data-p="P3"] { --pc: var(--p3); }
.profile-card[data-p="P4"] { --pc: var(--p4); }
.profile-card .share { font-size: 2rem; font-weight: 700; font-variation-settings: "wdth" 85; line-height: 1; margin: 0.3rem 0 0.2rem; }
.profile-card .share small { font-size: 0.85rem; font-weight: 400; color: var(--ink-3); font-variation-settings: "wdth" 100; }
.chip { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.85rem; }
.chip::before { content: ""; width: 0.8em; height: 0.8em; border-radius: 2px; background: var(--pc); }
.chip[data-p="P1"] { --pc: var(--p1); } .chip[data-p="P2"] { --pc: var(--p2); }
.chip[data-p="P3"] { --pc: var(--p3); } .chip[data-p="P4"] { --pc: var(--p4); }
.stat { border-left: 3px solid var(--accent); padding-left: 1rem; }
.stat .num { font-size: var(--step-3); font-weight: 700; font-variation-settings: "wdth" 85; line-height: 1; display: block; margin-bottom: 0.35rem; }
.stat p { margin: 0; color: var(--ink-2); }
.button { display: inline-block; padding: 0.6rem 1.1rem; border-radius: 5px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.button:hover { background: var(--accent-ink); color: #fff; }
.button.ghost { background: none; color: var(--accent); border: 1px solid var(--accent); }
.button.ghost:hover { background: var(--tint-teal); color: var(--accent-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.arrow-link { font-weight: 600; text-decoration: none; }
.arrow-link::after { content: " →"; }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); background: linear-gradient(180deg, #f4f8f8 0%, #fff 100%); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: none; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
.hero .lede { margin-top: 1rem; }

/* Charts and tables */
figure { margin: 2rem 0; }
.chart-figure { border: 1px solid var(--rule); border-radius: 8px; padding: 1.2rem 1.25rem; }
figcaption { font-weight: 650; margin-bottom: 0.4rem; }
.chart { min-height: 120px; overflow-x: auto; }
.chart svg { max-width: none; }
.chart-note { font-size: var(--step--1); color: var(--ink-3); margin: 0.6rem 0 0; }
.chart-tools { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin-top: 0.8rem; font-size: 0.9rem; }
.chart-tools button { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; padding: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0.4rem 0 0.8rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 650; background: #f6f7f7; }
td.num, th.num { text-align: right; }
.table-scroll { overflow-x: auto; margin: 0.8rem 0; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: end; margin: 0.6rem 0 1rem; }
.controls label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.88rem; color: var(--ink-2); font-weight: 600; }
select { font: inherit; font-size: 0.95rem; padding: 0.4rem 0.6rem; border: 1px solid #b9c0c6; border-radius: 4px; background: #fff; color: var(--ink); min-width: 12rem; }

/* People */
.person { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start; }
.person img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--tint-grey); }
.person h3 { margin: 0.1rem 0 0.15rem; font-size: 1.05rem; }
.person .role { font-weight: 600; color: var(--accent); font-size: 0.88rem; margin-bottom: 0.25rem; }
.person p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }

/* Lists of outputs */
.outputs { list-style: none; padding: 0; margin: 0; }
.outputs li { border-top: 1px solid var(--rule); padding: 1rem 0; display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; }
.outputs li:last-child { border-bottom: 1px solid var(--rule); }
.outputs .type { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding-top: 0.15rem; }
.outputs .title { font-weight: 650; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 99px; background: var(--tint-lilac); color: var(--ink-2); margin-left: 0.4rem; vertical-align: 0.1em; }
@media (max-width: 560px) { .outputs li { grid-template-columns: 1fr; gap: 0.2rem; } }

/* Prose helpers */
.prose h2:first-child { margin-top: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1.1rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--tint-teal); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.sources { font-size: var(--step--1); color: var(--ink-3); }
.sources li + li { margin-top: 0.5em; }
.toc { font-size: 0.92rem; border-left: 2px solid var(--rule); padding-left: 1rem; }
.video-frame { aspect-ratio: 16 / 9; background: #0f1a24; border-radius: 8px; overflow: hidden; }
.video-frame video { width: 100%; height: 100%; }
details.transcript { margin-top: 0.8rem; }
details.transcript summary { cursor: pointer; color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.section .wrap > h2:first-child, .section .wide > h2:first-child { margin-top: 0; }

/* Policy briefs */
.print-only { display: none; }
.brief { padding: 2.2rem 0 3rem; }
.brief h1 { font-size: var(--step-3); max-width: none; }
.brief h2 { font-size: var(--step-1); margin-top: 1.8rem; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 1rem 0 1.5rem; }
.brief-key { background: var(--tint-teal); padding: 1rem 1.3rem; border-radius: 6px; border-left: 5px solid var(--accent); }
.brief-key h2 { margin: 0 0 0.3rem; font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); }
.brief-key p { margin: 0; font-size: 1.05em; }
.brief-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin: 1.4rem 0 0.4rem; }
.brief-glance .num { font-size: var(--step-2); }
.brief-glance span:last-child { color: var(--ink-2); font-size: 0.93rem; display: block; }
.brief-list { padding-left: 1.3rem; }
.brief-list li { margin-bottom: 0.55rem; }
.brief-fig { margin: 1.4rem 0; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 6px; break-inside: avoid; }
.brief-fig figcaption { font-weight: 650; margin-bottom: 0.3rem; }
.brief-fig .src { font-size: var(--step--1); color: var(--ink-3); margin: 0.6rem 0 0; }
.legend li { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; }
ul.legend { padding: 0; }
.legend .sw { width: 0.8rem; height: 0.8rem; border-radius: 2px; display: inline-block; }
.sbars { display: grid; gap: 0.3rem; }
.srow { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.srow:has(.tall) { grid-template-columns: 1fr; }
.srow.hl .lab { font-weight: 700; }
.stack { display: flex; height: 1.35rem; border-radius: 2px; overflow: hidden; }
.stack.tall { height: 2rem; }
.seg { color: #fff; font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.seg.p1 { background: var(--p1); } .seg.p2 { background: var(--p2); color: var(--ink); } .seg.p3 { background: var(--p3); }
.seg.p3 span { background: rgba(255,255,255,0.92); color: var(--ink); padding: 0 0.25em; border-radius: 2px; line-height: 1.3; } .seg.p4 { background: var(--p4); }
.hbars { display: grid; gap: 0.35rem; }
.hrow { display: grid; grid-template-columns: minmax(8rem, 17rem) 1fr 3.6rem; gap: 0.6rem; align-items: center; font-size: 0.88rem; }
.hrow .bar { background: var(--tint-grey); height: 0.95rem; border-radius: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hrow .bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hrow .val { text-align: right; font-variant-numeric: tabular-nums; }
.brief-about { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.brief-about h2 { margin-top: 0; }
.brief-more { margin-top: 1.5rem; }
.brief-card h2 { font-size: var(--step-1); margin-top: 0; }
.brief-card h2 a { text-decoration: none; }
@media (max-width: 520px) {
  .hrow { grid-template-columns: 1fr 3.4rem; }
  .hrow .lab { grid-column: 1 / -1; }
  .srow { grid-template-columns: 5.6rem 1fr; }
}

@media print {
  @page { size: letter; margin: 13mm 15mm 12mm; }
  html { font-size: 10pt; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .skip, .screen-only, .nav-toggle { display: none !important; }
  .print-only { display: block; }
  .wrap { width: 100%; }
  a { color: inherit; text-decoration: none; }
  .brief { padding: 0; }
  .brief-print-top { font-size: 0.85rem; color: var(--ink-3); border-bottom: 2px solid var(--accent); padding-bottom: 0.35rem; margin-bottom: 0.8rem; }
  .brief .eyebrow { margin-bottom: 0.3rem; }
  .brief h1 { font-size: 1.85rem; line-height: 1.15; margin: 0 0 0.8rem; }
  .brief h2 { font-size: 1.15rem; margin: 1rem 0 0.4rem; break-after: avoid; }
  .brief p, .brief li { line-height: 1.42; }
  .brief-key, .brief-glance, .brief-list li, .brief-about { break-inside: avoid; }
  .brief-key { -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 0.7rem 1rem; }
  .brief-glance { grid-template-columns: repeat(3, 1fr); margin: 0.9rem 0 0; }
  .brief-glance .num { font-size: 1.5rem; }
  .brief-list li { margin-bottom: 0.35rem; }
  .brief-fig { margin: 0.8rem 0; padding: 0.7rem 0.9rem; }
  .brief-about { margin-top: 1rem; padding-top: 0.6rem; }
  .brief-about p { margin: 0 0 0.35rem; }
  .hrow { grid-template-columns: 22rem 1fr 3.6rem; }
  .brief-logos { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem !important; }
}

.video-frame video { width: 100%; height: 100%; display: block; }
.transcript { margin-top: 0.8rem; font-size: 0.95rem; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.transcript p { margin: 0.6rem 0 0; color: var(--ink-2); }

/* Home */
.hero-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr 1fr; } }
.hero-grid h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem); }
.hero-video { margin: 0; }
.hero-video figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.5rem; }
.steps-cards { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.link-card { display: block; height: 100%; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.link-card:hover, .link-card:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px rgba(13, 92, 99, 0.12); }
.link-card h3 { color: var(--accent-ink); }
.link-card p { color: var(--ink-2); margin-bottom: 0; }
.link-card .eyebrow { margin-bottom: 0.4rem; }
.step-n { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.6rem; }
.home-bar { margin: 1.4rem 0 1rem; }
.home-bar .stack.tall { height: 2.4rem; }
.home-bar .seg { font-size: 0.9rem; }
.profile-mini .profile-card { border-top-width: 4px; padding-top: 0.6rem; }
.profile-mini h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.profile-mini p { margin: 0; font-size: 0.93rem; color: var(--ink-2); }
.home-about p:last-child { margin-bottom: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }

.brief-contact { background: var(--tint-grey); padding: 0.7rem 1rem; border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
