/* =========================================================
   Helora Advanced UI — inspired by modern 21st.dev patterns
   Shimmer buttons, hero beams, sticky scroll, progress.
   ========================================================= */

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  box-shadow: 0 0 18px rgba(31, 168, 166, 0.45);
  pointer-events: none;
}

/* Button motion lives in assets/css/button.css */

/* ---------- Advanced hero ---------- */
.hero-advanced {
  position: relative;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.72;
  mix-blend-mode: screen;
}

.hero-beams {
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 30%, rgba(31, 168, 166, 0.28), transparent 70%),
    radial-gradient(35% 40% at 80% 20%, rgba(242, 166, 90, 0.22), transparent 70%),
    radial-gradient(50% 40% at 60% 80%, rgba(14, 124, 123, 0.18), transparent 70%);
  filter: blur(12px);
  animation: beam-drift 12s ease-in-out infinite alternate;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 40% 40%, #000 20%, transparent 75%);
}

.hero-advanced .hero-slider { z-index: 1; }
.hero-advanced .hero-overlay { z-index: 3; }
.hero-advanced .hero-content { z-index: 4; }
.hero-advanced .hero-controls { z-index: 5; }

.hero-advanced .hero-brand {
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.hero-advanced .hero-title em {
  position: relative;
  display: inline-block;
}

.hero-advanced .hero-title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.22em;
  background: linear-gradient(90deg, transparent, rgba(242, 166, 90, 0.55), transparent);
  z-index: -1;
  border-radius: 999px;
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

.hero.is-ready .hero-title em::after {
  transform: scaleX(1);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.scroll-hint-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent);
  animation: scroll-line 1.8s ease-in-out infinite;
}

@keyframes beam-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); }
}

@keyframes scroll-line {
  0% { transform: scaleY(0.35); transform-origin: top; opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.35); transform-origin: bottom; opacity: 0.3; }
}

/* ---------- Sticky journey scroll ---------- */
.journey {
  position: relative;
  background:
    radial-gradient(700px 400px at 10% 20%, rgba(31, 168, 166, 0.12), transparent 60%),
    radial-gradient(600px 360px at 90% 10%, rgba(242, 166, 90, 0.12), transparent 55%),
    linear-gradient(180deg, #f7fbfc 0%, #ffffff 50%, #f3f7f8 100%);
}

.journey-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: start;
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.journey-sticky {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  align-self: start;
}

.journey-sticky h2 {
  margin: 0.6rem 0 1rem;
}

.journey-progress {
  margin-top: 1.5rem;
  height: 4px;
  border-radius: 99px;
  background: rgba(14, 124, 123, 0.12);
  overflow: hidden;
}

.journey-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.25s ease;
}

.journey-steps {
  display: grid;
  gap: 1.1rem;
  padding-bottom: 2rem;
}

.journey-step {
  position: relative;
  padding: 1.4rem 1.4rem 1.4rem 1.5rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(18, 26, 31, 0.04);
  opacity: 0.45;
  transform: translateY(24px) scale(0.98);
  filter: blur(1px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.journey-step.is-active {
  opacity: 1;
  transform: none;
  filter: blur(0);
  border-color: rgba(31, 168, 166, 0.35);
  box-shadow: 0 22px 50px rgba(14, 124, 123, 0.12);
}

.journey-step-num {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 0.55rem;
}

.journey-step h3 {
  margin-bottom: 0.45rem;
}

/* ---------- Horizontal scroll rail ---------- */
.rail-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  overflow: hidden;
}

.rail-head {
  width: min(100% - 2.5rem, var(--container));
  margin: 0 auto 1.5rem;
}

.rail-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.5rem 0 1.5rem;
}

.rail-viewport::-webkit-scrollbar { display: none; }

.rail-track {
  display: flex;
  gap: 1.1rem;
  width: max-content;
  padding-inline: max(1.25rem, calc((100vw - var(--container)) / 2));
}

.rail-card {
  width: min(78vw, 340px);
  min-height: 280px;
  scroll-snap-align: start;
  border-radius: 24px;
  padding: 1.4rem;
  color: #fff;
  display: grid;
  align-content: end;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 15%, rgba(10, 28, 32, 0.82) 100%);
  z-index: 1;
}

.rail-card > * { position: relative; z-index: 2; }

.rail-card:hover { transform: translateY(-8px) scale(1.02); }

.rail-card:nth-child(1) { background-image: linear-gradient(160deg, rgba(14,124,123,0.88), rgba(10,36,38,0.9)), url("../images/hero/consult.webp"); background-size: cover; background-position: center; }
.rail-card:nth-child(2) { background-image: linear-gradient(160deg, rgba(217,137,58,0.88), rgba(10,36,38,0.9)), url("../images/services/lab.webp"); background-size: cover; background-position: center; }
.rail-card:nth-child(3) { background-image: linear-gradient(160deg, rgba(20,110,122,0.88), rgba(10,36,38,0.9)), url("../images/services/imaging.webp"); background-size: cover; background-position: center; }
.rail-card:nth-child(4) { background-image: linear-gradient(160deg, rgba(36,52,58,0.88), rgba(10,36,38,0.9)), url("../images/services/urgent.webp"); background-size: cover; background-position: center; }
.rail-card:nth-child(5) { background-image: linear-gradient(160deg, rgba(14,124,123,0.88), rgba(10,36,38,0.9)), url("../images/services/inpatient.webp"); background-size: cover; background-position: center; }
.rail-card:nth-child(6) { background-image: linear-gradient(160deg, rgba(242,166,90,0.85), rgba(10,36,38,0.9)), url("../images/services/virtual.webp"); background-size: cover; background-position: center; }

.rail-card p { color: rgba(255, 255, 255, 0.88); }

.rail-card .icon {
  width: 36px;
  height: 36px;
  color: #fff;
  margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
  .journey-inner { grid-template-columns: 1fr; }
  .journey-sticky { position: relative; top: 0; }
  .hero-canvas { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-beams,
  .scroll-hint-line {
    animation: none !important;
  }
}
