/* How It Goes: The Show.
   One sheet of glass holds all four steps, parted by hairlines that stand in the gutters of the page's grid.
   Each step has a very large number, a station on one rail, and its words. A blue line runs the rail from
   step 1 to Launch and the brand's blue square rides it; a pane of light inside the glass travels with it.
   It uses the page's own tokens and adds none. Every class here starts with shw.

   The picture with scripts off is the settled picture: every rule below draws that first, and the states that
   steps.js switches on (is-live, is-armed, is-wait, is-on, is-lit, is-in, is-landed, is-near) only take away
   from it or play once. Everything that moves is a transform or an opacity. */

.shw { position: relative; isolation: isolate; --num: 80px; --num-box: 54px; --sq: 16px; --shw-ease: cubic-bezier(0.2, 0.7, 0.2, 1); --shw-roll: cubic-bezier(0.3, 1.25, 0.4, 1); }
.shw__slab { display: block; }
.shw__list { position: relative; z-index: 1; }

/* What lies inside the glass and is cut to its corners: the pane of light, the light under the pointer, the sheen. */
.shw__fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.shw__fx i { position: absolute; left: 0; top: 0; display: none; }
.shw.is-live .shw__fx i { display: block; }
/* the pane of light: a plain white field that steps.js stretches over the step that is forward */
.shw__lit { width: 100px; height: 100px; transform-origin: 0 0; opacity: 0; transition: opacity 0.5s ease; will-change: transform; }
.shw__lit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #fff 55%, #F3F5FF 100%); }
.shw.is-on .shw__lit { opacity: 1; }
/* below a computer the light does not ride with the scroll: it steps to the step that has been reached */
.shw.is-col .shw__lit { transition: opacity 0.5s ease, transform 0.55s var(--shw-ease); }
/* a soft light under the pointer, on a computer */
.shw__glow { width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; opacity: 0; transition: opacity 0.4s ease; will-change: transform; background: radial-gradient(closest-side, rgba(47, 75, 255, 0.09), rgba(47, 75, 255, 0.04) 45%, rgba(47, 75, 255, 0)); }
.shw.is-near .shw__glow { opacity: 1; }
/* one sheen across the glass as the square lands on Launch */
.shw__sheen { top: -10% !important; width: 28%; height: 120%; opacity: 0; transform: translateX(-140%) skewX(-14deg); background: linear-gradient(90deg, rgba(47, 75, 255, 0), rgba(47, 75, 255, 0.03) 25%, rgba(47, 75, 255, 0.1) 50%, rgba(47, 75, 255, 0.03) 75%, rgba(47, 75, 255, 0)); }

/* ---------- One step. Below a computer: the rail down the left, the number, then the words ---------- */
.shw__step {
  position: relative; grid-column: 1 / -1;
  display: grid; grid-template-columns: var(--sq) minmax(0, 1fr); column-gap: var(--s-16); row-gap: var(--s-16); align-items: start;
  padding: var(--inset); -webkit-tap-highlight-color: transparent;
}
.shw.is-live .shw__step { cursor: pointer; }
/* the hairline between two steps */
.shw__step:not(:last-child)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5px; height: 1px; background: var(--rule); pointer-events: none; }
/* with scripts off there is no travelling light, so Launch is lit where it stands */
.shw:not(.is-live) .shw__step:last-child::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #fff 55%, #F3F5FF 100%); border-radius: 0 0 var(--r-2) var(--r-2); }

/* The number, very large, in the headline face. Its box is exactly as tall as a numeral (0.675 of the size in
   this face) and it is pulled left by the numeral's own side bearing, so its ink starts on the inset line.
   Two numerals lie one under the other in a window, soft at the top and the foot: an outline, and the solid one.
   The solid one rolls up into the window as the line reaches the step. */
.shw__no {
  position: relative; grid-column: 2; display: block; width: -moz-fit-content; width: fit-content; min-width: var(--s-56); height: var(--num-box);
  margin: 0; padding: 0; border: 0; background: none; text-align: left;
  font: 700 var(--num)/var(--num-box) var(--display); letter-spacing: -0.05em; color: var(--ink); -webkit-tap-highlight-color: transparent;
}
button.shw__no { -webkit-appearance: none; appearance: none; cursor: pointer; }
.shw__no:focus-visible { outline: 2px solid var(--focus); outline-offset: 8px; border-radius: var(--r-1); }
.shw__num {
  display: block; height: calc(var(--num-box) + 32px); margin-top: -16px; padding-right: var(--s-8); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.shw__num > span { display: block; transform: translateY(-50%); transition: transform 0.75s var(--shw-roll); will-change: transform; }
.shw__num i, .shw__num b { display: block; height: calc(var(--num-box) + 32px); padding-top: 16px; box-sizing: border-box; font: inherit; font-style: normal; text-indent: -0.0125em; }
.shw__num i { color: #fff; -webkit-text-stroke: 3px rgba(11, 13, 18, 0.2); paint-order: stroke fill; }
.shw__step:last-child .shw__num b { color: var(--accent); }
/* the one that is out of the window is put out of sight once the roll is over */
.shw__num i { visibility: hidden; transition: visibility 0s linear 0.75s; }
.shw.is-live .shw__num b { transition: visibility 0s; }
.shw.is-live .shw__step:not(.is-lit) .shw__num i { visibility: visible; transition: visibility 0s; }
.shw.is-live .shw__step:not(.is-lit) .shw__num b { visibility: hidden; transition: visibility 0s linear 0.5s; }
.shw.is-live .shw__step:not(.is-lit) .shw__num > span { transform: translateY(0); transition-duration: 0.5s; transition-timing-function: var(--shw-ease); }

/* The rail: a station for each step, and the line from one station to the next. */
.shw__rail { position: relative; grid-column: 1; grid-row: 1 / span 2; align-self: stretch; display: block; width: var(--sq); --dot-top: calc((var(--num-box) - var(--sq)) / 2); }
.shw__dot { position: absolute; left: 0; top: var(--dot-top); width: var(--sq); height: var(--sq); border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 1px rgba(11, 13, 18, 0.2); }
.shw__dot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transition: opacity 0.25s ease; }
.shw:not(.is-live) .shw__step:last-child .shw__dot::before { background: var(--accent); }
.shw.is-live .shw__step:not(.is-lit) .shw__dot::before { opacity: 0; }
.shw__seg { position: absolute; left: 7px; width: 2px; top: calc(var(--dot-top) + var(--sq)); bottom: calc(-2 * var(--inset) - var(--dot-top)); pointer-events: none; }
.shw__seg::before { content: ""; position: absolute; inset: 0 auto 0 0.5px; width: 1px; background: var(--rule); }
.shw__seg i { position: absolute; inset: 0; background: var(--accent); transform-origin: 50% 0; transform: scaleY(var(--f, 1)); will-change: transform; }

/* The words. */
.shw__say { grid-column: 2; }
.shw__say p { margin-top: var(--s-4); }

/* The square: the brand's full stop. steps.js moves it and stretches it the way it is going. */
.shw__sq { display: none; position: absolute; left: 0; top: 0; z-index: 2; width: var(--sq); height: var(--sq); pointer-events: none; opacity: 0; transition: opacity 0.25s ease; will-change: transform; }
.shw.is-live .shw__sq { display: block; }
.shw.is-on .shw__sq { opacity: 1; }
.shw__sq i { display: block; width: 100%; height: 100%; border-radius: 3px; background: var(--accent); box-shadow: 0 4px 12px -2px rgba(47, 75, 255, 0.55); will-change: transform; }
.shw__sq::after { content: ""; position: absolute; inset: 0; border-radius: 3px; box-shadow: 0 0 0 2px var(--accent); opacity: 0; }

/* ---------- The entrance ---------- */
/* before a step has been reached its words wait a little low and clear; they arrive one after the other */
.shw.is-armed .shw__say > * { transition: opacity 0.5s ease, transform 0.7s var(--shw-ease); }
.shw.is-armed .shw__say > p { transition-delay: 0.09s; }
.shw.is-armed .shw__step:not(.is-in) .shw__say > * { opacity: 0; transform: translateY(12px); }
/* on a computer the whole sheet rises first */
.shw.is-armed .shw__slab { transition: opacity 0.6s ease, transform 0.8s var(--shw-ease); }
.shw.is-wait .shw__slab { opacity: 0; transform: translateY(24px); }
/* the landing on Launch: one ring from the square, one sheen across the glass, once */
.shw.is-landed .shw__sq::after { animation: shw-ring 0.9s var(--shw-ease) 1 both; }
.shw.is-landed .shw__sheen { animation: shw-sheen 1s cubic-bezier(0.45, 0, 0.3, 1) 1 both; }
@keyframes shw-ring { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(3.5); } }
@keyframes shw-sheen { 0% { opacity: 0; transform: translateX(-140%) skewX(-14deg); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(400%) skewX(-14deg); } }

/* ---------- From a large phone up: the number beside its words, on the page's columns ---------- */
@media (min-width: 600px) {
  .shw { --num: 96px; --num-box: 65px; }
  .shw__step { grid-template-columns: subgrid; row-gap: 0; padding: var(--s-32) 0; align-items: start; }
  .shw__rail { grid-row: 1; margin-left: var(--inset); }
  .shw__no { grid-column: 2 / span 2; grid-row: 1; }
  .shw__say { grid-column: 4 / -1; grid-row: 1; padding-right: var(--inset); }
  .shw__seg { bottom: calc(-2 * var(--s-32) - var(--dot-top)); }
}

/* ---------- Computer: four in a row. The number, the rail under it, the words under that ---------- */
@media (max-width: 1199px) {
  .shw__sheen { display: none !important; }
}
@media (min-width: 1200px) {
  .shw { --num: 128px; --num-box: 86px; }
  .shw__step { grid-column: span 3; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--num-box) var(--sq) 1fr; row-gap: var(--s-24); align-items: start; padding: var(--s-32) var(--inset); }
  .shw__step:not(:last-child)::after { left: auto; right: calc(var(--gutter) / -2 - 0.5px); top: 0; bottom: 0; width: 1px; height: auto; }
  .shw:not(.is-live) .shw__step:last-child::before { left: calc(var(--gutter) / -2); border-radius: 0 var(--r-2) var(--r-2) 0; }
  .shw__no { grid-column: 1; grid-row: 1; }
  .shw__rail { grid-column: 1; grid-row: 2; width: auto; height: var(--sq); margin-left: 0; --dot-top: 0px; }
  .shw__say { grid-column: 1; grid-row: 3; padding-right: 0; }
  .shw__say h3 { min-height: calc(var(--d4-lh) * 2); }
  .shw__say p { margin-top: var(--s-8); }
  .shw__seg { left: var(--sq); top: 7px; bottom: auto; width: calc(100% + 2 * var(--inset) + var(--gutter) - var(--sq)); height: 2px; }
  .shw__seg::before { inset: 0.5px 0 auto 0; width: auto; height: 1px; }
  .shw__seg i { transform-origin: 0 50%; transform: scaleX(var(--f, 1)); }
}

/* No movement asked for: every change of state is at once. (The page's own rule already stops transitions;
   this is here so the section keeps its promise when it is used alone.) */
@media (prefers-reduced-motion: reduce) {
  .shw *, .shw *::before, .shw *::after { transition: none !important; animation: none !important; }
  .shw__glow, .shw__sheen { display: none !important; }
}
