/* ============================================================
   OGAI Digital Solutions — animations.css
   Scroll-reveal, signature precision-mark draw, hero scan-line,
   ticker marquee. All gated behind prefers-reduced-motion.
   ============================================================ */

/* ---------- Ticker marquee ---------- */
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Hero document-capture animation ---------- */
.capture {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 4 / 4.6;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 24px;
  overflow: hidden;
}
.capture__brandbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.capture__logo { width: 46px; height: 12px; border-radius: 3px; background: var(--color-primary); opacity: 0.85; }
.capture__chip { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--color-accent); border: 1px solid var(--color-accent); padding: 2px 8px; border-radius: var(--radius-pill); }
.capture__row { display: flex; flex-direction: column; gap: 6px; padding: 9px 8px; border-radius: 6px; transition: background 240ms var(--ease); }
.capture__row + .capture__row { margin-top: 4px; }
.capture__label { width: 38%; height: 7px; border-radius: 3px; background: var(--color-border); }
.capture__value { width: 72%; height: 9px; border-radius: 3px; background: #c9d2df; transition: background 240ms var(--ease); position: relative; }
.capture__value--short { width: 48%; }
.capture__value--long { width: 88%; }
/* "captured" state — value turns navy + a check appears */
.capture__row.is-captured { background: var(--color-accent-soft); }
.capture__row.is-captured .capture__value { background: var(--color-primary); }
.capture__row.is-captured::after {
  content: "";
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat,
    var(--color-success);
}
.capture__row { position: relative; }
/* scanning line */
.capture__scan {
  position: absolute; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  box-shadow: 0 0 18px 3px rgba(15,118,110,0.5);
  top: 0;
  animation: scan 3.6s var(--ease) infinite;
}
@keyframes scan {
  0%   { top: 8%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}
.capture__footer { position: absolute; left: 24px; right: 24px; bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.capture__accuracy { font-family: var(--font-mono); font-size: 11px; color: var(--color-success); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.capture__accuracy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 0 rgba(30,122,76,0.5); animation: pulse 2s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(30,122,76,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(30,122,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(30,122,76,0); }
}
.capture__progress { width: 90px; height: 6px; border-radius: 3px; background: var(--color-border); overflow: hidden; }
.capture__progress::after { content: ""; display: block; height: 100%; width: 99%; background: var(--grad-accent); }

/* ---------- Scroll reveal ----------
   Hidden state is gated behind `.js` so that without JavaScript
   (or if a script fails) all content remains fully visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* staggered children */
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }

/* ---------- Precision-mark draw-in ---------- */
/* When the heading scrolls into view it gets .is-visible, animating width */
.js .section-head h2::after { width: 0; transition: width 720ms var(--ease) 160ms; }
.js .section-head.is-visible h2::after { width: 64px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .section-head h2::after { width: 64px; }
  .capture__scan { display: none; }
  .ticker__track { animation: none; }
  .capture__accuracy::before { animation: none; }
}
