/* ==== Motion, product pages (loop/tools/combined/motion/product.py): Speedrun, How We Work, Platform,
   Company brain, About. Every rule starts with html.m-on: with motion off the page is the locked page. What each
   part does and why is written beside it in product.js. ==== */

/* ---- Speedrun · the mural: frames over the picture, hidden between frames (product.js shows one at a time) ---- */
html.m-on .m-mural{position:absolute;inset:0;pointer-events:none}
html.m-on .m-mural .m-fr{position:absolute;display:block;opacity:0}
html.m-on .m-mural .m-fr.m-hinting{animation:m-pr-frame calc(240ms / var(--motion-speed)) steps(1,end) 1}
@keyframes m-pr-frame{0%,100%{opacity:1}}
/* the spark's hover area: the gap between the finger and the wing, a little round it */
html.m-on .m-mural__hit{position:absolute;left:45.5%;top:28%;width:13%;height:34%;pointer-events:auto}

/* ---- Speedrun · the week: the picture going out stays under the one dissolving in, its words hidden at once. The
   locked page crossfades the panels over 200ms; with motion on the words change in a cut and the picture dissolves in
   three steps over the last one, so a half-transparent picture never shows the page through it. ---- */
html.m-on .sr .e-wk-panel{transition:none}
html.m-on .sr .e-wk-panel.m-wk-under{visibility:visible;opacity:1;z-index:0}
html.m-on .sr .e-wk-panel.m-wk-under > :not(.pxf){visibility:hidden}
html.m-on .sr .e-wk-panel[data-state="now"]{z-index:1}

/* ---- Speedrun · "Is now really the best time?": windows waiting to open, the opening outline, the close box ---- */
@media screen{html.m-on .sr .d4-w.m-d4-wait > :not(.m-zr), html.m-on .sr .d4-w.m-d4-gone > :not(.m-zr){visibility:hidden}}
html.m-on .sr .d4-w .m-zr{position:absolute;display:block;visibility:visible;opacity:0;pointer-events:none;
  box-shadow:inset 0 0 0 2px var(--color-mute)}
html.m-on .sr .d4-w--on .m-zr{box-shadow:inset 0 0 0 2px var(--color-blue)}
html.m-on .sr .d4-w .win__bar{position:relative}
/* signs that the windows can be handled: a grab cursor on the title bar, a pointer and a pixel cross on the close box */
html.m-on .sr .d4-w .win__bar.m-grab{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
html.m-on .sr .d4-w.m-held .win__bar.m-grab{cursor:grabbing}
html.m-on .sr .d4-w .m-close{position:absolute;left:0;top:0;bottom:0;width:calc(var(--space-3) + 16px);cursor:pointer}
html.m-on .sr .d4-w .m-close::after{content:"";position:absolute;left:var(--space-3);top:calc(50% - 4px);width:8px;height:8px;opacity:0;
  background:var(--color-hair) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM1 1h1v1H1zM2 2h1v1H2zM3 3h1v1H3zM3 0h1v1H3zM2 1h1v1H2zM1 2h1v1H1zM0 3h1v1H0z' fill='%23081D47'/%3E%3C/svg%3E") 0 0/8px 8px no-repeat}
html.m-on .sr .d4-w--on .m-close::after{background-color:var(--color-coral)}
@media (hover:hover) and (pointer:fine){
  html.m-on .sr .d4-w .m-close:hover::after{opacity:1}
}

/* ---- Speedrun · "You walk away with": the five things before they are set down ---- */
@media screen{html.m-on .sr .f2-pack.m-wa-wait .f-ic img{opacity:0}}

/* ---- How We Work · "Who's in the room": the leader lines before they are drawn ---- */
@media screen{html.m-on .hw .d-rm.m-ld-wait .d-ld{clip-path:inset(-8px 100% -8px 0)}}

/* ---- How We Work · "Settled before we build": a box not yet ticked, and the frame it is filled before its tick ---- */
@media screen{html.m-on .hw .w1-ck li.m-unticked::before{background:var(--color-paper);box-shadow:inset 0 0 0 2px var(--color-blue)}}
html.m-on .hw .w1-ck li.m-ticking::before{background:var(--color-blue)}

/* ---- How We Work · the four steps: before the line is drawn ---- */
html.m-on .hw .w3-steps::before{transform-origin:0 50%}
@media screen{html.m-on .hw .w3-steps.m-st-wait::before{transform:scaleX(0)}}
@media screen{html.m-on .hw .w3-steps.m-st-wait::after, html.m-on .hw .w3-steps.m-st-wait .w3-st::before{opacity:0}}
@media (max-width:959px){
  html.m-on .hw .w3-steps::before{transform-origin:50% 0}
  html.m-on .hw .w3-steps.m-st-wait::before{transform:scaleY(0)} /* screen only: max-width */
}

/* ---- Platform · the action layer: the squares on the wires, the new system's square, junction and hover area ---- */
html.m-on .pl .dl-sch .m-pk{fill:currentColor;stroke:none;opacity:0}
html.m-on .pl .dl-sch.m-run .m-pk--in{animation:m-pk-travel calc(6.4s / var(--motion-speed)) linear infinite both}
html.m-on .pl .dl-sch.m-run .m-pk--out{animation:m-pk-travel calc(6.4s / var(--motion-speed)) linear infinite both}
html.m-on[data-m-diagrams="once"] .pl .dl-sch.m-run .m-pk{animation-iteration-count:1}
@keyframes m-pk-travel{
  0%{transform:translateY(0);opacity:0}
  3%{transform:translateY(calc(var(--d) * .1));opacity:1}
  27%{transform:translateY(calc(var(--d) * .9));opacity:1}
  30%,100%{transform:translateY(var(--d));opacity:0}
}
html.m-on .pl .dl-sch .m-pk-j{fill:currentColor;stroke:none;opacity:0}
html.m-on .pl .dl-sch .m-pk-hit{fill:transparent;stroke:none;pointer-events:all}
html.m-on .pl .dl-sch__svg.m-connect .m-pk--new, html.m-on .pl .dl-sch .m-pk--new.m-hinting{
  animation:m-pk-connect calc(2.2s / var(--motion-speed)) linear 1 both}
html.m-on .pl .dl-sch__svg.m-connect .m-pk-j{animation:m-pk-joined calc(2.2s / var(--motion-speed)) linear 1 both}
@keyframes m-pk-connect{
  0%{transform:translateY(0);opacity:0}
  6%{transform:translateY(calc(var(--d) * .1));opacity:1}
  54%{transform:translateY(calc(var(--d) * .9));opacity:1}
  60%,100%{transform:translateY(var(--d));opacity:0}
}
@keyframes m-pk-joined{0%,56%{opacity:0}60%,90%{opacity:1}100%{opacity:0}}

/* ---- Company brain · the hero's conversation before it plays ---- */
@media screen{html.m-on .cb .chat .msg.m-msg-wait{opacity:0}}

/* ---- Company brain · the plate's routes. The one rule set here that is not under html.m-on: Naz asked for the
   plate's dotted lines in amber ("can we make these lines yellow instead of ink color?"), a change to the plate itself,
   so the page shows it with motion off too (product.py puts the routes in the page, over the plate without its ink
   dots). One amber dot for each ink dot, on the same centres; on a phone every other one, since at that width the
   dots would otherwise run together. --s is a route's step between dots, in the plate's pixels. ---- */
.cb .d-plate .m-routes{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;--k:1}
.cb .d-plate .m-route{fill:none;stroke:var(--color-amber);stroke-width:4.8;stroke-linecap:round;
  stroke-dasharray:0 calc(var(--s) * var(--k) * 1px)}
@media (max-width:1099px){.cb .d-plate .m-route{stroke-width:6}}
@media (max-width:760px){.cb .d-plate .m-routes{--k:2}.cb .d-plate .m-route{stroke-width:10}}
/* With motion on they march like ants, one dot's step at a time, in the direction what they carry goes: down every
   spoke into the exchange, clockwise round the ring (the path's own direction, product_layers.py). Smooth and steady,
   a printed line carrying something. stroke-dashoffset on 16 paths of a small SVG: a repaint of that SVG only, no
   layout. Diagram modes: "loop" marches while the plate is in view; "once" marches for six steps as it arrives and
   stops where it started, so the plate is left as it is drawn. */
html.m-on .cb .d-plate .m-routes.m-march .m-route{
  animation:m-march calc(var(--k) * 720ms / var(--motion-speed)) linear infinite}
html.m-on[data-m-diagrams="once"] .cb .d-plate .m-routes.m-march .m-route{animation-iteration-count:6}
@keyframes m-march{from{stroke-dashoffset:0}to{stroke-dashoffset:calc(var(--s) * var(--k) * -1px)}}

/* ---- Company brain · the margin bars before they fill ---- */
html.m-on .cb .bars i{transform-origin:0 50%}
@media screen{html.m-on .cb .m-bars-wait .bars i{transform:scaleX(0)}}
@media screen{html.m-on .cb .m-bars-wait .done{opacity:0}}

/* ---- About · the carton on roller skates ---- */
html.m-on .bel4 .m-skate.m-hinting{animation:m-skate-nudge calc(700ms / var(--motion-speed)) var(--ease-in-out) 1}
@keyframes m-skate-nudge{0%,100%{transform:translateX(0)}40%{transform:translateX(-5px)}}

/* layers:begin (product_layers.py writes this block) */
/* the mural's frames */
html.m-on .m-mural .m-fr--s1-dim{left:22.2083%;top:12.5251%;width:4.25%;height:10.7214%;background:url(product/mural-frames.webp) 0.1513% 3.6364%/1396.0784% 151.4019% no-repeat}
html.m-on .m-mural .m-fr--s1-glint{left:22.2083%;top:12.5251%;width:4.25%;height:10.7214%;background:url(product/mural-frames.webp) 8.1694% 3.6364%/1396.0784% 151.4019% no-repeat}
html.m-on .m-mural .m-fr--s2-dim{left:30.75%;top:21.8437%;width:2.9167%;height:6.513%;background:url(product/mural-frames.webp) 15.805% 2.0619%/2034.2857% 249.2308% no-repeat}
html.m-on .m-mural .m-fr--s2-glint{left:30.75%;top:21.8437%;width:2.9167%;height:6.513%;background:url(product/mural-frames.webp) 21.2703% 2.0619%/2034.2857% 249.2308% no-repeat}
html.m-on .m-mural .m-fr--s3-dim{left:31.625%;top:45.491%;width:3.625%;height:8.9178%;background:url(product/mural-frames.webp) 27.0755% 2.7397%/1636.7816% 182.0225% no-repeat}
html.m-on .m-mural .m-fr--s3-glint{left:31.625%;top:45.491%;width:3.625%;height:8.9178%;background:url(product/mural-frames.webp) 33.8818% 2.7397%/1636.7816% 182.0225% no-repeat}
html.m-on .m-mural .m-fr--s4-dim{left:69.3333%;top:12.5251%;width:4.25%;height:10.7214%;background:url(product/mural-frames.webp) 41.1498% 3.6364%/1396.0784% 151.4019% no-repeat}
html.m-on .m-mural .m-fr--s4-glint{left:69.3333%;top:12.5251%;width:4.25%;height:10.7214%;background:url(product/mural-frames.webp) 49.1679% 3.6364%/1396.0784% 151.4019% no-repeat}
html.m-on .m-mural .m-fr--s5-dim{left:48.75%;top:19.1383%;width:4.25%;height:10.521%;background:url(product/mural-frames.webp) 57.1861% 3.5088%/1396.0784% 154.2857% no-repeat}
html.m-on .m-mural .m-fr--s5-glint{left:48.75%;top:19.1383%;width:4.25%;height:10.521%;background:url(product/mural-frames.webp) 65.2042% 3.5088%/1396.0784% 154.2857% no-repeat}
html.m-on .m-mural .m-fr--s6-dim{left:56.625%;top:55.8116%;width:3.4167%;height:9.1182%;background:url(product/mural-frames.webp) 72.1311% 2.8169%/1736.5854% 178.022% no-repeat}
html.m-on .m-mural .m-fr--s6-glint{left:56.625%;top:55.8116%;width:3.4167%;height:9.1182%;background:url(product/mural-frames.webp) 78.5395% 2.8169%/1736.5854% 178.022% no-repeat}
html.m-on .m-mural .m-fr--spark-glint1{left:49%;top:36.2725%;width:5.75%;height:15.8317%;background:url(product/mural-frames.webp) 88.647% 50%/1031.8841% 102.5316% no-repeat}
html.m-on .m-mural .m-fr--spark-glint2{left:49%;top:36.2725%;width:5.75%;height:15.8317%;background:url(product/mural-frames.webp) 99.689% 50%/1031.8841% 102.5316% no-repeat}
/* layers:end */
