/* ==========================================================================
   Film v2: "cinematic chapters" styling for the six film sections.
   Optional layer on top of site.css. To go back to the previous look, delete
   the film-v2 <link> and <script> lines in index.html.
   Everything that hides or animates content is scoped to #world.fx, which
   js/film-v2.js adds, so nothing disappears if the script doesn't run.
   ========================================================================== */

/* Scrims: bottom-weighted lower third + a soft top fade behind the header */
.fx .sw-copylayer::before {
  inset: auto 0 0 0; width: 100%; height: 66%;
  background: linear-gradient(0deg,
    rgba(6, 7, 9, .95) 0%, rgba(6, 7, 9, .74) 30%, rgba(6, 7, 9, .3) 64%, transparent 100%);
}
.fx .sw-copylayer::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 190px;
  background: linear-gradient(180deg, rgba(6, 7, 9, .62), transparent);
}

/* Copy: lower-third grid. Title block left, instrument readouts right */
.fx .sw-copy {
  top: auto; bottom: 112px; left: var(--pad); right: var(--pad);
  width: auto; max-width: none;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 120px); align-items: end;
}
.fx .sw-copy > * { grid-column: 1; }
.fx .sw-copy__num { display: none; }

.fx .sw-copy__eyebrow { margin-top: 0; display: flex; align-items: center; gap: 14px; }
.fx .sw-copy__eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; flex: none; }
.fx .sw-copy__title {
  font-size: clamp(2.6rem, 5.2vw, 5.4rem); line-height: .97; letter-spacing: -.036em;
  margin-top: 20px; max-width: 14ch; text-shadow: none;
}
.fx .sw-copy__body { margin-top: 22px; max-width: 44ch; text-shadow: none; color: rgba(237, 239, 236, .74); }
.fx .sw-copy__tags { display: none; }
.fx .sw-copy__cta { margin-top: 30px; }

/* Word-by-word headline reveal */
.fx-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.fx-w > span { display: inline-block; transform: translateY(108%); transition: transform 1.05s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.fx .is-on .fx-w > span { transform: none; }

/* Supporting lines ease in after the headline */
.fx .sw-copy__eyebrow, .fx .sw-copy__body, .fx .sw-copy__cta, .fx .fx-scroll {
  opacity: 0; transform: translateY(12px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.fx .is-on .sw-copy__eyebrow { opacity: 1; transform: none; }
.fx .is-on .sw-copy__body { opacity: 1; transform: none; transition-delay: .28s; }
.fx .is-on .sw-copy__cta { opacity: 1; transform: none; transition-delay: .42s; }
.fx .is-on .fx-scroll { opacity: 1; transform: none; transition-delay: .6s; }

/* Instrument readouts */
.fx-stats {
  grid-column: 2 !important; grid-row: 1 / span 3; align-self: end;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; margin: 0;
}
.fx-stat { position: relative; padding-top: 16px; border-top: 1px solid rgba(237, 239, 236, .2);
  opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.fx-stat::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px;
  background: var(--sw-accent); transform: scaleX(0); transform-origin: left;
  transition: transform 1.2s var(--ease);
}
.fx-stat:nth-child(2) { transition-delay: .1s; } .fx-stat:nth-child(2)::before { transition-delay: .1s; }
.fx-stat:nth-child(3) { transition-delay: .2s; } .fx-stat:nth-child(3)::before { transition-delay: .2s; }
.fx .is-on .fx-stat { opacity: 1; transform: none; }
.fx .is-on .fx-stat::before { transform: scaleX(1); }
.fx-stat dt { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.fx-stat dd {
  margin: 14px 0 0; font-family: var(--f-display); font-stretch: 100%; font-weight: 300;
  font-size: clamp(2rem, 3.3vw, 3.4rem); line-height: 1; letter-spacing: -.035em;
  color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.fx-stat small { font-family: var(--f-mono); font-size: .72rem; font-weight: 400; letter-spacing: 0; color: var(--mute); margin-left: 6px; }

/* 01 Ignite + 06 Launch: centred title cards that sit below the scooters */
.fx .sw-copy:first-of-type, .fx .sw-copy:last-of-type {
  grid-template-columns: 1fr; justify-items: center; text-align: center; bottom: 100px;
}
.fx .sw-copy:first-of-type .sw-copy__eyebrow::after,
.fx .sw-copy:last-of-type .sw-copy__eyebrow::after { content: ""; width: 32px; height: 1px; background: currentColor; flex: none; }
.fx .sw-copy:first-of-type .sw-copy__title,
.fx .sw-copy:last-of-type .sw-copy__title { max-width: none; font-size: clamp(2.2rem, 3.7vw, 3.8rem); margin-top: 16px; }
.fx .sw-copy:first-of-type .sw-copy__body,
.fx .sw-copy:last-of-type .sw-copy__body { margin: 16px auto 0; max-width: 72ch; }
.fx .sw-copy:last-of-type .sw-copy__cta { justify-content: center; margin-top: 26px; }
.fx-scroll {
  margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
}
.fx-scroll i { width: 1px; height: 26px; background: rgba(237, 239, 236, .2); position: relative; overflow: hidden; }
.fx-scroll i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: fx-drop 1.8s var(--ease) infinite; }
@keyframes fx-drop { to { top: 100%; } }
.fx ~ .sw-hint, .fx .sw-hint { display: none; }

/* Chapter bar (replaces the dot rail) */
.fx .sw-route { display: none; }
.fx-chapters {
  position: fixed; z-index: 45; left: var(--pad); right: var(--pad); bottom: 34px;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px;
  transition: opacity .5s;
}
.fx-chapters button {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: block;
  padding-top: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); transition: color .4s;
}
.fx-chapters button::before, .fx-chapters button::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
}
.fx-chapters button::before { background: rgba(237, 239, 236, .16); }
.fx-chapters button::after {
  background: var(--c, var(--ink)); transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease), background .4s;
}
.fx-chapters button.is-past::after { transform: scaleX(1); background: rgba(237, 239, 236, .45); }
.fx-chapters button.is-active::after { transform: scaleX(1); height: 2px; top: -.5px; }
.fx-chapters button.is-active, .fx-chapters button:hover { color: var(--ink); }
.fx-chapters button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.fx-chapters b { font-weight: 400; margin-right: 10px; opacity: .55; }
body.past-film .fx-chapters { opacity: 0; pointer-events: none; }

/* ---------------- Phones / narrow ---------------- */
@media (max-width: 860px) {
  .fx .sw-copylayer::before { height: 78%; }
  .fx .sw-copy { grid-template-columns: 1fr; bottom: calc(58px + env(safe-area-inset-bottom)); }
  .fx .sw-copy__title { font-size: clamp(2rem, 8.6vw, 2.9rem); max-width: none; margin-top: 14px; }
  .fx .sw-copy__body { margin-top: 14px; font-size: .98rem; }
  .fx-stats { grid-column: 1 !important; grid-row: auto; margin-top: 22px; gap: 0 14px; }
  .fx-stat { padding-top: 12px; }
  .fx-stat dt { font-size: .56rem; letter-spacing: .1em; }
  .fx-stat dd { font-size: clamp(1.35rem, 6vw, 1.8rem); margin-top: 8px; }
  .fx-stat small { font-size: .62rem; margin-left: 3px; }
  .fx .sw-copy:first-of-type, .fx .sw-copy:last-of-type { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .fx .sw-copy:first-of-type .sw-copy__title,
  .fx .sw-copy:last-of-type .sw-copy__title { font-size: clamp(2rem, 8.6vw, 2.9rem); }
  .fx-scroll i { display: none; }
  .fx-scroll { margin-top: 20px; }
  .fx-chapters { bottom: calc(22px + env(safe-area-inset-bottom)); gap: 6px; }
  .fx-chapters button { padding-top: 0; height: 10px; font-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-w > span, .fx .sw-copy__eyebrow, .fx .sw-copy__body, .fx .sw-copy__cta, .fx .fx-scroll, .fx-stat { transition: none; }
  .fx-scroll i::after { animation: none; }
}
