/* ============================================
   THE RIVERS EDGE — Custom Styles
   Classic & Elegant | Forest Green + Off-White
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Selection ---- */
::selection {
    background: rgba(45, 90, 61, 0.2);
    color: #1a3a26;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

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

.scroll-line {
    animation: scrollLine 1.8s ease-in-out infinite;
}

/* ---- Scroll Reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

#navbar.scrolled {
    background-color: rgba(10, 21, 13, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

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

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

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

#mobile-menu:not(.open) {
    transform: translateX(100%);
}

/* ---- Buttons ---- */
button, [type="submit"], a[href="#contact"] {
    cursor: pointer;
}

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

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
}

/* ---- Divider Line ---- */
.divider-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(45, 90, 61, 0.2), transparent);
}

/* ---- Smooth Image Loading ---- */
img {
    transition: opacity 0.4s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* ---- Print ---- */
@media print {
    #navbar, #mobile-toggle, .scroll-indicator {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---- 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;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---- Focus Visible ---- */
:focus-visible {
    outline: 2px solid rgba(45, 90, 61, 0.6);
    outline-offset: 2px;
}

/* ---- Mobile Navigation ---- */
@media (max-width: 1023px) {
    #mobile-menu {
        pointer-events: none;
    }
    
    #mobile-menu.open {
        pointer-events: all;
    }
    
    .mobile-link {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    }
    
    #mobile-menu.open .mobile-link {
        opacity: 1;
        transform: translateY(0);
    }
    
    #mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
    #mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
    #mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
    #mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
    #mobile-menu.open .mobile-link:nth-child(6) { transition-delay: 0.3s; }
}
