/* ===== Custom Styles for Pepper Tree Village ===== */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0610;
}

::-webkit-scrollbar-thumb {
    background: #3d0c1e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/* Selection color */
::selection {
    background: rgba(184, 134, 11, 0.3);
    color: #f5e6f0;
}

/* ===== Navbar ===== */
#navbar {
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled {
    background: rgba(10, 6, 16, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(184, 134, 11, 0.1);
}

/* Mobile menu */
#mobileMenu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

#mobileMenu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
}

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

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

/* Menu button animation */
.menu-line {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    width: 6;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ===== Hero ===== */
.scroll-dot {
    animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
    0% { top: 0; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Floating cards */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -2s;
}

.floating-card:nth-child(3) {
    animation-delay: -4s;
}

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

/* ===== Residence Cards ===== */
.residence-card {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.residence-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.residence-card:nth-child(2) {
    transition-delay: 0.15s;
}

.residence-card:nth-child(3) {
    transition-delay: 0.3s;
}

/* ===== Amenities ===== */
.amenity-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== General reveal animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Gold shimmer on hover for key elements ===== */
.shimmer-hover:hover {
    background-image: linear-gradient(
        120deg,
        transparent 0%,
        rgba(184, 134, 11, 0.08) 50%,
        transparent 100%
    );
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .font-serif {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    #hero h1 {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
}

/* ===== Focus visible for accessibility ===== */
:focus-visible {
    outline: 2px solid #b8860b;
    outline-offset: 2px;
}

/* ===== 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;
    }
}
