/* ============================================
   Miller's Well Drilling — Custom Styles
   ============================================ */

/* ---- Base / Reset ---- */
*, *::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: #1B4332;
  color: #FDFCF8;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FDFCF8;
}
::-webkit-scrollbar-thumb {
  background: #82ba8a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #1B4332;
}

/* ---- Header ---- */
#site-header {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
  background-color: rgba(253, 252, 248, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(27, 67, 50, 0.08);
}

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

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

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

/* ---- Mobile Menu ---- */
#mobile-menu.open {
  transform: translateX(0);
}

.menu-line:first-child {
  transform-origin: center;
}

#mobile-menu.open .menu-line:first-child {
  transform: translateY(5px) rotate(45deg);
}

#mobile-menu.open .menu-line:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

#mobile-menu.open .menu-line:nth-child(2) {
  opacity: 0;
}

.mobile-nav-link {
  position: relative;
}

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

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1B4332, #539d61);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

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

/* ---- Testimonial Cards ---- */
.testimonial-card {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(27, 67, 50, 0.12) !important;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 16px;
  right: 24px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 5rem;
  color: #d8e8dc;
  line-height: 1;
  pointer-events: none;
}

/* ---- Scroll Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  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; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
  
  .service-card::before {
    transform: scaleX(1);
  }
  
  .testimonial-card {
    transform: none;
  }
  
  .testimonial-card:hover {
    transform: none;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* ---- Form Select Arrow ---- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231B4332' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ---- Print ---- */
@media print {
  #site-header,
  #mobile-menu {
    display: none;
  }
  
  body {
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
  }
}
