/* ===== Base & Utilities ===== */
*, *::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-color: rgba(61, 163, 114, 0.2);
  color: #0a2342;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f0f4f8;
}
::-webkit-scrollbar-thumb {
  background: #abc2d4;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #81a5c0;
}

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

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

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

#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(10, 35, 66, 0.08);
}

#navbar.scrolled .nav-text {
  color: #0a2342 !important;
}

#navbar.scrolled .nav-icon-fill {
  fill: #0a2342 !important;
}

/* ===== Mobile Menu ===== */
.mobile-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

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

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #63bc8f, #3da372);
  transition: height 0.5s ease;
}

.service-card:hover::before {
  height: 100%;
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Prefers reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }
}

/* ===== Button Hover Effects ===== */
a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ===== Image Loading ===== */
img {
  max-width: 100%;
  height: auto;
}

/* ===== Focus Styles ===== */
:focus-visible {
  outline: 2px solid #3da372;
  outline-offset: 2px;
}

/* ===== Smooth Section Transitions ===== */
section {
  position: relative;
}

/* ===== Form Styles ===== */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 163, 114, 0.15);
}

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

/* ===== Print Styles ===== */
@media print {
  nav, #contactForm, #successMessage, .service-card {
    display: none;
  }
  body {
    color: #000;
    background: #fff;
  }
}
