/* Our Infrastructure. Loaded after site.css and page.css.
   The pictures lie end to end in one long strip with the yellow line along it. The whole strip is turned by --a, so the line
   crosses the screen from the top left to the bottom right, and it is moved along the line only, so the line never moves.
   --H: the height of the strip, just enough to cover the turned screen. Everything in it is a share of --H, as in the pictures:
   a tile is 1.26 long, the line is .45 down (tools/build-infrastructure.py: 2016, 1600 and 720 pixels). */
.oneline { --vh: max(100vh, 20rem); --H: calc((var(--vh) * .88295 + 100vw * .46947) * 1.012); --px: calc(var(--H) / 1600); position: relative; background: var(--ink); color: var(--white); }
.live .oneline { height: 585vh; }
.oneline__pin { position: relative; overflow: clip; }
.live .oneline__pin { position: sticky; top: 0; height: 100vh; height: var(--vh); }

.strip { position: absolute; left: 0; top: 0; display: flex; width: calc(6.72 * var(--H)); height: var(--H); transform-origin: 0 0; will-change: transform; }
.tile { position: relative; flex: none; width: calc(1.26 * var(--H) + 1px); height: 100%; margin-right: -1px; overflow: clip; }   /* a pixel over each other: no hair between two pictures */
.tile--start { width: calc(.42 * var(--H) + 1px); }
.tile img { width: 100%; height: 100%; max-width: none; object-fit: cover; }

/* the paint: a strip 35 pixels high, with the line in the middle of it. It is uncovered from the left. */
.paint { position: absolute; left: calc(var(--at, 0) * var(--H) - 1px); top: calc(703 * var(--px)); width: calc(1.26 * var(--H) + 2px); height: calc(35 * var(--px)); overflow: clip; }
.paint--first { width: calc(1.68 * var(--H) + 2px); }
.paint div { display: flex; width: 100%; height: 100%; }
.paint img { flex: none; width: calc(1.26 * var(--H) + 2px); height: 100%; max-width: none; }
.paint--first img:first-child { width: calc(.42 * var(--H)); }
.live .paint, .live .paint div { will-change: transform; }

/* the line as it is seen from far away: the same line, kept wide enough to see, and longer than the pictures */
.strip__all { position: absolute; left: calc(-12 * var(--H)); width: calc(32 * var(--H)); top: calc(712.5 * var(--px)); height: calc(15 * var(--px)); background: var(--yellow); opacity: 0; }

.convoy { position: absolute; left: calc(1.68 * var(--H)); top: 0; width: calc(1.26 * var(--H)); height: 100%; overflow: clip; }
.convoy img { position: absolute; left: calc(var(--x) * var(--px)); top: calc(var(--y) * var(--px)); width: calc(var(--w) * var(--px)); max-width: none; height: auto; will-change: transform; }

/* the words stand still in the corner under the line */
.oneline__shade { position: absolute; inset: 0; background: linear-gradient(208deg, rgb(9 12 16 / 0) 50%, rgb(9 12 16 / .78) 78%, rgb(9 12 16 / .93)); opacity: .55; }
.leg__h { margin: 0; font-size: min(6.1vw, 12.6svh); font-weight: 600; line-height: .94; letter-spacing: -.05em; }
.leg__h span { display: block; }
.leg .page-h { font-size: min(4.5vw, 9.4svh); }
.leg .page-lead { max-width: 26em; margin-top: .9em; }
.leg .btn { margin-top: 1.4rem; background: var(--white); }            /* only the line is yellow */
.leg .btn:hover { background: var(--yellow); }
.live .leg { position: absolute; left: var(--gut); bottom: calc(clamp(1.8rem, 5.4svh, 3.6rem) + var(--bar)); max-width: 62vw; opacity: 0; will-change: transform, opacity; }
.live .leg--first { opacity: 1; }
.live .leg--ink { color: var(--ink); }
.live .leg__still { display: none; }

/* the whole line, level: the pictures lie between the two, and JS puts them there */
.network { --band: 54svh; }          /* where the line is on the screen once it is level */
.network__h { margin: 0; font-size: min(5vw, 10.6svh); font-weight: 600; line-height: 1; letter-spacing: -.042em; }
.network__h span + span { color: #8d8d88; }
.network__list { display: grid; grid-template-columns: repeat(5, 1fr); }
.network__list a { display: block; padding: .2rem 1.4rem 1rem 0; font-size: clamp(1.0625rem, 1.5vw, 1.8rem); line-height: 1.16; letter-spacing: -.022em; }
.network__list b { font-weight: 600; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--out); }
.network__list a:is(:hover, :focus-visible) b { background-size: 100% 2px; }
.live .network { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.live .network.is-on { pointer-events: auto; }
.live .network__h { position: absolute; left: var(--gut); top: max(5.4rem, 13.5svh); }
.live .network__list { position: absolute; left: var(--gut); right: var(--gut); top: calc(var(--band) + (100vw - 2 * var(--gut)) / 6.3 * .55 + 1.4rem); }

/* the opening: the picture is there first, then the line is painted, then the words */
.live .oneline:not(.is-in) .paint--first { visibility: hidden; }
.live .is-in .paint--first { animation: paint-a 1.7s .3s cubic-bezier(.5, .05, .25, 1) backwards; }
.live .is-in .paint--first > div { animation: paint-b 1.7s .3s cubic-bezier(.5, .05, .25, 1) backwards; }
@keyframes paint-a { from { transform: translateX(-100%); } }
@keyframes paint-b { from { transform: translateX(100%); } }
.live .leg--first :is(h1 span, p) { animation: line-rise 1s var(--out) backwards; animation-delay: calc(.75s + var(--i, 0) * .09s); }
.leg--first h1 span:nth-child(2) { --i: 1; }
.leg--first h1 span:nth-child(3) { --i: 2; }
.leg--first p { --i: 3.4; }
@keyframes line-rise { from { opacity: 0; translate: 0 .35em; } }

/* ---------- standing still (calm, or without scripts) ----------
   Every picture is exactly as high as the line falls across it, so the line runs from corner to corner, and every second one
   is mirrored: it leaves each picture where the next one begins. */
html:not(.live) .oneline__pin { display: flex; flex-direction: column; }
html:not(.live) .oneline__shade { display: none; }
html:not(.live) .tile--start { visibility: hidden; }
html:not(.live) .leg { position: relative; }
html:not(.live) .leg__still { --s: calc(100vw * 1.0434); position: relative; height: calc(100vw * .53171); overflow: clip; }
html:not(.live) .leg__still img { position: absolute; left: 0; top: 0; width: calc(1.26 * var(--s)); height: var(--s); max-width: none; transform-origin: 0 0; transform: rotate(28deg) translate(calc(var(--u) * -1 * var(--s)), calc(-.45 * var(--s))); }
html:not(.live) .leg__still img + img { height: calc(var(--s) * 35 / 1600); transform: rotate(28deg) translate(calc(var(--u) * -1 * var(--s)), calc(var(--s) * -17 / 1600)); }
html:not(.live) .leg:nth-of-type(even) .leg__still { transform: scaleX(-1); }
html:not(.live) .leg__still::after { content: ""; position: absolute; inset: 0; background: linear-gradient(208deg, rgb(9 12 16 / 0) 50%, rgb(9 12 16 / .78) 80%, rgb(9 12 16 / .93)); }
html:not(.live) .leg--ink .leg__still::after { content: none; }
html:not(.live) .leg__words { position: absolute; left: var(--gut); bottom: clamp(1.4rem, 3vw, 3.6rem); max-width: 60%; }
html:not(.live) .leg:nth-of-type(even) .leg__words { left: auto; right: var(--gut); max-width: 44%; }
html:not(.live) .leg--ink .leg__words { color: var(--ink); }
html:not(.live) .network { display: contents; }
html:not(.live) .network__h { order: 2; padding: clamp(4rem, 8vw, 8rem) var(--gut) clamp(2rem, 3.4vw, 3.4rem); }
html:not(.live) .strip { --H: calc((100vw - 2 * var(--gut)) / 6.3); --px: calc(var(--H) / 1600); position: relative; order: 3; flex: none; margin-left: calc(var(--gut) - .42 * var(--H)); }
html:not(.live) .paint--first img:first-child { visibility: hidden; }
html:not(.live) .strip__all { height: 4px; margin-top: -1px; opacity: 1; }
html:not(.live) .network__list { order: 4; padding: 1.4rem var(--gut) clamp(3rem, 6vw, 6rem); }

/* ---------- upright screens ---------- */
@media (max-width: 800px), (max-aspect-ratio: 9/10) {
  .leg__h { font-size: min(12.4vw, 7.6svh); }
  .leg .page-h { font-size: min(9.6vw, 6.4svh); }
  .live .leg { max-width: none; right: var(--gut); }
  .leg .page-lead { max-width: 24em; }
  .network__h { font-size: min(10.6vw, 6.4svh); }
}
/* on an upright screen the whole line stands up, with a name beside each picture */
@media (max-aspect-ratio: 9/10) {
  .network__h span { display: block; }
  .live .network__h { left: calc(var(--gut) + 11svh + 7vw); top: max(5rem, 11svh); font-size: min(8.5vw, 6.4svh); }          /* beside the line, not under it */
  .live .network__list { left: calc(var(--gut) + 11svh + 7vw); top: calc(max(5rem, 11svh) + min(8.5vw, 6.4svh) * 2 + 3svh); bottom: calc(4svh + var(--bar)); grid-template-columns: 1fr; grid-template-rows: repeat(5, 1fr); }
  .live .network__list li { display: grid; align-items: center; }
  .live .network__list a { padding: .5rem 0; font-size: clamp(1.25rem, 3.4vw, 2rem); }
}
@media (max-width: 800px) {
  html:not(.live) :is(.leg, .leg--ink, .leg:nth-of-type(even)) .leg__words { position: static; max-width: none; padding: 1.6rem var(--gut) 2.2rem; border: solid var(--yellow); border-width: 0 calc(100vw * 1.0434 * 15 / 1600) 0 0; color: var(--white); }
  html:not(.live) .leg:nth-of-type(even) .leg__words { border-width: 0 0 0 calc(100vw * 1.0434 * 15 / 1600); }
  html:not(.live) .leg__still::after { content: none; }
  html:not(.live) .network__list { grid-template-columns: 1fr; gap: .4rem; }
}
