/* ============================================================
   AtlasFiles — motion. Keyframes + scroll-reveal choreography.
   All motion is gated behind prefers-reduced-motion at the bottom.
   ============================================================ */

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* hero: ambient float for orbiting file cards */
@keyframes float-a { 0%,100% { transform: translate(0,0) rotate(-3deg); } 50% { transform: translate(0,-16px) rotate(-1deg); } }
@keyframes float-b { 0%,100% { transform: translate(0,0) rotate(2deg); } 50% { transform: translate(0,14px) rotate(4deg); } }
@keyframes float-c { 0%,100% { transform: translate(0,0) rotate(-1deg); } 50% { transform: translate(0,-12px) rotate(1deg); } }

.orbit .filecard { animation: var(--fa, float-a) var(--dur, 7s) ease-in-out infinite; animation-delay: var(--dl, 0s); }

/* hero: when the stage resolves (JS adds .resolved), cards drift toward
   the result window and fade, the window rises in. */
.stage .orbit { transition: opacity .7s var(--ease); }
.stage.resolved .orbit { opacity: 0; }
.stage .appwin {
  position: absolute; inset: 0; margin: auto; height: max-content;
  opacity: 0; transform: translateY(24px) scale(0.96);
  transition: opacity .9s var(--ease) .2s, transform .9s var(--ease) .2s;
}
.stage.resolved .appwin { opacity: 1; transform: none; }
/* result rows cascade in */
.stage.resolved .row { animation: row-in .6s var(--ease) backwards; }
.stage.resolved .row:nth-child(1){ animation-delay:.35s; }
.stage.resolved .row:nth-child(2){ animation-delay:.46s; }
.stage.resolved .row:nth-child(3){ animation-delay:.57s; }
.stage.resolved .row:nth-child(4){ animation-delay:.68s; }
@keyframes row-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* glow breathing */
@keyframes breathe { 0%,100% { opacity: .4; } 50% { opacity: .62; } }
.cta-final .glow--orange { animation: breathe 6s ease-in-out infinite; }

/* floating CTA particles */
@keyframes drift { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10%,90% { opacity: .5; } 100% { transform: translateY(-120px) rotate(80deg); opacity: 0; } }
.particle { animation: drift var(--pd, 9s) linear infinite; animation-delay: var(--pdl, 0s); }

/* scan bar fills when its feature reveals */
.feature.in .scan__fill { transition: width 2.4s var(--ease) .2s; }

/* smart-search mock: chips light up on reveal */
.feature .qchip { opacity: 0; transform: translateY(6px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.feature.in .qchip { opacity: 1; transform: none; }
.feature.in .qchip:nth-child(1){ transition-delay: .5s; }
.feature.in .qchip:nth-child(2){ transition-delay: .68s; }
.feature.in .qchip:nth-child(3){ transition-delay: .86s; }

/* filter pills cycle active on reveal */
@keyframes pill-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.feature.in .pill.is-active { animation: pill-pop .5s var(--ease); }

/* how-it-works step numbers pulse in */
.step .step__n { transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.in .step:hover .step__n { box-shadow: 0 0 0 4px var(--accent-tint); transform: translateY(-2px); }

/* shield glow */
@keyframes shield-glow { 0%,100% { filter: drop-shadow(0 0 14px rgba(249,115,22,0.35)); } 50% { filter: drop-shadow(0 0 26px rgba(249,115,22,0.6)); } }
.shield { animation: shield-glow 5s ease-in-out infinite; }

/* ============================================================
   SHOWCASE — smart insights + duplicate center
   ============================================================ */

/* ============================================================
   SMART INSIGHTS — card stagger-reveal + count-up + alert pulse
   ============================================================ */
.insights-stage .insight-card { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.insights-stage.in .insight-card { opacity: 1; transform: none; }
.insights-stage.in .insight-card:nth-child(1){ transition-delay:.05s; }
.insights-stage.in .insight-card:nth-child(2){ transition-delay:.12s; }
.insights-stage.in .insight-card:nth-child(3){ transition-delay:.19s; }
.insights-stage.in .insight-card:nth-child(4){ transition-delay:.26s; }
.insights-stage.in .insight-card:nth-child(5){ transition-delay:.33s; }
.insights-stage.in .insight-card:nth-child(6){ transition-delay:.40s; }
.insights-stage.in .insight-card:nth-child(7){ transition-delay:.47s; }
.insights-stage.in .insight-card:nth-child(8){ transition-delay:.54s; }
.insights-stage.in .insight-card:nth-child(9){ transition-delay:.61s; }

@keyframes insight-pulse {
  0%,100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ic-color) 30%, transparent); }
  50%     { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ic-color) 55%, transparent), 0 0 32px var(--ic-glow); }
}
.insight-card--alert.is-pulsing { animation: insight-pulse 1.1s var(--ease) 2; }

/* duplicate center: clean-up ripple */
@keyframes dupe-ripple { 0% { transform: translate(-50%,-50%) scale(0); opacity: .7; } 100% { transform: translate(-50%,-50%) scale(34); opacity: 0; } }

/* duplicate center: a flagged row sweeps to the trash */
@keyframes dupe-sweep {
  0%   { opacity: 1; transform: translateX(0); max-height: 80px; }
  55%  { opacity: 0; transform: translateX(44px); }
  100% { opacity: 0; transform: translateX(44px); max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}
.dfile.swept { animation: dupe-sweep .5s var(--ease) forwards; overflow: hidden; }

/* the surviving "Keep" row settles up + greens its border once cleaned */
.dgroup .dfile--keep { transition: border-color .4s var(--ease), background .4s var(--ease); }
.dupe-win.cleaned .dfile--keep { border-color: rgba(86,211,154,0.30); background: rgba(86,211,154,0.05); }

/* ---------- reduced motion: strip all of it ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .stage .appwin { opacity: 1 !important; transform: none !important; }
  .stage .orbit { opacity: 0 !important; }
  .scan__fill { width: var(--scan-final, 78%) !important; }
  .insights-stage .insight-card { opacity: 1 !important; transform: none !important; }
}
