/* Tyne Nurdles site styles. No external fonts or resources: everything is served from this origin. */

:root {
  --ink: #13262e;
  --ink-soft: #3d5058;
  --tide: #0d3b4c;
  --tide-deep: #082a37;
  --teal: #1f6f78;
  --teal-light: #d7ebea;
  --mud: #f3eee6;
  --sand: #ddd1bd;
  --pellet: #f3ecd9;
  --accent: #b0561b;
  --accent-dark: #8e4413;
  --line: #d6d2c9;
  --white: #ffffff;
  --warn-bg: #fff4d6;
  --warn-line: #d9a520;
  --error: #b3261e;
  --ok: #1d6b3a;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --radius: 10px;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--font-body);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--tide); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; color: var(--tide-deep); margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-top: 1.8em; }
h3 { font-size: 1.25rem; margin-top: 1.4em; }
h2:first-child, h3:first-child { margin-top: 0; }
p, ul, ol, dl, table { margin: 0 0 1.1em; }
li + li { margin-top: 0.3em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }
.plain { list-style: none; padding: 0; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 44rem; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--white); color: var(--tide); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

mark.tbc { background: #ffe066; color: #000; padding: 0 0.25em; border-radius: 3px; font-size: 0.9em; }

/* ---------- Header ---------- */

.site-header { background: var(--tide); color: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--white); text-decoration: none; padding: 0.6rem 0; }
.brand:hover { color: var(--white); }
.brand-mark { width: 2.4rem; height: 2.4rem; color: #7fc4c4; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; }
.brand-sub { font-size: 0.8rem; opacity: 0.85; }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav ul { list-style: none; display: flex; gap: 0.2rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav li + li { margin: 0; }
.site-nav ul a {
  display: block; padding: 0.45rem 0.65rem; color: var(--white); text-decoration: none;
  border-radius: 6px; font-size: 0.97rem;
}
.site-nav ul a:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.site-nav ul a[aria-current="page"] { box-shadow: inset 0 -3px 0 #7fc4c4; border-radius: 0; }

.nav-toggle {
  display: none; align-items: center; gap: 0.5rem; background: transparent; color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 6px; padding: 0.45rem 0.8rem; font: inherit; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

@media (max-width: 64rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 1rem; }
  .js .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 0.7rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0; }
  .site-nav ul a[aria-current="page"] { box-shadow: inset 4px 0 0 #7fc4c4; padding-left: 0.9rem; }
  .nav-cta { align-self: flex-start; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block; background: var(--accent); color: var(--white); text-decoration: none;
  padding: 0.75rem 1.3rem; border-radius: 999px; font-weight: 600; border: 2px solid var(--accent);
  font: 600 1rem/1.2 var(--font-body); cursor: pointer;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); text-decoration: none; }
.button-small { padding: 0.5rem 1rem; font-size: 0.93rem; }
.button-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.7); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--white); }
.button-outline { background: transparent; color: var(--tide); border-color: var(--tide); }
.button-outline:hover { background: var(--tide); color: var(--white); border-color: var(--tide); }
.button[disabled], .button[aria-disabled="true"] { background: #8a9499; border-color: #8a9499; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Hero and page headers ---------- */

.hero {
  background: var(--tide-deep); color: var(--white); position: relative; overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(6rem, 13vw, 10rem);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: clamp(5rem, 12vw, 9rem);
  background: url("/assets/img/hero-waves.svg") bottom center / cover no-repeat; opacity: 0.9; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: var(--white); max-width: 22ch; }
.hero .lede { color: #d5e6e8; }
.eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #9fd3d0; margin-bottom: 0.9rem;
}

.page-head { background: var(--mud); border-bottom: 1px solid var(--line); padding: clamp(2rem, 5vw, 3.5rem) 0; }
.page-head .eyebrow { color: var(--teal); }
.page-head .lede { margin-bottom: 0; }

/* ---------- Sections ---------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--mud); }
.section-dark { background: var(--tide); color: var(--white); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark a { color: #aee0dd; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem;
}
.card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.card-link:hover { border-color: var(--teal); color: inherit; transform: translateY(-2px); }
.card-link .more { color: var(--teal); font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; margin: 2rem 0 0; }
.fact { border-left: 3px solid #7fc4c4; padding: 0.2rem 0 0.2rem 1rem; }
.fact-value { display: block; font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--white); line-height: 1.1; }
.fact-label { font-size: 0.92rem; color: #cfe2e4; }

.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--teal-light); color: var(--tide); padding: 0.15rem 0.55rem; border-radius: 999px; margin-bottom: 0.6rem;
}

figure { margin: 0 0 1.5rem; }
figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.6rem; }
.figure-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--mud); }

.callout { border-left: 4px solid var(--teal); background: var(--teal-light); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1.5rem; }
.callout > :last-child { margin-bottom: 0; }
.callout-warn { border-color: var(--warn-line); background: var(--warn-bg); }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.steps li { counter-increment: step; margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--tide); color: var(--white); font-weight: 700; margin-bottom: 0.6rem;
}

/* ---------- Team ---------- */

.person { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.1rem; align-items: start; }
.avatar {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; background: var(--teal-light);
  display: grid; place-items: center; font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--tide);
}
.person h3 { margin: 0 0 0.1rem; font-size: 1.2rem; }
.person .role { font-weight: 600; color: var(--ink-soft); margin: 0 0 0.5rem; font-size: 0.95rem; }
.person p { font-size: 0.97rem; }

.partner-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); list-style: none; padding: 0; }
.partner-list li { margin: 0; }

/* ---------- Tables, definition lists ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--mud); font-weight: 700; }
.table-scroll { overflow-x: auto; }

.prose { max-width: 46rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.15rem; }
.toc { background: var(--mud); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.toc ol { margin: 0; padding-left: 1.3rem; }

details { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.2rem; margin-bottom: 0.75rem; background: var(--white); }
details[open] { border-color: var(--teal); }
summary { cursor: pointer; font-weight: 600; color: var(--tide-deep); }
details > :not(summary) { margin-top: 0.8rem; }
details > :last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */

.form { max-width: 46rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem 0.6rem; margin: 0 0 1.6rem; background: var(--white); }
legend { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--tide-deep); padding: 0 0.4rem; }
.field { margin-bottom: 1.25rem; }
.field > label, .field-label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { display: block; font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 0.45rem; font-weight: 400; }
.req { color: var(--error); font-weight: 700; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 0.92rem; }

input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 2px solid #8b979c; border-radius: 6px; padding: 0.55rem 0.7rem;
}
input[type="number"] { max-width: 12rem; }
input[type="date"], input[type="time"] { max-width: 14rem; }
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--tide); }

.choice { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; align-items: start; margin-bottom: 0.8rem; }
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; accent-color: var(--tide); }
.choice label { font-weight: 400; }
.choice-group { border: 0; padding: 0; margin: 0 0 1.25rem; background: none; }
.choice-group legend { font-family: var(--font-body); font-size: 1rem; font-weight: 600; padding: 0; margin-bottom: 0.5rem; color: var(--ink); }
.inline-choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.inline-choices .choice { margin-bottom: 0.3rem; }

.dropzone {
  border: 2px dashed #8b979c; border-radius: var(--radius); padding: 1.5rem; text-align: center; background: var(--mud);
}
.dropzone.dragover { border-color: var(--tide); background: var(--teal-light); }
.dropzone input[type="file"] { margin: 0.75rem auto 0; max-width: 100%; }
.file-list { list-style: none; padding: 0; margin: 0.8rem 0 0; text-align: left; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0.6rem; background: var(--white); border: 1px solid var(--line); border-radius: 6px; font-size: 0.93rem; }
.file-list .file-error { color: var(--error); }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error-summary { border: 3px solid var(--error); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; background: #fff; }
.error-summary h2 { font-size: 1.2rem; margin: 0 0 0.5rem; color: var(--error); }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--error); font-weight: 600; }
.field-error { display: block; color: var(--error); font-weight: 600; font-size: 0.93rem; margin-bottom: 0.3rem; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--error); }

.progress { margin: 1rem 0; }
.progress progress { width: 100%; height: 0.9rem; accent-color: var(--tide); }
.status-panel { border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1.5rem; }
.status-ok { background: #e3f3e8; border: 2px solid var(--ok); }
.status-ok h2 { color: var(--ok); margin-top: 0; }
.reference { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; font-weight: 700; background: var(--white); padding: 0.2rem 0.5rem; border-radius: 4px; }

/* ---------- Funder logo ----------
   UKRI rules: master files only, never stretched or recoloured; the UKRI symbol at least
   28 px high; clear space of a quarter of the symbol height all round. The symbol is the
   full height of the logo, so a 56 px logo needs 14 px of clear space. */

.funder-logo { display: block; height: 56px; width: auto; margin: 14px 0; padding: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--tide-deep); color: #d5e3e6; font-size: 0.95rem; margin-top: 0; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); padding-top: 3rem; padding-bottom: 2rem; }
.footer-title { font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 1.2rem; padding-bottom: 1.5rem; font-size: 0.88rem; }
.footer-base p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .button-row { display: none; }
}

@media (max-width: 30rem) {
  .brand-sub { display: none; }
  .brand-mark { width: 2rem; height: 2rem; }
  .person { grid-template-columns: 1fr; gap: 0.7rem; }
  .avatar { width: 4rem; height: 4rem; font-size: 1.3rem; }
  fieldset { padding: 1rem 1rem 0.4rem; }
}
