/* ============================================
   Lorena Mercado — Real Estate Website
   Custom Styles
============================================ */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(123, 45, 142, 0.15);
    color: #7B2D8E;
}

/* --- Scroll Reveal Animations --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }

/* --- Hero Animations --- */
.hero-anim {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0.2s; }
.hero-anim:nth-child(2) { animation-delay: 0.4s; }
.hero-anim:nth-child(3) { animation-delay: 0.6s; }
.hero-anim:nth-child(4) { animation-delay: 0.8s; }

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Floating Card Animations --- */
.hero-card-1 {
    animation: float1 6s ease-in-out infinite;
}

.hero-card-2 {
    animation: float2 5s ease-in-out infinite;
}

.hero-card-3 {
    animation: float3 5.5s ease-in-out infinite;
}

.hero-card-4 {
    animation: float4 4.5s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0px) rotate(1deg); }
    50% { transform: translateY(-8px) rotate(-1deg); }
}

/* --- Navbar --- */
.nav-link {
    position: relative;
}

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

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

/* --- Navbar scroll state --- */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.nav-scrolled .nav-link {
    color: #374151 !important;
}

/* --- Mobile Menu --- */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* --- Hamburger Animation --- */
#menuBtn.active #bar1 {
    transform: translateY(3px) rotate(45deg);
}

#menuBtn.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#menuBtn.active #bar3 {
    transform: translateY(-3px) rotate(-45deg);
    width: 1.5rem;
}

/* --- Custom Select --- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* --- Button loading state --- */
#submitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- Smooth image loading --- */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #7B2D8E;
    outline-offset: 2px;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.2;
    }
}

/* --- Subtle grain texture overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.015;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
