/* ─── Custom Styles for The Spirit of Care ─── */

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

/* ─── Animations ─── */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes float-delay {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-2deg); }
}

@keyframes float-slow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
  animation: float-delay 7s ease-in-out infinite;
  animation-delay: 1s;
}

.animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.animate-fade-in-up-delay {
  animation: fadeInUp 0.8s ease-out 0.15s forwards;
  opacity: 0;
}

.animate-fade-in-up-delay-2 {
  animation: fadeInUp 0.8s ease-out 0.3s forwards;
  opacity: 0;
}

.animate-fade-in-up-delay-3 {
  animation: fadeInUp 0.8s ease-out 0.45s forwards;
  opacity: 0;
}

.animate-fade-in-up-delay-4 {
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
  opacity: 0;
}

/* ─── Scroll-triggered animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

#navbar.scrolled {
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #FF6B4A;
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

/* ─── Service Cards ─── */
.service-card {
  border: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  border-color: #FFEDE6;
}

/* ─── Mobile menu ─── */
#mobile-menu {
  animation: fadeIn 0.3s ease;
}

.mobile-link {
  padding: 8px 0;
  border-bottom: 1px solid #E8E8EA;
}

.mobile-link:last-child {
  border-bottom: none;
}

/* ─── Form enhancements ─── */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.15);
}

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

::-webkit-scrollbar-track {
  background: #FFFBF5;
}

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

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

/* ─── Selection color ─── */
::selection {
  background: #FFD5C8;
  color: #3A3A44;
}

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

  section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
