@property --focus-x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 20%;
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes breathe { 0%, 100% { opacity: 0.85; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
@keyframes float { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-110px); } }
@keyframes sweep { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes bar-up { to { transform: scaleY(1); } }
@keyframes line-in { to { transform: scaleX(1); } }
@keyframes ring-in { to { transform: scale(1); opacity: 1; } }
@keyframes pop-in { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel { 0% { top: 28px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 36px); opacity: 0; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes state-spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 6px rgba(0, 230, 107, 0.5); } 50% { box-shadow: 0 0 16px rgba(0, 230, 107, 0.95); } }

/* ==========================================================================
   AMBIENTE (hero e CTA)
   ========================================================================== */
.hero-glow { animation: breathe 9s ease-in-out infinite; }
.ring--lg { animation: spin 180s linear infinite; }
.ring--md { animation: spin 140s linear infinite reverse; }
.cta-ring--a { animation: spin 220s linear infinite; }

.scroll-hint-line::after { animation: sweep 2.6s ease-in-out infinite; }

.particles span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--zc-green-primary);
  opacity: 0;
  animation: float var(--d) ease-in-out var(--delay) infinite;
}

/* Entrada do hero: o único momento coreografado ao carregar */
.js .hero-inner > * { animation: rise 900ms var(--ease-out) both; }
.js .hero-inner > :nth-child(1) { animation-delay: 80ms; }
.js .hero-inner > :nth-child(2) { animation-delay: 200ms; }
.js .hero-inner > :nth-child(3) { animation-delay: 380ms; }
.js .hero-inner > :nth-child(4) { animation-delay: 500ms; }
.js .hero-inner > :nth-child(5) { animation-delay: 620ms; }

.project--building .state-dot,
.status-dot { animation: pulse-dot 2.4s ease-in-out infinite; }
.project--adapting .state-dot::after { animation: state-spin 2.8s linear infinite; }

/* ==========================================================================
   REVEAL (só com JS ativo)
   ========================================================================== */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Em contentores stagger, são os filhos que entram em sequência */
.js [data-stagger][data-reveal] { opacity: 1; transform: none; }
.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), background 280ms var(--ease-out), border-color 280ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms), calc(var(--i, 0) * 80ms), 0s, 0s;
}
.js [data-stagger].is-visible > * { opacity: 1; transform: none; }

/* Cartões com hover: usam "translate" para não colidir com o reveal */
.zone-panel:hover, .session:hover, .naiza-chat:hover { transform: none; translate: 0 -2px; }

/* ==========================================================================
   GRÁFICOS DE EVOLUÇÃO: animam quando entram no viewport
   ========================================================================== */
.measure-grid.is-visible .gfx-bars i { animation: bar-up 900ms var(--ease-out) forwards; }
.measure-grid.is-visible .gfx-bars i:nth-child(2) { animation-delay: 70ms; }
.measure-grid.is-visible .gfx-bars i:nth-child(3) { animation-delay: 140ms; }
.measure-grid.is-visible .gfx-bars i:nth-child(4) { animation-delay: 210ms; }
.measure-grid.is-visible .gfx-bars i:nth-child(5) { animation-delay: 280ms; }
.measure-grid.is-visible .gfx-bars i:nth-child(6) { animation-delay: 350ms; }
.measure-grid.is-visible .gfx-bars i:nth-child(7) { animation-delay: 420ms; }

.measure-grid.is-visible .gfx-focus i { animation: ring-in 800ms var(--ease-out) forwards; }
.measure-grid.is-visible .gfx-focus i:nth-child(2) { animation-delay: 150ms; }
.measure-grid.is-visible .gfx-focus i:nth-child(3) { animation-delay: 300ms; }

.measure-grid.is-visible .gfx-proof i { animation: line-in 700ms var(--ease-out) forwards; }
.measure-grid.is-visible .gfx-proof i:nth-child(2) { animation-delay: 160ms; }
.measure-grid.is-visible .gfx-proof i:nth-child(3) { animation-delay: 320ms; }

.measure-grid.is-visible .gfx-chain::before { animation: line-in 1100ms var(--ease-out) 100ms forwards; }
.measure-grid.is-visible .gfx-chain i { animation: pop-in 400ms var(--ease-out) forwards; }
.measure-grid.is-visible .gfx-chain i:nth-child(1) { animation-delay: 100ms; }
.measure-grid.is-visible .gfx-chain i:nth-child(2) { animation-delay: 350ms; }
.measure-grid.is-visible .gfx-chain i:nth-child(3) { animation-delay: 600ms; }
.measure-grid.is-visible .gfx-chain i:nth-child(4) { animation-delay: 850ms; }
.measure-grid.is-visible .gfx-chain i:nth-child(5) { animation-delay: 1100ms; }

.measure-grid.is-visible .gfx-path { animation: draw 1600ms var(--ease-out) 200ms forwards; }
.measure-grid.is-visible .gfx-path--dim { animation: pop-in 600ms var(--ease-out) 200ms forwards; }
.measure-grid.is-visible .gfx-end { animation: pop-in 400ms var(--ease-out) 1600ms forwards; }

/* Fluxo de recursos: ponto que percorre a linha */
.flow.is-visible::after { animation: travel 4.5s ease-in-out infinite; }
.flow::after { opacity: 0; }

/* ==========================================================================
   MOVIMENTO REDUZIDO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .particles, .hero-glow { display: none; }
  .js [data-reveal], .js [data-stagger] > * { opacity: 1; transform: none; }

  .gfx-bars i { transform: none; }
  .gfx-focus i { transform: none; opacity: 1; }
  .gfx-proof i, .gfx-chain::before { transform: none; }
  .gfx-chain i, .gfx-end, .gfx-path--dim { opacity: 1; }
  .gfx-path { stroke-dashoffset: 0; }
  .flow::after { opacity: 1; }

  /* Manifesto estático, sem sequência ao scroll */
  .js .manifesto { height: auto; }
  .js .manifesto-sticky { position: relative; height: auto; min-height: 100svh; padding-block: 6rem; }
  .js .manifesto-stage { display: grid; }
  .js .manifesto-line { position: static; opacity: 1; transform: none; }
  .js .manifesto-progress { display: none; }
}
