/* The plain-language technology page (technology.html), told as one lesson's
   story: a calm hero, eighteen chapters joined by one glowing thread, a research showcase, that draws
   itself as the reader scrolls (technology-hub.js lays it out, sets
   .ts-ready, .is-lit, .is-in and .is-playing), and a horizontal stage track.
   Colours come from the site tokens in styles.css, so both themes and NAOMI
   off follow. Motion uses transform and opacity only; under reduced motion
   every scene rests in its final state. */

/* ---- Hero ---- */

.ts-hero {
  padding-block-end: clamp(2.75rem, 5vw, 4rem);
}

.ts-hero-inner > .details-back {
  display: flex;
  width: fit-content;
}

.ts-hero-inner h1 {
  max-width: 17ch;
  font-size: clamp(2.3rem, 4.6vw, 3.9rem);
  line-height: 1.04;
  text-wrap: balance;
}

.ts-lede {
  max-width: 42rem;
  text-wrap: pretty;
}

.ts-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  margin-top: clamp(1.4rem, 3vw, 2rem);
  padding: 0.5rem 1.15rem 0.5rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 650;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.ts-cue:hover,
.ts-cue:focus-visible {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 14%, transparent);
}

.ts-cue-arrow {
  position: relative;
  width: 0.7rem;
  height: 1.1rem;
}

.ts-cue-arrow::before {
  position: absolute;
  inset: 0 auto auto 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  content: "";
  transform: translate(-50%, 0.2rem) rotate(45deg);
}

/* ---- The story and its thread ---- */

.ts-story {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
}

.ts-story-shell {
  position: relative;
}

.ts-thread {
  position: absolute;
  inset: 0 var(--page-pad);
  pointer-events: none;
}

.ts-thread-svg {
  display: block;
  overflow: visible;
}

.ts-thread svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-stop-1 {
  stop-color: var(--teal);
}

.ts-stop-2 {
  stop-color: var(--violet);
}

.ts-stop-3 {
  stop-color: var(--lime);
}

.ts-spark-mid {
  stop-color: var(--teal-light);
  stop-opacity: 0.55;
}

.ts-spark-edge {
  stop-color: var(--teal);
  stop-opacity: 0;
}

.ts-thread-track {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-dasharray: 2 7;
}

.ts-thread-glow {
  stroke: url(#ts-thread-gradient);
  stroke-width: 9;
  opacity: 0.16;
}

.ts-thread-line {
  stroke: url(#ts-thread-gradient);
  stroke-width: 2.25;
}

.ts-thread-spark {
  transition: opacity 240ms ease;
}

.ts-thread-spark.is-hidden {
  opacity: 0;
}

/* Until the script lays out the thread, a static line stands in for it. */
html:not(.ts-ready) .ts-thread {
  display: none;
}

html:not(.ts-ready) .ts-chapters::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ts-node-x);
  width: 2px;
  background: linear-gradient(var(--teal), var(--violet), var(--lime));
  content: "";
  opacity: 0.55;
  transform: translateX(-50%);
}

.ts-chapters {
  --ts-node-x: 50%;
  position: relative;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts-chapter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 1fr);
  grid-template-areas: "scene node copy";
  align-items: center;
  padding-block: clamp(2.5rem, 5vw, 4.25rem);
  scroll-margin-top: 5.5rem;
}

.ts-chapter:nth-child(even) {
  grid-template-areas: "copy node scene";
}

.ts-node {
  position: relative;
  z-index: 1;
  grid-area: node;
  justify-self: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid color-mix(in srgb, var(--ts-accent) 70%, var(--line-strong));
  border-radius: 999px;
  background: var(--bg);
  transition: background-color 420ms ease, box-shadow 420ms ease, border-color 420ms ease;
}

.ts-node::after {
  position: absolute;
  inset: -0.55rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--ts-accent) 45%, transparent), transparent 70%);
  content: "";
  opacity: 0;
  transition: opacity 420ms ease;
}

.ts-chapter.is-lit .ts-node,
html:not(.ts-ready) .ts-node {
  border-color: var(--ts-accent);
  background: var(--ts-accent);
}

.ts-chapter.is-lit .ts-node::after {
  opacity: 1;
}

.ts-node--loop {
  width: 1.5rem;
  height: 1.5rem;
}

.ts-node--end {
  width: 1.6rem;
  height: 1.6rem;
  border-width: 2px;
  background: var(--bg);
}

.ts-chapter.is-lit .ts-node--end {
  background: color-mix(in srgb, var(--ts-accent) 30%, var(--bg));
}

/* ---- Chapter copy ---- */

.ts-copy {
  grid-area: copy;
  display: grid;
  gap: 0.95rem;
  justify-items: start;
  min-width: 0;
  max-width: 34rem;
}

.ts-chapter:nth-child(even) .ts-copy {
  justify-self: end;
}

/* Inline flow, so a long kicker wraps beside its number and the status chip
   follows the last word instead of dropping the whole label to a new line. */
.ts-kicker {
  display: block;
  margin: 0;
  color: var(--ts-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.3;
  text-transform: uppercase;
}

.ts-num {
  margin-right: 0.6rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.ts-copy h2,
.ts-status-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.ts-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.68;
}

.ts-copy .ts-quote {
  padding-left: 1rem;
  border-left: 2px solid var(--ts-accent);
  color: var(--text);
  font-size: clamp(1.1rem, 1.6vw, 1.28rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.45;
}

.ts-limit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.65rem;
  padding: 0.7rem 0.95rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-soft) 60%, transparent);
}

.ts-copy .ts-limit,
.ts-status-foot .ts-limit {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ts-limit-label {
  flex: 0 0 auto;
  color: var(--ts-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ts-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  color: var(--ts-accent);
  font-size: 0.94rem;
  font-weight: 700;
}

.ts-link span:first-child {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 220ms ease;
}

.ts-link:hover span:first-child,
.ts-link:focus-visible span:first-child {
  background-size: 100% 1px;
}

.ts-link-arrow {
  display: inline-block;
  transition: transform 220ms ease;
}

.ts-link:hover .ts-link-arrow,
.ts-link:focus-visible .ts-link-arrow {
  transform: translateX(4px);
}

.ts-link:focus-visible,
.ts-cue:focus-visible {
  outline: 3px solid var(--ts-accent, var(--teal));
  outline-offset: 3px;
  border-radius: 0.5rem;
}

.ts-cue:focus-visible {
  border-radius: 999px;
}

/* ---- Scenes: shared panel ---- */

.ts-scene {
  position: relative;
  grid-area: scene;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  max-width: 30rem;
  aspect-ratio: 16 / 11;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--ts-accent) 14%, transparent), transparent 60%),
    linear-gradient(160deg, var(--surface-raised), var(--surface));
  box-shadow: 0 30px 60px -36px color-mix(in srgb, var(--ts-accent) 40%, transparent);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.ts-chapter:nth-child(odd) .ts-scene {
  justify-self: end;
}

.ts-scene .ts-bar,
.ts-tline,
.ts-own-line {
  display: block;
  height: 0.5rem;
  border-radius: 999px;
}

/* 00: the stuck moment. */
.ts-scene--hook {
  align-content: center;
  gap: 1.1rem;
}

.ts-bubble {
  justify-self: start;
  max-width: 94%;
  padding: 0.9rem 1.15rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem 1.25rem 1.25rem 0.35rem;
  background: var(--surface-light);
}

.ts-bubble-who,
.ts-hint-who {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ts-hook-line {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ts-hook-slot {
  position: relative;
  display: inline-block;
  margin-inline: 0.28em;
}

html:lang(ja) .ts-hook-slot,
html:lang(zh) .ts-hook-slot {
  margin-inline: 0.06em;
}

/* The German sentence ends on the verb, so the full stop follows it directly. */
html:lang(de) .ts-hook-slot,
html:lang(de) .ts-used {
  margin-inline-end: 0;
}

.ts-hook-word {
  color: var(--ts-accent);
}

.ts-hook-caret {
  position: absolute;
  top: 0.12em;
  left: 0;
  width: 2px;
  height: 1.1em;
  border-radius: 1px;
  background: var(--ts-accent);
  opacity: 0;
}

.ts-hint {
  justify-self: end;
  display: grid;
  padding: 0.6rem 0.95rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--violet) 55%, transparent);
  border-radius: 1rem 1rem 0.35rem 1rem;
  background: color-mix(in srgb, var(--violet) 12%, var(--surface));
}

.ts-hint-word {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

/* 01: one stream, straight to recognition. */
.ts-scene--listen {
  align-content: center;
  gap: 1.3rem;
}

.ts-bypass {
  justify-self: center;
  padding: 0.3rem 0.8rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.7;
}

.ts-listen-row {
  display: grid;
  grid-template-columns: auto minmax(2rem, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.ts-station {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  max-width: 7rem;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 650;
  text-align: center;
}

.ts-station svg {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 45%, transparent);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--ts-accent) 12%, transparent);
  color: var(--ts-accent);
}

.ts-wire {
  position: relative;
  height: 1rem;
  margin-bottom: 1.4rem;
}

.ts-wire-line {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-accent) 30%, transparent), var(--ts-accent));
  transform: translateY(-50%);
}

.ts-wire-pulse {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.ts-wire-pulse::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--ts-accent);
  box-shadow: 0 0 12px var(--ts-accent);
  content: "";
  transform: translate(-50%, -50%);
}

.ts-lines {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.ts-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
}

.ts-line-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ts-bar--source {
  width: 88%;
  background: var(--text-soft);
  opacity: 0.8;
  transform-origin: left;
}

.ts-bar--translation {
  width: 74%;
  background: var(--ts-accent);
  transform-origin: left;
}

/* 02: the pause tells reply help when to speak. */
.ts-scene--pause {
  align-content: center;
  gap: 1.15rem;
}

.ts-say {
  width: min(80%, 17.5rem);
}

.ts-say-lines {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.15rem;
}

.ts-say-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ts-say-line {
  display: block;
  width: var(--w);
  height: 0.5rem;
  border-radius: 999px;
  background: var(--text-soft);
  opacity: 0.75;
  transform-origin: left;
}

.ts-say-q {
  color: var(--ts-accent);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.ts-gap {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding-right: 0.75rem;
}

.ts-gap-label,
.ts-dial-stop,
.ts-said {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ts-gap-track {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-accent) 18%, transparent) 0 50%, color-mix(in srgb, var(--line-strong) 55%, transparent) 50% 100%);
}

.ts-gap-fill {
  position: absolute;
  inset: 0 50% 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-accent) 45%, transparent), var(--ts-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--ts-accent) 55%, transparent);
  transform-origin: left;
}

.ts-gap-tick {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-light);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.ts-gap-tick--q {
  left: 50%;
  border-color: var(--ts-accent);
  color: var(--ts-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ts-accent) 18%, transparent);
}

.ts-gap-tick--stop {
  left: 100%;
  border-style: dashed;
  opacity: 0.75;
}

.ts-help-chip {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 55%, transparent);
  border-radius: 1rem 1rem 0.35rem 1rem;
  background: color-mix(in srgb, var(--ts-accent) 12%, var(--surface));
  box-shadow: 0 0 34px -12px color-mix(in srgb, var(--ts-accent) 70%, transparent);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.ts-help-dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ts-accent);
}

.ts-help-bars {
  display: grid;
  gap: 0.3rem;
}

.ts-help-bars span {
  display: block;
  width: 3.2rem;
  height: 0.32rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-accent) 65%, transparent);
}

.ts-help-bars span + span {
  width: 2.1rem;
}

/* 03: help steps back while the teacher is testing; the transcript runs on. */
.ts-scene--quiet {
  align-content: center;
  gap: 0.95rem;
}

.ts-quiz {
  max-width: 92%;
}

.ts-quiz-line {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ts-hold {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.ts-help-chip--held {
  border-style: dashed;
  box-shadow: none;
  opacity: 0.3;
  transform: scale(0.94);
}

.ts-turn {
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  background: var(--ts-accent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--ts-accent) 45%, transparent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 04: one dial, from a cue word to a whole reply; used words are underlined. */
.ts-scene--dial {
  align-content: center;
  gap: 1.25rem;
}

.ts-dial {
  display: grid;
  gap: 0.7rem;
  width: 100%;
}

.ts-dial-track {
  position: relative;
  height: 0.4rem;
  margin-inline: 0.6rem;
  border-radius: 999px;
  background: var(--line-strong);
}

.ts-dial-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-accent) 35%, transparent), var(--ts-accent));
  transform-origin: left;
}

.ts-dial-runner {
  position: absolute;
  inset: 0;
}

.ts-dial-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.2rem;
  height: 1.2rem;
  border: 3px solid var(--ts-accent);
  border-radius: 999px;
  background: var(--surface-light);
  box-shadow: 0 0 16px color-mix(in srgb, var(--ts-accent) 60%, transparent);
  transform: translate(-50%, -50%);
}

.ts-dial-runner {
  transform: translateX(100%);
}

.ts-dial-stops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.ts-dial-stop {
  color: var(--text-soft);
  opacity: 0.5;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.ts-dial-stop--2 {
  text-align: center;
}

.ts-dial-stop--3 {
  text-align: right;
  opacity: 1;
}

.ts-card {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.05rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 40%, var(--line));
  border-radius: 1.1rem;
  background: var(--surface-light);
}

.ts-card .ts-bubble-who {
  margin-bottom: 0;
}

.ts-variants {
  display: grid;
  align-items: center;
  min-height: 2.7em;
}

.ts-variant {
  grid-area: 1 / 1;
  color: var(--text);
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ts-variant--1,
.ts-variant--2 {
  opacity: 0;
}

.ts-variant-word {
  padding: 0.1rem 0.6rem 0.15rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-accent) 12%, transparent);
  color: var(--ts-accent);
}

.ts-blank {
  display: inline-block;
  width: 3.4em;
  height: 1em;
  margin-left: 0.3em;
  border-bottom: 2px dashed var(--ts-accent);
  vertical-align: -0.12em;
}

.ts-used {
  position: relative;
  display: inline-block;
  margin-inline: 0.28em;
  color: var(--ts-accent);
}

.ts-used::after {
  position: absolute;
  right: 0;
  bottom: -0.08em;
  left: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--ts-accent);
  box-shadow: 0 0 8px var(--ts-accent);
  content: "";
  transform-origin: left;
}

html:lang(ja) .ts-used,
html:lang(zh) .ts-used,
html:lang(ja) .ts-blank,
html:lang(zh) .ts-blank {
  margin-inline: 0.06em;
}

.ts-said {
  justify-self: start;
  color: var(--ts-accent);
  font-size: 0.62rem;
}

/* 05: the teacher's moment. */
.ts-proposal {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 40%, var(--line));
  border-radius: 1.1rem;
  background: var(--surface-light);
}

.ts-proposal-head {
  color: var(--ts-accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ts-moment {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}

.ts-moment-mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--ts-accent);
}

.ts-moment-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.ts-bar--moment {
  background: var(--text-soft);
  opacity: 0.55;
}

.ts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ts-action {
  position: relative;
  padding: 0.38rem 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.ts-action::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in srgb, var(--ts-accent) 30%, transparent);
  box-shadow: inset 0 0 0 1px var(--ts-accent);
  content: "";
  opacity: 0;
}

.ts-action {
  isolation: isolate;
}

/* 06: the smallest useful memory. */
.ts-scene--memory {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.ts-transcript {
  display: grid;
  justify-self: stretch;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.ts-tline {
  width: var(--w);
  background: var(--muted);
  opacity: 0.55;
}

.ts-tline--kept {
  position: relative;
  background: var(--ts-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ts-accent) 55%, transparent);
  opacity: 1;
}

.ts-tline--kept::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.3rem);
  width: 3.4rem;
  height: 0;
  border-top: 1.5px dashed var(--ts-accent);
  content: "";
}

.ts-pin {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 50%, transparent);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--ts-accent) 10%, var(--surface));
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.ts-pin svg {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--ts-accent);
  color: var(--bg);
}

/* 07: the loop between lessons. */
.ts-orbit {
  position: relative;
  width: min(82%, 15.5rem);
  aspect-ratio: 1;
}

.ts-orbit svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ts-orbit-ring {
  stroke: color-mix(in srgb, var(--ts-accent) 55%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 3 6;
}

.ts-orbit-arrows {
  stroke: var(--ts-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-orbit-runner {
  fill: var(--ts-accent);
  transform: rotate(45deg);
  transform-box: view-box;
  transform-origin: 100px 100px;
  filter: drop-shadow(0 0 6px var(--ts-accent));
}

.ts-orbit-label {
  position: absolute;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-light);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.ts-orbit-label--top {
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ts-orbit-label--right {
  top: 50%;
  left: 85%;
  transform: translate(-50%, -50%);
}

.ts-orbit-label--bottom {
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ts-orbit-label--left {
  top: 50%;
  left: 15%;
  transform: translate(-50%, -50%);
}

/* 08: every lesson in its own lane. */
.ts-scene--lanes {
  align-content: center;
  gap: 1.15rem;
}

.ts-lane {
  position: relative;
  display: block;
  width: 100%;
  height: 1.9rem;
}

.ts-lane::before {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  left: 0;
  border-top: 1.5px dashed color-mix(in srgb, var(--ts-accent) 40%, var(--line));
  content: "";
}

.ts-lane::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--ts-accent);
  border-radius: 999px;
  background: var(--surface);
  content: "";
  transform: translateY(-50%);
}

.ts-lane-token {
  position: absolute;
  inset: 0 3.6rem 0 0;
}

.ts-lane-token::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 3rem;
  height: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 60%, transparent);
  border-radius: 999px;
  background:
    radial-gradient(circle at 0.75rem 50%, var(--ts-accent) 0 0.22rem, transparent 0.25rem),
    color-mix(in srgb, var(--ts-accent) 16%, var(--surface));
  content: "";
  transform: translateY(-50%);
}

.ts-lane--2 .ts-lane-token {
  transform: translateX(55%);
}

.ts-lane--3 .ts-lane-token {
  transform: translateX(25%);
}

.ts-lane-pass {
  justify-self: start;
  margin-top: 0.25rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 650;
}

/* 09: the conversation the learner holds later. */
.ts-open-bubble {
  display: grid;
  gap: 0.7rem;
  width: min(88%, 21rem);
  padding: 1.15rem 1.3rem 1.35rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 45%, transparent);
  border-radius: 1.5rem 1.5rem 1.5rem 0.4rem;
  background: color-mix(in srgb, var(--ts-accent) 7%, var(--surface));
  box-shadow: 0 0 60px -18px color-mix(in srgb, var(--ts-accent) 45%, transparent);
}

.ts-own-line {
  width: var(--w);
  background: linear-gradient(90deg, var(--ts-accent), color-mix(in srgb, var(--ts-accent) 35%, transparent));
  transform-origin: left;
}

/* ---- Status chips: what runs in the alpha today, what comes in beta, and
   what is still research. One per product chapter, beside its kicker. ---- */

.ts-status-chip {
  --ts-chip: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0.15rem 0 0.15rem 0.6rem;
  padding: 0.24rem 0.62rem 0.24rem 0.52rem;
  vertical-align: 0.08em;
  border: 1px solid color-mix(in srgb, var(--ts-chip) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-chip) 11%, transparent);
  color: var(--text);
  font-size: 0.6rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}

.ts-status-chip::before {
  flex: 0 0 auto;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--ts-chip);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ts-chip) 70%, transparent);
  content: "";
}

.ts-status-chip--beta {
  --ts-chip: var(--violet);
  border-style: dashed;
}

.ts-status-chip--beta::before {
  border: 1.5px solid var(--ts-chip);
  background: transparent;
  box-shadow: none;
}

.ts-status-chip--research {
  --ts-chip: var(--teal);
}

.ts-status-chip--research::before {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 1px;
  transform: rotate(45deg);
}

/* In implementation: amber, its dot half filled, for work under way. */
.ts-status-chip--building {
  --ts-chip: var(--ts-amber);
}

.ts-status-chip--building::before {
  border: 1.5px solid var(--ts-chip);
  background: linear-gradient(90deg, var(--ts-chip) 50%, transparent 50%);
  box-shadow: 0 0 6px color-mix(in srgb, var(--ts-chip) 55%, transparent);
}

/* 10: exercises from every lesson. */
.ts-scene--exercises {
  align-content: center;
  gap: 0.85rem;
}

.ts-ex-transcript {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.ts-ex-line {
  display: block;
  width: var(--w);
  height: 0.45rem;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.5;
}

.ts-ex-hit {
  position: relative;
  justify-self: start;
  max-width: 100%;
  padding: 0.1rem 0.45rem;
  isolation: isolate;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

.ts-ex-hit::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--ts-accent) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ts-accent) 60%, transparent);
  content: "";
  transform-origin: left;
}

.ts-ex-card {
  justify-self: end;
  display: grid;
  gap: 0.35rem;
  width: min(90%, 19rem);
  padding: 0.65rem 0.9rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 50%, var(--line));
  border-radius: 1rem 1rem 0.35rem 1rem;
  background: var(--surface-light);
  box-shadow: 0 0 34px -14px color-mix(in srgb, var(--ts-accent) 70%, transparent);
}

.ts-ex-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.ts-ex-card .ts-bubble-who {
  margin: 0;
}

.ts-ex-keep {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--ts-accent);
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ts-ex-phrase {
  color: var(--text);
  font-size: clamp(0.95rem, 1.6vw, 1.06rem);
  font-weight: 680;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ts-ex-schedule {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.ts-ex-label,
.ts-lin-tag,
.ts-gate-label,
.ts-carry-label,
.ts-socket-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* The gaps grow, as the review intervals do. */
.ts-ex-days {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1.55fr 1.9fr auto;
  align-items: center;
}

.ts-ex-days::before {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  left: 0.9rem;
  border-top: 1.5px dashed color-mix(in srgb, var(--ts-accent) 40%, var(--line));
  content: "";
}

.ts-ex-day {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding-inline: 0.3rem;
  justify-self: start;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 60%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-accent) 16%, var(--surface));
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

/* 11: lineage and evidence, through the admission gate. */
.ts-scene--lineage {
  align-content: center;
  gap: 0.8rem;
}

.ts-lin-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.ts-lin-mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--ts-accent);
  box-shadow: 0 0 10px var(--ts-accent);
}

.ts-bar--lin {
  width: 82%;
  background: var(--text-soft);
  opacity: 0.7;
}

.ts-lin-versions {
  position: relative;
  display: grid;
  gap: 0.45rem;
  width: 100%;
  padding-left: 1.5rem;
}

/* The dashed line that ties every version back to its source line. */
.ts-lin-versions::before {
  position: absolute;
  top: -0.8rem;
  bottom: 1.6rem;
  left: 0.6rem;
  border-left: 1.5px dashed var(--ts-accent);
  content: "";
}

.ts-lin-card {
  position: relative;
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.8rem;
  background: var(--surface-light);
}

.ts-lin-card::before {
  position: absolute;
  top: 1.05rem;
  left: -0.92rem;
  width: 0.9rem;
  border-top: 1.5px dashed var(--ts-accent);
  content: "";
}

.ts-lin-card--old {
  opacity: 0.5;
  transform: scale(0.97);
  transform-origin: left center;
}

.ts-lin-card--new {
  border-color: color-mix(in srgb, var(--ts-accent) 60%, var(--line));
  box-shadow: 0 0 30px -12px color-mix(in srgb, var(--ts-accent) 70%, transparent);
}

.ts-lin-card--new .ts-lin-tag {
  color: var(--ts-accent);
}

.ts-bar--ver {
  width: var(--w);
  background: var(--text-soft);
  opacity: 0.55;
}

.ts-gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  width: 100%;
}

.ts-gate-outs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ts-gate-out {
  position: relative;
  padding: 0.3rem 0.7rem;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 650;
}

.ts-gate-out::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in srgb, var(--ts-accent) 30%, transparent);
  box-shadow: inset 0 0 0 1px var(--ts-accent);
  content: "";
  opacity: 0;
}

/* 12: the learner model that goes with the learner. */
.ts-scene--carry {
  align-content: center;
  gap: 1rem;
}

.ts-carry-teachers {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
}

.ts-carry-teacher {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-light);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.ts-carry-teacher--a {
  opacity: 0.45;
}

.ts-carry-teacher--b {
  border-color: var(--ts-accent);
  box-shadow: 0 0 22px -6px color-mix(in srgb, var(--ts-accent) 70%, transparent);
  color: var(--text);
}

.ts-carry-path {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.ts-carry-track {
  position: relative;
  height: 0.55rem;
  margin-inline: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-strong) 55%, transparent);
}

.ts-carry-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-accent) 40%, transparent), var(--ts-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--ts-accent) 50%, transparent);
  transform-origin: left;
}

/* The handoff point: the path runs through it without a break. */
.ts-carry-handoff {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.35rem;
  height: 1.35rem;
  border: 1.5px dashed var(--ts-accent);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.ts-carry-head {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
}

.ts-carry-head::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.95rem;
  height: 0.95rem;
  border: 3px solid var(--ts-accent);
  border-radius: 999px;
  background: var(--surface-light);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ts-accent) 60%, transparent);
  content: "";
  transform: translate(-50%, -50%);
}

.ts-carry-grant {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.8rem 0.38rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--ts-accent) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-accent) 8%, var(--surface));
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}

.ts-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 2rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--ts-accent);
}

.ts-toggle-knob {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--bg);
  transform: translateX(0.9rem);
}

/* 13: the two speech-recognition harnesses. */
.ts-scene--asr {
  align-content: center;
  gap: 0.75rem;
}

.ts-run {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.85rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.ts-run--live {
  border-color: color-mix(in srgb, var(--ts-accent) 40%, var(--line));
}

.ts-run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.ts-run-name {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ts-run-badge {
  padding: 0.14rem 0.55rem;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 0.64rem;
  font-weight: 700;
}

.ts-run-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.ts-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 1.6rem;
}

.ts-wave span {
  display: block;
  width: 3px;
  height: var(--h);
  border-radius: 2px;
  background: var(--ts-accent);
}

.ts-results {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 0.35rem;
}

.ts-result {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--text-soft);
  opacity: 0.7;
  transform-origin: left;
}

.ts-run-check {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--success);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

/* 14: every provider plugs into the same contract. */
.ts-scene--providers {
  align-content: center;
  justify-items: center;
  gap: 0.95rem;
}

.ts-socket {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}

.ts-socket-slot {
  display: grid;
  place-items: center;
  width: 5.4rem;
  height: 3.4rem;
  overflow: hidden;
  border: 2px dashed color-mix(in srgb, var(--ts-accent) 60%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ts-accent) 8%, transparent);
}

.ts-plug {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: 4.1rem;
  height: 2.4rem;
  border: 1px solid var(--ts-accent);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--ts-accent) 22%, var(--surface-light));
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  opacity: 0;
}

.ts-plug--1 {
  opacity: 1;
}

.ts-faults {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.ts-fault {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.ts-same {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.85rem 0.32rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--success) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 750;
}

.ts-same-check {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--success);
  color: var(--bg);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

/* 15: zero model training. Words leave the lesson bubble for the provider
   chip and one answer returns; the branch toward a model's training stays
   dark behind a shut gate and padlock, and the model glyph never lights. */
.ts-scene--training {
  align-content: center;
  justify-items: center;
  gap: 0.9rem;
}

.ts-train-svg {
  width: 100%;
  max-width: 26rem;
  height: auto;
  overflow: visible;
}

.ts-train-svg * {
  transform-box: fill-box;
  transform-origin: center;
}

.ts-train-stop--a { stop-color: var(--teal); }
.ts-train-stop--b { stop-color: var(--violet-light); }
.ts-train-stop--core { stop-color: color-mix(in srgb, var(--teal) 55%, transparent); }
.ts-train-stop--clear { stop-color: transparent; }

.ts-train-bubble {
  stroke: var(--line-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
  fill: color-mix(in srgb, var(--surface-light) 70%, transparent);
}

.ts-train-bubble-glow {
  stroke: var(--lime);
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--lime) 70%, transparent));
}

.ts-train-word {
  stroke: color-mix(in srgb, var(--text-soft) 70%, transparent);
  stroke-width: 4;
  stroke-linecap: round;
}

.ts-train-wire {
  stroke: url(#ts-train-flow);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.45;
}

.ts-train-halo {
  fill: url(#ts-train-glow);
  opacity: 0.5;
}

.ts-train-pins {
  stroke: color-mix(in srgb, var(--violet-light) 55%, transparent);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.ts-train-chip {
  stroke: color-mix(in srgb, var(--violet-light) 75%, var(--teal));
  stroke-width: 1.8;
  fill: color-mix(in srgb, var(--violet) 16%, var(--surface));
}

.ts-train-die {
  stroke: color-mix(in srgb, var(--teal) 45%, transparent);
  stroke-width: 1.2;
  fill: color-mix(in srgb, var(--teal) 10%, transparent);
}

.ts-train-core {
  fill: var(--teal);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--teal) 80%, transparent));
}

.ts-train-ring {
  stroke: var(--teal);
  stroke-width: 1.4;
  opacity: 0;
}

/* A token is one round, zero-length dash on its path: moving the dash offset
   carries the dot along the curve. */
.ts-train-token {
  stroke: var(--teal);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0.001 2;
  stroke-dashoffset: 0;
  opacity: 0;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--teal) 85%, transparent));
}

.ts-train-token--answer {
  stroke: var(--lime);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--lime) 85%, transparent));
}

.ts-train-token--ghost {
  stroke: color-mix(in srgb, var(--violet-light) 60%, var(--muted));
  stroke-width: 5;
  filter: none;
}

.ts-train-branch {
  stroke: color-mix(in srgb, var(--muted) 55%, transparent);
  stroke-width: 1.6;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}

.ts-train-model {
  opacity: 0.32;
}

.ts-train-model path {
  stroke: var(--muted);
  stroke-width: 1;
}

.ts-train-model circle {
  stroke: var(--muted);
  stroke-width: 1.2;
  fill: var(--surface);
}

.ts-train-spark {
  fill: color-mix(in srgb, var(--violet-light) 70%, var(--muted));
  opacity: 0;
}

.ts-train-post {
  stroke: var(--line-strong);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-train-shutter {
  transform-origin: 50% 0;
}

.ts-train-panel {
  stroke: color-mix(in srgb, var(--success) 40%, var(--line-strong));
  stroke-width: 1.2;
  fill: color-mix(in srgb, var(--success) 10%, var(--surface));
}

.ts-train-slats {
  stroke: color-mix(in srgb, var(--success) 30%, var(--line));
  stroke-width: 1.4;
  stroke-linecap: round;
}

.ts-train-seal {
  fill: color-mix(in srgb, var(--success) 70%, transparent);
  opacity: 0;
}

.ts-train-shackle {
  stroke: var(--success);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.ts-train-lock-body {
  fill: var(--success);
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--success) 45%, transparent));
}

.ts-train-keyhole {
  stroke: var(--bg);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.ts-train-lock-ring {
  stroke: var(--success);
  stroke-width: 1.4;
  opacity: 0;
}

.ts-train-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.ts-train-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.ts-train-label::before {
  content: "";
  flex: none;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--teal);
}

.ts-train-label--provider::before {
  background: var(--violet-light);
}

.ts-train-labels > .ts-train-off {
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--text);
}

.ts-train-off::before {
  background: var(--success);
}

/* 16: zero data retention and data in Europe. The lesson's words travel to
   the AI node and one answer returns; the request trail behind them then
   retracts and crumbles to nothing. A migration arrow glides from a neutral
   spot into a ring of twelve amber points around the server, and the ring
   lights point by point. */
.ts-scene--europe {
  align-content: center;
  justify-items: center;
  gap: 0.9rem;
}

.ts-eu-svg {
  width: 100%;
  max-width: 26rem;
  height: auto;
  overflow: visible;
}

.ts-eu-svg * {
  transform-box: fill-box;
  transform-origin: center;
}

.ts-eu-stop--ai { stop-color: color-mix(in srgb, var(--teal) 50%, transparent); }
.ts-eu-stop--eu { stop-color: color-mix(in srgb, var(--ts-amber) 20%, transparent); }
.ts-eu-stop--clear { stop-color: transparent; }

.ts-eu-bubble {
  stroke: var(--line-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
  fill: color-mix(in srgb, var(--surface-light) 70%, transparent);
}

.ts-eu-bubble-glow {
  stroke: var(--lime);
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--lime) 70%, transparent));
}

.ts-eu-word {
  stroke: color-mix(in srgb, var(--text-soft) 70%, transparent);
  stroke-width: 4;
  stroke-linecap: round;
}

/* The trail is the only line between the bubble and the AI node: it exists
   while a request travels and is gone once the answer is back. */
.ts-eu-trail {
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--teal) 60%, transparent));
}

.ts-eu-mote {
  fill: color-mix(in srgb, var(--teal) 70%, var(--muted));
  opacity: 0;
}

.ts-eu-halo {
  fill: url(#ts-eu-ai-glow);
  opacity: 0.5;
}

.ts-eu-ai {
  stroke: color-mix(in srgb, var(--violet-light) 75%, var(--teal));
  stroke-width: 1.8;
  fill: color-mix(in srgb, var(--violet) 16%, var(--surface));
}

.ts-eu-ai-ring {
  stroke: var(--teal);
  stroke-width: 1.4;
  opacity: 0;
}

.ts-eu-spark {
  fill: var(--teal);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--teal) 80%, transparent));
}

.ts-eu-link {
  stroke: color-mix(in srgb, var(--muted) 50%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

/* A token is one round, zero-length dash on its path, as in chapter 15. */
.ts-eu-token {
  stroke: var(--teal);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0.001 2;
  stroke-dashoffset: 0;
  opacity: 0;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--teal) 85%, transparent));
}

.ts-eu-token--answer {
  stroke: var(--lime);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--lime) 85%, transparent));
}

.ts-eu-token--link {
  stroke-width: 4.5;
}

.ts-eu-track {
  stroke: color-mix(in srgb, var(--ts-amber) 38%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}

/* At rest the arrow has arrived inside the ring. */
.ts-eu-arrow {
  stroke: var(--ts-amber);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  transform: translate(40px, -31px);
}

.ts-eu-ring-glow {
  fill: url(#ts-eu-ring-glow);
  opacity: 0.7;
}

.ts-eu-star {
  fill: var(--ts-amber);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ts-amber) 70%, transparent));
}

.ts-eu-rack {
  stroke: color-mix(in srgb, var(--ts-amber) 45%, var(--line-strong));
  stroke-width: 1.6;
  fill: color-mix(in srgb, var(--ts-amber) 8%, var(--surface));
}

.ts-eu-slots {
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
}

.ts-eu-led {
  fill: var(--success);
}

/* The scene's labels reuse chapter 15's pills: a hollow dot for "no trace",
   an amber pill for Europe. */
.ts-eu-label--trace::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--teal);
}

.ts-train-labels > .ts-eu-label--eu {
  border-color: color-mix(in srgb, var(--ts-amber) 55%, transparent);
  background: color-mix(in srgb, var(--ts-amber) 12%, transparent);
  color: var(--text);
}

.ts-eu-label--eu::before {
  background: var(--ts-amber);
}

/* 17: always researching. The scene is a small lab orbit; below the copy,
   the idea cards spread out from the end of the thread like a constellation. */
.ts-chapter.ts-chapter--research {
  grid-template-areas:
    "copy node scene"
    "ideas ideas ideas";
  row-gap: clamp(2.2rem, 4vw, 3.2rem);
}

.ts-lab {
  width: min(76%, 14.5rem);
  aspect-ratio: 1;
}

.ts-lab svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ts-lab-ring {
  stroke: color-mix(in srgb, var(--ts-accent) 45%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 3 6;
}

.ts-lab-ring--inner {
  stroke-dasharray: 2 5;
  opacity: 0.7;
}

.ts-lab-orbit {
  fill: var(--ts-accent);
  transform-box: view-box;
  transform-origin: 100px 100px;
  filter: drop-shadow(0 0 5px var(--ts-accent));
}

.ts-lab-orbit--1 {
  transform: rotate(40deg);
}

.ts-lab-orbit--2 {
  fill: var(--teal);
  transform: rotate(200deg);
}

.ts-lab-orbit--3 {
  fill: var(--lime);
  transform: rotate(120deg);
}

.ts-lab-core {
  fill: color-mix(in srgb, var(--ts-accent) 28%, var(--surface));
  stroke: var(--ts-accent);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
}

.ts-ideas {
  position: relative;
  grid-area: ideas;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  isolation: isolate;
}

/* A soft field of light under the cards, centred on the thread's end. */
.ts-ideas::before {
  position: absolute;
  inset: -4rem 0 -2rem;
  z-index: -1;
  background: radial-gradient(ellipse 50% 50% at 50% 38%, color-mix(in srgb, var(--ts-accent) 12%, transparent), transparent 100%);
  content: "";
  pointer-events: none;
}

.ts-idea {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.6rem;
  padding: 1.25rem 1.15rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  transition:
    transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 320ms ease,
    box-shadow 320ms ease;
}

/* The middle column sits lower, so the cards read as a constellation, not a table. */
.ts-idea:nth-child(3n + 2) {
  margin-top: 1.8rem;
}

/* Each card is a star: a small point of light on its top edge. */
.ts-idea::before {
  position: absolute;
  top: -0.3rem;
  left: 1.3rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--ts-accent);
  box-shadow: 0 0 10px var(--ts-accent);
  content: "";
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 320ms ease;
}

.ts-idea:hover,
.ts-idea:focus-visible {
  border-color: color-mix(in srgb, var(--ts-accent) 55%, var(--line));
  box-shadow: 0 26px 50px -30px color-mix(in srgb, var(--ts-accent) 75%, transparent);
  transform: translateY(-4px);
}

.ts-idea:hover::before,
.ts-idea:focus-visible::before {
  box-shadow: 0 0 18px 2px var(--ts-accent);
  transform: scale(1.35);
}

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

.ts-idea .ts-status-chip {
  margin: 0;
}

.ts-idea h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 740;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

.ts-idea p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- Where we are: the horizontal stage track ---- */

.ts-status {
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3rem, 6vw, 5.5rem);
}

.ts-status-head {
  display: grid;
  gap: 1rem;
  justify-items: start;
  max-width: 46rem;
}

.ts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.ts-chip--live {
  border-color: color-mix(in srgb, var(--success) 55%, transparent);
  color: var(--text);
}

.ts-chip--live::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent);
  content: "";
}

.ts-track-wrap {
  margin-top: clamp(1.8rem, 3.5vw, 2.6rem);
}

.ts-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 1rem 0 0.6rem;
  list-style: none;
}

.ts-track:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.ts-stage {
  --ts-gap: 0.9rem;
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 2.4rem 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  scroll-snap-align: start;
  transition: transform 220ms ease, border-color 220ms ease;
}

.ts-stage:hover,
.ts-stage:focus-visible {
  border-color: color-mix(in srgb, var(--ts-accent) 50%, var(--line));
  transform: translateY(-2px);
}

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

/* The rail: one segment per stage, from its dot to the next card. */
.ts-stage::before {
  position: absolute;
  top: 1.15rem;
  right: calc(-1 * var(--ts-gap) - 1px);
  left: 1.45rem;
  border-top: 2px dashed var(--line-strong);
  content: "";
}

.ts-stage:last-child::before {
  display: none;
}

.ts-stage--done::before,
.ts-stage--current::before {
  border-top-style: solid;
  border-top-color: color-mix(in srgb, var(--ts-accent) 70%, transparent);
}

.ts-stage-dot {
  position: absolute;
  top: calc(1.15rem - 0.5rem + 1px);
  left: 1rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--muted);
  border-radius: 999px;
  background: var(--surface);
}

.ts-stage--done .ts-stage-dot {
  border-color: var(--ts-accent);
  background: var(--ts-accent);
}

.ts-stage--current {
  border-color: color-mix(in srgb, var(--ts-accent) 55%, var(--line));
  background:
    radial-gradient(circle at 1.5rem 1.2rem, color-mix(in srgb, var(--ts-accent) 22%, transparent), transparent 9rem),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
  box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--ts-accent) 60%, transparent);
}

.ts-stage--current .ts-stage-dot {
  border-color: var(--ts-accent);
  background: var(--bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ts-accent) 22%, transparent);
}

.ts-stage--current .ts-stage-dot::after {
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: var(--ts-accent);
  content: "";
}

.ts-stage--next .ts-stage-dot {
  border-color: color-mix(in srgb, var(--ts-accent) 70%, transparent);
}

.ts-stage--planned {
  border-style: dashed;
  background: transparent;
}

.ts-stage-status {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ts-stage--done .ts-stage-status,
.ts-stage--current .ts-stage-status {
  color: var(--ts-accent);
}

.ts-here {
  position: absolute;
  top: -0.7rem;
  right: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--ts-accent);
  color: var(--bg);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  box-shadow: 0 0 18px color-mix(in srgb, var(--ts-accent) 55%, transparent);
}

.ts-stage-name {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.ts-stage--planned .ts-stage-name {
  color: var(--text-soft);
}

.ts-stage p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.ts-status-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin-top: 1.4rem;
}

.ts-status-foot .ts-limit {
  max-width: 44rem;
}

/* ---- Motion, only when it is welcome ----
   Every scene loops in at most six seconds: a clear beginning, one key
   moment, then a visible rest before it clears. Sub-elements are staggered,
   never competing; only transform and opacity move, except two tiny glow
   rings. Loops pause while their chapter is off screen (.is-playing), and
   under reduced motion every scene rests in its final, fully drawn state. */

:root {
  --ts-amber: #f4cf72;
  --ts-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ts-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ts-soft: cubic-bezier(0.45, 0, 0.55, 1);
}

/* Glow layers the loops fade in and out, so no border or colour animates. */
.ts-orbit-label::before,
.ts-fault::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in srgb, var(--ts-accent) 26%, var(--surface-light));
  box-shadow:
    inset 0 0 0 1px var(--ts-accent),
    0 0 18px -4px color-mix(in srgb, var(--ts-accent) 70%, transparent);
  content: "";
  opacity: 0;
}

.ts-orbit-label,
.ts-fault {
  isolation: isolate;
}

.ts-fault {
  position: relative;
}

/* The strike that marks the old version as superseded draws itself. */
.ts-lin-card--old .ts-lin-tag {
  position: relative;
  justify-self: start;
}

.ts-lin-card--old .ts-lin-tag::after {
  position: absolute;
  top: 50%;
  right: -0.1em;
  left: -0.1em;
  height: 1.5px;
  background: currentColor;
  content: "";
  transform-origin: left;
}

.ts-thread-spark {
  transform-box: fill-box;
  transform-origin: center;
}

.ts-cue {
  transition:
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 320ms var(--ts-out),
    transform 320ms var(--ts-out);
}

.ts-cue:hover,
.ts-cue:focus-visible {
  box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--teal) 80%, transparent);
  transform: translateY(-2px);
}

.ts-stage {
  transition:
    transform 320ms var(--ts-out),
    border-color 220ms ease,
    box-shadow 320ms var(--ts-out);
}

.ts-stage:hover,
.ts-stage:focus-visible {
  box-shadow: 0 22px 44px -28px color-mix(in srgb, var(--ts-accent) 70%, transparent);
  transform: translateY(-3px);
}

.ts-idea {
  transition:
    transform 420ms var(--ts-out),
    border-color 320ms ease,
    box-shadow 420ms var(--ts-out);
}

.ts-idea:hover,
.ts-idea:focus-visible {
  transform: translateY(-5px);
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero: the cue drops once toward the story, then rests. */
  .ts-cue-arrow::before {
    animation: ts-cue 2.8s var(--ts-in-out) infinite;
  }

  /* Chapter entry: the scene rises first, its copy follows. */
  html.ts-ready .ts-chapter:not(.is-in) .ts-scene,
  html.ts-ready .ts-chapter:not(.is-in) .ts-copy {
    opacity: 0;
    transform: translateY(28px);
  }

  html.ts-ready .ts-scene,
  html.ts-ready .ts-copy {
    transition:
      opacity 900ms var(--ts-out),
      transform 900ms var(--ts-out);
  }

  html.ts-ready .ts-copy {
    transition-delay: 140ms;
  }

  /* The thread: the spark breathes at the reading line, and a node lands
     (one scale and glow pulse) the moment the thread reaches it. */
  .ts-thread-spark {
    animation: ts-spark 2.6s var(--ts-soft) infinite;
  }

  .ts-chapter.is-lit .ts-node {
    animation: ts-node-land 900ms var(--ts-out) both;
  }

  .ts-chapter.is-lit .ts-node::after {
    animation: ts-node-glow 1300ms var(--ts-out) both;
  }

  /* Loops run only while their chapter is on screen (JS sets .is-playing). */
  html.ts-ready .ts-chapter:not(.is-playing) .ts-scene *,
  html.ts-ready .ts-chapter:not(.is-playing) .ts-scene *::before,
  html.ts-ready .ts-chapter:not(.is-playing) .ts-scene *::after,
  html.ts-ready .ts-chapter:not(.is-playing) .ts-idea::before {
    animation-play-state: paused;
  }

  /* 00: the caret waits, the hint arrives, the word lands, the sentence completes. */
  .ts-hook-caret {
    animation: ts-caret 6s steps(1, end) infinite;
  }

  .ts-hint {
    animation: ts-hint 6s var(--ts-out) infinite;
  }

  .ts-hook-word {
    animation: ts-hook-word 6s var(--ts-out) infinite;
  }

  .ts-hook-after {
    animation: ts-hook-after 6s var(--ts-out) infinite;
  }

  /* 01: the stream travels; the text, then its translation, writes itself. */
  .ts-wire-pulse {
    animation: ts-pulse 2.4s var(--ts-in-out) infinite both;
  }

  .ts-wire-pulse--2 {
    animation-delay: -1.6s;
  }

  .ts-wire-pulse--3 {
    animation-delay: -0.8s;
  }

  .ts-bar--source {
    animation: ts-bar-source 4.8s var(--ts-out) infinite;
  }

  .ts-bar--translation {
    animation: ts-bar-translation 4.8s var(--ts-out) infinite;
  }

  /* 02: the speaker finishes, the pause fills to the question mark, help arrives. */
  .ts-say-line {
    animation: ts-say 6s var(--ts-out) infinite;
  }

  .ts-say-end .ts-say-line {
    animation-name: ts-say-2;
  }

  .ts-say-q {
    animation: ts-say-q 6s var(--ts-out) infinite;
  }

  .ts-gap-fill {
    animation: ts-gap 6s var(--ts-soft) infinite;
  }

  .ts-gap-tick--q {
    animation: ts-tick 6s var(--ts-out) infinite;
  }

  .ts-help-chip--pause {
    animation: ts-help-in 6s var(--ts-out) infinite;
  }

  /* 03: help starts to offer itself, folds away for the quiz, the learner's
     turn shows; the transcript runs on underneath. */
  .ts-help-chip--held {
    animation: ts-held 6s var(--ts-in-out) infinite;
  }

  .ts-turn {
    animation: ts-turn 6s var(--ts-out) infinite;
  }

  .ts-lines--live .ts-bar--source,
  .ts-lines--live .ts-bar--translation {
    animation-duration: 6s;
  }

  /* 04: the dial moves stop by stop; the help grows from a word to a whole
     reply; the word the learner then says is underlined. */
  .ts-dial-runner,
  .ts-dial-fill {
    animation: ts-dial-runner 6s var(--ts-in-out) infinite;
  }

  .ts-dial-fill {
    animation-name: ts-dial-fill;
  }

  .ts-dial-stop--1 {
    animation: ts-stop-1 6s ease infinite;
  }

  .ts-dial-stop--2 {
    animation: ts-stop-2 6s ease infinite;
  }

  .ts-dial-stop--3 {
    animation: ts-stop-3 6s ease infinite;
  }

  .ts-variant--1 {
    animation: ts-variant-1 6s var(--ts-out) infinite;
  }

  .ts-variant--2 {
    animation: ts-variant-2 6s var(--ts-out) infinite;
  }

  .ts-variant--3 {
    animation: ts-variant-3 6s var(--ts-out) infinite;
  }

  .ts-used::after {
    animation: ts-used 6s var(--ts-out) infinite;
  }

  .ts-said {
    animation: ts-said 6s var(--ts-out) infinite;
  }

  /* 05: the proposal draws its lesson moment; the teacher's four answers light in turn. */
  .ts-bar--moment {
    transform-origin: left;
    animation: ts-moment-bar 6s var(--ts-out) infinite;
  }

  .ts-moment-mark {
    animation: ts-moment-mark 6s var(--ts-out) infinite;
  }

  .ts-action::before {
    animation: ts-action 6s var(--ts-in-out) infinite both;
  }

  .ts-action--2::before {
    animation-delay: 0.96s;
  }

  .ts-action--3::before {
    animation-delay: 1.92s;
  }

  .ts-action--4::before {
    animation-delay: 2.88s;
  }

  /* 06: the transcript recedes; the confirmed line and its pin stay. The kept
     line and its tie stay still on purpose: in headless Chrome the tie vanished
     whenever it or its line ran an opacity or transform animation. */
  .ts-tline:not(.ts-tline--kept) {
    animation: ts-fade-lines 6s var(--ts-in-out) infinite;
  }

  .ts-pin {
    animation: ts-pin 6s var(--ts-out) infinite;
  }

  /* 07: the result travels the loop and rests at every station, which lights as it arrives. */
  .ts-orbit-runner {
    will-change: transform;
    animation: ts-orbit 6s var(--ts-in-out) infinite;
  }

  .ts-orbit-label::before {
    animation: ts-station 6s var(--ts-soft) infinite;
  }

  .ts-orbit-label--right::before {
    animation-delay: -4.5s;
  }

  .ts-orbit-label--bottom::before {
    animation-delay: -3s;
  }

  .ts-orbit-label--left::before {
    animation-delay: -1.5s;
  }

  /* 08: each lesson moves in its own lane, at its own pace. */
  .ts-lane-token {
    animation: ts-lane 4.8s var(--ts-in-out) infinite;
  }

  .ts-lane--2 .ts-lane-token {
    animation-duration: 6s;
    animation-delay: -2.4s;
  }

  .ts-lane--3 .ts-lane-token {
    animation-duration: 5.4s;
    animation-delay: -4s;
  }

  /* 09: the learner's own words arrive, unhurried. */
  .ts-own-line {
    animation: ts-own-line 6s var(--ts-out) infinite both;
  }

  .ts-own-line:nth-of-type(3) {
    animation-delay: 0.35s;
  }

  .ts-own-line:nth-of-type(4) {
    animation-delay: 0.7s;
  }

  /* 10: a phrase lights in the transcript, becomes a card, is kept, and comes back at growing gaps. */
  .ts-ex-hit::before {
    animation: ts-ex-hit 6s var(--ts-out) infinite;
  }

  .ts-ex-card {
    animation: ts-ex-card 6s var(--ts-out) infinite;
  }

  .ts-ex-keep {
    animation: ts-ex-keep 6s var(--ts-out) infinite;
  }

  .ts-ex-day {
    animation: ts-ex-day 6s var(--ts-out) infinite both;
  }

  .ts-ex-day:nth-child(2) { animation-delay: 0.15s; }
  .ts-ex-day:nth-child(3) { animation-delay: 0.3s; }
  .ts-ex-day:nth-child(4) { animation-delay: 0.45s; }
  .ts-ex-day:nth-child(5) { animation-delay: 0.6s; }

  /* 11: a correction arrives as the new version, the old one is struck and steps back; the gate answers. */
  .ts-lin-card--new {
    animation: ts-lin-new 6s var(--ts-out) infinite;
  }

  .ts-lin-card--old {
    animation: ts-lin-old 6s var(--ts-out) infinite;
  }

  .ts-lin-card--old .ts-lin-tag::after {
    animation: ts-lin-strike 6s var(--ts-out) infinite;
  }

  .ts-gate-out::before {
    animation: ts-gate-out 6s var(--ts-in-out) infinite both;
  }

  .ts-gate-out--2::before { animation-delay: 0.96s; }
  .ts-gate-out--3::before { animation-delay: 1.92s; }

  /* 12: the grant opens, the path runs through the handoff without a break; only the teacher changes. */
  .ts-carry-fill {
    animation: ts-carry-fill 6s var(--ts-in-out) infinite;
  }

  .ts-carry-head {
    animation: ts-carry-head 6s var(--ts-in-out) infinite;
  }

  .ts-carry-handoff {
    animation: ts-carry-handoff 6s var(--ts-out) infinite;
  }

  .ts-carry-teacher--a {
    animation: ts-carry-a 6s ease infinite;
  }

  .ts-carry-teacher--b {
    animation: ts-carry-b 6s ease infinite;
  }

  .ts-toggle {
    animation: ts-toggle-track 6s ease infinite;
  }

  .ts-toggle-knob {
    animation: ts-toggle 6s var(--ts-out) infinite;
  }

  /* 13: audio flows; the replay's results arrive in order and pass, then the live run's do. */
  .ts-wave span {
    animation: ts-wave 1.6s var(--ts-soft) infinite alternate;
  }

  .ts-wave span:nth-child(2n) { animation-delay: -0.5s; }
  .ts-wave span:nth-child(3n) { animation-delay: -1.05s; }

  .ts-run--replay .ts-result {
    animation: ts-result 6s var(--ts-out) infinite both;
  }

  .ts-run--live .ts-result {
    animation: ts-result-live 6s var(--ts-out) infinite both;
  }

  .ts-result:nth-child(2) { animation-delay: 0.2s; }
  .ts-result:nth-child(3) { animation-delay: 0.4s; }

  .ts-run--replay .ts-run-check {
    animation: ts-check 6s var(--ts-out) infinite;
  }

  .ts-run--live .ts-run-check {
    animation: ts-check-live 6s var(--ts-out) infinite;
  }

  /* 14: provider after provider plugs in; the same faults run; the same check passes. */
  .ts-plug {
    animation: ts-plug 6s var(--ts-in-out) infinite both;
  }

  .ts-plug--2 { animation-delay: 2s; }
  .ts-plug--3 { animation-delay: 4s; }

  .ts-fault::before {
    animation: ts-fault 2s var(--ts-in-out) infinite both;
  }

  .ts-fault--2::before { animation-delay: 0.2s; }
  .ts-fault--3::before { animation-delay: 0.4s; }
  .ts-fault--4::before { animation-delay: 0.6s; }

  .ts-same-check {
    animation: ts-same 2s var(--ts-out) infinite;
  }

  /* 15: on first reveal the outlines draw themselves, the shutter rolls
     down and the shackle drops. Then one 5.6 s loop: three words travel to
     the provider, it pulses once and an answer returns to the bubble, while
     a stray token drifts toward training, the lock clicks and it dissolves. */
  html.ts-ready .ts-scene--training .ts-train-draw {
    stroke-dasharray: 1;
    transition: stroke-dashoffset 1.2s var(--ts-out) 0.25s;
  }

  html.ts-ready .ts-scene--training .ts-train-chip {
    transition-delay: 0.45s;
  }

  html.ts-ready .ts-scene--training .ts-train-wire {
    transition-delay: 0.65s;
  }

  html.ts-ready .ts-scene--training .ts-train-post {
    transition-delay: 0.85s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-train-draw {
    stroke-dashoffset: 1;
  }

  html.ts-ready .ts-scene--training .ts-train-shutter {
    transition: transform 0.9s var(--ts-out) 1.25s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-train-shutter {
    transform: scaleY(0.04);
  }

  html.ts-ready .ts-scene--training .ts-train-hasp {
    transition: transform 0.5s var(--ts-out) 1.9s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-train-hasp {
    transform: translateY(-5px);
  }

  html.ts-ready .ts-scene--training .ts-train-model,
  html.ts-ready .ts-scene--training .ts-train-branch,
  html.ts-ready .ts-scene--training .ts-train-lock-body,
  html.ts-ready .ts-scene--training .ts-train-keyhole,
  html.ts-ready .ts-scene--training .ts-train-word {
    transition: opacity 0.9s var(--ts-soft) 0.9s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-train-model,
  html.ts-ready .ts-chapter:not(.is-in) .ts-train-branch,
  html.ts-ready .ts-chapter:not(.is-in) .ts-train-lock-body,
  html.ts-ready .ts-chapter:not(.is-in) .ts-train-keyhole {
    opacity: 0;
  }

  .ts-train-token--1,
  .ts-train-token--2,
  .ts-train-token--3 {
    animation: ts-train-word-token 5.6s var(--ts-in-out) infinite both;
  }

  .ts-train-word {
    animation: ts-train-word 5.6s var(--ts-soft) infinite both;
  }

  .ts-train-token--2,
  .ts-train-word--2 {
    animation-delay: 0.2s;
  }

  .ts-train-token--3,
  .ts-train-word--3 {
    animation-delay: 0.4s;
  }

  .ts-train-core {
    animation: ts-train-core 5.6s var(--ts-out) infinite both;
  }

  .ts-train-ring {
    animation: ts-train-ring 5.6s var(--ts-out) infinite both;
  }

  .ts-train-halo {
    animation: ts-train-halo 5.6s var(--ts-soft) infinite both;
  }

  .ts-train-token--answer {
    animation: ts-train-answer 5.6s var(--ts-in-out) infinite both;
  }

  .ts-train-bubble-glow {
    animation: ts-train-bubble-glow 5.6s var(--ts-out) infinite both;
  }

  .ts-train-token--ghost {
    animation: ts-train-ghost 5.6s var(--ts-out) infinite both;
  }

  .ts-train-seal {
    animation: ts-train-seal 5.6s var(--ts-in-out) infinite both;
  }

  .ts-train-shackle {
    animation: ts-train-shackle 5.6s var(--ts-out) infinite both;
  }

  .ts-train-lock-body {
    animation: ts-train-lock-body 5.6s var(--ts-out) infinite both;
  }

  .ts-train-lock-ring {
    animation: ts-train-lock-ring 5.6s var(--ts-out) infinite both;
  }

  .ts-train-spark--1 { animation: ts-train-spark-1 5.6s var(--ts-out) infinite both; }
  .ts-train-spark--2 { animation: ts-train-spark-2 5.6s var(--ts-out) infinite both; }
  .ts-train-spark--3 { animation: ts-train-spark-3 5.6s var(--ts-out) infinite both; }

  /* 16: on first reveal the bubble, AI node and server draw themselves and
     the ring turns in. Then one 5.6 s loop in step with chapter 15: the words
     travel with a trail behind them, the AI pulses and hands the work to the
     server, the answer returns, and the trail retracts and crumbles; the
     arrow glides into the ring and the ring lights point by point. */
  html.ts-ready .ts-scene--europe .ts-eu-draw {
    stroke-dasharray: 1;
    transition: stroke-dashoffset 1.2s var(--ts-out) 0.25s;
  }

  html.ts-ready .ts-scene--europe .ts-eu-ai {
    transition-delay: 0.45s;
  }

  html.ts-ready .ts-scene--europe .ts-eu-rack {
    transition-delay: 0.7s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-eu-draw {
    stroke-dashoffset: 1;
  }

  html.ts-ready .ts-scene--europe .ts-eu-ring {
    transition:
      opacity 0.9s var(--ts-soft) 0.8s,
      transform 1.3s var(--ts-out) 0.8s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-eu-ring {
    opacity: 0;
    transform: scale(0.82) rotate(-40deg);
  }

  html.ts-ready .ts-scene--europe .ts-eu-link,
  html.ts-ready .ts-scene--europe .ts-eu-track,
  html.ts-ready .ts-scene--europe .ts-eu-slots {
    transition: opacity 0.9s var(--ts-soft) 0.9s;
  }

  html.ts-ready .ts-chapter:not(.is-in) .ts-eu-link,
  html.ts-ready .ts-chapter:not(.is-in) .ts-eu-track,
  html.ts-ready .ts-chapter:not(.is-in) .ts-eu-slots {
    opacity: 0;
  }

  .ts-eu-token--1,
  .ts-eu-token--2,
  .ts-eu-token--3 {
    animation: ts-train-word-token 5.6s var(--ts-in-out) infinite both;
  }

  .ts-eu-word {
    animation: ts-train-word 5.6s var(--ts-soft) infinite both;
  }

  .ts-eu-token--2,
  .ts-eu-word--2 {
    animation-delay: 0.2s;
  }

  .ts-eu-token--3,
  .ts-eu-word--3 {
    animation-delay: 0.4s;
  }

  .ts-eu-trail {
    animation: ts-eu-trail 5.6s linear infinite both;
  }

  .ts-eu-mote {
    animation: ts-eu-mote 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-mote--2 { animation-delay: 0.3s; }
  .ts-eu-mote--3 { animation-delay: 0.6s; }

  .ts-eu-spark {
    animation: ts-train-core 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-ai-ring {
    animation: ts-train-ring 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-halo {
    animation: ts-train-halo 5.6s var(--ts-soft) infinite both;
  }

  .ts-eu-token--answer {
    animation: ts-train-answer 5.6s var(--ts-in-out) infinite both;
  }

  .ts-eu-bubble-glow {
    animation: ts-train-bubble-glow 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-token--link {
    animation: ts-eu-link 5.6s var(--ts-in-out) infinite both;
  }

  .ts-eu-led {
    animation: ts-eu-led 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-led--2 { animation-delay: 0.08s; }
  .ts-eu-led--3 { animation-delay: 0.16s; }

  .ts-eu-arrow {
    animation: ts-eu-arrow 5.6s var(--ts-in-out) infinite both;
  }

  .ts-eu-ring-glow {
    animation: ts-eu-ring-glow 5.6s var(--ts-soft) infinite both;
  }

  .ts-eu-star {
    animation: ts-eu-star 5.6s var(--ts-out) infinite both;
  }

  .ts-eu-star:nth-child(2) { animation-delay: 0.07s; }
  .ts-eu-star:nth-child(3) { animation-delay: 0.14s; }
  .ts-eu-star:nth-child(4) { animation-delay: 0.21s; }
  .ts-eu-star:nth-child(5) { animation-delay: 0.28s; }
  .ts-eu-star:nth-child(6) { animation-delay: 0.35s; }
  .ts-eu-star:nth-child(7) { animation-delay: 0.42s; }
  .ts-eu-star:nth-child(8) { animation-delay: 0.49s; }
  .ts-eu-star:nth-child(9) { animation-delay: 0.56s; }
  .ts-eu-star:nth-child(10) { animation-delay: 0.63s; }
  .ts-eu-star:nth-child(11) { animation-delay: 0.7s; }
  .ts-eu-star:nth-child(12) { animation-delay: 0.77s; }

  /* 17: ideas circle the lab, each at its own pace; the core breathes. The
     revolutions are the one constant motion here, as orbits are. */
  .ts-lab-orbit--1 {
    animation: ts-lab-1 22s linear infinite;
  }

  .ts-lab-orbit--2 {
    animation: ts-lab-2 15s linear infinite;
  }

  .ts-lab-orbit--3 {
    animation: ts-lab-3 30s linear infinite;
  }

  .ts-lab-core {
    animation: ts-lab-core 4.8s var(--ts-soft) infinite;
  }

  /* The research constellation: each card's star twinkles at its own pace,
     the cards rise in turn as the chapter arrives. */
  html.ts-ready .ts-chapter:not(.is-in) .ts-idea {
    opacity: 0;
    transform: translateY(24px);
  }

  html.ts-ready .ts-idea {
    transition:
      opacity 800ms var(--ts-out),
      transform 800ms var(--ts-out),
      border-color 320ms ease,
      box-shadow 420ms var(--ts-out);
  }

  html.ts-ready .ts-chapter.is-in .ts-idea:nth-child(2) { transition-delay: 90ms, 90ms, 0s, 0s; }
  html.ts-ready .ts-chapter.is-in .ts-idea:nth-child(3) { transition-delay: 180ms, 180ms, 0s, 0s; }
  html.ts-ready .ts-chapter.is-in .ts-idea:nth-child(4) { transition-delay: 270ms, 270ms, 0s, 0s; }
  html.ts-ready .ts-chapter.is-in .ts-idea:nth-child(5) { transition-delay: 360ms, 360ms, 0s, 0s; }
  html.ts-ready .ts-chapter.is-in .ts-idea:nth-child(6) { transition-delay: 450ms, 450ms, 0s, 0s; }

  .ts-idea::before {
    animation: ts-twinkle 5.2s var(--ts-soft) infinite;
  }

  .ts-idea:nth-child(2)::before { animation-delay: -1.7s; animation-duration: 4.6s; }
  .ts-idea:nth-child(3)::before { animation-delay: -3.1s; animation-duration: 5.8s; }
  .ts-idea:nth-child(4)::before { animation-delay: -0.9s; animation-duration: 5s; }
  .ts-idea:nth-child(5)::before { animation-delay: -2.4s; animation-duration: 4.4s; }
  .ts-idea:nth-child(6)::before { animation-delay: -4s; animation-duration: 5.6s; }

  .ts-idea:hover::before,
  .ts-idea:focus-visible::before {
    animation-play-state: paused;
    opacity: 1;
  }

  /* Where we are: the current stage's dot sends out one calm ring at a time. */
  .ts-stage--current .ts-stage-dot {
    animation: ts-here 2.8s var(--ts-out) infinite;
  }

  .ts-chip--live::before {
    animation: ts-live 2.6s var(--ts-out) infinite;
  }
}

/* Still parts in their final state, also the resting frame of each loop. */
.ts-hook-caret {
  opacity: 0;
}

@keyframes ts-cue {
  0%,
  18% {
    opacity: 1;
    transform: translate(-50%, 0.05rem) rotate(45deg);
  }
  52% {
    opacity: 0.45;
    transform: translate(-50%, 0.5rem) rotate(45deg);
  }
  80%,
  100% {
    opacity: 1;
    transform: translate(-50%, 0.05rem) rotate(45deg);
  }
}

@keyframes ts-spark {
  0%,
  100% {
    transform: scale(0.82);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes ts-node-land {
  0% {
    transform: scale(0.55);
  }
  45% {
    transform: scale(1.35);
  }
  100% {
    transform: none;
  }
}

@keyframes ts-node-glow {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  35% {
    opacity: 1;
    transform: scale(1.8);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes ts-caret {
  0%,
  8%,
  16%,
  24% {
    opacity: 1;
  }
  4%,
  12%,
  20%,
  28%,
  100% {
    opacity: 0;
  }
}

@keyframes ts-hint {
  0%,
  14% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  26%,
  48% {
    opacity: 1;
    transform: none;
  }
  60%,
  88% {
    opacity: 0.55;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes ts-hook-word {
  0%,
  38% {
    opacity: 0;
    transform: translateY(0.35em);
  }
  48%,
  90% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-hook-after {
  0%,
  50% {
    opacity: 0;
    transform: translateX(-0.25em);
  }
  62%,
  90% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-pulse {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  14%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes ts-bar-source {
  0%,
  8% {
    opacity: 0.8;
    transform: scaleX(0);
  }
  36%,
  90% {
    opacity: 0.8;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-bar-translation {
  0%,
  28% {
    opacity: 1;
    transform: scaleX(0);
  }
  56%,
  90% {
    opacity: 1;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-say {
  0%,
  2% {
    opacity: 0.75;
    transform: scaleX(0);
  }
  14%,
  92% {
    opacity: 0.75;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-say-2 {
  0%,
  12% {
    opacity: 0.75;
    transform: scaleX(0);
  }
  24%,
  92% {
    opacity: 0.75;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-say-q {
  0%,
  24% {
    opacity: 0;
    transform: scale(0.5);
  }
  29% {
    opacity: 1;
    transform: scale(1.25);
  }
  34%,
  92% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-gap {
  0%,
  31% {
    opacity: 0;
    transform: scaleX(0);
  }
  33% {
    opacity: 1;
    transform: scaleX(0.04);
  }
  56%,
  92% {
    opacity: 1;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-tick {
  0%,
  55% {
    transform: translate(-50%, -50%);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.3);
  }
  68%,
  100% {
    transform: translate(-50%, -50%);
  }
}

@keyframes ts-help-in {
  0%,
  58% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  68%,
  92% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes ts-held {
  0%,
  8% {
    opacity: 0;
    transform: scale(0.94);
  }
  18%,
  30% {
    opacity: 0.85;
    transform: none;
  }
  42%,
  92% {
    opacity: 0.3;
    transform: scale(0.94);
  }
  98%,
  100% {
    opacity: 0;
    transform: scale(0.94);
  }
}

@keyframes ts-turn {
  0%,
  40% {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }
  48% {
    opacity: 1;
    transform: scale(1.06);
  }
  54%,
  92% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-dial-runner {
  0%,
  22% {
    transform: translateX(0);
  }
  30%,
  50% {
    transform: translateX(50%);
  }
  58%,
  90% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes ts-dial-fill {
  0%,
  22% {
    transform: scaleX(0.03);
  }
  30%,
  50% {
    transform: scaleX(0.5);
  }
  58%,
  90% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0.03);
  }
}

@keyframes ts-stop-1 {
  0%,
  24%,
  96%,
  100% {
    opacity: 1;
  }
  28%,
  92% {
    opacity: 0.5;
  }
}

@keyframes ts-stop-2 {
  0%,
  26%,
  56%,
  100% {
    opacity: 0.5;
  }
  30%,
  52% {
    opacity: 1;
  }
}

@keyframes ts-stop-3 {
  0%,
  54%,
  96%,
  100% {
    opacity: 0.5;
  }
  58%,
  92% {
    opacity: 1;
  }
}

@keyframes ts-variant-1 {
  0%,
  22% {
    opacity: 1;
    transform: none;
  }
  27%,
  94% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes ts-variant-2 {
  0%,
  26% {
    opacity: 0;
    transform: translateY(6px);
  }
  32%,
  50% {
    opacity: 1;
    transform: none;
  }
  55%,
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes ts-variant-3 {
  0%,
  54% {
    opacity: 0;
    transform: translateY(6px);
  }
  60%,
  90% {
    opacity: 1;
    transform: none;
  }
  95%,
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes ts-used {
  0%,
  68% {
    transform: scaleX(0);
  }
  74%,
  92% {
    transform: scaleX(1);
  }
  96%,
  100% {
    transform: scaleX(0);
  }
}

@keyframes ts-said {
  0%,
  72% {
    opacity: 0;
    transform: translateY(3px);
  }
  78%,
  90% {
    opacity: 1;
    transform: none;
  }
  95%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-moment-bar {
  0%,
  4% {
    opacity: 0.55;
    transform: scaleX(0);
  }
  18%,
  92% {
    opacity: 0.55;
    transform: scaleX(1);
  }
  98%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-moment-mark {
  0%,
  3% {
    transform: none;
  }
  9% {
    transform: scale(1.7);
  }
  16%,
  100% {
    transform: none;
  }
}

@keyframes ts-action {
  0%,
  20% {
    opacity: 0;
  }
  24%,
  32% {
    opacity: 1;
  }
  36%,
  100% {
    opacity: 0;
  }
}

@keyframes ts-fade-lines {
  0%,
  18% {
    opacity: 0.55;
  }
  32%,
  88% {
    opacity: 0.16;
  }
  98%,
  100% {
    opacity: 0.55;
  }
}

@keyframes ts-pin {
  0%,
  32% {
    opacity: 0;
    transform: translateX(-10px) scale(0.96);
  }
  44%,
  88% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* A quarter turn per station, resting at each one. */
@keyframes ts-orbit {
  0%,
  8% {
    transform: rotate(0deg);
  }
  25%,
  33% {
    transform: rotate(90deg);
  }
  50%,
  58% {
    transform: rotate(180deg);
  }
  75%,
  83% {
    transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* A station is lit while the result rests there; local 0% is its arrival. */
@keyframes ts-station {
  0%,
  12% {
    opacity: 1;
  }
  24%,
  93% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes ts-lane {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  12%,
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes ts-own-line {
  0%,
  6% {
    opacity: 0;
    transform: scaleX(0);
  }
  26%,
  82% {
    opacity: 1;
    transform: scaleX(1);
  }
  88%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-ex-hit {
  0%,
  4% {
    opacity: 1;
    transform: scaleX(0);
  }
  14%,
  86% {
    opacity: 1;
    transform: scaleX(1);
  }
  92%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-ex-card {
  0%,
  14% {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  26%,
  86% {
    opacity: 1;
    transform: none;
  }
  92%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-ex-keep {
  0%,
  32% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ts-accent) 0%, transparent);
    transform: none;
  }
  36% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ts-accent) 40%, transparent);
    transform: scale(0.9);
  }
  46%,
  100% {
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--ts-accent) 0%, transparent);
    transform: none;
  }
}

@keyframes ts-ex-day {
  0%,
  42% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  47% {
    opacity: 1;
    transform: scale(1.14);
  }
  52%,
  76% {
    opacity: 1;
    transform: none;
  }
  82%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
}

@keyframes ts-lin-new {
  0%,
  10% {
    opacity: 0;
    transform: translateY(12px);
  }
  22%,
  88% {
    opacity: 1;
    transform: none;
  }
  95%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-lin-old {
  0%,
  10% {
    opacity: 1;
    transform: none;
  }
  22%,
  88% {
    opacity: 0.5;
    transform: scale(0.97);
  }
  97%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes ts-lin-strike {
  0%,
  16% {
    transform: scaleX(0);
  }
  26%,
  88% {
    transform: scaleX(1);
  }
  95%,
  100% {
    transform: scaleX(0);
  }
}

@keyframes ts-gate-out {
  0%,
  32% {
    opacity: 0;
  }
  37%,
  45% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes ts-carry-fill {
  0% {
    opacity: 0;
    transform: scaleX(0.02);
  }
  6% {
    opacity: 1;
    transform: scaleX(0.02);
  }
  36%,
  48% {
    opacity: 1;
    transform: scaleX(0.5);
  }
  82%,
  92% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-carry-head {
  0% {
    opacity: 0;
    transform: translateX(2%);
  }
  6% {
    opacity: 1;
    transform: translateX(2%);
  }
  36%,
  48% {
    opacity: 1;
    transform: translateX(50%);
  }
  82%,
  92% {
    opacity: 1;
    transform: translateX(100%);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes ts-carry-handoff {
  0%,
  36% {
    transform: translate(-50%, -50%);
  }
  41% {
    transform: translate(-50%, -50%) scale(1.4);
  }
  50%,
  100% {
    transform: translate(-50%, -50%);
  }
}

@keyframes ts-carry-a {
  0%,
  38% {
    opacity: 1;
  }
  46%,
  92% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

@keyframes ts-carry-b {
  0%,
  38% {
    opacity: 0.4;
  }
  46%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

@keyframes ts-toggle {
  0%,
  22% {
    transform: none;
  }
  30%,
  92% {
    transform: translateX(0.9rem);
  }
  100% {
    transform: none;
  }
}

@keyframes ts-toggle-track {
  0%,
  22% {
    opacity: 0.4;
  }
  30%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

@keyframes ts-wave {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes ts-result {
  0%,
  8% {
    opacity: 0;
    transform: scaleX(0);
  }
  16%,
  84% {
    opacity: 0.7;
    transform: scaleX(1);
  }
  90%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-result-live {
  0%,
  40% {
    opacity: 0;
    transform: scaleX(0);
  }
  48%,
  84% {
    opacity: 0.7;
    transform: scaleX(1);
  }
  90%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes ts-check {
  0%,
  25% {
    opacity: 0;
    transform: scale(0.4);
  }
  30% {
    opacity: 1;
    transform: scale(1.18);
  }
  35%,
  88% {
    opacity: 1;
    transform: none;
  }
  94%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes ts-check-live {
  0%,
  57% {
    opacity: 0;
    transform: scale(0.4);
  }
  62% {
    opacity: 1;
    transform: scale(1.18);
  }
  67%,
  88% {
    opacity: 1;
    transform: none;
  }
  94%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* One plug per third of the loop: it slides in, holds, and slides on. */
@keyframes ts-plug {
  0% {
    opacity: 0;
    transform: translateY(-60%);
  }
  6%,
  27% {
    opacity: 1;
    transform: none;
  }
  33.3%,
  100% {
    opacity: 0;
    transform: translateY(60%);
  }
}

@keyframes ts-fault {
  0%,
  18% {
    opacity: 0;
  }
  26%,
  34% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0;
  }
}

@keyframes ts-same {
  0%,
  66% {
    transform: none;
  }
  73% {
    transform: scale(1.3);
  }
  82%,
  100% {
    transform: none;
  }
}

@keyframes ts-train-word-token {
  0%,
  4% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
  8%,
  24% {
    opacity: 1;
  }
  29%,
  100% {
    opacity: 0;
    stroke-dashoffset: -1;
  }
}

@keyframes ts-train-word {
  0%,
  4% {
    opacity: 1;
  }
  11%,
  62% {
    opacity: 0.3;
  }
  76%,
  100% {
    opacity: 1;
  }
}

@keyframes ts-train-core {
  0%,
  31% {
    transform: none;
  }
  36% {
    transform: scale(1.35);
  }
  48%,
  100% {
    transform: none;
  }
}

@keyframes ts-train-ring {
  0%,
  32% {
    opacity: 0;
    transform: scale(0.6);
  }
  36% {
    opacity: 0.8;
  }
  56%,
  100% {
    opacity: 0;
    transform: scale(2.3);
  }
}

@keyframes ts-train-halo {
  0%,
  28% {
    opacity: 0.5;
  }
  38% {
    opacity: 1;
  }
  60%,
  100% {
    opacity: 0.5;
  }
}

@keyframes ts-train-answer {
  0%,
  38% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
  42%,
  56% {
    opacity: 1;
  }
  60%,
  100% {
    opacity: 0;
    stroke-dashoffset: -1;
  }
}

@keyframes ts-train-bubble-glow {
  0%,
  57% {
    opacity: 0;
  }
  62% {
    opacity: 0.9;
  }
  82%,
  100% {
    opacity: 0;
  }
}

@keyframes ts-train-ghost {
  0%,
  44% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
  49%,
  62% {
    opacity: 0.8;
  }
  64% {
    stroke-dashoffset: -1;
  }
  68%,
  100% {
    opacity: 0;
    stroke-dashoffset: -1;
  }
}

@keyframes ts-train-seal {
  0%,
  52% {
    opacity: 0;
    transform: none;
  }
  54% {
    opacity: 0.9;
  }
  60% {
    opacity: 0.6;
  }
  62%,
  100% {
    opacity: 0;
    transform: translateY(51px);
  }
}

@keyframes ts-train-shackle {
  0%,
  58% {
    transform: none;
  }
  60% {
    transform: translateY(1.8px);
  }
  66%,
  100% {
    transform: none;
  }
}

@keyframes ts-train-lock-body {
  0%,
  58% {
    transform: none;
  }
  60% {
    transform: scale(1.08);
  }
  68%,
  100% {
    transform: none;
  }
}

@keyframes ts-train-lock-ring {
  0%,
  59% {
    opacity: 0;
    transform: scale(0.7);
  }
  61% {
    opacity: 0.75;
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

@keyframes ts-train-spark-1 {
  0%,
  63% {
    opacity: 0;
    transform: none;
  }
  65% {
    opacity: 0.9;
  }
  76%,
  100% {
    opacity: 0;
    transform: translate(-7px, -8px);
  }
}

@keyframes ts-train-spark-2 {
  0%,
  63% {
    opacity: 0;
    transform: none;
  }
  65% {
    opacity: 0.9;
  }
  76%,
  100% {
    opacity: 0;
    transform: translate(-10px, 1px);
  }
}

@keyframes ts-train-spark-3 {
  0%,
  63% {
    opacity: 0;
    transform: none;
  }
  65% {
    opacity: 0.9;
  }
  76%,
  100% {
    opacity: 0;
    transform: translate(-6px, 8px);
  }
}

/* The trail draws behind the first word (the same 4 % to 29 % span as its
   token), holds while the answer travels, then retracts from the bubble and
   fades out. */
@keyframes ts-eu-trail {
  0% {
    opacity: 0;
    stroke-dashoffset: 1;
  }
  4% {
    opacity: 0.9;
    stroke-dashoffset: 1;
    animation-timing-function: var(--ts-in-out);
  }
  29% {
    stroke-dashoffset: 0;
  }
  44% {
    opacity: 0.9;
    stroke-dashoffset: 0;
    animation-timing-function: var(--ts-soft);
  }
  66%,
  100% {
    opacity: 0;
    stroke-dashoffset: -1;
  }
}

@keyframes ts-eu-mote {
  0%,
  47% {
    opacity: 0;
    transform: none;
  }
  51% {
    opacity: 0.85;
  }
  64%,
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.4);
  }
}

@keyframes ts-eu-link {
  0%,
  33% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
  35%,
  41% {
    opacity: 1;
  }
  45%,
  100% {
    opacity: 0;
    stroke-dashoffset: -1;
  }
}

@keyframes ts-eu-led {
  0%,
  43% {
    opacity: 0.4;
    transform: none;
  }
  46% {
    opacity: 1;
    transform: scale(1.6);
  }
  52%,
  86% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0.4;
    transform: none;
  }
}

@keyframes ts-eu-arrow {
  0% {
    opacity: 0;
    transform: none;
  }
  8% {
    opacity: 0.9;
    transform: none;
  }
  38% {
    opacity: 0.9;
    transform: translate(40px, -31px);
  }
  50%,
  84% {
    opacity: 0.6;
    transform: translate(40px, -31px);
  }
  94%,
  100% {
    opacity: 0;
    transform: translate(40px, -31px);
  }
}

@keyframes ts-eu-ring-glow {
  0%,
  36% {
    opacity: 0.15;
  }
  54%,
  86% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.15;
  }
}

@keyframes ts-eu-star {
  0%,
  36% {
    opacity: 0.28;
    transform: none;
  }
  40% {
    opacity: 1;
    transform: scale(1.5);
  }
  47%,
  86% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0.28;
    transform: none;
  }
}

@keyframes ts-lab-1 {
  from {
    transform: rotate(40deg);
  }
  to {
    transform: rotate(400deg);
  }
}

@keyframes ts-lab-2 {
  from {
    transform: rotate(200deg);
  }
  to {
    transform: rotate(-160deg);
  }
}

@keyframes ts-lab-3 {
  from {
    transform: rotate(120deg);
  }
  to {
    transform: rotate(480deg);
  }
}

@keyframes ts-lab-core {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes ts-twinkle {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes ts-here {
  0% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ts-accent) 30%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--ts-accent) 0%, transparent);
  }
}

@keyframes ts-live {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--success) 0%, transparent);
  }
}

/* Reduced motion: every scene fully drawn and still. Loops are declared only
   for no-preference above; this also stops the transitions and lifts. */
@media (prefers-reduced-motion: reduce) {
  .ts-cue-arrow::before,
  .ts-thread-spark,
  .ts-node,
  .ts-node::after,
  .ts-hook-caret,
  .ts-hook-word,
  .ts-hook-after,
  .ts-hint,
  .ts-wire-pulse,
  .ts-bar--source,
  .ts-bar--translation,
  .ts-say-line,
  .ts-say-q,
  .ts-gap-fill,
  .ts-gap-tick--q,
  .ts-help-chip,
  .ts-turn,
  .ts-dial-runner,
  .ts-dial-fill,
  .ts-dial-stop,
  .ts-variant,
  .ts-used::after,
  .ts-said,
  .ts-bar--moment,
  .ts-moment-mark,
  .ts-action::before,
  .ts-tline,
  .ts-pin,
  .ts-orbit-runner,
  .ts-orbit-label::before,
  .ts-lane-token,
  .ts-own-line,
  .ts-ex-hit::before,
  .ts-ex-card,
  .ts-ex-keep,
  .ts-ex-day,
  .ts-lin-card,
  .ts-lin-tag::after,
  .ts-gate-out::before,
  .ts-carry-fill,
  .ts-carry-head,
  .ts-carry-handoff,
  .ts-carry-teacher,
  .ts-toggle,
  .ts-toggle-knob,
  .ts-wave span,
  .ts-result,
  .ts-run-check,
  .ts-plug,
  .ts-fault,
  .ts-fault::before,
  .ts-same-check,
  .ts-train-svg *,
  .ts-eu-svg *,
  .ts-lab-orbit,
  .ts-lab-core,
  .ts-idea::before,
  .ts-stage--current .ts-stage-dot,
  .ts-chip--live::before,
  .ts-join-pulse,
  .ts-join-pulse::before,
  .ts-join-pulse::after {
    animation: none;
  }

  .ts-scene,
  .ts-copy,
  .ts-cue,
  .ts-stage,
  .ts-node,
  .ts-node::after,
  .ts-thread-spark,
  .ts-link-arrow,
  .ts-link span:first-child,
  .ts-idea,
  .ts-idea::before {
    transition: none;
  }

  .ts-cue:hover,
  .ts-cue:focus-visible,
  .ts-stage:hover,
  .ts-stage:focus-visible,
  .ts-idea:hover,
  .ts-idea:focus-visible,
  .ts-idea:hover::before,
  .ts-idea:focus-visible::before {
    transform: none;
  }

  .ts-gate-out--1::before,
  .ts-action--1::before,
  .ts-orbit-label--top::before {
    opacity: 1;
  }

  .ts-wire-pulse--2 {
    opacity: 1;
    transform: translateX(50%);
  }

  .ts-thread-spark {
    display: none;
  }
}

/* ---- Light theme: paper, not glass ---- */

html[data-theme="light"] .ts-scene,
html[data-theme="light"] .ts-idea,
html[data-theme="light"] .ts-stage--done,
html[data-theme="light"] .ts-stage--next {
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--ts-accent) 7%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .ts-stage--current {
  border-color: color-mix(in srgb, var(--ts-accent) 45%, var(--line));
  background:
    radial-gradient(circle at 1.5rem 1.2rem, color-mix(in srgb, var(--ts-accent) 10%, transparent), transparent 9rem),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .ts-stage--planned {
  border-color: color-mix(in srgb, var(--muted) 38%, var(--line));
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  opacity: 0.9;
}

html[data-theme="light"] .ts-join-inner {
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--teal) 10%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="light"] {
  --ts-amber: #9a5b00;
}

html[data-theme="light"] .ts-thread-glow {
  opacity: 0.1;
}

html[data-theme="light"] .ts-cue {
  background: var(--surface);
}

/* Japanese and Chinese wrap at phrase boundaries where the browser can. */
html:lang(ja) .ts-hero-inner h1,
html:lang(ja) .ts-copy h2,
html:lang(ja) .ts-status-head h2,
html:lang(zh) .ts-hero-inner h1,
html:lang(zh) .ts-copy h2,
html:lang(zh) .ts-status-head h2 {
  word-break: auto-phrase;
}

/* ---- Narrower screens ---- */

@media (max-width: 1080px) {
  .ts-ideas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ts-idea:nth-child(3n + 2) {
    margin-top: 0;
  }

  .ts-idea:nth-child(even) {
    margin-top: 1.6rem;
  }

  .ts-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 1.1rem;
  }

  .ts-stage:nth-child(3)::before {
    display: none;
  }
}

/* Between the single column and the wide layout, a fixed 16:11 panel is too
   short for its scene; it grows with its content instead. */
@media (min-width: 901px) and (max-width: 1199px) {
  .ts-scene,
  .ts-chapter:nth-child(odd) .ts-scene {
    aspect-ratio: auto;
    min-height: clamp(16rem, 23vw, 19rem);
  }

  .ts-orbit {
    width: min(78%, 14rem);
  }

  .ts-lab {
    width: min(74%, 13.5rem);
  }
}

@media (max-width: 900px) {
  .ts-chapters {
    --ts-node-x: 0.9rem;
  }

  .ts-chapter,
  .ts-chapter:nth-child(even) {
    grid-template-columns: 1.8rem minmax(0, 1fr);
    grid-template-areas:
      ". scene"
      "node copy";
    align-items: start;
    column-gap: 0.9rem;
    row-gap: 1.4rem;
    padding-block: 2rem;
  }

  .ts-node {
    margin-top: 0.1rem;
  }

  /* The larger nodes must stay inside the narrow gutter, clear of the eyebrow. */
  .ts-node--loop,
  .ts-node--end {
    width: 1.25rem;
    height: 1.25rem;
  }

  .ts-node::after {
    inset: -0.3rem;
  }

  .ts-scene,
  .ts-chapter:nth-child(odd) .ts-scene {
    justify-self: start;
    max-width: 36rem;
    aspect-ratio: auto;
    min-height: 14.5rem;
  }

  .ts-chapter:nth-child(even) .ts-copy {
    justify-self: start;
  }

  .ts-copy {
    max-width: 38rem;
  }

  .ts-chapter.ts-chapter--research {
    grid-template-areas:
      ". scene"
      "node copy"
      ". ideas";
    row-gap: 1.4rem;
  }

  /* The track scrolls sideways here; the faded right edge shows that more cards follow. */
  .ts-track-wrap {
    margin-inline: calc(-1 * var(--page-pad));
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
  }

  .ts-track {
    display: flex;
    gap: 0.9rem;
    padding: 1.05rem calc(var(--page-pad) + 2.5rem) 1rem var(--page-pad);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--page-pad);
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .ts-stage {
    flex: 0 0 min(68%, 17rem);
  }

  .ts-stage:nth-child(3)::before {
    display: block;
  }
}

@media (max-width: 560px) {
  .ts-scene {
    min-height: 13.5rem;
  }

  .ts-scene--memory {
    grid-template-columns: minmax(0, 1fr);
  }

  .ts-tline--kept::after {
    display: none;
  }

  .ts-ideas {
    grid-template-columns: minmax(0, 1fr);
  }

  .ts-idea:nth-child(even) {
    margin-top: 0;
  }

  .ts-status-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Closing call: join the alpha tests ---- */

.ts-join {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(4rem, 8vw, 6.5rem);
}

.ts-join-inner {
  position: relative;
  max-width: 46rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.4rem, 4vw, 3rem);
  border: 1px solid color-mix(in srgb, var(--teal) 38%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 0 60px color-mix(in srgb, var(--teal) 12%, transparent);
  text-align: center;
  overflow: hidden;
}

.ts-join-inner .ts-kicker {
  text-align: center;
  color: var(--teal);
}

.ts-join-inner h2 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  text-wrap: balance;
}

.ts-join-body {
  max-width: 34rem;
  margin: 0 auto 1.6rem;
  color: var(--text-soft);
  text-wrap: pretty;
}

.ts-join-button {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}

/* A soft glow breathes from the top edge of the card: the live signal of a
   working alpha, nothing more. It is a glow, not a ring, so no line ever
   crosses the kicker or the heading. */
.ts-join-pulse {
  position: absolute;
  top: -6rem;
  left: 50%;
  width: 12rem;
  height: 12rem;
  margin-left: -6rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--teal) 26%, transparent), transparent 62%);
  opacity: 0.8;
  pointer-events: none;
}

/* In motion, two glows take turns breathing out, half a breath apart, so the
   signal never stops abruptly; the still glow above is the reduced-motion
   state. */
.ts-join-pulse::before,
.ts-join-pulse::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, color-mix(in srgb, var(--teal) 30%, transparent), transparent 62%);
  content: "";
  opacity: 0;
}

.ts-join-inner > :not(.ts-join-pulse) {
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .ts-join-pulse {
    opacity: 0.55;
  }

  .ts-join-pulse::before,
  .ts-join-pulse::after {
    animation: ts-join-breathe 5.2s var(--ts-out) infinite;
  }

  .ts-join-pulse::after {
    animation-delay: -2.6s;
  }

  .ts-join-button .ts-link-arrow {
    transition: transform 320ms var(--ts-out);
  }

  .ts-join-button:hover .ts-link-arrow,
  .ts-join-button:focus-visible .ts-link-arrow {
    transform: translateX(4px);
  }
}

@keyframes ts-join-breathe {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  12% {
    opacity: 0.7;
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}
