/* Homepage router cards: standalone styles */
body .page-wrapper .route-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: calc(var(--space-lg) + 0.25rem);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-fast);
}

body .page-wrapper .explore-grid .route-link:nth-child(1) {
  --route-accent: #c14dff;
}

body .page-wrapper .explore-grid .route-link:nth-child(1) .route-tag {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.08)), var(--color-primary);
}

body .page-wrapper .explore-grid .route-link:nth-child(2) {
  --route-accent: #4da3ff;
}

body .page-wrapper .explore-grid .route-link:nth-child(3) {
  --route-accent: #ff9d4d;
}

body .page-wrapper .explore-grid .route-link:nth-child(4) {
  --route-accent: #59c98c;
}

body .page-wrapper .route-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--route-accent), transparent 80%);
  opacity: 0.95;
  pointer-events: none;
}

body .page-wrapper .route-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.09) 50%, transparent 64%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

body .page-wrapper .route-link:hover,
body .page-wrapper .route-link:focus-visible {
  transform: translateY(-4px);
  border-color: var(--route-accent);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--route-accent);
}

body .page-wrapper .route-link:hover::after,
body .page-wrapper .route-link:focus-visible::after {
  transform: translateX(130%);
}

body .page-wrapper .route-link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

body .page-wrapper .route-tag {
  position: absolute;
  top: 0.95rem;
  left: auto;
  right: -2.9rem;
  width: 10.6rem;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.58rem 0.44rem;
  box-sizing: border-box;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  white-space: nowrap;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.05)), var(--route-accent);
  border: 1px solid rgba(255, 255, 255, 0.44);
  transform: rotate(33deg);
  transform-origin: center;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.14);
  opacity: 0.92;
  overflow: hidden;
  isolation: isolate;
  z-index: 2;
  pointer-events: none;
}

body .page-wrapper .route-tag::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -24%;
  width: 56%;
  height: 225%;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28) 46%, rgba(255, 255, 255, 0) 76%);
  transform: rotate(8deg);
  opacity: 0.62;
}

body .page-wrapper .route-tag::after {
  content: "";
  position: absolute;
  left: -35%;
  right: -35%;
  bottom: 1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 34%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.28) 66%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 220% 100%;
  background-position: 100% 0;
  opacity: 0.48;
  pointer-events: none;
  animation: routeTagLineRun 4.6s ease-in-out infinite;
}

body .page-wrapper .route-link h3 {
  font-size: 1.82rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  min-height: calc(1.25em * 2);
}

body .page-wrapper .route-link p {
  font-size: 1.08rem;
  line-height: 1.6;
  margin: 0 0 0.9rem;
}

body .page-wrapper #pathways .route-link .hero-subtitle {
  min-height: calc(1.6em * 2);
}

body .page-wrapper .route-link .explore-icon {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  box-shadow: 0 0 0 1px var(--route-accent), var(--shadow-sm);
  background: rgba(255, 255, 255, 0.08);
}

body .page-wrapper #pathways .explore-grid {
  row-gap: var(--space-lg);
  column-gap: var(--space-lg);
  align-items: stretch;
}

body .page-wrapper .route-link .explore-icon i {
  color: var(--route-accent);
  transition: transform var(--transition-fast);
}

body .page-wrapper .route-link:hover .explore-icon,
body .page-wrapper .route-link:focus-visible .explore-icon {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--route-accent), var(--shadow-md);
}

body .page-wrapper .route-link:hover .explore-icon i,
body .page-wrapper .route-link:focus-visible .explore-icon i {
  transform: scale(1.05);
}

body .page-wrapper .route-bullets {
  margin: 0.5rem 0 var(--space-lg) 1.1rem;
  padding: 6px 0 0;
  text-align: left;
  color: var(--color-text-secondary);
  flex: 1 1 auto;
}

body .page-wrapper .route-bullets li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.55;
  position: relative;
  top: 0;
}

body .page-wrapper .route-link .route-cta-wrap {
  margin-top: auto;
  display: block;
  width: 100%;
}

body .page-wrapper .route-link .btn {
  margin-top: 0;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 1rem 1.2rem;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md, 10px);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  animation: routeCardBtnPulseSoft 1.9s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, box-shadow, filter;
}

/* Home-only tightening: keep breathing room, but reduce excess gap density */
body:not(.business-router-page) .page-wrapper #pathways .explore-grid {
  row-gap: clamp(1rem, 1.9vw, 1.25rem);
  column-gap: clamp(1rem, 1.9vw, 1.25rem);
}

body:not(.business-router-page) .page-wrapper #pathways .route-link {
  padding-top: calc((var(--space-lg) * 0.82) + 0.15rem);
}

body:not(.business-router-page) .page-wrapper #pathways .route-link .explore-icon {
  margin-bottom: 0.82rem;
}

body:not(.business-router-page) .page-wrapper #pathways .route-bullets {
  margin: 0.42rem 0 var(--space-md) 1.1rem;
}

body .page-wrapper .route-link:hover .btn,
body .page-wrapper .route-link:focus-visible .btn {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg, 0 10px 24px rgba(0, 0, 0, 0.25));
  filter: brightness(1.04);
}

body .page-wrapper .route-link:focus-visible .btn {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  body .page-wrapper .route-tag {
    top: 0.85rem;
    left: auto;
    right: -2.65rem;
    width: 10.8rem;
    max-width: none;
    font-size: 0.68rem;
    padding: 0.34rem 0.62rem 0.5rem;
    transform: rotate(30deg);
  }

  body .page-wrapper .route-link h3 {
    font-size: 1.58rem;
    margin: 0 0 0.9rem;
    min-height: calc(1.25em * 2);
  }

  body .page-wrapper .route-link p {
    font-size: 1.03rem;
    line-height: 1.58;
  }

  body .page-wrapper #pathways .route-link .hero-subtitle {
    min-height: calc(1.58em * 2);
  }

  body .page-wrapper .route-bullets li {
    font-size: 0.97rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .page-wrapper .route-link,
  body .page-wrapper .route-link::after,
  body .page-wrapper .route-link .explore-icon,
  body .page-wrapper .route-link .explore-icon i,
  body .page-wrapper .route-link .btn {
    transition: none !important;
    animation: none !important;
  }

  body .page-wrapper .route-tag::after {
    animation: none !important;
  }

  body .page-wrapper .route-link:hover,
  body .page-wrapper .route-link:focus-visible {
    transform: none !important;
  }

  body .page-wrapper .route-link:hover::after,
  body .page-wrapper .route-link:focus-visible::after {
    transform: none !important;
  }
}

@keyframes routeTagLineRun {
  0% {
    background-position: 100% 0;
    opacity: 0.2;
  }

  14% {
    opacity: 0.9;
  }

  50% {
    background-position: 0% 0;
    opacity: 0.95;
  }

  76% {
    opacity: 0.35;
  }

  100% {
    background-position: -15% 0;
    opacity: 0.2;
  }
}

@keyframes routeCardBtnPulseSoft {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 11px rgba(170, 95, 245, 0.13), 0 6px 14px rgba(0, 0, 0, 0.16);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 17px rgba(186, 118, 255, 0.25), 0 9px 20px rgba(0, 0, 0, 0.22);
    filter: brightness(1.032);
  }
}
