/* ==========================================================================
   Rhythm N Flow — Custom styles (beyond Tailwind utilities)
   ========================================================================== */

:root {
  --brand-600: #3b732e;
  --accent-500: #46acd9;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #7CB342;
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid #46acd9;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Scroll-reveal animation system (Framer Motion style) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal="fade-left"] {
  transform: translateX(-36px);
}
[data-reveal="fade-right"] {
  transform: translateX(36px);
}
[data-reveal="zoom"] {
  transform: scale(0.94);
}
[data-reveal="fade"] {
  transform: none;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* Staggered group: children are revealed one after another */
[data-reveal-group] [data-reveal] {
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------- Navigation links (desktop + mobile) ---------- */

.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a421a;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: #7CB342;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover {
  color: #3b732e;
}
.nav-link:hover::after,
.nav-link[aria-current='page']::after {
  width: 100%;
}
.nav-link[aria-current='page'] {
  color: #3b732e;
}

/* Solid (scrolled) header */
header.is-scrolled .nav-link {
  color: #1a421a;
}
header.is-scrolled .nav-link:hover {
  color: #3b732e;
}
header.is-scrolled .nav-link[aria-current='page'] {
  color: #3b732e;
}
header.is-scrolled .nav-link::after {
  background: #3b732e;
}

/* Mobile menu always sits on white */
#mobile-menu .nav-link {
  display: block;
  padding: 0.75rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #1a421a;
}
#mobile-menu .nav-link:hover {
  background: #e7f2d7;
  color: #3b732e;
}
#mobile-menu .nav-link[aria-current='page'] {
  color: #3b732e;
}
#mobile-menu .nav-link::after {
  display: none;
}

/* ---------- Decorative animations ---------- */

@keyframes rnf-kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes rnf-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes rnf-float-x {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, -8px);
  }
}

@keyframes rnf-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes rnf-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes rnf-spin-slow {
  to {
    transform: rotate(360deg);
  }
}

.animate-kenburns {
  animation: rnf-kenburns 18s ease-out forwards;
}

.animate-float {
  animation: rnf-float 6s ease-in-out infinite;
}

.animate-float-x {
  animation: rnf-float-x 7s ease-in-out infinite;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: rnf-marquee 36s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.whatsapp-pulse {
  animation: rnf-pulse-ring 2.4s cubic-bezier(0.66, 0, 0, 1) infinite;
}

.spin-slow {
  animation: rnf-spin-slow 24s linear infinite;
}

/* ---------- Misc helpers ---------- */

.text-gradient-brand {
  background: linear-gradient(92deg, #3b732e 0%, #7CB342 45%, #46acd9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bg-hero-pattern {
  background-image: radial-gradient(
      ellipse 60% 50% at 20% 20%,
      rgba(124, 179, 66, 0.14),
      transparent 60%
    ),
    radial-gradient(
      ellipse 55% 45% at 85% 15%,
      rgba(110, 193, 228, 0.16),
      transparent 55%
    ),
    radial-gradient(
      ellipse 50% 55% at 50% 100%,
      rgba(94, 151, 79, 0.10),
      transparent 60%
    );
}

.dotted-grid {
  background-image: radial-gradient(rgba(124, 179, 66, 0.35) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Brand pattern (from the official brand kit) as a subtle overlay */
.brand-pattern-overlay {
  background-image: url('../images/brand/brand_pattern_dark.png');
  background-repeat: repeat;
  opacity: 0.09;
}

/* Light variant of the brand pattern for light-themed sections */
.brand-pattern-overlay-light {
  background-image: url('../images/brand/brand_pattern_light.png');
  background-repeat: repeat;
  opacity: 0.5;
}

/* Soft green decorative blob */
.blob-green {
  background: radial-gradient(circle, rgba(124, 179, 66, 0.18), transparent 70%);
  border-radius: 9999px;
  filter: blur(20px);
}
.blob-sky {
  background: radial-gradient(circle, rgba(110, 193, 228, 0.18), transparent 70%);
  border-radius: 9999px;
  filter: blur(20px);
}

/* Custom scrollbar (subtle, premium) */
::-webkit-scrollbar {
  width: 11px;
}
::-webkit-scrollbar-track {
  background: #f2f8f0;
}
::-webkit-scrollbar-thumb {
  background: #b2d48a;
  border-radius: 8px;
  border: 3px solid #f2f8f0;
}
::-webkit-scrollbar-thumb:hover {
  background: #5a974f;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal],
  [data-reveal-group] > [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
