/* 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;
  --red: #e5383b;

  /* Backdrop tints: pale enough for navy text to stay readable on top of them. */
  --periwinkle: #aeb8f6;
  --periwinkle-light: #cdd3fa;
  --line-soft: rgba(16, 22, 79, 0.16);
  --line-mid: rgba(16, 22, 79, 0.34);
  --edge-navy: rgba(16, 22, 79, 0.24);
  --edge-blue: rgba(31, 53, 224, 0.32);
  --edge-lime: #b6d930;
  --tint-white: rgba(255, 255, 255, 0.6);
  --tint-lime: rgba(215, 255, 63, 0.55);
  --tint-blue: rgba(31, 53, 224, 0.06);
  --tint-shine: rgba(255, 255, 255, 0.8);

  /* What the page itself is made of: its ground, the ink drawn straight onto it, its accent
     and its quiet text. Night shift (below) swaps these; cards keep their own colours. */
  --page: var(--paper);
  --page-ink: var(--navy);
  --page-accent: var(--blue);
  --page-muted: var(--muted);

  --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);
}

/* Night shift, set by the console's large knob (scripts/theme.js). */
:root[data-theme='night'] {
  color-scheme: dark;
  --page: #0a0d2e;
  --page-ink: #eef0ff;
  --page-accent: var(--periwinkle);
  --page-muted: #a3a8d6;
  --line-soft: rgba(238, 240, 255, 0.16);
  --line-mid: rgba(238, 240, 255, 0.36);
  --edge-navy: rgba(238, 240, 255, 0.28);
  --edge-blue: rgba(174, 184, 246, 0.5);
  --tint-white: rgba(255, 255, 255, 0.14);
  --tint-blue: rgba(174, 184, 246, 0.12);
}

.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(--page);
  color: var(--page-ink);
  transition: background-color 0.4s, color 0.4s;
  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(--page-accent); }
:focus-visible { outline: 3px solid var(--page-accent); 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(--page-accent); }
.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); }
/* Four links fit on one row of a phone. */
@media (max-width: 440px) {
  .site-nav { gap: 6px; }
  .pill-link { padding: 0 11px; font-size: 14px; }
}

.site-footer { padding-top: 40px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 14px; }
.site-footer__domain { --dot: 8px; --dot-color: var(--page-accent); 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(--page-ink); 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); }

/* Light surfaces keep daytime ink whatever the page around them is doing.
   A panel that holds links and labels of its own gets all the page colours back. */
.pill-link, .chip, .about, .demo__scroll, .demo__flag { color: var(--navy); }
.runs-on { --page-ink: var(--navy); --page-accent: var(--blue); --page-muted: var(--muted); color: var(--page-ink); }

/* 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; }
/* Eyebrows are drawn only on an expressive mascot, and stay hidden until a mood shows them. */
.m-brow {
  stroke: var(--m-line, var(--navy)); stroke-width: 5; stroke-linecap: round; opacity: 0;
  transform-box: fill-box; transform-origin: 50% 50%; transition: opacity 0.3s, transform 0.3s;
}
.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: 260px;
  border-radius: 24px; overflow: hidden;
  padding: clamp(18px, 2.4vw, 30px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  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(5px, 0.54vw, 7.5px);
  font-size: clamp(64px, 10.4vw, 140px); 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: 200px; 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;
  /* It is a button: hold it. No text selection or touch menu while holding. */
  padding: 0; border: 0; color: inherit; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.porthole:disabled { cursor: default; }
.porthole .mascot { width: 66%; height: auto; }
.knobs { display: flex; gap: 14px; align-items: flex-start; }
/* Each knob is a button: the knob itself, with its name underneath. */
.knob-control {
  display: grid; grid-template-rows: 70px auto; justify-items: center; align-items: center; gap: 6px;
  min-width: 72px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.knob-control:disabled { opacity: 0.5; cursor: not-allowed; }
.knob-control:not(:disabled):hover .knob { rotate: 20deg; }
.knob-control[aria-pressed='true'] .knob { rotate: 140deg; }
.console :focus-visible { outline-color: var(--white); }
/* The safety sign: hidden until this visitor has blown the flask at least once. */
.incident-sign {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 250px; padding: 8px 12px;
  border: 5px solid; border-image: repeating-linear-gradient(45deg, var(--navy) 0 8px, var(--lime) 8px 16px) 5;
  background: var(--lime); color: var(--navy);
  font-weight: 700; font-size: 11px; line-height: 1.25; letter-spacing: 0.08em; text-transform: uppercase;
}
.incident-sign[hidden] { display: none; }
.incident-sign__days { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.incident-sign small { display: block; font-size: 10px; opacity: 0.75; }
.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; }

/* On a phone the porthole and knobs share one row, so the tagline and button come sooner. */
@media (max-width: 600px) {
  .console__side { flex-direction: row; flex-wrap: wrap; }
  .incident-sign { max-width: none; }
  .porthole { width: 112px; }
}

/* Experiments: project keys. */
/* Up to three keys in a row; a shorter last row stretches to fill the width. */
.keys { --key-gap: 18px; display: flex; flex-wrap: wrap; gap: 26px var(--key-gap); }
.key {
  flex: 1 1 calc((100% - 2 * var(--key-gap)) / 3); min-width: min(300px, 100%);
  display: flex; flex-direction: column; gap: 14px; min-height: 230px; 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__status {
  padding: 3px 10px; border: 2px solid currentColor; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.key__name { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: break-word; }
.key__summary { max-width: 48ch; font-size: 16px; line-height: 1.45; text-wrap: pretty; }
.keys--single .key { flex: 0 1 420px; }
.key__open { margin-top: auto; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Operator: the short introduction. */
.about {
  max-width: 920px; padding: clamp(22px, 3vw, 34px); border-radius: 28px; background: var(--white);
  box-shadow: 0 8px 0 var(--stone);
  font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; font-weight: 500; text-wrap: pretty;
}

/* 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(--page-ink); }
.capability { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; padding: 18px 0; border-top: 2px solid var(--page-ink); }
.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(--page-ink); 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; }
/* A project's own logo, on a white plate so it reads on any hero colour. */
.project__logo { width: min(300px, 100%); height: auto; padding: 10px 14px; border-radius: 18px; background: var(--white); }
.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(--page-ink); }
.what-list li { padding: 16px 0; border-top: 2px solid var(--page-ink); font-size: 18px; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.note { font-size: 14px; color: var(--page-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; }

/* A project's demos: a gallery of screenshots, a table of results or a chat exchange (components/demo.mjs). */
.demo { display: flex; flex-direction: column; gap: 16px; }
.demo__caption { font-size: 14px; color: var(--page-muted); }

/* Gallery: the first screenshot runs full width, the rest sit two to a row.
   Each one clicks through to the full-size image. */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 26px 18px; }
.gallery__item { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.gallery__item:first-child { grid-column: 1 / -1; }
.gallery__label { font-size: 16px; font-weight: 500; line-height: 1.4; text-wrap: pretty; }
.demo__zoom { display: block; border-radius: clamp(14px, 2vw, 28px); overflow: hidden; background: var(--white); box-shadow: 0 10px 0 var(--stone); }
.demo__image { display: block; width: 100%; height: auto; }

/* Table of results, with an optional total row and flagged risk. */
.demo__scroll { overflow-x: auto; border-radius: 22px; background: var(--white); box-shadow: 0 8px 0 var(--stone); }
.demo-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.demo-table th, .demo-table td { padding: 14px 20px; text-align: left; }
.demo-table thead th { background: var(--navy); color: var(--white); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.demo-table tbody td { border-top: 2px solid var(--paper); font-weight: 500; }
.demo-table td:last-child { font-weight: 700; }
.demo-table tfoot th, .demo-table tfoot td { background: var(--lime); font-family: var(--font-display); font-weight: 400; font-size: 18px; text-transform: uppercase; }
.demo__flag { padding: 18px 20px; border-radius: 18px; border: 2px solid var(--navy); background: var(--card); font-size: 16px; line-height: 1.45; text-wrap: pretty; }

/* Chat exchange. */
.chat { display: flex; flex-direction: column; gap: 12px; padding: clamp(18px, 2.4vw, 28px); border-radius: 28px; background: var(--ink-soft); color: var(--white); box-shadow: 0 10px 0 #0b0c10; }
.chat__bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.chat__avatar { width: 36px; height: 36px; border-radius: 50%; }
.chat__msg { max-width: min(560px, 86%); padding: 12px 16px; border-radius: 18px; color: var(--navy); font-size: 16px; line-height: 1.45; }
.chat__msg--visitor { align-self: flex-end; background: var(--lime); border-bottom-right-radius: 4px; font-weight: 500; }
.chat__msg--bot { align-self: flex-start; background: var(--white); border-bottom-left-radius: 4px; }

/* The 404 page: the mascot beside a spilled flask. */
.not-found { padding-block: 48px 96px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
/* The scene sits on a lit bench, so its navy outlines stay readable on the night page. */
.accident {
  display: flex; align-items: flex-end; gap: 4px; margin-bottom: 8px;
  padding: clamp(16px, 2.4vw, 26px) clamp(18px, 3vw, 34px); border-radius: 28px; background: var(--card); box-shadow: 0 8px 0 var(--stone);
}
.accident .mascot { width: min(170px, 32vw); height: auto; }
.spill { width: min(300px, 44vw); height: auto; overflow: visible; }
.sp-glass { fill: var(--white); }
.sp-liquid, .sp-puddle, .sp-drop { fill: var(--lime); }
.sp-outline { fill: none; stroke: var(--navy); stroke-width: 6; stroke-linejoin: round; }
.sp-rim { fill: var(--navy); }
.sp-stream { fill: none; stroke: var(--lime); stroke-width: 11; stroke-linecap: round; }
.sp-puddle { stroke: var(--navy); stroke-width: 5; stroke-linejoin: round; }
.sp-drop { stroke: var(--navy); stroke-width: 2; }

/* The backdrop behind every page: molecules far back, bubbles in front of them and
   ships along the bottom of the window. This file says where each piece rests;
   motion.css makes it move. Everything is tinted light enough to sit under navy text. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop__molecules, .backdrop__bubbles, .backdrop__sea { position: absolute; inset: 0; }
/* Every layer is at full strength in the page margins and fades to --calm behind the reading
   column (1280px wide, centred). On screens no wider than that it is faint throughout. */
.backdrop__molecules, .backdrop__bubbles, .backdrop__sea {
  --fade: linear-gradient(90deg, #000 0, #000 calc(50% - 640px), var(--calm) calc(50% - 560px), var(--calm) calc(50% + 560px), #000 calc(50% + 640px), #000 100%);
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}
.backdrop__molecules, .backdrop__bubbles { --calm: rgba(0, 0, 0, 0.3); }
.backdrop__sea { --calm: rgba(0, 0, 0, 0.5); }

/* Molecules */
.molecule { position: absolute; left: var(--x); top: var(--y); width: var(--w); }
.molecule__spin { display: block; }
.molecule-art { display: block; width: 100%; height: auto; overflow: visible; }
.mol-bonds { stroke: var(--line-soft); stroke-width: 4; stroke-linecap: round; }
.mol-atom { stroke: var(--line-mid); stroke-width: 2; }
.mol-atom--lime { fill: var(--lime); }
.mol-atom--blue { fill: var(--periwinkle-light); }
.mol-atom--white { fill: var(--white); }
.molecule--1 { --x: -2%; --y: 10%; --w: clamp(130px, 15vw, 240px); --drift: 15s; --delay: -2s; --spin: 110s; --dx: 22px; --dy: -30px; }
.molecule--2 { --x: 80%; --y: 4%; --w: clamp(170px, 20vw, 320px); --drift: 19s; --delay: -7s; --spin: 150s; --dx: -28px; --dy: -22px; }
.molecule--3 { --x: 38%; --y: 26%; --w: clamp(110px, 12vw, 190px); --drift: 13s; --delay: -4s; --spin: 90s; --dx: 30px; --dy: -18px; }
.molecule--4 { --x: 90%; --y: 42%; --w: clamp(120px, 13vw, 210px); --drift: 17s; --delay: -9s; --spin: 130s; --dx: -20px; --dy: -34px; }
.molecule--5 { --x: 3%; --y: 50%; --w: clamp(160px, 18vw, 290px); --drift: 18s; --delay: -1s; --spin: 140s; --dx: 26px; --dy: -24px; }
.molecule--6 { --x: 60%; --y: 60%; --w: clamp(110px, 12vw, 200px); --drift: 14s; --delay: -6s; --spin: 100s; --dx: -32px; --dy: -20px; }
.molecule--7 { --x: 22%; --y: 72%; --w: clamp(120px, 13vw, 220px); --drift: 16s; --delay: -3s; --spin: 120s; --dx: 18px; --dy: -36px; }

/* Bubbles: a skin, a size, a column and a pace, mixed in components/backdrop.mjs */
.bubble { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); }
.bubble__skin {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%;
  border: var(--edge, 2px) solid var(--bubble-line); background: var(--bubble-fill);
}
.bubble--clear { --bubble-line: var(--edge-navy); --bubble-fill: transparent; }
.bubble--white { --bubble-line: var(--edge-navy); --bubble-fill: var(--tint-white); }
.bubble--lime { --bubble-line: var(--edge-lime); --bubble-fill: var(--tint-lime); }
.bubble--blue { --bubble-line: var(--edge-blue); --bubble-fill: var(--tint-blue); }
.bubble--white .bubble__skin::after, .bubble--lime .bubble__skin::after {
  content: ''; position: absolute; left: 18%; top: 16%; width: 22%; height: 22%; border-radius: 50%; background: var(--tint-shine);
}
.bubble--size-s { --size: 16px; }
.bubble--size-m { --size: 34px; }
.bubble--size-l { --size: 64px; --edge: 3px; }
.bubble--size-xl { --size: 124px; --edge: 3px; }
.bubble--col-1 { --x: 1.5%; }
.bubble--col-2 { --x: 5%; }
.bubble--col-3 { --x: 12%; }
.bubble--col-4 { --x: 22%; }
.bubble--col-5 { --x: 33%; }
.bubble--col-6 { --x: 44%; }
.bubble--col-7 { --x: 56%; }
.bubble--col-8 { --x: 67%; }
.bubble--col-9 { --x: 78%; }
.bubble--col-10 { --x: 88%; }
.bubble--col-11 { --x: 93.5%; }
.bubble--col-12 { --x: 97%; }
.bubble--pace-1 { --y: 18%; --rise: 19s; --delay: -3s; --sway: 4.5s; }
.bubble--pace-2 { --y: 62%; --rise: 25s; --delay: -11s; --sway: 6s; }
.bubble--pace-3 { --y: 36%; --rise: 31s; --delay: -19s; --sway: 5s; }
.bubble--pace-4 { --y: 78%; --rise: 21s; --delay: -7s; --sway: 6.5s; }
.bubble--pace-5 { --y: 8%; --rise: 28s; --delay: -15s; --sway: 4s; }
.bubble--pace-6 { --y: 50%; --rise: 23s; --delay: -21s; --sway: 5.5s; }
.bubble--pace-7 { --y: 68%; --rise: 34s; --delay: -27s; --sway: 7s; }

/* The sea: two wave lines with a ship on each. --waterline is where a hull meets its wave. */
.wave { position: absolute; left: 0; bottom: var(--wave-bottom); height: 24px; }
.wave--near { --wave-bottom: 16px; }
.wave--far { --wave-bottom: 36px; }
.wave-art { display: block; }
.wave__line { fill: none; stroke: var(--stone); stroke-width: 3; stroke-linecap: round; }

.lane { position: absolute; left: 0; right: 0; bottom: calc(var(--waterline) - var(--ship-w) * 0.058); }
.lane--out { --ship-w: clamp(230px, 30vw, 430px); --waterline: 28px; translate: calc(var(--ship-w) + 6vw) 0; }
.lane--return { --ship-w: clamp(150px, 20vw, 280px); --waterline: 48px; opacity: 0.8; translate: calc(100% - 8vw) 0; }
/* A ship is parked just off the left edge of its lane, so moving the lane brings it across. */
.ship { position: relative; width: var(--ship-w); margin-left: calc(-1 * var(--ship-w)); transform-origin: 50% 90%; }
.ship--return { scale: -1 1; }
.ship-art { display: block; width: 100%; height: auto; overflow: visible; }
.ship-line { stroke: var(--line-mid); stroke-width: 3; stroke-linecap: round; }
.ship-funnel, .ship-house, .ship-hull { stroke: var(--line-mid); stroke-width: 2; stroke-linejoin: round; }
.ship-funnel, .ship-hull, .ship-window { fill: var(--periwinkle); }
.ship-house { fill: var(--white); }
.ship-band { fill: var(--lime); }
.ship-rail { fill: var(--stone); }
.ship-stripe { fill: none; stroke: var(--lime); stroke-width: 6; }
.ship-box { stroke: var(--line-mid); stroke-width: 1.5; }
.ship-box--lime { fill: var(--lime); }
.ship-box--blue { fill: var(--periwinkle-light); }
.ship-box--white { fill: var(--white); }
.ship-box--stone { fill: var(--stone); }
.ship-name { fill: var(--white); font-family: var(--font-display); font-size: 19px; letter-spacing: 3px; }
/* Funnel exhaust, drawn as lime bubbles. Hidden until motion.css sets it going. */
.puff {
  position: absolute; left: 11.5%; top: 3%; width: 4.2%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--edge-lime); background: var(--tint-lime); opacity: 0;
}

/* Less going on behind a narrow screen. */
@media (max-width: 720px) {
  .molecule:nth-child(n + 5), .bubble:nth-child(n + 15) { display: none; }
}

/* The meltdown easter egg: hold the hero mascot until its flask blows (scripts/meltdown.js).
   This file sets the resting states; motion.css plays the blast. */

/* While held, the flask fills and its contents heat from lime to red; after the blast it
   stands empty, then refills. */
.porthole g rect.m-liquid, .porthole g path.m-liquid { transition: transform 0.4s var(--ease), fill 0.4s; }
.porthole g rect.m-liquid { transform-box: fill-box; transform-origin: 50% 100%; }
.porthole.is-charging g .m-liquid { fill: var(--red); }
.porthole.is-charging g rect.m-liquid { transform: scaleY(1.9); transition: transform 1.5s linear, fill 1.5s linear; }
.porthole.is-charging g path.m-liquid { transform: translateY(-72px); transition: transform 1.5s linear, fill 1.5s linear; }
:root[data-meltdown='boom'] .porthole g rect.m-liquid { transform: scaleY(0.04); }
:root[data-meltdown='boom'] .porthole g path.m-liquid { transform: translateY(76px); }

/* Moods. Held, the mascot gets angry: its brows come down. It frowns for the whole blast;
   motion.css takes it from red and angry to pale and sad. */
.porthole .m-smile { transform-box: fill-box; transform-origin: 50% 50%; transition: transform 0.3s var(--ease); }
.porthole.is-charging .m-brow { opacity: 1; }
.porthole.is-charging .m-brow--left { transform: rotate(18deg); }
.porthole.is-charging .m-brow--right { transform: rotate(-18deg); }
.porthole.is-charging .m-smile, :root[data-meltdown='boom'] .porthole .m-smile { transform: scaleY(-1); }

/* The page itself takes on an acid tint for the length of the blast. */
:root[data-meltdown='boom'] { --page: #e3f3a2; }
:root[data-theme='night'][data-meltdown='boom'] { --page: #11290f; }

/* Goo: a layer over everything, invisible until the blast. --blast-x/y mark the mascot. */
.goo { position: fixed; inset: 0; z-index: 20; overflow: hidden; pointer-events: none; visibility: hidden; }
:root[data-meltdown='boom'] .goo { visibility: visible; }
.goo__flash {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at var(--blast-x, 50%) var(--blast-y, 30%), var(--lime) 0, var(--tint-lime) 30%, transparent 70%);
}

/* Droplets: each one is turned to its own heading, then thrown along it. */
.goo__shot { position: absolute; left: var(--blast-x, 50%); top: var(--blast-y, 30%); width: 0; height: 0; rotate: calc(var(--i) * 22.5deg); }
.goo__shot::before {
  content: ''; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--lime); border: 3px solid var(--edge-lime); opacity: 0;
}
.goo__shot:nth-child(2) { --i: 0; --reach: 44vmax; }
.goo__shot:nth-child(3) { --i: 1; --reach: 62vmax; }
.goo__shot:nth-child(4) { --i: 2; --reach: 38vmax; }
.goo__shot:nth-child(5) { --i: 3; --reach: 70vmax; }
.goo__shot:nth-child(6) { --i: 4; --reach: 50vmax; }
.goo__shot:nth-child(7) { --i: 5; --reach: 66vmax; }
.goo__shot:nth-child(8) { --i: 6; --reach: 42vmax; }
.goo__shot:nth-child(9) { --i: 7; --reach: 58vmax; }
.goo__shot:nth-child(10) { --i: 8; --reach: 72vmax; }
.goo__shot:nth-child(11) { --i: 9; --reach: 46vmax; }
.goo__shot:nth-child(12) { --i: 10; --reach: 64vmax; }
.goo__shot:nth-child(13) { --i: 11; --reach: 40vmax; }
.goo__shot:nth-child(14) { --i: 12; --reach: 68vmax; }
.goo__shot:nth-child(15) { --i: 13; --reach: 52vmax; }
.goo__shot:nth-child(16) { --i: 14; --reach: 60vmax; }
.goo__shot:nth-child(17) { --i: 15; --reach: 48vmax; }

/* Patches: acid that lands, spreads and seethes. Wider than tall, with two bubbles
   popping at the edge. Where each lands (--x, --y), how big, and when. None lands on the
   mascot's porthole on a wide screen, so its face stays in view. */
.goo__patch {
  position: absolute; left: var(--x); top: var(--y); width: var(--size); height: calc(var(--size) * 0.52);
  border-radius: 46% 54% 60% 40% / 58% 44% 56% 42%; border: 3px solid var(--edge-lime); background: rgba(215, 255, 63, 0.84);
  opacity: 0; scale: 0;
}
.goo__patch::before, .goo__patch::after {
  content: ''; position: absolute; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--edge-lime); background: var(--lime);
}
.goo__patch::before { left: 14%; top: -16%; width: 15%; }
.goo__patch::after { right: 18%; top: -8%; width: 9%; }
.goo__patch--1 { --x: 4%; --y: 10%; --size: clamp(150px, 20vw, 300px); --delay: 0.18s; }
.goo__patch--2 { --x: 44%; --y: 13%; --size: clamp(170px, 21vw, 310px); --delay: 0.1s; }
.goo__patch--3 { --x: 36%; --y: 34%; --size: clamp(130px, 16vw, 240px); --delay: 0.3s; }
.goo__patch--4 { --x: 80%; --y: 46%; --size: clamp(140px, 18vw, 260px); --delay: 0.42s; }
.goo__patch--5 { --x: 10%; --y: 56%; --size: clamp(180px, 24vw, 340px); --delay: 0.26s; }
.goo__patch--6 { --x: 52%; --y: 64%; --size: clamp(120px, 15vw, 220px); --delay: 0.5s; }
.goo__patch--7 { --x: -4%; --y: 34%; --size: clamp(130px, 16vw, 240px); --delay: 0.36s; }
.goo__patch--8 { --x: 18%; --y: -3%; --size: clamp(160px, 22vw, 320px); --delay: 0.14s; }
.goo__patch--9 { --x: 72%; --y: 78%; --size: clamp(130px, 17vw, 250px); --delay: 0.56s; }

/* Fizz: small bubbles that rise a little and pop, over and over, all across the screen.
   A skin, a size, a column and a pace, mixed in components/meltdown.mjs. */
.goo__fizz {
  position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); border-radius: 50%;
  border: 2px solid var(--fizz-line); background: var(--fizz-fill); opacity: 0;
}
.goo__fizz--lime { --fizz-line: var(--edge-lime); --fizz-fill: var(--tint-lime); }
.goo__fizz--white { --fizz-line: rgba(255, 255, 255, 0.95); --fizz-fill: rgba(255, 255, 255, 0.45); }
.goo__fizz--size-s { --size: 12px; }
.goo__fizz--size-m { --size: 22px; }
.goo__fizz--size-l { --size: 38px; }
.goo__fizz--col-1 { --x: 3%; }
.goo__fizz--col-2 { --x: 12%; }
.goo__fizz--col-3 { --x: 21%; }
.goo__fizz--col-4 { --x: 30%; }
.goo__fizz--col-5 { --x: 39%; }
.goo__fizz--col-6 { --x: 48%; }
.goo__fizz--col-7 { --x: 57%; }
.goo__fizz--col-8 { --x: 66%; }
.goo__fizz--col-9 { --x: 75%; }
.goo__fizz--col-10 { --x: 84%; }
.goo__fizz--col-11 { --x: 93%; }
.goo__fizz--pace-1 { --y: 24%; --pop: 1.5s; --delay: 0.3s; }
.goo__fizz--pace-2 { --y: 62%; --pop: 2.3s; --delay: 0.9s; }
.goo__fizz--pace-3 { --y: 40%; --pop: 1.2s; --delay: 0.5s; }
.goo__fizz--pace-4 { --y: 86%; --pop: 2s; --delay: 1.3s; }
.goo__fizz--pace-5 { --y: 16%; --pop: 1.8s; --delay: 0.7s; }
.goo__fizz--pace-6 { --y: 72%; --pop: 1.4s; --delay: 0.4s; }
.goo__fizz--pace-7 { --y: 50%; --pop: 2.6s; --delay: 1.1s; }
.goo__fizz--pace-8 { --y: 94%; --pop: 1.6s; --delay: 0.6s; }
.goo__fizz--pace-9 { --y: 32%; --pop: 2.1s; --delay: 1.5s; }

/* 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; } }
@keyframes charge-shake {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  10% { translate: -1px 0; } 20% { translate: 1px 1px; } 30% { translate: -2px 0; rotate: -1deg; } 40% { translate: 2px -1px; rotate: 1deg; }
  50% { translate: -3px 1px; rotate: -2deg; } 60% { translate: 3px -1px; rotate: 2deg; } 70% { translate: -5px 1px; rotate: -3deg; }
  80% { translate: 5px -2px; rotate: 3deg; } 90% { translate: -6px 2px; rotate: -4deg; } 96% { translate: 6px -2px; rotate: 4deg; }
}
@keyframes charge-swell { to { scale: 1.1; box-shadow: inset 0 0 0 10px var(--blue-ink), 0 0 0 10px rgba(215, 255, 63, 0.35), 0 0 60px 20px rgba(215, 255, 63, 0.7); } }
@keyframes quake {
  0%, 100% { translate: 0 0; } 15% { translate: -10px 6px; } 30% { translate: 9px -7px; } 45% { translate: -7px -4px; }
  60% { translate: 6px 5px; } 75% { translate: -4px 2px; } 90% { translate: 2px -1px; }
}
/* The mascot's mood through the blast: red and angry for the first few seconds, then
   pale and sad, brows and wings drooping, until it is over. */
@keyframes mood-glass { 0%, 22% { fill: var(--red); } 32%, 100% { fill: var(--white); } }
@keyframes mood-brow-left {
  0%, 22% { transform: rotate(18deg); opacity: 1; }
  32%, 92% { transform: rotate(-16deg); opacity: 1; }
  100% { transform: rotate(-16deg); opacity: 0; }
}
@keyframes mood-brow-right {
  0%, 22% { transform: rotate(-18deg); opacity: 1; }
  32%, 92% { transform: rotate(16deg); opacity: 1; }
  100% { transform: rotate(16deg); opacity: 0; }
}
@keyframes mood-wing-left { 0%, 22% { rotate: 14deg; } 32%, 92% { rotate: -26deg; } 100% { rotate: 0deg; } }
@keyframes mood-wing-right { 0%, 22% { rotate: -14deg; } 32%, 92% { rotate: 26deg; } 100% { rotate: 0deg; } }
@keyframes goo-flash { 0% { opacity: 0; } 12% { opacity: 0.95; } 100% { opacity: 0; } }
@keyframes goo-shot { 0% { translate: 0 0; scale: 0.4; opacity: 1; } 75% { opacity: 1; } 100% { translate: var(--reach) 0; scale: 1.5; opacity: 0; } }
@keyframes goo-fade { 0%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes goo-patch { 0% { scale: 0; opacity: 0; } 2% { scale: 0.55; opacity: 1; } 60%, 100% { scale: 1.15; opacity: 1; } }
@keyframes goo-seethe {
  from { border-radius: 46% 54% 60% 40% / 58% 44% 56% 42%; }
  to { border-radius: 58% 42% 44% 56% / 42% 60% 40% 58%; }
}
@keyframes goo-pop { 0% { scale: 0.3; opacity: 0; } 25% { opacity: 1; } 80% { scale: 1.1; opacity: 1; } 100% { scale: 1.7; opacity: 0; } }
@keyframes fizz {
  0% { translate: 0 0; scale: 0.2; opacity: 0; }
  15% { scale: 1; opacity: 1; }
  75% { translate: 0 -13vh; scale: 1; opacity: 1; }
  100% { translate: 0 -16vh; scale: 1.9; opacity: 0; }
}
/* Melting: a jolt from the blast, a long sag, then everything sets itself right. */
@keyframes melt-left {
  0%, 100% { transform: none; filter: none; }
  2% { transform: translateY(-8px) rotate(0.6deg); }
  30% { transform: translateY(20px) rotate(-2.5deg) skewX(3deg) scaleY(1.06); }
  70%, 86% { transform: translateY(58px) rotate(-6deg) skewX(7deg) scaleY(1.2); filter: hue-rotate(38deg) saturate(1.35); }
}
@keyframes melt-right {
  0%, 100% { transform: none; filter: none; }
  2% { transform: translateY(-6px) rotate(-0.6deg); }
  30% { transform: translateY(26px) rotate(2deg) skewX(-4deg) scaleY(1.08); }
  70%, 86% { transform: translateY(70px) rotate(5deg) skewX(-8deg) scaleY(1.26); filter: hue-rotate(38deg) saturate(1.35); }
}
@keyframes melt-sag {
  0%, 100% { transform: none; filter: none; }
  2% { transform: translateY(-5px); }
  30% { transform: translateY(14px) scaleY(1.1) skewX(-1deg); }
  70%, 86% { transform: translateY(40px) scaleY(1.32) skewX(2deg); filter: hue-rotate(38deg) saturate(1.35); }
}
@keyframes drip { 0% { translate: 0 0; opacity: 1; } 80%, 100% { translate: 0 16px; opacity: 0; } }
@keyframes bubble-rise { to { translate: 0 calc(-100vh - 200px); } }
@keyframes bubble-sway { 0%, 100% { translate: -12px 0; } 50% { translate: 12px 0; } }
@keyframes molecule-drift { 0%, 100% { translate: 0 0; } 50% { translate: var(--dx) var(--dy); } }
@keyframes molecule-spin { to { rotate: 360deg; } }
@keyframes wave-roll { to { translate: -120px 0; } }
@keyframes sail-out { from { translate: 0 0; } to { translate: calc(100% + var(--ship-w)) 0; } }
@keyframes sail-return { from { translate: calc(100% + var(--ship-w)) 0; } to { translate: 0 0; } }
@keyframes ship-bob { 0%, 100% { translate: 0 0; rotate: -0.6deg; } 50% { translate: 0 4px; rotate: 0.6deg; } }
@keyframes puff {
  0% { translate: 0 0; scale: 0.4; opacity: 0; }
  15% { opacity: 0.9; }
  100% { translate: calc(var(--ship-w) * -0.16) calc(var(--ship-w) * -0.34); scale: 1.5; opacity: 0; }
}

@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; }

  .sp-drop { animation: drip 1.6s ease-in infinite; }
  .sp-drop--late { animation-delay: 0.7s; }

  /* Meltdown. Charging: the held mascot shakes harder and its porthole swells. */
  .porthole.is-charging { animation: charge-swell 1.5s ease-in forwards; }
  .porthole.is-charging .mascot { animation: charge-shake 1.5s linear forwards; }
  .porthole.is-charging .m-bubble { animation-duration: 0.3s; }
  :root[data-meltdown='boom'] .porthole path.m-glass { animation: mood-glass 15s linear both; }
  :root[data-meltdown='boom'] .porthole .m-brow--left { animation: mood-brow-left 15s var(--ease) both; }
  :root[data-meltdown='boom'] .porthole .m-brow--right { animation: mood-brow-right 15s var(--ease) both; }
  :root[data-meltdown='boom'] .porthole .m-wing--left { animation: mood-wing-left 15s var(--ease) both; }
  :root[data-meltdown='boom'] .porthole .m-wing--right { animation: mood-wing-right 15s var(--ease) both; }
  /* The blast: a flash and droplets, then acid patches seething and bubbles fizzing
     while the page melts. The whole layer fades out at the end. */
  :root[data-meltdown='boom'] .goo { animation: goo-fade 15s linear both; }
  :root[data-meltdown='boom'] .goo__flash { animation: goo-flash 0.9s ease-out both; }
  :root[data-meltdown='boom'] .goo__shot::before { animation: goo-shot 0.85s cubic-bezier(0.1, 0.7, 0.3, 1) calc(var(--i) * 12ms) both; }
  :root[data-meltdown='boom'] .goo__patch { animation: goo-patch 14s var(--ease) var(--delay) both, goo-seethe 1.7s ease-in-out infinite alternate; }
  :root[data-meltdown='boom'] .goo__patch::before { animation: goo-pop 0.9s ease-out infinite; }
  :root[data-meltdown='boom'] .goo__patch::after { animation: goo-pop 0.7s ease-out 0.3s infinite; }
  :root[data-meltdown='boom'] .goo__fizz { animation: fizz var(--pop) ease-out var(--delay) infinite; }
  :root[data-meltdown='boom'] .console { animation: quake 0.6s ease-out, melt-sag 14s var(--ease) 0.6s both; }
  :root[data-meltdown='boom'] :is(.key, .cartridge, .chip, .pill-link, .switch, .about, .section-heading, .brand, .site-footer__domain) {
    transform-origin: 50% 0; animation: melt-left 14s var(--ease) both;
  }
  :root[data-meltdown='boom'] :is(.key, .cartridge, .chip, .pill-link, .switch):nth-child(even) { animation-name: melt-right; }
  :root[data-meltdown='boom'] :is(.key, .cartridge, .chip, .section-heading):nth-child(3n) { animation-name: melt-sag; }
  :root[data-meltdown='boom'] :is(.chip, .pill-link, .switch):nth-child(3n + 1) { animation-delay: 0.5s; }

  /* Backdrop. Bubbles start below the window and rise through it; each lane carries
     its ship from one edge to the other. Negative delays start everything mid-flight. */
  .bubble { top: 100%; animation: bubble-rise var(--rise) linear var(--delay) infinite; }
  .bubble__skin { animation: bubble-sway var(--sway) ease-in-out infinite; }
  .molecule { animation: molecule-drift var(--drift) ease-in-out var(--delay) infinite; }
  .molecule__spin { animation: molecule-spin var(--spin) linear infinite; }
  .molecule:nth-child(even) .molecule__spin { animation-direction: reverse; }
  .wave { animation: wave-roll 7s linear infinite; }
  .wave--far { animation-duration: 11s; animation-direction: reverse; }
  .lane--out { animation: sail-out 70s linear -20s infinite; }
  .lane--return { animation: sail-return 110s linear -45s infinite; }
  .ship { animation: ship-bob 5s ease-in-out infinite; }
  .puff { animation: puff 4.2s ease-out infinite; }
  .puff:nth-child(2) { animation-delay: -1.4s; }
  .puff:nth-child(3) { animation-delay: -2.8s; }

  /* 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; }
}
