/* MGML Research Institute — site styles
   Dark, high-contrast theme. Text tokens are checked for WCAG AA on every surface. */

/* ---------- Tokens ---------- */
:root {
  --bg: #050c17;
  --bg-2: #081322;
  --panel: #0b192c;
  --panel-2: #0f2139;
  --line: rgba(140, 178, 224, .14);
  --line-2: rgba(140, 178, 224, .26);
  --text: #eaf1fa;
  --text-2: #b6c5d8;      /* body copy on dark surfaces */
  --text-3: #92a7c1;      /* labels: >= 4.5:1 on --panel-2 */
  --accent: #52c5ff;
  --accent-2: #2f8cff;
  --gold: #e3ad45;
  --display: 'Space Grotesk', 'Inter', Arial, sans-serif;
  --sans: 'Inter', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --content: 1240px;
  --pad: 40px;
  --header: 76px;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

sub,
sup {
  font-size: .72em;
}

::selection {
  background: rgba(82, 197, 255, .35);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #001224;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Shared label style */
.label,
.kicker,
.block-num,
.step-num,
.card-num,
.img-note,
.breadcrumb,
.chip,
.footer-legal,
.stat-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--accent);
}

.kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
}

h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

h3 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

p {
  margin: 0 0 14px;
}

.grad {
  background: linear-gradient(100deg, #ffffff 0%, #9fdcff 45%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid transparent;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #021529;
  box-shadow: 0 8px 30px rgba(47, 140, 255, .28);
}

.btn-primary:hover {
  box-shadow: 0 10px 40px rgba(82, 197, 255, .45);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: rgba(12, 27, 46, .5);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn span[aria-hidden] {
  font-family: var(--sans);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  background: rgba(5, 12, 23, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  height: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-crest {
  display: block;
  width: 40px;
  height: auto;
  filter: drop-shadow(0 0 1px rgba(235, 242, 250, .9)) drop-shadow(0 0 10px rgba(82, 197, 255, .25));
}

.brand-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.1;
}

.brand-name span {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-2);
}

.primary-nav a {
  transition: color .2s;
}

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

.nav-group {
  position: relative;
}

.nav-group > a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 18px);
  left: -24px;
  display: none;
  width: 380px;
  padding: 10px;
  background: rgba(9, 21, 37, .97);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  display: grid;
}

.nav-dropdown a {
  display: flex;
  gap: 14px;
  padding: 10px 12px;
  color: var(--text-2);
}

.nav-dropdown a:hover {
  background: rgba(82, 197, 255, .08);
  color: var(--text);
}

.nav-dropdown a span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 2px;
}

.nav-cta {
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
}

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  min-height: clamp(640px, calc(100vh - var(--header)), 900px);
  min-height: clamp(640px, calc(100svh - var(--header)), 900px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(5, 12, 23, .96) 0%, rgba(5, 12, 23, .86) 38%, rgba(5, 12, 23, .35) 70%, rgba(5, 12, 23, .2) 100%),
    linear-gradient(0deg, rgba(5, 12, 23, .95) 0%, transparent 30%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: .5;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 22% 55%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 22% 55%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 90px var(--pad) 150px;
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(44px, 6.4vw, 86px);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 0 0 26px;
}

.hero-lead {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-stats {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(5, 12, 23, .6);
  backdrop-filter: blur(8px);
}

.hero-stats .wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  padding: 22px 24px 22px 0;
}

.stat + .stat {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.stat-value {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--text-3);
  letter-spacing: .08em;
}

.hero .img-note {
  position: absolute;
  z-index: 3;
  right: var(--pad);
  bottom: 104px;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: 110px 0;
  border-bottom: 1px solid var(--line);
}

.section-grid {
  background-image: linear-gradient(rgba(120, 165, 220, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 165, 220, .045) 1px, transparent 1px);
  background-size: 64px 64px;
}

.section-alt {
  background: var(--bg-2);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 56px;
}

.section-head h2 {
  margin-top: 4px;
}

.section-head > p {
  color: var(--text-2);
  font-size: 17px;
  margin: 0;
}

.img-note {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .1em;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 70px;
  align-items: start;
}

.about-text p {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.8;
}

.about-text p:first-child {
  color: var(--text);
  font-size: 21px;
  line-height: 1.6;
}

.panel {
  position: relative;
  padding: 30px;
  background: linear-gradient(160deg, rgba(15, 33, 57, .95), rgba(11, 25, 44, .95));
  border: 1px solid var(--line-2);
}

.panel::before,
.panel::after,
.frame::before,
.frame::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
}

.panel::before,
.frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.panel::after,
.frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

.panel h3 {
  margin: 10px 0 18px;
}

.milestones {
  list-style: none;
  margin: 0;
  padding: 0;
}

.milestones li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
}

.milestones li::before {
  content: '';
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(227, 173, 69, .7);
}

.milestones strong {
  color: var(--text);
  font-weight: 600;
}

/* Programme cards */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.programme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}

.programme-card:hover {
  transform: translateY(-4px);
  border-color: rgba(82, 197, 255, .55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(82, 197, 255, .15);
}

.programme-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a1626;
}

.programme-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s;
}

.programme-card:hover .programme-media img {
  transform: scale(1.05);
}

.programme-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11, 25, 44, .9) 0%, transparent 55%);
}

.card-num {
  position: absolute;
  z-index: 1;
  left: 18px;
  bottom: 14px;
  color: var(--accent);
}

.programme-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 22px 20px;
}

.programme-body h3 {
  margin-bottom: 10px;
}

.programme-body p {
  flex: 1;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.card-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.programme-card > a.stretched::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Pipeline */
.pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--steps, 5), 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.pipeline::before {
  content: '';
  position: absolute;
  top: 23px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, rgba(47, 140, 255, .2));
}

.pipeline::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dff5ff;
  box-shadow: 0 0 14px 4px rgba(82, 197, 255, .8);
  animation: travel 6s linear infinite;
}

@keyframes travel {
  from {
    left: 24px;
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  to {
    left: calc(100% - 30px);
    opacity: 0;
  }
}

.pipeline li {
  position: relative;
  min-width: 0;
}

.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  letter-spacing: 0;
  box-shadow: 0 0 20px rgba(82, 197, 255, .25);
}

.section-alt .step-num,
.section-alt .pipeline-panel .step-num {
  background: var(--bg-2);
}

.pipeline h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.pipeline p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Capabilities */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 70px;
  background: var(--line);
  border: 1px solid var(--line);
}

.capability {
  padding: 26px 22px;
  background: var(--bg);
}

.capability h3 {
  font-size: 16px;
  margin: 12px 0 8px;
}

.capability p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.cap-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.cap-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Leadership */
.leader {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 80px;
  align-items: center;
}

.frame {
  position: relative;
  border: 1px solid var(--line-2);
  background: var(--panel);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.leader-role {
  margin: 0 0 14px;
  color: var(--accent);
}

.leader h2 {
  margin-bottom: 24px;
}

.leader-bio p {
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.8;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0 26px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}

.facts div {
  padding: 18px 18px 18px 0;
}

.facts div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line-2);
}

.facts strong {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.facts span {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  background: rgba(82, 197, 255, .04);
  color: var(--text-2);
  font-size: 11px;
  letter-spacing: .08em;
}

/* Collaboration */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.collab-card {
  padding: 26px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.collab-card h3 {
  font-size: 17px;
  margin: 14px 0 10px;
}

.collab-card p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.partners {
  margin-top: 40px;
}

.partners .label {
  display: block;
  margin-bottom: 14px;
}

/* Contact / CTA */
.cta {
  position: relative;
  overflow: hidden;
  padding: 110px 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(47, 140, 255, .22), transparent 55%), radial-gradient(ellipse at 10% 90%, rgba(82, 197, 255, .12), transparent 50%), var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 70px;
  align-items: start;
}

.cta h2 {
  margin-bottom: 18px;
}

.cta-text {
  max-width: 620px;
  color: var(--text-2);
  font-size: 17px;
  margin-bottom: 30px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cta-aside .label {
  display: block;
  margin-bottom: 12px;
}

.cta-aside ul {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.cta-aside li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
}

.cta-aside li::before {
  content: '+';
  margin-right: 10px;
  color: var(--accent);
  font-family: var(--mono);
}

.email-line {
  display: inline-block;
  font-family: var(--display);
  font-size: 18px;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

/* ---------- Research pages ---------- */
.page-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.page-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(5, 12, 23, .98) 0%, rgba(5, 12, 23, .75) 40%, rgba(5, 12, 23, .25) 100%),
    linear-gradient(90deg, rgba(5, 12, 23, .8) 0%, transparent 70%);
}

.page-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 120px var(--pad) 64px;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--text-3);
}

.breadcrumb a {
  color: var(--text-2);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.page-hero h1 {
  max-width: 900px;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}

.page-hero-sub {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 500;
  color: var(--text-2);
}

.page-hero .img-note {
  position: absolute;
  z-index: 2;
  right: var(--pad);
  top: 24px;
}

.subnav {
  position: sticky;
  top: var(--header);
  z-index: 40;
  background: rgba(8, 19, 34, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.subnav .wrap {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav .wrap::-webkit-scrollbar {
  display: none;
}

.subnav a {
  flex: none;
  padding: 15px 0 13px;
  border-bottom: 2px solid transparent;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color .2s, border-color .2s;
}

.subnav a:hover,
.subnav a.is-active {
  color: var(--text);
  border-color: var(--accent);
}

.intro {
  padding: 90px 0 80px;
  border-bottom: 1px solid var(--line);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 70px;
  align-items: start;
}

.intro-text p {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.8;
}

.intro-text p:first-child {
  color: var(--text);
  font-size: 22px;
  line-height: 1.6;
}

.highlight .label {
  color: var(--gold);
}

.highlight p {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

.focus-list {
  margin-top: 4px;
}

.highlight + .focus-list {
  margin-top: 34px;
}

.focus-list h3 {
  margin: 12px 0 16px;
  font-size: 18px;
}

.block {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}

.block-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 48px;
}

.block-num {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
}

.block-head-text p {
  color: var(--text-2);
  font-size: 16.5px;
  margin: 0 0 10px;
}

.block-head-text p:last-child {
  margin-bottom: 0;
}

.r-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.r-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.r-card {
  position: relative;
  padding: 30px 28px 26px;
  background: linear-gradient(170deg, rgba(15, 33, 57, .85), rgba(11, 25, 44, .85));
  border: 1px solid var(--line);
  transition: border-color .25s;
}

.r-card:hover {
  border-color: rgba(82, 197, 255, .45);
}

.r-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

.r-card h3 {
  margin-bottom: 14px;
}

.r-card p,
.r-card li {
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.7;
}

.r-card p:last-child {
  margin-bottom: 0;
}

.ticks {
  margin: 4px 0 14px;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding: 6px 0 6px 22px;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 16px;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.ticks li::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 13px;
  width: 4px;
  height: 7px;
  border-right: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  transform: rotate(45deg);
}

.r-sub {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.r-sub h4 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.r-sub p {
  margin: 0;
  font-size: 15px;
}

/* Rows layout */
.rows {
  border-top: 1px solid var(--line-2);
}

.row {
  display: grid;
  grid-template-columns: 70px .9fr 1.3fr;
  gap: 30px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.row-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  padding-top: 4px;
}

.row h3 {
  font-size: 19px;
}

.row-text p,
.row-text li {
  color: var(--text-2);
  font-size: 15.5px;
}

.row-text p:last-child {
  margin-bottom: 0;
}

/* Mechanism cards */
.mech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
}

.mech {
  padding: 30px 26px;
  background: var(--bg-2);
}

.mech h3 {
  font-size: 18px;
  margin: 14px 0 12px;
}

.mech p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}

.mech p:last-child {
  margin-bottom: 0;
}

.formula {
  display: inline-block;
  margin: 2px 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(82, 197, 255, .35);
  background: rgba(82, 197, 255, .06);
  font-family: var(--mono);
  font-size: 14px;
  color: #cdeeff;
}

.m {
  font-family: var(--mono);
  font-size: .92em;
  color: #cdeeff;
}

/* Element tiles */
.element-groups {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
}

.element-groups h3 {
  margin-bottom: 16px;
  font-size: 16px;
}

.elements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.el {
  position: relative;
  width: 84px;
  height: 80px;
  padding: 8px;
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(15, 33, 57, .9), rgba(8, 19, 34, .9));
  transition: border-color .2s, box-shadow .2s;
}

.el:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(82, 197, 255, .25);
}

.el-z {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.el-sym {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.el-name {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}

.el.precious .el-sym {
  color: var(--gold);
}

.el.strategic .el-sym {
  color: var(--accent);
}

/* Feature figure */
.feature {
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.feature figure {
  position: relative;
  margin: 0;
}

.feature img {
  display: block;
  width: 100%;
  height: clamp(280px, 42vw, 560px);
  object-fit: cover;
}

.feature figcaption {
  position: absolute;
  left: var(--pad);
  bottom: 22px;
  max-width: 560px;
  padding: 10px 14px;
  background: rgba(5, 12, 23, .78);
  backdrop-filter: blur(6px);
  border-left: 2px solid var(--accent);
  color: var(--text-2);
  font-size: 14px;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.duo img {
  height: clamp(220px, 28vw, 420px);
}

/* Pipeline & criteria panel on research pages */
.pipeline-panel {
  margin-bottom: 50px;
}

.criteria {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.criteria li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
}

.criteria li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(82, 197, 255, .6);
}

.criteria-title {
  margin: 0 0 18px;
  font-size: 18px;
}

.after-note {
  margin-top: 28px;
  max-width: 860px;
  color: var(--text-2);
}

/* Applications */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.app-card {
  padding: 24px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-2);
}

.app-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.app-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
}

/* Collaboration block on research pages */
.collab-split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 60px;
}

.collab-split .label {
  display: block;
  margin-bottom: 14px;
}

.collab-split .ticks li {
  color: var(--text-2);
}

/* Pager */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.pager a {
  display: block;
  padding: 34px var(--pad);
  transition: background .2s;
}

.pager a:hover {
  background: var(--panel);
}

.pager a + a {
  text-align: right;
  border-left: 1px solid var(--line);
}

.pager .label {
  display: block;
  margin-bottom: 8px;
}

.pager strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 70px 0 30px;
  background: #030810;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr .9fr;
  gap: 50px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.footer-brand p {
  max-width: 360px;
  margin-top: 18px;
  color: var(--text-2);
  font-size: 15px;
}

.footer-col .label {
  display: block;
  margin-bottom: 14px;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  padding: 4px 0;
  font-size: 15px;
  color: var(--text-2);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
  padding-top: 24px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: none;
  line-height: 1.7;
}

.footer-legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .programme-grid,
  .collab-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .capability-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mech-grid,
  .r-grid.cols-3,
  .app-grid,
  .criteria {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 36px;
  }

  .pipeline::before,
  .pipeline::after {
    display: none;
  }
}

@media (max-width: 920px) {
  :root {
    --pad: 24px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 6px;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text);
    transition: transform .2s;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--header));
    overflow-y: auto;
    padding: 8px var(--pad) 24px;
    background: rgba(5, 12, 23, .98);
    border-bottom: 1px solid var(--line-2);
    font-size: 16px;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav > a,
  .nav-group > a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group > a::after {
    display: none;
  }

  .nav-dropdown {
    position: static;
    display: grid;
    width: auto;
    padding: 4px 0 8px;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav-dropdown::before {
    display: none;
  }

  .nav-dropdown a {
    padding: 9px 0 9px 4px;
    font-size: 15px;
  }

  .nav-cta {
    margin-top: 16px;
    text-align: center;
  }

  .section-head,
  .block-head,
  .about-grid,
  .intro-grid,
  .cta-grid,
  .leader,
  .collab-split,
  .element-groups {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .leader .frame {
    max-width: 420px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .row {
    grid-template-columns: 50px 1fr;
    gap: 8px 20px;
  }

  .row-text {
    grid-column: 2;
  }

  .duo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --pad: 20px;
    --header: 66px;
  }

  body {
    font-size: 15.5px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-crest {
    width: 34px;
  }

  .hero-inner {
    padding: 64px var(--pad) 230px;
  }

  .hero-lead {
    font-size: 17px;
  }

  .hero-stats .wrap {
    grid-template-columns: 1fr;
  }

  .stat,
  .stat + .stat {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 12px 0;
    border-left: 0;
  }

  .stat + .stat {
    border-top: 1px solid var(--line);
  }

  .stat-value {
    min-width: 54px;
    font-size: 24px;
  }

  .stat-label {
    margin: 0;
  }

  .hero .img-note {
    top: 12px;
    bottom: auto;
  }

  .hero-canvas {
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 40%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 60% at 50% 40%, #000 0%, transparent 75%);
  }

  .section,
  .cta {
    padding: 76px 0;
  }

  .block {
    padding: 70px 0;
  }

  .intro {
    padding: 60px 0;
  }

  .intro-text p:first-child,
  .about-text p:first-child {
    font-size: 19px;
  }

  .page-hero {
    min-height: 470px;
  }

  .page-hero-inner {
    padding: 100px var(--pad) 44px;
  }

  .programme-grid,
  .collab-grid,
  .capability-grid,
  .mech-grid,
  .r-grid,
  .r-grid.cols-3,
  .app-grid,
  .criteria {
    grid-template-columns: 1fr;
  }

  .pipeline {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .pipeline li {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 18px;
    padding-bottom: 24px;
  }

  .pipeline li:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 48px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--accent), rgba(47, 140, 255, .2));
  }

  .step-num {
    grid-row: 1 / 3;
    margin-bottom: 0;
  }

  .pipeline h3 {
    padding-top: 12px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts div,
  .facts div + div {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 12px 0;
    border-left: 0;
  }

  .facts div + div {
    border-top: 1px solid var(--line-2);
  }

  .facts strong {
    min-width: 76px;
    font-size: 24px;
  }

  .feature figcaption {
    position: static;
    max-width: none;
    background: var(--panel);
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager a + a {
    text-align: left;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .el {
    width: calc((100% - 24px) / 4);
  }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
