/* ============================================
   JoAnne Silva — Real Estate Website
   Custom Styles & Animation Utilities
   ============================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base font settings */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement: content is visible
   by default, JS adds animation classes.
   ============================================ */

.reveal-up,
.reveal-left,
.reveal-right {
    /* Content is visible by default — no opacity:0 here */
}

/* Animation classes added by JS only */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up.animate-in {
        animation: revealUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .reveal-left.animate-in {
        animation: revealLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .reveal-right.animate-in {
        animation: revealRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Navbar Scroll State
   ============================================ */
.nav-scrolled {
    background: rgba(250, 249, 246, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 60, 52, 0.08);
}

.nav-scrolled .font-serif {
    color: #1a3c34 !important;
}

/* ============================================
   Mobile Menu Transitions
   ============================================ */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

/* ============================================
   Mobile Menu Button Animation
   ============================================ */
body.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
body.menu-open .menu-line:nth-child(2) {
    opacity: 0;
}
body.menu-open .menu-line:nth-child(3) {
    width: 6px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Custom Select Arrow
   ============================================ */
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='%231a3c34' stroke-width='2.5' 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 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Selection Color
   ============================================ */
::selection {
    background: rgba(26, 60, 52, 0.15);
    color: #1a3c34;
}

/* ============================================
   Focus Visible Styles
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #1a3c34;
    outline-offset: 2px;
    border-radius: 4px;
}

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