/* ==========================================================================
   HealthMarket — Modern Site Animations
   ========================================================================== */

:root {
  --ahi-ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ahi-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ahi-duration: 1.55s;
  --ahi-hero-duration: 1.65s;
}

/* --------------------------------------------------------------------------
   Scroll-reveal base
   -------------------------------------------------------------------------- */

.ahi-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--ahi-duration) var(--ahi-ease-out),
    transform var(--ahi-duration) var(--ahi-ease-out);
  transition-delay: var(--ahi-delay, 0s);
}

.ahi-reveal.ahi-visible {
  opacity: 1;
  transform: translateY(0);
}

.ahi-reveal--fade-up {
  transform: translateY(18px);
}

.ahi-reveal--fade-down {
  transform: translateY(-14px);
}

.ahi-reveal--fade-left {
  transform: translateX(22px);
}

.ahi-reveal--fade-right {
  transform: translateX(-22px);
}

/* --------------------------------------------------------------------------
   Hero — page-load entrance
   -------------------------------------------------------------------------- */

.ahi-hero-load {
  opacity: 0;
  animation: ahiHeroIn var(--ahi-hero-duration) var(--ahi-ease-out) forwards;
  animation-delay: var(--ahi-delay, 0s);
}

@keyframes ahiHeroIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ahi-hero-load--soft {
  animation-name: ahiHeroSoft;
}

@keyframes ahiHeroSoft {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating glow on hero */
.ahi-hero::after {
  animation: ahiGlowPulse 10s ease-in-out infinite alternate;
}

@keyframes ahiGlowPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Home Hero — creative entrance
   -------------------------------------------------------------------------- */

.ahi-hero-bg-glow {
  position: absolute;
  top: 50%;
  left: 52%;
  z-index: 1;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 200, 83, 0.24) 0%, rgba(95, 200, 83, 0.06) 45%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: ahiHeroBgGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.ahi-hero-bg-glow-secondary {
  top: 18%;
  left: 78%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(10, 63, 82, 0.35) 0%, transparent 70%);
  animation-duration: 10s;
  animation-delay: 1.5s;
}

.ahi-hero-grid-overlay {
  animation: ahiHeroGridDrift 24s linear infinite;
}

@keyframes ahiHeroGridDrift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(48px);
  }
}

.ahi-hero-orbit {
  animation: ahiHeroOrbitSpin 18s linear infinite;
}

@keyframes ahiHeroOrbitSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.ahi-hero-summary-card {
  opacity: 0;
  animation: ahiHeroSummaryIn 1.45s var(--ahi-ease-out) forwards;
  animation-delay: 0.75s;
}

.ahi-hero-summary {
  opacity: 1;
  transform: none;
  animation: none;
}

.ahi-hero-summary-card p {
  opacity: 0;
  animation: ahiHeroSummaryText 1.2s var(--ahi-ease-out) forwards;
  animation-delay: 0.95s;
}

@keyframes ahiHeroBgGlow {
  0% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }
}

.ahi-hero-eyebrow {
  opacity: 0;
  animation: ahiEyebrowIn 1.2s var(--ahi-ease-out) forwards;
}

.ahi-hero-eyebrow-text {
  display: inline-block;
}

@keyframes ahiEyebrowIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    letter-spacing: 0.4px;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    letter-spacing: 1.6px;
  }
}

.ahi-hero-line-inner {
  display: block;
  transform: translateY(110%);
  opacity: 0;
  animation: ahiHeroLineReveal 1.35s var(--ahi-ease-out) forwards;
  animation-delay: var(--ahi-line-delay, 0.25s);
}

@keyframes ahiHeroLineReveal {
  0% {
    opacity: 0;
    transform: translateY(110%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ahi-hero-gradient {
  opacity: 0;
  transform: translateY(18px);
  animation:
    ahiHeroWordIn 1.1s var(--ahi-ease-out) forwards,
    ahiGradientShimmer 5s linear infinite;
  animation-delay: var(--ahi-word-delay, 0.6s), calc(var(--ahi-word-delay, 0.6s) + 1.1s);
}

@keyframes ahiHeroWordIn {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ahiGradientShimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.ahi-hero-btn {
  opacity: 0;
  transform: translateY(22px);
  animation: ahiHeroBtnIn 1.1s var(--ahi-ease-out) forwards;
  animation-delay: var(--ahi-btn-delay, 0.85s);
}

@keyframes ahiHeroBtnIn {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ahi-btn-primary.ahi-hero-btn {
  position: relative;
  overflow: hidden;
  background-size: 200% auto;
  animation:
    ahiHeroBtnIn 1.1s var(--ahi-ease-out) forwards,
    ahiBtnGradientShift 6s ease-in-out infinite;
  animation-delay: var(--ahi-btn-delay, 0.85s), calc(var(--ahi-btn-delay, 0.85s) + 1.2s);
}

.ahi-hero .ahi-btn-light.ahi-hero-btn {
  animation:
    ahiHeroBtnIn 1.1s var(--ahi-ease-out) forwards,
    ahiHeroBtnGlow 4s ease-in-out infinite;
  animation-delay: var(--ahi-btn-delay, 0.85s), calc(var(--ahi-btn-delay, 0.85s) + 1.2s);
}

@keyframes ahiHeroBtnGlow {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 16px 36px rgba(255, 255, 255, 0.18);
  }
}

@keyframes ahiBtnGradientShift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}


@keyframes ahiHeroSummaryIn {
  0% {
    opacity: 0;
    transform: translateX(36px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ahiHeroSummaryText {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ahi-hero-visual-wrap {
  opacity: 0;
  transform: translate3d(calc(-42% + var(--ahi-parallax-x, 0px)), 0, 0) scale(0.96);
  animation: ahiHeroVisualIn 1.7s var(--ahi-ease-out) forwards;
  animation-delay: 0.35s;
  transition: transform 0.4s var(--ahi-ease-smooth);
}

.ahi-hero-visual-wrap.ahi-hero-visual-ready {
  transform: translate3d(calc(-42% + var(--ahi-parallax-x, 0px)), 0, 0) scale(1);
}

@keyframes ahiHeroVisualIn {
  0% {
    opacity: 0;
    transform: translate3d(calc(-52% + var(--ahi-parallax-x, 0px)), 0, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(calc(-42% + var(--ahi-parallax-x, 0px)), 0, 0) scale(1);
  }
}

.ahi-hero-visual-wrap .ahi-hero-image {
  animation: ahiHeroImageSway 8s ease-in-out infinite alternate;
  animation-delay: 2s;
  filter:
    drop-shadow(0 28px 56px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 40px rgba(112, 228, 83, 0.12));
}

@keyframes ahiHeroImageSway {
  0% {
    transform: translateX(-10px);
  }
  100% {
    transform: translateX(10px);
  }
}

.ahi-hero-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  border-radius: 50%;
  border: 1px solid rgba(112, 228, 83, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ahi-hero-pulse-1 {
  width: 280px;
  height: 280px;
  animation: ahiNeuralPulse 4s ease-out infinite;
}

.ahi-hero-pulse-2 {
  width: 380px;
  height: 380px;
  animation: ahiNeuralPulse 4s ease-out infinite 1.3s;
}

.ahi-hero-pulse-3 {
  width: 480px;
  height: 480px;
  border-color: rgba(10, 63, 82, 0.25);
  animation: ahiNeuralPulse 4s ease-out infinite 2.6s;
}

@keyframes ahiNeuralPulse {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.88);
  }
  70% {
    opacity: 0.15;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.12);
  }
}

/* --------------------------------------------------------------------------
   Header — scroll state
   -------------------------------------------------------------------------- */

.ahi-header {
  transition:
    background 0.5s var(--ahi-ease-smooth),
    backdrop-filter 0.5s var(--ahi-ease-smooth),
    box-shadow 0.5s var(--ahi-ease-smooth);
}

.ahi-header.ahi-header-scrolled {
  background: rgba(21, 22, 23, 0.98);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

.ahi-header.ahi-header-scrolled .ahi-navbar {
  min-height: 80px;
  padding-top: 12px;
}

.ahi-header.ahi-header-scrolled .ahi-nav {
  padding-top: 12px;
}

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

.ahi-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--ahi-green, #59ee4f);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ahi-ease-out);
}

.ahi-nav .nav-link:hover::after,
.ahi-nav .nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Buttons & interactive elements
   -------------------------------------------------------------------------- */

.ahi-btn {
  transition:
    transform 0.35s var(--ahi-ease-smooth),
    box-shadow 0.35s var(--ahi-ease-smooth),
    background 0.35s var(--ahi-ease-smooth),
    border-color 0.35s var(--ahi-ease-smooth),
    color 0.35s var(--ahi-ease-smooth) !important;
}

.ahi-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(89, 238, 79, 0.15);
}

.ahi-btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Stats — floating badges
   -------------------------------------------------------------------------- */

@keyframes ahiBadgeFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.ahi-stat-badge {
  transition:
    transform 0.4s var(--ahi-ease-smooth),
    box-shadow 0.4s var(--ahi-ease-smooth),
    border-color 0.35s var(--ahi-ease-smooth),
    background 0.35s var(--ahi-ease-smooth);
}

.ahi-stat-badge-wrap.ahi-reveal {
  transform: scale(0.94);
}

.ahi-stat-badge-wrap.ahi-reveal.ahi-visible {
  transform: scale(1);
}

.ahi-stat-badge-wrap:hover .ahi-stat-badge {
  border-color: rgba(112, 228, 83, 0.55);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 255, 236, 0.96) 100%);
  box-shadow:
    0 16px 40px rgba(112, 228, 83, 0.22),
    0 4px 14px rgba(10, 63, 82, 0.08),
    0 0 0 1px rgba(112, 228, 83, 0.3);
  transform: translateY(-5px);
  animation-play-state: paused;
}

.ahi-stat-badge-wrap:hover .ahi-stat-badge strong,
.ahi-stat-badge-wrap:hover .ahi-stat-badge .ahi-stat-green {
  background: linear-gradient(90deg, #0A3F52 0%, #70E453 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ahi-stat-badge-wrap:hover .ahi-stat-badge p {
  color: #3d9a4a;
}

@keyframes ahiFeatureShine {
  0%,
  72% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

/* --------------------------------------------------------------------------
   Feature cards — modern hover
   -------------------------------------------------------------------------- */

.ahi-feature-card:not(.ahi-feature-card-active):hover {
  transform: translateY(-6px);
  border-color: rgba(112, 228, 83, 0.45);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99) 0%, rgba(240, 255, 236, 0.94) 100%);
  box-shadow:
    0 18px 44px rgba(112, 228, 83, 0.18),
    0 6px 18px rgba(10, 63, 82, 0.08),
    0 0 0 1px rgba(112, 228, 83, 0.22);
}

.ahi-feature-card:not(.ahi-feature-card-active):hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.ahi-feature-card:not(.ahi-feature-card-active):hover .ahi-feature-card-icon {
  transform: scale(1.06);
  border-color: rgba(112, 228, 83, 0.35);
  background: linear-gradient(135deg, rgba(10, 63, 82, 0.1) 0%, rgba(112, 228, 83, 0.28) 100%);
  box-shadow: 0 6px 16px rgba(112, 228, 83, 0.2);
}

.ahi-feature-card:not(.ahi-feature-card-active):hover .svg_icon {
  transform: scale(1.05);
}

.ahi-feature-card:not(.ahi-feature-card-active):hover h3 {
  background: linear-gradient(90deg, #0A3F52 0%, #3d9a4a 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ahi-feature-card:not(.ahi-feature-card-active):hover p {
  color: rgba(10, 63, 82, 0.72);
}

.ahi-feature-card-active:hover {
  transform: translateY(-5px);
  box-shadow:
    0 26px 56px rgba(10, 63, 82, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.ahi-feature-card-active:hover .ahi-feature-card-icon {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.22);
}

.ahi-difference-visual:hover::before {
  opacity: 0.65;
}

.ahi-difference-visual:hover img {
  transform: scale(1.02);
  box-shadow:
    0 28px 64px rgba(10, 63, 82, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   Signal cards — modern hover
   -------------------------------------------------------------------------- */

.ahi-signal-card:hover {
  transform: translateY(-6px);
  border-color: rgba(112, 228, 83, 0.45);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99) 0%, rgba(240, 255, 236, 0.94) 100%);
  box-shadow:
    0 18px 44px rgba(112, 228, 83, 0.18),
    0 6px 18px rgba(10, 63, 82, 0.08),
    0 0 0 1px rgba(112, 228, 83, 0.22);
}

.ahi-signal-card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.ahi-signal-card:hover .ahi-signal-icon {
  transform: scale(1.06);
  border-color: rgba(112, 228, 83, 0.4);
  background: linear-gradient(135deg, rgba(10, 63, 82, 0.1) 0%, rgba(112, 228, 83, 0.28) 100%);
  box-shadow: 0 6px 16px rgba(112, 228, 83, 0.2);
}

.ahi-signal-card:hover .ahi-signal-icon .feature_icon,
.ahi-signal-card:hover .ahi-signal-icon img {
  transform: scale(1.05);
}

.ahi-signal-card:hover h3 {
  background: linear-gradient(90deg, #0A3F52 0%, #3d9a4a 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ahi-signal-card:hover p {
  color: rgba(10, 63, 82, 0.72);
}

/* --------------------------------------------------------------------------
   Process cards — animated gradient border
   -------------------------------------------------------------------------- */

@keyframes ahiProcessBorderRotate {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.ahi-process-card:hover::before {
  animation-duration: 2.8s;
}

/* --------------------------------------------------------------------------
   Cards — hover lift
   -------------------------------------------------------------------------- */

.ahi-feature-card,
.ahi-process-card,
.ahi-decision-cell,
.ahi-principles-card,
.ahi-layer-card,
.ahi-alert-card,
.ahi-trust-item,
.gov-card,
.ahi-indicator-cell,
.partners-grid-item,
.pg-pillar-card,
.dst-practice-card,
.ahi-confidence-card,
.gov-ethics-item {
  transition:
    transform 0.4s var(--ahi-ease-smooth),
    box-shadow 0.4s var(--ahi-ease-smooth),
    border-color 0.35s var(--ahi-ease-smooth);
}

.ahi-process-card:hover,
.ahi-decision-cell:hover,
.ahi-principles-card:hover,
.ahi-layer-card:hover,
.ahi-alert-card:hover,
.ahi-trust-item:hover,
.gov-card:hover,
.ahi-indicator-cell:hover,
.partners-grid-item:hover,
.pg-pillar-card:hover,
.dst-practice-card:hover,
.ahi-confidence-card:hover,
.gov-ethics-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* Section kicker line draw */
.ahi-section-kicker span,
.pg-section-kicker span,
.dst-section-kicker span {
  transform-origin: left center;
  transition: transform 1.25s var(--ahi-ease-out);
}

.ahi-section-kicker:not(.ahi-visible) span,
.pg-section-kicker:not(.ahi-visible) span,
.dst-section-kicker:not(.ahi-visible) span {
  transform: scaleX(0);
}

.ahi-section-kicker.ahi-visible span,
.pg-section-kicker.ahi-visible span,
.dst-section-kicker.ahi-visible span {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Counter & progress animations
   -------------------------------------------------------------------------- */

.ahi-counter-animate {
  display: inline-block;
}

.ahi-rosew-stress-bar-fill,
.ahi-scoring-segment {
  transition: width 2s var(--ahi-ease-out);
}

.ahi-rosew-stress-bar-fill.ahi-bar-animate {
  width: 0 !important;
}

.ahi-rosew-stress-bar-fill.ahi-bar-visible {
  width: var(--ahi-bar-target, 0%) !important;
}

/* --------------------------------------------------------------------------
   Images
   -------------------------------------------------------------------------- */

.ahi-difference-visual img,
.ahi-trust-image,
.gov-structure-visual img,
.pg-intro-visual img,
.dst-section-visual img {
  transition: opacity var(--ahi-duration) var(--ahi-ease-out), transform var(--ahi-duration) var(--ahi-ease-out);
}

.pg-intro-visual:hover img,
.dst-section-visual:hover img {
  transform: scale(1.02);
}

/* Footer links */
.ahi-footer-col a,
.ahi-footer-social-link,
.ahi-footer-email {
  transition: color 0.3s var(--ahi-ease-smooth), opacity 0.3s var(--ahi-ease-smooth);
}

.ahi-footer-col a:hover,
.ahi-footer-social-link:hover,
.ahi-footer-email:hover {
  opacity: 0.8;
}

/* Partner logos */
.partners-grid-item img {
  transition: transform 0.4s var(--ahi-ease-smooth), filter 0.4s var(--ahi-ease-smooth);
  filter: grayscale(20%);
}

.partners-grid-item:hover img {
  transform: scale(1.03);
  filter: grayscale(0%);
}

@media only screen and (max-width: 991.98px) {
  .ahi-stat-badge {
    animation-duration: 7s;
  }

  .ahi-hero-pulse,
  .ahi-hero-bg-glow {
    display: none;
  }

  .ahi-hero-visual-wrap {
    transform: none !important;
  }

  .ahi-hero-visual-wrap .ahi-hero-image {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ahi-reveal,
  .ahi-stat-badge,
  .ahi-stat-badge-wrap.ahi-reveal,
  .ahi-hero-load,
  .ahi-hero::after,
  .ahi-hero-bg-glow,
  .ahi-hero-eyebrow,
  .ahi-hero-line-inner,
  .ahi-hero-gradient,
  .ahi-hero-btn,
  .ahi-hero-summary,
  .ahi-hero-summary p,
  .ahi-hero-visual-wrap,
  .ahi-hero-visual-wrap .ahi-hero-image,
  .ahi-hero-pulse {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .ahi-feature-card-active::after {
    animation: none !important;
  }

  .ahi-process-card::before {
    animation: none !important;
    transform: translate(-50%, -50%) rotate(45deg) !important;
  }

  .ahi-btn:hover,
  .ahi-feature-card:not(.ahi-feature-card-active):hover,
  .ahi-feature-card-active:hover,
  .ahi-signal-card:hover,
  .ahi-process-card:hover,
  .ahi-signal-card:hover,
  .ahi-decision-cell:hover,
  .ahi-principles-card:hover,
  .ahi-layer-card:hover,
  .ahi-alert-card:hover,
  .ahi-trust-item:hover,
  .gov-card:hover,
  .partners-grid-item:hover,
  .pg-pillar-card:hover,
  .dst-practice-card:hover {
    transform: none;
  }
}
