/* PREDIX scroll scenes: the story (oil → Duval → grade → life) and the fleet zoom.
   Default rules are the FINISHED composition (reduced motion, no script, failed CDN).
   Rules under .scene.is-live are the held, scrubbed stage. */

/* ===================== Story ===================== */
.story { background: var(--navy); color: #fff; }
.story .scene-stage { padding: var(--gap-section) var(--margin); }
.story__beats { display: grid; gap: clamp(72px, 9vw, 140px); }
.beat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.beat__copy { grid-column: 1 / span 5; }
.beat__copy p { margin-top: 24px; max-width: 40ch; color: #fff; }
.beat__art { grid-column: 7 / span 6; }
.beat__art svg { width: 100%; height: auto; overflow: visible; }

/* progress: four triangles, the motif at text size */
.story__rail { display: none; }

/* art: final state by default */
.st-txt { fill: #fff; font-family: var(--font); }
.st-soft { fill: #c9dcec; font-family: var(--font); }
.st-ink { fill: #0f2233; font-family: var(--font); }

.scene.is-live.story .scene-stage { padding: 0 var(--margin); display: grid; align-items: center; }
.scene.is-live .story__beats { position: relative; height: 100%; display: block; }
.scene.is-live .beat { position: absolute; inset: 0; }
.scene.is-live .story__rail {
  display: flex; gap: 10px; position: absolute; left: var(--margin); bottom: 40px; z-index: 2;
}
.story__rail i {
  width: 18px; height: 16px; background: rgba(255, 255, 255, 0.28);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); transition: background-color 250ms ease;
}
.story[data-beat="0"] .story__rail i:nth-child(-n + 1),
.story[data-beat="1"] .story__rail i:nth-child(-n + 2),
.story[data-beat="2"] .story__rail i:nth-child(-n + 3),
.story[data-beat="3"] .story__rail i:nth-child(-n + 4) { background: var(--amber); }

@media (max-width: 767px) {
  .beat { row-gap: 32px; }
  .beat__copy, .beat__art { grid-column: 1 / -1; }
  .scene.is-live.story .scene-stage { align-items: center; padding-top: 0; }
  .scene.is-live .beat { align-content: center; }
  .scene.is-live .beat__copy p { margin-top: 14px; }
  .scene.is-live .beat__copy .display { font-size: 10vw; }
}

/* ===================== Fleet ===================== */
.fleet { background: var(--ground); }
.fleet .scene-stage { padding: var(--gap-section) var(--margin) 0; }
.fleet__copy { position: relative; min-height: 9.5em; }
.fleet__copy .display { max-width: 14em; }
.fleet__cap { margin-top: 16px; max-width: 46ch; }
.fleet__cap--start { display: none; }
.fleet__grid {
  margin-top: 48px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  transform-origin: 50% 50%;
}
.asset { border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; transition: opacity 200ms ease; }
.asset b, .asset span { grid-column: 1; min-width: 0; }
.asset b { white-space: nowrap; font-weight: 600; font-size: 17px; color: #0f2233; display: block; }
.asset span { font-size: 14px; color: #4b6074; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset i { font-style: normal; font-weight: 700; font-size: 28px; line-height: 1; grid-row: 1 / span 2; grid-column: 2; }
/* a heat map of the plant: the tile's colour is its grade */
.g-A { background: #e2f1e6; } .g-A i { color: #1f7a3d; }
.g-B { background: #dfeaf6; } .g-B i { color: #004a88; }
.g-C { background: #fcecc9; } .g-C i { color: #8a5a00; }
.g-D { background: #f8dcd8; } .g-D i { color: #a3241a; }
.asset.is-urgent { background: var(--amber); }
.asset.is-urgent span { color: #3b2a00; }
.asset.is-urgent i { color: #062b45; }
/* finished composition: the three urgent ones stand out, the rest recede */
.fleet__grid .asset:not(.is-urgent) { opacity: 0.5; }

.scene.is-live.fleet .scene-stage { padding: 56px var(--margin) 0; display: flex; flex-direction: column; }
.scene.is-live .fleet__copy { min-height: 0; }
.scene.is-live .fleet__cap { position: absolute; left: 0; top: 100%; margin-top: 12px; }
.scene.is-live .fleet__cap--start { display: block; }
.scene.is-live .fleet__copy { margin-bottom: 64px; }
.scene.is-live .fleet__grid { margin-top: 24px; }
.scene.is-live .fleet__grid .asset:not(.is-urgent) { opacity: 1; }
.scene.is-live .asset.is-urgent { background: #f8dcd8; }
.scene.is-live .asset.is-urgent span { color: #4b6074; }
.scene.is-live .asset.is-urgent i { color: #a3241a; }

@media (max-width: 767px) {
  .fleet__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fleet__grid .asset:nth-child(n + 13) { display: none; }
  .asset { padding: 12px; }
  .asset i { font-size: 22px; }
}

/* live fleet: the copy is an opaque band above the grid, so the zooming cards never cross the words */
.scene.is-live .fleet__copy { position: relative; z-index: 2; background: var(--ground); display: grid; padding-bottom: 20px; margin-bottom: 0; }
.scene.is-live .fleet__copy .display { grid-row: 1; grid-column: 1; }
.scene.is-live .fleet__cap { position: static; grid-row: 2; grid-column: 1; margin-top: 16px; }
.scene.is-live .fleet__grid { position: relative; z-index: 1; }
