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

body {
  overflow-x: hidden;
}

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

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

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

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

/* Navbar scroll state */
.navbar-scrolled {
  background: rgba(254, 253, 249, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

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

#menuBtn[aria-expanded="true"] .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.4rem;
}

.mobile-menu-open {
  opacity: 1 !important;
  pointer-events: all !important;
}

.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.35s 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; }

/* ===== Hero Animations ===== */
.hero-anim {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-anim:nth-child(1) { transition-delay: 0.1s; }
.hero-anim:nth-child(2) { transition-delay: 0.25s; }
.hero-anim:nth-child(3) { transition-delay: 0.4s; }
.hero-anim:nth-child(4) { transition-delay: 0.55s; }
.hero-anim:nth-child(5) { transition-delay: 0.7s; }

/* ===== Reveal on Scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.15s; }
.reveal:nth-child(4) { transition-delay: 0.2s; }
.reveal:nth-child(5) { transition-delay: 0.25s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }

/* ===== Service Cards ===== */
.group:hover .group-hover\:-rotate-3 {
  transform: rotate(-3deg);
}

/* ===== Form Focus States ===== */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

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

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

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

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

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

  .hero-anim {
    opacity: 1;
    transform: none;
  }
}
