/* ============================================================================
   Scan mark

   One sweep arm, one loop, six seconds per revolution. Targets light as the
   arm passes their bearing, which is the whole point: the mark explains the
   counter sitting under it.
   ========================================================================= */

.gw-scanmark {
    width: 100%;
    max-width: 180px;
    margin-inline: auto;
    aspect-ratio: 1;
    color: var(--gw-accent);
}

.gw-scanmark svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* ── Static furniture ────────────────────────────────────────────────────── */

.gw-scan-rings circle {
    fill: none;
    stroke: var(--gw-line-strong);
    stroke-width: 1;
}

.gw-scan-cross line {
    stroke: var(--gw-line);
    stroke-width: 1;
    stroke-dasharray: 2 6;
}

.gw-scan-edge-ring {
    fill: none;
    stroke: color-mix(in srgb, var(--gw-accent) 34%, transparent);
    stroke-width: 1.2;
}

/* ── Sweep ───────────────────────────────────────────────────────────────── */

.gw-scan-sweep {
    transform-origin: 60px 60px;
    animation: gw-scan-rotate 6s linear infinite;
}

.gw-scan-edge {
    stroke: currentColor;
    stroke-width: 1.4;
    opacity: 0.85;
}

@keyframes gw-scan-rotate {
    to { transform: rotate(360deg); }
}

/* ── Targets ─────────────────────────────────────────────────────────────── */
/* Each target's delay is its bearing expressed as a fraction of the six-second
   revolution, so the flash lands exactly when the arm crosses it. */

.gw-scan-targets circle {
    fill: currentColor;
    opacity: 0.16;
    transform-box: fill-box;
    transform-origin: center;
    animation: gw-scan-ping 6s var(--gw-ease-out) infinite;
    animation-delay: var(--at, 0s);
}

@keyframes gw-scan-ping {
    0%   { opacity: 0.95; transform: scale(1.55); }
    12%  { opacity: 0.5;  transform: scale(1); }
    45%  { opacity: 0.16; transform: scale(1); }
    100% { opacity: 0.16; transform: scale(1); }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
/* The arm parks at its starting bearing and the targets hold a steady level,
   so the mark still reads as a scanner without anything moving. */

@media (prefers-reduced-motion: reduce) {
    .gw-scan-sweep,
    .gw-scan-targets circle {
        animation: none;
    }

    .gw-scan-targets circle { opacity: 0.45; }
}

@media screen and (max-width: 600px) {
    .gw-scanmark { max-width: 128px; }
}
