/* Story page: a pixel road that fills in as you scroll through the levels. */
.story-intro h1 { font-size: clamp(28px, 6vw, 64px); line-height: 1.25; margin-bottom: 18px; text-shadow: 4px 4px 0 var(--yellow); }
.story-intro p:last-child { max-width: 52ch; font-size: 17px; line-height: 1.6; }

.road-section { background: var(--white) radial-gradient(var(--sky) 2px, transparent 2px) 0 0 / 28px 28px; }
.road { --track: 140px; --lane: 28px; position: relative; padding: 56px 0 96px var(--track); }
.road-track { position: absolute; left: 0; top: 0; width: var(--track); overflow: visible; }
.road-track path { fill: none; stroke-linejoin: miter; stroke-linecap: square; }
.road-edge { stroke: var(--navy); stroke-width: calc(var(--lane) + 8px); }
.road-bed { stroke: var(--sky); stroke-width: var(--lane); }
.road-fill { stroke: var(--yellow); stroke-width: var(--lane); }
.road-rider { position: absolute; left: 0; top: 0; width: 52px; height: auto; image-rendering: pixelated; z-index: 2; pointer-events: none; }

.milestones { list-style: none; margin: 0; padding: 0; }
.milestone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 32px 48px; align-items: start; min-height: 72vh; }
.milestone-coin { position: absolute; z-index: 1; width: 40px; height: 40px; transform: translate(-50%, -50%); background: var(--white); border: 4px solid var(--navy); box-shadow: 3px 3px 0 var(--navy); }
.milestone.is-cleared .milestone-coin { background: var(--yellow) url("assets/px/coin.png") center / 70% auto no-repeat; }
.milestone-tag { margin: 0; font: 12px/1.5 var(--f-display); color: var(--orange); letter-spacing: .04em; }
.milestone h2 { font-size: clamp(18px, 2.4vw, 28px); line-height: 1.4; margin: 14px 0 12px; }
.milestone-copy p:last-child { margin: 0; max-width: 46ch; font-size: 16px; line-height: 1.6; }
.milestone-card { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 28px 20px; background: var(--sky); }
.milestone-card img { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; }
.milestone-card figcaption { font: 64px/1 var(--f-score); color: var(--navy); }

.road.is-live .milestone-copy, .road.is-live .milestone-card { opacity: .35; transform: translateY(18px); transition: opacity .4s, transform .4s; }
.road.is-live .milestone.is-cleared .milestone-copy, .road.is-live .milestone.is-cleared .milestone-card { opacity: 1; transform: none; }

.story-next { text-align: center; }
.story-next h2 { font-size: clamp(20px, 3.4vw, 36px); line-height: 1.4; margin-bottom: 14px; }
.story-next p { margin: 0 auto 24px; max-width: 44ch; }

.milestone-photo { padding: 10px 10px 14px; background: var(--white); }
.milestone-photo img { width: 100%; height: auto; max-height: 360px; object-fit: contain; image-rendering: auto; border: 3px solid var(--navy); }
.milestone-photo figcaption { font-size: 36px; }

.milestone-placeholder { width: 100%; padding: 10px 10px 14px; background: var(--white); }
.placeholder-frame { width: 100%; aspect-ratio: 4 / 3; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px; padding: 16px; border: 3px dashed var(--navy); background: var(--sky); text-align: center; }
.milestone-card .placeholder-frame img { width: 64px; height: 64px; }
.placeholder-frame p { flex-basis: 100%; margin: 0; font: 12px/1.6 var(--f-display); }
.milestone-placeholder figcaption { font-size: 36px; }

.milestone-video { padding: 10px 10px 14px; background: var(--navy); }
.milestone-video figcaption { color: var(--yellow); font-size: 36px; }
.milestone-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 3px solid var(--yellow); background: #000; }
.milestone-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.milestone-chart { justify-items: stretch; padding: 20px 16px 14px; background: var(--navy); }
.chart-title { margin: 0; font: 12px/1.5 var(--f-display); color: var(--white); text-align: center; }
.chart-bars { list-style: none; margin: 0; padding: 0 0 0; height: 220px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; border-bottom: 3px solid var(--yellow); }
.chart-bars li { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.chart-bar { width: 100%; height: var(--bar); min-height: 6px; background: var(--yellow) repeating-linear-gradient(0deg, transparent 0 10px, var(--navy) 10px 12px); border: 2px solid var(--yellow); transform-origin: bottom; }
.chart-bars li:last-child .chart-bar { background-color: var(--pink); border-color: var(--pink); }
.chart-value { font: 15px/1 var(--f-score); color: var(--white); white-space: nowrap; }
.chart-year { position: absolute; bottom: -24px; font: 15px/1 var(--f-score); color: var(--sky); }
.milestone-chart figcaption { margin-top: 28px; text-align: center; color: var(--yellow); text-shadow: 3px 3px 0 var(--pink); }
.road.is-live .chart-bar { transform: scaleY(0); transition: transform .6s steps(8); }
.road.is-live .milestone.is-cleared .chart-bar { transform: scaleY(1); }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(2) .chart-bar { transition-delay: .1s; }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(3) .chart-bar { transition-delay: .2s; }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(4) .chart-bar { transition-delay: .3s; }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(5) .chart-bar { transition-delay: .4s; }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(6) .chart-bar { transition-delay: .5s; }
.road.is-live .milestone.is-cleared .chart-bars li:nth-child(7) .chart-bar { transition-delay: .6s; }

@media (max-width: 760px) {
  .road { --track: 64px; --lane: 16px; padding-top: 32px; }
  .road-rider { width: 36px; }
  .milestone { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: 72px; gap: 20px; }
  .milestone-coin { width: 28px; height: 28px; border-width: 3px; }
  .milestone-card { max-width: 240px; padding: 20px; }
  .milestone-card img { width: 64px; height: 64px; }
  .milestone-card figcaption { font-size: 40px; }
  .milestone-photo, .milestone-video, .milestone-chart, .milestone-placeholder { max-width: none; padding: 8px 8px 12px; }
  .chart-bars { height: 180px; gap: 4px; }
  .chart-value { font-size: 12px; }
  .chart-year { font-size: 12px; }
  .milestone-photo img { width: 100%; height: auto; }
  .milestone-photo figcaption { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .road.is-live .chart-bar { transition: none; }
  .road.is-live .milestone-copy, .road.is-live .milestone-card { transition: none; }
}
