/* web/src/static/funnel.css — the pictures of the account pages and the layout of the three steps:
   Sign up, Pick a size, Your console. On a step: one text column at the left (372 px, the same on all
   three), one picture at the right; on a phone the picture is small and stands over the text. The
   markup is pages.ts and scenes.ts (span and i, aria-hidden), placed here by classes: the CSP stays
   style-src 'self'. The robots and the colours are team.css (the public page), linked first.
   HONEST MOTION: a part changes only under the data-* value that a page script sets from a REAL signal
   (console.js: data-stage from stage.js) or with the checked radio. The default of every rule is the END
   state of its value, so with prefers-reduced-motion each state shows still and whole; every
   animation is inside the prefers-reduced-motion: no-preference block. Only transform, opacity and colours move. */

/* ================================================================ LOOK (no motion) */

/* The step rail beside the mark: four stops, the stop of now is bright. */
.path { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font: 500 13px/1 var(--font-mono); }
.path li { display: flex; gap: 8px; }
.path li + li::before { content: "·"; }
.path[data-at="account"] [data-stop="account"] > span, .path[data-at="plan"] [data-stop="plan"] > span, .path[data-at="server"] [data-stop="server"] > span, .path[data-at="console"] [data-stop="console"] > span { color: var(--ink-0); }
@media (max-width: 359px) { .path, .path li { gap: 5px; } .path { font-size: 12px; } .ftop .wrap { gap: 10px; } }

/* ---------------------------------------------------------------- a step: text column, picture */
main.step { width: 100%; max-width: none; padding: 40px 0; }
.step > .wrap { display: grid; grid-template-columns: 372px minmax(0, 1fr); column-gap: 60px; align-items: center; }
.col { min-width: 0; }
.col > * { margin: 0; }
.col h1 { margin-left: -0.04em; font-size: 48px; line-height: 1.04; letter-spacing: -0.04em; text-wrap: balance; }
.col > .sub, #server-text { margin: 16px 0 0; color: var(--ink-1); font-size: 18px; line-height: 1.45; text-wrap: pretty; }
/* the field and the main action: one size on all three steps */
.col form { display: grid; gap: 12px; margin-top: 32px; }
.col input:not([type="radio"]) { height: 52px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line-2); }
.col input::placeholder { color: var(--ink-2); opacity: 1; }
.col input:not([type="radio"]):focus { box-shadow: inset 0 0 0 1px var(--ink-1); }
.col button, .col .button { width: 100%; height: 52px; border-radius: 10px; font-size: 16px; }
.col button:focus-visible, .col .button:focus-visible, .col a:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 3px; }
.col .accept { margin-top: 12px; color: var(--ink-2); font-size: var(--text-sm); }
.col .status { min-height: 0; margin-top: 16px; font-size: var(--text-base); }
.col .status:empty { margin-top: 0; }
/* Sign up: the status line has its place (two lines) from the start, so its words move nothing */
.col #signup ~ .status { min-height: 3em; margin-top: 12px; }
.col .alt { margin-top: 12px; font-size: 16px; }
.col .alt a { text-decoration: none; }
/* a step with no list (a payment that failed, the wait for the payment): its words, then its action */
#step { margin-top: 28px; }
#step > * { margin: 0; }
#step > * + * { margin-top: 16px; }
#step > p { color: var(--ink-1); font-size: 16px; }
#step > p strong { color: var(--ink-0); }
#step > p.muted { color: var(--ink-2); font-size: var(--text-sm); }
#server-actions { margin-top: 28px; gap: 12px; }
#server-actions > p { color: var(--ink-1); font-size: 16px; }
#server-actions > p.muted { color: var(--ink-2); font-size: var(--text-sm); }
.step .fold { grid-column: 1; min-width: 0; margin-top: 40px; }
/* the two steps with the fold start at a fixed height: an open fold moves nothing over it */
main.step:has(#server) { justify-content: flex-start; padding-top: clamp(32px, 15vh, 150px); }
main.step:has(#plans) { padding-top: clamp(28px, 7vh, 88px); }

/* ---------------------------------------------------------------- the step "Pick a size" */
/* pages.ts planCards: pick, then pay. Real radios in rows (the row is the label: a press anywhere in
   it picks): a size, then how to pay, the pay line and the main button. The amounts of every size and
   period are in the markup; only the ones of the checked radios show (:has(:checked), so with no
   script too); a hidden one is display: none, so a screen reader reads the shown one only. */
#plans p { margin: 0; }
#plans .choose { min-width: 0; margin: 0; padding: 0; border: 0; }
#plans [data-for], #plans [data-per] { display: none; }
#plans:has(input[name="size"][value="small"]:checked) [data-for="small"],
#plans:has(input[name="size"][value="medium"]:checked) [data-for="medium"],
#plans:has(input[name="size"][value="large"]:checked) [data-for="large"],
#plans:has(input[name="period"][value="month"]:checked) [data-per="month"],
#plans:has(input[name="period"][value="year"]:checked) [data-per="year"] { display: inline; }
.opt { color: var(--ink-0); cursor: pointer; }
/* one list: the sizes */
#plans .sizes { border-radius: 14px; background: var(--bg-1); box-shadow: 0 0 0 1px var(--line); }
#plans .sizes .opt { display: grid; grid-template-columns: 18px 1fr auto; column-gap: 14px; row-gap: 4px; align-items: center; align-content: center; min-height: 76px; padding: 12px 16px; border-radius: 14px; }
#plans .sizes .opt + .opt { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
#plans .sizes .opt:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* the radio: an 18 px ring (style.css draws every input as a text field: undone here) */
.opt > input[type="radio"] {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); cursor: pointer;
}
.opt > input[type="radio"]:checked { box-shadow: inset 0 0 0 5.5px var(--ink-0); }
.opt:has(> input:focus-visible) { outline: 2px solid var(--ink-1); outline-offset: 2px; }
@media (hover: hover) { .opt:hover > input:not(:checked, :disabled) { box-shadow: inset 0 0 0 1.5px var(--ink-0); } }
/* a full size: not pressable, and it looks so; "Full" stays at full strength */
.opt:has(> input:disabled), .opt > input:disabled { cursor: default; }
.opt:has(> input:disabled) > :not(.o-name) { opacity: .5; }
.opt:has(> input:disabled) > .o-name { color: color-mix(in srgb, var(--ink-0) 50%, transparent); }
.opt:has(> input:disabled) .full { color: var(--ink-0); }
@media (forced-colors: active) { .opt > input[type="radio"] { -webkit-appearance: auto; appearance: auto; } }
.sizes .o-name { font-size: 16px; font-weight: 600; }
.sizes .o-price { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.per { color: var(--ink-1); font-size: var(--text-base); font-weight: 400; }
.sizes .o-sub { grid-column: 2 / -1; color: var(--ink-2); font: 400 var(--text-sm)/1.4 var(--font-mono); letter-spacing: -0.02em; }
/* the marks: Recommended, and a full size */
.rec, .full { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--bg-3); color: var(--ink-1); font-size: 11px; font-weight: 500; line-height: 1.35; vertical-align: 1px; }
.full { background: none; box-shadow: inset 0 0 0 1px var(--line-2); }
/* the switch yearly / monthly: the radios fill their half and are not drawn */
#plans .pers { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 46px; margin-top: 12px; padding: 3px; border-radius: 11px; background: var(--bg-1); box-shadow: 0 0 0 1px var(--line); }
#plans .pers .opt { position: relative; display: grid; place-items: center; border-radius: 8px; color: var(--ink-1); font-size: var(--text-base); font-weight: 500; }
#plans .pers .opt > input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
#plans .pers .opt:has(> input:checked) { background: var(--bg-3); color: var(--ink-0); }
.free { color: var(--ink-1); }
@media (forced-colors: active) { #plans .pers .opt:has(> input:checked) { outline: 2px solid Highlight; } }
#plans .sum { display: grid; gap: 16px; margin-top: 20px; }
#plans .sum p { color: var(--ink-1); font-size: 16px; line-height: 1.45; text-wrap: pretty; }
#plans .sum p strong { color: var(--ink-0); }
#plans > p.muted, #plans > noscript p { margin-top: 12px; }

/* ---------------------------------------------------------------- the three pictures */
/* --a: the side of one robot (12 cells: a whole number of screen pixels for each cell). */
.pic { --a: 48px; }
.pic .av { width: var(--a); height: var(--a); }
.row12 .av, .crew .av { border-radius: 0; background-color: transparent; }

/* Sign up: the team in one row on a line. The last row of cells is empty: the feet are on the line. */
.row12 { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line-2); }
.row12 .av { margin-bottom: calc(var(--a) / -12); }

/* Pick a size: the box of the checked size is bright, its lights are on and its robots stand on it.
   The robots of the other boxes are down, out of the window .crew, which ends at the box's upper edge. */
.boxes { --k: 1; --led: 8px; --next: 14px; display: flex; align-items: flex-end; justify-content: space-between; padding-top: calc(var(--a) + 8px); border-bottom: 1px solid var(--line-2); }
.box { position: relative; display: block; border-radius: 12px 12px 0 0; background: var(--bg-1); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.s-small { width: calc(126px * var(--k)); height: calc(108px * var(--k)); }
.s-medium { width: calc(162px * var(--k)); height: calc(144px * var(--k)); }
.s-large { width: calc(216px * var(--k)); height: calc(180px * var(--k)); }
.crew { position: absolute; left: 50%; bottom: calc(100% - var(--a) / 12); display: flex; gap: calc(8px * var(--k)); transform: translateX(-50%); clip-path: inset(-50% 0 calc(var(--a) / 12)); }
.crew .av { transform: translateY(100%); }
.leds { position: absolute; left: calc(18px * var(--k)); top: calc(18px * var(--k)); }
.leds, .leds::before, .leds::after { width: var(--led); height: var(--led); background: var(--glow, var(--bg-3)); }
.leds::before, .leds::after { content: ""; position: absolute; top: 0; left: var(--next); }
.leds::after { left: calc(2 * var(--next)); }
.grill { position: absolute; left: calc(18px * var(--k)); right: calc(18px * var(--k)); bottom: calc(18px * var(--k)); height: calc(10px * var(--k)); border: solid var(--line-2); border-width: 2px 0; }
main:has(input[name="size"][value="small"]:checked) .s-small,
main:has(input[name="size"][value="medium"]:checked) .s-medium,
main:has(input[name="size"][value="large"]:checked) .s-large { background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
main:has(input[name="size"][value="small"]:checked) .s-small .crew .av,
main:has(input[name="size"][value="medium"]:checked) .s-medium .crew .av,
main:has(input[name="size"][value="large"]:checked) .s-large .crew .av { transform: none; }
main:has(input[name="size"][value="small"]:checked) .s-small .leds,
main:has(input[name="size"][value="medium"]:checked) .s-medium .leds,
main:has(input[name="size"][value="large"]:checked) .s-large .leds { --glow: var(--ink-0); }

/* Your console: 12 places. The robots come in with the real stage: three when the order is on its way,
   six when the server starts, nine when the console answers, all when it is ready. The ones that come
   next are dim; a server that is off, stops or is deleted has the whole team dim; no server: no robot. */
.tiles { --a: 96px; display: grid; grid-template-columns: repeat(4, var(--a)); justify-content: space-between; row-gap: 40px; }
.slot { display: block; border-radius: 25%; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.slot .av { opacity: 0; }
/* The tile and the robot in it are two parts, so that the robot can jump and the tile stays: .av is
   the tile (a picture of size 0 is not drawn), its ::before is the robot, with the same picture. */
.slot .av { background-size: 0 0; }
.slot .av::before { content: ""; display: block; height: 100%; background: inherit; background-color: transparent; background-size: 1200% 100%; }
.tiles:is([data-stage="order"], [data-stage="blocked"]) .slot:nth-child(-n+6) .av,
.tiles[data-stage="start"] .slot:nth-child(-n+9) .av,
.tiles:is([data-stage="answer"], [data-stage="off"], [data-stage="stopping"], [data-stage="deleting"]) .av { opacity: .38; }
.tiles:is([data-stage="order"], [data-stage="blocked"]) .slot:nth-child(-n+3) .av,
.tiles[data-stage="start"] .slot:nth-child(-n+6) .av,
.tiles[data-stage="answer"] .slot:nth-child(-n+9) .av,
.tiles[data-stage="ready"] .av { opacity: 1; }

/* a smaller window: the same two columns with smaller pictures */
@media (max-width: 1100px) {
  .step > .wrap { column-gap: 40px; }
  .pic { --a: 36px; }
  .boxes { --k: .75; --led: 6px; --next: 10px; }
  .tiles { --a: 72px; row-gap: 28px; }
}
/* two columns: the line of the robots is level with the lower edge of the sign-up button */
@media (min-width: 901px) { .row12 { margin-top: 118px; } }
/* one column: a small picture over the title, the text under it */
@media (max-width: 900px) {
  main.step, main.step:has(#server), main.step:has(#plans) { justify-content: flex-start; padding: 32px 0 40px; }
  .step > .wrap { grid-template-columns: minmax(0, 440px); justify-content: center; }
  .pic { --a: 24px; order: -1; margin-bottom: 32px; }
  .boxes { --k: .4; --led: 3px; --next: 6px; justify-content: space-evenly; }
  .box { border-radius: 6px 6px 0 0; }
  .tiles { --a: 48px; grid-template-columns: repeat(6, var(--a)); row-gap: 12px; }
  .col h1 { font-size: 38px; }
  .col > .sub, #server-text { margin-top: 12px; font-size: 17px; }
  .col form { margin-top: 24px; }
  #step, #server-actions { margin-top: 24px; }
}
/* a phone: "Recommended" stays on the line of its size, the button is in the first screen */
@media (max-width: 430px) {
  main.step, main.step:has(#server), main.step:has(#plans) { padding-top: 24px; }
  .pic { margin-bottom: 24px; }
  .boxes { --k: .35; --next: 5px; }
  #plans .sizes .opt { column-gap: 10px; min-height: 68px; padding: 10px 16px; }
  #plans .sum { gap: 12px; margin-top: 14px; }
  .rec, .full { margin-left: 2px; padding: 2px 6px; }
}
@media (max-width: 389px) {
  main:has(#plans) .pic { display: none; }
  .tiles { --a: 36px; }
  .sizes .per { display: block; text-align: right; }
}

/* ---------------------------------------------------------------- the heads of the other cards */
/* A scene is the head of its card: the band (full card width, its own sky and ground; --p is one
   scene pixel) with the scene's grid of whole pixels in its middle. Sprites (robot, key, question
   mark) use 2 scene pixels per cell (.x2). */
.band { --p: 3px; position: relative; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-1); }
form > .band, .card > .band { margin: -16px -16px 0; }
@media (max-width: 379px) { .band { --p: 2px; } }
.sc { --u: var(--p); position: relative; width: calc(var(--u)*116); margin: 0 auto; color: var(--ink-0); }
.sc span, .sc i, .sc b { position: absolute; display: block; font-style: normal; }
.sc .x2 { --u: calc(var(--p) * 2); }
.sc .earth { left: -100vw; right: -100vw; bottom: 0; background: var(--bg-2); }
.sc .gnd { left: -100vw; right: -100vw; height: calc(var(--u)*1); background: repeating-linear-gradient(90deg, var(--ink-2) 0 calc(var(--u)*1), transparent calc(var(--u)*1) calc(var(--u)*3)); }
.sc .cloud { height: calc(var(--u)*2); background: color-mix(in srgb, var(--ink-2) 22%, transparent); }
.sc .cloud::before { content: ""; position: absolute; left: 25%; top: calc(var(--u)*-2); width: 50%; height: calc(var(--u)*2); background: inherit; }
.sc .qw { width: calc(var(--u)*10); height: calc(var(--u)*14); color: var(--ink-1); opacity: 0; }
.sc .qw .px { left: 0; top: 0; }

/* sprites: a grid of cells; each <i> is one rectangle (rules made from the rows) */
.sc .px { display: grid; grid-template-columns: repeat(12, calc(var(--u)*1)); grid-auto-rows: calc(var(--u)*1); }
.sc .px > i { position: static; background: currentColor; }
.sc .px.key { grid-template-columns: repeat(8, calc(var(--u)*1)); width: calc(var(--u)*8); height: calc(var(--u)*3); }
.sc .px.q { grid-template-columns: repeat(5, calc(var(--u)*1)); width: calc(var(--u)*5); height: calc(var(--u)*7); }

/* the robot: the mark in parts (12 × 12 cells), eyelids, legs, two small arms */
.rb { left: 0; top: 0; width: calc(var(--u)*12); height: calc(var(--u)*12); }
.rb > .px { inset: 0; }
.rb .lid { top: calc(var(--u)*4); width: calc(var(--u)*2); height: calc(var(--u)*2); background: currentColor; opacity: 0; }
.rb .lid.l { left: calc(var(--u)*3); } .rb .lid.r { left: calc(var(--u)*7); }
.rb .leg { top: calc(var(--u)*10); width: calc(var(--u)*2); height: calc(var(--u)*1); background: currentColor; }
.rb .leg.l { left: calc(var(--u)*2); } .rb .leg.r { left: calc(var(--u)*8); }
.rb .arm { width: calc(var(--u)*1); background: currentColor; }
.rb .arm.l { left: 0; top: calc(var(--u)*6); height: calc(var(--u)*3); } .rb .arm.r { left: calc(var(--u)*11); top: calc(var(--u)*6); height: calc(var(--u)*3); }
.rb .arm.up { left: calc(var(--u)*11); top: calc(var(--u)*3); height: calc(var(--u)*4); opacity: 0; }
.sc .who { width: calc(var(--u)*24); height: calc(var(--u)*24); }

/* ---------------------------------------------------------------- Sign in, access code, recover: the key */
.sc-key, .sc-pay { height: calc(var(--u)*40); }
.sc-key .earth, .sc-pay .earth { top: calc(var(--u)*35); }
.sc-key .gnd, .sc-pay .gnd { top: calc(var(--u)*34); }
.sc-key .c1 { left: calc(var(--u)*8); top: calc(var(--u)*8); width: calc(var(--u)*12); } .sc-key .c2 { left: calc(var(--u)*92); top: calc(var(--u)*5); width: calc(var(--u)*16); }
.sc-key .who { left: calc(var(--u)*40); top: calc(var(--u)*10); }
.sc-key .slot-key { left: calc(var(--u)*66); top: calc(var(--u)*22); width: calc(var(--u)*16); height: calc(var(--u)*6); border: calc(var(--u)*1) dashed var(--ink-2); opacity: .8; }
.sc-key .kw { left: calc(var(--u)*66); top: calc(var(--u)*22); width: calc(var(--u)*16); height: calc(var(--u)*6); opacity: 0; }
.sc-key .kw .key { left: 0; top: 0; }
.sc-key .qw { left: calc(var(--u)*68); top: calc(var(--u)*3); }
.sc-key[data-at="done"] .kw, .sc-in .kw { opacity: 1; }
.sc-key[data-at="done"] .slot-key { opacity: 0; }
.sc-key[data-at="done"] .rb-ant { color: var(--ok); }
.sc-key[data-at="ask"] .arm.up { opacity: 1; } .sc-key[data-at="ask"] .arm.r { opacity: 0; }
.sc-key[data-at="err"] .qw { opacity: 1; }
.sc-in[data-at="done"] .kw .key { transform: rotate(90deg); transform-origin: calc(var(--u)*1.5) calc(var(--u)*1.5); }

/* sign in and recover: the head stands alone (no card around it), a tile of its own */
main > .band { border-radius: var(--radius); box-shadow: var(--shadow); }
main > .band + * { margin-top: 16px; }

/* ---------------------------------------------------------------- The test subscription: the stamp */
.sc-pay .c1 { left: calc(var(--u)*4); top: calc(var(--u)*4); width: calc(var(--u)*12); }
.sc-pay .who { left: calc(var(--u)*8); top: calc(var(--u)*10); }
.sc-pay .tk { left: calc(var(--u)*38); top: calc(var(--u)*5); width: calc(var(--u)*72); height: calc(var(--u)*26); border: calc(var(--u)*1) solid var(--ink-0); background: var(--bg-2); }
.sc-pay .tk::before, .sc-pay .tk::after { content: ""; position: absolute; top: calc(var(--u)*9); width: calc(var(--u)*3); height: calc(var(--u)*6); background: var(--bg-1); border: calc(var(--u)*1) solid var(--ink-0); }
.sc-pay .tk::before { left: calc(var(--u)*-1); border-left: 0; } .sc-pay .tk::after { right: calc(var(--u)*-1); border-right: 0; }
.sc-pay .tk-l { left: calc(var(--u)*7); height: calc(var(--u)*2); background: color-mix(in srgb, var(--ink-2) 70%, transparent); }
.sc-pay .tk-l.a { top: calc(var(--u)*6); width: calc(var(--u)*24); } .sc-pay .tk-l.b { top: calc(var(--u)*11); width: calc(var(--u)*32); } .sc-pay .tk-l.c { top: calc(var(--u)*16); width: calc(var(--u)*16); }
.sc-pay .stamp { right: calc(var(--u)*6); top: calc(var(--u)*6); padding: calc(var(--u)*1) calc(var(--u)*3); border: calc(var(--u)*1) solid var(--ink-0); border-radius: calc(var(--u)*1); font: 700 calc(var(--p) * 7)/1.2 var(--font-mono); letter-spacing: .12em; color: var(--ink-0); transform: rotate(-9deg); opacity: 0; }
.sc-pay[data-at="done"] .stamp { opacity: 1; }

/* hidden for the eye, read by a screen reader */
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* a narrow phone: the console's two actions stand one under the other (their words do not wrap) */
@media (max-width: 359px) { #server-actions > .actions { grid-auto-flow: row; } }

/* the rectangles of the sprites (scenes.ts spriteCss(); scenes.test.ts checks them) */
.rb-ant>i:nth-child(1){grid-area:2/6/span 2/span 2}
.rb-bd>i:nth-child(1){grid-area:4/3/span 1/span 8}
.rb-bd>i:nth-child(2){grid-area:5/2/span 2/span 2}
.rb-bd>i:nth-child(3){grid-area:5/6/span 2/span 2}
.rb-bd>i:nth-child(4){grid-area:5/10/span 2/span 2}
.rb-bd>i:nth-child(5){grid-area:7/2/span 1/span 10}
.rb-bd>i:nth-child(6){grid-area:8/2/span 1/span 2}
.rb-bd>i:nth-child(7){grid-area:8/5/span 1/span 4}
.rb-bd>i:nth-child(8){grid-area:8/10/span 1/span 2}
.rb-bd>i:nth-child(9){grid-area:9/2/span 1/span 3}
.rb-bd>i:nth-child(10){grid-area:9/9/span 1/span 3}
.rb-bd>i:nth-child(11){grid-area:10/3/span 1/span 8}
.key>i:nth-child(1){grid-area:1/1/span 1/span 3}
.key>i:nth-child(2){grid-area:2/1/span 1/span 1}
.key>i:nth-child(3){grid-area:2/3/span 1/span 6}
.key>i:nth-child(4){grid-area:3/1/span 1/span 3}
.key>i:nth-child(5){grid-area:3/6/span 1/span 1}
.key>i:nth-child(6){grid-area:3/8/span 1/span 1}
.q>i:nth-child(1){grid-area:1/2/span 1/span 3}
.q>i:nth-child(2){grid-area:2/1/span 1/span 1}
.q>i:nth-child(3){grid-area:2/5/span 2/span 1}
.q>i:nth-child(4){grid-area:4/3/span 1/span 2}
.q>i:nth-child(5){grid-area:5/3/span 1/span 1}
.q>i:nth-child(6){grid-area:7/3/span 1/span 1}

/* ================================================================ MOTION (only with no preference) */
@media (prefers-reduced-motion: no-preference) {
  /* A wave: the place of a robot in it (--i). In a row: left to right. */
  :is(.row12, .crew) .av { --i: 0; }
  :is(.row12, .crew) .av:nth-child(2) { --i: 1; } :is(.row12, .crew) .av:nth-child(3) { --i: 2; } :is(.row12, .crew) .av:nth-child(4) { --i: 3; }
  .row12 .av:nth-child(5) { --i: 4; } .row12 .av:nth-child(6) { --i: 5; } .row12 .av:nth-child(7) { --i: 6; } .row12 .av:nth-child(8) { --i: 7; }
  .row12 .av:nth-child(9) { --i: 8; } .row12 .av:nth-child(10) { --i: 9; } .row12 .av:nth-child(11) { --i: 10; } .row12 .av:nth-child(12) { --i: 11; }

  /* Pick a size: the box of the new pick gets bright, its robots come up onto it one by one (a little
     too high, then down on the box), its three lights go on one after the other. On the old
     box all lights go off and all robots go down together. Transitions: a fast second pick turns them
     round. */
  .box { --up: 220ms var(--ease-in-out); --each: 0ms; --light: 0ms; transition: background-color 320ms ease, box-shadow 320ms ease; }
  main:has(input[name="size"][value="small"]:checked) .s-small,
  main:has(input[name="size"][value="medium"]:checked) .s-medium,
  main:has(input[name="size"][value="large"]:checked) .s-large { --up: 400ms cubic-bezier(0.34, 1.56, 0.64, 1); --each: 50ms; --light: 120ms; }
  .crew .av { transition: transform var(--up) calc((var(--i) + 1) * var(--each)); }
  .leds, .leds::before, .leds::after { transition: background-color 120ms ease var(--light); }
  .leds::before { transition-delay: calc(2 * var(--light)); }
  .leds::after { transition-delay: calc(3 * var(--light)); }
  .opt, .opt > input[type="radio"] { transition: background-color 120ms, color 120ms, box-shadow 120ms; }

  /* Sign up: the passkey is made: the robots jump, a wave from left to right. It ends (848 ms) before
     the page goes on (signup.js: 900 ms). */
  .row12[data-at="done"] .av { --h: -50%; animation: jump 320ms calc(var(--i) * 48ms) both; }

  /* Your console: a new stage lets its robots in one by one. */
  .slot .av { transition: opacity 320ms var(--ease-out); }
  .tiles[data-from] .slot:nth-child(3n+2) .av { transition-delay: 160ms; }
  .tiles[data-from] .slot:nth-child(3n) .av { transition-delay: 320ms; }
  /* A robot that gets fully lit hops in its tile, at the end of its fade (then the loop below, while the server is made); those that are lit
     when the page loads hop in a wave from the upper left. It is the hop of the public page
     (landing.css). An animation starts only when a robot comes under this rule: a poll, or a next
     stage that keeps it lit, starts no second hop. After a wait the wave of jumps (below) is in its place. */
  .tiles:is([data-stage="order"], [data-stage="blocked"]) .slot:nth-child(-n+3) .av::before,
  .tiles[data-stage="start"] .slot:nth-child(-n+6) .av::before,
  .tiles[data-stage="answer"] .slot:nth-child(-n+9) .av::before,
  .tiles[data-stage="ready"] .av::before { animation: tileHop 280ms var(--ease-in-out) var(--lit); }
  /* While the server is made (order, start, answer; not blocked: a stopped make stands still) the lit
     robots go on hopping after their first hop: the same hop, then a rest, 2.4 s for each robot. Each
     robot has its own place in the round (--o, steps of 200 ms; the order is loose: next places differ by
     1 s), so some robot is in the air at each moment and no two rows move as one block. The delay of the
     loop does not use --lit, so a change of stage never moves a loop that runs: an animation starts only
     when a robot comes under this rule. At ready the rule ends; the jumps (or the one hop) take its place. */
  .tiles[data-stage="order"] .slot:nth-child(-n+3) .av::before,
  .tiles[data-stage="start"] .slot:nth-child(-n+6) .av::before,
  .tiles[data-stage="answer"] .slot:nth-child(-n+9) .av::before { animation: tileHop 280ms var(--ease-in-out) var(--lit), tileLoop 2400ms var(--ease-in-out) calc(1100ms + var(--o) * 200ms) infinite; }
  .slot { --lit: calc(320ms + (var(--x) + var(--y)) * 70ms); }
  .slot:nth-child(1) { --o: 5; } .slot:nth-child(2) { --o: 10; } .slot:nth-child(3) { --o: 3; } .slot:nth-child(4) { --o: 8; } .slot:nth-child(5) { --o: 1; } .slot:nth-child(6) { --o: 6; }
  .slot:nth-child(7) { --o: 11; } .slot:nth-child(8) { --o: 4; } .slot:nth-child(9) { --o: 9; } .slot:nth-child(10) { --o: 2; } .slot:nth-child(11) { --o: 7; } .slot:nth-child(12) { --o: 0; }
  .tiles[data-from] .slot { --lit: 320ms; }
  .tiles[data-from] .slot:nth-child(3n+2) { --lit: 480ms; }
  .tiles[data-from] .slot:nth-child(3n) { --lit: 640ms; }
  /* After a wait that this page saw (data-cheer) the robots jump in their tiles, a wave from the upper
     left to the lower right. A jump is two cells of the picture high; the red robot has only one free
     above its head. */
  .tiles[data-cheer][data-stage="ready"] .av::before { animation: jump 320ms calc(400ms + (var(--x) + var(--y)) * 70ms) both; }
  .slot { --x: 0; --y: 0; --h: -16.6667%; }
  .slot .av-security { --h: -8.3333%; }
  @media not all and (max-width: 900px) {
    .slot:nth-child(4n+2) { --x: 1; } .slot:nth-child(4n+3) { --x: 2; } .slot:nth-child(4n) { --x: 3; }
    .slot:nth-child(n+5) { --y: 1; } .slot:nth-child(n+9) { --y: 2; }
  }
  @media (max-width: 900px) {
    .slot:nth-child(6n+2) { --x: 1; } .slot:nth-child(6n+3) { --x: 2; } .slot:nth-child(6n+4) { --x: 3; } .slot:nth-child(6n+5) { --x: 4; } .slot:nth-child(6n) { --x: 5; }
    .slot:nth-child(n+7) { --y: 1; }
  }

  /* the robot of a card is alive: it blinks; its antenna changes colour softly */
  .rb .rb-ant { transition: color 200ms ease; }
  .rb .lid { animation: blink 4.2s steps(1) 1.4s infinite; }

  /* a wave on arrival; the key drops into the hand when the passkey is made */
  .sc-key[data-at="hello"] .arm.up { animation: waveUp 1.1s steps(1) 300ms both; }
  .sc-key[data-at="hello"] .arm.r { animation: waveDn 1.1s steps(1) 300ms both; }
  .sc-key[data-at="ask"] .slot-key { animation: pulse 1.2s ease-in-out infinite alternate; }
  .sc-key[data-at="done"] .kw { animation: keyDrop 560ms var(--ease-out) both; }
  .sc-key[data-at="done"] .who { animation: hop 380ms var(--ease-out) 420ms both; }
  .sc-key[data-at="err"] .qw { animation: pop 260ms var(--ease-out) both; }
  .sc-in[data-at="done"] .kw .key { animation: keyTurn 300ms steps(1) both; }

  /* the test subscription: the stamp lands */
  .sc-pay[data-at="done"] .stamp { animation: stamp 300ms var(--ease-out) 160ms both; }
  .sc-pay[data-at="done"] .tk { animation: thud 220ms var(--ease-out) 400ms both; }
  .sc-pay[data-at="done"] .arm.up { animation: waveUp 500ms steps(1) both; }
  .sc-pay[data-at="done"] .arm.r { animation: waveDn 500ms steps(1) both; }

  /* under the title: new words fade in, new actions rise in */
  #server-text > span { transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
  @starting-style { #server-text > span { opacity: 0; transform: translateY(2px); } }
  #server-actions > * { transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
  @starting-style { #server-actions > * { opacity: 0; transform: translateY(4px); } }
}

@keyframes blink { 0%, 96% { opacity: 0; } 97%, 100% { opacity: 1; } }
@keyframes waveUp { 0% { opacity: 1; } 18% { opacity: 0; } 36% { opacity: 1; } 54% { opacity: 0; } 72% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes waveDn { 0% { opacity: 0; } 18% { opacity: 1; } 36% { opacity: 0; } 54% { opacity: 1; } 72% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes pulse { to { opacity: .35; } }
@keyframes pop { from { opacity: 0; transform: translateY(calc(var(--u)*3)) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes keyDrop { 0% { opacity: 0; transform: translateY(calc(var(--u)*-26)); } 25% { opacity: 1; } 72% { transform: translateY(calc(var(--u)*2)); } 100% { opacity: 1; transform: none; } }
@keyframes keyTurn { 0% { transform: none; } 50% { transform: rotate(45deg); } 100% { transform: rotate(90deg); } }
@keyframes hop { 0%, 100% { transform: none; } 45% { transform: translateY(calc(var(--u)*-4)); } }
/* a jump as of a real body: the two curves are the two halves of the parabola of a throw; --h: its height */
@keyframes jump {
  0%, 100% { transform: none; animation-timing-function: cubic-bezier(0.3333, 0.6667, 0.6667, 1); }
  50% { transform: translateY(var(--h)); animation-timing-function: cubic-bezier(0.3333, 0, 0.6667, 0.3333); }
}
/* the hop of the public page (landing.css): one cell of the robot's picture high */
@keyframes tileHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8.3333%); } }
/* the same hop, once in each round of 2.4 s: 280 ms of hop, then the rest */
@keyframes tileLoop { 0%, 11.6667%, 100% { transform: translateY(0); } 5.8333% { transform: translateY(-8.3333%); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-9deg) scale(1.7); } to { opacity: 1; transform: rotate(-9deg); } }
@keyframes thud { 0%, 100% { transform: none; } 40% { transform: translateY(calc(var(--u)*2)); } }
