/* GTM (v16): "What I bring with me." One lead, travelling the whole machine. The machine is drawn on one 2D
   canvas (gtm.js); this file sets the words that stand beside it. The film layout is the default. Reduced motion
   (.is-reduced) or no script engine (.g-flat) turns the same markup into a plain, complete section. */
#gtm { position: relative; background: #01030a; }

/* the chapter title and its line, top left */
#gtm .g-head { position: absolute; left: 0; top: clamp(10px, 4vh, 44px); width: min(100%, 1100px); }
#gtm .g-head .mg-mask { display: block; }
#gtm .g-head .mg-mask > b { display: block; transform: translateY(122%); text-wrap: balance; }
#gtm .g-sub { margin-top: clamp(12px, 2vh, 20px); max-width: 36ch; color: var(--soft); text-wrap: pretty; opacity: 0; will-change: opacity, transform; }

/* the five beats share one place, bottom left; one is on at a time */
#gtm .g-beats { list-style: none; position: absolute; left: 0; bottom: 0; width: min(100%, 720px); display: grid; align-items: end; }
#gtm .g-beat { grid-area: 1 / 1; }
#gtm .g-beat .mg-mask { display: block; }
#gtm .g-beat .mg-mask > b { display: block; transform: translateY(122%); text-wrap: balance; }
#gtm .g-beat .mg-lead { margin-top: clamp(10px, 1.6vh, 16px); color: var(--ink); text-wrap: pretty; opacity: 0; will-change: opacity, transform; }
@media (min-width: 900px) { #gtm .g-beat .mg-mask > b, #gtm .g-head .mg-mask > b { white-space: nowrap; } }

/* the stations in order: in the film the picture carries them, so this list is for a screen reader only */
#gtm .g-flow { list-style: none; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 899px) {
  #gtm .g-head { top: 12px; width: 100%; }
  #gtm .g-sub { margin-top: 12px; max-width: none; }
  #gtm .g-beats { width: 100%; }
  #gtm .g-beat .mg-lead { margin-top: 10px; }
}
/* a phone on its side, or a very short window: the type steps down so the picture keeps its room */
@media (max-height: 520px) {
  #gtm .g-sub { font-size: 15px; max-width: 60ch; }
  #gtm .g-beat .mg-beat { font-size: 26px; }
  #gtm .g-beat .mg-lead { font-size: 15px; }
}

/* ---- reduced motion, or no script engine: nothing is pinned, nothing is drawn. The same words, set as a page:
   the title, its line, the stations in order on one line, then the five beats. ---- */
.is-reduced #gtm .mg-art, #gtm.g-flat .mg-art { display: none; }
#gtm.g-flat .mg-pin { height: auto; }
#gtm.g-flat .mg { position: relative; height: auto; min-height: 100svh; }
#gtm.g-flat .mg-safe { position: relative; left: auto; right: auto; top: auto; bottom: auto; padding: calc(96px + env(safe-area-inset-top, 0px)) var(--pad-r) 64px var(--pad-l); }
.is-reduced #gtm .mg-safe, #gtm.g-flat .mg-safe { max-width: 1240px; }
.is-reduced #gtm .g-head, .is-reduced #gtm .g-beats, .is-reduced #gtm .g-flow,
#gtm.g-flat .g-head, #gtm.g-flat .g-beats, #gtm.g-flat .g-flow { position: relative; left: auto; top: auto; bottom: auto; width: auto; }
.is-reduced #gtm .g-head .mg-mask > b, .is-reduced #gtm .g-beat .mg-mask > b, #gtm.g-flat .g-head .mg-mask > b, #gtm.g-flat .g-beat .mg-mask > b { transform: none; }
.is-reduced #gtm .g-sub, .is-reduced #gtm .g-beat .mg-lead, #gtm.g-flat .g-sub, #gtm.g-flat .g-beat .mg-lead { opacity: 1; }
.is-reduced #gtm .g-sub, #gtm.g-flat .g-sub { max-width: 44ch; }

/* the stations: one white line, each name under it in order. No dots: on this site a white dot is a person */
.is-reduced #gtm .g-flow, #gtm.g-flat .g-flow {
  height: auto; overflow: visible; clip: auto; white-space: normal;
  display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); margin-top: clamp(40px, 7vh, 72px);
}
.is-reduced #gtm .g-flow li, #gtm.g-flat .g-flow li {
  position: relative; padding: 18px 8px 0 0; border-top: var(--mg-stroke) solid var(--ink);
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; color: var(--ink);
}

.is-reduced #gtm .g-beats, #gtm.g-flat .g-beats { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; column-gap: clamp(32px, 6vw, 96px); margin-top: clamp(40px, 7vh, 72px); }
.is-reduced #gtm .g-beat, #gtm.g-flat .g-beat { grid-area: auto; padding: 26px 0 30px; border-top: 1px solid var(--line); }
.is-reduced #gtm .g-beat .mg-beat, #gtm.g-flat .g-beat .mg-beat { font-size: clamp(26px, 2.6vw, 38px); }
.is-reduced #gtm .g-beat .mg-lead, #gtm.g-flat .g-beat .mg-lead { margin-top: 12px; max-width: 42ch; color: var(--soft); }
.is-reduced #gtm .g-beat:last-child, #gtm.g-flat .g-beat:last-child { grid-column: 1 / -1; }
.is-reduced #gtm .g-beat:last-child .mg-lead, #gtm.g-flat .g-beat:last-child .mg-lead { max-width: 60ch; color: var(--ink); }

@media (max-width: 1099px) {
  /* the line runs down the page instead of across it */
  .is-reduced #gtm .g-flow, #gtm.g-flat .g-flow { grid-template-columns: minmax(0, 1fr); margin-top: 36px; margin-left: 5px; }
  .is-reduced #gtm .g-flow li, #gtm.g-flat .g-flow li { padding: 0 0 15px 22px; border-top: 0; border-left: var(--mg-stroke) solid var(--ink); font-size: 16px; line-height: 1.2; }
  .is-reduced #gtm .g-flow li:last-child, #gtm.g-flat .g-flow li:last-child { padding-bottom: 0; border-left-color: transparent; }
}
@media (max-width: 899px) {
  .is-reduced #gtm .g-beats, #gtm.g-flat .g-beats { grid-template-columns: minmax(0, 1fr); margin-top: 36px; }
  .is-reduced #gtm .g-beat, #gtm.g-flat .g-beat { padding: 20px 0 24px; }
}

/* reduced motion: the picture is the last frame, still, under the title; the list stays for a screen reader */
.is-reduced #gtm .g-still { position: relative; width: min(1312px, calc(100vw - var(--pad-l) - var(--pad-r) - 20px)); height: clamp(300px, 27vw, 460px); margin-top: clamp(28px, 5vh, 56px); }
.is-reduced #gtm .g-still canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 699px) { .is-reduced #gtm .g-still { width: auto; height: 440px; margin-left: calc(10px - var(--pad-l)); margin-right: calc(10px - var(--pad-r)); } }
.is-reduced #gtm.g-has-still .g-flow { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; display: block; }
