/* Neural journey · storyboard scroll layer */
:root {
  --journey-spine-w: 72px;
  --journey-hud-top: 5.5rem;
}

.neural-spine {
  position: fixed;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: var(--journey-spine-w);
  height: min(78vh, 640px);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.neural-spine.is-visible { opacity: 1; }

.neural-spine-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.neural-spine-track {
  fill: none;
  stroke: rgba(0, 212, 238, 0.12);
  stroke-width: 2;
  stroke-linecap: round;
}
.neural-spine-glow {
  fill: none;
  stroke: url(#neuralGrad);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(0, 212, 238, 0.45));
  transition: stroke-dashoffset 0.35s ease-out;
}
.neural-node {
  fill: rgba(8, 8, 16, 0.92);
  stroke: rgba(0, 212, 238, 0.35);
  stroke-width: 1.5;
  transition: stroke 0.35s, fill 0.35s, r 0.35s;
}
.neural-node.is-active {
  stroke: var(--neon-magenta, #e8328a);
  fill: rgba(232, 50, 138, 0.15);
  filter: drop-shadow(0 0 10px rgba(232, 50, 138, 0.5));
}
.neural-node.is-passed {
  stroke: rgba(0, 212, 238, 0.7);
  fill: rgba(0, 212, 238, 0.12);
}

.neural-spine-labels {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: calc(var(--journey-spine-w) + 0.35rem);
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}
.neural-spine-labels li {
  transition: color 0.35s, text-shadow 0.35s;
  white-space: nowrap;
}
.neural-spine-labels li.is-active {
  color: var(--neon-cyan, #00d4ee);
  text-shadow: 0 0 12px rgba(0, 212, 238, 0.4);
}
.neural-spine-labels li.is-passed { color: rgba(255, 255, 255, 0.5); }

.journey-hud {
  position: fixed;
  top: var(--journey-hud-top);
  left: calc(var(--journey-spine-w) + 2.5rem);
  z-index: 41;
  pointer-events: none;
  max-width: 220px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 212, 238, 0.2);
  background: rgba(6, 6, 14, 0.82);
  backdrop-filter: blur(16px);
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s, transform 0.4s;
}
.journey-hud.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.journey-hud-kicker {
  display: block;
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-magenta, #e8328a);
  margin-bottom: 0.25rem;
}
.journey-hud strong {
  display: block;
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 0.82rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

/* Storyboard section */
.neural-journey {
  position: relative;
  padding: clamp(3rem, 8vw, 5rem) 0;
  overflow: hidden;
}
.neural-journey::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 30%, rgba(0, 212, 238, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(232, 50, 138, 0.05), transparent 50%);
  pointer-events: none;
}
.neural-journey .container { position: relative; z-index: 1; }

.journey-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  perspective: 1200px;
}

.journey-frame {
  position: relative;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(12, 12, 22, 0.95), rgba(6, 6, 14, 0.88));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out, box-shadow 0.35s, border-color 0.35s;
  overflow: hidden;
}
.journey-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 238, 0.06), transparent 45%, rgba(232, 50, 138, 0.04));
  pointer-events: none;
}
.journey-frame.is-lit {
  border-color: rgba(0, 212, 238, 0.35);
  box-shadow: 0 24px 60px rgba(0, 212, 238, 0.08), 0 0 0 1px rgba(0, 212, 238, 0.1);
}
.journey-frame-num {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--neon-cyan, #00d4ee), var(--neon-magenta, #e8328a));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}
.journey-frame h3 {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: #fff;
}
.journey-frame p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.55;
}
.journey-frame-tag {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(232, 50, 138, 0.35);
  color: var(--neon-magenta, #e8328a);
}

.journey-canvas-wrap {
  margin-top: 2.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.35);
  min-height: 220px;
  position: relative;
  overflow: hidden;
}
#journey-neural-canvas {
  display: block;
  width: 100%;
  height: 220px;
}

.hero-grid { transition: transform 0.1s linear; will-change: transform; }

@media (max-width: 1100px) {
  .neural-spine,
  .journey-hud { display: none !important; }
}

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

@media (prefers-reduced-motion: reduce) {
  .journey-frame { transition: none; }
  .hero-grid { transition: none; }
}
