/* The feature scenes: little windows that act out what Catail does. Every looping animation in a
   scene runs for that scene's --loop with no delay, so one negative delay (--freeze) can stop the
   whole scene on a telling frame when the visitor asks for less motion. */

.features__lead {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 600;
}

.scenes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 30px 24px;
  margin-top: 36px;
}

.scene {
  --loop: 8s;
  --freeze: -4s;
  display: flex;
  flex-direction: column;
  grid-column: span 2;
  margin: 0;
  transition: opacity 420ms var(--out), translate 420ms var(--out);
}

.scene--w3 {
  grid-column: span 3;
}

.scene--w4 {
  grid-column: span 4;
}

.scene--w6 {
  grid-column: 1 / -1;
}

.scene figcaption {
  margin-top: 14px;
}

.scene figcaption h3 {
  font-size: 21px;
}

.scene figcaption p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
}

/* Off screen, everything waits. */
.scene:not(.is-on) *,
.scene:not(.is-on) *::before,
.scene:not(.is-on) *::after {
  animation-play-state: paused !important;
}

.win,
.scene .demo {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: var(--stroke);
  border-radius: 18px;
  box-shadow: var(--lift);
  overflow: hidden;
}

.scene .demo {
  box-shadow: var(--lift);
}

.scene .demo__body {
  flex: 1;
  min-height: 322px;
  height: auto;
}

.win__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--bg-2);
  border-bottom: var(--stroke);
  font-weight: 800;
  font-size: 13.5px;
}

.win__dots {
  display: flex;
  gap: 6px;
}

.win__dots i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  opacity: 0.5;
}

.win__body {
  position: relative;
  flex: 1;
  min-height: 236px;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Shared bits ---------- */

.ptr {
  position: absolute;
  z-index: 6;
  width: 30px;
  height: 37px;
  background: var(--ptr-img) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
  opacity: 0;
}

.bdg {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.sc-corner {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  background: var(--accent);
  color: var(--on-brand);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 800 13px/1 var(--body);
  white-space: nowrap;
}

.pill--swap {
  display: inline-grid;
  justify-items: center;
  align-items: center;
}

.pill--swap > span {
  grid-area: 1 / 1;
}

.pill.is-bumping {
  animation: bump 320ms var(--pop);
}

@keyframes bump {
  40% {
    transform: scale(1.14);
  }
}

.mcard {
  display: block;
  padding: 6px 8px;
  background: var(--bg-2);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 10px;
  font: 700 12px/1.2 var(--body);
  white-space: nowrap;
}

.mcard--img {
  width: 64px;
  height: 46px;
  padding: 3px;
}

.mcard .thumb {
  height: 100%;
  border-radius: 6px;
}

.msg2 {
  display: block;
  padding: 4px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 14px 14px 4px 14px;
  font: 700 14px/1.3 var(--body);
}

.msg2 .thumb {
  width: 116px;
  height: 44px;
  border-radius: 9px;
}

.msg2--text {
  padding: 7px 12px;
}

.tail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 6px;
  background: var(--brand);
  color: var(--on-brand);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 800 13px/1.2 var(--body);
  white-space: nowrap;
}

.tail::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--on-brand);
  color: var(--brand);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.menu {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--line);
  font: 700 12.5px/1.2 var(--body);
  opacity: 0;
}

.menu span {
  padding: 4px 10px;
  border-radius: 6px;
}

.menu .is-on {
  background: var(--accent);
  color: var(--on-brand);
}

.toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
}

.toolbar svg {
  width: 28px;
  height: 28px;
  padding: 5px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  border-radius: 8px;
}

.toolbar svg.is-on {
  background: var(--accent);
  stroke: var(--on-brand);
}

/* A fake page to capture from. */
.page {
  position: absolute;
  inset: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--bg-3);
  border-radius: 10px;
}

.page i {
  display: block;
  height: 7px;
  background: var(--bg-3);
  border-radius: 4px;
}

.page .page__h {
  width: 46%;
  height: 12px;
  background: var(--muted);
  opacity: 0.6;
}

.page .page__l--s {
  width: 70%;
}

.page .page__l--m {
  width: 84%;
}

.page__img {
  width: 58%;
  height: 72px;
  border: 2px solid var(--bg-3);
  border-radius: 8px;
}

/* ---------- Capture and draw ---------- */

.sc-cap__sel {
  position: absolute;
  left: 16%;
  top: 22%;
  z-index: 2;
  width: 58%;
  height: 46%;
  border: 2px solid var(--brand);
  border-radius: 3px;
  transform-origin: 100% 100%;
  animation: cap-sel var(--loop) infinite;
}

@keyframes cap-sel {
  0% {
    width: 0;
    height: 0;
    opacity: 0;
    box-shadow: 0 0 0 999px rgb(30 15 25 / 0);
  }
  5% {
    width: 0;
    height: 0;
    opacity: 1;
    box-shadow: 0 0 0 999px rgb(30 15 25 / 0.36);
  }
  18%,
  68% {
    width: 58%;
    height: 46%;
    opacity: 1;
    transform: none;
    box-shadow: 0 0 0 999px rgb(30 15 25 / 0.36);
  }
  72% {
    box-shadow: 0 0 0 999px rgb(30 15 25 / 0);
  }
  80% {
    width: 58%;
    height: 46%;
    opacity: 0;
    transform: translate(36%, 70%) scale(0.08);
    box-shadow: 0 0 0 999px rgb(30 15 25 / 0);
  }
  100% {
    width: 0;
    height: 0;
    opacity: 0;
  }
}

.sc-cap__arrow {
  position: absolute;
  inset: 12% 8% 10% 40%;
  width: 52%;
  height: 78%;
  overflow: visible;
}

.sc-cap__arrow path {
  fill: none;
  stroke: #e5484d;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 100;
  animation: cap-arrow var(--loop) infinite;
}

@keyframes cap-arrow {
  0%,
  26% {
    stroke-dashoffset: 100;
  }
  38%,
  100% {
    stroke-dashoffset: 0;
  }
}

.sc-cap__box {
  position: absolute;
  left: 7%;
  top: 14%;
  width: 34%;
  height: 58%;
  border: 3px solid #e5484d;
  border-radius: 6px;
  animation: cap-box var(--loop) infinite;
}

@keyframes cap-box {
  0%,
  42% {
    opacity: 0;
    transform: scale(0.4);
  }
  48%,
  100% {
    opacity: 1;
    transform: none;
  }
}

.sc-cap__add {
  position: absolute;
  top: calc(100% + 7px);
  right: -2px;
  transform-origin: 100% 0;
  animation: cap-add var(--loop) infinite;
}

@keyframes cap-add {
  0%,
  52% {
    opacity: 0;
    transform: scale(0.5);
  }
  57% {
    opacity: 1;
    transform: scale(1.08);
  }
  60%,
  64% {
    opacity: 1;
    transform: none;
  }
  66% {
    opacity: 1;
    transform: scale(0.9);
  }
  68%,
  100% {
    opacity: 1;
    transform: none;
  }
}

.sc-cap__bar {
  position: absolute;
  left: 16%;
  top: 4%;
  z-index: 3;
  transform-origin: 0 100%;
  animation: cap-bar var(--loop) infinite;
}

@keyframes cap-bar {
  0%,
  19% {
    opacity: 0;
    transform: translateY(6px) scale(0.85);
  }
  23%,
  68% {
    opacity: 1;
    transform: none;
  }
  72%,
  100% {
    opacity: 0;
    transform: translateY(6px) scale(0.85);
  }
}

.sc-cap .pill {
  animation: cap-pill var(--loop) infinite;
}

@keyframes cap-pill {
  0%,
  79% {
    transform: none;
  }
  82% {
    transform: scale(1.16);
  }
  86%,
  100% {
    transform: none;
  }
}

.sc-cap__n0 {
  animation: show-a var(--loop) infinite;
}

.sc-cap__n1 {
  animation: show-b var(--loop) infinite;
}

@keyframes show-a {
  0%,
  79% {
    opacity: 1;
  }
  80%,
  96% {
    opacity: 0;
  }
  97%,
  100% {
    opacity: 1;
  }
}

@keyframes show-b {
  0%,
  79% {
    opacity: 0;
  }
  80%,
  96% {
    opacity: 1;
  }
  97%,
  100% {
    opacity: 0;
  }
}

/* ---------- Undo ---------- */

.sc-undo__chat {
  position: absolute;
  inset: 12px 14px 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sc-undo__m1 {
  animation: undo-m1 var(--loop) infinite;
}

.sc-undo__m2 {
  animation: undo-m2 var(--loop) infinite;
}

.sc-undo__m3 {
  animation: undo-m3 var(--loop) infinite;
}

@keyframes undo-m1 {
  0%,
  2% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  5%,
  52% {
    opacity: 1;
    transform: none;
  }
  60%,
  100% {
    opacity: 0;
    transform: translate(40px, 120px) scale(0.3);
  }
}

@keyframes undo-m2 {
  0%,
  5% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  8%,
  54% {
    opacity: 1;
    transform: none;
  }
  62%,
  100% {
    opacity: 0;
    transform: translate(40px, 90px) scale(0.3);
  }
}

@keyframes undo-m3 {
  0%,
  8% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  11%,
  56% {
    opacity: 1;
    transform: none;
  }
  64%,
  100% {
    opacity: 0;
    transform: translate(40px, 60px) scale(0.3);
  }
}

.sc-undo .sc-corner {
  display: grid;
  justify-items: end;
  align-items: end;
}

.sc-undo__box,
.sc-undo__back {
  grid-area: 1 / 1;
}

.sc-undo__box {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  animation: undo-box var(--loop) infinite;
}

.sc-undo__box .boxcat {
  width: 62px;
}

@keyframes undo-box {
  0%,
  12% {
    opacity: 0;
    transform: translateY(10px);
  }
  15%,
  58% {
    opacity: 1;
    transform: none;
  }
  62%,
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

.pill--undo {
  position: relative;
  overflow: hidden;
  animation: undo-press var(--loop) infinite;
}

.pill--undo b {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 11px;
}

@keyframes undo-press {
  0%,
  49% {
    transform: none;
  }
  51% {
    transform: scale(0.9);
  }
  54%,
  100% {
    transform: none;
  }
}

.sc-undo__time {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 3px;
  background: var(--ink);
  border-radius: 3px;
  transform-origin: 0 50%;
  animation: undo-time var(--loop) infinite;
}

@keyframes undo-time {
  0%,
  15% {
    transform: none;
  }
  51%,
  100% {
    transform: scaleX(0.2);
  }
}

.sc-undo__back {
  animation: undo-back var(--loop) infinite;
}

@keyframes undo-back {
  0%,
  61% {
    opacity: 0;
    transform: scale(0.6);
  }
  64% {
    opacity: 1;
    transform: scale(1.12);
  }
  67%,
  94% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
  }
}

.sc-undo__ptr {
  animation: undo-ptr var(--loop) infinite;
}

@keyframes undo-ptr {
  0%,
  26% {
    left: 40%;
    top: 30%;
    opacity: 0;
  }
  32% {
    left: 46%;
    top: 40%;
    opacity: 1;
  }
  46% {
    left: calc(100% - 64px);
    top: calc(100% - 34px);
    opacity: 1;
    transform: none;
  }
  50% {
    left: calc(100% - 64px);
    top: calc(100% - 34px);
    transform: scale(0.82);
  }
  54% {
    left: calc(100% - 64px);
    top: calc(100% - 34px);
    opacity: 1;
    transform: none;
  }
  68%,
  100% {
    left: 60%;
    top: 55%;
    opacity: 0;
  }
}

/* ---------- Text mode ---------- */

.sc-text__p {
  position: absolute;
  inset: 16px 18px auto;
  font: 700 15.5px/1.75 var(--body);
}

.sc-text__a,
.sc-text__b {
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / 0 100% no-repeat;
  border-radius: 4px;
}

.sc-text__a {
  animation: mark-a var(--loop) infinite;
}

.sc-text__b {
  animation: mark-b var(--loop) infinite;
}

@keyframes mark-a {
  0%,
  4% {
    background-size: 0 100%;
  }
  14%,
  40% {
    background-size: 100% 100%;
  }
  43%,
  100% {
    background-size: 0 100%;
  }
}

@keyframes mark-b {
  0%,
  49% {
    background-size: 0 100%;
  }
  58%,
  86% {
    background-size: 100% 100%;
  }
  89%,
  100% {
    background-size: 0 100%;
  }
}

.sc-text__key {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 3;
  padding: 2px 12px;
  background: var(--surface);
  font-size: 17px;
  translate: -50% -50%;
  animation: text-key var(--loop) infinite;
}

@keyframes text-key {
  0%,
  15% {
    opacity: 0;
    transform: scale(0.6);
  }
  17% {
    opacity: 1;
    transform: scale(1.12);
  }
  19%,
  23% {
    opacity: 1;
    transform: translateY(2px);
  }
  26%,
  59% {
    opacity: 0;
    transform: scale(0.6);
  }
  61% {
    opacity: 1;
    transform: scale(1.12);
  }
  63%,
  67% {
    opacity: 1;
    transform: translateY(2px);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
}

.sc-text__c1,
.sc-text__c2 {
  position: absolute;
  z-index: 2;
  opacity: 0;
}

.sc-text__c1 {
  animation: text-c1 var(--loop) infinite;
}

.sc-text__c2 {
  animation: text-c2 var(--loop) infinite;
}

@keyframes text-c1 {
  0%,
  22% {
    left: 18px;
    top: 30px;
    opacity: 0;
    transform: none;
  }
  24% {
    left: 18px;
    top: 30px;
    opacity: 1;
    transform: none;
  }
  34% {
    left: calc(100% - 110px);
    top: calc(100% - 46px);
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    left: calc(100% - 110px);
    top: calc(100% - 46px);
    opacity: 0;
  }
}

@keyframes text-c2 {
  0%,
  66% {
    left: 40%;
    top: 58px;
    opacity: 0;
    transform: none;
  }
  68% {
    left: 40%;
    top: 58px;
    opacity: 1;
    transform: none;
  }
  78% {
    left: calc(100% - 110px);
    top: calc(100% - 46px);
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    left: calc(100% - 110px);
    top: calc(100% - 46px);
    opacity: 0;
  }
}

.sc-text__n0 {
  animation: text-n0 var(--loop) infinite;
}

.sc-text__n1 {
  animation: text-n1 var(--loop) infinite;
}

.sc-text__n2 {
  animation: text-n2 var(--loop) infinite;
}

@keyframes text-n0 {
  0%,
  33% {
    opacity: 1;
  }
  34%,
  96% {
    opacity: 0;
  }
  97%,
  100% {
    opacity: 1;
  }
}

@keyframes text-n1 {
  0%,
  33% {
    opacity: 0;
  }
  34%,
  77% {
    opacity: 1;
  }
  78%,
  100% {
    opacity: 0;
  }
}

@keyframes text-n2 {
  0%,
  77% {
    opacity: 0;
  }
  78%,
  96% {
    opacity: 1;
  }
  97%,
  100% {
    opacity: 0;
  }
}

/* ---------- Files ---------- */

.files {
  position: absolute;
  left: 14px;
  top: 14px;
  display: grid;
  gap: 6px;
}

.file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: var(--surface);
  border: 2px solid var(--bg-3);
  border-radius: 9px;
  font: 700 13px/1.2 var(--body);
}

.doc {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 30px;
  color: #fff;
  border-radius: 4px 9px 4px 4px;
  font: 800 8.5px/1 var(--body);
  font-style: normal;
}

.doc--pdf {
  background: #d9473f;
}

.doc--doc {
  background: #2f6fd6;
  font-size: 12px;
}

.doc--xls {
  background: #1f8a4c;
  font-size: 12px;
}

.sc-file__pdf {
  animation: file-pick var(--loop) infinite;
}

@keyframes file-pick {
  0%,
  11% {
    border-color: var(--bg-3);
  }
  13%,
  40% {
    border-color: var(--brand);
  }
  42%,
  100% {
    border-color: var(--bg-3);
  }
}

.sc-file__doc {
  animation: file-pick2 var(--loop) infinite;
}

@keyframes file-pick2 {
  0%,
  53% {
    border-color: var(--bg-3);
  }
  55%,
  66% {
    border-color: var(--brand);
  }
  68%,
  100% {
    border-color: var(--bg-3);
  }
}

.sc-file__drag,
.sc-file__fly {
  position: absolute;
  z-index: 4;
  box-shadow: 2px 2px 0 var(--line);
  opacity: 0;
}

.sc-file__drag {
  animation: file-drag var(--loop) infinite;
}

@keyframes file-drag {
  0%,
  13% {
    left: 22px;
    top: 21px;
    opacity: 0;
    transform: none;
  }
  15% {
    left: 22px;
    top: 21px;
    opacity: 1;
    transform: rotate(-8deg);
  }
  36% {
    left: calc(100% - 80px);
    top: calc(100% - 50px);
    opacity: 1;
    transform: rotate(-8deg);
  }
  40% {
    left: calc(100% - 80px);
    top: calc(100% - 50px);
    opacity: 1;
    transform: rotate(-8deg);
  }
  43%,
  100% {
    left: calc(100% - 70px);
    top: calc(100% - 36px);
    opacity: 0;
    transform: scale(0.3);
  }
}

.sc-file__menu {
  animation: file-menu var(--loop) infinite;
}

@keyframes file-menu {
  0%,
  54% {
    left: 96px;
    top: 74px;
    opacity: 0;
    transform: scale(0.85);
    transform-origin: 0 0;
  }
  56%,
  64% {
    left: 96px;
    top: 74px;
    opacity: 1;
    transform: none;
  }
  66%,
  100% {
    left: 96px;
    top: 74px;
    opacity: 0;
  }
}

.sc-file__fly {
  animation: file-fly var(--loop) infinite;
}

@keyframes file-fly {
  0%,
  65% {
    left: 22px;
    top: 59px;
    opacity: 0;
    transform: none;
  }
  66% {
    left: 22px;
    top: 59px;
    opacity: 1;
    transform: none;
  }
  75% {
    left: calc(100% - 70px);
    top: calc(100% - 36px);
    opacity: 0;
    transform: scale(0.3) rotate(20deg);
  }
  100% {
    left: calc(100% - 70px);
    top: calc(100% - 36px);
    opacity: 0;
  }
}

.sc-file__ptr {
  animation: file-ptr var(--loop) infinite;
}

@keyframes file-ptr {
  0%,
  4% {
    left: 60%;
    top: 40%;
    opacity: 0;
    transform: none;
  }
  10% {
    left: 44px;
    top: 30px;
    opacity: 1;
    transform: none;
  }
  13% {
    left: 44px;
    top: 30px;
    transform: scale(0.85);
  }
  36%,
  40% {
    left: calc(100% - 60px);
    top: calc(100% - 38px);
    opacity: 1;
    transform: scale(0.85);
  }
  44% {
    left: calc(100% - 60px);
    top: calc(100% - 38px);
    transform: none;
  }
  52% {
    left: 70px;
    top: 66px;
    transform: none;
  }
  54% {
    left: 70px;
    top: 66px;
    transform: scale(0.85);
  }
  56% {
    left: 70px;
    top: 66px;
    transform: none;
  }
  61% {
    left: 130px;
    top: 98px;
    transform: none;
  }
  63% {
    left: 130px;
    top: 98px;
    transform: scale(0.85);
  }
  65% {
    left: 130px;
    top: 98px;
    opacity: 1;
    transform: none;
  }
  76%,
  100% {
    left: 60%;
    top: 50%;
    opacity: 0;
  }
}

.sc-file__n0 {
  animation: file-n0 var(--loop) infinite;
}

.sc-file__drop {
  animation: file-drop var(--loop) infinite;
}

.sc-file__n1 {
  animation: file-n1 var(--loop) infinite;
}

.sc-file__n2 {
  animation: file-n2 var(--loop) infinite;
}

@keyframes file-n0 {
  0%,
  31% {
    opacity: 1;
  }
  32%,
  96% {
    opacity: 0;
  }
  97%,
  100% {
    opacity: 1;
  }
}

@keyframes file-drop {
  0%,
  31% {
    opacity: 0;
  }
  32%,
  41% {
    opacity: 1;
  }
  42%,
  100% {
    opacity: 0;
  }
}

@keyframes file-n1 {
  0%,
  41% {
    opacity: 0;
  }
  42%,
  74% {
    opacity: 1;
  }
  75%,
  100% {
    opacity: 0;
  }
}

@keyframes file-n2 {
  0%,
  74% {
    opacity: 0;
  }
  75%,
  96% {
    opacity: 1;
  }
  97%,
  100% {
    opacity: 0;
  }
}

.sc-file__pill {
  animation: file-pill var(--loop) infinite;
}

@keyframes file-pill {
  0%,
  31% {
    background: var(--accent);
    transform: none;
  }
  32%,
  41% {
    background: var(--brand);
    transform: scale(1.06);
  }
  43% {
    background: var(--accent);
    transform: scale(1.14);
  }
  46%,
  74% {
    background: var(--accent);
    transform: none;
  }
  77% {
    transform: scale(1.14);
  }
  80%,
  100% {
    transform: none;
  }
}

/* ---------- OCR ---------- */

.sc-ocr__photo {
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 48%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, #cfe0f2, #a9c3e0);
  border: 2px solid var(--line);
  border-radius: 12px;
}

.sc-ocr__note {
  padding: 12px 14px;
  background: #ffe58a;
  color: #3b2a1a;
  border-radius: 4px;
  box-shadow: 3px 4px 0 rgb(0 0 0 / 0.15);
  font: 700 14px/1.5 var(--body);
  rotate: -4deg;
  animation: ocr-note var(--loop) infinite;
}

@keyframes ocr-note {
  0%,
  32% {
    outline: 3px dashed transparent;
    outline-offset: 3px;
  }
  36%,
  90% {
    outline: 3px dashed var(--brand);
    outline-offset: 3px;
  }
  94%,
  100% {
    outline: 3px dashed transparent;
    outline-offset: 3px;
  }
}

.sc-ocr__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand);
  box-shadow: 0 0 12px 3px var(--brand);
  animation: ocr-scan var(--loop) infinite;
}

@keyframes ocr-scan {
  0%,
  5% {
    top: 0;
    opacity: 0;
  }
  7% {
    top: 0;
    opacity: 1;
  }
  31% {
    top: 100%;
    opacity: 1;
  }
  33%,
  100% {
    top: 100%;
    opacity: 0;
  }
}

.sc-ocr__out {
  position: absolute;
  right: 14px;
  top: 14px;
  bottom: 14px;
  width: calc(52% - 38px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  animation: ocr-out var(--loop) infinite;
}

@keyframes ocr-out {
  0%,
  36% {
    opacity: 0;
    transform: translateX(30px);
  }
  42%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
    transform: translateX(30px);
  }
}

.sc-ocr__label {
  color: var(--muted);
  font: 800 11.5px/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sc-ocr__line {
  font: 700 14px/1.3 var(--body);
  white-space: nowrap;
}

.sc-ocr__l1 {
  animation: ocr-l1 var(--loop) infinite;
}

.sc-ocr__l2 {
  animation: ocr-l2 var(--loop) infinite;
}

@keyframes ocr-l1 {
  0%,
  44% {
    clip-path: inset(0 100% 0 0);
  }
  53%,
  100% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes ocr-l2 {
  0%,
  54% {
    clip-path: inset(0 100% 0 0);
  }
  62%,
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.sc-ocr__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.sc-ocr__btns span {
  padding: 3px 8px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  font: 800 11.5px/1.2 var(--body);
  white-space: nowrap;
}

.sc-ocr__btns .sc-ocr__add {
  animation: ocr-add var(--loop) infinite;
}

@keyframes ocr-add {
  0%,
  71% {
    background: var(--bg-2);
    transform: none;
  }
  73% {
    background: var(--brand);
    transform: scale(0.9);
  }
  76%,
  92% {
    background: var(--brand);
    transform: none;
  }
  95%,
  100% {
    background: var(--bg-2);
  }
}

/* ---------- QR ---------- */

.sc-qr {
  background:
    radial-gradient(circle at 20% 20%, var(--bg-2) 0 40px, transparent 41px),
    radial-gradient(circle at 85% 70%, var(--bg-2) 0 54px, transparent 55px),
    var(--bg);
}

.sc-qr__code {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 118px;
  height: 118px;
  padding: 7px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  translate: -50% -50%;
}

.sc-qr__code svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #1b1a1e;
}

.sc-qr__corners {
  position: absolute;
  inset: -10px;
  --c: var(--brand);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 22px 4px,
    linear-gradient(var(--c), var(--c)) 0 0 / 4px 22px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 22px 4px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 4px 22px,
    linear-gradient(var(--c), var(--c)) 0 100% / 22px 4px,
    linear-gradient(var(--c), var(--c)) 0 100% / 4px 22px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 22px 4px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 4px 22px;
  background-repeat: no-repeat;
  animation: qr-corners var(--loop) infinite;
}

@keyframes qr-corners {
  0%,
  8% {
    opacity: 0;
    transform: scale(1.3);
  }
  14% {
    opacity: 1;
    transform: none;
  }
  20% {
    transform: scale(1.05);
  }
  26%,
  92% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
  }
}

.sc-qr__beam {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: var(--brand);
  box-shadow: 0 0 10px 2px var(--brand);
  animation: qr-beam var(--loop) infinite;
}

@keyframes qr-beam {
  0%,
  13% {
    top: 4px;
    opacity: 0;
  }
  15% {
    top: 4px;
    opacity: 1;
  }
  30% {
    top: calc(100% - 6px);
    opacity: 1;
  }
  32%,
  100% {
    top: calc(100% - 6px);
    opacity: 0;
  }
}

.sc-qr__chip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 3px 12px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--line);
  font: 600 13px/1.2 var(--body);
  white-space: nowrap;
  translate: -50% 0;
  animation: qr-chip var(--loop) infinite;
}

.sc-qr__chip b {
  font-weight: 900;
}

@keyframes qr-chip {
  0%,
  31% {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
  36%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
}

.sc-qr__go {
  padding: 4px 12px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 999px;
  font-weight: 800;
  animation: qr-go var(--loop) infinite;
}

@keyframes qr-go {
  0%,
  60% {
    transform: none;
  }
  62% {
    transform: scale(0.88);
  }
  65%,
  100% {
    transform: none;
  }
}

.sc-qr__ptr {
  animation: qr-ptr var(--loop) infinite;
}

@keyframes qr-ptr {
  0%,
  40% {
    left: 78%;
    top: 30%;
    opacity: 0;
    transform: none;
  }
  45% {
    left: 74%;
    top: 40%;
    opacity: 1;
  }
  58% {
    left: calc(50% + 66px);
    top: calc(100% - 34px);
    opacity: 1;
    transform: none;
  }
  62% {
    left: calc(50% + 66px);
    top: calc(100% - 34px);
    transform: scale(0.82);
  }
  66% {
    left: calc(50% + 66px);
    top: calc(100% - 34px);
    opacity: 1;
    transform: none;
  }
  76%,
  100% {
    left: 80%;
    top: 50%;
    opacity: 0;
  }
}

/* ---------- Export ---------- */

.sc-zip__cards > .mcard {
  position: absolute;
  top: 14px;
  width: 64px;
  height: 46px;
  overflow: hidden;
  font-size: 10.5px;
  white-space: normal;
}

.sc-zip__c1 {
  animation: zip-c1 var(--loop) infinite;
}

.sc-zip__c2 {
  animation: zip-c2 var(--loop) infinite;
}

.sc-zip__c3 {
  animation: zip-c3 var(--loop) infinite;
}

@keyframes zip-c1 {
  0%,
  34% {
    left: 14px;
    top: 14px;
    opacity: 1;
    transform: none;
  }
  42%,
  96% {
    left: calc(50% - 60px);
    top: 58%;
    opacity: 0;
    transform: scale(0.3);
  }
  97% {
    left: 14px;
    top: 14px;
    opacity: 0;
    transform: none;
  }
  100% {
    left: 14px;
    top: 14px;
    opacity: 1;
  }
}

@keyframes zip-c2 {
  0%,
  38% {
    left: 84px;
    top: 14px;
    opacity: 1;
    transform: none;
  }
  46%,
  96% {
    left: calc(50% - 60px);
    top: 58%;
    opacity: 0;
    transform: scale(0.3);
  }
  97% {
    left: 84px;
    top: 14px;
    opacity: 0;
    transform: none;
  }
  100% {
    left: 84px;
    top: 14px;
    opacity: 1;
  }
}

@keyframes zip-c3 {
  0%,
  42% {
    left: 154px;
    top: 14px;
    opacity: 1;
    transform: none;
  }
  50%,
  96% {
    left: calc(50% - 60px);
    top: 58%;
    opacity: 0;
    transform: scale(0.3);
  }
  97% {
    left: 154px;
    top: 14px;
    opacity: 0;
    transform: none;
  }
  100% {
    left: 154px;
    top: 14px;
    opacity: 1;
  }
}

.sc-zip__save {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 4px 12px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  font: 800 13px/1.3 var(--body);
  animation: zip-save var(--loop) infinite;
}

@keyframes zip-save {
  0%,
  12% {
    transform: none;
  }
  14% {
    transform: scale(0.9);
  }
  17%,
  100% {
    transform: none;
  }
}

.sc-zip__menu {
  right: 14px;
  bottom: 48px;
  min-width: 74px;
  transform-origin: 100% 100%;
  animation: zip-menu var(--loop) infinite;
}

@keyframes zip-menu {
  0%,
  14% {
    opacity: 0;
    transform: scale(0.8);
  }
  17%,
  28% {
    opacity: 1;
    transform: none;
  }
  31%,
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

.sc-zip__bundle {
  position: absolute;
  left: calc(50% - 88px);
  top: 46%;
  display: grid;
  justify-items: center;
  gap: 4px;
  font: 800 12.5px/1 var(--body);
  animation: zip-bundle var(--loop) infinite;
}

.sc-zip__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  background:
    repeating-linear-gradient(var(--line) 0 4px, transparent 4px 8px) 50% 0 / 6px 26px no-repeat,
    var(--brand);
  color: var(--on-brand);
  border: 2px solid var(--line);
  border-radius: 6px 14px 6px 6px;
  font: 900 11px/1 var(--body);
  font-style: normal;
  padding-top: 22px;
}

@keyframes zip-bundle {
  0%,
  30% {
    opacity: 0;
    transform: scale(0.6);
  }
  34% {
    opacity: 1;
    transform: none;
  }
  50% {
    transform: none;
  }
  53% {
    transform: scale(1.12);
  }
  56%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
}

.sc-zip__list {
  position: absolute;
  left: calc(50% - 22px);
  top: 46%;
  display: grid;
  gap: 2px;
  font: 600 12.5px/1.35 ui-monospace, "Cascadia Code", Consolas, monospace;
}

.sc-zip__list span {
  padding-left: 14px;
  border-left: 2px solid var(--bg-3);
}

.sc-zip__list span:nth-child(1) {
  animation: zip-l1 var(--loop) infinite;
}

.sc-zip__list span:nth-child(2) {
  animation: zip-l2 var(--loop) infinite;
}

.sc-zip__list span:nth-child(3) {
  animation: zip-l3 var(--loop) infinite;
}

@keyframes zip-l1 {
  0%,
  55% {
    opacity: 0;
    transform: translateX(-8px);
  }
  58%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

@keyframes zip-l2 {
  0%,
  59% {
    opacity: 0;
    transform: translateX(-8px);
  }
  62%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

@keyframes zip-l3 {
  0%,
  63% {
    opacity: 0;
    transform: translateX(-8px);
  }
  66%,
  92% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

.sc-zip__ptr {
  animation: zip-ptr var(--loop) infinite;
}

@keyframes zip-ptr {
  0%,
  3% {
    left: 60%;
    top: 30%;
    opacity: 0;
    transform: none;
  }
  10% {
    left: calc(100% - 50px);
    top: calc(100% - 32px);
    opacity: 1;
    transform: none;
  }
  14% {
    left: calc(100% - 50px);
    top: calc(100% - 32px);
    transform: scale(0.84);
  }
  17% {
    left: calc(100% - 50px);
    top: calc(100% - 32px);
    transform: none;
  }
  23% {
    left: calc(100% - 56px);
    top: calc(100% - 92px);
    transform: none;
  }
  26% {
    left: calc(100% - 56px);
    top: calc(100% - 92px);
    transform: scale(0.84);
  }
  29% {
    left: calc(100% - 56px);
    top: calc(100% - 92px);
    opacity: 1;
    transform: none;
  }
  38%,
  100% {
    left: 80%;
    top: 30%;
    opacity: 0;
  }
}

/* ---------- Shortcuts ---------- */

.sc-keys {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
}

.sc-keys__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 6px 10px;
  background: var(--surface);
  border: 2px solid var(--bg-3);
  border-radius: 12px;
  font: 700 13.5px/1.2 var(--body);
}

.sc-keys__field {
  display: inline-grid;
  justify-items: end;
  align-items: center;
  gap: 4px;
  grid-auto-flow: column;
}

.sc-keys__field kbd {
  font-size: 12px;
}

.sc-keys__edit {
  animation: keys-edit var(--loop) infinite;
}

@keyframes keys-edit {
  0%,
  8% {
    border-color: var(--bg-3);
    box-shadow: none;
  }
  10%,
  56% {
    border-color: var(--line);
    box-shadow: 0 0 0 3px var(--accent);
  }
  60%,
  100% {
    border-color: var(--bg-3);
    box-shadow: none;
  }
}

.sc-keys__edit .sc-keys__field {
  grid-auto-flow: row;
}

.sc-keys__edit .sc-keys__field > span:not(.sc-keys__ok) {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sc-keys__old {
  animation: keys-old var(--loop) infinite;
}

@keyframes keys-old {
  0%,
  10% {
    opacity: 1;
  }
  12%,
  96% {
    opacity: 0;
  }
  98%,
  100% {
    opacity: 1;
  }
}

.sc-keys__wait {
  color: var(--muted);
  font-size: 13px;
  animation: keys-wait var(--loop) infinite;
}

@keyframes keys-wait {
  0%,
  11% {
    opacity: 0;
  }
  13%,
  19% {
    opacity: 1;
  }
  22% {
    opacity: 0.35;
  }
  25%,
  33% {
    opacity: 1;
  }
  35%,
  100% {
    opacity: 0;
  }
}

.sc-keys__k1 {
  animation: keys-k1 var(--loop) infinite;
}

.sc-keys__k2 {
  animation: keys-k2 var(--loop) infinite;
}

.sc-keys__k3 {
  animation: keys-k3 var(--loop) infinite;
}

@keyframes keys-k1 {
  0%,
  35% {
    opacity: 0;
    transform: translateY(-6px);
  }
  38%,
  94% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

@keyframes keys-k2 {
  0%,
  41% {
    opacity: 0;
    transform: translateY(-6px);
  }
  44%,
  94% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

@keyframes keys-k3 {
  0%,
  47% {
    opacity: 0;
    transform: translateY(-6px);
  }
  50%,
  94% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

.sc-keys__edit {
  position: relative;
}

.sc-keys__edit .sc-keys__ok {
  position: absolute;
  right: -9px;
  top: -9px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: #3aa66a;
  color: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  font: 900 12px/1 var(--body);
  animation: keys-ok var(--loop) infinite;
}

@keyframes keys-ok {
  0%,
  53% {
    opacity: 0;
    transform: scale(0.4);
  }
  56% {
    opacity: 1;
    transform: scale(1.2);
  }
  59%,
  94% {
    opacity: 1;
    transform: none;
  }
  97%,
  100% {
    opacity: 0;
  }
}

/* ---------- Paste modes ---------- */

.seg {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 2;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 800 13px/1 var(--body);
  translate: -50% 0;
}

.seg > span {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  text-align: center;
  white-space: nowrap;
}

.seg__knob {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--brand);
  border-radius: 999px;
  animation: seg-knob var(--loop) infinite;
}

@keyframes seg-knob {
  0%,
  47% {
    transform: none;
  }
  52%,
  96% {
    transform: translateX(100%);
  }
  100% {
    transform: none;
  }
}

.sc-mode__key {
  position: absolute;
  left: 22px;
  top: 58%;
  padding: 3px 12px;
  background: var(--surface);
  font-size: 17px;
  animation: mode-key var(--loop) infinite;
}

@keyframes mode-key {
  0%,
  8%,
  13%,
  55%,
  60%,
  63%,
  68%,
  71%,
  76%,
  100% {
    transform: none;
    background: var(--surface);
  }
  10%,
  57.5%,
  65.5%,
  73.5% {
    transform: translateY(3px);
    background: var(--accent);
  }
}

.sc-mode__chat {
  position: absolute;
  inset: 58px 14px 12px;
}

.sc-mode__chat .msg2 {
  position: absolute;
  right: 0;
}

.sc-mode__chat .msg2 .thumb {
  width: 92px;
  height: 36px;
}

.msg2--group {
  top: 0;
  display: flex;
  gap: 4px;
}

.msg2--group .thumb {
  width: 64px !important;
  height: 52px !important;
}

.sc-mode__all {
  animation: mode-all var(--loop) infinite;
}

@keyframes mode-all {
  0%,
  9% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  12%,
  44% {
    opacity: 1;
    transform: none;
  }
  48%,
  100% {
    opacity: 0;
  }
}

.sc-mode__o1 {
  top: 0;
  animation: mode-o1 var(--loop) infinite;
}

.sc-mode__o2 {
  top: 54px;
  animation: mode-o2 var(--loop) infinite;
}

.sc-mode__o3 {
  top: 108px;
  animation: mode-o3 var(--loop) infinite;
}

@keyframes mode-o1 {
  0%,
  57% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  60%,
  94% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
  }
}

@keyframes mode-o2 {
  0%,
  65% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  68%,
  94% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
  }
}

@keyframes mode-o3 {
  0%,
  73% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  76%,
  94% {
    opacity: 1;
    transform: none;
  }
  98%,
  100% {
    opacity: 0;
  }
}

/* ---------- Languages ---------- */

.sc-lang {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px;
  text-align: center;
}

.sc-lang__btn {
  padding: 9px 18px 9px 9px;
  font-size: 18px;
  box-shadow: 3px 3px 0 var(--line);
}

.sc-lang__btn.is-flipping {
  animation: flip 360ms ease-in-out;
}

@keyframes flip {
  50% {
    transform: perspective(300px) rotateX(90deg);
  }
}

.sc-lang .langs {
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Data stays home ---------- */

.scene--dark {
  flex-direction: row-reverse;
  align-items: center;
  gap: 32px;
  padding: 28px 32px;
  background: var(--band);
  color: var(--on-band);
  border-radius: var(--radius);
}

.scene--dark figcaption {
  flex: 1;
  margin: 0;
}

.scene--dark figcaption h3 {
  font-size: 32px;
}

.scene--dark figcaption p {
  margin-top: 10px;
  max-width: 54ch;
  color: var(--on-band);
  opacity: 0.9;
  font-size: 16.5px;
}

.sc-home {
  position: relative;
  flex: none;
  width: min(440px, 46%);
  height: 190px;
}

.sc-home__pc {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 62%;
  border: 2.5px dashed var(--band-soft);
  border-radius: 18px;
}

.sc-home__label {
  position: absolute;
  left: 14px;
  top: 10px;
  color: var(--band-soft);
  font: 800 13px/1 var(--body);
}

.sc-home__pc .mcard {
  position: absolute;
}

.sc-home__c1 {
  left: 10%;
  top: 38%;
  animation: bob-a var(--loop) ease-in-out infinite;
}

.sc-home__c2 {
  left: 44%;
  top: 26%;
  animation: bob-b var(--loop) ease-in-out infinite;
}

.sc-home__c3 {
  left: 54%;
  top: 60%;
  animation: bob-c var(--loop) ease-in-out infinite;
}

@keyframes bob-a {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-9px) rotate(2deg);
  }
}

@keyframes bob-b {
  0%,
  100% {
    transform: translateY(-6px) rotate(2deg);
  }
  50% {
    transform: translateY(5px) rotate(-2deg);
  }
}

@keyframes bob-c {
  0%,
  100% {
    transform: translateY(4px) rotate(3deg);
  }
  50% {
    transform: translateY(-6px) rotate(-1deg);
  }
}

.sc-home__wall {
  position: absolute;
  left: 70%;
  top: 22%;
  bottom: 22%;
  width: 5px;
  background: var(--band-soft);
  border-radius: 4px;
}

/* Something tries to leave, and bounces back. */
.sc-home__wall::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: var(--brand);
  border-radius: 50%;
  animation: knock var(--loop) infinite;
}

@keyframes knock {
  0%,
  10% {
    left: -90px;
    opacity: 0;
  }
  16% {
    left: -90px;
    opacity: 1;
  }
  34% {
    left: -14px;
    opacity: 1;
    transform: none;
  }
  37% {
    left: -12px;
    transform: scaleX(0.6);
  }
  52% {
    left: -70px;
    opacity: 1;
    transform: none;
  }
  60%,
  100% {
    left: -80px;
    opacity: 0;
  }
}

.sc-home__cloud {
  position: absolute;
  right: 0;
  top: 50%;
  font-size: 70px;
  line-height: 1;
  color: var(--on-band);
  opacity: 0.85;
  translate: 0 -50%;
}

.sc-home__cloud b {
  position: absolute;
  right: -4px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #e5484d;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  animation: cloud-no var(--loop) infinite;
}

@keyframes cloud-no {
  0%,
  33% {
    transform: none;
  }
  37% {
    transform: scale(1.3) rotate(-12deg);
  }
  42% {
    transform: rotate(8deg);
  }
  46%,
  100% {
    transform: none;
  }
}

/* ---------- The cat on the badge (played by scenes.js) ---------- */

.sc-seat {
  background:
    linear-gradient(transparent 70%, color-mix(in srgb, var(--bg-3) 60%, transparent)),
    var(--bg-2);
}

.sc-seat__bdg {
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.desk {
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  gap: 14px;
}

.desk span {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 72px;
  font: 700 11.5px/1.2 var(--body);
  text-align: center;
}

.desk i {
  width: 40px;
  height: 32px;
  background: linear-gradient(#f2c94c, #e8b730);
  border: 2px solid var(--line);
  border-radius: 4px 10px 6px 6px;
}

.scat {
  --fat: 0;
  position: relative;
  display: block;
  width: 96px;
  aspect-ratio: 332 / 335;
}

.scat__s,
.scat__head {
  position: absolute;
  inset: 0;
  background: var(--cat-body) 0 0 / 100% 100% no-repeat;
}

.scat__s {
  clip-path: inset(var(--t) 0 var(--b) 0);
  transform: scaleX(calc(1 + var(--fat) * 0.5 * var(--k)));
  transform-origin: 40% 50%;
  transition: transform 420ms var(--pop);
}

.scat__head {
  z-index: 1;
  clip-path: inset(0 0 62% 0);
  transform-origin: 40% 37%;
  transition: transform 160ms var(--out);
}

.scat .cat__foot {
  z-index: 2;
}

.is-asleep .scat {
  transform-origin: 50% 100%;
  animation: breathe 2.6s ease-in-out infinite;
}

.is-asleep .scat__head {
  transform: rotate(9deg) translateY(2px);
  transition-duration: 700ms;
}

@keyframes breathe {
  50% {
    transform: scale(1.03, 0.96);
  }
}

.sc-seat__zz {
  position: absolute;
  right: 140px;
  bottom: 104px;
  font: 800 18px/1 var(--display);
  color: var(--muted);
}

.sc-seat__zz b {
  position: absolute;
  opacity: 0;
}

.is-asleep .sc-seat__zz b {
  animation: zz 2.4s ease-out infinite;
}

.is-asleep .sc-seat__zz b:nth-child(2) {
  animation-delay: 0.8s;
}

.is-asleep .sc-seat__zz b:nth-child(3) {
  animation-delay: 1.6s;
  font-size: 24px;
}

@keyframes zz {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-22px, -46px) rotate(-12deg);
  }
}

.sc-seat__fly {
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 32px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 7px;
  opacity: 0;
}

.sc-seat__fly::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 4px;
  background: linear-gradient(var(--brand), var(--brand)) 20% 90% / 18% 50% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 55% 90% / 18% 80% no-repeat, var(--bg-2);
}

.sc-seat__fly.is-flying {
  animation: seat-fly 520ms var(--out);
}

@keyframes seat-fly {
  from {
    left: 18px;
    top: 18px;
    opacity: 1;
    transform: rotate(-6deg);
  }
  to {
    left: calc(100% - 92px);
    top: calc(100% - 46px);
    opacity: 0.2;
    transform: scale(0.4);
  }
}

.sc-seat__ptr {
  left: 30%;
  top: 30%;
  transition: opacity 200ms;
}

.is-pointing .sc-seat__ptr {
  opacity: 1;
  animation: wander 3.6s ease-in-out;
}

@keyframes wander {
  0% {
    left: 12%;
    top: 20%;
  }
  30% {
    left: 70%;
    top: 14%;
  }
  60% {
    left: 18%;
    top: 58%;
  }
  85% {
    left: 46%;
    top: 30%;
  }
  100% {
    left: 46%;
    top: 30%;
  }
}

/* ---------- The queue scene ---------- */

.key-btn.is-pressed {
  animation: key-press 320ms var(--out);
}

@keyframes key-press {
  30% {
    transform: translateY(3px) scale(0.95);
    background: var(--accent);
  }
}

.undo__btn b {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.7;
}

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

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

  .scene,
  .scene--w3 {
    grid-column: span 1;
  }

  .scene--w4,
  .scene--w6,
  .scene--solo {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .scenes {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .scene,
  .scene--w3,
  .scene--solo {
    grid-column: 1 / -1;
  }

  .scene--dark {
    flex-direction: column;
    align-items: stretch;
    padding: 22px 18px;
  }

  .sc-home {
    width: 100%;
    height: 170px;
  }

  .scene--dark figcaption h3 {
    font-size: 26px;
  }
}

/* Less motion: each looping scene stands still on its telling frame. */
@media (prefers-reduced-motion: reduce) {
  .scene *,
  .scene *::before,
  .scene *::after {
    animation-play-state: paused !important;
    animation-delay: var(--freeze) !important;
  }
}
