/* Poulpe: the teaser's own layout (index.html of this folder), SUN-1456.

   Tokens and components are the design system's copies under
   assets/ (assets/tokens.css, assets/components.css): every colour, type size, radius,
   shadow and duration here is a token, and the arms, the state pill, the dot
   and the logo are the system's classes. What the system has no token for is this page's own
   measures, named once under "Measures", and a small control's height and
   inner gaps, taken as assets/components.css has them. Here, in tz- classes:

     1  Measures and the page          5  A card's one live line
     2  The line of words              6  The flow: lanes, steps, the state
     3  The board: band, columns       7  The timeline: what the script sets
     4  A card, and its workers        8  Narrower: rows, and a list of steps

   The board is a light rebuild of the live board's look (SUN-1450); the flow
   is the first draft's lane graph (section 02, site-lanes), turned so that
   time runs left to right.

   With no script, and under "reduce motion", none of part 7 applies: the page
   is a still of the story's end. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--pp-bg);
}

/* ---- 1  Measures and the page ------------------------------------------- */

.tz {
  /* The page, wide and narrow. */
  --tz-wide: 1192px;
  --tz-narrow: 640px;
  /* A card: its height, the same for every card so that nothing jumps; its
     live line's, the same whatever it says; and that line's action's. */
  --tz-card: 93px;
  --tz-live: 36px;
  --tz-act: 26px;
  /* The flow: the column of names, a step's words, a lane, the state's row;
     a lane's line, a node, a turn. */
  --tz-who: 176px;
  --tz-what: 44px;
  --tz-pitch: 34px;
  --tz-state: 38px;
  --tz-line: 3px;
  --tz-node: 14px;
  --tz-turn: 12px;
  /* Narrow: a row's name, and a step of the list. */
  --tz-rowhead: 80px;
  --tz-step: 32px;
  /* A card crossing the board: twice the system's slow, so the eye follows. */
  --tz-travel: calc(var(--pp-dur-slow) * 2);
  /* The ring round what the person presses: the accent, thinned so that it
     shows on a tinted line too. */
  --tz-ring: color-mix(in srgb, var(--pp-accent) 30%, transparent);

  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(120% 56% at 50% 0%, var(--pp-accent-soft), transparent 70%), var(--pp-bg);
}

.tz [hidden] {
  display: none !important;
}

.tz-marks {
  position: absolute;
}

.tz-page {
  align-self: center;
  width: min(100% - 2 * var(--pp-space-6), var(--tz-wide));
  margin: 0 auto;
  padding: var(--pp-space-6) 0 var(--pp-space-5);
}

/* ---- 2  The line of words ----------------------------------------------- */

.tz-head {
  display: grid;
  justify-items: center;
  gap: var(--pp-space-4);
  margin-bottom: var(--pp-space-6);
  text-align: center;
}

.tz-head > .pp-logo {
  --pp-logo-height: 40px;
}

.tz-line {
  max-width: 24em;
  font-size: clamp(var(--pp-size-5), 6.4vw, var(--pp-size-6));
}

/* The app is not out yet: one quiet word under the line. */
.tz-soon {
  margin: 0;
}

/* ---- 3  The board: band, columns ----------------------------------------
   The app's window, drawn: the band with what is happening and the + that
   makes an issue, then the columns. */

.tz-board {
  padding: var(--pp-space-3);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-xl);
  background: var(--pp-surface);
  box-shadow: var(--pp-shadow-lg);
}

.tz-band {
  display: flex;
  align-items: center;
  gap: var(--pp-space-3);
  margin: var(--pp-space-2) var(--pp-space-2) var(--pp-space-4) var(--pp-space-3);
}

/* Close, minimise and zoom, of a window that is not in front: drawn only. */
.tz-lights {
  display: inline-flex;
  gap: var(--pp-space-3);
  margin-right: var(--pp-space-4);
}

.tz-lights > i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pp-border-strong);
}

/* What is happening: a count each, in the accent where the person is needed. */
.tz-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--pp-space-3);
  height: 30px;
  padding: 0 var(--pp-space-2) 0 var(--pp-space-4);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-pill);
  background: var(--pp-surface);
  box-shadow: var(--pp-shadow-sm);
  color: var(--pp-text);
  font-size: var(--pp-size-2);
  font-weight: var(--pp-weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.tz-chip > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--pp-radius-pill);
  background: var(--pp-surface-hover);
  font-size: var(--pp-size-1);
  font-weight: var(--pp-weight-bold);
  font-variant-numeric: tabular-nums;
  transition:
    background-color var(--pp-dur-base) var(--pp-ease),
    color var(--pp-dur-base) var(--pp-ease);
}

.tz-chip[data-zero] {
  box-shadow: none;
  color: var(--pp-text-muted);
}

.tz-chip[data-tally='approve']:not([data-zero]) > b {
  background: var(--pp-accent);
  color: var(--pp-on-accent);
}

/* The engines at work, a dot each, overlapping a little. */
.tz-chip__engines {
  display: inline-flex;
  margin-left: calc(var(--pp-space-2) * -1);
}

.tz-chip__engines > .pp-dot {
  margin-right: calc(var(--pp-space-2) * -1);
  box-shadow: 0 0 0 2px var(--pp-surface);
}

.tz-chip__engines > .pp-dot:last-child {
  margin-right: 0;
}

/* The +: a new issue. Round, as tall as the counts beside it. */
.tz-plus {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-pill);
  background: var(--pp-surface);
  box-shadow: var(--pp-shadow-sm);
  color: var(--pp-text);
}

.tz-cols {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--pp-space-3);
}

.tz-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--pp-radius-lg);
  background: var(--pp-surface-2);
  box-shadow: inset 0 0 0 1px var(--pp-border);
}

.tz-col__head {
  display: flex;
  align-items: baseline;
  gap: var(--pp-space-3);
  margin: 0;
  padding: var(--pp-space-4) var(--pp-space-4) var(--pp-space-2);
  font-size: var(--pp-size-2);
  line-height: var(--pp-leading-snug);
}

.tz-col__name {
  font-weight: var(--pp-weight-semibold);
  white-space: nowrap;
}

.tz-col__count {
  color: var(--pp-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Room for two cards: the most a column holds in the story. */
.tz-col__body {
  display: flex;
  flex-direction: column;
  gap: var(--pp-space-3);
  min-height: calc(2 * var(--tz-card) + var(--pp-space-2) + 2 * var(--pp-space-3));
  padding: var(--pp-space-2) var(--pp-space-3) var(--pp-space-3);
}

/* ---- 4  A card, and its workers -----------------------------------------
   A tz-slot is a card's place on the board; the script moves the slot, so a
   card's workers travel with it. */

.tz-slot {
  position: relative;
  display: grid;
  min-width: 0;
}

.tz-card {
  display: grid;
  gap: var(--pp-space-2);
  min-width: 0;
  height: var(--tz-card);
  padding: var(--pp-space-4) var(--pp-space-4) 0;
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-md);
  background: var(--pp-surface);
  box-shadow: var(--pp-shadow-sm);
  overflow: hidden;
}

/* The card the flow below is about: the selection's edge. */
.tz-card--watched {
  border-color: var(--pp-accent);
  box-shadow: 0 0 0 3px var(--pp-accent-soft), var(--pp-shadow-sm);
}

.tz-card__top {
  display: flex;
  align-items: center;
  gap: var(--pp-space-3);
  height: 14px;
  margin: 0;
  color: var(--pp-text-muted);
}

.tz-priority {
  flex: none;
}

.tz-card__key {
  font: var(--pp-weight-medium) var(--pp-size-1) / 1 var(--pp-font-mono);
  white-space: nowrap;
}

.tz-card__title {
  min-height: calc(var(--pp-leading-snug) * 1em);
  margin: 0;
  overflow: hidden;
  font-size: var(--pp-size-2);
  font-weight: var(--pp-weight-medium);
  line-height: var(--pp-leading-snug);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The lead's workers, hung under its card while they are at work: each on
   its own engine, as the lanes below branch. */
.tz-workers {
  display: none;
  margin: var(--pp-space-2) 0 0 var(--pp-space-5);
  padding: 0;
  list-style: none;
}

.tz-slot[data-live='workers'] > .tz-workers {
  display: grid;
}

.tz-workers > li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding-left: var(--pp-space-5);
  color: var(--pp-text-muted);
  font-size: var(--pp-size-1);
  line-height: 1;
  white-space: nowrap;
}

.tz-workers > li > b {
  color: var(--pp-engine-text);
  font-weight: var(--pp-weight-semibold);
}

/* The branch to a worker: down from the card, then across to its name. */
.tz-workers > li::before {
  content: '';
  position: absolute;
  top: calc(var(--pp-space-2) * -1);
  bottom: 10px;
  left: 0;
  width: 11px;
  border: 0 solid var(--pp-dot);
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: var(--pp-radius-sm);
}

.tz-workers > li + li::before {
  top: -11px;
}

/* ---- 5  A card's one live line ------------------------------------------
   One line, the same height whatever it says. Its tint says whose turn it
   is: the accent where the person is asked, the state's colours where
   something is done, none for the rest. Every line a card may say is in the
   page; all but one are hidden. */

.tz-live {
  --tz-tint: transparent;
  --tz-ink: var(--pp-text-muted);
  display: flex;
  align-items: center;
  gap: var(--pp-space-2);
  height: var(--tz-live);
  min-width: 0;
  margin: var(--pp-space-2) calc(var(--pp-space-4) * -1) 0;
  padding: 0 var(--pp-space-2) 0 var(--pp-space-4);
  border-top: 1px solid var(--pp-border);
  background: var(--tz-tint);
  color: var(--tz-ink);
  font-size: var(--pp-size-2);
  line-height: 1;
  white-space: nowrap;
}

.tz-live[data-group='writing'] {
  font-size: var(--pp-size-1);
}

.tz-live[data-group='new'] {
  --tz-tint: var(--pp-accent-soft);
  padding-left: var(--pp-space-2);
  border-top-color: transparent;
}

.tz-live[data-group='agent'] {
  --tz-ink: var(--pp-engine-text);
}

.tz-live[data-group='gate'] {
  --pp-dot: var(--pp-state-progress);
}

.tz-live[data-group='approve'] {
  --tz-tint: var(--pp-ok-soft);
  --tz-ink: var(--pp-ok-text);
  --pp-dot: var(--pp-ok);
  border-top-color: transparent;
}

.tz-live:is([data-group='passed'], [data-group='done']) {
  --tz-ink: var(--pp-ok-text);
}

.tz-live[data-group='deployed'] {
  --tz-ink: var(--pp-accent-text);
}

.tz-live__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tz-live:is([data-group='agent'], [data-group='approve'], [data-group='done'], [data-group='deployed']) > .tz-live__text {
  font-weight: var(--pp-weight-semibold);
}

/* What leads the line keeps a full step from its words. */
.tz-live > :is(.pp-arms, .pp-dot, .tz-live__icon, .tz-checks, .tz-shipped) {
  flex: none;
  margin-right: var(--pp-space-2);
}

/* A quiet count of the workers of the session at work. */
.tz-live__workers {
  flex: none;
  padding: 3px 6px;
  border-radius: var(--pp-radius-pill);
  background: var(--pp-surface-hover);
  color: var(--pp-text-muted);
  font-size: var(--pp-size-1);
  font-weight: var(--pp-weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* The checks as three short arms, drawn when passed. They do not move: a
   machine is not an agent at work. */
.tz-checks {
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
}

.tz-checks > i {
  width: 4px;
  height: 12px;
  border-radius: var(--pp-radius-pill);
  background: var(--pp-border-strong);
}

.tz-checks > i[data-done] {
  background: var(--pp-state-main);
}

/* Done: the state pill's own dot, the design system's deployed one. */
.tz-shipped {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pp-state-deployed);
  box-shadow: 0 0 0 2px var(--pp-accent-soft);
}

/* A pull request's number, at the line's end. */
.tz-pr {
  margin-left: auto;
  padding: 0 var(--pp-space-3);
  color: var(--pp-accent-text);
  font: var(--pp-weight-semibold) var(--pp-size-1) / 1 var(--pp-font-mono);
}

/* A line's action, drawn: a new card's two answers, and Touch ID's mark. */
.tz-act {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: var(--tz-act);
  padding: 0 var(--pp-space-4);
  border-radius: var(--pp-radius-pill);
  color: var(--pp-accent-text);
  font-weight: var(--pp-weight-semibold);
}

.tz-act--primary,
.tz-act--touch {
  background: var(--pp-accent);
  color: var(--pp-on-accent);
}

.tz-act--touch {
  width: var(--tz-act);
  margin-left: auto;
  padding: 0;
}

/* ---- 6  The flow: lanes, steps, the state --------------------------------
   One lane per actor; time runs left to right. Each step of the list is a
   column: its words, its piece of every lane, and the issue's state where it
   changes. The lanes are drawn per step, to the step's full width, so they
   join whatever the width.

   In a step's graph, <i> elements, placed by data-l (a lane) or by data-a and
   data-b (from lane, to lane):
     ln           a lane passing through      ln--from / ln--to   starting / ending at the node
     nd           a node                      nd--you, nd--fixed  the person; a fixed program
     br           a branch leaving lane a at the node for lane b, and running along it
     mg           lane b coming back into lane a, at the node
     dn, up       lane a to lane b at the step's left edge; and back at its right
     lk           the dashed link between the person and the lead            */

/* As wide as the board's columns, so that the two stand edge to edge. */
.tz-flow {
  display: grid;
  grid-template-columns: var(--tz-who) minmax(0, 1fr);
  margin-top: var(--pp-space-5);
  padding: 0 calc(var(--pp-space-3) + 1px);
}

/* Who: a name beside each lane, and what the first and last rows are. */
.tz-who {
  display: grid;
  grid-template-rows: var(--tz-what) repeat(5, var(--tz-pitch)) var(--tz-state);
  align-items: center;
}

.tz-who__key {
  align-self: end;
  padding-bottom: var(--pp-space-3);
}

.tz-who__key > .tz-card__key {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--pp-space-3);
  border: 1px solid var(--pp-accent);
  border-radius: var(--pp-radius-sm);
  background: var(--pp-surface);
  box-shadow: 0 0 0 3px var(--pp-accent-soft);
  color: var(--pp-text-muted);
}

.tz-who__issue {
  color: var(--pp-text-muted);
  font: var(--pp-size-1) / 1.5 var(--pp-font-mono);
  letter-spacing: 0.02em;
}

.tz-lane {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--pp-size-2);
  font-weight: var(--pp-weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.tz-lane > small {
  margin-left: var(--pp-space-1);
  color: var(--pp-text-muted);
  font-size: var(--pp-size-1);
  font-weight: var(--pp-weight-regular);
}

.tz-lane > .pp-dot ~ .pp-dot {
  margin-left: var(--pp-space-2);
}

/* The person and the fixed program, as their nodes are drawn. */
.tz-dot {
  flex: none;
  width: 8px;
  height: 8px;
}

.tz-dot--you {
  border: 2px solid var(--pp-text);
  border-radius: 50%;
}

.tz-dot--fixed {
  border-radius: 2px;
  background: var(--pp-text);
}

.tz-steps {
  position: relative;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tz-step {
  position: relative;
  display: grid;
  grid-template-rows: var(--tz-what) calc(5 * var(--tz-pitch)) var(--tz-state);
  min-width: 0;
}

.tz-step__what {
  align-self: end;
  margin: 0;
  padding: 0 var(--pp-space-1) var(--pp-space-3);
  font-size: var(--pp-size-2);
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.tz-graph {
  position: relative;
}

/* A piece is drawn in --tz-ink: its paint (the lane's colour, unless it says
   otherwise), at the share --tz-on that its step is lit, over the page's
   ground. Mixed, not made translucent: two pieces that overlap show no seam. */
.tz-graph > i {
  --tz-paint: var(--pp-dot);
  --tz-ink: color-mix(in srgb, var(--tz-paint) var(--tz-on, 100%), var(--pp-bg));
  position: absolute;
}

.tz-graph [data-l='0'] { --l: 0; }
.tz-graph [data-l='1'] { --l: 1; }
.tz-graph [data-l='2a'] { --l: 1.72; }
.tz-graph [data-l='2b'] { --l: 2.28; }
.tz-graph [data-l='3'] { --l: 3; }
.tz-graph [data-l='4'] { --l: 4; }
.tz-graph [data-a='1'] { --a: 1; }
.tz-graph [data-b='2a'] { --b: 1.72; }
.tz-graph [data-b='2b'] { --b: 2.28; }
.tz-graph [data-b='3'] { --b: 3; }

/* A lane reaches half a pixel into the steps beside it, so that no seam shows
   where two steps meet. */
.tz-graph .ln {
  top: calc(var(--tz-pitch) * (var(--l) + 0.5) - var(--tz-line) / 2);
  right: -0.5px;
  left: -0.5px;
  height: var(--tz-line);
  background: var(--tz-ink);
}

.tz-graph .ln--from {
  left: 50%;
}

.tz-graph .ln--to {
  right: 50%;
}

/* The person's lane: thin and dashed. It is there all along, and seldom used.
   Its dashes are a pattern fixed to the window, not a border, so that they
   run on unbroken from one step to the next. */
.tz-graph .ln--you {
  --tz-paint: var(--pp-text-muted);
  top: calc(var(--tz-pitch) * 0.5 - 0.75px);
  right: 0;
  left: 0;
  height: 1.5px;
  background: repeating-linear-gradient(to right, var(--tz-ink) 0 4px, transparent 4px 7px) fixed;
}

.tz-graph .ln--you.ln--from {
  left: 50%;
}

.tz-graph .ln--you.ln--to {
  right: 50%;
}

/* Poulpe's: a rail, from the checks to the last stage. */
.tz-graph .ln--fixed {
  --tz-paint: var(--pp-text-faint);
  top: calc(var(--tz-pitch) * (var(--l) + 0.5) - 1px);
  height: 2px;
}

.tz-graph .nd {
  z-index: 2;
  top: calc(var(--tz-pitch) * (var(--l) + 0.5) - var(--tz-node) / 2);
  left: calc(50% - var(--tz-node) / 2);
  width: var(--tz-node);
  height: var(--tz-node);
  border-radius: 50%;
  background: var(--tz-ink);
  box-shadow: 0 0 0 3px var(--pp-bg);
}

.tz-graph .nd--small {
  --tz-node: 11px;
  box-shadow: 0 0 0 2px var(--pp-bg);
}

.tz-graph .nd--you {
  --tz-paint: var(--pp-text);
  border: 2.5px solid var(--tz-ink);
  background: var(--pp-bg);
}

.tz-graph .nd--fixed {
  --tz-paint: var(--pp-text);
  border-radius: 3px;
}

.tz-graph :is(.br, .mg, .dn, .up) {
  top: calc(var(--tz-pitch) * (var(--a) + 0.5));
  height: calc(var(--tz-pitch) * (var(--b) - var(--a)) + var(--tz-line) / 2);
  border: 0 solid var(--tz-ink);
  border-bottom-width: var(--tz-line);
}

.tz-graph .br {
  right: -0.5px;
  left: calc(50% - var(--tz-line) / 2);
  border-left-width: var(--tz-line);
  border-bottom-left-radius: var(--tz-turn);
}

.tz-graph .mg {
  right: calc(50% - var(--tz-line) / 2);
  left: -0.5px;
  border-right-width: var(--tz-line);
  border-bottom-right-radius: var(--tz-turn);
}

.tz-graph .dn {
  right: 50%;
  left: calc(var(--tz-line) / -2);
  border-left-width: var(--tz-line);
  border-bottom-left-radius: var(--tz-turn);
}

.tz-graph .up {
  right: calc(var(--tz-line) / -2);
  left: 50%;
  border-right-width: var(--tz-line);
  border-bottom-right-radius: var(--tz-turn);
}

.tz-graph .lk {
  --tz-paint: var(--pp-text-muted);
  top: calc(var(--tz-pitch) * 0.5);
  left: calc(50% - 0.75px);
  height: var(--tz-pitch);
  border-left: 1.5px dashed var(--tz-ink);
}

/* The issue's state, under the step that changes it; a dotted line says
   that it holds in between. */
.tz-step__state {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
}

.tz-step__state::before {
  content: '';
  position: absolute;
  top: calc(50% - 0.75px);
  right: 0;
  left: 0;
  height: 1.5px;
  background: repeating-linear-gradient(to right, var(--pp-text-faint) 0 1.5px, transparent 1.5px 4.5px) fixed;
}

.tz-step:first-child > .tz-step__state::before {
  left: 50%;
}

.tz-step:last-child > .tz-step__state::before {
  right: 50%;
}

.tz-step__state > .pp-state {
  position: relative;
  height: 20px;
  padding: 0 8px 0 6px;
  font-size: var(--pp-size-1);
}

.tz-step__state > .pp-state::before {
  width: 8px;
  height: 8px;
}

.tz-note {
  margin: var(--pp-space-4) var(--pp-space-3) 0;
  color: var(--pp-text-muted);
  font: var(--pp-size-1) / 1.5 var(--pp-font-mono);
  letter-spacing: 0.02em;
  text-align: right;
}

/* ---- 7  The timeline: what the script sets --------------------------------
   teaser.js puts tz-playing on <html> while the story plays, and tz-turning
   while the cards go back to their start; is-now and is-done on the steps;
   is-moving and is-entering on a card's slot; is-pressed on what the person
   presses; is-typing on a title being written; and, on the steps' list, --tz-n
   (how many steps) and --tz-at (the one being played). */

/* The cards alone leave and come back: the columns stay, and the flow goes
   back to its first step by itself. */
.tz-col__body {
  transition: opacity var(--pp-dur-slow) var(--pp-ease);
}

.tz-turning .tz-col__body {
  opacity: 0;
}

/* A card, and a row of the narrow board, glide to where they now are. */
.tz-slot,
.tz-col {
  transition: transform var(--tz-travel) var(--pp-ease);
}

.tz-card {
  transition: box-shadow var(--pp-dur-base) var(--pp-ease);
}

.tz-slot.is-moving {
  z-index: 3;
}

.tz-slot.is-moving > .tz-card {
  box-shadow: var(--pp-shadow-lg);
}

.tz-slot.is-moving > .tz-card--watched {
  box-shadow: 0 0 0 3px var(--pp-accent-soft), var(--pp-shadow-lg);
}

.tz-slot.is-entering > .tz-card {
  animation: tz-enter var(--pp-dur-slow) var(--pp-ease) both;
}

@keyframes tz-enter {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

/* What a line now says comes in; the line itself, and its tint, are there at once. */
.tz-playing .tz-live > *,
.tz-playing .tz-workers > li {
  animation: tz-say var(--pp-dur-slow) var(--pp-ease) both;
}

.tz-playing .tz-workers > li + li {
  animation-delay: var(--pp-dur-fast);
}

@keyframes tz-say {
  from {
    opacity: 0;
  }
}

/* A press: the +, a new card's "Start a session", Touch ID. */
.tz .is-pressed {
  animation: tz-press var(--pp-dur-slow) var(--pp-ease) both;
}

.tz-plus.is-pressed {
  border-color: var(--pp-accent);
  background: var(--pp-accent-soft);
  color: var(--pp-accent-text);
}

.tz-act.is-pressed {
  background: var(--pp-accent-hover);
}

@keyframes tz-press {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--tz-ring);
  }
  40% {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
    box-shadow: 0 0 0 4px var(--tz-ring);
  }
}

/* A title being written: the caret after the last letter. */
.tz-card__title.is-typing::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-left: 1px;
  background: var(--pp-accent);
  vertical-align: -0.12em;
  animation: tz-caret 1s steps(1) infinite;
}

@keyframes tz-caret {
  50% {
    opacity: 0;
  }
}

/* The playhead: a band behind the step being played, in step with the board. */
.tz-playing .tz-steps::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% / var(--tz-n));
  border-radius: var(--pp-radius-lg);
  background: var(--pp-accent-soft);
  transform: translateX(calc(var(--tz-at) * 100%));
  transition: transform var(--pp-dur-slow) var(--pp-ease);
}

.tz-playing .tz-step > *,
.tz-playing .tz-graph > i {
  transition:
    opacity var(--pp-dur-slow) var(--pp-ease),
    color var(--pp-dur-slow) var(--pp-ease),
    background-color var(--pp-dur-slow) var(--pp-ease),
    border-color var(--pp-dur-slow) var(--pp-ease);
}

/* What has not happened yet stands back: its lanes are lit by a third. */
.tz-playing .tz-step:not(.is-done, .is-now) {
  --tz-on: 30%;
}

.tz-playing .tz-step:not(.is-done, .is-now) > .tz-step__state {
  opacity: 0.3;
}

.tz-playing .tz-step:not(.is-done, .is-now) > .tz-step__what {
  color: var(--pp-text-muted);
  opacity: 0.7;
}

.tz-playing .tz-step.is-now > .tz-step__what {
  color: var(--pp-accent-text);
}

/* ---- 8  Narrower: rows, and a list of steps ------------------------------
   Under the board's columns' least width the board turns too: a row per
   state, its name beside its cards. The flow becomes the list it is: a mark
   for who, the words, the state. While it plays the list is a strip of the
   marks, with the words of the step being played under it. */

@media (max-width: 1199px) {
  .tz {
    --tz-card: 69px;
    --tz-live: 32px;
  }

  .tz-page {
    align-self: start;
    width: min(100% - 2 * var(--pp-space-4), var(--tz-narrow));
    padding: var(--pp-space-6) 0;
  }

  .tz-head > .pp-logo {
    --pp-logo-height: 34px;
  }

  .tz-board {
    border-radius: var(--pp-radius-lg);
  }

  .tz-band {
    margin: var(--pp-space-2) var(--pp-space-2) var(--pp-space-3);
  }

  .tz-lights {
    display: none;
  }

  /* Seven cards' room: the most the rows hold in the story, so that what is
     under the board does not move. */
  .tz-cols {
    grid-auto-flow: row;
    align-content: start;
    gap: 0;
    min-height: calc(7 * (var(--tz-card) + var(--pp-space-3)) + 6 * var(--pp-space-3) + 5px);
  }

  .tz-col {
    display: grid;
    grid-template-columns: var(--tz-rowhead) minmax(0, 1fr);
    border-top: 1px solid var(--pp-border);
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .tz-col:first-child {
    border-top: 0;
  }

  .tz-col__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--pp-space-1);
    padding: var(--pp-space-4) 0 0 var(--pp-space-3);
    font-size: var(--pp-size-1);
  }

  .tz-col__body {
    min-height: calc(var(--tz-card) + 2 * var(--pp-space-3));
    padding: var(--pp-space-3) var(--pp-space-2) var(--pp-space-3) 0;
  }

  /* A card in a row: its title and its key on one line. */
  .tz-card {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--pp-space-3);
    padding-top: 10px;
  }

  .tz-card__title {
    grid-row: 1;
    grid-column: 1;
  }

  .tz-card__top {
    grid-row: 1;
    grid-column: 2;
    height: auto;
  }

  .tz-priority {
    display: none;
  }

  .tz-live {
    grid-column: 1 / -1;
  }

  /* The list of steps. */
  .tz-flow {
    display: block;
    padding: 0 var(--pp-space-3);
  }

  .tz-who {
    display: none;
  }

  .tz-steps {
    grid-auto-rows: var(--tz-step);
    grid-auto-flow: row;
  }

  .tz-step {
    grid-template-rows: none;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--pp-space-3);
  }

  /* Who: the lane's dot, as the lanes draw their nodes. */
  .tz-step::before {
    content: '';
    justify-self: center;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pp-dot);
  }

  .tz-step[data-who='you']::before {
    border: 2.5px solid var(--pp-text);
    background: none;
  }

  .tz-step[data-who='poulpe']::before {
    border-radius: 2px;
    background: var(--pp-text);
  }

  .tz-step[data-who='workers']::before {
    width: 8px;
    height: 8px;
    background: var(--pp-engine-codex);
    box-shadow: 7px 0 0 var(--pp-engine-local);
    transform: translateX(-3.5px);
  }

  .tz-step__what {
    align-self: center;
    padding: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tz-graph,
  .tz-step__state::before {
    display: none;
  }

  .tz-note {
    text-align: left;
  }

  /* While it plays: the strip of marks, and the words of one step. */
  .tz-playing .tz-steps {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-rows: var(--tz-step);
    grid-auto-flow: column;
    padding-bottom: var(--tz-step);
  }

  .tz-playing .tz-step {
    position: static;
    grid-template-columns: none;
    justify-items: center;
  }

  .tz-playing .tz-steps::before {
    bottom: var(--tz-step);
    border-radius: var(--pp-radius-pill);
  }

  .tz-playing .tz-step__what {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--tz-step);
    font-size: var(--pp-size-3);
    font-weight: var(--pp-weight-medium);
    line-height: var(--tz-step);
    text-align: center;
  }

  .tz-playing .tz-step:not(.is-now) > .tz-step__what {
    opacity: 0;
  }

  .tz-playing .tz-step.is-now > .tz-step__what {
    color: var(--pp-text);
  }

  .tz-playing .tz-step__state {
    display: none;
  }

  .tz-playing .tz-step:not(.is-done, .is-now)::before {
    opacity: 0.3;
  }
}

/* The smallest phones: a card gives up its key, so that its title and its
   line still read whole. */
@media (max-width: 359px) {
  .tz-page {
    width: calc(100% - 2 * var(--pp-space-3));
  }

  .tz-card__top {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tz *,
  .tz *::before,
  .tz *::after {
    animation: none !important;
  }
}

/* The legal footer sits after the teaser, outside its board and timeline. */
.pp-sprite { position: absolute; }

.tz-footer {
  padding: var(--pp-space-4) var(--pp-space-6);
  color: var(--pp-text-muted);
  font-size: var(--pp-size-2);
  text-align: center;
}

.tz-footer a { color: inherit; text-underline-offset: 0.2em; }
.tz-footer a:hover { color: var(--pp-accent-hover); }
.tz-footer a:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 4px; }
