/* Die Bühne der Anmelde- und der Fehlerseite (QV-0047 Wunsch 30): der
   Hintergrund von www.qvadis.ai, Element für Element, in den Farben der App.
   Grau der Homepage → Linien der Navigation (--stage-*), Orange → Aktionsblau
   (dunkel in beiden Themes über data-surface="nav"). Nur Tokens. */
.stage-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--nav-bg);
  pointer-events: none;
}

.stage-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-grid,
.stage-gridFine {
  fill: none;
  stroke-width: 1;
}

.stage-grid {
  stroke: var(--stage-line);
}

.stage-gridFine {
  stroke: var(--stage-line-faint);
}

.stage-vignetteClear {
  stop-color: var(--nav-bg);
  stop-opacity: 0;
}

.stage-vignetteDark {
  stop-color: var(--stage-vignette);
  stop-opacity: 0.95;
}

.stage-scanEdge {
  stop-color: var(--action);
  stop-opacity: 0;
}

.stage-scanCore {
  stop-color: var(--action);
  stop-opacity: 0.9;
}

.stage-ringOuter,
.stage-ringFaint,
.stage-ringWide,
.stage-ringDotted,
.stage-ringDashed,
.stage-ringBroad,
.stage-arcThin,
.stage-arcBroad {
  fill: none;
}

.stage-ringOuter {
  stroke: var(--stage-ring);
  stroke-width: 1;
}

.stage-ringFaint {
  stroke: var(--stage-line);
  stroke-width: 1;
}

.stage-ringWide {
  stroke: var(--stage-ring);
  stroke-width: 2;
}

.stage-ringDotted {
  stroke: var(--stage-track);
  stroke-width: 2;
  stroke-dasharray: 4 26;
}

.stage-arcThin {
  stroke: var(--action);
  stroke-width: 3;
  stroke-dasharray: 120 2800;
  stroke-linecap: round;
}

.stage-ringDashed {
  stroke: var(--stage-line);
  stroke-width: 1;
  stroke-dasharray: 60 40;
}

.stage-ringBroad {
  stroke: var(--stage-track);
  stroke-width: 46;
}

/* The cross that cuts the broad ring into four arcs. */
.stage-cut {
  fill: var(--nav-bg);
}

.stage-arcBroad {
  stroke: var(--action);
  stroke-width: 46;
  stroke-dasharray: 150 1905;
  stroke-opacity: 0.9;
}

.stage-barAction {
  fill: var(--action);
}

.stage-bar {
  fill: var(--stage-track);
}

.stage-brackets {
  fill: none;
  stroke: var(--stage-bracket);
  stroke-width: 2;
}

.stage-tracks .stage-track,
.stage-track {
  stroke: var(--stage-track);
  stroke-width: 18;
}

.stage-track.stage-trackAction {
  stroke: var(--action);
}

/* The Q of the app with the turning dashed ring of the homepage, in a corner. */
.stage-mark {
  position: absolute;
  top: var(--space-6);
  left: var(--space-6);
  width: 7rem;
  height: 7rem;
  overflow: visible;
}

.stage-markRing {
  fill: none;
  stroke: var(--ink);
  stroke-width: 8;
}

.stage-markSpur {
  stroke: var(--action);
  stroke-width: 8;
}

.stage-markOrbit {
  fill: none;
  stroke: var(--action);
  stroke-width: 1.2;
  stroke-dasharray: 5 9;
  transform-origin: 25.7px 29.7px;
}

.stage-spin,
.stage-spinSlow,
.stage-spinBack {
  transform-origin: 0 0;
}

@media (max-width: 479px) {
  .stage-mark {
    top: var(--space-4);
    left: var(--space-4);
    width: 4.5rem;
    height: 4.5rem;
  }
}

/* The motion of the homepage, with its timings - only where the reader has
   not asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .stage-breathe {
    animation: stage-breathe 11s ease-in-out infinite;
  }

  .stage-spinSlow {
    animation: stage-spin 64s linear infinite;
  }

  .stage-spinBack {
    animation: stage-spin-back 44s linear infinite;
  }

  .stage-spin {
    animation: stage-spin 26s linear infinite;
  }

  .stage-track {
    animation: stage-track 9s ease-in-out infinite;
  }

  .stage-scan {
    animation: stage-scan 14s linear infinite;
  }

  .stage-mark {
    animation: stage-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .stage-markOrbit {
    animation: stage-spin 22s linear infinite;
  }

  /* The large Q draws itself like the mark on the card (wish 31): the ring
     from the gap, clockwise, then the spur slides in. */
  .stage-markRing {
    stroke-dasharray: 137;
    stroke-dashoffset: 137;
    animation: stage-draw 900ms cubic-bezier(0.65, 0, 0.35, 1) 150ms forwards;
  }

  .stage-markSpur {
    opacity: 0;
    transform: translate(-6px, -6px);
    animation: stage-spur 420ms ease-out 900ms forwards;
  }
}

/* Without motion the scan line rests out of sight, as on the homepage. */
@media (prefers-reduced-motion: reduce) {
  .stage-scan {
    opacity: 0;
  }
}

@keyframes stage-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes stage-spin-back {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes stage-breathe {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes stage-scan {
  0% {
    transform: translateY(-120px);
    opacity: 0;
  }
  12% {
    opacity: 0.55;
  }
  88% {
    opacity: 0.55;
  }
  100% {
    transform: translateY(1200px);
    opacity: 0;
  }
}

@keyframes stage-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes stage-spur {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes stage-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stage-track {
  0% {
    transform: scaleX(0);
    transform-origin: left center;
  }
  45% {
    transform: scaleX(1);
    transform-origin: left center;
  }
  55% {
    transform: scaleX(1);
    transform-origin: right center;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right center;
  }
}

.stage-delay-700 { animation-delay: .7s; }
.stage-delay-350 { animation-delay: .35s; }
.stage-delay-1050 { animation-delay: 1.05s; }
.stage-track[data-delay="1400"] { animation-delay: 1.4s; }
.stage-track[data-delay="1750"] { animation-delay: 1.75s; }
.stage-stage { --action: #4a95dd; --ink: #e7ecf5; }
