/*
 * GENERATED by scripts/gen-brand-motion.ts — edit the script, not this file.
 *
 * The brandmark loader (the boot screen in index.html, <BrandSpinner>, the header <Logo>). One loop starts and
 * ends on the mark, so a loader can stop cleanly at the end of a loop:
 *   3 → 1  two clockwise wipes, from 12 and from 6 o'clock, each erase half of the mark;
 *   1 → 2  the same two wipes draw it back, turned 45° (a diamond fitted to the mark's box);
 *   2 → 3  the diamond turns 45° clockwise and grows into the upright mark.
 * Markup (viewBox 0 0 102 102): .nq-solid (the square with its hole) under a mask of two pies (.nq-wipe, one from
 * 12 and one from 6) and .nq-cover, which fills the mask while the mark is whole. Colour: currentColor.
 */
.nq-mark { overflow: visible; }
.nq-mark .nq-solid { transform-box: view-box; transform-origin: 51px 51px; }
.nq-mark.is-playing .nq-solid { animation: nq-turn var(--nq-loop, 2s) linear infinite; }
.nq-mark.is-playing .nq-wipe { animation: nq-wipe var(--nq-loop, 2s) infinite; }
.nq-mark.is-playing .nq-cover { animation: nq-cover var(--nq-loop, 2s) infinite; }

@keyframes nq-wipe {
  0% { stroke-dasharray: 0 0 51 49; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  34% { stroke-dasharray: 0 51 0 49; animation-timing-function: step-end; }
  42% { stroke-dasharray: 0 1 0 99; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  72%, 100% { stroke-dasharray: 0 1 51 48; }
}
@keyframes nq-cover {
  0% { opacity: 1; animation-timing-function: step-end; }
  0.5% { opacity: 0; animation-timing-function: step-end; }
  72%, 100% { opacity: 1; }
}
@keyframes nq-turn {
  0% { transform: rotate(0deg) scale(1); animation-timing-function: step-end; }
  38%, 74% { transform: rotate(-45deg) scale(0.8164); }
  75.38% { transform: rotate(-44.85deg) scale(0.8164); }
  76.75% { transform: rotate(-44.35deg) scale(0.8165); }
  78.13% { transform: rotate(-43.39deg) scale(0.8166); }
  79.5% { transform: rotate(-41.81deg) scale(0.8172); }
  80.88% { transform: rotate(-39.37deg) scale(0.8189); }
  82.25% { transform: rotate(-35.64deg) scale(0.8233); }
  83.63% { transform: rotate(-30.04deg) scale(0.8341); }
  85% { transform: rotate(-22.5deg) scale(0.8573); }
  86.38% { transform: rotate(-14.96deg) scale(0.8915); }
  87.75% { transform: rotate(-9.36deg) scale(0.925); }
  89.13% { transform: rotate(-5.63deg) scale(0.9518); }
  90.5% { transform: rotate(-3.19deg) scale(0.9715); }
  91.88% { transform: rotate(-1.61deg) scale(0.9852); }
  93.25% { transform: rotate(-0.65deg) scale(0.9939); }
  94.63% { transform: rotate(-0.15deg) scale(0.9986); }
  96% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .nq-mark.is-playing .nq-solid,
  .nq-mark.is-playing .nq-wipe,
  .nq-mark.is-playing .nq-cover { animation: none; }
  .nq-mark.is-playing { animation: nq-breathe 1.2s ease-in-out infinite alternate; }
}
@keyframes nq-breathe { to { opacity: 0.35; } }

/* Boot screen (public, account and admin): ink, fades in after 150 ms so fast loads never flash it, and is gone by
   400 ms at the latest (src/lib/boot.ts). */
#nq-boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 28px;
  background: #0a0a0a; color: #f5f5f0;
  /* In after 150 ms; out from 280 ms, gone by 380 ms (under the 400 ms cap). Opacity runs on the compositor, so a busy main thread (the app
     bundle starting up) can't stretch it; JS only removes the element afterwards. */
  animation: nq-boot-in 100ms ease-out 150ms both, nq-boot-out 100ms linear 280ms forwards;
  transition: opacity 100ms ease-out;
}
#nq-boot.is-done { opacity: 0; pointer-events: none; }
#nq-boot .nq-lockup { width: 200px; height: auto; }
/* "account" / "admin" under the lockup (boot.js sets html[data-boot] from the path). */
#nq-boot .nq-boot-caption { margin: 0; min-height: 1em; font: 12px/1 ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.04em; color: #8c8c87; }
html[data-boot="account"] #nq-boot .nq-boot-caption::after { content: "account"; }
html[data-boot="admin"] #nq-boot .nq-boot-caption::after { content: "admin"; }
@keyframes nq-boot-in { from { opacity: 0; } }
/* Crawlable markup in #root (site links, prerendered docs pages) is for crawlers only: kept off screen until React
   replaces it (main.tsx drops data-prerender), so a slow bundle never shows it unstyled. */
#root[data-prerender] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes nq-boot-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

/*
 * The lockup (mark + wordmark), one loop of --nq-lockup-loop (default 5.95s); it ends as the mark is wiped out and the next loop draws it straight back in, so it reads as one continuous animation. At 5.95s:
 *   0–0.8s  the mark is drawn by its wipe in the middle, as a diamond;   0.8–1.5s  it turns upright;
 *   1.7–2.4s  it moves left to its place in the lockup;
 *   from 2.3s  n u q t u m are filled from the left (a fill slides through each letter's shape), 0.12s apart, 0.55s each;
 *   hold until 4.4s;
 *   n u q t u m empty out to the right, 0.06s apart, 0.4s each, as the mark rolls back;
 *   4.55–5.25s  the mark moves back to the middle, turning 45° clockwise into the diamond it started as;   5.35–5.95s  it is erased there.
 * A different --nq-lockup-loop scales all of it. Markup: <AnimatedLockup> in components/ui/BrandLockup.tsx.
 */
.nq-lockup { overflow: visible; }
.nq-lockup .nq-lk-solid { transform-box: view-box; transform-origin: 51px 51px; }
.nq-lockup.is-playing .nq-lk-solid { animation: nq-lk-turn var(--nq-lockup-loop, 5.95s) linear infinite; }
.nq-lockup.is-playing .nq-lk-move { animation: nq-lk-move var(--nq-lockup-loop, 5.95s) infinite; }
.nq-lockup.is-playing .nq-lk-wipe { animation: nq-lk-wipe var(--nq-lockup-loop, 5.95s) infinite; }
.nq-lockup.is-playing .nq-lk-cover { animation: nq-lk-cover var(--nq-lockup-loop, 5.95s) infinite; }

@keyframes nq-lk-wipe {
  0% { stroke-dasharray: 0 1 0 99; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  13.45% { stroke-dasharray: 0 1 51 48; animation-timing-function: step-end; }
  89.92% { stroke-dasharray: 0 0 51 49; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  100% { stroke-dasharray: 0 51 0 49; }
}
@keyframes nq-lk-cover {
  0% { opacity: 0; animation-timing-function: step-end; }
  13.45% { opacity: 1; animation-timing-function: step-end; }
  89.92%, 100% { opacity: 0; }
}
@keyframes nq-lk-turn {
  0%, 13.45% { transform: rotate(-45deg) scale(0.8164); }
  14.18% { transform: rotate(-44.85deg) scale(0.8164); }
  14.92% { transform: rotate(-44.35deg) scale(0.8165); }
  15.65% { transform: rotate(-43.39deg) scale(0.8166); }
  16.39% { transform: rotate(-41.81deg) scale(0.8172); }
  17.12% { transform: rotate(-39.37deg) scale(0.8189); }
  17.86% { transform: rotate(-35.64deg) scale(0.8233); }
  18.59% { transform: rotate(-30.04deg) scale(0.8341); }
  19.33% { transform: rotate(-22.5deg) scale(0.8573); }
  20.06% { transform: rotate(-14.96deg) scale(0.8915); }
  20.8% { transform: rotate(-9.36deg) scale(0.925); }
  21.53% { transform: rotate(-5.63deg) scale(0.9518); }
  22.27% { transform: rotate(-3.19deg) scale(0.9715); }
  23% { transform: rotate(-1.61deg) scale(0.9852); }
  23.74% { transform: rotate(-0.65deg) scale(0.9939); }
  24.47% { transform: rotate(-0.15deg) scale(0.9986); }
  25.21% { transform: rotate(0deg) scale(1); }
  76.47% { transform: rotate(0deg) scale(1); }
  77.21% { transform: rotate(0.15deg) scale(0.9986); }
  77.94% { transform: rotate(0.65deg) scale(0.9939); }
  78.68% { transform: rotate(1.61deg) scale(0.9852); }
  79.41% { transform: rotate(3.19deg) scale(0.9715); }
  80.15% { transform: rotate(5.63deg) scale(0.9518); }
  80.88% { transform: rotate(9.36deg) scale(0.925); }
  81.62% { transform: rotate(14.96deg) scale(0.8915); }
  82.35% { transform: rotate(22.5deg) scale(0.8573); }
  83.09% { transform: rotate(30.04deg) scale(0.8341); }
  83.82% { transform: rotate(35.64deg) scale(0.8233); }
  84.56% { transform: rotate(39.37deg) scale(0.8189); }
  85.29% { transform: rotate(41.81deg) scale(0.8172); }
  86.03% { transform: rotate(43.39deg) scale(0.8166); }
  86.76% { transform: rotate(44.35deg) scale(0.8165); }
  87.5% { transform: rotate(44.85deg) scale(0.8164); }
  88.24% { transform: rotate(45deg) scale(0.8164); }
  100% { transform: rotate(45deg) scale(0.8164); }
}

@keyframes nq-lk-move {
  0%, 28.57% { transform: translateX(320px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  40.34%, 76.47% { transform: translateX(0); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  88.24%, 100% { transform: translateX(320px); }
}

.nq-lockup.is-playing .nq-lk-n { animation: nq-lk-slide-n var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-n {
  0%, 38.66% { transform: translateX(-101px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  47.9%, 73.95% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  80.67%, 100% { transform: translateX(101px); }
}
.nq-lockup.is-playing .nq-lk-u1 { animation: nq-lk-slide-u1 var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-u1 {
  0%, 40.67% { transform: translateX(-94px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  49.92%, 74.96% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  81.68%, 100% { transform: translateX(94px); }
}
.nq-lockup.is-playing .nq-lk-q { animation: nq-lk-slide-q var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-q {
  0%, 42.69% { transform: translateX(-94px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  51.93%, 75.97% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  82.69%, 100% { transform: translateX(94px); }
}
.nq-lockup.is-playing .nq-lk-t { animation: nq-lk-slide-t var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-t {
  0%, 44.71% { transform: translateX(-69px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  53.95%, 76.97% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  83.7%, 100% { transform: translateX(69px); }
}
.nq-lockup.is-playing .nq-lk-u2 { animation: nq-lk-slide-u2 var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-u2 {
  0%, 46.72% { transform: translateX(-94px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  55.97%, 77.98% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  84.71%, 100% { transform: translateX(94px); }
}
.nq-lockup.is-playing .nq-lk-m { animation: nq-lk-slide-m var(--nq-lockup-loop, 5.95s) infinite; }
@keyframes nq-lk-slide-m {
  0%, 48.74% { transform: translateX(-102px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  57.98%, 78.99% { transform: translateX(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  85.71%, 100% { transform: translateX(102px); }
}

@media (prefers-reduced-motion: reduce) {
  .nq-lockup.is-playing * { animation: none !important; }
}
