/* Base resets and custom properties */
:root {
  --color-primary: #7BC950;
  --color-primary-dark: #5BA835;
  --color-dark-green: #1B4332;
  --color-deep-green: #0D2818;
  --color-teal: #2D8B7A;
  --color-light-blue: #87CEEB;
  --color-soft-yellow: #F5E6A3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: rgba(123, 201, 80, 0.3);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7BC950;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Navigation states */
#navbar.scrolled .nav-backdrop {
  background: rgba(13, 40, 24, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#navbar.scrolled {
  box-shadow: 0 1px 0 rgba(123, 201, 80, 0.1);
}

/* Nav link underline effect */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 60%;
}

/* Mobile menu active state */
#mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

/* Menu toggle animation */
.menu-open .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-open .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-open .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.5rem;
  margin-left: 0;
}

/* Scroll line animation */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* Hero sun rotation */
.hero-sun {
  animation: sunRotate 20s linear infinite;
  transform-origin: center;
}

@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-rays {
  animation: rayPulse 3s ease-in-out infinite;
}

@keyframes rayPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Service card hover lift */
.service-card {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.5s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* Partner hover */
.partner-item {
  transition: transform 0.4s ease, border-color 0.4s ease;
}

.partner-item:hover {
  transform: translateY(-2px);
}

/* Smooth transitions for all interactive elements */
a, button {
  transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title-line {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }
}

@media (max-width: 480px) {
  .service-card {
    padding: 1.5rem;
  }
}

/* Preloader fade */
#preloader.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

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

  html {
    scroll-behavior: auto;
  }
}