/* ===== Custom Styles for Hong Wei Medical Group ===== */

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.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; }

/* --- Hero Decorative Shapes --- */
.hero-shape {
  position: absolute;
  pointer-events: none;
}

.shape-circle-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  top: -200px;
  right: -100px;
  animation: float-slow 20s ease-in-out infinite;
}

.shape-circle-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(6, 95, 70, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  bottom: 10%;
  left: 5%;
  animation: float-slow 15s ease-in-out infinite reverse;
}

.shape-rect-1 {
  width: 120px;
  height: 120px;
  background: rgba(110, 231, 183, 0.08);
  border-radius: 24px;
  top: 25%;
  right: 3%;
  transform: rotate(45deg);
  animation: float-slow 12s ease-in-out infinite;
}

.shape-rect-2 {
  width: 60px;
  height: 60px;
  background: rgba(6, 158, 105, 0.08);
  border-radius: 12px;
  bottom: 20%;
  left: 10%;
  transform: rotate(20deg);
  animation: float-slow 10s ease-in-out infinite reverse;
}

.shape-dots {
  width: 200px;
  height: 200px;
  top: 15%;
  left: 48%;
  background-image: radial-gradient(circle, rgba(6, 95, 70, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: float-slow 18s ease-in-out infinite;
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-20px) rotate(45deg); }
}

.shape-rect-2 {
  animation-name: float-rect2;
}

@keyframes float-rect2 {
  0%, 100% { transform: translateY(0) rotate(20deg); }
  50% { transform: translateY(-15px) rotate(25deg); }
}

/* --- Header Scroll State --- */
#site-header.scrolled {
  background: rgba(254, 253, 248, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(6, 95, 70, 0.08);
}

/* --- Service Card Tilt on Hover --- */
.service-card {
  transform: translateY(0);
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* --- Clip Diagonal --- */
.clip-diagonal {
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
}

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

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

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

/* --- Mobile Menu --- */
#mobile-menu {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-link {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid rgba(6, 95, 70, 0.08);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-nav-link:hover {
  color: #059669;
  padding-left: 8px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-shape,
  .service-card,
  .nav-link::after {
    transition: none;
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .clip-diagonal {
    clip-path: none;
  }

  .shape-circle-1 {
    width: 300px;
    height: 300px;
  }

  .shape-circle-2 {
    width: 150px;
    height: 150px;
  }

  .shape-rect-1 {
    width: 60px;
    height: 60px;
  }

  .shape-dots {
    width: 100px;
    height: 100px;
  }
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background: rgba(16, 185, 129, 0.2);
  color: #064e3b;
}
