/* Layout: a one-line-diagram site. Navy bands carry thesis statements; warm white carries the work.
   A thin bus line with nodes is the recurring device: it shows disciplines converging on one project. */
:root {
  --navy: #13213A;
  --navy-2: #1C2D4B;
  --graphite: #2A2F36;
  --ink: #171B21;
  --paper: #F7F5F0;
  --paper-2: #EEEBE3;
  --line: #D9D4C8;
  --muted: #565D68;
  --amber: #FF9F00;      /* logo amber: marks, rules, nodes */
  --amber-text: #8F5600; /* amber that passes contrast on paper */
  --green: #2F7D52;      /* energy green: status, confirmations */
  --on-navy: #F3F1EA;
  --on-navy-muted: #B4BCCB;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1200px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--amber-text); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 14px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 64px; width: auto; max-width: none; object-fit: contain; }
@media (max-width: 600px) { .brand img { height: 52px; } }
.lang { margin-left: auto; display: flex; gap: 4px; font-family: var(--mono); font-size: 13px; }
.lang a, .lang span { padding: 4px 8px; border-radius: 3px; text-decoration: none; color: var(--muted); }
.lang a[aria-current="true"] { background: var(--navy); color: var(--on-navy); }
.lang span[aria-disabled="true"] { opacity: .7; }
.nav { flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; white-space: nowrap; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 3px;
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--graphite);
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
.nav a.nav-cta { background: var(--navy); color: var(--on-navy); }
.nav a.nav-cta:hover { background: var(--navy-2); color: var(--on-navy); }
/* Desktop: logo + language on the first row, the whole menu on one line below */
@media (min-width: 900px) {
  .site-header .wrap { row-gap: 8px; padding-block: 12px 6px; }
  .nav { order: 3; flex: 1 1 100%; overflow: visible; }
  .nav ul { flex-wrap: wrap; justify-content: space-between; gap: 0; }
  .nav a { font-size: 13.5px; padding: 7px 9px; letter-spacing: -0.005em; }
}
@media (min-width: 1220px) { .nav ul { flex-wrap: nowrap; } }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); font-stretch: 87.5%; text-wrap: balance; margin: 0; color: inherit; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 22px; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
.lede { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; max-width: 62ch; }
.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber-text);
}
.measure { max-width: 66ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Bands ---------- */
.band { padding-block: clamp(56px, 8vw, 104px); }
.band-alt { background: var(--paper-2); }
.band-navy { background: var(--navy); color: var(--on-navy); }
.band-navy .eyebrow { color: var(--amber); }
.band-navy .muted, .band-navy .lede { color: var(--on-navy-muted); }
.band-navy a { color: var(--on-navy); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-lg { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.stack-lg > * { min-width: 0; }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  border-radius: 3px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent;
  font-family: var(--body); cursor: pointer;
}
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: #FFB233; color: var(--ink); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { color: inherit; background: rgba(127,127,127,.12); }
.btn-navy { background: var(--navy); color: var(--on-navy); }
.btn-navy:hover { background: var(--navy-2); color: var(--on-navy); }

/* ---------- Hero ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.page-hero .wrap { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Single-line diagram: disciplines on a bus feeding one project */
.sld { font-family: var(--mono); font-size: 14px; color: var(--on-navy); min-width: 0; }
.sld-caption { color: var(--on-navy-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.sld ul { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; display: flex; flex-direction: column; gap: 10px; }
.sld ul::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; background: var(--amber); }
.sld li { position: relative; padding: 9px 14px; border: 1px solid #3A4C6E; border-radius: 3px; background: var(--navy-2); }
.sld li::before { content: ""; position: absolute; left: -21px; top: 50%; width: 20px; height: 2px; background: var(--amber); }
.sld li::after { content: ""; position: absolute; left: -24px; top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.sld-out {
  margin: 14px 0 0 0; padding: 14px 16px; border-radius: 3px; background: var(--amber); color: var(--ink);
  font-weight: 500; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.band-paper .sld, .sld.on-paper { color: var(--ink); }
.sld.on-paper li { background: #FFFFFF; border-color: var(--line); }
.sld.on-paper .sld-caption { color: var(--muted); }

/* ---------- Grids & items ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 20px; }

.route {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 22px;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink);
  min-width: 0;
}
.route:hover { border-color: var(--navy); color: var(--ink); }
.route .who { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-text); }
.route h3 { font-size: 21px; }
.route p { color: var(--muted); font-size: 15.5px; }
.route .go { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 15px; color: var(--navy); }

.cap { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 2px solid var(--ink); min-width: 0; }
.cap ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--graphite); font-size: 15.5px; }
.cap ul li::marker { color: var(--amber-text); }

.ticklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticklist li { padding-left: 26px; position: relative; }
.ticklist li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 12px; height: 2px; background: var(--amber); }
.ticklist.no li::before { background: var(--muted); }

.boundary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 4px; background: #FFFFFF; }
.boundary > div { padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.boundary > div + div { border-left: 1px solid var(--line); }
@media (max-width: 820px) { .boundary > div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Tables ---------- */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: #FFFFFF; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
thead th { background: var(--navy); color: var(--on-navy); font-weight: 500; font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; color: var(--ink); }
td { color: var(--graphite); }
.tag { font-family: var(--mono); font-size: 12.5px; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.tag-buyer { background: #F6E7CF; color: #6E4100; }
.tag-seller { background: #DCEBE1; color: #1F5A39; }
.tag-both { background: var(--paper-2); color: var(--graphite); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; padding: 22px 22px 26px 0; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--amber-text); }
.steps p { color: var(--muted); font-size: 15.5px; }

/* ---------- Reference ---------- */
.ref { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.ref img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: 0% center; border-radius: 4px; }
@media (max-width: 860px) { .ref img { aspect-ratio: 4 / 3; } }
@media (max-width: 860px) { .ref { grid-template-columns: minmax(0, 1fr); } }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; margin: 0; font-size: 15.5px; border-top: 1px solid var(--line); }
.facts dt, .facts dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-right: 24px; padding-top: 13px; }
.facts dd { color: var(--ink); }

.figure-wide img { width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 4px; }
.figure-wide figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px; }
.cta h2 { max-width: 20ch; }

/* ---------- Form ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; padding: clamp(20px, 3vw, 32px); }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; font-weight: 500; min-width: 0; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; font-size: 16px; padding: 12px; color: var(--ink);
  background: var(--paper); border: 1px solid #BDB6A6; border-radius: 3px; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 14px; color: var(--muted); }
.form-status { grid-column: 1 / -1; padding: 12px 14px; border-radius: 3px; background: #DCEBE1; color: #1F5A39; font-size: 15px; }

.contact-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; margin: 0; }
.contact-list dt, .contact-list dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-right: 20px; padding-top: 14px; }
.contact-list dd { font-size: 17px; user-select: all; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--on-navy-muted); font-size: 14.5px; }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 32px; padding-block: 56px 32px; }
.site-footer img { height: 56px; width: auto; max-width: none; align-self: flex-start; object-fit: contain; }
.site-footer h4 { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); font-weight: 500; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { color: var(--amber); }
.legal { border-top: 1px solid #2E4062; }
.legal .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 18px 28px; font-family: var(--mono); font-size: 12.5px; }

.draft-flag { background: var(--amber); color: var(--ink); font-family: var(--mono); font-size: 12.5px; text-align: center; padding: 6px 12px; }

@media (prefers-reduced-motion: no-preference) {
  .sld li { animation: node-in .5s ease both; }
  .sld li:nth-child(2) { animation-delay: .06s; } .sld li:nth-child(3) { animation-delay: .12s; }
  .sld li:nth-child(4) { animation-delay: .18s; } .sld li:nth-child(5) { animation-delay: .24s; }
  .sld li:nth-child(6) { animation-delay: .30s; }
  @keyframes node-in { from { transform: translateX(-6px); } to { transform: none; } }
}

/* ---------- Collaborators ---------- */
.collab { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.collab li { display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FFFFFF; font-family: var(--display); font-stretch: 87.5%; font-weight: 600; font-size: 22px; color: var(--graphite); text-align: center; }

/* ---------- Legal pages & form consent ---------- */
.legal-text { max-width: 72ch; display: flex; flex-direction: column; gap: 14px; }
.legal-text h2 { font-size: 24px; margin-top: 18px; }
.legal-text .facts { margin: 6px 0; }
.field-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.field-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--navy); }
.form-status.is-error { background: #F6E7CF; color: #6E4100; }

/* ---------- Video ---------- */
.video-frame { margin: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.video-frame video { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; border-radius: 4px; background: var(--navy); }
.video-frame figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.define h3 + .ticklist { margin-top: 16px; }
/* China bridge (home) */
.bridge .grid-2 { align-items: center; }
.bridge-steps { display: flex; flex-direction: column; gap: 12px; }
.bridge-steps .cap { position: relative; background: var(--paper); border-left: 3px solid var(--amber); padding: 16px 20px; }
.bridge-steps .cap:nth-child(2) { border-left-color: var(--green, #2E9E5B); margin-left: 24px; }
.bridge-steps .cap:nth-child(3) { border-left-color: var(--navy); margin-left: 48px; }
.bridge-steps .cap .eyebrow { margin: 0 0 4px; }
.bridge-steps .cap h3 { margin: 0 0 4px; }
@media (max-width: 700px) { .bridge-steps .cap:nth-child(n) { margin-left: 0; } }
.bridge-steps .cap { border-top: 0; gap: 0; padding-top: 16px; }
/* News */
.news-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.news-filter button { font: 500 14px/1 var(--body); padding: 9px 14px; border: 1px solid var(--line); background: var(--paper); color: var(--graphite); border-radius: 3px; cursor: pointer; }
.news-filter button.is-on { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.news-item { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--paper-2); border-top: 3px solid var(--navy); min-width: 0; }
.news-item[hidden] { display: none; }
.news-item h3 { margin: 0; font-size: 21px; line-height: 1.2; }
.news-item p { margin: 0; }
.news-meta { display: flex; gap: 12px; align-items: center; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.news-tag { padding: 3px 8px; border-radius: 2px; color: #fff; background: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.news-tag-st { background: var(--amber); color: var(--ink); }
.news-item:has(.news-tag-st) { border-top-color: var(--amber); }
.news-take { font-size: 15px; color: var(--graphite); border-left: 2px solid var(--green); padding-left: 12px; }
.news-src { font-size: 13.5px; color: var(--muted); margin-top: auto !important; }
.news-note { font-size: 13px; color: var(--muted); }

/* ---------- Analysis page ---------- */
.band-tight { padding-top: clamp(32px, 4vw, 48px); padding-bottom: clamp(32px, 4vw, 48px); }
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-top: 2px solid var(--ink); }
.a-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.a-stat b { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; color: var(--navy); }
.a-stat span { color: var(--muted); font-size: 15px; }
.a-src { font-size: 13.5px; color: var(--muted); max-width: 820px; }
.a-top { align-items: start; }
.a-chart { margin: 0; background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; padding: 18px; min-width: 0; }
.a-chart figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.a-take { border-left: 3px solid var(--amber); padding-left: 16px; color: var(--graphite); }
table.a-table { table-layout: fixed; min-width: 0; }
table.a-wide { min-width: 680px; }
.fibre-band { padding-top: 0; }
.figure-wide img[src*="data-centre-hall"], .figure-wide img[src*="fibre-optic"] { aspect-ratio: 16 / 6; }
.cool-fig img { width: 100%; height: auto; border-radius: 4px; display: block; background: #0F1B2E; }
