/* ============================================
   Contreras Josefina — Custom Styles
   Classic & Elegant Real Estate Website
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(45, 168, 118, 0.2);
    color: #0a2540;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a2540;
}
::-webkit-scrollbar-thumb {
    background: #2da876;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1a8a5c;
}

/* ---- Navbar ---- */
#navbar {
    color: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled {
    background: rgba(6, 24, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

#navbar.scrolled .nav-logo-path {
    stroke: #89dbb8;
}

#navbar.scrolled .nav-logo-text {
    color: #ffffff;
}

#navbar.scrolled .nav-logo-sub {
    color: rgba(137, 219, 184, 0.7);
}

.nav-link {
    position: relative;
}

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

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

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

#mobile-menu.open .mobile-nav-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 1;
}

.mobile-nav-link {
    opacity: 0;
}

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

.menu-line {
    background: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled .menu-line {
    background: rgba(255, 255, 255, 0.85);
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

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

#menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    width: 24px;
}

/* ---- Scroll Indicator ---- */
@keyframes scroll-indicator {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(400%); }
}

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

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

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
    .animate-scroll-indicator {
        animation: none;
    }
}

/* ---- Selection ---- */
::-moz-selection {
    background: rgba(45, 168, 118, 0.2);
    color: #0a2540;
}

/* ---- Print ---- */
@media print {
    #navbar, #menu-toggle, .scroll-reveal {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
