.journey-story {
  --journey-cyan: #31ded0;
  --journey-blue: #6f96ff;
  --journey-coral: #ee7188;
  --journey-green: #77dea0;
  --journey-panel: rgba(10, 27, 45, .78);
  position: relative;
  isolation: isolate;
  overflow: clip;
  overflow-anchor: none;
  color: #f7fbff;
  background:
    radial-gradient(circle at 78% 42%, rgba(39, 212, 197, .105), transparent 29%),
    radial-gradient(circle at 9% 77%, rgba(93, 141, 255, .10), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #06101d 54%, #081522 100%);
  border-top: 1px solid rgba(255, 255, 255, .07);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.journey-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .28;
  background-image:
    linear-gradient(rgba(130, 164, 204, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 164, 204, .05) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 84%, transparent);
}

.journey-atmosphere {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(93, 141, 255, .13);
  border-radius: 50%;
  pointer-events: none;
}

.journey-atmosphere::before,
.journey-atmosphere::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: inherit;
  border-radius: inherit;
}

.journey-atmosphere::after { inset: 27%; }
.journey-atmosphere-one { width: 650px; height: 650px; top: -315px; right: -190px; }
.journey-atmosphere-two { width: 520px; height: 520px; bottom: -260px; left: -215px; border-color: rgba(39, 212, 197, .09); }

.journey-scroll { position: relative; }
.journey-stage { position: relative; min-height: 100svh; padding: 98px 0 42px; overflow: hidden; overflow-anchor: none; }

@media (min-width: 901px) {
  .journey-scroll { min-height: calc(100svh + 4700px); }
  .journey-stage { position: sticky; top: 0; }
}

@media (min-width: 761px) and (max-width: 900px) {
  .journey-scroll { min-height: calc(100svh + 3200px); }
  .journey-stage { position: sticky; top: 0; }
}

.journey-progress {
  position: absolute;
  z-index: 7;
  top: 26px;
  left: 50%;
  display: grid;
  grid-template-columns: auto minmax(140px, 390px) auto;
  align-items: center;
  gap: 17px;
  width: min(1160px, calc(100% - 40px));
  transform: translateX(-50%);
  color: rgba(222, 235, 246, .48);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.journey-progress-track { height: 1px; overflow: hidden; background: rgba(142, 170, 205, .2); }
.journey-progress-track i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--journey-cyan), var(--journey-blue)); transform: scaleX(.04); transform-origin: left; }
.journey-progress-count b { color: var(--journey-cyan); font-size: 12px; }

.journey-layout {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(600px, 1.55fr);
  gap: clamp(34px, 5vw, 78px);
  align-items: center;
  min-height: calc(100svh - 140px);
}

.journey-copy-stack { position: relative; min-height: 590px; }
.journey-scene-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(26px);
  pointer-events: none;
}

.journey-scene-copy.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.journey-kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 23px; color: #91a7bd; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.journey-kicker::before { content: ""; width: 27px; height: 1px; background: var(--journey-cyan); box-shadow: 0 0 12px rgba(49, 222, 208, .65); }
.journey-kicker span { color: var(--journey-cyan); font-size: 13px; letter-spacing: .05em; }
.journey-scene-copy h2 { max-width: 470px; margin: 0 0 22px; font-size: clamp(37px, 4.15vw, 61px); line-height: 1.02; letter-spacing: -.055em; }
.journey-scene-copy h2 em { color: var(--journey-blue); font-style: normal; }
.journey-scene-copy > p:not(.journey-kicker) { max-width: 450px; margin: 0; color: #9fb2c5; font-size: 16px; line-height: 1.68; }

.journey-insight {
  max-width: 390px;
  margin-top: 30px;
  padding: 17px 19px 17px 21px;
  border: 1px solid rgba(82, 207, 205, .2);
  border-left: 2px solid var(--journey-cyan);
  border-radius: 0 13px 13px 0;
  background: linear-gradient(90deg, rgba(39, 212, 197, .095), rgba(39, 212, 197, .018));
}
.journey-insight span { display: block; margin-bottom: 7px; color: var(--journey-cyan); font-size: 9px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.journey-insight p { margin: 0; color: #c4d3df; font-size: 13px; line-height: 1.55; }
.journey-insight-signal { border-color: rgba(111, 150, 255, .22); border-left-color: var(--journey-blue); background: linear-gradient(90deg, rgba(93, 141, 255, .10), rgba(93, 141, 255, .018)); }
.journey-insight-signal span { color: #96b0ff; }

.journey-legend { display: flex; flex-wrap: wrap; gap: 10px 17px; margin-top: 29px; color: #a8bac9; font-size: 10px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.journey-legend span { display: inline-flex; align-items: center; gap: 7px; }
.journey-legend i { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 255, 255, .035); }
.legend-forward { background: var(--journey-cyan); }
.legend-friction { background: var(--journey-coral); }
.legend-recovery { background: var(--journey-green); }

.journey-metric { display: flex; align-items: center; gap: 16px; width: fit-content; margin-top: 29px; padding-top: 21px; border-top: 1px solid rgba(255, 255, 255, .12); }
.journey-metric strong { color: var(--journey-cyan); font-size: 34px; line-height: 1; letter-spacing: -.045em; text-shadow: 0 0 25px rgba(49, 222, 208, .22); }
.journey-metric span { color: #8499ae; font-size: 9px; font-weight: 750; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; }

.journey-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(118, 155, 202, .18);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(18, 43, 69, .74), rgba(7, 19, 32, .88)),
    radial-gradient(circle at 65% 50%, rgba(49, 222, 208, .07), transparent 42%);
  box-shadow: 0 34px 95px rgba(0, 4, 10, .34), inset 0 1px 0 rgba(255, 255, 255, .035);
}

.journey-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, .025), transparent 28%, transparent 72%, rgba(39, 212, 197, .018));
}

.journey-visual-topline { position: absolute; z-index: 8; inset: 14px 18px auto 23px; display: flex; align-items: center; justify-content: space-between; color: #8195ab; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.journey-visual-topline span:first-child { color: var(--journey-cyan); }
.journey-visual-actions { display: flex; align-items: center; gap: 11px; }
.journey-visual-narrative {
  position: absolute;
  z-index: 6;
  top: 55px;
  left: 50%;
  width: min(650px, calc(100% - 96px));
  min-height: 58px;
  transform: translateX(-50%);
  pointer-events: none;
}
.journey-visual-copy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .28em;
  margin: 0;
  padding: 7px 12px 13px;
  opacity: 0;
  overflow: visible;
  clip-path: inset(-6px 100% -12px -6px);
  color: #d7e5ef;
  font-size: clamp(12px, 1.22vw, 16px);
  line-height: 1.5;
  letter-spacing: -.01em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 16px rgba(4, 12, 22, .84), 0 0 32px rgba(4, 12, 22, .55);
  transform: translateY(5px);
  transition: opacity .28s ease, transform .42s ease, clip-path .62s cubic-bezier(.2, .8, .2, 1);
}
.journey-visual-copy span { color: #b7cad8; font-weight: 560; }
.journey-visual-copy strong { color: #f4fffd; font-weight: 760; }
.journey-visual-copy strong::after { content: ""; display: inline-block; width: 18px; height: 1px; margin: 0 0 .25em 10px; background: linear-gradient(90deg, var(--journey-cyan), transparent); }
.journey-visual-copy.is-active { opacity: 1; clip-path: inset(-6px 0 -12px -6px); transform: translateY(0); }
.journey-svg { width: 100%; height: auto; aspect-ratio: 1.58; overflow: visible; }

.journey-orbits { fill: none; stroke: rgba(121, 159, 202, .11); stroke-width: 1; }
.journey-orbits path { stroke-dasharray: 2 11; }
.journey-route-base { fill: none; stroke: rgba(137, 173, 211, .22); stroke-width: 1.3; }
.journey-route-progress { fill: none; stroke: url(#journeyLineGradient); stroke-width: 2; stroke-linecap: round; filter: url(#journeyGlow); }
.primary-patient-halo { fill: rgba(49, 222, 208, .12); stroke: rgba(49, 222, 208, .42); stroke-width: 1; }
.primary-patient { fill: #e9fffd; stroke: var(--journey-cyan); stroke-width: 2; filter: url(#journeyGlow); }

.journey-node circle { fill: url(#journeyNodeFill); stroke: rgba(69, 210, 205, .62); stroke-width: 1.2; }
.journey-node path { fill: none; stroke: #d8f9f6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.journey-node text { fill: #c7d7e4; font-size: 9px; font-weight: 800; letter-spacing: .065em; text-anchor: middle; }

.journey-branch { fill: none; stroke-width: 1.2; stroke-linecap: round; opacity: 0; }
.branch-teal { stroke: rgba(49, 222, 208, .72); }
.branch-blue { stroke: rgba(111, 150, 255, .75); }
.branch-friction { stroke: rgba(238, 113, 136, .82); stroke-dasharray: 4 5; }
.branch-recovery { stroke: rgba(119, 222, 160, .82); stroke-dasharray: 3 5; }
.branch-label { opacity: 0; }
.branch-label circle { fill: var(--journey-cyan); }
.branch-label text { fill: #a9bdcd; font-size: 8px; font-weight: 750; letter-spacing: .055em; }
.branch-label-denial circle,
.branch-label-dropout circle { fill: var(--journey-coral); }
.route-patient { fill: #dffefb; stroke: var(--journey-cyan); stroke-width: 1.6; filter: url(#journeyGlow); opacity: 0; }
.route-patient-denial,
.route-patient-dropout { fill: #fff1f3; stroke: var(--journey-coral); }
.route-patient-restart { fill: #edfff3; stroke: var(--journey-green); }

.network-path { fill: none; stroke: #3d8ed8; stroke-width: .62; stroke-linecap: round; opacity: 0; }
.network-path.path-teal { stroke: #28cbbb; }
.network-path.path-blue { stroke: #4f91f2; }
.network-path.path-friction { stroke: #d7657e; stroke-dasharray: 2 7; }
.network-particle { fill: #7cc9ff; filter: url(#journeyGlow); opacity: 0; }
.network-particle.particle-teal { fill: #46e4d4; }
.network-particle.particle-friction { fill: #f0788f; }

.journey-signal-routes { pointer-events: none; }
.signal-route { fill: none; stroke: url(#journeySignalGradient); stroke-width: 2; stroke-linecap: round; opacity: 0; filter: url(#journeyGlow); }
.signal-route-risk { stroke: var(--journey-coral); stroke-width: 1.55; }
.signal-route-restart { stroke: var(--journey-green); stroke-width: 1.7; }
.signal-core-halo { fill: rgba(49, 222, 208, .08); filter: url(#journeySoftGlow); opacity: 0; }
.signal-core-ring { fill: rgba(7, 20, 33, .9); stroke: var(--journey-cyan); stroke-width: 1.2; opacity: 0; }
.signal-core { fill: #edfffd; stroke: var(--journey-cyan); stroke-width: 2; filter: url(#journeyGlow); opacity: 0; }
.signal-core-label { fill: #a8bdcc; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-anchor: middle; opacity: 0; }

.journey-signal-notes { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.journey-signal-note { position: absolute; min-width: 145px; padding: 10px 12px 10px 27px; opacity: 0; border: 1px solid rgba(111, 150, 255, .26); border-radius: 10px; background: rgba(6, 18, 31, .9); box-shadow: 0 10px 30px rgba(0, 5, 12, .28); }
.journey-signal-note i { position: absolute; width: 7px; height: 7px; left: 11px; top: 15px; border-radius: 50%; background: var(--journey-cyan); box-shadow: 0 0 10px currentColor; }
.journey-signal-note span,
.journey-signal-note strong { display: block; }
.journey-signal-note span { color: #dce9f3; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.journey-signal-note strong { margin-top: 3px; color: #8299ac; font-size: 7px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.signal-note-access { top: 17%; left: 44%; border-color: rgba(238, 113, 136, .36); }
.signal-note-access i,
.signal-note-risk i { background: var(--journey-coral); }
.signal-note-risk { top: 65%; left: 51%; border-color: rgba(238, 113, 136, .3); }
.signal-note-restart { top: 66%; right: 9%; border-color: rgba(119, 222, 160, .3); }
.signal-note-restart i { background: var(--journey-green); }
.signal-note-segment { top: 30%; left: 8%; border-color: rgba(49, 222, 208, .3); }

.journey-controls {
  --scrub-progress: 0%;
  position: absolute;
  z-index: 7;
  left: 22px;
  right: 22px;
  bottom: 13px;
  display: grid;
  overflow-anchor: none;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 47px;
  padding: 7px 10px 6px 8px;
  border: 1px solid rgba(116, 151, 190, .16);
  border-radius: 999px;
  background: rgba(5, 17, 29, .75);
  box-shadow: 0 10px 30px rgba(0, 4, 10, .2), inset 0 1px 0 rgba(255, 255, 255, .025);
  backdrop-filter: blur(14px);
}

.journey-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 78px;
  min-height: 32px;
  padding: 0 12px;
  color: #c7d9e7;
  border: 1px solid rgba(73, 209, 203, .28);
  border-radius: 999px;
  background: rgba(39, 212, 197, .065);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.journey-play:hover,
.journey-play:focus-visible,
.journey-play.is-playing {
  color: #f2fffd;
  border-color: rgba(49, 222, 208, .68);
  background: rgba(39, 212, 197, .13);
  box-shadow: 0 0 22px rgba(39, 212, 197, .08);
}

.journey-play:focus-visible,
.journey-scrubber input:focus-visible { outline: 2px solid #9cb4ff; outline-offset: 3px; }
.journey-play-icon { display: inline-grid; place-items: center; width: 11px; color: var(--journey-cyan); font-size: 9px; line-height: 1; }

.journey-scrubber { min-width: 0; padding-top: 2px; }
.journey-scrubber input {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--journey-cyan) 0 var(--scrub-progress), rgba(132, 165, 201, .23) var(--scrub-progress) 100%) center / 100% 2px no-repeat;
  cursor: ew-resize;
  touch-action: none;
}

.journey-scrubber input::-webkit-slider-runnable-track { height: 18px; background: transparent; }
.journey-scrubber input::-moz-range-track { height: 2px; border: 0; background: transparent; }
.journey-scrubber input::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: 2.5px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #e9fffd;
  border-radius: 50%;
  background: var(--journey-cyan);
  box-shadow: 0 0 0 4px rgba(49, 222, 208, .1), 0 0 15px rgba(49, 222, 208, .5);
}
.journey-scrubber input::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid #e9fffd; border-radius: 50%; background: var(--journey-cyan); box-shadow: 0 0 0 4px rgba(49, 222, 208, .1), 0 0 15px rgba(49, 222, 208, .5); }
.journey-scrubber-scenes { display: flex; justify-content: space-between; padding: 0 1px; margin-top: -2px; color: rgba(170, 192, 209, .42); font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.journey-control-count { min-width: 37px; color: rgba(174, 195, 213, .48); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.journey-control-count b { color: var(--journey-cyan); font-size: 10px; }

.journey-story[data-scene="2"] .journey-visual { border-color: rgba(66, 174, 203, .25); }
.journey-story[data-scene="3"] .journey-visual { border-color: rgba(91, 132, 207, .25); }
.journey-story[data-scene="4"] .journey-visual { border-color: rgba(49, 222, 208, .27); box-shadow: 0 34px 105px rgba(0, 4, 10, .38), 0 0 52px rgba(39, 212, 197, .04), inset 0 1px 0 rgba(255, 255, 255, .04); }

@media (max-width: 1080px) {
  .journey-layout { grid-template-columns: minmax(270px, .7fr) minmax(540px, 1.45fr); gap: 28px; }
  .journey-scene-copy h2 { font-size: clamp(34px, 4vw, 48px); }
  .journey-scene-copy > p:not(.journey-kicker) { font-size: 15px; }
  .journey-signal-note { transform: scale(.88); }
}

@media (max-width: 900px) {
  .journey-stage { min-height: 900px; padding-top: 82px; }
  .journey-layout { grid-template-columns: minmax(250px, .67fr) minmax(440px, 1.33fr); min-height: 760px; }
  .journey-copy-stack { min-height: 520px; }
  .journey-scene-copy h2 { font-size: 35px; }
  .journey-scene-copy > p:not(.journey-kicker) { font-size: 14px; }
  .journey-insight { padding: 14px 15px 14px 17px; }
  .journey-visual-topline { inset: 15px 17px auto; }
  .journey-visual-narrative { top: 48px; width: calc(100% - 52px); }
  .journey-visual-copy { padding-inline: 13px; font-size: 11px; white-space: normal; }
  .journey-signal-note { display: none; }
}

@media (max-width: 760px) {
  .journey-story { overflow: clip; }
  .journey-story::before { background-size: 58px 58px; }
  .journey-scroll { min-height: calc(100svh + 3200px); }
  .journey-stage { position: sticky; top: 0; min-height: 100svh; padding: 70px 0 16px; overflow: hidden; }
  .journey-progress { position: absolute; z-index: 9; top: 50px; left: 14px; right: 14px; display: flex; width: auto; margin: 0; transform: none; }
  .journey-progress-track { flex: 1; }
  .journey-progress-count { display: block; }
  .journey-layout { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(205px, .9fr); gap: 14px; min-height: calc(100svh - 86px); }
  .journey-copy-stack { display: block; order: 2; min-height: 205px; width: 100%; }
  .journey-scene-copy {
    position: absolute;
    inset: 0;
    justify-content: flex-start;
    padding: 0 2px;
    pointer-events: none;
  }
  .journey-scene-copy.is-active { pointer-events: auto; }
  .journey-scene-copy h2 { max-width: none; margin-bottom: 10px; font-size: clamp(28px, 8.4vw, 38px); }
  .journey-scene-copy > p:not(.journey-kicker) { max-width: none; font-size: 14px; line-height: 1.5; }
  .journey-kicker { margin-bottom: 10px; }
  .journey-insight { margin-top: 14px; padding: 12px 14px 12px 16px; }
  .journey-visual { order: 1; width: 100%; border-radius: 21px; }
  .journey-svg { min-height: 0; transform: none; }
  .journey-visual-topline { font-size: 7px; }
  .journey-visual-narrative { top: 50px; width: calc(100% - 34px); }
  .journey-visual-copy { min-height: 58px; padding: 9px 12px 15px; font-size: 10px; line-height: 1.5; }
  .journey-controls { left: 10px; right: 10px; bottom: 9px; display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; gap: 8px; min-height: 42px; padding: 5px 7px 4px 6px; }
  .journey-play { min-width: 68px; min-height: 30px; padding-inline: 9px; font-size: 8px; }
  .journey-control-count { min-width: 31px; font-size: 7px; }
  .journey-scrubber-scenes { display: none; }
  .journey-branch,
  .branch-label,
  .route-patient { opacity: .48; }
  .journey-node text { font-size: 10px; }
}

@media (max-width: 500px) {
  .journey-progress-label { font-size: 8px; }
  .journey-progress { gap: 12px; }
  .journey-scene-copy { padding: 0 2px; }
  .journey-svg { min-height: 0; transform: none; }
  .journey-visual { min-height: 0; }
  .journey-orbits ellipse:first-child { opacity: .45; }
  .branch-label { display: none; }
  .journey-node text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-stage { min-height: 0; padding-block: 96px; }
  .journey-progress { position: static; width: var(--shell); margin: 0 auto 38px; transform: none; }
  .journey-progress-track i { transform: scaleX(1) !important; }
  .journey-progress-count { display: none; }
  .journey-layout { grid-template-columns: 1fr; min-height: 0; }
  .journey-copy-stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; min-height: 0; }
  .journey-scene-copy { position: relative; inset: auto; opacity: 1 !important; transform: none !important; padding: 24px; border: 1px solid rgba(115, 154, 199, .15); border-radius: 20px; background: rgba(10, 27, 45, .62); }
  .journey-scene-copy h2 { font-size: 34px; }
  .journey-visual { max-width: 900px; width: 100%; margin-inline: auto; }
  .journey-branch { opacity: .38 !important; }
  .branch-label { opacity: .55 !important; }
  .journey-signal-note { opacity: .95 !important; }
  .signal-route { opacity: .75 !important; }
  .signal-core-halo,
  .signal-core-ring,
  .signal-core,
  .signal-core-label { opacity: 1 !important; }
  .journey-visual-copy { opacity: 0 !important; clip-path: none !important; transform: none !important; }
  .journey-visual-copy[data-journey-visual-copy="4"] { opacity: 1 !important; }
  .journey-controls { display: none; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 680px) {
  .journey-copy-stack { grid-template-columns: 1fr; }
}
