/* REDtone Group — accessible static site
   Every text/background pair below is at least 7:1 (WCAG 1.4.6 AAA).
   UI borders are at least 3:1 (WCAG 1.4.11). */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}

:root {
  --ink: #15171c;        /* body text: 17.9:1 on white */
  --muted: #4a4f5a;      /* secondary text: 7.4:1 on surface */
  --red: #a50d1c;        /* links, buttons: 7.85:1 on white */
  --red-deep: #7a0913;   /* hero band: white text 11.2:1 */
  --red-tint: #f7c6c0;   /* text on deep red: 7.3:1 */
  --surface: #f3f4f6;
  --paper: #ffffff;
  --line: #4a4f5a;       /* form borders: 7:1+ */
  --focus: #15171c;
  --on-accent: #ffffff;  /* text on --red buttons */
  --footer-bg: #15171c;
  --footer-fg: #ffffff;
  --band-fg: #ffffff;

  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;

  --measure: 68ch;
  --wrap: 74rem;
  --gap: clamp(1.25rem, 3vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
}

img, svg { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 82%;
  line-height: 1.1;
  margin: 0 0 0.6em;
  color: var(--ink);
}
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); font-weight: 760; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.35rem; font-weight: 680; font-stretch: 90%; margin-top: 1.4em; }

p, ul, ol, dl { margin: 0 0 1.1em; max-width: var(--measure); }
h1, h2, h3, p, li, a, legend, label { overflow-wrap: break-word; }
h1, h2, h3 { hyphens: auto; }
li + li { margin-top: 0.35em; }

.lede { font-size: 1.3rem; line-height: 1.55; max-width: 58ch; }
.muted { color: var(--muted); }

/* Links are always underlined so colour is never the only cue (1.4.1) */
a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 3px; }

/* ---------- Focus (2.4.7, 2.4.11, 2.4.13) ---------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.band :focus-visible { outline-color: var(--band-fg); }

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 0.75rem 1rem;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; outline-color: var(--red); }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gap);
}

main { display: block; padding-bottom: 4rem; }
main:focus { outline: none; }

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1rem; }

.page-head + h2 { margin-top: 0.5em; }

.section { padding: 1rem 0; }
.section--surface {
  background: var(--surface);
  padding: 2.5rem 0 1.5rem;
  margin: 2.5rem 0;
}
.section--surface h2 { margin-top: 0; }

/* ---------- Header & navigation (identical on every page: 3.2.3, 3.2.4, 3.2.6) ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-stretch: 78%;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark .wm-red { color: var(--red); }
.wordmark .wm-group { font-weight: 500; font-stretch: 100%; font-size: 0.6em; margin-left: 0.35em; color: var(--muted); }
.wordmark:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  min-height: 44px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  max-width: none;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.1rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); color: var(--red); }

/* Menu button only used on small screens and only when JavaScript is running */
@media (max-width: 52rem) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { width: 100%; }
  .js .site-nav[data-open="false"] { display: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--surface); }
  .site-nav a[aria-current="page"] { border-bottom: 3px solid var(--red); }
}

/* ---------- Hero band (home) ---------- */

.band {
  background: var(--red-deep);
  color: var(--band-fg);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.band h1 {
  color: var(--band-fg);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-stretch: 72%;
  font-weight: 780;
  line-height: 1;
  max-width: 16ch;
  margin-bottom: 0.5em;
}
.band p { color: var(--band-fg); }
.band a { color: var(--band-fg); }

/* The "route" line: the countries we work in, joined like points on a network */
.route { margin-top: 2.5rem; }
.route h2 {
  color: var(--red-tint);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
.route ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  row-gap: 1rem;
}
.route li {
  margin: 0;
  position: relative;
  padding: 1.1rem 2.25rem 0 0;
  font-family: var(--font-display);
  font-stretch: 85%;
  font-weight: 650;
  font-size: 1.25rem;
  border-top: 2px solid var(--red-tint);
}
.route li::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--band-fg);
}
.route li:last-child { padding-right: 0; border-top-color: transparent; }
.route li:last-child::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.25rem;
  border-top: 2px solid var(--red-tint);
}

/* ---------- Content blocks ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 0 var(--gap);
}

.service-list {
  list-style: none;
  padding: 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.5rem var(--gap);
}
.service-list li { margin: 0; border-left: 4px solid var(--red); padding: 0.1rem 0 0.1rem 1rem; }
.service-list h3 { margin: 0 0 0.3em; }
.service-list p { margin: 0; }

.company {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
}
.company h2 { margin-top: 0; }
.company .facts { font-weight: 700; color: var(--muted); }

.toc { columns: 2 14rem; max-width: 40rem; }

.leader { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 2.5rem; }
.leader h2 { margin: 0 0 0.2em; }
.leader .role { font-weight: 700; color: var(--muted); margin-bottom: 1rem; }

.news-list { list-style: none; padding: 0; max-width: var(--measure); }
.news-list li { margin: 0; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.news-list h2, .news-list h3 { font-size: 1.35rem; font-stretch: 90%; margin: 0 0 0.35em; }
.news-list time { display: block; color: var(--muted); font-size: 1rem; margin-bottom: 0.4rem; }
.news-list p { margin: 0; }

.article-meta { color: var(--muted); }
.summary {
  background: var(--surface);
  border-left: 4px solid var(--red);
  padding: 1rem 1.25rem;
  max-width: var(--measure);
}
.summary h2 { font-size: 1.15rem; margin: 0 0 0.4em; font-family: var(--font-body); }
.summary p:last-child { margin-bottom: 0; }

.post-nav { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ---------- Contact details ---------- */

.contact-list { list-style: none; padding: 0; }
.contact-list li { margin: 0 0 1rem; }
.contact-list strong { display: block; }

/* ---------- Forms (1.3.1, 1.3.5, 3.3.1, 3.3.2, 3.3.3, 3.3.5) ---------- */

.form { max-width: 38rem; }
.field { margin: 0 0 1.5rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.field .hint { display: block; color: var(--muted); font-size: 1rem; margin-bottom: 0.4rem; }
.req { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  min-height: 48px;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.field [aria-invalid="true"] { border-color: var(--red); border-width: 3px; }
.error-text { display: block; color: var(--red); font-weight: 700; margin-top: 0.35rem; }
.error-text[hidden] { display: none; }
.error-text::before { content: "Error: "; }

.error-summary {
  border: 3px solid var(--red);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  max-width: 38rem;
}
.error-summary h2 { font-size: 1.3rem; margin: 0 0 0.5rem; color: var(--red); }
.error-summary ul { margin: 0; }

.notice {
  border: 3px solid var(--ink);
  padding: 1rem 1.25rem;
  max-width: 38rem;
}
.notice h2 { margin-top: 0; font-size: 1.4rem; }

/* Spam trap: kept off-screen, hidden from assistive technology */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  background: var(--red);
  color: var(--on-accent);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 0.7rem 1.5rem;
  min-height: 48px;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: var(--red-deep); border-color: var(--red-deep); text-decoration: underline; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 3rem 0 2rem;
}
.site-footer a { color: var(--footer-fg); }
.site-footer :focus-visible { outline-color: var(--footer-fg); }
.site-footer h2 { color: var(--footer-fg); font-size: 1.25rem; margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem var(--gap);
}
.site-footer .legal { max-width: none; border-top: 1px solid var(--footer-fg); margin-top: 2rem; padding-top: 1rem; font-size: 1rem; }

/* ---------- Display options panel ---------- */

.display-toggle {
  font: inherit;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
}
.display-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.display-toggle[hidden] { display: none; }

.display-panel .wrap { display: block; }
.display-panel { background: var(--surface); border-top: 1px solid var(--line); padding: 1.25rem 0 0.5rem; }
.display-panel[hidden] { display: none; }
.display-title { font-size: 1.35rem; margin: 0 0 0.25rem; }
.display-note { color: var(--muted); font-size: 1rem; }
.display-groups { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.display-panel fieldset { border: 2px solid var(--line); border-radius: 4px; padding: 0.5rem 1rem 0.75rem; margin: 0; min-width: min(100%, 14rem); }
.display-panel legend { font-weight: 700; padding: 0 0.35rem; }
.display-panel fieldset label { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
.display-panel input[type="radio"] { width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--red); }
.display-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; max-width: none; }
.button--plain { background: var(--paper); color: var(--ink); border-color: var(--line); }
.button--plain:hover { background: var(--paper); border-color: var(--ink); }

/* Text size choices */
html[data-textsize="large"] { font-size: 125%; }
html[data-textsize="xlarge"] { font-size: 150%; }

/* High contrast: yellow and white on black, every pair well above 7:1 */
html[data-contrast="high"] {
  --ink: #ffffff;
  --muted: #ffffff;
  --paper: #000000;
  --surface: #000000;
  --red: #ffff00;
  --red-deep: #000000;
  --red-tint: #ffff00;
  --line: #ffffff;
  --focus: #ffff00;
  --on-accent: #000000;
  --footer-bg: #000000;
  --footer-fg: #ffffff;
  --band-fg: #ffffff;
}
html[data-contrast="high"] body { background: #000000; }
html[data-contrast="high"] .band,
html[data-contrast="high"] .section--surface,
html[data-contrast="high"] .site-footer,
html[data-contrast="high"] .display-panel { border-top: 2px solid #ffffff; border-bottom: 2px solid #ffffff; }
html[data-contrast="high"] .button:hover { background: #ffffff; border-color: #ffffff; color: #000000; }
html[data-contrast="high"] .site-nav a:hover { border-bottom-color: #ffff00; }

/* ---------- User preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .route li::before { forced-color-adjust: none; background: CanvasText; }
  .button { border-color: ButtonText; }
}

@media print {
  .site-header nav, .nav-toggle, .skip-link, .site-footer { display: none; }
  a { color: #000000; }
}
