/* Williams Home Care — Custom Styles */

/* Base & Typography */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a1628;
}
::-webkit-scrollbar-thumb {
  background: #1a3d6e;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #24548f;
}

/* Selection */
::selection {
  background: rgba(45, 212, 164, 0.2);
  color: #f0fdf9;
}

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

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2dd4a4, transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.service-card:hover::before {
  opacity: 1;
}

/* Testimonial Cards */
.testimonial-card {
  position: relative;
}

.testimonial-card::after {
  content: '"';
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 6rem;
  font-weight: 700;
  color: rgba(45, 212, 164, 0.05);
  line-height: 1;
  pointer-events: none;
}

/* Navbar Transition */
#navbar.scrolled {
  background: rgba(6, 13, 31, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Menu Animations */
.mobile-menu-open .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.mobile-menu-open .menu-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-open .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
  width: 5rem;
  margin-left: 0;
  margin-right: 0;
}

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

/* Scroll Reveal Animations */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }
.reveal[data-delay="6"] { transition-delay: 0.6s; }

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

/* 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='%232dd4a4' stroke-width='2' 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 !important;
}

/* Button focus states */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #2dd4a4;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Input focus states */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* Hero underline animation */
@keyframes underline-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-underline svg {
  transform-origin: left;
  animation: underline-draw 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

/* Floating card animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

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

/* Pulse for CTA */
@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 164, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(45, 212, 164, 0); }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .font-serif {
    line-height: 1.15;
  }
}
