/* fx.css: the FX lab's shared styles, loaded once per page after the site's own system.css and components.css and
   before any effect's CSS. No look of its own: every color is one of the site's tokens, and every rule sits in
   :where(), so any rule of the site wins.

   The site's two dials. Every effect multiplies its speed by --fx-pace and its strength by --fx-energy, so one line
   in a site's system.css sets the character of all its motion: a quiet site 0.7 and 0.5, a loud one 1.25 and 1.3.
   --fx-seed is the site's own number (any number, say one made from its name): what an effect arranges by chance (a
   shader's ground, the particles) it arranges from it, so the same effect never falls the same way on two sites. */
:where(:root) {
  --fx-pace: 1;
  --fx-energy: 1;
  --fx-seed: 1;   /* the site's own number: whatever an effect arranges by chance, it arranges from this */
}

/* What reads on the ground an effect stands on. With the look packs (agencystudio's look\README.md) a ground sets
   --on, --on-soft, --edge, --act, --act-on, --surface, --surface-on and --surface-edge on the body and on each band,
   and these follow them. Without the packs they fall back to the tokens of system.css: the paper's colors on a light
   ground, the ink's on a dark one. fx.js finds the ground itself: it writes the color painted behind the element as
   --fx-ground and marks a dark one data-fx-dark (before the script runs, [data-look~="dark"] and .band--ink say it).
   An effect's CSS uses only these and the tokens. */
:where([data-fx]) {
  --fx-on: var(--on, var(--c-ink, #14161a));
  --fx-on-soft: var(--on-soft, var(--c-ink-soft, #5b6270));
  --fx-edge: var(--edge, var(--c-line, #d9dde3));
  --fx-act: var(--act, var(--c-brand, #2456e6));
  --fx-act-on: var(--act-on, var(--c-on-brand, #fff));
  --fx-surface: var(--surface, var(--c-paper, #fff));
  --fx-surface-on: var(--surface-on, var(--c-ink, #14161a));
  --fx-surface-edge: var(--surface-edge, var(--c-line, #d9dde3));
  --fx-ground: var(--c-paper, #fff);
  --fx-tint: var(--c-brand-text, var(--c-brand, #2456e6));       /* the brand as text on this ground */
  --fx-tint-2: var(--c-accent-text, var(--c-accent, #e6682a));   /* the accent as text on this ground */
  --fx-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  --fx-ease-io: var(--ease-in-out, cubic-bezier(0.65, 0, 0.35, 1));
  --fx-fast: var(--dur-fast, 180ms);
  --fx-med: var(--dur-med, 480ms);
}
:where([data-fx][data-fx-dark]),
:where([data-look~="dark"]) :where([data-fx]:not([data-fx-ready])),
:where([data-fx][data-look~="dark"]:not([data-fx-ready])),
:where(.band--ink) :where([data-fx]:not([data-fx-ready])),
:where([data-fx].band--ink:not([data-fx-ready])) {
  --fx-on: var(--on, var(--c-on-ink, #f2f4f7));
  --fx-on-soft: var(--on-soft, color-mix(in srgb, var(--c-on-ink, #f2f4f7) 70%, var(--c-ink, #14161a)));
  --fx-edge: var(--edge, color-mix(in srgb, var(--c-on-ink, #f2f4f7) 18%, transparent));
  --fx-surface: var(--surface, color-mix(in srgb, var(--c-on-ink, #f2f4f7) 7%, var(--c-ink, #14161a)));
  --fx-surface-on: var(--surface-on, var(--c-on-ink, #f2f4f7));
  --fx-surface-edge: var(--surface-edge, color-mix(in srgb, var(--c-on-ink, #f2f4f7) 16%, transparent));
  --fx-ground: var(--c-ink, #14161a);
  --fx-tint: var(--c-brand-on-ink, color-mix(in srgb, var(--c-brand, #2456e6) 55%, var(--c-on-ink, #f2f4f7)));
  --fx-tint-2: var(--c-accent-on-ink, color-mix(in srgb, var(--c-accent, #e6682a) 55%, var(--c-on-ink, #f2f4f7)));
}
:where(.band--alt) :where([data-fx]), :where([data-fx].band--alt) { --fx-ground: var(--c-paper-alt, #f3f4f6); }
:where(.band--brand) :where([data-fx]), :where([data-fx].band--brand) {
  --fx-ground: var(--c-brand, #2456e6);
  --fx-tint: var(--on, var(--c-on-brand, #fff));
  --fx-tint-2: var(--on, var(--c-on-brand, #fff));
}

/* Read by a screen reader, hidden from the eye (a split headline's whole text, a word-swap's source word). */
:where(.fx-sr) { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* A split text's pieces (FX.split): each word a box that wraps like a word, its inner box the one that moves. */
:where(.fx-w) { display: inline-block; vertical-align: baseline; white-space: nowrap; }
:where(.fx-wi, .fx-c) { display: inline-block; }

/* A shader's canvas (fx-gl.js) fills its host under the host's content and fades in over the host's own still
   background once its first frame is drawn. */
:where(.fx-gl) { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity 0.6s linear; }
:where(.fx-gl[data-on]) { opacity: 1; }

/* A stop icon shows the icon of what pressing it does (the skeleton's core.css has the same two rules). */
:where([data-stop] .stop__play) { display: none; }
:where([data-stop][aria-pressed="true"] .stop__play) { display: inline; }
:where([data-stop][aria-pressed="true"] .stop__pause) { display: none; }

@media (prefers-reduced-motion: reduce) {
  :where(.fx-gl) { transition: none; }
}
