/* Nextflow — motion layer for the public site. Transform/opacity only, strong ease-out, reduced-motion aware. */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- Hero entrance (first paint) ---------- */
@keyframes nf-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nf-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.nf-anim .nf-hero .eyebrow, .nf-anim .nf-hero h1, .nf-anim .nf-hero .lead, .nf-anim .nf-hero .actions, .nf-anim .nf-hero .nf-checks,
.nf-anim .hero .eyebrow, .nf-anim .hero h1, .nf-anim .hero .lead, .nf-anim .hero .actions {
  animation: nf-up 700ms var(--ease-out) both;
}
.nf-anim .nf-hero h1, .nf-anim .hero h1 { animation-delay: 60ms; }
.nf-anim .nf-hero .lead, .nf-anim .hero .lead { animation-delay: 140ms; }
.nf-anim .nf-hero .actions, .nf-anim .hero .actions { animation-delay: 220ms; }
.nf-anim .nf-hero .nf-checks { animation-delay: 300ms; }

/* gradient words: slow light sweep */
@keyframes nf-sheen { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
.nf-anim h1 em {
  background-image: linear-gradient(100deg, #6366F1 0%, #A855F7 35%, #C4B5FD 50%, #A855F7 65%, #6366F1 100%);
  background-size: 200% 100%;
  animation: nf-sheen 9s linear infinite;
}

/* ---------- Orbit of agents ---------- */
@keyframes nf-spin { to { transform: rotate(360deg); } }
@keyframes nf-breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes nf-float { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 6px)); } }
.nf-anim .nf-orbit::before { animation: nf-spin 60s linear infinite; }
.nf-anim .nf-orbit::after { animation: nf-breathe 5s ease-in-out infinite; }
.nf-anim .nf-core { animation: nf-pop 800ms var(--ease-out) 200ms both; }
.nf-anim .nf-sat { animation: nf-pop 700ms var(--ease-out) both, nf-float 6s ease-in-out infinite; }
.nf-anim .nf-sat:nth-child(2) { animation-delay: 380ms, 1.2s; }
.nf-anim .nf-sat:nth-child(3) { animation-delay: 440ms, 2.0s; }
.nf-anim .nf-sat:nth-child(4) { animation-delay: 500ms, 2.8s; }
.nf-anim .nf-sat:nth-child(5) { animation-delay: 560ms, 1.6s; }
.nf-anim .nf-sat:nth-child(6) { animation-delay: 620ms, 2.4s; }
.nf-anim .nf-sat:nth-child(7) { animation-delay: 680ms, 3.2s; }
/* signal travelling from the core: a soft ring */
.nf-core::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid rgba(167, 139, 250, .6); opacity: 0; pointer-events: none; }
@keyframes nf-ping { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.nf-anim .nf-core::after { animation: nf-ping 3.2s var(--ease-out) 1.4s infinite; }

/* ---------- Scroll reveal (set up by nf-motion.js) ---------- */
.nf-rv { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.nf-rv.in { opacity: 1; transform: none; }

/* ---------- Hover & press (pointer devices only for hover) ---------- */
.btn { transition: transform 160ms var(--ease-out), filter 200ms ease, box-shadow 200ms ease, background-color 200ms ease, border-color 200ms ease; }
.btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .nf-agent, .nf-step, .nf-auto, .feat, .pain, .card { transition: transform 300ms var(--ease-out), border-color 200ms ease, box-shadow 300ms ease, opacity 700ms var(--ease-out); }
  .nf-agent:hover, .nf-step:hover, .nf-auto:hover, .feat:hover, .pain:hover {
    transform: translateY(-3px); border-color: rgba(167, 139, 250, .45);
    box-shadow: 0 18px 40px -22px rgba(139, 92, 246, .55);
  }
  .nf-agent:hover .nf-tile, .nf-sector:hover .nf-tile { transform: scale(1.06) rotate(-4deg); }
  .btn.primary:hover { box-shadow: 0 14px 36px -8px rgba(139, 92, 246, .7) !important; }
  .nf-sat:hover { border-color: rgba(167, 139, 250, .55); }
}
.nf-tile { transition: transform 300ms var(--ease-out); }

/* spotlight that follows the cursor on cards (desktop) */
.nf-spot { position: relative; isolation: isolate; }
.nf-spot::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity 300ms ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .14), transparent 60%); }
@media (hover: hover) and (pointer: fine) { .nf-spot:hover::before { opacity: 1; } }

/* ---------- Header: denser once scrolled ---------- */
header.top, header.nav { transition: background-color 300ms ease, box-shadow 300ms ease; }
header.top.nf-scrolled, header.nav.nf-scrolled { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .9); }

/* ---------- Sector filter ---------- */
.nf-auto[hidden] { display: none; }
@keyframes nf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nf-auto.nf-refresh { animation: nf-in 320ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.nf-filter button { transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out); }
.nf-filter button:active { transform: scale(.97); }

/* FAQ */
.nf-faq summary::after { transition: transform 200ms var(--ease-out); }
.nf-faq details[open] p { animation: nf-in 300ms var(--ease-out) both; }

/* status dot on "En service" badges */
@keyframes nf-live { 0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } }
.nf-anim .nf-badge.live::before, .nf-anim .nf-checks span:first-child::before { animation: nf-live 2.4s ease-out infinite; }

/* ---------- Reduced motion: keep fades, drop movement and loops ---------- */
@media (prefers-reduced-motion: reduce) {
  .nf-anim *, .nf-anim *::before, .nf-anim *::after { animation: none !important; }
  .nf-rv { transform: none; transition: opacity 300ms ease; }
  .nf-anim h1 em { background-image: linear-gradient(135deg, #6366F1, #A855F7); }
  .btn:active, .nf-filter button:active { transform: none; }
}
.nf-anim .nf-sat:nth-child(8) { animation-delay: 740ms, 2.2s; }
.nf-anim .nf-sat:nth-child(9) { animation-delay: 800ms, 3.0s; }
.nf-anim .nf-sat:nth-child(10) { animation-delay: 860ms, 1.8s; }
