/* motion.css — the motion library's scene skins (WI-WEB-19). Tokens only; every timing × --tempo. */
/* A kept site carries no tokens: the tempo is 1 unless the site sets it (zero specificity, so its own :root wins) —
   without it every timing here is invalid and the endless row stands still (WI-WEB-37, 2026-10-07). */
:where(html) { --tempo: 1; }
.mx-stage { position: relative; padding: var(--space-lg); isolation: isolate; container-type: inline-size; }
.mx-glow {
  position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px);
  opacity: 0.55; pointer-events: none;
  animation: mx-drift calc(8s * var(--tempo)) var(--ease-in-out) infinite alternate;
}
.mx-glow-a { left: 0; top: 0; background: radial-gradient(circle, var(--color-accent), transparent 68%); }
.mx-glow-b {
  right: 0; bottom: 0; background: radial-gradient(circle, var(--color-accent-ink), transparent 68%); opacity: 0.3;
  animation-duration: calc(9.5s * var(--tempo)); animation-direction: alternate-reverse;
}
@keyframes mx-drift { from { transform: translate(-80px, -40px) scale(0.95); } to { transform: translate(90px, 60px) scale(1.08); } }
.mx-mark { position: absolute; width: 12px; height: 12px; border: 0 solid var(--color-rule-2); }
.mx-tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.mx-tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.mx-bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.mx-br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.mx-frame { position: relative; padding: 1.5px; border-radius: var(--radius-card); background: var(--color-rule); overflow: hidden; }
.mx-frame::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 200%; aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0 64%, color-mix(in srgb, var(--color-accent) 70%, transparent) 76%,
    var(--color-accent-ink) 84%, transparent 92%);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: mx-spin calc(2.6s * var(--tempo)) linear infinite;
}
@keyframes mx-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.mx-card {
  --card: var(--color-ink); --card-ink: var(--color-paper); --card-mute: var(--color-rule-2);
  --card-line: color-mix(in srgb, var(--color-neutral) 35%, var(--color-ink));
  --card-head: color-mix(in srgb, var(--color-ink-2) 22%, var(--color-ink));
  --row-h: 5.5rem;
  position: relative; border-radius: calc(var(--radius-card) - 1.5px); background: var(--card); color: var(--card-ink); overflow: hidden;
}
.mx-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg);
  background: var(--card-head); border-bottom: var(--rule-fine) solid var(--card-line);
}
.mx-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); }
.mx-pill {
  padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600;
  white-space: nowrap; color: var(--color-accent); background: color-mix(in srgb, var(--color-accent-ink) 25%, var(--color-ink));
}
.mx-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--text-sm); color: var(--color-accent); }
.mx-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); animation: mx-pulse calc(1.2s * var(--tempo)) var(--ease-in-out) infinite; }
@keyframes mx-pulse { 50% { opacity: 0.35; transform: scale(0.7); } }

.mx-tall { --row-h: 6.75rem; }   /* rows that carry one more line of words */
.mx-rows { position: relative; height: calc(var(--row-h) * 3); overflow: hidden; }
.mx-hl {
  --hl: 0; position: absolute; inset-inline: 0; top: 0; height: var(--row-h);
  background: color-mix(in srgb, var(--color-accent-ink) 14%, var(--card));
  transform: translateY(calc(var(--hl) * 100%)); transition: transform calc(250ms * var(--tempo)) var(--ease-out);
}
.mx-hl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--color-accent); }
.mx-row {
  position: absolute; inset-inline: 0; top: 0; height: var(--row-h); z-index: 1; perspective: 900px;
  border-bottom: var(--rule-fine) solid var(--card-line);
  transform: translateY(calc(var(--slot) * 100%));
  transition: transform calc(250ms * var(--tempo)) var(--ease-out), opacity calc(180ms * var(--tempo)) ease;
}
.mx-snap { transition: none !important; }
.mx-rise { z-index: 3; transition-duration: calc(450ms * var(--tempo)), calc(180ms * var(--tempo)); }
.mx-rise .mx-front { background: var(--card); }
.mx-row-in { position: relative; height: 100%; transform-style: preserve-3d; }
.mx-face {
  position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-md); padding: 0 var(--space-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mx-back { transform: rotateX(180deg); background: color-mix(in srgb, var(--color-accent-ink) 20%, var(--card)); }
.mx-back .mx-av { background: var(--card); color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); }
.mx-av {
  flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: var(--radius-input);
  background: linear-gradient(135deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 70%, var(--color-paper)));
  color: var(--color-ink); font-weight: 700;
}
.mx-txt { flex: 1; min-width: 0; }
.mx-l1 { display: flex; align-items: center; gap: var(--space-xs); white-space: nowrap; overflow: hidden; }
.mx-name { font-family: var(--font-display); font-size: var(--text-md); font-weight: 700; white-space: nowrap; }
.mx-chip, .mx-badge { flex: none; padding: 2px var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-xs); }
.mx-chip { color: var(--card-mute); background: color-mix(in srgb, var(--color-neutral) 22%, var(--card)); }
.mx-badge {
  display: inline-block; font-weight: 700; color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent-ink) 22%, var(--card));
  border: var(--rule-fine) solid color-mix(in srgb, var(--color-accent-ink) 70%, var(--card));
}
.mx-role, .mx-more { margin-top: 4px; font-size: var(--text-sm); color: var(--card-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-more { margin-top: 2px; font-size: var(--text-xs); }
.mx-typing::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--color-accent); }
.mx-status { flex: none; display: grid; justify-items: end; font-weight: 700; font-size: var(--text-sm); }
.mx-status > span {
  grid-area: 1 / 1; white-space: nowrap;
  transition: opacity calc(150ms * var(--tempo)) ease, transform calc(150ms * var(--tempo)) var(--ease-out);
}
.mx-s-ready, .mx-b-ready { color: var(--color-accent); font-weight: 700; font-size: var(--text-sm); }
.mx-s-pend { color: var(--color-muted); animation: mx-breathe calc(1s * var(--tempo)) ease-in-out infinite; }
@keyframes mx-breathe { 50% { opacity: 0.55; } }
[data-state="ready"] .mx-s-pend { opacity: 0; transform: translateY(-8px); animation: none; }
[data-state="pending"] .mx-s-ready { opacity: 0; transform: translateY(8px); }
.mx-foot {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg);
  background: var(--card-head); font-size: var(--text-sm); color: var(--card-mute);
}
.mx-foot span:last-child:not(:first-child) { font-weight: 700; color: var(--color-accent); }
.mx-ghost {
  position: absolute; z-index: 20; pointer-events: none; background: var(--color-ink); color: var(--color-paper);
  border-radius: var(--radius-input); border: var(--rule-fine) solid color-mix(in srgb, var(--color-accent-ink) 60%, var(--color-ink));
  filter: drop-shadow(0 14px 24px color-mix(in srgb, var(--color-paper) 55%, transparent));
  --card: var(--color-ink); --card-mute: var(--color-rule-2); --card-line: transparent;
}
.mx-ghost .mx-back { display: none; }

/* ---- variants (WI-WEB-20): the same list, five ways of moving ---- */
/* ticker: a steady drift (no edge fade: it cut into rows mid-drift and the card read as emptier) */
.mx-linear .mx-row { transition: transform calc(1300ms * var(--tempo)) linear, opacity calc(180ms * var(--tempo)) ease; }
.mx-v-ticker .mx-hl { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 35%, transparent); }

/* scan: a bar of light sweeps the rows; the row it reaches decodes */
.mx-beam {
  --hl: 0; position: absolute; inset-inline: 0; top: 0; height: var(--row-h); z-index: 2; pointer-events: none;
  transform: translateY(calc(var(--hl) * 100%)); transition: transform calc(300ms * var(--tempo)) var(--ease-out);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-accent) 22%, transparent) 45%,
    color-mix(in srgb, var(--color-accent-ink) 40%, transparent) 50%, transparent 58%);
  background-size: 250% 100%; animation: mx-sweep calc(800ms * var(--tempo)) linear infinite;
}
@keyframes mx-sweep { from { background-position: 120% 0; } to { background-position: -30% 0; } }
.mx-v-scan .mx-name, .mx-v-scan .mx-role { font-variant-numeric: tabular-nums; }

/* stack: a deck of cards in depth; the front card leaves, the next steps forward */
.mx-v-stack .mx-rows { height: calc(var(--row-h) + 3.25rem); padding: 0 var(--space-md); overflow: visible; }
.mx-v-stack .mx-hl { display: none; }
.mx-v-stack .mx-row {
  inset-inline: var(--space-md); top: var(--space-md); border: var(--rule-fine) solid var(--card-line); border-radius: var(--radius-input);
  background: var(--card); box-shadow: 0 10px 24px color-mix(in srgb, var(--color-paper) 35%, transparent);
  z-index: calc(10 - var(--slot));
  transform: translateY(calc(var(--slot) * 0.9rem)) scale(calc(1 - var(--slot) * 0.05));
  transform-origin: 50% 0; opacity: calc(1 - var(--slot) * 0.15);
  transition: transform calc(220ms * var(--tempo)) var(--ease-out), opacity calc(220ms * var(--tempo)) ease;
}
.mx-v-stack .mx-row[data-slot="-1"] { opacity: 0; }
.mx-v-stack .mx-card { overflow: visible; }

/* rank: the riser glows as it climbs */
/* CHANGE 2026-10-06 (WI-WEB-21): 320 ms → 220 ms, the canon's 150–300 ms; at 320 ms two rows sat half over each other
   long enough for the life check to catch the list at 77% full. */
.mx-v-rank .mx-row { transition: transform calc(220ms * var(--tempo)) cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity calc(180ms * var(--tempo)) ease; }
.mx-v-rank .mx-rise .mx-front { background: color-mix(in srgb, var(--color-accent-ink) 26%, var(--card)); box-shadow: inset 3px 0 0 var(--color-accent); }

/* ---- dashboard (WI-WEB-21): tiles of the person's own numbers, rows, a goal ---- */
/* tiles share one row however narrow the slot (WI-WEB-23: four tiles wrapped 3 + 1 in a page's picture slot) */
.mx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(5.5rem, 100%), 1fr)); gap: var(--space-xs); padding: var(--space-md) var(--space-lg); }
@container (max-width: 30rem) { .mx-num { font-size: var(--text-lg); } .mx-tile { padding: var(--space-xs) var(--space-sm); } }
.mx-tile {
  display: grid; gap: 2px; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--color-neutral) 12%, var(--card)); border: var(--rule-fine) solid var(--card-line);
  transition: background-color calc(200ms * var(--tempo)) ease, border-color calc(200ms * var(--tempo)) ease, box-shadow calc(200ms * var(--tempo)) ease;
}
.mx-tile.mx-on { background: color-mix(in srgb, var(--color-accent-ink) 18%, var(--card)); border-color: var(--color-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--color-accent) 25%, transparent); }
.mx-num { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; color: var(--color-accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mx-tl { font-size: var(--text-sm); font-weight: 600; }
.mx-ts { font-size: var(--text-xs); color: var(--card-mute); }
.mx-drows { display: grid; }
.mx-drow { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-lg); border-top: var(--rule-fine) solid var(--card-line); background: var(--card); }
.mx-drow .mx-av { width: 2.5rem; height: 2.5rem; }
.mx-drow { transition: background-color calc(200ms * var(--tempo)) ease, box-shadow calc(200ms * var(--tempo)) ease; }
.mx-drow.mx-on { background: color-mix(in srgb, var(--color-accent-ink) 10%, var(--card)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--color-accent) 60%, transparent); }
.mx-drow.mx-rise { background: color-mix(in srgb, var(--color-accent-ink) 16%, var(--card)); box-shadow: inset 3px 0 0 var(--color-accent); }
.mx-drow .mx-txt { min-width: 0; }
.mx-drow .mx-role { white-space: normal; }
.mx-dval { flex: 0 1 auto; max-width: 40%; text-align: right; font-weight: 700; font-size: var(--text-sm); color: var(--color-accent); }   /* whole, never clipped */
.mx-goal { display: grid; gap: var(--space-xs); padding: var(--space-md) var(--space-lg); border-top: var(--rule-fine) solid var(--card-line); background: var(--card-head); }
.mx-goal-l { display: flex; justify-content: space-between; gap: var(--space-md); font-size: var(--text-sm); }
.mx-goal-l span:last-child:not(:first-child) { font-weight: 700; color: var(--color-accent); }
.mx-bar { position: relative; height: 0.5rem; border-radius: var(--radius-pill); overflow: hidden; background: color-mix(in srgb, var(--color-neutral) 25%, var(--card)); }
.mx-bar i { position: absolute; inset: 0; border-radius: inherit; transform-origin: 0 50%; transform: scaleX(var(--to));
  background: linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 60%, var(--color-accent-ink))); overflow: hidden; }
.mx-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 60%, transparent), transparent);
  transform: translateX(-100%); animation: mx-shine calc(1.6s * var(--tempo)) linear infinite; }
@keyframes mx-shine { to { transform: translateX(100%); } }

/* ---- step flow (WI-WEB-21): steps lit in turn, a spark on the rail, a message ---- */
.mx-flow { position: relative; list-style: none; margin: 0; padding: var(--space-md) var(--space-lg); display: grid; gap: var(--space-sm); }
.mx-rail { position: absolute; left: calc(var(--space-lg) + 1rem); top: var(--space-lg); bottom: var(--space-lg); width: 2px; background: var(--card-line); }
.mx-spark { --y: 0px; position: absolute; left: -4px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 30%, transparent), 0 0 16px var(--color-accent);
  transform: translateY(calc(var(--y) - var(--space-lg) - var(--space-md))); transition: transform calc(300ms * var(--tempo)) var(--ease-out); }
.mx-step { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--space-md); align-items: start;
  padding: var(--space-sm); border-radius: var(--radius-input); transition: background-color calc(200ms * var(--tempo)) ease, box-shadow calc(200ms * var(--tempo)) ease; }
.mx-step.mx-on { background: color-mix(in srgb, var(--color-accent-ink) 14%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 45%, transparent); }
.mx-dot { z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-weight: 700; font-size: var(--text-sm);
  background: var(--card); color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); transition: background-color calc(200ms * var(--tempo)) ease, color calc(200ms * var(--tempo)) ease; }
.mx-step.mx-on .mx-dot { background: var(--color-accent); color: var(--card); }
.mx-step-b { display: grid; gap: var(--space-xs); min-width: 0; }
.mx-step-t { font-size: var(--text-sm); font-weight: 700; }
.mx-step-l { font-size: var(--text-sm); color: var(--card-mute); }
.mx-pips { display: flex; }
.mx-pip { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-left: -0.4rem; border-radius: 50%; font-size: var(--text-xs); font-weight: 700;
  background: color-mix(in srgb, var(--color-accent-ink) 35%, var(--card)); border: 2px solid var(--card); }
.mx-pip:first-child { margin-left: 0; }
.mx-items { display: grid; gap: 2px; }
/* CHANGE 2026-10-06 (WI-WEB-21): in a narrow card the value wraps under the name instead of running past the edge. */
.mx-item { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: var(--space-md); padding: 4px var(--space-sm); border-radius: var(--radius-input); font-size: var(--text-sm);
  transition: background-color calc(160ms * var(--tempo)) ease; }
.mx-item span:first-child { font-weight: 600; }
.mx-item span + span { color: var(--color-accent); font-weight: 700; white-space: nowrap; margin-left: auto; }
.mx-item.mx-on { background: color-mix(in srgb, var(--color-accent-ink) 22%, var(--card)); }
.mx-msg { position: relative; margin: 0; font-size: var(--text-sm); line-height: var(--lh-normal); color: var(--card-mute); overflow: hidden; }
.mx-msg.mx-sweeping::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--color-accent) 28%, transparent) 50%, transparent 70%);
  transform: translateX(-100%); animation: mx-wipe calc(700ms * var(--tempo)) var(--ease-out) forwards; }
@keyframes mx-wipe { to { transform: translateX(100%); } }
.mx-acts { display: flex; gap: var(--space-sm); }
.mx-act { padding: 6px var(--space-md); border-radius: var(--radius-input); font-size: var(--text-sm); font-weight: 700; background: var(--color-accent); color: var(--card); }
.mx-act-2 { background: transparent; color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }

/* a standalone preview page: the section's words beside its scene */
.mx-demo {
  margin: 0; background-color: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); overflow-x: hidden;
  background-image: radial-gradient(color-mix(in srgb, var(--color-rule-2) 45%, transparent) 1px, transparent 1.2px); background-size: 22px 22px;
}
.mx-demo *, .mx-demo *::before, .mx-demo *::after { box-sizing: border-box; }
.mx-feature {
  max-width: var(--page-max); margin: var(--section-gap) auto; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-2xl); align-items: center; padding: var(--space-2xl) var(--space-xl);
  border: var(--rule-fine) solid var(--color-rule); border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--color-paper-2) 45%, transparent);
}
.mx-words h2 { margin: 0 0 var(--section-head-gap); font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-display-s); line-height: var(--lh-snug); }
.mx-words p { margin: 0 0 var(--space-md); max-width: var(--measure); font-size: var(--text-md); line-height: var(--lh-relaxed); color: var(--color-ink-2); }

@media (max-width: 860px) { .mx-feature { grid-template-columns: 1fr; margin: var(--space-xl) var(--space-md); padding: var(--space-xl) var(--space-md); } .mx-stage { padding: var(--space-md); } }
@media (max-width: 520px) {
  .mx-card { --row-h: 4.75rem; }
  .mx-card.mx-tall { --row-h: 5.75rem; }
  .mx-head, .mx-foot { padding-inline: var(--space-md); }
  .mx-face { padding: 0 var(--space-md); gap: var(--space-sm); }
  .mx-av { width: 2.5rem; height: 2.5rem; }
  .mx-name { font-size: var(--text-base); }
  .mx-chip { display: none; }
  .mx-role, .mx-status, .mx-foot { font-size: var(--text-xs); }
}
@media (prefers-reduced-motion: reduce) {
  .mx-stage *, .mx-stage *::before, .mx-stage *::after { animation: none !important; transition: none !important; }
}

/* tour (WI-WEB-24) — a list of features as a tour. Stacked by default (phone, reduced motion, no room): each item's
   words above its picture, all open. On a wide screen the words stay while the pictures scroll past. */
.mx-tour { display: flex; flex-direction: column; gap: var(--space-xl); }
.mx-tour-nav, .mx-stops, .mx-tour-figs { display: contents; }
.mx-tour-rail { display: none; }
.mx-stop { order: calc(var(--i) * 2); list-style: none; }
.mx-fig { order: calc(var(--i) * 2 + 1); }
.mx-fig > figure { margin: 0; }
.mx-stop-h { margin: 0; font: inherit; }
.mx-stop-h button { all: unset; display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-sm); row-gap: var(--space-2xs); cursor: pointer; }
.mx-stop-h button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: var(--radius-input); }
.mx-stop-n { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-accent); align-self: baseline; }
.mx-stop-t { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-ink); line-height: var(--lh-tight); }
.mx-stop-g { grid-column: 2; color: var(--color-accent-ink); font-weight: 600; line-height: var(--lh-snug); }
.mx-stop-more > div { padding: var(--space-sm) 0 0 calc(2ch + var(--space-sm)); }
.mx-stop-b { margin: 0 0 var(--space-sm); color: var(--color-ink-2); line-height: var(--lh-relaxed); }
.mx-stop-pts { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2xs); }
.mx-stop-pts li { position: relative; padding-left: 1.4em; color: var(--color-ink-2); font-size: var(--text-sm); }
.mx-stop-pts li::before { content: "✓"; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }

@media (min-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .mx-tour { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3xl); align-items: start; }
  .mx-tour-nav { display: block; position: sticky; top: 11vh; padding-left: var(--space-lg); }
  .mx-stops { display: grid; gap: var(--space-2xs); margin: 0; padding: 0; }
  .mx-tour-figs { display: block; }
  .mx-tour-rail { display: block; position: absolute; left: 0; top: var(--space-sm); bottom: var(--space-sm); width: 2px;
    background: var(--color-rule); border-radius: 2px; }
  .mx-tour-rail > i { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: top;
    transform: scaleY(var(--p, 0.02)); background: linear-gradient(var(--color-accent-ink), var(--color-accent)); }
  .mx-stop { position: relative; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card);
    border: 1px solid transparent;
    transition: background-color calc(240ms * var(--tempo)) ease, border-color calc(240ms * var(--tempo)) ease; }
  .mx-stop::before { content: ""; position: absolute; left: calc(-1 * var(--space-lg) - 4px); top: calc(var(--space-sm) + 0.35em);
    width: 10px; height: 10px; border-radius: 50%; background: var(--color-rule-2); transform: scale(0.6);
    transition: transform calc(240ms * var(--tempo)) var(--ease-out), background-color calc(240ms * var(--tempo)) ease; }
  .mx-stop.mx-on { background: color-mix(in srgb, var(--color-accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); }
  .mx-stop.mx-on::before { background: var(--color-accent); transform: scale(1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 30%, transparent); }
  .mx-stop:not(.mx-on) .mx-stop-t { color: var(--color-ink-2); }
  .mx-stop:not(.mx-on) .mx-stop-g { color: var(--color-muted); font-size: var(--text-sm); }
  .mx-stop:not(.mx-on) { padding-block: var(--space-xs); }   /* closed items stay short, so the open one fits the screen */
  .mx-stop-t { font-size: var(--text-lg); transition: color calc(200ms * var(--tempo)) ease; }
  .mx-stop-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows calc(280ms * var(--tempo)) var(--ease-out); }
  .mx-stop-more > div { overflow: hidden; }
  .mx-stop.mx-on .mx-stop-more { grid-template-rows: 1fr; }
  .mx-stop-pts li { opacity: 0; transform: translateY(6px); transition: opacity calc(200ms * var(--tempo)) ease, transform calc(200ms * var(--tempo)) var(--ease-out); }
  .mx-stop.mx-on .mx-stop-pts li { opacity: 1; transform: none; transition-delay: calc((140ms + var(--k) * 70ms) * var(--tempo)); }
  /* CHANGE 2026-10-06 (WI-WEB-24): the owner, "can we reduce the gap between the images" — each picture 74vh tall
     left a screen of empty space on a tall window; now a fixed breath between pictures. */
  .mx-fig { padding-block: var(--space-xl); opacity: 0.5; transform: scale(0.92);
    transition: opacity calc(300ms * var(--tempo)) ease, transform calc(300ms * var(--tempo)) var(--ease-out); }
  .mx-fig.mx-on { opacity: 1; transform: none; }
  .mx-fig:first-child { padding-top: 0; transform-origin: top; }   /* the first picture starts level with the list */
}

/* ---------- M3 (WI-WEB-30), learned from gojiberry.ai's measurements, no code copied ---------- */

/* the tour's panel mode: each item's words scroll past, one panel beside them changes */
@media (min-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .mx-tour-panel .mx-tour-nav { position: relative; top: auto; }
  .mx-tour-panel .mx-stop { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; border: 0; background: none; }
  .mx-tour-panel .mx-stop.mx-on { background: none; }
  .mx-tour-panel .mx-stop .mx-stop-more { grid-template-rows: 1fr; }
  .mx-tour-panel .mx-stop:not(.mx-on) { opacity: 0.38; transition: opacity calc(260ms * var(--tempo)) ease; }
  .mx-tour-panel .mx-stop .mx-stop-pts li { opacity: 1; transform: none; }
  .mx-tour-panel .mx-tour-figs { position: sticky; top: 12vh; height: 76vh; display: grid; align-items: center; }
  .mx-tour-panel .mx-fig { grid-area: 1 / 1; padding: 0; opacity: 0; transform: translateY(14px) scale(0.97); }
  .mx-tour-panel .mx-fig.mx-on { opacity: 1; transform: none; }
  .mx-tour-panel .mx-fig:first-child { padding-top: 0; }
}

/* word reveal: blurred and lowered → sharp, each word a little after the one before; only once the script has wrapped
   the words (.mx-ready), so without it the heading simply stands. Filter on a few words for half a second. */
[data-mx-reveal].mx-ready .mx-w { display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(0.28em);
  transition: opacity calc(380ms * var(--tempo)) ease, filter calc(420ms * var(--tempo)) ease, transform calc(420ms * var(--tempo)) var(--ease-out);
  transition-delay: calc(var(--w) * 45ms * var(--tempo)); }
[data-mx-reveal].mx-ready.mx-in .mx-w { opacity: 1; filter: none; transform: none; }

/* endless sideways row: drawn twice, moved by half its width */
.mx-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.mx-mq-track { display: flex; width: max-content; animation: mx-mq calc(var(--n) * var(--per) * var(--tempo)) linear infinite; }
.mx-marquee:hover .mx-mq-track, .mx-marquee:focus-within .mx-mq-track { animation-play-state: paused; }
.mx-mq-set { display: flex; align-items: center; gap: var(--space-lg, 2.5rem); margin: 0; padding: 0 var(--space-lg, 2.5rem) 0 0; list-style: none; }
.mx-mq-item { flex: none; }
@keyframes mx-mq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .mx-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .mx-mq-track { animation: none; } .mx-mq-set[aria-hidden] { display: none; }
}

/* logo wall: one cell swaps per beat */
.mx-wall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-sm); margin: 0; padding: 0; list-style: none; }
.mx-cell { display: grid; place-items: center; min-height: 4.5rem; padding: var(--space-sm); border: 1px solid var(--color-rule);
  border-radius: var(--radius-card); background: color-mix(in srgb, var(--color-paper-2, var(--color-paper)) 70%, transparent); }
.mx-cell-in { display: block; text-align: center; color: var(--color-ink-2); font-weight: 600;
  transition: opacity calc(240ms * var(--tempo)) ease, filter calc(240ms * var(--tempo)) ease, transform calc(240ms * var(--tempo)) ease; }
.mx-cell-in.mx-out { opacity: 0; filter: blur(4px); transform: translateY(-6px); }
.mx-cell-in.mx-enter { opacity: 0; filter: blur(4px); transform: translateY(6px); }

/* ---------- M4 (WI-WEB-31; tracker MX-08 MX-12 MX-16 MX-23 MX-24 MX-29) ---------- */

/* walkthrough: the cursor and its press */
.mx-walk { position: relative; }
.mx-cursor { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; opacity: 0;
  transition: transform calc(420ms * var(--tempo)) cubic-bezier(0.3, 0.7, 0.2, 1), opacity calc(200ms * var(--tempo)) ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.mx-cursor.mx-shown { opacity: 1; }
.mx-cursor.mx-press svg { transform: scale(0.82); }
.mx-cursor svg { display: block; transition: transform calc(120ms * var(--tempo)) ease; }
.mx-ripple { position: absolute; z-index: 4; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--color-accent) 45%, transparent); animation: mx-ripple calc(520ms * var(--tempo)) ease-out forwards; }
@keyframes mx-ripple { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

/* before/after slider: the before pane on top, clipped at the handle */
@property --at { syntax: '<number>'; inherits: true; initial-value: 50; }
.mx-compare { --at: 50; position: relative; display: grid; border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid var(--color-rule); transition: --at calc(900ms * var(--tempo)) var(--ease-in-out); touch-action: pan-y; }
.mx-compare.mx-held { transition: none; }
.mx-cmp-pane { grid-area: 1 / 1; padding: var(--space-xl); min-height: 16rem; }
.mx-cmp-pane ul { margin: var(--space-md) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-xs); }
.mx-cmp-pane li { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-input); }
.mx-cmp-t { font-family: var(--font-label, var(--font-mono)); font-size: var(--text-xs); letter-spacing: var(--tracking-label, .1em); text-transform: uppercase; }
.mx-cmp-before { background: color-mix(in srgb, #e5484d 10%, var(--color-paper)); clip-path: inset(0 calc(100% - var(--at) * 1%) 0 0); }
.mx-cmp-before .mx-cmp-t { color: #ff8d8f; } .mx-cmp-before li { background: color-mix(in srgb, #e5484d 12%, transparent); color: var(--color-ink-2); }
.mx-cmp-after { background: color-mix(in srgb, var(--color-accent) 14%, var(--color-paper)); text-align: right; }
.mx-cmp-after .mx-cmp-t { color: var(--color-accent-ink); } .mx-cmp-after li { background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-ink); }
.mx-cmp-handle { position: absolute; top: 0; bottom: 0; left: calc(var(--at) * 1%); width: 2px; margin-left: -1px; background: var(--color-ink); pointer-events: none; }
.mx-cmp-handle i { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  background: var(--color-ink); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.mx-cmp-handle i::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-paper); font-weight: 700; }
.mx-cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.mx-cmp-range:focus-visible + .mx-cmp-handle, .mx-compare:focus-within .mx-cmp-handle i { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* cards stacking on scroll */
.mx-stackscroll { list-style: none; margin: 0; padding: 0; }
.mx-ss-card { position: sticky; top: calc(14vh + var(--i) * 22px); margin-bottom: 18vh; transform-origin: 50% 0;
  transition: transform calc(120ms * var(--tempo)) linear, opacity calc(120ms * var(--tempo)) linear; }
.mx-ss-card:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .mx-ss-card { position: static; margin-bottom: var(--space-md); } }

/* charts that draw: bars grow once the script is ready and the chart is in view */
.mx-chart { margin: 0; } .mx-chart figcaption { font-weight: 600; margin-bottom: var(--space-sm); color: var(--color-ink); }
.mx-chart ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.mx-bar { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr auto; align-items: center; gap: var(--space-sm); color: var(--color-ink-2); }
.mx-bar-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--color-ink) 12%, transparent); overflow: hidden; }
.mx-bar-track i { display: block; height: 100%; border-radius: inherit; transform-origin: 0 50%; transform: scaleX(var(--v));
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-ink));
  transition: transform calc(900ms * var(--tempo)) var(--ease-out), filter calc(300ms * var(--tempo)) ease; transition-delay: calc(var(--k, 0) * 110ms * var(--tempo)); }
.mx-chart.mx-ready:not(.mx-in) .mx-bar-track i { transform: scaleX(0); }
.mx-bar.mx-lit .mx-bar-track i { filter: brightness(1.35); }
.mx-bar-n { color: var(--color-ink); font-variant-numeric: tabular-nums; }

/* line drawing: a path with pathLength 1 draws from 0 to 1 */
.mx-draw { fill: none; stroke: color-mix(in srgb, var(--color-accent) 70%, transparent); stroke-width: 1.4;   /* no non-scaling-stroke: with it a pathLength dash stops short of the end */
  stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset calc(900ms * var(--tempo)) var(--ease-out);
  transition-delay: calc(var(--d, 0) * 120ms * var(--tempo)); }
.mx-drawing .mx-draw { stroke-dashoffset: 1; }

/* lines fanning out */
.mx-fan { position: relative; margin: 0; aspect-ratio: 1000 / 300; min-height: 220px; }
.mx-fan-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.mx-fan-hub { position: absolute; left: 50%; top: 21.3%; transform: translate(-50%, -50%); z-index: 1; padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-card); background: var(--color-accent); color: #fff; font-weight: 700; box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent) 25%, transparent); }
.mx-fan-items { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; }
.mx-fan-items li { position: absolute; left: var(--x); top: 78.7%; translate: -50% 0; white-space: nowrap; padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill, 999px); background: color-mix(in srgb, var(--color-ink) 6%, var(--color-paper)); color: var(--color-ink); font-size: var(--text-sm); }
.mx-fan-items li { transition: scale calc(240ms * var(--tempo)) var(--ease-out), border-color calc(240ms * var(--tempo)) ease; }
.mx-fan-items li.mx-lit { scale: 1.08; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 30%, transparent); }
.mx-fan-dot { position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; opacity: 0;
  background: var(--color-accent-ink); box-shadow: 0 0 12px var(--color-accent); }
@media (max-width: 40rem) { .mx-fan-items li { font-size: var(--text-xs); white-space: normal; text-align: center; max-width: 18vw; } }
.mx-cmp-r { margin: var(--space-md) 0 0; font-weight: 600; color: var(--color-ink); }
.mx-snap .mx-bar-track i, .mx-snap .mx-draw { transition: none !important; }   /* their start state set at once (WI-WEB-31) */

/* ---------- M5 page-wide life (WI-WEB-35; tracker MX-47 MX-48 MX-50 MX-53) ---------- */

/* notifications: one at a time at a corner, the site's own examples */
.mx-notes { position: fixed; left: 16px; bottom: 16px; z-index: 70; pointer-events: none; width: min(340px, calc(100vw - 32px)); }
.mx-note { position: absolute; left: 0; bottom: 0; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px;
  border-radius: 12px; background: var(--color-ink, #fff); color: var(--color-paper, #0b1020); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity calc(260ms * var(--tempo, 1)) ease, transform calc(320ms * var(--tempo, 1)) var(--ease-out, ease-out); }
.mx-note.mx-in { opacity: 1; transform: none; }
.mx-note b { display: block; font-size: 14px; } .mx-note small { display: block; font-size: 12px; opacity: .7; }
.mx-note-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); }
/* on a phone the call-to-action bar is the one floating thing; the notes are a desktop treat (WI-WEB-41) */
@media (max-width: 760px) { .mx-notes { display: none; } }
@media (prefers-reduced-motion: reduce) { .mx-notes { display: none; } }

/* numbers counting up to their own value */
.mx-count { font-variant-numeric: tabular-nums; }

/* the highlighter: a marker stroke that draws itself under a highlighted phrase */
/* a brush stroke under a highlighted phrase: a painted swoosh, thick on the left, tapering and lifting to the right,
   mostly below the letters so it never fights them; it is painted in, left to right, when the heading shows (the owner,
   2026-10-07: "the highlight still doesnt look very good. u can use a brush stroke"). The phrase keeps its own colour. */
.mx-hl-draw { position: relative; display: inline-block; isolation: isolate; }
.mx-hl-draw::after { content: ""; position: absolute; z-index: -1; left: -3%; right: -3%; bottom: -.16em; height: .34em; pointer-events: none;
  background: color-mix(in srgb, var(--color-accent, #2563eb) 78%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'%3E%3Cpath d='M6 22 C 70 14 150 12 230 13 C 300 14 360 8 396 4 L 394 13 C 352 18 300 24 232 25 C 150 26 74 30 10 36 C 2 37 0 26 6 22 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'%3E%3Cpath d='M6 22 C 70 14 150 12 230 13 C 300 14 360 8 396 4 L 394 13 C 352 18 300 24 232 25 C 150 26 74 30 10 36 C 2 37 0 26 6 22 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(0 0 0 0); transition: clip-path calc(650ms * var(--tempo, 1)) cubic-bezier(.3,.7,.2,1); }
.mx-hl-draw.mx-hl-wait::after { clip-path: inset(0 100% 0 0); }

/* the call to action in reach, on a phone */
.mx-cta-bar { display: none; }
@media (max-width: 760px) {
  .mx-cta-bar { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; transform: translateY(150%);
    transition: transform calc(300ms * var(--tempo, 1)) var(--ease-out, ease-out); }
  .mx-cta-bar.mx-up { transform: none; }
}
.mx-cta-btn { display: block; text-align: center; padding: 15px 18px; border-radius: 14px; background: var(--color-accent, #2563eb); color: #fff;
  font-weight: 700; font-size: 16px; text-decoration: none; box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--color-accent, #2563eb) 70%, transparent); }
.mx-cta-btn:focus-visible { outline: 3px solid var(--color-focus, #93c5fd); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .mx-cta-bar { transition: none; } }
.mx-snap.mx-hl-draw::after { transition: none !important; }   /* its start state set at once, never seen un-painting */
