/* ============================================
   SoCal IceCream California Del Sur
   Custom Styles
   ============================================ */

/* Base */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background-color: #3d6631;
  color: #fefdf8;
}

/* Navbar */
#navbar {
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(254, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(31, 53, 26, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #528240;
  transition: width 0.3s ease;
}

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

#navbar.scrolled .nav-link {
  color: #264121;
}

#navbar.scrolled .nav-link:hover {
  color: #528240;
}

#navbar.scrolled .nav-link::after {
  background: #528240;
}

/* Mobile menu */
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

#mobileMenu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* Menu button animation */
.menu-btn.active .menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

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

.menu-btn.active .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 1.5rem;
}

/* Marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 30s linear infinite;
}

/* Reveal animations */
.reveal-left,
.reveal-right,
.reveal-menu,
.reveal-feature,
.reveal-img {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-left {
    transform: translateX(-40px);
  }
  .reveal-right {
    transform: translateX(40px);
  }
  .reveal-menu {
    transform: translateY(30px);
  }
  .reveal-feature {
    transform: translateY(20px);
  }
  .reveal-img {
    transform: scale(0.97);
  }

  .reveal-left.visible,
  .reveal-right.visible,
  .reveal-menu.visible,
  .reveal-feature.visible,
  .reveal-img.visible {
    opacity: 1;
    transform: translate(0) scale(1);
  }
}

/* Hero */
#hero {
  position: relative;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, #fefdf8, transparent);
  pointer-events: none;
}

/* Buttons */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #528240;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Smooth image loading */
img {
  image-rendering: auto;
}

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

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

::-webkit-scrollbar-thumb {
  background: #9dbe86;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #72a25a;
}
</style>
