/* The drawing of « 1 email received = 1 operation » on the pricing page (templates/components/Pricing/Operations.html.twig).
   A file rather than a <style> block in the page: the Content-Security-Policy of the static image allows no inline style
   (frankenphp/static.Caddyfile). The motion itself is SMIL, written in the component; this file colours the drawing and
   stops the motion when the reader asked for none. */

/* The blueprint grid: a gradient rather than an image, coloured through a token so both themes follow. */
.ops-grid {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      color-mix(in srgb, var(--color-accent) 6%, transparent) 39px,
      color-mix(in srgb, var(--color-accent) 6%, transparent) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      color-mix(in srgb, var(--color-accent) 6%, transparent) 39px,
      color-mix(in srgb, var(--color-accent) 6%, transparent) 40px
    );
}

/* `height: auto` against the viewBox keeps the layout from shifting while the page loads. */
.ops-route {
  display: block;
  width: 100%;
  height: auto;
}

.ops-route text {
  font-family: var(--font-mono);
  fill: var(--color-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-route .t-lg {
  font-size: 13px;
  fill: var(--color-text);
}

.ops-route .t-sm {
  font-size: 10.5px;
  fill: var(--color-faint);
}

/* A heading names the direction of its fan, so it reads before the rows do. */
.ops-route .heading {
  fill: var(--color-muted-foreground);
  letter-spacing: 0.14em;
}

.ops-route .node {
  fill: var(--color-surface);
  stroke: var(--color-line-bright);
  stroke-width: 1.2;
}

/* The webhook's destination: dashed while no webhook leaves. */
.ops-route .node.planned {
  fill: none;
  stroke: var(--color-line);
  stroke-dasharray: 4, 4;
}

.ops-route .node-o {
  fill: none;
  stroke: var(--color-line);
  stroke-width: 1;
  stroke-dasharray: 3, 4;
}

.ops-route .wire {
  fill: none;
  stroke: var(--color-line-bright);
  stroke-width: 1.2;
}

.ops-route .dim-line {
  stroke: var(--color-line);
  stroke-width: 0.75;
}

/* A refusal is not a branch: it is an arrival that did not happen. */
.ops-route .wire.aside {
  stroke: var(--color-line);
  stroke-dasharray: 2, 3;
}

/* The accent is this drawing's word for « this one costs an operation ». */
.ops-route .wire.counted {
  stroke: var(--color-accent);
  stroke-width: 1.8;
}

.ops-route .head-dim {
  fill: var(--color-line-bright);
}

.ops-route .head-on {
  fill: var(--color-accent);
}

.ops-route .weight {
  fill: var(--color-good);
}

.ops-route .weight.counted {
  fill: var(--color-accent);
}

.ops-route .tick {
  font-size: 21px;
  fill: var(--color-accent);
  letter-spacing: 0;
  text-transform: none;
}

.ops-route .dot {
  fill: var(--color-accent);
}

.ops-route .dot.halo {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1;
}

/* The still counter is for readers who asked for no motion; everyone else sees the animated one. */
.ops-route .tick-still {
  display: none;
}

/* SMIL ignores `prefers-reduced-motion`, and an animated value beats any rule of this file. So the moving parts are
   taken out of the drawing (`display` is not what they animate) and the still counter shows the total: one email
   received, one operation. A frozen dot would read as a permanent marker on one wire. */
@media (prefers-reduced-motion: reduce) {
  .ops-route .dots,
  .ops-route .ticks {
    display: none;
  }

  .ops-route .tick-still {
    display: inline;
  }
}
