/* atm.one motion and brand effects v1.1 (19/11/2026)
 * Requires tokens.css. Every animation here stops under prefers-reduced-motion.
 * Durations and easing come from the motion tokens (design-system.md section 6).
 */

/* ---------- Brand glow: login and hero areas only, never behind data (section 2.6) ---------- */
.atm-brand-glow {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #070B1A;
}
.atm-brand-glow::before,
.atm-brand-glow::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
/* Large violet arc, upper right, with a cyan-to-violet rim light */
.atm-brand-glow::before {
  width: 120vmax; height: 120vmax;
  right: -62vmax; top: -78vmax;
  background: radial-gradient(closest-side, rgba(122, 23, 255, .35), rgba(122, 23, 255, 0) 72%);
  box-shadow: inset 0 0 0 1px rgba(64, 227, 242, .55), inset 0 -2px 24px rgba(122, 23, 255, .45);
}
/* Cyan arc, lower right */
.atm-brand-glow::after {
  width: 90vmax; height: 90vmax;
  right: -40vmax; bottom: -66vmax;
  background: radial-gradient(closest-side, rgba(64, 227, 242, .25), rgba(64, 227, 242, 0) 70%);
  box-shadow: inset 0 0 0 1px rgba(122, 23, 255, .55), inset 0 2px 24px rgba(64, 227, 242, .35);
}
[data-theme="light"] .atm-brand-glow,
.atm-brand-glow[data-theme="light"] { background: #F7F6FC; }
[data-theme="light"] .atm-brand-glow::before,
.atm-brand-glow[data-theme="light"]::before {
  background: radial-gradient(closest-side, rgba(122, 23, 255, .20), rgba(122, 23, 255, 0) 72%);
  box-shadow: inset 0 0 0 1px rgba(64, 227, 242, .35);
}
[data-theme="light"] .atm-brand-glow::after,
.atm-brand-glow[data-theme="light"]::after {
  background: radial-gradient(closest-side, rgba(64, 227, 242, .20), rgba(64, 227, 242, 0) 70%);
  box-shadow: inset 0 0 0 1px rgba(122, 23, 255, .30);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .atm-brand-glow:not([data-theme="dark"]) { background: #F7F6FC; }
}
/* Slow drift on the glow (login only); off under reduced motion */
@keyframes atm-glow-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-2vmax, 1.5vmax, 0); } }
.atm-brand-glow--animated::before { animation: atm-glow-drift 18s var(--atm-motion-ease) infinite alternate; }
.atm-brand-glow--animated::after  { animation: atm-glow-drift 24s var(--atm-motion-ease) infinite alternate-reverse; }

/* ---------- Loader: the pulsing cyan dot from the wordmark ---------- */
.atm-loader {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--atm-text-secondary);
  font: var(--atm-text-small-weight) var(--atm-text-small-size)/var(--atm-text-small-line) var(--atm-font-ui);
}
.atm-loader__dot {
  width: 10px; height: 10px; border-radius: var(--atm-radius-pill);
  background: var(--atm-brand-cyan);
  animation: atm-dot-pulse 1.2s var(--atm-motion-ease) infinite;
}
.atm-loader__dot:nth-child(2) { animation-delay: .15s; }
.atm-loader__dot:nth-child(3) { animation-delay: .30s; }
@keyframes atm-dot-pulse {
  0%, 80%, 100% { transform: scale(.6); opacity: .35; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* ---------- Skeleton placeholders while data loads ---------- */
.atm-skeleton {
  border-radius: var(--atm-radius-md);
  background: linear-gradient(90deg, var(--atm-surface-sunken) 0%, var(--atm-border) 50%, var(--atm-surface-sunken) 100%);
  background-size: 200% 100%;
  animation: atm-shimmer 1.4s linear infinite;
}
@keyframes atm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Standard transitions ---------- */
.atm-fade-in  { animation: atm-fade-in  var(--atm-motion-slow) var(--atm-motion-ease) both; }
.atm-rise-in  { animation: atm-rise-in  var(--atm-motion-slow) var(--atm-motion-ease) both; }
.atm-menu-in  { animation: atm-menu-in  var(--atm-motion-base) var(--atm-motion-ease) both; transform-origin: top right; }
@keyframes atm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes atm-rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes atm-menu-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.atm-interactive { transition: background-color var(--atm-motion-fast) var(--atm-motion-ease),
                               border-color var(--atm-motion-fast) var(--atm-motion-ease),
                               color var(--atm-motion-fast) var(--atm-motion-ease); }

/* ---------- Animated wordmark (splash or login intro, played once) ----------
 * Markup pattern is in brand/animated/README.md.
 * The transparent WebM files need VP9 alpha support (Chrome, Edge, Firefox). Safari and reduced motion
 * show the static SVG instead. */
.atm-logo-intro { display: inline-block; }
.atm-logo-intro video { display: block; width: 100%; height: auto; }
.atm-logo-intro .atm-logo-intro__static { display: none; width: 100%; height: auto; }
/* No playable video (Safari has no VP9 alpha; the video removes itself on error): show the static wordmark */
.atm-logo-intro:not(:has(video)) .atm-logo-intro__static { display: block; }

@media (prefers-reduced-motion: reduce) {
  .atm-brand-glow--animated::before, .atm-brand-glow--animated::after,
  .atm-loader__dot, .atm-skeleton, .atm-fade-in, .atm-rise-in, .atm-menu-in { animation: none !important; }
  .atm-loader__dot { opacity: 1; transform: none; }
  .atm-logo-intro video { display: none; }
  .atm-logo-intro .atm-logo-intro__static { display: block; }
}
