/* Custom styles for Costa Living */

:root {
  --nav-accent: #166534;
  --nav-text: #14532d;
  --nav-bg: rgba(254, 253, 248, 0.92);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

/* Nav styles */
#nav {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#nav.scrolled {
  background: var(--nav-bg);
  box-shadow: 0 1px 20px rgba(20, 83, 45, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #22c55e;
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

/* Mobile menu */
.mobile-link {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(22, 101, 52, 0.08);
}

.mobile-link:last-child {
  border-bottom: none;
}

/* Scroll reveal animations */
.scroll-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger children */
  #services .scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
  #services .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
  #services .scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
  #services .scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
  #services .scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
  #services .scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

  #neighborhoods .scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
  #neighborhoods .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
  #neighborhoods .scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
  #neighborhoods .scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
  #neighborhoods .scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
  #neighborhoods .scroll-reveal:nth-child(6) { transition-delay: 0.3s; }
}

/* Form focus styles */
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* Selection color */
::selection {
  background: rgba(34, 197, 94, 0.2);
  color: #14532d;
}

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

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

::-webkit-scrollbar-thumb {
  background: #86efac;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4ade80;
}

/* Subtle pulse for CTA */
@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 101, 52, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(22, 101, 52, 0); }
}

/* Ensure all images have no layout shift */
img {
  max-width: 100%;
  height: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }

  #hero h1 {
    font-size: 2.75rem;
  }

  #hero .stats {
    gap: 1.5rem;
  }

  .scroll-reveal {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  #hero h1 {
    font-size: 2.25rem;
  }
}
