/* ============================================
   LaBrot Child & Family Psychiatric Services
   Custom Styles
   ============================================ */

/* --- 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: rgba(123, 45, 59, 0.15);
  color: #7B2D3B;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #fefcfb;
}
::-webkit-scrollbar-thumb {
  background: #f7c2ca;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ef8fa0;
}

/* --- Animations --- */
@keyframes scrollDown {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

.animate-scroll-down {
  animation: scrollDown 1.5s ease-in-out infinite;
}

/* --- Hero Animations --- */
.hero-subtitle {
  animation: fadeUp 0.7s ease forwards;
}

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

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

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

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

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

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

#mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

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

/* --- Navbar scroll state --- */
#navbar.scrolled {
  background: rgba(254, 252, 251, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(123, 45, 59, 0.08);
}

/* --- Service Cards --- */
.service-card {
  transition: background-color 0.5s ease;
}

.service-card:hover {
  transform: translateY(-2px);
}

/* --- Fade-in on scroll --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --- Floating card animation --- */
.fade-up-card {
  animation: cardFloat 0.6s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

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

/* --- Form focus states --- */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

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

@media (min-width: 768px) and (max-width: 1023px) {
  .service-card {
    padding: 1.5rem !important;
  }
}

/* --- Print styles --- */
@media print {
  #navbar, #contact-form, .animate-scroll-down {
    display: none !important;
  }
  body {
    color: #333;
    background: white;
  }
}
