/* ============================================
   Heather Hoven Realtor — Custom Styles
   ============================================ */

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

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

body {
  margin: 0;
  overflow-x: hidden;
}

/* Selection */
::selection {
  background-color: #F5D5CC;
  color: #7B2D3B;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FDF8F6;
}
::-webkit-scrollbar-thumb {
  background: #F9C5CE;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #F497A8;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid #F5D5CC;
  outline-offset: 2px;
}

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

#navbar.scrolled {
  background-color: rgba(253, 248, 246, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(123, 45, 59, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #F5D5CC;
  border-radius: 1px;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

/* ============================================
   Reveal Animations
   ============================================ */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
}

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

/* Stagger children */
.reveal-stagger > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger > *:nth-child(6) { transition-delay: 0.40s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-hidden,
  .reveal-stagger > *,
  html {
    transition: none !important;
    animation: none !important;
  }
  .reveal-hidden {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
  display: block;
  width: 100%;
  text-align: left;
}

#mobileMenu {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#mobileMenu.hidden {
  display: none;
}

/* Menu icon animation */
#menuIcon.open {
  transform: rotate(90deg);
}
#menuIcon.open line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
#menuIcon.open line:nth-child(2) {
  opacity: 0;
}
#menuIcon.open line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ============================================
   Back to Top
   ============================================ */
#backToTop {
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#backToTop:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(123, 45, 59, 0.3);
}

/* ============================================
   Form
   ============================================ */
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='%237B2D3B' 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 12px center;
  padding-right: 36px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .font-serif {
    line-height: 1.15;
  }
}
