/* ALGCO visuals: example screens, automation demo, IT diagram, video and photo slots.
   Kit colors only (from tokens.css). Accent is never used here; it stays on the CTA button.
   Loops only run when JS adds .anim-on (motion allowed). Without JS or with reduced motion
   every visual shows its finished state. */

.vis {
  position: relative;
  background: var(--c-offwhite);
  color: var(--c-ink);
  border: 1px solid var(--c-ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
}
.vis * { box-sizing: border-box; }
.vis ul, .vis ol { list-style: none; margin: 0; padding: 0; }

/* Window bar: square dots echo the logo's core square */
.scr-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--c-rule);
}
.scr-bar i { width: 8px; height: 8px; border: 1.5px solid var(--c-ink); }
.scr-bar b { margin-left: 8px; font-size: 12px; font-weight: 700; }
.scr-body, .vis .scr-body { padding: 14px; }
.scr-label { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); }
.scr-btn {
  display: block; margin-top: 10px; padding: 8px 10px;
  background: var(--c-primary); color: var(--c-offwhite);
  font-weight: 700; font-size: 12px; text-align: center;
}

/* 1. Booking + payment screen */
.booking { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid li {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid var(--c-rule); font-size: 11px; font-variant-numeric: tabular-nums;
}
.cal-grid .off { color: var(--c-muted); background: var(--c-rule); border-color: transparent; }
.cal-grid .sel { background: var(--c-primary); color: var(--c-offwhite); border-color: var(--c-primary); font-weight: 700; }
.slots li { padding: 5px 8px; margin-bottom: 4px; border: 1px solid var(--c-rule); font-size: 12px; }
.slots .sel { border: 2px solid var(--c-primary); font-weight: 700; }
.toast {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--c-ink); color: var(--c-offwhite);
  font-weight: 600; font-size: 12px;
  opacity: 0;
}
.toast::before { content: ""; width: 8px; height: 8px; background: var(--c-offwhite); }

/* 2. Job + invoice tracker */
.trk { width: 100%; border-collapse: collapse; font-size: 12px; }
.trk th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); padding: 0 6px 8px 0; }
.trk td { padding: 8px 6px 8px 0; border-top: 1px solid var(--c-rule); white-space: nowrap; }
.chip { display: inline-block; padding: 1px 6px; border: 1px solid currentColor; font-size: 11px; font-weight: 600; }
.chip.fill { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-offwhite); }
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; }
.swap > .from { opacity: 0; }          /* finished state by default */

/* 3. Automation demo */
.flow li {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--c-rule);
  transition: color 300ms ease-out;
}
.flow li:last-child { border-bottom: 0; }
.flow .dot { width: 12px; height: 12px; border: 2px solid var(--c-primary); background: var(--c-primary); transition: background 300ms ease-out; }
.flow b { display: block; font-size: 13px; }
.flow small { display: block; font-size: 12px; color: var(--c-muted); }
.flow .scr-btn { margin: 0; padding: 5px 10px; }
.flow li.is-pending { color: var(--c-muted); }
.flow li.is-pending .dot { background: transparent; }
.flow li.is-pending small, .flow li.is-pending .scr-btn { opacity: 0.35; }
.flow li.is-current .dot { outline: 2px solid var(--c-primary); outline-offset: 3px; }
.flow-note { padding: 10px 14px; border-top: 1px solid var(--c-rule); font-size: 12px; color: var(--c-muted); }

/* 4. IT setup diagram */
.net svg { display: block; width: 100%; height: auto; }
.net text { font-family: var(--font); font-size: 11.5px; font-weight: 600; fill: var(--c-ink); }
.net .hub-text { fill: var(--c-offwhite); font-weight: 700; font-size: 12.5px; }
.net .node { fill: var(--c-offwhite); stroke: var(--c-ink); stroke-width: 1; }
.net .hub { fill: var(--c-primary); }
.net .link { stroke: var(--c-primary); stroke-width: 2; fill: none; stroke-dasharray: 4 6; }
.net .watch { fill: none; stroke: var(--c-primary); stroke-width: 1.5; stroke-dasharray: 6 6; }
.net .watch-label { fill: var(--c-primary); font-weight: 700; }


/* Caption under each visual */
.vis-cap { margin-top: 8px; font-size: 0.8125rem; color: var(--c-muted); }
.on-dark .vis-cap { color: inherit; }

/* Pause control (WCAG 2.2.2): shown only when animations run */
.anim-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 14px; background: transparent; color: inherit;
  border: 1px solid currentColor; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.anim-toggle::before { content: ""; width: 8px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.anim-toggle[aria-pressed="true"]::before { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 9px; border-color: transparent transparent transparent currentColor; }
.anim-toggle[hidden] { display: none; }

/* Loops: only with JS + motion allowed */
@media (prefers-reduced-motion: no-preference) {
  .anim-on .toast { animation: toast 7s ease-out infinite; }
  .anim-on .swap > .from { animation: swapFrom 6s step-end infinite; }
  .anim-on .swap > .to { animation: swapTo 6s step-end infinite; }
  .anim-on .net .link { animation: flowDash 1.1s linear infinite; }
  .anim-on .net .watch { animation: flowDash 2.4s linear infinite; }
  .anim-on .typed { animation: none; }
  .anim-on .flow li.is-current .typed { animation: fadeIn 900ms ease-out both; }
}
.anim-paused .vis *, .anim-paused .vis, .vis.is-offscreen *,
.anim-paused .marquee-track, .marquee.is-offscreen .marquee-track { animation-play-state: paused !important; }

@keyframes toast {
  0%, 50% { opacity: 0; transform: translateY(8px); }
  58%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes swapFrom { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes swapTo { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes flowDash { to { stroke-dashoffset: -20; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 5. Work queue: requests move New -> Drafted -> Approved instead of piling up */
.lane-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-height: 176px; }
.lane { border: 1px dashed var(--c-rule); padding: 8px 8px 0; }
.lane .scr-label { margin-bottom: 0; }
.ticket {
  position: absolute; left: 19px; width: calc((100% - 28px - 16px) / 3 - 10px);
  padding: 7px 8px; background: var(--c-offwhite); border: 1px solid var(--c-ink);
  font-size: 11.5px; font-weight: 700; line-height: 1.25;
  display: flex; align-items: center; gap: 6px;
}
.ticket::before { content: ""; flex: none; width: 8px; height: 8px; border: 1.5px solid var(--c-primary); }
.ticket.t1 { top: 44px; }
.ticket.t2 { top: 88px; }
.ticket.t3 { top: 132px; }
/* Finished state (no JS / reduced motion): one ticket in each lane */
.ticket.t1 { transform: translateX(calc(200% + 36px)); }
.ticket.t2 { transform: translateX(calc(100% + 18px)); }
.ticket.t1::before, .ticket.t2::before { background: var(--c-primary); }
@media (prefers-reduced-motion: no-preference) {
  .anim-on .ticket { animation: lanes 9s cubic-bezier(.65, 0, .35, 1) infinite; }
  .anim-on .ticket.t1 { animation-delay: 0s; }
  .anim-on .ticket.t2 { animation-delay: -3s; }
  .anim-on .ticket.t3 { animation-delay: -6s; }
}
@keyframes lanes {
  0%, 22%   { transform: translateX(0); opacity: 1; }
  33%, 55%  { transform: translateX(calc(100% + 18px)); opacity: 1; }
  66%, 88%  { transform: translateX(calc(200% + 36px)); opacity: 1; }
  96%       { transform: translateX(calc(200% + 36px)); opacity: 0; }
  100%      { transform: translateX(0); opacity: 0; }
}
