/* Standard's square settles at the end of a rule, connecting one chapter
   to the next. Only decoration moves; the words and controls remain still. */
:root {
  --motion-settle: cubic-bezier(.2, .7, .2, 1);
  --motion-arrive: 450ms;
  --motion-bridge: 600ms;
}

[data-motion-section] { position: relative; }
.section-bridge {
  position: absolute;
  top: 1.25rem;
  left: 0;
  right: 0;
  width: 100%;
  max-width: var(--container);
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  margin-inline: auto;
  height: 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  pointer-events: none;
  user-select: none;
}
.section-bridge-line {
  flex: 1;
  height: 1px;
  background: var(--rule-2);
  transform-origin: left center;
}
.section-bridge-mark {
  color: var(--accent);
  font-size: .875rem;
  line-height: 1;
}

/* The labeled Ada illustration connects its four stages without suggesting
   that a customer's request is currently being processed. */
.ada-example[data-motion-cue] { border-radius: 3px; }
.ada-example[data-motion-cue] li { position: relative; padding-left: 1.1rem; }
.ada-example[data-motion-cue] li::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.ada-example[data-motion-cue] li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 2.5px;
  top: 2.2rem;
  bottom: -.85rem;
  width: 1px;
  background: var(--rule-2);
  transform-origin: center top;
}

@media (prefers-reduced-motion: no-preference) {
  .section-bridge.motion-entered .section-bridge-line {
    animation: section-rule var(--motion-bridge) var(--motion-settle) both;
  }
  .section-bridge.motion-entered .section-bridge-mark {
    animation: section-square var(--motion-arrive) var(--motion-settle) 150ms both;
  }
  .ada-example.motion-entered li::before {
    animation: section-square var(--motion-arrive) var(--motion-settle) both;
  }
  .ada-example.motion-entered li::after {
    animation: process-rule var(--motion-arrive) var(--motion-settle) both;
  }
  .ada-example.motion-entered li:nth-child(2)::before,
  .ada-example.motion-entered li:nth-child(2)::after { animation-delay: 70ms; }
  .ada-example.motion-entered li:nth-child(3)::before,
  .ada-example.motion-entered li:nth-child(3)::after { animation-delay: 140ms; }
  .ada-example.motion-entered li:nth-child(4)::before { animation-delay: 210ms; }
  @keyframes section-rule {
    0% { transform: scaleX(.08); background: var(--accent); }
    65% { transform: scaleX(1); background: var(--accent); }
    100% { transform: scaleX(1); background: var(--rule-2); }
  }
  @keyframes section-square {
    from { transform: translateY(-8px) scale(.7); opacity: .35; }
    to { transform: none; opacity: 1; }
  }
  @keyframes process-rule {
    from { transform: scaleY(0); background: var(--accent); }
    to { transform: scaleY(1); background: var(--rule-2); }
  }
}

@media (prefers-reduced-motion: reduce), print {
  .section-bridge *, .ada-example[data-motion-cue] li::before,
  .ada-example[data-motion-cue] li::after {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
