/*
 * brush-logo (CSS) — companion to brush-logo.js (ADR 0004). Load both in Webflow.
 *
 * The logo SVG lives in the page inside [data-fx-brush-logo] (like the
 * text-scramble copy lives in its element). This file sets the initial hidden
 * state and the reveal transitions; brush-logo.js injects one <mask> per brush
 * stroke and flips [data-fx-run] to play it.
 *
 * Animation only — no layout. Stage, background, size and position of the logo
 * belong to the host (Webflow); this file never touches them.
 */

/* Hidden until brush-logo.js has built the reveal masks — stops a one-frame
   flash of the finished logo before the animation is wired. Snaps on (no fade):
   the white wordmark is just there, the strokes are held hidden by their masks
   and paint on from there.
   ponytail: this hides the hero if the script never loads; acceptable — the
   effect owns its own display, same contract as every effect here. */
[data-fx-brush-logo] svg { opacity: 0; }
[data-fx-brush-logo][data-fx-run] svg { opacity: 1; }

/* Per-stroke reveal line, injected into a <mask> by the JS. pathLength=1 makes
   the draw-on length-independent: dashoffset 1 (hidden) -> 0 (painted). */
.brush-logo__reveal {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
[data-fx-brush-logo][data-fx-run] .brush-logo__reveal {
  stroke-dashoffset: 0;
  /* Near-steady brush speed (soft ends): the paint spreads across the whole
     duration instead of front-loading, so overlapping strokes are actually
     seen painting at the same time. A front-loaded ease snaps each stroke on
     and hides the overlap, reading as sequential. */
  transition: stroke-dashoffset var(--fx-stroke-dur, 560ms)
              var(--fx-ease, cubic-bezier(.803, .657, .513, .967)) var(--fx-stroke-delay, 0ms);
}

/* Reduced motion: show the finished logo immediately, no paint-on. */
@media (prefers-reduced-motion: reduce) {
  [data-fx-brush-logo] svg { opacity: 1; }
  .brush-logo__reveal { stroke-dashoffset: 0; }
  [data-fx-brush-logo][data-fx-run] svg,
  [data-fx-brush-logo][data-fx-run] .brush-logo__reveal { transition: none; }
}
