/* Animations and micro-interactions */
:root {
  --brand: #4CAF50;
  --brand-dark: #388E3C;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Hero animated gradient overlay */
.hero-animated-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 0% 0%, rgba(76,175,80,0.18) 0%, transparent 60%),
              radial-gradient(120% 80% at 100% 100%, rgba(56,142,60,0.18) 0%, transparent 60%);
  animation: hueShift 12s linear infinite alternate;
  mix-blend-mode: screen;
}

@keyframes hueShift {
  0% { filter: hue-rotate(0deg) saturate(1); opacity: .8; }
  50%{ filter: hue-rotate(10deg) saturate(1.1); opacity: .9; }
  100%{ filter: hue-rotate(20deg) saturate(1.2); opacity: 1; }
}

/* Reveal base */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Direction variants */
.fade-in { transform: none; }
.fade-right { transform: translateX(-16px); }
.fade-left { transform: translateX(16px); }

/* Staggering */
.stagger-parent { --stagger-step: 90ms; }
.stagger-parent .stagger-child { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.stagger-parent.is-visible .stagger-child { opacity: 1; transform: translateY(0); }
.stagger-parent.is-visible .stagger-child:nth-child(1) { transition-delay: calc(var(--stagger-step) * 0); }
.stagger-parent.is-visible .stagger-child:nth-child(2) { transition-delay: calc(var(--stagger-step) * 1); }
.stagger-parent.is-visible .stagger-child:nth-child(3) { transition-delay: calc(var(--stagger-step) * 2); }
.stagger-parent.is-visible .stagger-child:nth-child(4) { transition-delay: calc(var(--stagger-step) * 3); }

/* Buttons micro-interactions */
.btn { transition: transform .18s var(--ease), box-shadow .18s var(--ease); will-change: transform; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,.14); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: 0 6px 14px rgba(0,0,0,.16); }

/* Image card hover effects */
.img-card { position: relative; transition: transform .35s var(--ease), box-shadow .35s var(--ease); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.img-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,.16); }
.hover-zoom img { transition: transform .5s var(--ease); will-change: transform; }
.hover-zoom:hover img { transform: scale(1.05); }

/* Feature mini-cards */
.card-hover { transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .28s var(--ease); }
.card-hover:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(0,0,0,.14); background: #ffffff; }

/* Animated gradient border utility */
.gradient-border { position: relative; border-radius: inherit; }
.gradient-border::before {
  content: "";
  position: absolute; inset: -1px; border-radius: inherit; padding: 2px;
  background: linear-gradient(135deg, #4CAF50, #7B1FA2, #388E3C, #4CAF50);
  background-size: 300% 300%;
  animation: borderFlow 8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; 
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes borderFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Slightly intensify on hover when element is hoverable */
.gradient-border:hover::before { filter: brightness(1.08); }

/* Header scroll state */
.header.scrolled { backdrop-filter: saturate(1.2) blur(10px); background: rgba(255,255,255,0.72); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.header.scrolled .nav-link { color: #2c3e50; }

/* Back to top button removed */

/* Smooth scroll for in-page anchors */
html { scroll-behavior: smooth; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .stagger-parent .stagger-child { opacity: 1 !important; transform: none !important; }
}
