:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-sunken: #eef1f8;
  --text: #12182b;
  --text-dim: #5b6474;
  --text-faint: #97a0af;
  --navy: #2e2d62;
  --navy-soft: #3d3c7a;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --line: rgba(18, 24, 43, 0.09);
  --amber: #b45309;
  --amber-bg: #fef3e2;
  --icon-data: #e34321;
  --icon-ml: #b02090;
  --icon-core: #1e5df8;
  --icon-agent: #0f9488;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  letter-spacing: -0.015em;
  margin: 0;
  font-weight: 600;
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */
.nav {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: none;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #ffffff;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.08); }

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navlinks {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
}

.navlinks a { transition: color .15s ease; }
.navlinks a:hover, .navlinks a.active { color: #ffffff; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  cursor: default;
  transition: color .15s ease;
}

.nav-trigger .chevron {
  font-size: 0.6em;
  margin-left: 3px;
  opacity: 0.6;
  transition: transform .15s ease;
}

.nav-item:hover .nav-trigger,
.nav-trigger.active {
  color: #ffffff;
}

.nav-item:hover .nav-trigger .chevron {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
  z-index: 20;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
}

.dropdown-inner {
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: var(--navy-soft);
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-inner a {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.dropdown-inner a:hover,
.dropdown-inner a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@media (max-width: 900px) {
  .nav .wrap { padding: 0 20px; }
  .nav-toggle { display: flex; }

  .navlinks {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 32px -20px rgba(0, 0, 0, 0.5);
    padding: 8px 16px 18px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height .25s ease;
  }

  .navlinks.open {
    max-height: 480px;
    visibility: visible;
  }

  .navlinks > a {
    padding: 12px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-item { flex-direction: column; align-items: stretch; }
  .nav-trigger {
    padding: 12px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-between;
  }

  .dropdown {
    position: static;
    transform: none;
    padding-top: 0;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .nav-item .dropdown { display: none; }
  .nav-item.open .dropdown { display: block; }
  .nav-item.open .nav-trigger .chevron { transform: rotate(180deg); }

  .dropdown-inner {
    background: transparent;
    box-shadow: none;
    padding: 0 0 4px 12px;
  }

  .dropdown-inner a { color: rgba(255, 255, 255, 0.6); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: clamp(36px, 5vw, 64px) 0 clamp(28px, 3.5vw, 40px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -25%;
  background-image: url('assets/logo-splash.png');
  background-size: 150% auto;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(80px) saturate(1.25);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: splash-flow 24s ease-in-out infinite;
}

@keyframes splash-flow {
  0%   { transform: translate(0%, 0%) scale(1) rotate(0deg); filter: blur(80px) saturate(1.25) hue-rotate(0deg); }
  33%  { transform: translate(-3%, 2%) scale(1.08) rotate(3deg); filter: blur(80px) saturate(1.4) hue-rotate(10deg); }
  66%  { transform: translate(2%, -3%) scale(1.05) rotate(-3deg); filter: blur(80px) saturate(1.3) hue-rotate(-8deg); }
  100% { transform: translate(0%, 0%) scale(1) rotate(0deg); filter: blur(80px) saturate(1.25) hue-rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.62);
  z-index: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.hero-inner > * { max-width: 100%; margin-bottom: 0; }

.hero-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 22px;
}

.hero-mark {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 10px 24px -12px rgba(18, 24, 43, 0.35);
}

.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  color: var(--text);
}

.hero-subtitle {
  margin-top: 8px;
  color: var(--blue);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
}

.hero-breakdown-wrap {
  position: relative;
  z-index: 1;
  margin-top: 44px;
}

.hero-breakdown {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 40px;
  text-align: left;
  width: 100%;
}

.breakdown-item h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.breakdown-item p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.hero .cta-note {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
}

.hero .cta-notice {
  margin-top: 20px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  max-width: 600px;
}

.hero .cta-notice strong { color: var(--text); font-weight: 600; }

/* ---------- trust bar ---------- */
.trust-bar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 28px 0;
}

.trust-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 28px;
}

.trust-label {
  font-size: 0.82rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.trust-logo-plain { display: inline-flex; align-items: center; }
.trust-logo-plain img { height: 48px; width: auto; display: block; }
/* scd-logo.png devotes a much smaller share of its frame to the UKRI mark than
   alc-logo.svg or epsrc-logo.png do, so it needs a taller box for the mark to
   read at the same size as the other two; its mark also sits higher within
   that frame, so nudge it down to land on the same line as the other marks. */
.trust-logo-scd img { height: 86px; transform: translateY(8px); }
/* alc-logo.svg bundles a second "Ada Lovelace Centre" text row under the UKRI mark,
   so its mark sits at a smaller share of the image height than epsrc-logo.png's —
   sized up so the UKRI lettering reads at the same size in both. */
.trust-logo-alc img { height: 66px; margin-top: 10px; }
/* epsrc-logo.png's mark sits lower within its own frame than alc-logo.svg's does;
   nudge it up so the two UKRI marks line up horizontally. */
.trust-logo-epsrc img { transform: translateY(-6px); }

.trust-sep {
  color: var(--text-faint);
  opacity: 0.6;
}

/* ---------- ecosystem section ---------- */
.ecosystem {
  padding: clamp(28px, 4vw, 44px) 0 clamp(48px, 7vw, 80px);
  background: var(--bg-soft);
}

.section-head {
  max-width: 620px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-head .kicker {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--text);
}

.section-head p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.5;
}

.eco-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.eco-card {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-width: 0;
}

.eco-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px -22px rgba(18, 24, 43, 0.22);
  border-color: transparent;
}

.eco-card .icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 14px;
}

.icon-data { background: rgba(227, 67, 33, 0.12); color: var(--icon-data); }
.icon-ml { background: rgba(176, 32, 144, 0.12); color: var(--icon-ml); }
.icon-core { background: rgba(30, 93, 248, 0.12); color: var(--icon-core); }
.icon-agent { background: rgba(15, 148, 136, 0.12); color: var(--icon-agent); }

.eco-card .kicker {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.eco-card h3 {
  font-size: 1.15rem;
  color: var(--text);
}

.eco-card p.tagline {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.45;
}

.eco-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.84rem;
}

.eco-card .links a { color: var(--blue); }
.eco-card .links a:hover { text-decoration: underline; }
.eco-card .links a.muted { color: var(--text-faint); pointer-events: none; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary { background: var(--blue); color: #ffffff; }
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-secondary:hover { background: #ececee; }

.btn.disabled { opacity: 0.5; pointer-events: none; }

.btn-track {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.02em;
}

.btn-tonal {
  background: #e3efff;
  border: 1px solid rgba(0, 113, 227, 0.25);
  color: #0058b3;
}
.btn-tonal:hover { background: #d6e7ff; }
.btn-tonal .btn-track { background: rgba(0, 113, 227, 0.12); color: #0058b3; }

.btn-secondary .btn-track { background: rgba(18, 24, 43, 0.08); color: var(--text-dim); }

.link-more {
  color: var(--blue);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-more:hover { text-decoration: underline; }

/* ---------- sub page hero (core / agent) ---------- */
.sub-hero {
  border-bottom: 1px solid var(--line);
}

.sub-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: clamp(48px, 8vw, 88px) 0;
}

.sub-left .tag {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-weight: 600;
}

.sub-left h1 {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  color: var(--text);
  line-height: 1.1;
}

.sub-left p {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 440px;
}

.sub-left .btn { margin-top: 26px; }

.sub-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.sub-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* core: app preview mock + feature list */
.app-mock {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 24px 48px -32px rgba(18, 24, 43, 0.25);
}

.app-mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.app-mock-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.app-mock-body {
  padding: 22px;
  display: flex;
  gap: 16px;
}

.app-mock-panel {
  flex: 0 0 34%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-mock-panel span {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: var(--bg-sunken);
}
.app-mock-panel span:nth-child(1) { width: 70%; }
.app-mock-panel span:nth-child(2) { width: 90%; }
.app-mock-panel span:nth-child(3) { width: 55%; }
.app-mock-panel span:nth-child(4) { width: 80%; }

.app-mock-canvas {
  flex: 1;
  border-radius: var(--radius-sm);
  background: linear-gradient(155deg, var(--bg-sunken), var(--bg-soft));
  min-height: 120px;
  position: relative;
}

.app-mock-canvas::after {
  content: "Structure preview";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.feature-list { display: flex; flex-direction: column; gap: 18px; }
.feature-list .feature {
  display: flex;
  gap: 12px;
}
.feature-list .feature .bullet {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--icon-core);
}
.feature-list .feature h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 3px;
  font-weight: 600;
}
.feature-list .feature p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.45;
}




/* ---------- about modal ---------- */
.about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 24, 43, 0.55);
  z-index: 100;
}

.about-overlay.open { display: flex; }

.about-modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 84vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.about-close:hover { background: #ececee; color: var(--text); }

.about-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.about-modal h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 14px;
}

.about-modal h3 {
  font-size: 1rem;
  color: var(--text);
  margin-top: 22px;
  margin-bottom: 8px;
}

.about-modal p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.about-modal ul {
  margin: 0;
  padding-left: 18px;
}
.about-modal ul li {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 6px;
}

.contact-modal { max-width: 720px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.contact-card img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
}

.contact-card h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.contact-card .role {
  font-size: 0.76rem;
  color: var(--text-faint);
}

.contact-card a {
  font-size: 0.76rem;
  color: var(--blue);
  word-break: break-all;
}
.contact-card a:hover { text-decoration: underline; }

.contact-card h4 a {
  font-size: inherit;
  color: var(--blue);
  word-break: normal;
}
.contact-card h4 a::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.2em;
  font-weight: 400;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .eco-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-breakdown { grid-template-columns: repeat(2, 1fr); max-width: 520px; margin-left: auto; margin-right: auto; }
  .sub-hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .sub-left p { max-width: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .eco-grid { grid-template-columns: 1fr; }
  .hero-breakdown { grid-template-columns: 1fr; max-width: 380px; }
  .hero-cta { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-cta .btn { justify-content: center; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .about-modal { padding: 32px 24px; }
  .trust-inner { flex-direction: column; gap: 16px; }
  .trust-sep { display: none; }
}
