/* Motion sits outside the Android screen and leaves the reading order intact. */
@media (prefers-reduced-motion: no-preference) {
  .q-menu-trigger .q-chevron { transition: transform .25s ease-in-out; }
  .q-menu-trigger[aria-expanded="true"] .q-chevron { transform: rotate(180deg); }
  .q-menu-panel:not([hidden]) {
    animation: qw-menu-surface .35s ease-in-out both;
  }
  .q-menu-panel:not([hidden]) .q-menu-links a {
    --row-delay: 0ms;
    animation: qw-menu-opacity .35s ease-in-out var(--row-delay) backwards,
               qw-menu-position .5s ease var(--row-delay) backwards;
  }
  .q-menu-panel:not([hidden]) .q-menu-links a:nth-child(n+3),
  #q-menu-industries .q-menu-links a:nth-child(2) { --row-delay: 50ms; }
  .q-menu-panel:not([hidden]) .q-menu-links a:nth-child(n+5),
  #q-menu-industries .q-menu-links a:nth-child(3) { --row-delay: 100ms; }
  #q-menu-industries .q-menu-links a:nth-child(4) { --row-delay: 150ms; }
  .q-menu-panel .q-menu-links a:focus-visible { animation: none; }

  .receipt-status.complete { animation: qw-payment-recorded .36s ease-out; }

  .q-header .q-menu-links a,
  .company-story__link, .pub-row, .qs-decisions a { transition: color .1s linear, background-color .15s ease; }
  .company-story__link .i, .pub-row .i, .qs-decisions a .i {
    transition: translate .25s ease;
  }
  :is(.company-story__link,.pub-row,.qs-decisions a):is(:hover,:focus-visible) .i {
    translate: 3px 0;
  }
  .download-dialog[open] { animation: qw-dialog .25s ease-out; }
}
@keyframes qw-menu-surface {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes qw-menu-opacity {
  from { opacity: .15; } to { opacity: 1; }
}
@keyframes qw-menu-position {
  from { translate: 0 -.75em; } to { translate: 0 0; }
}
@keyframes qw-payment-recorded {
  from { background-color: #d0eed9; } to { background-color: transparent; }
}
@keyframes qw-dialog {
  from { opacity: .2; translate: 0 9px; } to { opacity: 1; translate: 0 0; }
}
#experience { scroll-margin-top: 90px; }
.feature-controls [role="tab"] { overflow: hidden; }
.feature-controls [role="tab"] > span { display: inline-block; }

/* The three existing project steps share a route that draws once as the visitor reaches it. */
#material-flow { scroll-margin-top: 92px; }
#material-flow .flow-row { position: relative; }
#material-flow .flow-dot { position: relative; z-index: 1; }
#material-flow .flow-row:not(:last-child)::before {
  content: ""; position: absolute; top: 50px; height: 100%; left: 21px;
  width: 2px; background: #b2d5b8; transform-origin: center top;
}
@media (prefers-reduced-motion: no-preference) {
  #material-flow .flow-visual.is-tracing .flow-row { --stop: 0ms; }
  #material-flow .flow-visual.is-tracing .flow-row:nth-child(2) { --stop: 540ms; }
  #material-flow .flow-visual.is-tracing .flow-row:nth-child(3) { --stop: 1080ms; }
  #material-flow .is-tracing .flow-row:not(:last-child)::before {
    animation: q-project-line 540ms cubic-bezier(.45,0,.45,1) var(--stop) backwards;
  }
  #material-flow .is-tracing .flow-dot {
    animation: q-project-stop 650ms cubic-bezier(.2,.8,.2,1) var(--stop) backwards;
  }
}
@keyframes q-project-line {
  from { transform: scaleY(0); background-color: #148047; }
  to { transform: scaleY(1); background-color: #b2d5b8; }
}
@keyframes q-project-stop {
  0% { scale: .9; }
  32% { scale: 1.1; color: #fff; background-color: #10713e; box-shadow: 0 0 0 5px #c8ead3; }
  100% { scale: 1; }
}

/* Headline, supporting copy and image have different entrances. Only the
   brief entry phase has an effect on painting or stacking order. */
@media screen and (prefers-reduced-motion: no-preference) {
  [data-scroll-entry][data-section-state] {
    --entry-y: 0px;
    --entry-scale: 1;
    --entry-opacity: 1;
    --entry-start-clip: inset(-6% -5% -7%);
    --entry-end-clip: inset(-6% -5% -7%);
    --entry-time: 760ms;
  }
  [data-scroll-entry="lead"][data-section-state] {
    --entry-y: clamp(25px, 3.2vw, 43px);
    --entry-opacity: .12;
    --entry-start-clip: inset(-6% -5% 64%);
    --entry-time: 840ms;
  }
  [data-scroll-entry="copy"][data-section-state] {
    --entry-y: 22px;
    --entry-opacity: .16;
    --entry-time: 690ms;
  }
  [data-scroll-entry="visual"][data-section-state] {
    --entry-y: clamp(22px, 3vw, 38px);
    --entry-scale: .966;
    --entry-opacity: .68;
    --entry-start-clip: inset(1% 3% 13% round 16px);
    --entry-time: 960ms;
  }
  [data-scroll-entry="band"][data-section-state] {
    --entry-start-clip: inset(22px clamp(10px, 2.7vw, 44px) 0 round 22px);
    --entry-end-clip: inset(-1px -1px -1px round 0px);
    --entry-time: 900ms;
  }
  [data-scroll-entry][data-initial-entry][data-section-state] {
    --entry-opacity: .78;
    --entry-y: 12px;
    --entry-start-clip: var(--entry-end-clip);
    --entry-scale: 1;
  }
  [data-scroll-entry="band"][data-initial-entry][data-section-state] {
    --entry-opacity: 1;
    --entry-y: 0px;
  }
  [data-section-state="waiting"] {
    opacity: var(--entry-opacity);
    translate: 0 var(--entry-y);
    scale: var(--entry-scale);
    clip-path: var(--entry-start-clip);
  }
  [data-section-state="playing"] {
    animation: q-section-arrive var(--entry-time) cubic-bezier(.28,.58,.2,1) var(--section-delay,0ms) backwards;
  }
}
@keyframes q-section-arrive {
  from {
    opacity: var(--entry-opacity);
    translate: 0 var(--entry-y);
    scale: var(--entry-scale);
    clip-path: var(--entry-start-clip);
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
    clip-path: var(--entry-end-clip);
  }
}
