/* GlycoCell, high-impact direction. "Fluorescence": the site reads like a lit
   microscope field. Dark single look, logo blue as the light source, one stain
   colour (lectin magenta) used sparingly, GlycoForge orange on GlycoForge only. */
:root {
  /* colour */
  --ink: #060B16;        /* field: blue-black, hue of the logo blue */
  --ink-2: #0B1424;      /* raised surface */
  --ink-3: #12203A;      /* hairlines, wells */
  --fg: #EAF1F7;         /* cool white text */
  --muted: #93A7AC;      /* logo grey, exact: secondary text (7.6:1 on ink) */
  --blue: #4791C9;       /* logo blue, exact: residues, large display, rules */
  --blue-text: #74B2E3;  /* logo blue lifted for small text on ink */
  --glow: #8FD0FF;       /* light-emitting tips */
  --stain: #FF4F9A;      /* lectin magenta: recognition, the thing to look at */
  --forge: #FF7F2A;      /* GlycoForge only */
  --plate: #FFFFFF;      /* white plate behind the GlycoForge logo */
  color-scheme: dark;

  /* type */
  --display: "Roboto", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-mega: clamp(3.2rem, 7.6vw, 8.4rem);
  --t-xl: clamp(2.4rem, 6vw, 5.4rem);
  --t-l: clamp(1.7rem, 3.4vw, 2.9rem);
  --t-m: clamp(1.25rem, 2vw, 1.6rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-label: 0.75rem;

  /* layout */
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--fg);
  font: 400 var(--t-body)/1.6 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
/* A quiet blue wash: selection happens by accident while scrolling, so it should not
   shout. The stain colour is kept for things the reader is meant to look at. */
::selection { background: rgba(71, 145, 201, 0.4); color: var(--fg); }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* labels and type */
.label { font: 500 var(--t-label)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.label b { color: var(--blue-text); font-weight: 500; }
h1, h2, h3 { font-family: var(--display); font-weight: 750; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
.display-xl { font-size: var(--t-xl); line-height: 1; letter-spacing: -0.022em; }
.display-l { font-size: var(--t-l); line-height: 1.02; }
.display-m { font-size: var(--t-m); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; max-width: 62ch; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--fg); }
.dim { color: var(--muted); }
.stain { color: var(--stain); }
.blue { color: var(--blue); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font: 600 0.95rem/1 var(--body); text-decoration: none;
  padding: 0.95em 1.3em; border: 1.5px solid var(--blue); color: var(--fg);
  background: transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--blue); color: var(--ink); }
.btn.solid { background: var(--fg); border-color: var(--fg); color: var(--ink); }
.btn.solid:hover { background: var(--glow); border-color: var(--glow); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(4px); }
.link { color: var(--blue-text); text-decoration: none; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link:hover { color: var(--glow); }

/* top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(to bottom, rgba(6, 11, 22, .92), rgba(6, 11, 22, .55) 70%, rgba(6, 11, 22, 0));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent; transition: background-color .2s, border-color .2s;
}
/* Once the page has scrolled, a solid bar: the fade's hard blur edge showed over light content such as the GlycoForge logo. */
/* Inner pages on phones: some browsers report a large top inset, so the soft fade would sit over page content. Home keeps the fade over its glycan field. */
@media (max-width: 980px) { body:has(.page-hero) .bar { background: rgb(6, 11, 22); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.bar.scrolled { background: rgb(6, 11, 22); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: var(--ink-3); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.bar .logo img { height: 46px; width: auto; display: block; }
.nav { display: flex; gap: clamp(14px, 1.8vw, 28px); font: 500 0.9rem/1 var(--body); }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); border-bottom-color: var(--blue); }
.menu-btn { display: none; background: none; border: 1.5px solid var(--ink-3); color: var(--fg); font: 600 0.85rem/1 var(--mono); letter-spacing: .1em; padding: 10px 14px; text-transform: uppercase; }
@media (max-width: 980px) {
  .nav { display: none; }
  .menu-btn { display: inline-block; }
  .bar.open .nav { display: flex; flex-direction: column; position: absolute; top: calc(76px + env(safe-area-inset-top, 0px)); left: 0; right: 0; background: var(--ink); padding: 12px var(--gutter) 24px; border-bottom: 1px solid var(--ink-3); font-size: 1.25rem; gap: 6px; }
  .bar.open .nav a { padding: 10px 0; }
}

/* the field canvas */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
main, footer { position: relative; z-index: 1; }

/* hero */
.hero { min-height: min(100svh, 980px); display: flex; align-items: flex-end; padding-block: calc(140px + env(safe-area-inset-top, 0px)) 72px; pointer-events: none; }
.hero .wrap { width: 100%; }
.hero a, .hero button { pointer-events: auto; }
.hero h1 { font-size: var(--t-mega); line-height: 0.92; letter-spacing: -0.025em; margin-block: 18px 22px; }
.hero h1 .stain { display: inline-block; }
.hero .sub { font: 600 var(--t-m)/1.2 var(--display); max-width: 30ch; letter-spacing: -0.01em; }
.hero .lede { margin-top: 18px; color: var(--muted); max-width: 54ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 48px; }
.hint { font: 400 var(--t-label)/1.4 var(--mono); letter-spacing: .08em; color: var(--muted); }
.hint .dot { display: inline-block; width: 8px; height: 8px; border: 1.5px solid var(--stain); border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.pause { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: transparent; color: var(--muted); border: 1px solid var(--ink-3); padding: 9px 12px; cursor: pointer; }
.pause:hover { color: var(--fg); border-color: var(--muted); }
.scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,11,22,.75), rgba(6,11,22,.2) 55%, transparent); pointer-events: none; z-index: -1; }

/* story chapters (canvas behind, text column left) */
.story { position: relative; }
.chapter { min-height: 100svh; display: flex; align-items: center; padding-block: 12vh; }
.chapter .wrap { width: 100%; }
.chapter .card { max-width: 30rem; display: grid; gap: 18px; }
.chapter .num { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .14em; color: var(--stain); }
.chapter h2 { font-size: var(--t-xl); line-height: 1; letter-spacing: -0.025em; }
.chapter p { color: var(--muted); font-size: 1.125rem; }
.chapter p strong { color: var(--fg); font-weight: 600; }
.progress { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 2; display: grid; gap: 10px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.progress.on { opacity: 1; }
.progress i { display: block; width: 3px; height: 22px; background: var(--ink-3); }
.progress i.on { background: var(--stain); }
@media (min-width: 761px) { .chapter .card { margin-left: 28px; } }
@media (max-width: 760px) {
  .chapter { align-items: flex-end; padding-block: 52svh 10svh; }
  .chapter .card { background: linear-gradient(to top, rgba(6,11,22,.96) 70%, rgba(6,11,22,.0)); padding-top: 40px; }
  .progress { display: none; }
}

/* solid sections after the story */
.after { background: var(--ink); position: relative; }
/* Vertical rhythm (tightened 26 Oct 2026, John): sections 40-64px top and bottom, headings 24-40px above their content. */
.section { padding-block: clamp(40px, 5vw, 64px); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px clamp(24px, 5vw, 80px); align-items: end; margin-bottom: clamp(24px, 3.5vw, 40px); }
.sec-head > * { min-width: 0; }
.sec-head:last-child { margin-bottom: 0; }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; } }

/* GlycoForge feature */
.forge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.forge > * { min-width: 0; }
@media (max-width: 900px) { .forge { grid-template-columns: 1fr; } }
.forge-plate { background: var(--plate); display: inline-block; padding: 14px 18px; }
.forge-plate img { height: 54px; width: auto; display: block; }
.status { display: inline-flex; align-items: center; gap: 10px; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--forge); border: 1px solid var(--forge); padding: 8px 12px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--forge); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none; } }
a.status { text-decoration: none; } a.status:hover { border-color: var(--forge); }
.plate { width: 100%; aspect-ratio: 3 / 2; max-width: 100%; display: block; }

/* institutions */
.insts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink-3); border-left: 1px solid var(--ink-3); }
.insts li { list-style: none; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); padding: 28px 24px 32px; font: 600 clamp(1.1rem, 1.7vw, 1.45rem)/1.2 var(--display); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.insts li span { font: 500 var(--t-label)/1 var(--mono); color: var(--muted); letter-spacing: .1em; }
.insts { margin: 0; padding: 0; }
@media (max-width: 760px) { .insts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .insts { grid-template-columns: 1fr; } .insts li { min-height: 0; } }
/* Open grid: blue rule on top, lines only between tiles */
.insts { border-top: 1.5px solid var(--blue); border-left: 0; }
.insts li { border-right: 0; border-bottom: 0; }
.insts li:nth-child(n+4) { border-top: 1px solid var(--ink-3); }
.insts li:not(:nth-child(3n+1)) { border-left: 1px solid var(--ink-3); }
.insts li:nth-child(3n+1) { padding-left: 0; }
@media (max-width: 760px) { .insts li:nth-child(n+3) { border-top: 1px solid var(--ink-3); } .insts li:nth-child(3n+1) { padding-left: 24px; } .insts li:nth-child(2n+1) { border-left: 0; padding-left: 0; } .insts li:nth-child(2n) { border-left: 1px solid var(--ink-3); } }
@media (max-width: 440px) { .insts li:nth-child(n+2) { border-top: 1px solid var(--ink-3); } .insts li { border-left: 0 !important; padding-left: 0 !important; } }

/* figures */
.figs { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--blue); }
.fig { padding: 28px 24px 28px 0; display: grid; gap: 10px; align-content: start; }
.fig + .fig { padding-left: 24px; border-left: 1px solid var(--ink-3); }
.fig .n { font: 700 clamp(4rem, 9vw, 8rem)/0.92 var(--display); letter-spacing: -0.028em; color: var(--fg); font-variant-numeric: tabular-nums; }
.fig .n small { font-size: 0.45em; color: var(--blue); letter-spacing: 0; }
.fig p { color: var(--muted); font-size: var(--t-small); max-width: 22ch; }
.fig p strong { color: var(--fg); display: block; font-size: 1rem; }
@media (max-width: 520px) { .figs { grid-template-columns: 1fr; } .fig + .fig { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink-3); } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(24px, 5vw, 64px); margin-top: 48px; }
.facts > div { display: grid; gap: 6px; align-content: start; border-left: 3px solid var(--stain); padding-left: 18px; }
.facts h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.facts p { color: var(--muted); font-size: var(--t-small); }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* split: translation + preparedness */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.split > div { padding: clamp(28px, 4vw, 56px); display: grid; gap: 18px; align-content: start; background: var(--ink-2); }
.split > div + div { border-left: 1px solid var(--ink-3); }
.split p { color: var(--muted); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split > div + div { border-left: 0; border-top: 1px solid var(--ink-3); } }

/* latest */
.latest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .latest { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } }
.latest article { border-top: 1.5px solid var(--blue); padding-top: 18px; display: grid; gap: 10px; align-content: start; }
.latest time { font: 500 var(--t-label)/1 var(--mono); color: var(--blue-text); letter-spacing: .1em; text-transform: uppercase; }
.latest p { font-size: 1.05rem; }
@media (max-width: 860px) { .latest { grid-template-columns: 1fr; } }

/* footer */
footer { background: var(--ink); padding-block: 64px 80px; }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.foot > * { min-width: 0; }
.foot .big { font: 700 clamp(2.6rem, 8vw, 7rem)/0.92 var(--display); letter-spacing: -0.028em; }
.foot .big span { color: var(--blue); }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: var(--t-small); }
.foot ul a { color: var(--muted); text-decoration: none; }
.foot ul a:hover { color: var(--fg); }
.funder { margin-top: 32px; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; color: var(--muted); font-size: var(--t-small); }
.funder .ph { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .1em; border: 1px dashed var(--muted); padding: 12px 16px; }
/* Text credit standing in for the UKRI / BBSRC logo until the artwork arrives. */
.funder-mark { display: flex; align-items: center; gap: 14px; margin: 0; white-space: nowrap; }
.funder-mark span { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.funder-mark b { font: 750 1.35rem/1 var(--display); letter-spacing: 0.01em; color: var(--fg); }
.funder-mark i { width: 1.5px; height: 1.4rem; background: var(--muted); }
.funder-mark a { color: var(--fg); text-decoration: none; border-bottom: 1.5px solid transparent; }
.funder-mark a:hover, .funder-mark a:focus-visible { border-bottom-color: currentColor; }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr; } }

/* review marks (exploration only, not part of the site) */
.marks [data-m] { box-shadow: inset 0 -0.12em 0 rgba(255, 79, 154, .55); }
.marks [data-m="review"] { box-shadow: inset 0 -0.12em 0 rgba(255, 127, 42, .8); }
.marks [data-m="check"] { box-shadow: inset 0 -0.12em 0 rgba(143, 208, 255, .7); }
.marks [data-m]::after {
  content: attr(data-m); display: inline-block; margin-left: .5em; vertical-align: middle;
  font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 5px; background: var(--stain); color: var(--ink); white-space: nowrap;
}
.marks [data-m="review"]::after { background: var(--forge); }
.marks [data-m="check"]::after { background: var(--glow); }
.marks [data-m][data-n]::after { content: attr(data-m) " · " attr(data-n); }

/* exploration toolbar (not part of the site) */
.xbar {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(11, 20, 36, .92); border: 1px solid var(--ink-3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 500 11px/1 var(--mono); letter-spacing: .06em; max-width: calc(100vw - 24px); overflow-x: auto;
}
.xbar span { color: var(--stain); padding: 0 10px; text-transform: uppercase; white-space: nowrap; }
.xbar a, .xbar button { color: var(--muted); text-decoration: none; padding: 9px 10px; background: none; border: 0; font: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.xbar a:hover, .xbar button:hover, .xbar [aria-current], .xbar [aria-pressed="true"] { color: var(--fg); background: var(--ink-3); }

/* ---------- shared additions ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--fg); color: var(--ink); padding: 10px 14px; font-weight: 600; }
.skip:focus { top: 12px; }
.stack { display: grid; gap: 22px; align-content: start; min-width: 0; }
.row-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.small { font-size: var(--t-small); }
h1 em, h2 em, .big em { font-style: normal; color: var(--stain); }
.forge-plate { justify-self: start; }
.foot-side { display: grid; gap: 20px; }
.foot-mail { font: 600 1.3rem/1.2 var(--display); }
.fig strong a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--blue); }
.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr; } }
.sec-head.top { align-items: start; }

/* ---------- inner page hero ---------- */
.page-hero { padding-block: calc(150px + env(safe-area-inset-top, 0px)) clamp(40px, 5vw, 64px); }
.ph-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ph-grid.ph-solo { grid-template-columns: minmax(0, 1fr); }
.page-hero h1 { font-size: clamp(3rem, 8.5vw, 8rem); line-height: 0.92; letter-spacing: -0.025em; }
.page-hero .lede { color: var(--muted); }
@media (max-width: 900px) { .ph-grid { grid-template-columns: 1fr; } .page-hero { padding-top: calc(120px + env(safe-area-inset-top, 0px)); } }
.still { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: radial-gradient(closest-side at 55% 50%, var(--ink-2), var(--ink)); }
.still canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.visual figure { margin: 0; display: grid; gap: 12px; }
.visual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .visual { grid-template-columns: 1fr; } }

/* statement */
.statement { font: 600 clamp(1.6rem, 3.6vw, 3.1rem)/1.12 var(--display); letter-spacing: -0.02em; max-width: 30ch; color: var(--muted); margin-top: 22px; text-wrap: balance; }
.statement strong { color: var(--fg); font-weight: 700; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--blue); }
.cards > div { padding: 28px 24px 8px 0; display: grid; gap: 12px; align-content: start; min-width: 0; }
.cards > div + div { padding-left: 24px; border-left: 1px solid var(--ink-3); }
.cards p { color: var(--muted); }
.cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* About: document covers above the engineering biology links (a cover is how people usually show these documents) */
.cards.docs > div { gap: 12px; }
@media (min-width: 861px) and (max-width: 1100px) {
  .cards.c4.docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.c4.docs > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .cards.c4.docs > div:nth-child(n+3) { border-top: 1px solid var(--ink-3); }
}
.doc-cover { display: block; box-sizing: border-box; width: 140px; max-width: 42%; aspect-ratio: 480 / 679; margin-bottom: 10px; border: 1px solid var(--ink-3); box-shadow: 0 12px 28px rgba(0, 0, 0, .45); transition: transform .2s; }
.doc-cover:hover { transform: translateY(-3px); }
.doc-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cards .credit { font-size: 0.75rem; color: var(--muted); opacity: .75; }
@media (max-width: 1100px) and (min-width: 861px) { .cards.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards.c4 > div:nth-child(3) { padding-left: 0; border-left: 0; } .cards.c4 > div:nth-child(n+3) { border-top: 1px solid var(--ink-3); } }
.cards h3 a { color: inherit; text-decoration: none; }
.cards h3 a:hover { color: var(--blue-text); }
@media (max-width: 860px) { .cards, .cards.c4 { grid-template-columns: 1fr; } .cards > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink-3); } }

/* research themes */
.theme-group { display: grid; gap: 24px; }
.theme-group + .theme-group { margin-top: clamp(48px, 6vw, 80px); }
.themes { border-top: 1.5px solid var(--blue); }
.theme { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(0, 0.9fr); gap: 20px clamp(20px, 3vw, 48px); padding-block: 32px; border-bottom: 1px solid var(--ink-3); }
.theme > p:first-child, .theme .stack p { color: var(--muted); }
.theme .ex { font-size: var(--t-small); }
.theme .ex .label { display: inline; margin-right: 6px; color: var(--blue-text); }
.theme .outcome { font: 600 1.15rem/1.3 var(--display); color: var(--fg); display: grid; gap: 8px; align-content: start; }
.theme .outcome .label { color: var(--stain); }
.forge-theme h3 { color: var(--forge); }
@media (max-width: 860px) { .theme { grid-template-columns: 1fr; } }

/* outputs */
.count { font: 500 0.4em/1 var(--mono); color: var(--stain); vertical-align: super; letter-spacing: 0; }
.papers, .events { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--blue); }
.papers li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px 28px; padding-block: 26px; border-bottom: 1px solid var(--ink-3); align-items: start; }
.yr { font: 500 var(--t-label)/1.6 var(--mono); color: var(--blue-text); letter-spacing: .1em; }
.ptitle { font: 600 clamp(1.1rem, 1.6vw, 1.35rem)/1.3 var(--display); letter-spacing: -0.01em; max-width: 60ch; }
.papers .link { white-space: nowrap; font-size: var(--t-small); }
@media (max-width: 760px) { .papers li { grid-template-columns: 1fr; } }
.events li { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 14rem); gap: 6px 28px; padding-block: 18px; border-bottom: 1px solid var(--ink-3); }
.events .ev { font-weight: 600; }
.events .kind { color: var(--muted); font-size: var(--t-small); }
@media (max-width: 760px) { .events li { grid-template-columns: 1fr; } }

/* partners */
.partners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.partners > div { background: var(--ink-2); border-top: 1.5px solid var(--blue); padding: clamp(24px, 4vw, 44px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.partners p { color: var(--muted); }
.partners > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.partners h3 { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 760px) { .partners { grid-template-columns: 1fr; } }

/* call to action */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(24px, 6vw, 96px); align-items: end; }
.cta-mail { font: 700 clamp(1.4rem, 2.6vw, 2.2rem)/1.1 var(--display); color: var(--blue); overflow-wrap: anywhere; }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

/* people */
.names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.5px solid var(--blue); }
.names li { padding: 20px 20px 20px 0; border-bottom: 1px solid var(--ink-3); display: grid; gap: 4px; min-width: 0; align-content: start; }
.team-group { margin: 40px 0 14px; } /* "Former members" under the Research team list */
.names b { font: 600 1.2rem/1.2 var(--display); }
.names span { color: var(--muted); font-size: var(--t-small); }
.names b a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 4px; text-decoration-thickness: 1px; } .names b a:hover { text-decoration-color: var(--blue-text); color: var(--blue-text); }
.pi { font: 600 10px/1 var(--mono) !important; letter-spacing: .12em; color: var(--ink) !important; background: var(--stain); padding: 3px 6px; vertical-align: middle; }
@media (max-width: 860px) { .names { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .names { grid-template-columns: 1fr; } }
/* No doubled line where a list ends a section: drop the last item's rule */
.theme:last-child, .papers li:last-child, .events li:last-child, .steps li:last-child { border-bottom: 0; }
.names li { border-bottom: 0; border-top: 1px solid var(--ink-3); }
.names li:nth-child(-n+3) { border-top: 0; }
@media (max-width: 860px) { .names li:nth-child(3) { border-top: 1px solid var(--ink-3); } }
@media (max-width: 480px) { .names li:nth-child(2) { border-top: 1px solid var(--ink-3); } }

.team { list-style: none; margin: 0; padding: 24px 0 0; border-top: 1.5px solid var(--blue); display: flex; flex-wrap: wrap; gap: 10px 0; font: 600 1.2rem/1.4 var(--display); } /* same size as the other names on the page */
.team li::after { content: "·"; color: var(--blue); margin: 0 0.5em; }
.team li:last-child::after { content: ""; }

/* contact */
.contact-hero { min-height: 70svh; display: flex; align-items: center; }
.contact-hero .wrap { width: 100%; }
.contact-hero h1 { font-size: clamp(3rem, 8.5vw, 8rem); }
.mega-mail { font: 700 clamp(2rem, 7vw, 6rem)/0.95 var(--display); letter-spacing: -0.025em; color: var(--blue); overflow-wrap: anywhere; max-width: none; }
/* closing invitation that replaces a separate contact block above the footer */
.sec-close { margin-top: 2.5rem; }
#contact, main [id] { scroll-margin-top: 120px; } /* the menu's Contact link jumps here, clear of the fixed top bar */
.mega-mail a, .foot-mail a, .cta-mail a { color: inherit; text-decoration: none; }
.mega-mail a:hover, .foot-mail a:hover, .cta-mail a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }

/* legal prose */
.prose { display: grid; gap: 20px; max-width: 64ch; font-size: 1.125rem; }
.prose p { color: var(--muted); }
.prose p:first-child { color: var(--fg); }

/* ---------- GlycoForge page ---------- */
.gf-hero h1 em { color: var(--forge); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0; align-items: stretch; }
.two > div { background: var(--ink-2); padding: clamp(28px, 4vw, 52px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.two .x { display: grid; place-items: center; padding: 0 clamp(12px, 2vw, 28px); font: 700 clamp(2.5rem, 5vw, 4.5rem)/1 var(--display); color: var(--forge); background: none; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } .two .x { padding: 12px 0; } }
.loop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.loop svg { width: 100%; max-width: 440px; aspect-ratio: 1; justify-self: center; }
@media (max-width: 860px) { .loop { grid-template-columns: 1fr; } }
.calc { border: 1px solid var(--ink-3); background: var(--ink-2); padding: clamp(24px, 4vw, 48px); display: grid; gap: 28px; }
.calc .out { font: 750 clamp(2.8rem, 9vw, 7.5rem)/0.92 var(--display); letter-spacing: -0.025em; color: var(--fg); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc .ctrl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.calc label { display: grid; gap: 10px; font: 500 var(--t-label)/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.calc label output { font: 700 1.6rem/1 var(--display); color: var(--fg); letter-spacing: 0; text-transform: none; }
.calc input[type=range] { width: 100%; accent-color: var(--forge); }
@media (max-width: 560px) { .calc .ctrl { grid-template-columns: 1fr; } }
.enables { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--forge); }
.enables div { padding: 28px 24px 8px 0; display: grid; gap: 12px; align-content: start; min-width: 0; }
.enables div + div { padding-left: 24px; border-left: 1px solid var(--ink-3); }
.enables span { font: 500 var(--t-label)/1 var(--mono); color: var(--forge); letter-spacing: .12em; }
.enables p { color: var(--muted); }
@media (max-width: 1100px) and (min-width: 861px) { .enables { grid-template-columns: repeat(2, minmax(0, 1fr)); } .enables div:nth-child(3) { padding-left: 0; border-left: 0; } .enables div:nth-child(n+3) { border-top: 1px solid var(--ink-3); } }
@media (max-width: 860px) { .enables { grid-template-columns: 1fr; } .enables div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink-3); } }
.statusbox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 80px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--ink-3); align-items: center; }
.steps li::before { content: ""; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--forge); display: grid; place-items: center; font: 800 15px/1 var(--display); }
.steps li.done::before { content: "\2713"; background: var(--forge); color: var(--ink); }
.steps li.now::before { content: "\2192"; color: var(--forge); }
.steps li.now { font-weight: 600; }
.steps li.next { color: var(--muted); }
.steps li.next::before { border-color: var(--muted); opacity: .6; }
@media (max-width: 860px) { .statusbox { grid-template-columns: 1fr; } }

.calc-out { display: grid; gap: 10px; min-width: 0; }
.calc .out sup { font-size: 0.5em; vertical-align: 0.9em; line-height: 0; }
.calc .out .x { color: var(--muted); font-weight: 500; }
/* calculator colour key: levels (base) in forge orange, genes (power) in blue */
.calc .lv { --c: var(--forge); } .calc .gn { --c: var(--blue-text); }
.calc .out { color: var(--fg); }
.calc .formula { margin: 0; font: 750 clamp(1.6rem, 4.5vw, 2.6rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.calc .formula .lv, .calc .formula .gn { color: var(--c); }
.calc .formula sup { font-size: .58em; vertical-align: .9em; line-height: 0; margin-left: .04em; }
.calc .formula .eq { color: var(--muted); font-weight: 500; }
.calc label.lv output, .calc label.gn output { color: var(--c); }
.calc label.lv input, .calc label.gn input { accent-color: var(--c); }
.calc .construct { margin: 0; display: grid; gap: 10px; min-width: 0; }
.calc .construct svg { display: block; width: 100%; height: auto; overflow: visible; }
.calc .construct figcaption { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.calc .construct figcaption > span { white-space: nowrap; }
.calc .construct .key { display: inline-block; width: 12px; height: 12px; background: var(--c); vertical-align: -1px; }
.calc .construct svg.key { width: 19px; height: 12px; background: none; }
.calc .construct .key.lv { width: 8px; height: 8px; border-radius: 50%; margin: 0 2px; }
.calc .scale { font: 600 1.15rem/1.3 var(--display); color: var(--fg); min-height: 1.3em; }
/* calculator demo: a hand drags each slider once so visitors see they can */
.calc { position: relative; }
.demo-hand { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -5px 0 0 -17px; pointer-events: none; opacity: 0; transition: opacity .35s; z-index: 2; }
.demo-hand.on { opacity: 1; }
.demo-hand svg { display: block; width: 40px; height: 40px; transform-origin: 17px 5px; transition: transform .15s, opacity .2s; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); }
.demo-hand.down svg { transform: scale(.86); }
.calc .try.glow { animation: demo-glow 1.6s ease-out; }
@keyframes demo-glow { 35% { color: var(--forge); text-shadow: 0 0 14px rgba(255, 127, 42, .6); } }
.calc .out { transform-origin: left center; }
.calc .out.pulse { animation: demo-pulse 1s ease-out; }
@keyframes demo-pulse { 30% { transform: scale(1.05); color: var(--forge); text-shadow: 0 0 28px rgba(255, 127, 42, .45); } }
.calc .drag-hint { display: none; }
.calc.still .drag-hint { display: inline; }

.team-groups { display: grid; gap: 40px; }
.team-groups .label { margin-bottom: 14px; }

/* Home: the main logo leads, large; the header logo appears once it has scrolled away */
.hero-logo { display: block; width: auto; height: clamp(110px, 15vw, 210px); max-width: 100%; margin-bottom: clamp(40px, 5.5vw, 80px); }
.bar .logo { transition: opacity .3s; }
.bar.hide-logo .logo { opacity: 0; pointer-events: none; }
.hero h1 { margin-top: 0; }
/* GlycoForge logo: larger on its page, and on the Home teaser */
.forge-plate { padding: clamp(14px, 1.6vw, 22px) clamp(18px, 2vw, 28px); }
.forge-plate img { height: clamp(64px, 6vw, 84px); }
/* wordmark matched to the Home logo: GlycoForge image height = 1.0725 x main logo height */
.gf-hero .forge-plate { max-width: 100%; box-sizing: border-box; }
.gf-hero .forge-plate img { width: clamp(337px, 45.97vw, 643px); max-width: 100%; height: auto; } /* = 118–225px tall; shrinks to fit its column */
.gf-hero .forge-plate { margin-bottom: clamp(18px, 3.3vw, 58px); } /* + the 22px stack gap = the Home logo's space */

/* Home hero, single-headline variant (switcher N, O): the subheading takes the headline's place. */
.hero.solo h1 { font-size: clamp(2rem, 3.8vw, 3.5rem); line-height: 1.02; letter-spacing: -0.022em; max-width: 21ch; }
.hero.solo .sub { display: none; }

/* Preview font switcher: light per-font tuning so each candidate is seen at its best. */
.xbar .fname { text-transform: none; color: var(--muted); }
[data-font="H"] h1, [data-font="H"] h2, [data-font="H"] h3, [data-font="E"] h1, [data-font="E"] h2, [data-font="E"] h3 { letter-spacing: -0.035em; }
.insts a { color: inherit; text-decoration: none; }
.insts a:hover, .insts a:focus-visible { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .18em; }

/* Section link icon: faint until the heading is hovered or the icon is focused */
.h-link { position: relative; display: inline-flex; vertical-align: middle; margin-left: .35em; padding: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.h-link svg { width: .55em; height: .55em; min-width: 16px; min-height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
h2:hover .h-link, h3:hover .h-link, .h-link:focus-visible, .h-link.copied { opacity: 1; }
.h-link:hover { color: var(--blue-text); }
.h-done { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 6px; white-space: nowrap; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .08em; color: var(--blue-text); }
@media (hover: none) { .h-link { display: none; } }
