/* Base & Typography */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(196, 119, 91, 0.2);
    color: #3d3632;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdfaf5;
}
::-webkit-scrollbar-thumb {
    background: #d49a4a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C4775B;
}

/* Navbar transition */
nav.scrolled {
    background: rgba(254, 253, 251, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.06);
}

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

nav.scrolled .nav-logo-text {
    color: #3d3632 !important;
}

nav.scrolled .nav-subtext {
    color: #8a8178 !important;
}

nav.scrolled .mobile-menu-link {
    color: #3d3632 !important;
}

/* Hero Animations */
.hero-content {
    animation: fadeInUp 1s ease-out forwards;
}

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

/* Scroll indicator */
.scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Section fade-in animations */
.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Stagger children */
.section-fade.visible > *:nth-child(1) { transition-delay: 0.1s; }
.section-fade.visible > *:nth-child(2) { transition-delay: 0.2s; }
.section-fade.visible > *:nth-child(3) { transition-delay: 0.3s; }
.section-fade.visible > *:nth-child(4) { transition-delay: 0.4s; }

/* Stat counter animation */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

#mobile-menu.open {
    max-height: 500px;
    padding-top: 0;
}

/* Back to top button */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Property card hover */
.group .relative.overflow-hidden {
    will-change: transform;
}

/* Form focus styles */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 119, 91, 0.15);
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .section-fade, .stat-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-content {
        animation: none;
        opacity: 1;
    }
    .scroll-line {
        animation: none;
        opacity: 0.5;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.75rem;
    }
    .section-fade {
        transition-delay: 0s !important;
    }
}

/* Large screen adjustments */
@media (min-width: 1280px) {
    .hero-content h1 {
        font-size: 5.5rem;
    }
}
