/*
 * NIHR design system for the HealthTech Research Centre: In Vitro Diagnostics site.
 *
 * Built from the Figma file "HealthTech Bridge — Imperial Redesign" (NIHR pages)
 * and the NIHR brand guidelines. Used by templates/base.html (public pages) and
 * templates/Dashboard/base_nihr.html (signed-in pages). Pages still on the old
 * Inspinia theme use css/style.css instead; never load both on one page.
 *
 * Archia is licensed through NIHR comms for this site only: do not copy the
 * font files anywhere else. Inclusive Sans is under the SIL Open Font Licence
 * (fonts/inclusive-sans/OFL.txt).
 */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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;
}
/* ← and →, which Google's subsets leave out; cut from the full font (same licence). */
@font-face {
  font-family: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-arrows.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2190, U+2192;
}

/* ---------- Tokens ---------- */
:root {
  --navy: #1c285e;
  --navy-hover: #182250;
  --navy-active: #16204b;
  --navy-row-hover: #2a3570;
  --coral: #fc5d5d;
  --off-black: #3c3c3c;
  --placeholder: #5a5a5a;
  --putty: #faf4eb;
  --steel: #c5dce5;
  --steel-60: #dceaef;
  --lilac: #c4c5ff;
  --lilac-tint: #f3f3ff;
  --glove-blue: #c7e9ff;
  --pending: #8396b0;
  --sunshine: #ffe626;
  --focus-text: #003078;
  --navy-25: rgba(28, 40, 94, 0.25);
  --navy-35: rgba(28, 40, 94, 0.35);

  --font-display: "Archia", "Inclusive Sans", Arial, sans-serif;
  --font-text: "Inclusive Sans", Arial, sans-serif;

  --shadow-card: 0 3px 8px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 3px 4px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);

  --page-gutter: clamp(20px, 4.17vw, 60px);
  --content-max: 1320px;
  --section-y: 80px;
  --block-gap: 44px;
  --ease: 180ms ease;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #fff;
  color: var(--off-black);
  font: 400 16px/1.5 var(--font-text);
}
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
}
p,
ul,
ol,
figure {
  margin: 0;
}
img {
  max-width: 100%;
}
a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-position: from-font;
}
a:hover {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.25rem;
  text-underline-position: auto;
}
button,
input {
  font: inherit;
}
[hidden] {
  display: none !important;
}

/* Focus: taken from the live nihr.ac.uk theme (the brand PDFs define no states). */
:focus-visible {
  outline: 3px solid var(--sunshine);
  outline-offset: 0;
}
a:focus-visible {
  outline: 3px solid transparent;
  background-color: var(--sunshine);
  color: var(--focus-text);
  box-shadow: 0 0 0 4px var(--sunshine), 0 2px 0 4px var(--focus-text);
  text-decoration-color: var(--focus-text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus {
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 0;
  border-radius: 0;
  font: 700 15px/1 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}
.btn::after {
  content: "\2192";
  content: "\2192" / "";
  transition: transform var(--ease);
}
.btn:hover {
  text-decoration: none;
}
.btn:hover::after {
  transform: translateX(3px);
}
.btn--plain::after {
  content: none;
}
.btn--primary {
  background: var(--navy);
  color: #fff;
}
.btn--primary:hover {
  background: var(--navy-hover);
  color: #fff;
}
.btn--primary:active {
  background: var(--navy-active);
}
.btn--secondary {
  background: var(--lilac);
  color: var(--navy);
}
.btn--secondary:hover {
  background: var(--navy);
  color: #fff;
}
.btn--inverse {
  background: #fff;
  color: var(--navy);
}
.btn--inverse:hover {
  background: var(--glove-blue);
  color: var(--navy);
}
.btn--outline-light {
  padding: 8px 16px;
  border: 1.5px solid #fff;
  background: transparent;
  color: #fff;
}
.btn--outline-light::after {
  content: none;
}
.btn--outline-light:hover {
  background: #fff;
  color: var(--navy);
}
.btn--outline {
  padding: 9px 14px;
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
}
.btn--outline::after {
  content: none;
}
.btn--outline:hover {
  background: var(--navy);
  color: #fff;
}
.btn--app {
  min-height: 48px;
  padding: 0 20px;
  font-size: 16px;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn[disabled]:hover::after {
  transform: none;
}
.btn:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: inset 0 -2px 0 var(--focus-text);
}

/* A text link with the coral arrow in front ("Link" in Figma). */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.link:hover {
  text-decoration: none;
}
.link__arrow {
  color: var(--coral);
  transition: transform var(--ease);
}
.link__text {
  text-decoration: underline;
  text-underline-position: from-font;
}
.link:hover .link__text {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.25rem;
  text-underline-position: auto;
}
.link:hover .link__arrow {
  transform: translateX(3px);
}
.link:focus-visible {
  box-shadow: 0 0 0 6px var(--sunshine), 0 2px 0 6px var(--focus-text);
}
.link:focus-visible .link__text {
  text-decoration-color: var(--focus-text);
}

/* A button that looks like a plain underlined link (log out, read bio). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-position: from-font;
  cursor: pointer;
}
.link-button:hover {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.25rem;
  text-underline-position: auto;
}
.link-button:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: 0 0 0 4px var(--sunshine), 0 2px 0 4px var(--focus-text);
}

/* ---------- Shared pieces ---------- */
.keyline-heading {
  display: flex;
  gap: 16px;
}
.keyline-heading::before {
  content: "";
  flex: 0 0 4px;
  background: var(--coral);
}
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.4;
}
.chip--filled {
  background: var(--navy);
  color: #fff;
}
.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: #fff;
}
.search-pill img {
  flex: none;
}
.search-pill input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--off-black);
  font: 400 16px/1.5 var(--font-text);
}
.search-pill input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}
.search-pill:focus-within {
  border-color: var(--off-black);
  box-shadow: 0 0 0 3px var(--sunshine);
}

/* ---------- Public header (brand architecture p.26) ---------- */
.site-topbar {
  background: #fff;
}
.site-topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 26px;
}
.site-logo {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  line-height: 0;
}
.site-logo img {
  display: block;
  height: auto;
}
.site-topbar__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.menu-button {
  display: none;
  flex: none;
}
.site-descbar {
  background: var(--navy);
  color: #fff;
}
.site-descbar .wrap {
  padding-top: 16px;
}
.site-descriptor {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font: 700 16px/1.4 var(--font-display);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 54px;
}
.site-nav__link {
  position: relative;
  color: #fff;
  font: 700 17px/1 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__link::before {
  content: "";
  position: absolute;
  top: -14px;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.site-nav__link:hover {
  color: #fff;
  text-decoration: none;
}
.site-nav__link:hover::before,
.site-nav__link[aria-current="page"]::before {
  transform: scaleX(1);
}
/* The design puts a 10px spacer, with the usual 48px gap either side, before Log in. */
.site-nav__login {
  margin-left: 58px;
}
/* On small screens the top bar's "NIHR website" button moves into the menu. */
.site-nav__exit {
  display: none;
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-y);
}
.section > .wrap {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}
.section--putty {
  background: var(--putty);
}
.section--steel {
  background: var(--steel-60);
}
.section--graphic {
  position: relative;
  overflow: hidden;
}
.section--graphic > .wrap {
  position: relative;
  z-index: 1;
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-head__title {
  font: 600 32px/1.1 var(--font-display);
}
.section-head__standfirst {
  max-width: 720px;
  color: var(--off-black);
  font: 400 20px/1.4 var(--font-display);
}
.section-head__standfirst--navy {
  color: var(--navy);
}
.section-head__legend {
  font-size: 14px;
  line-height: normal;
}

/* Graphic: lilac band behind the "Published tools" heading. */
.band {
  position: absolute;
  top: 66px;
  right: 0;
  width: 63.9%;
  height: 129px;
  background: linear-gradient(to left, #c4c5ff 0%, rgba(196, 197, 255, 0.45) 60%, rgba(196, 197, 255, 0) 100%);
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--section-y);
  overflow: hidden;
  background: var(--steel-60);
}
.hero .wrap {
  display: flex;
  align-items: center;
  gap: 64px;
}
.hero__copy {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}
.hero__title {
  font: 600 48px/1.05 var(--font-display);
}
.hero__standfirst {
  max-width: 600px;
  color: var(--off-black);
  font: 400 20px/1.4 var(--font-display);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding-top: 8px;
}
.hero__actions .link {
  font-size: 15px;
}
.hero__media {
  position: relative;
  flex: 0 0 520px;
  height: 400px;
}
/* Graphic: coral arc behind the top right of the photo. */
.hero__arc {
  position: absolute;
  top: -17.75%;
  left: 32.31%;
  z-index: 0;
  width: 78.85%;
  height: auto;
  pointer-events: none;
}
.hero__photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* ---------- Tool finder ---------- */
.finder {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 40px 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}
.stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--off-black);
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}
.stepper__marker {
  display: flex;
  align-items: center;
  width: 100%;
}
.stepper__line {
  flex: 1 1 0;
  height: 2px;
  background: var(--steel);
}
.stepper__step:first-child .stepper__line:first-child,
.stepper__step:last-child .stepper__line:last-child {
  visibility: hidden;
}
.stepper__num {
  display: grid;
  flex: none;
  place-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--steel);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font: 700 14px/1 var(--font-text);
}
.stepper__step.is-current,
.stepper__step.is-done {
  color: var(--navy);
}
.stepper__step.is-current {
  font-weight: 700;
}
.stepper__step.is-current .stepper__num,
.stepper__step.is-done .stepper__num {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.stepper__step.is-done .stepper__line,
.stepper__step.is-current .stepper__line:last-child,
.stepper__step.is-done + .stepper__step .stepper__line:first-child,
.stepper__step.is-current + .stepper__step .stepper__line:first-child {
  background: var(--coral);
}
.finder__panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.finder__question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.finder__title {
  font: 700 22px/1.2 var(--font-display);
}
.finder__title:focus {
  outline: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.tiles--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 20px 22px;
  border: 1px solid var(--steel);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease);
}
.tile:hover {
  border-color: var(--navy);
}
.tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.tile__icon {
  display: block;
  flex: none;
}
.tile__label {
  color: var(--navy);
  font-weight: 700;
}
.tile:has(input:checked) {
  padding: 23px 19px 21px;
  border: 2px solid var(--navy);
  background: var(--lilac-tint);
}
.tile:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: url("../img/nihr/icon-check.svg") center / 22px 22px no-repeat;
}
.tile:has(input:focus-visible) {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--sunshine);
}
.finder__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.finder__summary {
  color: var(--off-black);
}
.results {
  display: flex;
  flex-direction: column;
}
.result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--navy);
}
.result:first-child {
  margin-top: 0;
}
.result__name {
  color: var(--navy);
  font: 600 32px/1.1 var(--font-display);
}
.result__full {
  margin-top: -8px;
  color: var(--off-black);
  font: 400 20px/1.4 var(--font-display);
}
.result__text {
  max-width: 600px;
}

/* ---------- How to use ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
}
.steps__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--navy);
}
.steps__num {
  color: var(--navy);
  font: 600 40px/1 var(--font-display);
}
.steps__title {
  font: 600 20px/1.2 var(--font-display);
}

/* ---------- Published tools ---------- */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-height: 578px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.tool-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.tool-card__icon {
  display: block;
}
.tool-card__names {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
}
.tool-card__name {
  font: 600 32px/1.1 var(--font-display);
}
.tool-card__full {
  color: var(--off-black);
  font: 400 20px/1.4 var(--font-display);
}
.stat {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--coral);
  color: var(--navy);
}
.stat__num {
  font: 600 48px/1 var(--font-display);
  white-space: nowrap;
}
.stat__label {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 700;
}
.tool-card__action {
  margin-top: auto;
}

/* ---------- Our research ---------- */
.research-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.research-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 305px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.research-card .meta {
  gap: 12px;
}
.research-card__title {
  font: 700 22px/1.2 var(--font-display);
}
.research-card .link {
  margin-top: auto;
  padding-block: 4px;
}

/* ---------- Team ---------- */
.team {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 230px));
  gap: 32px 24px;
  padding: 0;
  list-style: none;
}
.person {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.person__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}
.person__name {
  color: var(--navy);
  font: 700 16px/1.5 var(--font-text);
}
.person__role {
  display: -webkit-box;
  min-height: 48px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.person__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.person__links a,
.person__links .link-button {
  padding-block: 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.bio-row {
  grid-column: 1 / -1;
}
/* Without JavaScript every bio stays visible under its person. */
.js .person__bio:not(.is-open),
.no-js [data-bio-toggle],
.no-js [data-bio-close],
.no-js .section--finder {
  display: none;
}
.no-js .person__bio {
  margin-top: 8px;
}
.person__bio {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 72ch;
  padding-top: 24px;
  border-top: 1px solid var(--navy);
}
.person__bio-name {
  color: var(--navy);
  font: 700 20px/1.2 var(--font-display);
}
.person__bio .btn {
  margin-top: 4px;
}

/* ---------- Contact ---------- */
.contact .wrap {
  flex-direction: row;
  align-items: flex-start;
  gap: 64px;
}
.contact__copy {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}
.contact__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.contact__social a {
  font-weight: 700;
}
.contact__details {
  display: flex;
  flex: 0 0 520px;
  flex-direction: column;
  gap: 16px;
  padding-left: 32px;
  border-left: 3px solid var(--coral);
}
.contact__org,
.contact__email {
  color: var(--navy);
  font-weight: 700;
}
.contact__details address {
  font-style: normal;
}
.contact__funder {
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Public footer ---------- */
.site-footer {
  padding-block: 85px 80px;
  background: var(--navy);
  color: #fff;
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.site-footer__col--brand {
  gap: 16px;
}
.site-footer__logo {
  display: block;
  height: auto;
}
.site-footer__desc {
  max-width: 320px;
  font-weight: 700;
}
.site-footer__title {
  color: #fff;
  font: 700 22px/1.2 var(--font-display);
}
.site-footer address {
  max-width: 300px;
  font-style: normal;
}
.site-footer a {
  color: #fff;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer__email {
  font-weight: 700;
}
.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Cookie notice ---------- */
.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  max-height: 100vh;
  overflow-y: auto;
  padding-block: 20px;
  border-top: 4px solid var(--coral);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 -8px 24px rgba(28, 40, 94, 0.2);
}
.cookie-banner .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.cookie-banner__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 90ch;
  font-size: 15px;
}
.cookie-banner__title {
  font-size: 16px;
  font-weight: 700;
}
.cookie-banner a {
  color: #fff;
}
.cookie-banner .btn::after {
  color: var(--coral);
}
.cookie-banner form {
  flex: none;
  margin: 0;
}

/* ---------- Signed-in app shell ---------- */
.nihr-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--steel);
  background: #fff;
}
.app-identity {
  display: flex;
  flex: none;
  align-items: center;
  gap: 16px;
}
.app-identity__logo {
  display: block;
  line-height: 0;
}
.app-identity__logo img {
  display: block;
  height: auto;
}
.app-identity__rule {
  width: 1px;
  height: 28px;
  background: var(--navy-25);
}
.app-identity__descriptor {
  color: var(--navy);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.app-identity__descriptor b {
  font-weight: 700;
}
.app-controls {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
  padding-left: 48px;
}
.search-pill--app {
  flex: 1 1 0;
  width: auto;
  min-width: 200px;
  max-width: 420px;
  height: 45px;
  padding: 11px 14px;
  border-color: var(--navy-35);
}
.search-pill--app input::placeholder {
  color: var(--off-black);
}
.app-controls .link,
.app-controls .link-button {
  padding-block: 12px;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
}
.app-controls form {
  margin: 0;
}
.app-controls__divider {
  flex: none;
  width: 1px;
  height: 20px;
  background: var(--navy-25);
}
.app-descbar {
  display: none;
}
.app-menu-button {
  display: none;
  flex: none;
}
.app-body {
  display: flex;
  flex: 1 0 auto;
}

.app-sidebar {
  display: flex;
  flex: 0 0 264px;
  flex-direction: column;
  padding: 28px 16px 24px;
  background: var(--navy);
  color: #fff;
}
.app-sidebar__account,
.app-sidebar__exit {
  display: none;
}
.app-nav,
.app-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.app-nav__link,
.app-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: #fff;
  font: 400 16px/1.25 var(--font-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app-nav__link:hover,
.app-nav__toggle:hover {
  background: var(--navy-row-hover);
  color: #fff;
  text-decoration: none;
}
.app-nav__link[aria-current="page"] {
  background: #fff;
  color: var(--navy);
  font-weight: 700;
}
.app-nav__chevron {
  display: block;
  flex: none;
}
.app-nav__toggle[aria-expanded="true"] .app-nav__chevron--closed,
.app-nav__toggle[aria-expanded="false"] .app-nav__chevron--open {
  display: none;
}
.app-nav__sub {
  padding: 4px 0 8px 32px;
}
.app-nav__sub ul {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}
.app-nav__sublink {
  display: flex;
  align-items: center;
  padding: 10px 16px 10px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.25;
  text-decoration: none;
}
.app-nav__sublink:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--coral);
}
.app-nav__sublink[aria-current="page"] {
  color: #fff;
  font-weight: 700;
}
.app-nav__spacer {
  height: 24px;
}
.app-nav__link:focus-visible,
.app-nav__toggle:focus-visible,
.app-nav__sublink:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: inset 0 -2px 0 var(--focus-text);
}
.app-nav__toggle:focus-visible .app-nav__chevron {
  filter: brightness(0.2);
}
.app-sidebar__signed-in {
  margin-top: 24px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.8);
}

.app-main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--block-gap);
  min-width: 0;
  padding-top: 40px;
}
.app-main > * {
  margin-inline: 40px;
}
.app-main > .tools-band {
  margin-inline: 0;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.page-head__title {
  font: 600 48px/1.2 var(--font-display);
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.message {
  padding: 16px 20px;
  border-left: 4px solid var(--coral);
  background: var(--putty);
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding: 16px 48px;
  border-top: 1px solid var(--steel);
}
.app-footer__name {
  font-size: 13px;
  line-height: 1.4;
}
.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.app-footer__links a {
  display: inline-block;
  padding-block: 12px;
}

/* ---------- Dashboard ---------- */
.firstrun {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 48px;
  background: var(--putty);
}
.firstrun__title {
  font: 600 28px/1.25 var(--font-display);
}
.firstrun p {
  max-width: 760px;
}
.tools-band {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: 24px;
  padding: 48px 40px;
  background: var(--steel);
}
.app-tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.app-tool-card__title {
  font: 700 22px/1.2 var(--font-display);
}
.app-tool-card__fact {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}
.app-tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}
.app-tool-card__actions .btn {
  justify-content: flex-start;
  min-width: 220px;
}
.app-tool-card__actions .link {
  padding-block: 8px;
}

.projects {
  padding: 0;
  list-style: none;
}
.project {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding-block: 24px;
  border-bottom: 1px solid var(--steel);
}
.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
}
.project__name {
  font-size: 22px;
  font-weight: 700;
  line-height: normal;
}
.project__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 118px);
  gap: 4px;
  padding: 0;
  list-style: none;
}
.pipeline__stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--off-black);
  line-height: 1.25;
}
.pipeline__bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  background: var(--pending);
}
.pipeline__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--navy);
}
.pipeline__stage--done,
.pipeline__stage--current {
  color: var(--navy);
}
.pipeline__stage--done .pipeline__bar {
  background: var(--navy);
}
.pipeline__stage--current .pipeline__label {
  font-weight: 700;
}
.project__meta-sep {
  margin-inline: 0.5em;
}
.project__meta,
.project__next,
.project__done {
  line-height: 1.25;
}
.project__next {
  color: var(--navy);
  font-weight: 700;
}

/* ---------- Responsive ---------- */
/* The dashboard header's descriptor needs 1324px on one line; wrap it, then hide it. */
@media (max-width: 1323px) {
  .app-identity__descriptor {
    white-space: normal;
  }
  .app-identity__descriptor b {
    display: block;
  }
}

@media (max-width: 1180px) {
  .site-topbar__controls .search-pill {
    display: none;
  }
  .app-identity__rule,
  .app-identity__descriptor {
    display: none;
  }
  .team {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-nav {
    gap: 28px;
  }
  .hero .wrap {
    gap: 40px;
  }
  .hero__media {
    flex-basis: 420px;
    height: 340px;
  }
  .research-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact__details {
    flex-basis: 420px;
  }
  .site-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .app-header {
    padding: 16px 20px;
  }
  /* Let the logo shrink on narrow phones so the Menu button stays on screen. */
  .app-identity,
  .app-identity__logo {
    flex: 0 1 auto;
    min-width: 0;
  }
  .app-controls {
    display: none;
  }
  .app-menu-button {
    display: inline-flex;
  }
  .app-descbar {
    display: block;
    padding: 12px 20px;
    background: var(--navy);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
  }
  .app-descbar span {
    display: block;
  }
  .app-body {
    flex-direction: column;
  }
  .js .app-sidebar {
    display: none;
  }
  .js .app-sidebar.is-open {
    display: flex;
  }
  .app-sidebar {
    flex-basis: auto;
    padding: 0 0 24px;
  }
  .app-sidebar__account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  }
  .app-sidebar__account .name {
    font-weight: 700;
  }
  .app-sidebar__account-links {
    display: flex;
    gap: 20px;
  }
  .app-sidebar__account a,
  .app-sidebar__account .link-button {
    color: #fff;
    font-weight: 400;
  }
  .app-nav {
    padding: 12px;
  }
  .app-sidebar__signed-in {
    display: none;
  }
  .app-sidebar__exit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 28px 0;
  }
  .app-sidebar__exit a {
    color: #fff;
  }
  .app-sidebar__exit .link__text {
    color: #fff;
  }
  .app-main {
    gap: 32px;
    padding-top: 32px;
  }
  .app-main > * {
    margin-inline: 20px;
  }
  .firstrun {
    padding: 24px 20px;
  }
  .tools-band {
    padding: 32px 20px;
  }
  .app-footer {
    padding: 8px 20px 16px;
  }
}

@media (max-width: 900px) {
  :root {
    --section-y: 56px;
    --block-gap: 32px;
  }
  .menu-button {
    display: inline-flex;
  }
  .no-js .menu-button {
    display: none;
  }
  .site-topbar .wrap {
    padding-block: 16px;
  }
  .site-topbar__controls {
    display: none;
  }
  .site-descbar .wrap {
    padding-block: 12px;
  }
  .site-descriptor {
    padding-bottom: 0;
    border-bottom: 0;
    font: 700 14px/1.4 var(--font-text);
  }
  .site-descriptor__second {
    display: block;
  }
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
    padding-top: 8px;
  }
  .js .site-nav {
    display: none;
  }
  .js .site-nav.is-open {
    display: flex;
  }
  .site-nav__link {
    padding-block: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  .site-nav__link::before {
    display: none;
  }
  .site-nav__login {
    align-self: flex-start;
    margin: 16px 0 4px;
  }
  .site-nav__exit {
    display: block;
  }
  .hero .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
  .hero__title {
    font-size: 36px;
  }
  .hero__standfirst,
  .section-head__standfirst {
    font-size: 18px;
  }
  .hero__media {
    flex: none;
    height: auto;
    /* Room above the photo for the arc, which rises 17.75% of the photo's height. */
    margin-top: 13.7%;
    aspect-ratio: 13 / 10;
  }
  .section-head__title {
    font-size: 28px;
  }
  .finder {
    padding: 24px 20px 20px;
  }
  .tiles,
  .tiles--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stepper__step {
    font-size: 13px;
  }
  .tool-cards {
    grid-template-columns: 1fr;
  }
  .tool-card {
    min-height: 0;
  }
  .tool-card__names {
    min-height: 0;
  }
  .research-cards {
    grid-template-columns: 1fr;
  }
  .research-card {
    min-height: 0;
  }
  .team {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .contact .wrap {
    flex-direction: column;
    gap: 40px;
  }
  .contact__details {
    flex-basis: auto;
    padding: 24px 0 0;
    border-top: 3px solid var(--coral);
    border-left: 0;
  }
  .cookie-banner .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .page-head__title {
    font-size: 36px;
  }
  .tools-band {
    grid-template-columns: 1fr;
  }
  .pipeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 600px) {
  .site-topbar .wrap {
    gap: 12px;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .link {
    align-self: flex-start;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }
  .site-footer {
    padding-top: 64px;
  }
  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .stat__num {
    font-size: 40px;
  }
  .finder__actions .btn {
    flex: 1 1 auto;
  }
  .app-tool-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .app-tool-card__actions .btn {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
