/* Automation proof: a small UI that builds itself with the visitor's scroll
   (js/indigo/automation-reveal.mjs writes each part's stage). The HTML diagram is the final
   frame: without JS, with reduced motion or motion-off, no stage values are set and every part
   reads its final default. transform + opacity only, so nothing reflows. */

/* Look: three equal-width cards on one inline axis, hairline fields, one amber accent. */
#service-automation .automation-diagram { display: grid; gap: 0; }
#service-automation :is(.auto-form, .lead-table, .wa-toast) {
  width: 100%; margin: 0; padding: 16px 18px; border: 1px solid var(--deep); border-radius: 4px;
}
#service-automation .fake-field { grid-template-columns: 56px minmax(0, 1fr); min-height: 34px; }
#service-automation :is(.field-fill, .lead-entry i, .toast-lines i) { height: 3px; border-radius: 0; }
#service-automation .field-fill { background: var(--deep); }
#service-automation .lead-entry i { background: color-mix(in srgb, var(--deep) 55%, transparent); }
#service-automation .wa-toast { border-inline-start: 3px solid #c9803a; background: var(--deep); color: var(--paper); }
#service-automation .toast-lines i { background: color-mix(in srgb, var(--paper) 70%, transparent); }
#service-automation .table-head { border-bottom: 1px solid color-mix(in srgb, var(--deep) 25%, transparent); }
#service-automation .table-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#service-automation .auto-connector { width: 1px; height: 28px; margin-inline-start: 32px; background: var(--deep); }

/* Stages come from js/indigo/automation-reveal.mjs (automationStages): per card --auto-o and
   --auto-y (it rises 36px from opacity 0, one card after another), then per bar --auto-fill and
   per connector --auto-line, which start only once their card has settled. Every value
   defaults to the final frame. A card's labels ride with the card: the box is the actor. */
/* No CSS transition: js/indigo/automation-reveal.mjs smooths wheel notches itself, so cards,
   bars and lines always come from the same progress value (a line never leads its box). */
#service-automation :is(.auto-form, .lead-table, .wa-toast) {
  opacity: var(--auto-o, 1); transform: translateY(var(--auto-y, 0px));
}
#service-automation .automation-steps span { opacity: var(--auto-o, 1); }
/* Bars "type" from the inline start (right in Hebrew); lines draw downward. */
#service-automation :is(.field-fill, .lead-entry i, .toast-lines i) { transform-origin: right center; transform: scaleX(var(--auto-fill, 1)); }
#service-automation .auto-connector { transform-origin: top center; transform: scaleY(var(--auto-line, 1)); }

/* Desktop: readable UI text instead of 12-13px fine print. */
@media (min-width: 721px) and (min-height: 541px) {
  #service-automation :is(.fake-field, .table-head, .wa-toast) { font-size: 15px; }
  #service-automation .automation-steps { font-size: 13px; }
  #service-automation :is(.auto-form, .lead-table, .wa-toast) { padding: 20px 24px; }
  #service-automation .auto-connector { height: 32px; margin-inline-start: 40px; }
}
@media (max-width: 720px) {
  #service-automation :is(.auto-form, .lead-table, .wa-toast) { padding: 12px 14px; }
  #service-automation .fake-field { grid-template-columns: 52px minmax(0, 1fr); min-height: 32px; }
  #service-automation .auto-connector { height: 20px; margin-inline-start: 26px; }
}

/* Final frame wins whenever motion is not allowed, whatever the attribute says. */
#service-automation[data-auto-reveal="static"] *,
.motion-off #service-automation *, .a11y-nomotion #service-automation * { transition: none !important; opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  #service-automation * { transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* Landscape phones lay the cards out form | record, toast below (css/indigo/mobile.css);
   the step labels would take a grid cell of their own there. */
@media (max-height: 540px) {
  #service-automation .automation-steps { display: none; }
  #service-automation .automation-diagram { gap: 12px; }
}
