/* Miller Regional Heart Center — Custom Styles */

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

body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: rgba(52, 212, 181, 0.2);
  color: #d5f5e8;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #060e1a;
}
::-webkit-scrollbar-thumb {
  background: #2e4874;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #34D4B5;
}

/* Nav transitions */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #34D4B5;
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* Navbar scroll state */
.nav-scrolled {
  background: rgba(3, 8, 16, 0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(46, 72, 116, 0.3);
}

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

/* Menu button animation */
.menu-open .menu-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.menu-open .menu-line:nth-child(2) {
  opacity: 0;
}
.menu-open .menu-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
  width: 1.5rem;
}

/* Mobile links */
.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s 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; }

/* Service card hover */
.service-card {
  transition: background-color 0.5s ease;
}

/* Scroll reveal animations — progressive enhancement */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered reveal delays */
.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; }

/* Pulse animation for heartbeat icon */
@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.logo-pulse {
  animation: pulse-heart 3s ease-in-out infinite;
}

/* EKG line decoration */
@keyframes ekf-draw {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

.ekg-line {
  stroke-dasharray: 1000;
  animation: ekg-draw 3s linear infinite;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid rgba(52, 212, 181, 0.5);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .font-serif {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }
}
