/* Base & utilities */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background: #C4775B;
  color: #fff;
}

/* Animation keyframes */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scroll-triggered animation classes */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.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; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Service card hover */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #C4775B, #E8D0B4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* Navbar scroll state */
.navbar-scrolled {
  background: rgba(253, 249, 245, 0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(196, 119, 91, 0.08), 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Mobile menu transitions */
.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s ease;
}

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

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

/* Hamburger animation */
.menu-open #bar1 {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-open #bar2 {
  opacity: 0;
}

.menu-open #bar3 {
  transform: rotate(-45deg) translate(4px, -4px);
  width: 1.25rem;
}

/* Smooth image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #C4775B;
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

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

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

/* Parallax-like subtle image zoom on hover */
.service-card .group-hover\:scale-105 {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hero text gradient */
.hero-gradient {
  background: linear-gradient(135deg, #4A2B22 0%, #8F4C37 50%, #C4775B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Decorative line animation */
.deco-line {
  position: relative;
}

.deco-line::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #C4775B, transparent);
}

/* Floating animation for decorative elements */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

.float-medium {
  animation: float 4s ease-in-out infinite;
}

/* Pulse for CTA buttons */
@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 119, 91, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(196, 119, 91, 0); }
}

.pulse-cta {
  animation: pulse-soft 3s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .reveal {
    transform: translateY(24px);
  }
}

@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;
  }
}
