/* ===========================
   Colorado Mountain Solar
   Custom Styles
   =========================== */

:root {
  --color-primary: #7BC67E;
  --color-primary-dark: #4A9E4D;
  --color-primary-light: #A8DCA9;
  --color-dk-green: #1B5E20;
  --color-lt-blue: #64B5F6;
  --color-yellow: #FFD54F;
  --color-orange: #FF8A65;
}

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

/* Selection color */
::selection {
  background-color: var(--color-primary);
  color: white;
}

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

/* Header scrolled state */
.header-scrolled .header-backdrop {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.header-scrolled {
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.06);
}

/* Mobile menu open state */
.menu-open #mobile-menu {
  transform: translateX(0);
}

.menu-open .hamburger-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

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

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

/* Nav link underline effect */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateX(-50%);
  border-radius: 1px;
}

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

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

@keyframes scrollBounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 1; }
  50% { transform: translate(-50%, 8px); opacity: 0.5; }
}

/* Service card shine effect */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transition: left 0.6s ease;
}

.service-card:hover::before {
  left: 100%;
}

/* Partner logo hover lift */
.partner-logo {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.partner-logo:hover {
  transform: translateY(-4px);
}

/* CTA button pulse */
.cta-btn {
  position: relative;
}

.cta-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: var(--color-primary);
  opacity: 0;
  z-index: -1;
  animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.05); }
}

/* Quote section text reveal */
blockquote {
  text-wrap: balance;
}

/* Counter animation helper */
.counter {
  display: inline-block;
  min-width: 2ch;
}

/* Mobile nav link stagger helper */
.mobile-nav-link {
  opacity: 0;
  transform: translateX(30px);
}

.menu-open .mobile-nav-link {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-open .mobile-nav-link[data-index="0"] { transition-delay: 0.1s; }
.menu-open .mobile-nav-link[data-index="1"] { transition-delay: 0.15s; }
.menu-open .mobile-nav-link[data-index="2"] { transition-delay: 0.2s; }
.menu-open .mobile-nav-link[data-index="3"] { transition-delay: 0.25s; }
.menu-open .mobile-nav-link[data-index="4"] { transition-delay: 0.3s; }
.menu-open .mobile-nav-link[data-index="5"] { transition-delay: 0.35s; }

/* Responsive image handling */
img {
  max-width: 100%;
  height: auto;
}

/* Smooth section transitions */
section {
  position: relative;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

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

  .scroll-indicator {
    animation: none;
  }
}

/* Print styles */
@media print {
  header, .scroll-indicator, .cta-btn {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
  }
}