/* ---------- Fonts (self-hosted, variable) ---------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  /* Colors */
  --accent: #006F97;
  --accent-hover: #00506D;
  --ink: #111214;
  --text-2: #3D4047;
  --muted: #5A5E66;
  --border: #E4E5E7;
  --border-strong: #C9CBD0;
  --dash: #9A9EA6;
  --band: #F3F4F6;
  --bg: #FFFFFF;
  --on-dark: #FFFFFF;
  --on-dark-2: #C4C7CD;
  --on-dark-3: #A3A7AF;
  --on-dark-ascii: #6B707A;
  --dark-border: #2A2C31;

  /* Fonts */
  --font-sans: Inter, system-ui, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --container: 1200px;
  --gutter: 32px;
  --section-y: 96px;
  --rule: 1px solid var(--border);
  --rule-strong: 1px solid var(--ink);

  /* ASCII fields */
  --ascii-size: 10px;
  --ascii-line: 12px;
}

/* ---------- Base ---------- */

/* Animated scrolling for in-page links, unless the visitor prefers reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
}

/* :where() keeps these at class-level specificity so component link colors win, as with the original inline styles. */
:where(a) { color: var(--accent); }
:where(a):hover { color: var(--accent-hover); }

h1, h2, h3, p, ol { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.contact :focus-visible,
.site-footer :focus-visible { outline-color: var(--on-dark); }
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--on-dark); }

/* Centred column, max 1200px wide. Uses padding rather than auto margins so it also stretches as a flex item. */
.container {
  padding-left: max(var(--gutter), calc((100% - var(--container)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--container)) / 2));
}

main { flex: 1 0 auto; }

.accent { color: var(--accent); }

.redacted {
  display: inline-block;
  height: 1em;
  vertical-align: -0.15em;
  background: var(--ink);
}
.redacted--4-5 { width: 4.5em; }
.redacted--6 { width: 6em; }
.redacted--7 { width: 7em; }
.redacted--9 { width: 9em; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
}
.btn--primary { min-height: 52px; padding: 0 28px; background: var(--accent); color: var(--bg); }
.btn--secondary { min-height: 52px; padding: 0 28px; border: 1px solid var(--border-strong); color: var(--ink); }
.btn--outline { min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); color: var(--ink); }
.btn--light { min-height: 56px; padding: 0 32px; background: var(--on-dark); color: var(--ink); }

/* ---------- Header ---------- */

.site-header { border-bottom: var(--rule); }
.site-header__inner {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
.site-header__logo { display: inline-flex; align-items: center; min-height: 44px; }
.site-header__logo img { height: 28px; width: auto; display: block; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.main-nav__link { color: var(--text-2); text-decoration: none; }
.main-nav { margin-left: auto; }
.site-header__cta {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Phones: logo and button share the top row, section links sit on their own row below. */
@media (max-width: 640px) {
  .site-header__inner { padding-top: 16px; padding-bottom: 12px; row-gap: 4px; }
  .main-nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 0 22px; }
  .main-nav__link { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- Hero ---------- */

.hero { padding-top: 104px; padding-bottom: var(--section-y); }

.file-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-bottom: 20px;
  margin-bottom: 72px;
  border-bottom: var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__title {
  max-width: 1040px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero__lede {
  margin-top: 40px;
  max-width: 680px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-2);
}

.hero__programmes {
  margin-top: 28px;
  max-width: 680px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 2;
  color: var(--muted);
}

.hero__actions { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 12px; }

.wave {
  margin-top: 88px;
  position: relative;
  border-top: var(--rule-strong);
  border-bottom: var(--rule);
  padding: 20px 0;
  overflow: hidden;
}

.ascii {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--ascii-size);
  line-height: var(--ascii-line);
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}
.ascii--wave { color: var(--ink); min-height: calc(22 * var(--ascii-line)); }
.ascii--pulse { color: var(--on-dark-ascii); min-height: calc(12 * var(--ascii-line)); }

/* ---------- Sections ---------- */

.section--ruled { border-top: var(--rule); }
.section__inner { padding-top: var(--section-y); padding-bottom: var(--section-y); }

.eyebrow {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.section-title {
  max-width: 820px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.section-title--narrow { max-width: 729px; }

.grid {
  margin-top: 56px;
  display: grid;
  gap: 40px 48px;
}
.grid--300 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid--260 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

.card { border-top: var(--rule-strong); padding-top: 20px; }
.card__text { font-size: 16px; color: var(--muted); }

/* What we do */
.card--work { padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.card__code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.card__title-display {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Principles */
.card__title { margin-bottom: 8px; font-size: 19px; font-weight: 600; }

/* Team */
.stat {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stat + .card__text { margin-top: 4px; }

/* ---------- Flow band ---------- */

.flow { background: var(--band); }
.flow__inner {
  padding-top: 56px;
  padding-bottom: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.flow__line {
  flex: 1 1 40px;
  min-width: 40px;
  position: relative;
  border-top: 1px dashed var(--dash);
}
.flow__end { color: var(--accent); font-weight: 500; }

.pulse {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: flow 2.4s linear infinite;
}
.pulse--2 { animation-delay: 0.8s; }
.pulse--3 { animation-delay: 1.6s; }

/* Phones: the pipeline reads top to bottom, with the dots travelling down. */
@media (max-width: 640px) {
  .flow__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .flow__line {
    flex: none;
    min-width: 0;
    width: 0;
    height: 28px;
    margin-left: 3px;
    border-top: 0;
    border-left: 1px dashed var(--dash);
  }
  .pulse { top: 0; left: -3.5px; animation-name: flow-y; }
}

/* ---------- Engagement ---------- */

.engagement {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 48px 80px;
}

.steps { padding: 0; list-style: none; border-top: var(--rule-strong); }
.steps__item {
  padding: 24px 0;
  border-bottom: var(--rule);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
}
.steps__num { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }
.steps__item strong { font-weight: 600; }
.steps__desc { color: var(--muted); }

/* ---------- Trust ---------- */

.trust {
  padding-top: 64px;
  padding-bottom: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 48px;
}
.trust__note { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

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

.contact { background: var(--ink); color: var(--on-dark); }
.contact__field { padding-top: 72px; overflow: hidden; }
.contact__inner {
  padding-top: 64px;
  padding-bottom: 112px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.contact__text { max-width: 720px; }
.contact__eyebrow {
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.contact__sub { margin-top: 24px; font-size: 19px; color: var(--on-dark-2); }

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

.site-footer { background: var(--ink); color: var(--on-dark-3); border-top: 1px solid var(--dark-border); }
.site-footer__inner {
  padding-top: 32px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.legal-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.legal-nav a { color: var(--on-dark-3); }

/* ---------- Motion ---------- */

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.blink { animation: blink 1.1s steps(1) infinite; }

@keyframes flow { from { left: 0; } to { left: calc(100% - 6px); } }
@keyframes flow-y { from { top: 0; } to { top: calc(100% - 6px); } }

@media (prefers-reduced-motion: reduce) {
  .blink, .pulse { animation: none; }
}

/* ---------- Legal pages ---------- */

.legal { padding-top: 104px; padding-bottom: var(--section-y); }
.legal__intro { margin-top: 24px; max-width: 720px; font-size: 16px; color: var(--muted); }
.legal__body { margin-top: 56px; max-width: 720px; }
.legal__body h2 {
  margin: 56px 0 16px;
  padding-top: 20px;
  border-top: var(--rule-strong);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.legal__body h2:first-child { margin-top: 0; }
.legal__body h3 { margin: 28px 0 8px; font-size: 17px; font-weight: 600; }
.legal__body p,
.legal__body li { font-size: 16px; color: var(--muted); }
.legal__body p + p,
.legal__body p + ul,
.legal__body ul + p { margin-top: 12px; }
.legal__body ul { margin: 0; padding-left: 20px; }
.legal__body li + li { margin-top: 4px; }
.legal__body strong { color: var(--ink); font-weight: 600; }
.legal__body .funding-logo { display: block; height: 56px; width: auto; margin-bottom: 16px; }

.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px 24px; }
.facts dt {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 2.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: 0; font-size: 16px; }
@media (max-width: 560px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd + dt { margin-top: 12px; }
}

.legal__body .legal__updated { margin-top: 56px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
