/* Learning Journey: arrow timeline.
   A large arrow starts behind "Learn. Practise. Progress." and runs through four slanted,
   colour-coded step tabs. Each tab shows its icon (top right) instead of a number.
   Markup is unchanged (CSS only). */

.journey {
  position: relative;
  padding-top: 70px;
  padding-bottom: 70px;
}

/* the arrow: starts at the title and points right past the last tab */
.journey::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(var(--pad) - 36px);
  right: calc(var(--pad) - 70px);
  top: 50%;
  height: 270px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #ffffff12 0%, #ffffff30 55%, #ffffff4a 100%);
  clip-path: polygon(0 20%, calc(100% - 120px) 20%, calc(100% - 120px) 0, 100% 50%, calc(100% - 120px) 100%, calc(100% - 120px) 80%, 0 80%);
  pointer-events: none;
}

.journey-title,
.journey-steps {
  position: relative;
  z-index: 1;
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
}

/* slanted tab */
.journey-steps article {
  position: relative;
  max-width: 235px;
  width: 100%;
  justify-self: center;
  min-height: 210px;
  padding: 58px 16px 18px 26px;
  border: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  transition: transform .4s ease;
}

.journey-steps article::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 6px;
  transform: skewX(-8deg);
  background: var(--tab);
  border: 1px solid #ffffff55;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 28px #02082a55, inset 0 1px 0 #ffffff77, inset 0 -12px 24px #ffffff12;
}

.journey-steps article:nth-child(1) {
  --tab: linear-gradient(165deg, #19d9f5a6, #2a8bff4d);
}

.journey-steps article:nth-child(2) {
  --tab: linear-gradient(165deg, #4a9bffa6, #2a4fd04d);
}

.journey-steps article:nth-child(3) {
  --tab: linear-gradient(165deg, #9a73ffa6, #6a3fd84d);
}

.journey-steps article:nth-child(4) {
  --tab: linear-gradient(165deg, #f0d28fa6, #d9b26a4d);
}

.journey-steps article:hover {
  transform: translateY(-6px);
}

/* icon replaces the number, top right */
.journey-steps span {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 64px;
  height: 64px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: none;
  display: grid;
  place-items: center;
  color: #fff;
}

.journey-steps article:hover span {
  box-shadow: none;
  transform: none;
}

.journey-steps span .ic {
  width: 58px;
  height: 58px;
  stroke-width: 1.3;
  color: #fff;
  filter: drop-shadow(0 4px 10px #02082a77);
}

.journey-steps article:hover span .ic {
  transform: none;
}

.journey-steps h3 {
  font-size: 16.5px;
  margin: 0 0 6px;
  color: #fff;
  text-shadow: 0 1px 6px #00000044;
}

.journey-steps p {
  max-width: none;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #ffffffe6;
}

/* the old connector line is replaced by the arrow */
.journey-steps article:not(:last-child)::after {
  display: none;
}

@media (max-width: 1100px) {
  .journey::after {
    top: auto;
    bottom: 70px;
    transform: none;
  }
}

@media (max-width: 820px) {
  .journey::after {
    display: none;
  }

  .journey-steps {
    grid-template-columns: 1fr 1fr;
    gap: 22px 18px;
  }

  .journey-steps article {
    min-height: 180px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .journey-steps {
    grid-template-columns: 1fr;
  }
}

/* Highlighted card titles: bold, glow, gold underline that grows, light sweep on hover */
.journey-steps h3 {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .3px;
  padding-bottom: 7px;
  margin: 0 0 8px;
  color: transparent;
  background: linear-gradient(100deg, #fff 0%, #fff 42%, #ffe7a8 50%, #fff 58%, #fff 100%) 100% 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px #02082a88);
  transition: background-position .9s ease;
}

.journey-steps h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #f7e6b8, #d9b26a);
  box-shadow: 0 0 10px #d9b26aaa;
  transition: width .5s cubic-bezier(.2, .75, .25, 1);
}

.journey-steps article:hover h3 {
  background-position: 0 0;
}

.journey-steps article:hover h3::after {
  width: 100%;
}

/* Arrow motion: a soft band of light flows along the arrow toward its head */
.journey::after {
  background:
    linear-gradient(100deg, transparent 38%, #ffffff55 50%, transparent 62%) 100% 0 / 220% 100% no-repeat,
    linear-gradient(90deg, #ffffff12 0%, #ffffff30 55%, #ffffff4a 100%);
  animation: arrowFlow 5.5s ease-in-out infinite;
}

@keyframes arrowFlow {
  0% { background-position: 100% 0, 0 0; }
  75%, 100% { background-position: 0% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .journey::after { animation: none; }
}

/* Each card lights up as the moving band of light passes it (same 5.5s loop as the arrow) */
.journey-steps article::before {
  animation: cardPass 5.5s ease-in-out infinite;
}

.journey-steps article:nth-child(1)::before { animation-delay: 1.6s; }
.journey-steps article:nth-child(2)::before { animation-delay: 2.0s; }
.journey-steps article:nth-child(3)::before { animation-delay: 2.4s; }
.journey-steps article:nth-child(4)::before { animation-delay: 2.8s; }

@keyframes cardPass {
  0%, 22%, 100% {
    filter: brightness(1);
    border-color: #ffffff55;
    box-shadow: 0 14px 28px #02082a55, inset 0 1px 0 #ffffff77, inset 0 -12px 24px #ffffff12;
  }
  10% {
    filter: brightness(1.32) saturate(1.15);
    border-color: #f7e6b8dd;
    box-shadow: 0 14px 34px #02082a55, 0 0 26px #d9b26a88, inset 0 1px 0 #ffffffcc, inset 0 -12px 24px #ffffff33;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-steps article::before { animation: none; }
}

/* Arrow in theme gold */
.journey::after {
  background:
    linear-gradient(100deg, transparent 38%, #ffffff55 50%, transparent 62%) 100% 0 / 220% 100% no-repeat,
    linear-gradient(90deg, #d9b26a1f 0%, #d9b26a45 55%, #d9b26a70 100%);
}
