/* ---------- Header ---------- */
/* The supplied logo PNG has a white background, so the header is a true white
   surface. This shows the approved logo unaltered (no blend modes). */
.site-header {
  background: var(--colour-surface);
  border-bottom: 1px solid var(--colour-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.site-header__logo img {
  height: 2.5rem;
  width: auto;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.25rem, 2vw, 1.5rem);
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--colour-ink-soft);
  transition: color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--colour-ink);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.5em;
}

.site-header__logo {
  flex: none;
}

.site-nav a {
  white-space: nowrap;
}

/* Phones: the logo keeps its size on its own row; the nav spans the row below. */
@media (max-width: 767px) {
  /* Two rows; the hero's first-screen height subtracts this. */
  :root {
    --header-height: 6.5rem;
  }

  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    padding-block: 0.75rem 0.25rem;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    justify-content: space-between;
    gap: 0;
    margin-inline: -0.375rem;
  }

  .site-nav a {
    padding-inline: 0.375rem;
    letter-spacing: 0.06em;
  }

  /* The logo already links home, so Home makes room for the other links. */
  .site-nav__home {
    display: none;
  }
}

/* The smallest phones: tighten the four links so they still fit one row. */
@media (max-width: 359px) {
  .site-nav a {
    padding-inline: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
}

/* ---------- Motion baseline (only when JS is present) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.js.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.js.is-ready .draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 850ms var(--ease);
  transition-delay: calc(300ms + var(--d, 0) * 1ms);
}

.js .settle {
  opacity: 0;
  transform: translate(var(--dx, 0), var(--dy, 0));
}

.js.is-ready .settle {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(600ms + var(--d, 0) * 1ms);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .settle {
    opacity: 1;
    transform: none;
  }

  .js .draw {
    stroke-dashoffset: 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(34rem, calc(100svh - var(--header-height)));
  display: flex;
}

.hero__inner {
  position: relative;
  flex: 1;
  align-items: stretch;
  row-gap: var(--space-content);
}

.hero__copy {
  grid-column: 1 / -1;
  align-self: center;
  padding-block: var(--space-content) 0;
}

.hero__eyebrow {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--colour-ink-soft);
}

.hero__eyebrow span:first-child {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--colour-ink);
}

.hero__eyebrow span:first-child::before {
  content: "";
  width: 1.5rem;
  height: 1.5px;
  background: var(--colour-brand);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__lead {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--colour-ink-soft);
  font-size: 1.125rem;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.hero__visual {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.hero__visual svg {
  width: 100%;
  max-width: 22rem;
  height: auto;
  overflow: visible;
  flex: none;
}

.hero__tail {
  flex: 1;
  min-height: var(--space-content);
  border-left: 1.5px solid var(--colour-brand);
}

.hero__cue {
  display: none;
}

/* System visual */
.sv-main {
  stroke: var(--colour-brand);
  stroke-width: 1.5;
  fill: none;
}

.sv-line {
  stroke: var(--colour-ink-soft);
  stroke-width: 1;
  fill: none;
}

/* The parts of the organisation */
.sv-box rect {
  fill: var(--colour-stone);
  stroke: var(--colour-line);
  stroke-width: 1;
}

.sv-box text {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: var(--colour-ink);
}

.sv-box--core rect {
  fill: var(--colour-brand);
  stroke: var(--colour-brand);
}

.sv-box--core text {
  fill: var(--colour-canvas);
}

/* Signals: hidden until the loop runs */
.sv-pulse {
  fill: none;
  stroke: var(--colour-brand);
  stroke-width: 2.5;
  stroke-linecap: butt;
  stroke-dasharray: 0.25 2;
  stroke-dashoffset: 0.25;
}

/* The loop: once the map has settled, a signal runs down each link in turn
   (0.7s apart) and each part lights as its signal arrives; every 6s. */
@media (prefers-reduced-motion: no-preference) {
  .js.is-ready .sv-pulse {
    animation: sv-signal 6s linear infinite;
    animation-delay: calc(2s + var(--p) * 0.7s);
  }

  .js.is-ready .sv-box rect {
    animation: sv-light 6s var(--ease) infinite;
    animation-delay: calc(2s + var(--p) * 0.7s);
  }

  .js.is-ready .sv-box--core rect {
    animation-name: sv-light-core;
  }
}

@keyframes sv-signal {
  0% {
    stroke-dashoffset: 0.25;
  }
  12%,
  100% {
    stroke-dashoffset: -1;
  }
}

@keyframes sv-light {
  0%,
  22% {
    fill: var(--colour-surface);
    stroke: var(--colour-brand);
  }
  40%,
  100% {
    fill: var(--colour-stone);
    stroke: var(--colour-line);
  }
}

@keyframes sv-light-core {
  0%,
  22% {
    stroke: var(--colour-brass);
    stroke-width: 3;
  }
  40%,
  100% {
    stroke: var(--colour-brand);
    stroke-width: 1;
  }
}

.sv-node {
  fill: var(--colour-brand);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
  }

  .hero__actions {
    flex-direction: row;
  }

  .hero__visual svg {
    max-width: 26rem;
  }
}

@media (min-width: 1024px) {
  .hero__copy {
    grid-column: 1 / span 7;
    padding-block: var(--space-content);
  }

  .hero__visual {
    grid-column: 8 / -1;
  }

  /* Keep the visual from setting the hero height on shorter desktop screens. */
  .hero__visual svg {
    max-width: none;
    max-height: max(20rem, calc(100svh - var(--header-height) - 7rem));
  }

  .hero__cue {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
    left: var(--gutter);
    bottom: var(--space-content);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--colour-ink-soft);
    transition: opacity 0.4s var(--ease);
  }

  .hero__cue::after {
    content: "";
    width: 2.5rem;
    height: 1px;
    background: var(--colour-ink-soft);
  }

  .hero__cue.is-hidden {
    opacity: 0;
  }
}

/* ---------- Problems ---------- */
/* A brand-blue band: deep navy fading into Bigeen blue, with a soft light
   behind the headline. The guide line and markers switch to brass, as on the
   other dark bands, so they stay visible. */
.problems {
  background:
    radial-gradient(ellipse 60% 55% at 18% 22%, rgba(247, 245, 240, 0.09), transparent 70%),
    linear-gradient(135deg, #0a1236 0%, #101f5c 45%, var(--colour-brand) 100%);
  background-color: var(--colour-brand);
  color: var(--colour-on-ink);
  padding-block: var(--space-section);
  /* The ticker runs edge to edge */
  overflow-x: clip;
}

.problems__inner {
  position: relative;
}

.problems__head {
  position: relative;
  row-gap: var(--space-content);
}

/* Structural guide: continues the hero line, then joins the list's top rule. */
.problems__head::before {
  content: "";
  position: absolute;
  left: var(--gutter-left, 0);
  top: calc(-1 * var(--space-section));
  bottom: calc(-1 * var(--space-content));
  width: 1.5px;
  background: var(--colour-brass);
  transform-origin: top;
}

.js .problems__head::before {
  transform: scaleY(0);
}

.js .problems__head.is-connected::before {
  transform: scaleY(1);
  transition: transform 0.9s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .js .problems__head::before {
    transform: none;
  }
}

.problems__title-block,
.problems__aside {
  grid-column: 1 / -1;
  padding-left: 1.25rem;
}

.problems h2 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 6.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.problems h2 span {
  display: block;
}

.problems h2 span + span {
  color: var(--colour-on-ink-soft);
}

.problems__aside p {
  color: var(--colour-on-ink-soft);
  max-width: 34rem;
}

.problems__aside .problems__emphasis {
  margin-top: 1rem;
  color: var(--colour-on-ink);
  font-weight: 600;
}

/* Six parallel symptoms, not a sequence — a small anchor square (the site's
   own index device), not a numeral that would imply order or causality. */
.problems__list {
  list-style: none;
  margin-top: var(--space-content);
  border-bottom: 1px solid var(--colour-line-on-ink);
}

.problems__list li {
  position: relative;
  padding: 1.25rem 0 1.25rem 1.75rem;
  border-top: 1px solid var(--colour-line-on-ink);
  font-size: 1.125rem;
  line-height: 1.45;
}

.problems__list li:first-child {
  border-top-color: var(--colour-on-ink-soft);
}

.problems__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.7rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--colour-brass);
}

/* Ticker: the symptoms run in one slow, endless line across the band.
   main.js adds .is-ticking (never under reduced motion) and a hidden copy of
   the items, so moving the track by half its width loops seamlessly. Hover,
   keyboard focus or the pause button stop it. */
.ticker {
  margin-top: var(--space-content);
}

.ticker .problems__list {
  margin-top: 0;
}

.ticker.is-ticking {
  /* Full-bleed, with the ends fading into the band */
  margin-inline: calc(50% - 50vw);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker.is-ticking .problems__list {
  display: flex;
  width: max-content;
  border-block: 1px solid var(--colour-line-on-ink);
  animation: ticker var(--ticker-duration, 40s) linear infinite;
}

.ticker.is-ticking:hover .problems__list,
.ticker.is-ticking:focus-within .problems__list,
.ticker.is-paused .problems__list {
  animation-play-state: paused;
}

.ticker.is-ticking .problems__list li {
  flex: none;
  padding: 1.5rem 3rem 1.5rem 1.75rem;
  border-top: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 600;
}

.ticker.is-ticking .problems__list li::before {
  top: 50%;
  margin-top: -0.25rem;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

.ticker__pause {
  display: block;
  margin: 1rem 0 0 auto;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--colour-on-ink-soft);
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.ticker__pause[hidden] {
  display: none;
}

.ticker__pause:hover {
  color: var(--colour-on-ink);
}

.ticker__pause:focus-visible {
  outline: 2px solid var(--colour-on-ink);
  outline-offset: 3px;
}

.problems__bridge {
  margin-top: calc(var(--space-section) * 0.7);
}

.problems__bridge-next {
  grid-column: 1 / -1;
  max-width: 34rem;
  margin-top: var(--space-content);
  color: var(--colour-on-ink-soft);
  font-size: 1.125rem;
}

@media (min-width: 768px) {
  .problems__title-block {
    grid-column: 1 / span 7;
    padding-left: 0;
  }

  .problems__aside {
    grid-column: 8 / -1;
    padding-left: var(--space-content);
    align-self: end;
  }

  .problems__head::before {
    left: calc((100% + var(--grid-gap)) * 7 / 12);
  }

}

@media (min-width: 900px) {
  .ticker:not(.is-ticking) .problems__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--grid-gap);
  }
}

/* ---------- Content pages (routing pages) ---------- */
.page {
  padding-block: var(--space-section);
}

.page__inner {
  row-gap: var(--space-content);
}

.page__body {
  grid-column: 1 / -1;
}

.page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.page__lead {
  max-width: 36rem;
  margin-top: 1.5rem;
  color: var(--colour-ink-soft);
  font-size: 1.125rem;
}

.page__routes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--space-content);
}

@media (min-width: 768px) {
  .page__body {
    grid-column: 1 / span 9;
  }

  .page__routes {
    flex-direction: row;
  }
}

/* ---------- Footer (shared markup: partials/footer.html) ---------- */
.site-footer {
  background: var(--colour-surface);
  border-top: 1px solid var(--colour-line);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}

.footer__grid {
  display: grid;
  gap: 2.5rem;
}

.footer__logo {
  display: inline-block;
  padding-block: 0.25rem;
}

.footer__logo img {
  height: 2.5rem;
  width: auto;
}

.footer__tagline {
  max-width: 18rem;
  margin-top: 1.25rem;
  color: var(--colour-ink-soft);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}

.footer__title {
  margin-bottom: 0.5rem;
  white-space: nowrap;
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--colour-ink-soft);
}

.footer__group ul {
  list-style: none;
}

/* Phones: two columns, with the last group given the full row so its title never wraps. */
.footer__group:last-child {
  grid-column: 1 / -1;
}

.footer__group a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  color: var(--colour-ink);
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.footer__group a:hover {
  color: var(--colour-brand);
  text-decoration: underline;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--colour-line);
  font-size: 0.875rem;
  color: var(--colour-ink-soft);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  list-style: none;
}

.footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--colour-ink-soft);
  text-decoration: none;
}

.footer__legal a:hover {
  color: var(--colour-brand);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .footer__nav {
    grid-template-columns: repeat(4, max-content);
    justify-content: space-between;
  }

  .footer__group:last-child {
    grid-column: auto;
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--space-content);
    align-items: start;
  }
}
