/* === Custom Styles for The Reserves at Charleston Oaks === */

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

/* Scroll indicator animation */
@keyframes scrollIndicator {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

.animate-scroll-indicator {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Navbar transition */
#navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(91, 191, 174, 0.15);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-midnight-800 {
    color: #0B1D3A;
}

#navbar.scrolled .menu-line {
    background: #0B1D3A;
}

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

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

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

/* Mobile menu */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s 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; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Menu button animation */
.menu-line {
    transition: all 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(2px, 2px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(2px, -2px);
    width: 1.25rem;
}

/* Image hover effects */
.group img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #faf9f6 inset !important;
    -webkit-text-fill-color: #0B1D3A !important;
}

/* Selection color */
::selection {
    background: rgba(91, 191, 174, 0.2);
    color: #0B1D3A;
}

/* Subtle fade-in animation for sections */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.fade-in.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.fade-in.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.fade-in.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.fade-in.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.fade-in.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.fade-in.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5BBFAE;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .fade-in, .fade-in.stagger > * {
        opacity: 1;
        transform: none;
    }
}
