/* ============================================================
   MORHENA AMBIENTAL — Animations
   ============================================================ */

/* ── Leaf System ── */
.leaf-svg {
  fill: currentColor;
  transition: transform 0.1s linear;
}

/* Single leaf path — used throughout */
.leaf {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Leaf sizes */
.leaf--xs  { width: 16px;  height: 22px; }
.leaf--sm  { width: 24px;  height: 34px; }
.leaf--md  { width: 36px;  height: 50px; }
.leaf--lg  { width: 52px;  height: 72px; }
.leaf--xl  { width: 72px;  height: 100px; }

/* Floating animation variants */
@keyframes leaf-float-1 {
  0%   { transform: translate(0, 0)   rotate(0deg)   scale(1); }
  25%  { transform: translate(12px, -18px) rotate(8deg)  scale(1.04); }
  50%  { transform: translate(-8px, -30px) rotate(-5deg) scale(0.97); }
  75%  { transform: translate(15px, -18px) rotate(12deg) scale(1.02); }
  100% { transform: translate(0, 0)   rotate(0deg)   scale(1); }
}

@keyframes leaf-float-2 {
  0%   { transform: translate(0, 0)    rotate(0deg)   scale(1); }
  33%  { transform: translate(-15px, -22px) rotate(-10deg) scale(1.05); }
  66%  { transform: translate(10px, -35px)  rotate(6deg)   scale(0.96); }
  100% { transform: translate(0, 0)    rotate(0deg)   scale(1); }
}

@keyframes leaf-float-3 {
  0%   { transform: translate(0, 0)   rotate(0deg)  scale(1); }
  20%  { transform: translate(8px, -12px)  rotate(5deg) scale(1.03); }
  40%  { transform: translate(-5px, -25px) rotate(-8deg) scale(0.98); }
  60%  { transform: translate(18px, -20px) rotate(15deg) scale(1.04); }
  80%  { transform: translate(-10px, -10px) rotate(-3deg) scale(0.99); }
  100% { transform: translate(0, 0)   rotate(0deg)  scale(1); }
}

@keyframes leaf-drift {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.08; }
  50%  { opacity: 0.15; }
  100% { transform: translateY(-60px) rotate(20deg); opacity: 0; }
}

@keyframes leaf-sway {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50%       { transform: rotate(6deg)  translateY(-8px); }
}

.anim-leaf-1 { animation: leaf-float-1 8s ease-in-out infinite; }
.anim-leaf-2 { animation: leaf-float-2 11s ease-in-out infinite; }
.anim-leaf-3 { animation: leaf-float-3 14s ease-in-out infinite; }
.anim-leaf-sway { animation: leaf-sway 6s ease-in-out infinite; }

/* Staggered delays */
.delay-1 { animation-delay: 0s; }
.delay-2 { animation-delay: -2s; }
.delay-3 { animation-delay: -4s; }
.delay-4 { animation-delay: -6s; }
.delay-5 { animation-delay: -8s; }
.delay-6 { animation-delay: -10s; }
.delay-7 { animation-delay: -3s; }
.delay-8 { animation-delay: -7s; }

/* ── Background Particle System ── */
@keyframes particle-rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-120px) translateX(30px) scale(0.5); opacity: 0; }
}

.particle {
  position: absolute;
  border-radius: var(--r-full);
  background: var(--c-green-400);
  animation: particle-rise linear infinite;
  will-change: transform, opacity;
}

/* ── Hero Ambient ── */
@keyframes hero-ambient-1 {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.15; }
  50%       { transform: scale(1.1) rotate(10deg); opacity: 0.2; }
}

@keyframes hero-ambient-2 {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.08; }
  50%       { transform: scale(0.9) rotate(-8deg); opacity: 0.12; }
}

.hero-ambient-shape {
  position: absolute;
  border-radius: var(--r-full);
  pointer-events: none;
}

.hero-ambient-1 {
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(0,125,143,0.12), transparent 70%);
  animation: hero-ambient-1 12s ease-in-out infinite;
}

.hero-ambient-2 {
  width: 800px; height: 800px;
  bottom: -300px; left: -200px;
  background: radial-gradient(circle, rgba(30,122,62,0.1), transparent 70%);
  animation: hero-ambient-2 16s ease-in-out infinite;
}

/* ── Logo Symbol Spin (slow) ── */
@keyframes logo-gentle-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.logo-symbol-spin {
  animation: logo-gentle-spin 40s linear infinite;
}

/* ── Scroll Indicator ── */
@keyframes scroll-fade {
  0%   { opacity: 0; transform: translateY(-10px); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

.scroll-indicator-arrow {
  animation: scroll-fade 2s ease-in-out infinite;
}

/* ── Counter ── */
.counter-value {
  transition: color 0.3s ease;
}

/* ── Section Transition Connector ── */
.section-connector {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 2;
}

.section-connector--down svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Line Draw Animation (SVG) ── */
.draw-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.draw-path.drawn {
  animation: draw-line 2s ease forwards;
}

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

/* ── Ciclo Flow Animation ── */
@keyframes ciclo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30,122,62,0); }
  50%       { box-shadow: 0 0 0 8px rgba(30,122,62,0.15); }
}

.ciclo-step--active .ciclo-step__icon {
  animation: ciclo-pulse 2s ease-in-out infinite;
}

/* ── CCO Grid Scan ── */
@keyframes cco-scan {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.15; }
  90%  { opacity: 0.15; }
  100% { transform: translateY(100%); opacity: 0; }
}

.cco-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-teal-300), transparent);
  animation: cco-scan 4s linear infinite;
  pointer-events: none;
}

/* ── CCO Map Animated Routes ── */
.cco-brazil-path {
  fill: rgba(30,122,62,0.08);
  stroke: rgba(30,122,62,0.35);
  stroke-width: 1.5;
}

.cco-ms-state {
  fill: rgba(30,122,62,0.10);
  stroke: rgba(77,201,122,0.5);
  stroke-width: 1.5;
  stroke-dasharray: 6 3;
}

.cco-route {
  stroke: rgba(77,201,122,0.38);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}

.cco-pulse {
  fill: none;
  stroke: #4dc97a;
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: cco-city-pulse 3s ease-out infinite;
}

@keyframes cco-city-pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  70%  { transform: scale(4.5); opacity: 0; }
  100% { transform: scale(4.5); opacity: 0; }
}

/* ── Brazil Map Pulse ── */
@keyframes brazil-dot-appear {
  0%   { opacity: 0; transform: scale(0); }
  60%  { transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.city-dot { animation: brazil-dot-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }
.city-dot:nth-child(1)  { animation-delay: 0.1s; }
.city-dot:nth-child(2)  { animation-delay: 0.2s; }
.city-dot:nth-child(3)  { animation-delay: 0.3s; }
.city-dot:nth-child(4)  { animation-delay: 0.4s; }
.city-dot:nth-child(5)  { animation-delay: 0.5s; }
.city-dot:nth-child(6)  { animation-delay: 0.6s; }
.city-dot:nth-child(7)  { animation-delay: 0.7s; }
.city-dot:nth-child(8)  { animation-delay: 0.8s; }
.city-dot:nth-child(9)  { animation-delay: 0.9s; }

/* ── GSAP will-change helpers ── */
.gsap-will-change {
  will-change: transform, opacity;
}

/* ── Typed text cursor ── */
.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--c-green-400);
  margin-left: 2px;
  animation: cursor-blink 1s step-end infinite;
}

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

/* ── Hover Magnetic Effect ── */
.magnetic { transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94); }

/* ── Solução Card Leaf ── */
.solucao-card__leaf {
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  color: var(--c-green-100);
  opacity: 0;
  transform: rotate(-30deg) scale(0.7);
  transition: opacity var(--t-slow), transform var(--t-slow);
  pointer-events: none;
}

.solucao-card:hover .solucao-card__leaf {
  opacity: 0.5;
  transform: rotate(-10deg) scale(1);
}

/* ── Background ambient leaves (hero) ── */
.hero-leaf-cluster {
  position: absolute;
  top: 0; right: 0;
  width: 45%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.07;
}

/* ── Transition wave between sections ── */
.wave-transition {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  line-height: 0;
  pointer-events: none;
  z-index: 3;
}

.wave-transition svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-scroll { display: none; }
  .leaf-float { display: none; }
  .clientes-track { animation: none; }
  .city-dot .city-pulse { display: none; }
  .cco-scan-line { display: none; }
}
