/* Design tokens: every colour, font and curve the site uses. */
:root {
  --navy: #10164f;
  --blue: #1f35e0;
  --blue-deep: #1426a8;
  --blue-ink: #0b1470;
  --lime: #d7ff3f;
  --lime-deep: #9dbf1f;
  --paper: #efede8;
  --card: #f6f4ee;
  --white: #ffffff;
  --ink: #111318;
  --ink-soft: #23262e;
  --stone: #c9c6bd;
  --muted: #4a4f7a;
  --screen: #0a0d08;
  --screen-dot: #1b2412;
  --green: #2fbf4a;

  --font-display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --font-text: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --wrap: 1280px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.2, 1.6, 0.4, 1);
}

.tone-lime { --tone-bg: var(--lime); --tone-fg: var(--navy); --tone-shadow: var(--lime-deep); }
.tone-white { --tone-bg: var(--white); --tone-fg: var(--navy); --tone-shadow: var(--stone); }
.tone-ink { --tone-bg: var(--ink-soft); --tone-fg: var(--white); --tone-shadow: #0b0c10; }
.tone-blue { --tone-bg: var(--blue); --tone-fg: var(--white); --tone-shadow: var(--blue-deep); }

/* Reset, page frame, type and the small shared pieces. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 24px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-top: 72px; display: flex; flex-direction: column; gap: 28px; }
.section:last-of-type { padding-bottom: 80px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 12px 18px; border-radius: 12px; background: var(--navy); color: var(--white); font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--white); }

.display-1, .display-2, .brand, .key__name, .cartridge h3, .capability h3, .button-key {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
}
.display-1 { font-size: clamp(40px, 7.4vw, 96px); line-height: 0.92; letter-spacing: -0.03em; text-wrap: balance; }
.display-2 { font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -0.03em; }
.kicker { font-family: var(--font-text); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }
.lede { font-size: clamp(19px, 2vw, 25px); line-height: 1.3; font-weight: 500; text-wrap: pretty; }
.section-heading { display: flex; flex-direction: column; gap: 8px; }

/* Text drawn as a grid of LED dots. */
.dot-text {
  --dot: 10px;
  --dot-color: var(--lime);
  color: var(--dot-color);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .dot-text {
    color: transparent;
    background-image: radial-gradient(circle at center, var(--dot-color) 0 38%, transparent 42%);
    background-size: var(--dot) var(--dot);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

.site-header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -0.02em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--white); font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.pill-link:hover { background: var(--navy); color: var(--white); }

.site-footer { padding-top: 40px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 14px; }
.site-footer__domain { --dot: 8px; --dot-color: var(--blue); font-size: clamp(40px, 11.6vw, 150px); line-height: 0.95; letter-spacing: -0.04em; text-transform: none; }
.site-footer__line {
  display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between;
  border-top: 2px solid var(--navy); padding-top: 14px;
  font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
}

.button-key {
  display: inline-flex; align-items: center; min-height: 60px; padding: 0 30px;
  border-radius: 18px; background: var(--lime); color: var(--navy); font-size: 18px;
  box-shadow: 0 10px 0 var(--lime-deep);
  transition: translate 0.12s, box-shadow 0.12s;
}
.button-key:hover { color: var(--navy); translate: 0 6px; box-shadow: 0 4px 0 var(--lime-deep); }
.button-key:active { translate: 0 10px; box-shadow: 0 0 0 var(--lime-deep); }

.led { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.led--lime { background: var(--lime); }
.led--white { background: var(--white); }
.led--green { width: 12px; height: 12px; background: var(--green); box-shadow: 0 0 0 3px #cfefd5; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px 0 6px;
  border-radius: 999px; background: var(--white); font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 10px rgba(16, 22, 79, 0.12), inset 0 -3px 0 rgba(16, 22, 79, 0.08);
  transition: rotate 0.2s, translate 0.2s;
}
.chip:hover { rotate: -3deg; translate: 0 -4px; }
.chip--plain { padding-left: 16px; }
.chip__cap {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background-image: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.75) 0 12%, transparent 30%);
}
.chip--local .chip__cap { background-color: var(--lime); }
.chip--cloud .chip__cap { background-color: var(--blue); }

.not-found { padding-block: 64px 96px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

/* The flask-bot. Override --m-line, --m-glass or --m-liquid to recolour it. */
.mascot { flex: none; overflow: visible; }
.m-line { fill: var(--m-line, var(--navy)); }
.m-glass { fill: var(--m-glass, var(--white)); }
.m-liquid { fill: var(--m-liquid, var(--lime)); }
.m-outline { fill: none; stroke: var(--m-line, var(--navy)); stroke-width: 8; stroke-linejoin: round; }
.m-feather { fill: var(--m-glass, var(--white)); stroke: var(--m-line, var(--navy)); stroke-width: 6; }
.m-bubble { fill: var(--m-liquid, var(--lime)); stroke: var(--m-line, var(--navy)); stroke-width: 3; }
.m-smile { fill: none; stroke: var(--m-line, var(--navy)); stroke-width: 5; stroke-linecap: round; }
.m-leg { stroke: var(--m-line, var(--navy)); stroke-width: 8; stroke-linecap: round; }
.m-crate { fill: var(--m-liquid, var(--lime)); stroke: var(--m-line, var(--navy)); stroke-width: 7; }
.m-rib { stroke: var(--m-line, var(--navy)); stroke-width: 4; stroke-linecap: round; }
.m-eye, .m-wing { transform-box: fill-box; }
.m-eye { transform-origin: center; }
.m-wing--left { transform-origin: 100% 60%; }
.m-wing--right { transform-origin: 0% 60%; }

/* The hero console. */
.console {
  border-radius: 36px; background: var(--blue); color: var(--white);
  padding: clamp(18px, 2.6vw, 32px);
  display: flex; flex-direction: column; gap: 22px;
  box-shadow: 0 14px 0 var(--blue-deep), 0 34px 50px rgba(16, 22, 79, 0.28);
}
.console__top {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.console__leds { display: inline-flex; gap: 8px; align-items: center; }
.console__body { display: flex; flex-wrap: wrap; gap: 22px; align-items: stretch; }
.console__bottom { display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: center; justify-content: space-between; }
.console__bottom .lede { flex: 1 1 380px; max-width: 640px; }

.screen {
  --mx: 50%; --my: 40%;
  flex: 3 1 520px; min-width: 0; min-height: 340px;
  border-radius: 24px; overflow: hidden;
  padding: clamp(18px, 3vw, 36px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  background-color: var(--screen);
  background-image:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(215, 255, 63, 0.16), transparent 70%),
    radial-gradient(circle at center, var(--screen-dot) 0 38%, transparent 42%);
  background-size: auto, 10px 10px;
  box-shadow: inset 0 0 0 4px var(--blue-ink), inset 0 0 40px rgba(215, 255, 63, 0.12);
}
.screen__title {
  --dot: clamp(6px, 0.75vw, 10px);
  font-size: clamp(64px, 14.5vw, 196px); line-height: 0.86; letter-spacing: -0.03em;
  filter: drop-shadow(0 0 10px rgba(215, 255, 63, 0.55));
}

.readouts { display: flex; flex-wrap: wrap; gap: 12px 36px; color: var(--lime); }
.readout { display: flex; flex-direction: column-reverse; gap: 2px; }
.readout dt { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.readout dd { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 44px); line-height: 1; font-variant-numeric: tabular-nums; }

.ticker { overflow: hidden; white-space: nowrap; color: var(--lime); font-weight: 700; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; }
.ticker__track { display: inline-flex; }
.ticker__group { display: inline-flex; gap: 28px; padding-right: 28px; }

.console__side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: space-between; }
.porthole {
  width: 100%; max-width: 280px; aspect-ratio: 1; border-radius: 50%;
  background: var(--lime);
  box-shadow: inset 0 0 0 10px var(--blue-ink), inset 0 12px 0 10px rgba(16, 22, 79, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.knobs { display: flex; gap: 18px; align-items: center; }
.knob { display: flex; justify-content: center; border-radius: 50%; box-shadow: 0 6px 0 var(--blue-ink); transition: rotate 0.5s var(--ease); }
.knob::before { content: ''; border-radius: 3px; background: var(--navy); }
.knob--large { width: 64px; height: 64px; background: var(--card); }
.knob--large::before { width: 6px; height: 20px; margin-top: 6px; }
.knob--small { width: 44px; height: 44px; background: var(--lime); }
.knob--small::before { width: 5px; height: 14px; margin-top: 5px; }
.console:hover .knob--large { rotate: 140deg; }
.console:hover .knob--small { rotate: -90deg; }

/* Experiments: project keys. */
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 26px 16px; }
.keys--single { grid-template-columns: minmax(0, 420px); }
.key {
  display: flex; flex-direction: column; gap: 14px; min-height: 270px; padding: 22px;
  border-radius: 22px; background: var(--tone-bg); color: var(--tone-fg);
  box-shadow: 0 10px 0 var(--tone-shadow);
  transition: translate 0.12s, box-shadow 0.12s;
}
.key:hover { color: var(--tone-fg); translate: 0 6px; box-shadow: 0 4px 0 var(--tone-shadow); }
.key:active { translate: 0 10px; box-shadow: 0 0 0 var(--tone-shadow); }
.key__top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }
.key__dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }
.key__name { font-size: 22px; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: break-word; }
.key__summary { font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.key__open { margin-top: auto; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Equipment: the rack of machine cartridges. */
.rack {
  border-radius: 28px; background: var(--ink);
  padding: 34px clamp(16px, 2.4vw, 28px) clamp(16px, 2.4vw, 28px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px;
  box-shadow: 0 12px 0 #000;
}
.cartridge {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--card); color: var(--navy);
  transition: translate 0.25s var(--spring);
}
.cartridge:hover { translate: 0 -14px; }
.cartridge__grip { height: 18px; background: repeating-linear-gradient(90deg, #d9d6cc 0 6px, var(--card) 6px 12px); }
.cartridge__body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; flex-grow: 1; }
.cartridge__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cartridge h3 { font-size: 24px; line-height: 1; letter-spacing: -0.02em; }
.spec-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.cartridge__role { padding: 12px 20px; background: var(--blue); color: var(--white); font-weight: 700; font-size: 14px; }

/* Reagents: capability board and runtime switches. */
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 700; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend__dot { width: 16px; height: 16px; border-radius: 50%; }
.legend__dot--local { background: var(--lime); box-shadow: inset 0 0 0 2px var(--navy); }
.legend__dot--cloud { background: var(--blue); }
.capabilities { display: flex; flex-direction: column; border-bottom: 2px solid var(--navy); }
.capability { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; padding: 18px 0; border-top: 2px solid var(--navy); }
.capability h3 { flex: 0 0 200px; font-size: 20px; line-height: 1.1; letter-spacing: -0.01em; }
.capability .chips { flex: 1 1 480px; min-width: 0; }
.runtimes-title { margin-top: 24px; }
.switches { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.switch {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0;
  border: 0; background: none; color: var(--navy); font: inherit; font-weight: 700; cursor: pointer;
}
.switch__track { position: relative; width: 64px; height: 36px; border-radius: 999px; background: #8e8a80; transition: background 0.2s; }
.switch__thumb {
  position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--white); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: translate 0.2s var(--spring);
}
.switch[aria-pressed='true'] .switch__track { background: var(--blue); }
.switch[aria-pressed='true'] .switch__thumb { translate: 28px 0; }

/* A single experiment page. */
.project { display: flex; flex-direction: column; gap: 56px; padding-bottom: 80px; }
.project__hero {
  border-radius: 36px; background: var(--tone-bg); color: var(--tone-fg);
  padding: clamp(22px, 4vw, 56px);
  display: flex; flex-direction: column; gap: 24px;
  box-shadow: 0 14px 0 var(--tone-shadow), 0 34px 50px rgba(16, 22, 79, 0.2);
}
.project__hero a:hover { color: inherit; text-decoration: underline; }
.project__crumbs { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.project__crumbs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.project__hero .lede { max-width: 760px; }
.status { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.project__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 40px 56px; align-items: start; }
.project__what { display: flex; flex-direction: column; gap: 16px; }
.what-list { display: flex; flex-direction: column; border-bottom: 2px solid var(--navy); }
.what-list li { padding: 16px 0; border-top: 2px solid var(--navy); font-size: 18px; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.note { font-size: 14px; color: var(--muted); }
.runs-on { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 22px; background: var(--white); }
.runs-on__machines { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-display); font-size: 22px; text-transform: uppercase; letter-spacing: -0.02em; }
.runs-on__machines a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.runs-on .chip { background: var(--paper); box-shadow: none; }
.project__next { display: flex; flex-direction: column; gap: 16px; }

/* All movement lives here, and all of it switches off for reduced motion. */
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes blink { 0%, 91%, 100% { scale: 1 1; } 95% { scale: 1 0.1; } }
@keyframes flap-left { 0%, 100% { rotate: 0deg; } 50% { rotate: 12deg; } }
@keyframes flap-right { 0%, 100% { rotate: 0deg; } 50% { rotate: -12deg; } }
@keyframes rise { from { translate: 0 0; opacity: 1; } to { translate: 0 -34px; opacity: 0; } }
@keyframes led-pulse { 0%, 60%, 100% { opacity: 1; } 70%, 90% { opacity: 0.25; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes boot { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes reveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes page-out { to { opacity: 0.5; } }

@media (prefers-reduced-motion: no-preference) {
  .mascot--bob { animation: bob 3s ease-in-out infinite; }
  .m-eye { animation: blink 4.2s infinite; }
  .m-wing--left { animation: flap-left 1.1s ease-in-out infinite; }
  .m-wing--right { animation: flap-right 1.1s ease-in-out infinite; }
  .m-bubble { animation: rise 2.4s ease-in infinite; }
  .m-bubble--late { animation-delay: 1.1s; }
  .led { animation: led-pulse 2.2s infinite; }
  .led--b { animation-delay: 0.5s; }
  .led--c { animation-delay: 1.1s; }
  .ticker__track { animation: ticker 22s linear infinite; }
  .ticker:hover .ticker__track { animation-play-state: paused; }
  .screen__title { animation: boot 1.1s steps(14) both; }

  /* Sections ease in as they scroll into view, where the browser supports it. */
  @supports (animation-timeline: view()) {
    [data-reveal] {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  /* Page-to-page wipe, where the browser supports cross-page transitions. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: page-out 0.25s var(--ease) both; }
  ::view-transition-new(root) { animation: page-in 0.45s var(--ease) both; }
}

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