/* 2 · PATH — €0 to €100 every month as six levels on one line going down.
   Without JS, or with reduced motion, this file alone shows the finished path.
   path.js adds .path-live (scroll drives the line) and .path-pinned (the stage holds still while it draws). */

#path.sec { padding-top: 110px; }
.path-inner { width: 100%; }
.path-br { display: none; }

.path-wrap { position: relative; max-width: 760px; margin: 48px auto 0; }
#path .lede { text-wrap: balance; }

/* the line: JS draws one curve through the dot centres */
.path-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.path-base, .path-rest, .path-prog { fill: none; stroke-linecap: round; }
.path-base { stroke: rgba(29, 29, 27, 0.14); stroke-width: 2; }
.path-rest { stroke: rgba(29, 29, 27, 0.22); stroke-width: 2.4; stroke-dasharray: 0 7; }
.path-prog { stroke: var(--crimson); stroke-width: 2.5; }
.path-head {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--crimson);
  box-shadow: 0 0 0 5px rgba(184, 31, 55, 0.13);
  opacity: 0; pointer-events: none; z-index: 2; will-change: transform;
  transition: opacity 0.2s;
}

/* the levels: dots weave left and right of the centre, labels sit on the outside */
.path { --row: 72px; --mid: 112px; --dot: 30px; position: relative; z-index: 3; }
.node {
  display: grid; grid-template-columns: 1fr var(--mid) 1fr; align-items: center;
  height: var(--row);
}
.path-dot { grid-column: 2; grid-row: 1; justify-self: start; }
.path-txt { grid-column: 1; grid-row: 1; display: grid; justify-items: end; text-align: right; padding-right: 22px; }
.node:nth-child(even) .path-dot { justify-self: end; }
.node:nth-child(even) .path-txt { grid-column: 3; justify-items: start; text-align: left; padding: 0 0 0 22px; }

.node b { font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.path-ev { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 15px; line-height: 1.3; color: var(--ink-2); letter-spacing: -0.008em; white-space: nowrap; }
.path-ev .tile { --s: 19px; }
.path-ev .tile + .tile { margin-left: -3px; }
.path-txt { transition: opacity 0.45s var(--out), transform 0.45s var(--out); }

/* the dot */
.path-dot {
  position: relative; display: grid; place-items: center;
  width: var(--dot); height: var(--dot); border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px rgba(29, 29, 27, 0.2);
}
.path-dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--crimson); transition: transform 0.5s var(--spring); }
.path-dot svg { position: relative; width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.25s 0.08s, transform 0.45s 0.08s var(--spring); }
.now .path-dot { background: #fff; box-shadow: inset 0 0 0 2px var(--crimson); }
.now .path-dot::before { inset: 9px; }
.path-halo { position: absolute; inset: -1px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--crimson); opacity: 0; }
.now b { color: var(--crimson); }
.now .path-ev { color: var(--crimson); font-weight: 500; }

/* locked levels stay quiet */
.node:not(.done):not(.now) .path-dot { box-shadow: inset 0 0 0 1.5px rgba(29, 29, 27, 0.16); }
.node:not(.done):not(.now) .path-dot::before { transform: scale(0); }
.node:not(.done):not(.now) .path-txt { opacity: 0.38; }
.node:not(.done):not(.now) .tile { filter: grayscale(1); }

/* the current level breathes once the line has reached it */
#path:not(.path-live) .now .path-halo,
.path-live .now.hit .path-halo { animation: path-breathe 2.6s var(--out) infinite; }
@keyframes path-breathe {
  0% { opacity: 0.6; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.8); }
}

/* scroll-driven: a level waits, dim and empty, until the line reaches it */
.path-live .node:is(.done, .now):not(.hit) .path-dot { background: var(--bg); box-shadow: inset 0 0 0 1.5px rgba(29, 29, 27, 0.2); }
.path-live .node:is(.done, .now):not(.hit) .path-dot::before { transform: scale(0); }
.path-live .node:is(.done, .now):not(.hit) .path-dot svg { opacity: 0; transform: scale(0.4); }
.path-live .node:is(.done, .now):not(.hit) .path-txt { opacity: 0.38; }
.path-live .node:is(.done, .now):not(.hit) b,
.path-live .node:is(.done, .now):not(.hit) .path-ev { color: var(--ink); font-weight: 600; }
.path-live .node:is(.done, .now):not(.hit) .path-ev { color: var(--ink-2); font-weight: 400; }
.path-live .node:is(.done, .now):not(.hit) .tile { filter: grayscale(1); }
.path-live .path-txt .tile { transition: filter 0.45s var(--out); }

/* the stage holds still while the line draws, then lets go */
.path-pinned .path-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--menubar-h, 30px);
}
.path-pinned .path-pin { height: calc(100vh + var(--path-d, 900px)); height: calc(100svh + var(--path-d, 900px)); }
#path.path-pinned { padding-top: 40px; }

/* who keeps score */
.refs { max-width: 920px; margin: 44px auto 0; text-align: center; font-size: 15px; line-height: 1.9; color: var(--ink-2); letter-spacing: -0.005em; text-wrap: balance; }
.refs .nw { white-space: nowrap; }
.refs .tile { --s: 20px; margin: -2px 6px 0 4px; }

@media (max-width: 1080px) {
  .path-wrap { max-width: 680px; }
}

/* phones: one straight line down the left, labels to its right */
@media (max-width: 760px) {
  #path.sec { padding-top: 90px; }
  .path-br { display: inline; }
  .path-wrap { max-width: none; margin-top: 30px; }
  .path { --row: 54px; --dot: 28px; }
  .node, .node:nth-child(even) { grid-template-columns: var(--dot) 1fr; }
  .path-dot, .node:nth-child(even) .path-dot { grid-column: 1; justify-self: start; }
  .path-txt, .node:nth-child(even) .path-txt { grid-column: 2; justify-items: start; text-align: left; padding: 0 0 0 16px; }
  .node b { font-size: 17px; }
  .path-ev { font-size: 14px; margin-top: 3px; }
  .path-ev .tile { --s: 17px; }
  .path-dot svg { width: 14px; height: 14px; }
  .now .path-dot::before { inset: 8px; }
  /* one left edge for the whole column on a phone */
  #path .h2, #path .lede, #path .refs { text-align: left; margin-left: 0; }
  #path .lede { max-width: 30em; margin-top: 16px; text-wrap: pretty; }
  .refs { margin-top: 28px; line-height: 1.5; }
  .refs .nw:first-of-type .tile { margin-left: 8px; }
  .refs .tile { --s: 22px; margin: -3px 0 0 6px; }
  /* names stay for screen readers; the icons say it on a phone */
  .refs .ref-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  #path .now .path-halo { animation: none; opacity: 0.25; transform: scale(1.4); }
}
