/*
 * The app's loading screen. Shown by index.html before any JS runs (on a
 * visit or refresh) and by AppLoader (src/components/shared/app-loader.tsx)
 * while a route's code downloads. Plain CSS on purpose: it has to render
 * before the app's own stylesheet exists, so it carries its own tokens.
 *
 * One of nine pictures plays while the status line cycles, each a thing
 * a shop counts, keeps or does. index.html picks one at random for a visit
 * (data-boot-scene on <html>) and BootScene
 * (src/components/shared/boot-scene.tsx) carries it on:
 *   abacus   beads slide across one after another and click into place,
 *            then go home in the opposite order
 *   files    three folder tabs rise one after another, like files being
 *            flipped through
 *   receipt  a till feeds out a slip, line by line, then it's torn off
 *   crates   three crates land on a shelf and are carried off
 *   scale    a pair of scales rocks, its pans staying level
 * and, for what the app has learnt since (Israel, 10 October 2026):
 *   rider      a delivery bike with a parcel on its rack, wheels turning
 *   swap       a phone and a boxed one trade places, and trade back
 *   checklist  a clipboard's three boxes are ticked off in turn
 *   scan       a scanner's line runs down a barcode label and back
 * Nothing shows for the first 400ms, so a fast load never flashes it;
 * after 8s a note offers a reload.
 *
 * Brand colours (web/docs/design/DESIGN_SYSTEM.md 6): mint, gamboge and
 * blue things with ink on paper, a dotted track, no shadow. The colours
 * stay in dark mode; what is drawn in ink turns pale, where ink would
 * vanish.
 *
 * .tabs-boot--inline is the same loader inside the page, under the top
 * bar (components/shared/business-opening.tsx).
 */

.tabs-boot {
  --tabs-boot-bg: #ebebeb;
  --tabs-boot-fg: #292929;
  --tabs-boot-muted: #5b6472;
  --tabs-boot-mint: #04e2c1;
  --tabs-boot-gamboge: #f29a13;
  --tabs-boot-blue: #2a96c8;
  /* The third folder tab is ink, and white in the dark. */
  --tabs-boot-tab-3: #292929;
  /* How far a bead slides: the rod's length less the four beads on it. */
  --tabs-boot-travel: 41px;
  --tabs-boot-track: #c4c8cd;
  --tabs-boot-bar: #292929;
  --tabs-boot-hover: #dedede;

  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px;
  background: var(--tabs-boot-bg);
  color: var(--tabs-boot-fg);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  opacity: 0;
  animation: tabs-boot-in 300ms ease-out 400ms forwards;
}

/* AppLoader: the router has already waited 400ms, so no second delay. */
.tabs-boot--now {
  animation-delay: 0ms;
}

html.dark .tabs-boot {
  --tabs-boot-bg: #090d15;
  --tabs-boot-fg: #ebf0f4;
  --tabs-boot-muted: #9dabbe;
  --tabs-boot-tab-3: #ffffff;
  --tabs-boot-track: #34405a;
  --tabs-boot-bar: #04e2c1;
  --tabs-boot-hover: #171d2b;
}

/* Inside the page: under the top bar, on whatever the page sits on. It
   shows after 150ms, so a business that opens at once never flashes it. */
.tabs-boot--inline {
  position: relative;
  min-height: calc(100svh - 3rem);
  background: transparent;
  animation-delay: 150ms;
}

/* The stage the picture plays on. Every picture is drawn in it, and the
   one picked for this visit is shown. */
.tabs-boot__stage {
  position: relative;
  width: 124px;
  height: 98px;
}

.tabs-boot__scene {
  display: none;
  position: absolute;
  inset: 0;
}

.tabs-boot__scene--on,
html:not([data-boot-scene]) .tabs-boot__scene--abacus,
html[data-boot-scene="abacus"] .tabs-boot__scene--abacus,
html[data-boot-scene="files"] .tabs-boot__scene--files,
html[data-boot-scene="receipt"] .tabs-boot__scene--receipt,
html[data-boot-scene="crates"] .tabs-boot__scene--crates,
html[data-boot-scene="scale"] .tabs-boot__scene--scale,
html[data-boot-scene="rider"] .tabs-boot__scene--rider,
html[data-boot-scene="swap"] .tabs-boot__scene--swap,
html[data-boot-scene="checklist"] .tabs-boot__scene--checklist,
html[data-boot-scene="scan"] .tabs-boot__scene--scan {
  display: block;
}

/* The abacus: a frame on two feet, three rods, four beads on each. */

.tabs-boot__abacus {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  width: 124px;
  height: 92px;
  padding: 9px 10px;
  border: 3px solid var(--tabs-boot-fg);
  border-radius: 18px;
}

/* Its feet. */
.tabs-boot__abacus::before,
.tabs-boot__abacus::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 16px;
  height: 6px;
  border-radius: 0 0 6px 6px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__abacus::before {
  left: 14px;
}

.tabs-boot__abacus::after {
  right: 14px;
}

.tabs-boot__rod {
  position: relative;
  display: flex;
  gap: 3px;
  height: 20px;
}

/* The rod itself, from one side of the frame to the other. */
.tabs-boot__rod::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  left: -10px;
  height: 2px;
  margin-top: -1px;
  background: var(--tabs-boot-fg);
}

/* The middle rod counts the other way. */
.tabs-boot__rod--2 {
  transform: scaleX(-1);
}

.tabs-boot__bead {
  position: relative;
  width: 12px;
  height: 20px;
  border-radius: 6px;
  /* A little past the mark and back: the bead clicks into place. */
  animation: 2.6s cubic-bezier(0.3, 1.3, 0.6, 1) infinite;
}

.tabs-boot__rod--1 .tabs-boot__bead {
  background: var(--tabs-boot-mint);
}

.tabs-boot__rod--2 .tabs-boot__bead {
  background: var(--tabs-boot-gamboge);
  animation-delay: 180ms;
}

.tabs-boot__rod--3 .tabs-boot__bead {
  background: var(--tabs-boot-blue);
  animation-delay: 360ms;
}

/* The first bead stays; the other three go over, the far one first. */
.tabs-boot__bead:nth-child(4) {
  animation-name: tabs-boot-bead-first;
}

.tabs-boot__bead:nth-child(3) {
  animation-name: tabs-boot-bead-second;
}

.tabs-boot__bead:nth-child(2) {
  animation-name: tabs-boot-bead-third;
}

/* The folder tabs. */
.tabs-boot__files {
  position: absolute;
  bottom: 0;
  left: 8px;
  width: 108px;
  height: 96px;
}

.tabs-boot__tab {
  position: absolute;
  bottom: 0;
  width: 30px;
  height: 64px;
  border-radius: 12px 12px 4px 4px;
  transform: translateY(0);
  animation: tabs-boot-rise 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.tabs-boot__tab--1 {
  left: 0;
  background: var(--tabs-boot-mint);
}

.tabs-boot__tab--2 {
  left: 39px;
  background: var(--tabs-boot-gamboge);
  animation-delay: 150ms;
}

.tabs-boot__tab--3 {
  left: 78px;
  background: var(--tabs-boot-tab-3);
  animation-delay: 300ms;
}

/* The receipt: a till with a slot and a light, and a slip fed out of it.
   The slip is paper, so it's white with ink on it in both themes. */
.tabs-boot__till {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 12px;
  width: 100px;
  height: 24px;
  border-radius: 9px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__till::before {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 5px;
  left: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-bg);
}

.tabs-boot__till::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tabs-boot-mint);
}

/* What the slip is seen through: it starts at the slot. */
.tabs-boot__slip-window {
  position: absolute;
  top: 21px;
  left: 30px;
  width: 64px;
  height: 77px;
  overflow: hidden;
}

.tabs-boot__slip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  width: 64px;
  height: 62px;
  padding: 11px 9px 0;
  border: 3px solid var(--tabs-boot-fg);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  animation: tabs-boot-slip 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.tabs-boot__slip i {
  display: block;
  flex: none;
  height: 4px;
  border-radius: 2px;
  background: #292929;
}

.tabs-boot__slip i:nth-child(2) {
  width: 68%;
}

.tabs-boot__slip i:nth-child(3) {
  width: 84%;
}

/* The total. */
.tabs-boot__slip i:nth-child(4) {
  align-self: flex-end;
  width: 56%;
  height: 9px;
  border-radius: 3px;
  background: var(--tabs-boot-mint);
}

/* The crates: two on the shelf and one on top, each with its tape. */
.tabs-boot__shelf {
  position: absolute;
  right: 6px;
  bottom: 4px;
  left: 6px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__box {
  position: absolute;
  width: 38px;
  height: 28px;
  border-radius: 7px;
  animation: 3s ease-out infinite;
}

.tabs-boot__box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 11px;
  margin-left: -3px;
  border-radius: 0 0 3px 3px;
  background: #292929;
}

.tabs-boot__box--1 {
  bottom: 8px;
  left: 22px;
  background: var(--tabs-boot-mint);
  animation-name: tabs-boot-box-first;
}

.tabs-boot__box--2 {
  bottom: 8px;
  left: 64px;
  background: var(--tabs-boot-gamboge);
  animation-name: tabs-boot-box-second;
}

.tabs-boot__box--3 {
  bottom: 36px;
  left: 43px;
  background: var(--tabs-boot-blue);
  animation-name: tabs-boot-box-third;
}

/* The scales: a post on a base, a beam that rocks on a mint pivot, and a
   pan hung from each end with something on it. */
.tabs-boot__scale-base {
  position: absolute;
  bottom: 2px;
  left: 40px;
  width: 44px;
  height: 7px;
  border-radius: 5px 5px 2px 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__scale-post {
  position: absolute;
  bottom: 6px;
  left: 60px;
  width: 4px;
  height: 62px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__beam {
  position: absolute;
  top: 28px;
  left: 14px;
  width: 96px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
  animation: tabs-boot-beam 2.8s ease-in-out infinite;
}

.tabs-boot__beam::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 42px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tabs-boot-mint);
}

/* A pan turns against the beam by as much as the beam turns, so it hangs
   straight down. */
.tabs-boot__pan {
  position: absolute;
  top: 2px;
  width: 30px;
  height: 30px;
  transform-origin: 50% 0;
  animation: tabs-boot-pan 2.8s ease-in-out infinite;
}

.tabs-boot__pan--left {
  left: -11px;
}

.tabs-boot__pan--right {
  right: -11px;
}

.tabs-boot__pan::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  width: 2px;
  height: 25px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__pan::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 30px;
  height: 5px;
  border-radius: 0 0 8px 8px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__pan i {
  position: absolute;
  z-index: 1;
  bottom: 6px;
  left: 7px;
  width: 16px;
  height: 13px;
  border-radius: 4px;
  background: var(--tabs-boot-gamboge);
}

.tabs-boot__pan--right i {
  left: 9px;
  width: 12px;
  height: 10px;
  border-radius: 3px;
  background: var(--tabs-boot-blue);
}

/* The rider: a delivery bike with a parcel on its rack, going nowhere
   fast. The wheels turn, the road runs under them, the parcel jogs. */
.tabs-boot__road {
  position: absolute;
  bottom: 3px;
  left: 6px;
  display: flex;
  gap: 12px;
  width: 112px;
  height: 4px;
  overflow: hidden;
}

/* A dash and its gap are 28px, and each dash runs back exactly that far,
   so the road never jumps. */
.tabs-boot__road i {
  flex: none;
  width: 16px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
  animation: tabs-boot-road 0.45s linear infinite;
}

.tabs-boot__wheel {
  position: absolute;
  bottom: 9px;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 3px solid var(--tabs-boot-fg);
  border-radius: 50%;
  animation: tabs-boot-wheel 0.9s linear infinite;
}

.tabs-boot__wheel--rear {
  left: 18px;
}

.tabs-boot__wheel--front {
  left: 80px;
}

/* Its two spokes. */
.tabs-boot__wheel::before,
.tabs-boot__wheel::after {
  content: "";
  position: absolute;
  background: var(--tabs-boot-fg);
}

.tabs-boot__wheel::before {
  top: 50%;
  right: 2px;
  left: 2px;
  height: 2px;
  margin-top: -1px;
}

.tabs-boot__wheel::after {
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
}

/* The frame, from one hub to the other, with the seat on its post. */
.tabs-boot__bike {
  position: absolute;
  bottom: 21px;
  left: 32px;
  width: 62px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__bike::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 26px;
  width: 4px;
  height: 16px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__bike::after {
  content: "";
  position: absolute;
  bottom: 14px;
  left: 19px;
  width: 20px;
  height: 6px;
  border-radius: 3px 3px 2px 2px;
  background: var(--tabs-boot-fg);
}

/* The fork leans back from the front hub to the handlebar. */
.tabs-boot__fork {
  position: absolute;
  bottom: 21px;
  left: 92px;
  width: 4px;
  height: 34px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
  transform: rotate(-16deg);
  transform-origin: 50% 100%;
}

.tabs-boot__fork::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10px;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__rack {
  position: absolute;
  bottom: 35px;
  left: 12px;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-fg);
}

.tabs-boot__parcel {
  position: absolute;
  bottom: 39px;
  left: 14px;
  width: 32px;
  height: 24px;
  border-radius: 7px;
  background: var(--tabs-boot-mint);
  animation: tabs-boot-jog 0.45s ease-in-out infinite;
}

.tabs-boot__parcel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 10px;
  margin-left: -3px;
  border-radius: 0 0 3px 3px;
  background: #292929;
}

/* The swap: a phone and a boxed one trade places, one going over as the
   other goes under, and then trade back. */
.tabs-boot__trade {
  position: absolute;
  top: 23px;
  width: 40px;
  height: 52px;
  border-radius: 11px;
  animation: 3.4s infinite;
}

.tabs-boot__trade::before,
.tabs-boot__trade::after {
  content: "";
  position: absolute;
  background: #292929;
}

/* The phone: its speaker and its button. */
.tabs-boot__trade--1 {
  left: 14px;
  background: var(--tabs-boot-mint);
  animation-name: tabs-boot-trade-over;
}

.tabs-boot__trade--1::before {
  top: 7px;
  left: 13px;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}

.tabs-boot__trade--1::after {
  bottom: 7px;
  left: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* The box: its tape. */
.tabs-boot__trade--2 {
  left: 70px;
  background: var(--tabs-boot-gamboge);
  animation-name: tabs-boot-trade-under;
}

.tabs-boot__trade--2::before {
  top: 0;
  left: 17px;
  width: 6px;
  height: 14px;
  border-radius: 0 0 3px 3px;
}

/* The checklist: a clipboard whose three boxes are ticked off in turn.
   It is paper, so white with ink on it in both themes. */
.tabs-boot__board {
  position: absolute;
  top: 9px;
  left: 25px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-sizing: border-box;
  width: 74px;
  height: 86px;
  padding: 20px 11px 0;
  border: 3px solid var(--tabs-boot-fg);
  border-radius: 11px;
  background: #ffffff;
}

/* Its clip, in gamboge so it shows on the paper and on the dark. */
.tabs-boot__board::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  width: 28px;
  height: 12px;
  border-radius: 5px;
  background: var(--tabs-boot-gamboge);
}

.tabs-boot__board i {
  position: relative;
  display: block;
  flex: none;
  height: 12px;
}

.tabs-boot__board i::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: 2.5px solid #292929;
  border-radius: 4px;
  animation: 3.2s ease-out infinite;
}

.tabs-boot__board i:nth-child(1)::before {
  animation-name: tabs-boot-tick-first;
}

.tabs-boot__board i:nth-child(2)::before {
  animation-name: tabs-boot-tick-second;
}

.tabs-boot__board i:nth-child(3)::before {
  animation-name: tabs-boot-tick-third;
}

.tabs-boot__board i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 20px;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: #292929;
}

.tabs-boot__board i:nth-child(2)::after {
  width: 20px;
}

.tabs-boot__board i:nth-child(3)::after {
  width: 25px;
}

/* The scan: a barcode label with a price sticker on its corner, and the
   scanner's line going down it and back. The sticker jumps at each pass. */
.tabs-boot__label {
  position: absolute;
  top: 17px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  width: 96px;
  height: 64px;
  border: 3px solid var(--tabs-boot-fg);
  border-radius: 11px;
  background: #ffffff;
}

.tabs-boot__label i {
  flex: none;
  width: 4px;
  height: 34px;
  border-radius: 1px;
  background: #292929;
}

.tabs-boot__label i:nth-child(2),
.tabs-boot__label i:nth-child(4),
.tabs-boot__label i:nth-child(6),
.tabs-boot__label i:nth-child(7) {
  width: 2px;
}

.tabs-boot__label i:nth-child(3),
.tabs-boot__label i:nth-child(8) {
  width: 6px;
}

.tabs-boot__label::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tabs-boot-gamboge);
  animation: tabs-boot-beep 1.8s ease-out infinite;
}

.tabs-boot__laser {
  position: absolute;
  top: 29px;
  left: 4px;
  width: 116px;
  height: 4px;
  border-radius: 2px;
  background: var(--tabs-boot-blue);
  animation: tabs-boot-laser 1.8s ease-in-out infinite;
}

/* Status copy: three lines crossfading in one slot. */
.tabs-boot__status {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--tabs-boot-muted);
}

/* One line that stays, where there's a single thing to say. */
.tabs-boot__status--steady .tabs-boot__line {
  opacity: 1;
  animation: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs-boot__line {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: tabs-boot-line 7.5s ease-in-out infinite;
}

.tabs-boot__line:nth-child(2) {
  animation-delay: 2.5s;
}

.tabs-boot__line:nth-child(3) {
  animation-delay: 5s;
}

/* Indeterminate progress sweep, along a dotted rule. */
.tabs-boot__track {
  position: relative;
  width: 160px;
  height: 4px;
  margin-top: -14px;
  overflow: hidden;
  border-radius: 999px;
}

.tabs-boot__track::before {
  content: "";
  position: absolute;
  inset: 1px 0 auto;
  border-top: 2px dotted var(--tabs-boot-track);
}

.tabs-boot__bar {
  position: relative;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--tabs-boot-bar);
  animation: tabs-boot-sweep 1.4s ease-in-out infinite;
}

/* After 8s: it's slow, say so and offer a way out. */
.tabs-boot__slow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tabs-boot-muted);
  opacity: 0;
  visibility: hidden;
  animation: tabs-boot-slow 400ms ease-out 8s forwards;
}

.tabs-boot__reload {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border: 2px solid var(--tabs-boot-fg);
  border-radius: 999px;
  background: transparent;
  color: var(--tabs-boot-fg);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.tabs-boot__reload:hover {
  background: var(--tabs-boot-hover);
}

.tabs-boot__reload:focus-visible {
  outline: 2px solid var(--tabs-boot-fg);
  outline-offset: 2px;
}

.tabs-boot__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes tabs-boot-in {
  to {
    opacity: 1;
  }
}

/* Over in turn, then home in the opposite order, so no bead ever has to
   pass through another. */
@keyframes tabs-boot-bead-first {
  0%,
  88%,
  100% {
    transform: translateX(0);
  }
  14%,
  74% {
    transform: translateX(var(--tabs-boot-travel));
  }
}

@keyframes tabs-boot-bead-second {
  0%,
  10%,
  78%,
  100% {
    transform: translateX(0);
  }
  24%,
  64% {
    transform: translateX(var(--tabs-boot-travel));
  }
}

@keyframes tabs-boot-bead-third {
  0%,
  20%,
  68%,
  100% {
    transform: translateX(0);
  }
  34%,
  54% {
    transform: translateX(var(--tabs-boot-travel));
  }
}

@keyframes tabs-boot-rise {
  0%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-30px);
  }
  55% {
    transform: translateY(0);
  }
}

/* Fed out a third at a time, as a till prints; held; then torn off. It
   starts again from inside the till, out of sight. */
@keyframes tabs-boot-slip {
  0% {
    opacity: 1;
    transform: translateY(-100%);
  }
  12%,
  22% {
    transform: translateY(-64%);
  }
  34%,
  44% {
    transform: translateY(-30%);
  }
  56%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  92%,
  100% {
    opacity: 0;
    transform: translateY(26%);
  }
}

/* Each crate drops, lands with a small bounce and waits; then all three
   are carried off together. */
@keyframes tabs-boot-box-first {
  0% {
    opacity: 0;
    transform: translate(0, -64px);
  }
  12% {
    opacity: 1;
    transform: translate(0, 0);
  }
  15% {
    transform: translate(0, -5px);
  }
  18%,
  80% {
    opacity: 1;
    transform: translate(0, 0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translate(64px, 0);
  }
}

@keyframes tabs-boot-box-second {
  0%,
  14% {
    opacity: 0;
    transform: translate(0, -64px);
  }
  26% {
    opacity: 1;
    transform: translate(0, 0);
  }
  29% {
    transform: translate(0, -5px);
  }
  32%,
  80% {
    opacity: 1;
    transform: translate(0, 0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translate(64px, 0);
  }
}

@keyframes tabs-boot-box-third {
  0%,
  28% {
    opacity: 0;
    transform: translate(0, -44px);
  }
  40% {
    opacity: 1;
    transform: translate(0, 0);
  }
  43% {
    transform: translate(0, -5px);
  }
  46%,
  80% {
    opacity: 1;
    transform: translate(0, 0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translate(64px, 0);
  }
}

@keyframes tabs-boot-beam {
  0%,
  100% {
    transform: rotate(-9deg);
  }
  50% {
    transform: rotate(9deg);
  }
}

@keyframes tabs-boot-pan {
  0%,
  100% {
    transform: rotate(9deg);
  }
  50% {
    transform: rotate(-9deg);
  }
}

@keyframes tabs-boot-road {
  to {
    transform: translateX(-28px);
  }
}

@keyframes tabs-boot-wheel {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tabs-boot-jog {
  50% {
    transform: translateY(-2px);
  }
}

/* Each goes round the other: out over the top (or under), a wait on the
   far side, and home the other way. Easing in to the middle of a crossing
   and out of it keeps the turn round. */
@keyframes tabs-boot-trade-over {
  0%,
  12% {
    transform: translate(0, 0);
    animation-timing-function: ease-in;
  }
  27% {
    transform: translate(28px, -20px);
    animation-timing-function: ease-out;
  }
  42%,
  58% {
    transform: translate(56px, 0);
    animation-timing-function: ease-in;
  }
  73% {
    transform: translate(28px, 20px);
    animation-timing-function: ease-out;
  }
  88%,
  100% {
    transform: translate(0, 0);
  }
}

@keyframes tabs-boot-trade-under {
  0%,
  12% {
    transform: translate(0, 0);
    animation-timing-function: ease-in;
  }
  27% {
    transform: translate(-28px, 20px);
    animation-timing-function: ease-out;
  }
  42%,
  58% {
    transform: translate(-56px, 0);
    animation-timing-function: ease-in;
  }
  73% {
    transform: translate(-28px, -20px);
    animation-timing-function: ease-out;
  }
  88%,
  100% {
    transform: translate(0, 0);
  }
}

/* A box fills and jumps as it is ticked; all three clear together. */
@keyframes tabs-boot-tick-first {
  0%,
  8% {
    background: transparent;
    transform: scale(1);
  }
  13% {
    background: var(--tabs-boot-mint);
    transform: scale(1.35);
  }
  18%,
  86% {
    background: var(--tabs-boot-mint);
    transform: scale(1);
  }
  94%,
  100% {
    background: transparent;
    transform: scale(1);
  }
}

@keyframes tabs-boot-tick-second {
  0%,
  28% {
    background: transparent;
    transform: scale(1);
  }
  33% {
    background: var(--tabs-boot-mint);
    transform: scale(1.35);
  }
  38%,
  86% {
    background: var(--tabs-boot-mint);
    transform: scale(1);
  }
  94%,
  100% {
    background: transparent;
    transform: scale(1);
  }
}

@keyframes tabs-boot-tick-third {
  0%,
  48% {
    background: transparent;
    transform: scale(1);
  }
  53% {
    background: var(--tabs-boot-mint);
    transform: scale(1.35);
  }
  58%,
  86% {
    background: var(--tabs-boot-mint);
    transform: scale(1);
  }
  94%,
  100% {
    background: transparent;
    transform: scale(1);
  }
}

@keyframes tabs-boot-laser {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(36px);
  }
}

/* The line turns at 0% and at 50%: the sticker jumps just after each. */
@keyframes tabs-boot-beep {
  0%,
  50%,
  100% {
    transform: scale(1);
  }
  6%,
  56% {
    transform: scale(1.3);
  }
  14%,
  64% {
    transform: scale(1);
  }
}

@keyframes tabs-boot-line {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  6%,
  28% {
    opacity: 1;
    transform: translateY(0);
  }
  34%,
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes tabs-boot-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes tabs-boot-slow {
  to {
    opacity: 1;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs-boot__bar {
    animation: tabs-boot-pulse 2s ease-in-out infinite;
  }

  /* Each picture stands still, caught part-way: a count left on the
     abacus, the tabs in steps, the slip out, the crates stacked, the
     scales tipped. */
  .tabs-boot__bead,
  .tabs-boot__tab,
  .tabs-boot__slip,
  .tabs-boot__box,
  .tabs-boot__beam,
  .tabs-boot__pan,
  .tabs-boot__road i,
  .tabs-boot__wheel,
  .tabs-boot__parcel,
  .tabs-boot__trade,
  .tabs-boot__board i::before,
  .tabs-boot__label::after,
  .tabs-boot__laser {
    animation: none;
  }

  /* The newer four, caught the same way: the bike parked, the swap not
     yet made, two boxes ticked, the line half-way down the label. */
  .tabs-boot__board i:nth-child(-n + 2)::before {
    background: var(--tabs-boot-mint);
  }

  .tabs-boot__laser {
    transform: translateY(18px);
  }

  .tabs-boot__tab--2 {
    transform: translateY(-10px);
  }

  .tabs-boot__tab--3 {
    transform: translateY(-20px);
  }

  .tabs-boot__beam {
    transform: rotate(-7deg);
  }

  .tabs-boot__pan {
    transform: rotate(7deg);
  }

  .tabs-boot__rod--1 .tabs-boot__bead:nth-child(4),
  .tabs-boot__rod--2 .tabs-boot__bead:nth-child(n + 3),
  .tabs-boot__rod--3 .tabs-boot__bead:nth-child(n + 2) {
    transform: translateX(var(--tabs-boot-travel));
  }

  .tabs-boot__bar {
    width: 100%;
  }

  /* One steady line instead of a crossfade. */
  .tabs-boot__line {
    animation: none;
  }

  .tabs-boot__line:first-child {
    opacity: 1;
  }
}

@keyframes tabs-boot-pulse {
  50% {
    opacity: 0.6;
  }
}
