/* ============================================================
   Golden Path — scroll-driven ten-step journey
   ============================================================ */

#journey .jz-wrap {
  position: relative;
  max-width: 72rem;
  margin: 4.5rem auto 0;
  padding: 6rem 1.5rem 8rem;
}

/* ---------- the SVG path ---------- */
.jz-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.jz-track {
  fill: none;
  stroke: oklch(0.72 0.06 80 / 0.35);
  stroke-width: 2;
  stroke-dasharray: 3 10;
  stroke-linecap: round;
}
.jz-flow {
  fill: none;
  stroke: url(#jzGrad);
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px oklch(0.82 0.16 78 / 0.55));
  transition: stroke-width 0.35s ease-out, filter 0.35s ease-out;
}
/* golden surge when the drop hands off to the next stage */
.jz-flow.jz-flash {
  stroke-width: 7;
  filter: drop-shadow(0 0 20px oklch(0.85 0.17 78 / 0.95));
}

/* ---------- travelling droplet ---------- */
.jz-drop {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 56px;
  margin: -28px 0 0 -22px;
  z-index: 6;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 8px 18px oklch(0.72 0.16 70 / 0.55));
}
.jz-drop svg { width: 100%; height: 100%; animation: jz-bob 2.4s ease-in-out infinite; }
@keyframes jz-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(3px) scale(1.03, 0.97); }
}

/* ---------- stage rows ---------- */
#journey .jz-stages { list-style: none; margin: 0; padding: 0; position: relative; z-index: 2; }
.jz-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 19rem;
}
.jz-side-a { grid-column: 1; grid-row: 1; }
.jz-mid    { grid-column: 2; grid-row: 1; display: grid; place-items: center; }
.jz-side-b { grid-column: 3; grid-row: 1; }
.jz-stage:nth-child(even) .jz-side-a { grid-column: 3; }
.jz-stage:nth-child(even) .jz-side-b { grid-column: 1; justify-self: end; }

/* ---------- medallion ---------- */
.jz-medal {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  border: 1px solid oklch(1 0 0 / 0.8);
  background: linear-gradient(150deg, #fff 0%, var(--tint) 70%);
  box-shadow: 0 14px 30px -14px oklch(0.5 0.08 60 / 0.4);
  transform: translateX(var(--nx)) scale(0.35);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease-out, box-shadow 0.5s;
  will-change: transform;
}
/* --focus (0..1) is set every frame by JS: 1 = droplet at this stage */
.jz-active .jz-medal {
  transform: translateX(var(--nx)) scale(calc(0.88 + 0.27 * var(--focus, 0)));
  opacity: 1;
}
.jz-current .jz-medal {
  box-shadow: 0 22px 45px -16px oklch(0.7 0.15 75 / 0.6);
}
.jz-medal:hover {
  box-shadow: 0 22px 45px -16px oklch(0.7 0.15 75 / 0.6);
}
.jz-medal .jz-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* size via width/height (not transform) so the per-stage keyframe animations compose with it */
.jz-current .jz-medal .jz-icon { width: 42px; height: 42px; }
.jz-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  height: 26px;
  width: 26px;
  border-radius: 9999px;
  border: 1px solid #fff;
  background: #fff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px oklch(0.4 0.05 60 / 0.2);
}
/* soft halo behind medallion */
.jz-halo {
  position: absolute;
  inset: -14px;
  border-radius: 9999px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.6s;
  pointer-events: none;
}
.jz-active .jz-halo { opacity: calc(var(--focus, 0) * 0.55); }
.jz-medal:hover .jz-halo { opacity: 0.55; }
/* spinning conic ring on the current stage */
.jz-ring {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: conic-gradient(from 0deg, oklch(0.9 0.13 85), oklch(0.75 0.15 65), oklch(0.9 0.13 85));
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%);
  mask: radial-gradient(circle, transparent 64%, #000 66%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.jz-current .jz-ring { opacity: 1; animation: jz-spin 7s linear infinite; }
@keyframes jz-spin { to { transform: rotate(360deg); } }
/* activation ripple */
.jz-ripple {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid var(--accent);
  opacity: 0.8;
  animation: jz-ripple 0.9s ease-out forwards;
  pointer-events: none;
}
@keyframes jz-ripple {
  to { transform: scale(2.1); opacity: 0; }
}
/* golden sparks that burst out when a stage activates */
.jz-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 9px;
  margin: -4px 0 0 -3px;
  background: var(--gradient-oil, linear-gradient(135deg, oklch(0.88 0.15 90), oklch(0.72 0.15 62)));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
  animation: jz-spark 0.75s cubic-bezier(0.16, 0.8, 0.4, 1) forwards;
}
@keyframes jz-spark {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0px), var(--dy, -40px)) scale(0.15) rotate(50deg); opacity: 0; }
}

/* ---------- per-stage icon animations (play on the current stage & on hover) ---------- */
@keyframes jz-i-sway    { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(7deg); } }
@keyframes jz-i-shake   { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2.5px) rotate(-3deg); } 75% { transform: translateX(2.5px) rotate(3deg); } }
@keyframes jz-i-snip    { 0%,100% { transform: rotate(0deg) scale(1); } 40% { transform: rotate(-10deg) scale(1.08); } 70% { transform: rotate(6deg); } }
@keyframes jz-i-flicker { 0%,100% { transform: scale(1) skewX(0deg); filter: brightness(1); } 30% { transform: scale(1.1, 0.94) skewX(-3deg); filter: brightness(1.25); } 60% { transform: scale(0.96, 1.08) skewX(3deg); filter: brightness(1.1); } }
@keyframes jz-i-spin    { to { transform: rotate(360deg); } }
@keyframes jz-i-drip    { 0%,100% { transform: translateY(-1.5px) scale(1); } 55% { transform: translateY(2.5px) scale(1.06, 0.94); } }
@keyframes jz-i-bubble  { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2.5px) rotate(4deg); } }
@keyframes jz-i-pulse   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes jz-i-bob     { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(2deg); } }
@keyframes jz-i-drive   { 0%,100% { transform: translateX(-2.5px) translateY(0); } 25% { transform: translateX(0) translateY(-1.5px); } 50% { transform: translateX(2.5px) translateY(0); } 75% { transform: translateX(0) translateY(-1.5px); } }

.jz-stage:nth-child(1).jz-current .jz-icon,  .jz-stage:nth-child(1) .jz-medal:hover .jz-icon  { animation: jz-i-sway 1.8s ease-in-out infinite; }
.jz-stage:nth-child(2).jz-current .jz-icon,  .jz-stage:nth-child(2) .jz-medal:hover .jz-icon  { animation: jz-i-shake 1s ease-in-out infinite; }
.jz-stage:nth-child(3).jz-current .jz-icon,  .jz-stage:nth-child(3) .jz-medal:hover .jz-icon  { animation: jz-i-snip 1.1s ease-in-out infinite; }
.jz-stage:nth-child(4).jz-current .jz-icon,  .jz-stage:nth-child(4) .jz-medal:hover .jz-icon  { animation: jz-i-flicker 1.2s ease-in-out infinite; }
.jz-stage:nth-child(5).jz-current .jz-icon,  .jz-stage:nth-child(5) .jz-medal:hover .jz-icon  { animation: jz-i-spin 5s linear infinite; }
.jz-stage:nth-child(6).jz-current .jz-icon,  .jz-stage:nth-child(6) .jz-medal:hover .jz-icon  { animation: jz-i-drip 1.4s ease-in-out infinite; }
.jz-stage:nth-child(7).jz-current .jz-icon,  .jz-stage:nth-child(7) .jz-medal:hover .jz-icon  { animation: jz-i-bubble 1.5s ease-in-out infinite; }
.jz-stage:nth-child(8).jz-current .jz-icon,  .jz-stage:nth-child(8) .jz-medal:hover .jz-icon  { animation: jz-i-pulse 1.3s ease-in-out infinite; }
.jz-stage:nth-child(9).jz-current .jz-icon,  .jz-stage:nth-child(9) .jz-medal:hover .jz-icon  { animation: jz-i-bob 1.4s ease-in-out infinite; }
.jz-stage:nth-child(10).jz-current .jz-icon, .jz-stage:nth-child(10) .jz-medal:hover .jz-icon { animation: jz-i-drive 1.2s ease-in-out infinite; }

/* ---------- cards ---------- */
.jz-card {
  position: relative;
  overflow: hidden;
  max-width: 26rem;
  border-radius: 1.5rem;
  border: 1px solid oklch(0.85 0.03 85 / 0.6);
  background: oklch(1 0 0 / 0.72);
  backdrop-filter: blur(14px);
  padding: 1.6rem 1.7rem;
  box-shadow: var(--shadow-soft, 0 10px 30px -18px oklch(0.4 0.05 60 / 0.35));
  opacity: 0;
  transform: translateX(var(--slide, -44px)) translateY(26px);
  filter: blur(5px);
  transition: opacity 0.7s ease-out, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease-out, box-shadow 0.4s, border-color 0.4s;
}
.jz-stage:nth-child(odd) .jz-card { margin-left: auto; }
.jz-stage:nth-child(even) .jz-card { --slide: 44px; margin-right: auto; }
.jz-active .jz-card {
  opacity: calc(0.45 + 0.55 * var(--focus, 0));
  transform: translateX(0) translateY(0) scale(calc(0.96 + 0.05 * var(--focus, 0)));
  filter: blur(0) saturate(calc(0.8 + 0.25 * var(--focus, 0)));
}
.jz-current .jz-card {
  border-color: oklch(0.8 0.13 80 / 0.65);
  box-shadow: 0 24px 50px -22px oklch(0.7 0.14 75 / 0.5);
}
.jz-active .jz-card:hover {
  opacity: 1;
  filter: blur(0) saturate(1.05);
}
/* shine sweep on hover */
.jz-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, oklch(1 0 0 / 0.5) 48%, oklch(0.95 0.08 90 / 0.35) 52%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s ease;
  pointer-events: none;
}
.jz-card:hover::after { transform: translateX(120%); }
/* card content reveals in a stagger once the stage activates */
.jz-card > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease-out, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.jz-card > .jz-step { transition-delay: 0.08s; }
.jz-card > h3 { transition-delay: 0.16s; }
.jz-card > p { transition-delay: 0.24s; }
.jz-card > .jz-fact { transition-delay: 0.34s; }
.jz-active .jz-card > * { opacity: 1; transform: translateY(0); }
.jz-step {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.jz-card h3 { margin-top: 0.35rem; font-size: 1.65rem; line-height: 1.15; font-weight: 500; }
.jz-card p { margin-top: 0.6rem; color: oklch(0.5 0.02 80); font-size: 0.95rem; line-height: 1.6; }
.jz-fact {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border-radius: 1rem;
  border: 1px solid oklch(0.85 0.09 85 / 0.5);
  background: oklch(0.98 0.04 90 / 0.65);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: oklch(0.42 0.03 70);
  line-height: 1.5;
}
.jz-fact svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: oklch(0.62 0.13 70); }
.jz-fact b {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: oklch(0.62 0.13 70);
}

/* ---------- ghost numbers ---------- */
.jz-num {
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: 1;
  font-weight: 600;
  color: oklch(0.35 0.06 145 / 0.09);
  transition: color 0.8s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s;
  transform: translateY(20px);
  opacity: 0;
  user-select: none;
}
.jz-stage:nth-child(even) .jz-num { text-align: right; }
.jz-active .jz-num {
  opacity: calc(0.4 + 0.6 * var(--focus, 0));
  transform: translateY(0) scale(calc(1 + 0.07 * var(--focus, 0)));
}
.jz-current .jz-num,
.jz-num:hover {
  background: var(--gradient-oil, linear-gradient(135deg, oklch(0.85 0.15 90), oklch(0.7 0.15 60)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- start / end markers ---------- */
.jz-marker {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  pointer-events: none;
}
.jz-marker-dot {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  border: 1px solid oklch(1 0 0 / 0.85);
  background: linear-gradient(150deg, #fff, oklch(0.96 0.05 110));
  box-shadow: 0 12px 26px -12px oklch(0.5 0.08 60 / 0.45);
  overflow: hidden;
}
.jz-marker-dot svg { width: 26px; height: 26px; color: oklch(0.55 0.12 140); }
.jz-marker-dot img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.jz-marker-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: oklch(0.5 0.05 80);
  background: oklch(1 0 0 / 0.75);
  border: 1px solid oklch(0.88 0.03 85 / 0.7);
  border-radius: 999px;
  padding: 3px 10px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* ---------- ambient floating shapes ---------- */
.jz-float {
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
  filter: blur(0.4px);
  will-change: transform;
  z-index: 1;
}
.jz-float > * { width: 100%; height: 100%; }

/* ---------- sticky progress HUD ---------- */
.jz-hud {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 9px;
  border-radius: 999px;
  border: 1px solid oklch(0.86 0.03 85 / 0.7);
  background: oklch(1 0 0 / 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -18px oklch(0.4 0.06 60 / 0.45);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s;
}
.jz-hud.jz-visible { opacity: 1; transform: translateY(0); }
.jz-hud-ring { position: relative; width: 42px; height: 42px; }
.jz-hud-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.jz-hud-ring .jz-hud-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.4 0.07 145);
}
.jz-hud-meta { line-height: 1.25; }
.jz-hud-meta small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: oklch(0.55 0.04 80);
}
.jz-hud-meta strong { font-size: 13px; font-weight: 600; color: oklch(0.25 0.03 80); }

/* ---------- scroll hint ---------- */
.jz-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  border-radius: 999px;
  border: 1px solid oklch(0.8 0.1 85 / 0.5);
  background: oklch(0.98 0.04 90 / 0.7);
  padding: 0.45rem 1.1rem;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.55 0.1 70);
}
.jz-hint svg { width: 14px; height: 14px; animation: jz-hint-drop 1.6s ease-in-out infinite; }
@keyframes jz-hint-drop {
  0%, 100% { transform: translateY(-2px); opacity: 0.6; }
  50% { transform: translateY(3px); opacity: 1; }
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  #journey .jz-wrap { padding: 4rem 1rem 5rem; }
  .jz-stage {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 15rem;
    /* !important so this beats the per-stage inline --nx and keeps medallions in the mobile rail */
    --nx: 0px !important;
  }
  .jz-mid { grid-column: 1; align-self: start; padding-top: 0.6rem; }
  .jz-side-a, .jz-stage:nth-child(even) .jz-side-a { grid-column: 2; }
  .jz-side-b, .jz-stage:nth-child(even) .jz-side-b { display: none; }
  .jz-medal { width: 64px; height: 64px; }
  .jz-medal .jz-icon { width: 26px; height: 26px; }
  .jz-card, .jz-stage:nth-child(even) .jz-card { --slide: 30px; margin: 0; max-width: none; }
  .jz-hud { right: 12px; bottom: 12px; }
}

/* ---------- no-JS fallback: everything visible until journey.js adds .jz-ready ---------- */
#journey:not(.jz-ready) .jz-card,
#journey:not(.jz-ready) .jz-card > *,
#journey:not(.jz-ready) .jz-medal,
#journey:not(.jz-ready) .jz-num {
  opacity: 1;
  transform: none;
  filter: none;
}
#journey:not(.jz-ready) .jz-drop,
#journey:not(.jz-ready) .jz-hud {
  display: none;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .jz-stage { --focus: 1; }
  .jz-medal, .jz-card, .jz-num { opacity: 1 !important; transform: translateX(var(--nx, 0)) !important; filter: none !important; transition: none !important; }
  .jz-card { transform: none !important; }
  .jz-num { transform: none !important; }
  .jz-card > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .jz-drop, .jz-hud, .jz-hint svg { display: none !important; }
  .jz-ring, .jz-drop svg, .jz-icon, .jz-spark, .jz-ripple, .jz-flow { animation: none !important; }
  .jz-card::after { display: none !important; }
}
