/* Decorative motion: the small dolphin companions bob, the night-watch headlamps glow, and the
   inline-SVG sonar logo sweeps once on load. Everything here is ornament: it never touches data,
   evidence or warnings, and it is off entirely when the visitor asks for reduced motion. */

@media (prefers-reduced-motion: no-preference) {
    /* 1. A small companion floats: a few pixels up and down with a slight tilt, slowly. */
    .dolphin-bob {
        animation: dolphin-bob 6.5s ease-in-out infinite;
        transform-origin: 50% 60%;
        will-change: transform;
    }

    @keyframes dolphin-bob {
        0%, 100% { transform: translateY(0) rotate(0deg); }
        50% { transform: translateY(-5px) rotate(-1.6deg); }
    }

    /* 2. Headlamp glow: soft light pools placed where each painted beam lands, breathing out of
       step with one another as if the dolphins sweep the ice. Positions are fractions of the
       1536x1024 night-watch painting, so they hold at every rendered size. */
    .lamp-glow i {
        position: absolute;
        width: 15%;
        aspect-ratio: 1;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 244, 214, .55) 0%, rgba(186, 212, 255, .2) 42%, transparent 70%);
        mix-blend-mode: screen;
        transform: translate(-50%, -50%);
        opacity: .15;
        animation: lamp-glow 7s ease-in-out infinite;
    }

    .lamp-glow i:nth-child(1) { left: 29%; top: 36%; animation-delay: 0s; }
    .lamp-glow i:nth-child(2) { left: 62.5%; top: 44%; animation-delay: -2.1s; }
    .lamp-glow i:nth-child(3) { left: 35%; top: 60%; animation-delay: -4.3s; }
    .lamp-glow i:nth-child(4) { left: 58%; top: 73%; width: 10%; animation-delay: -1.2s; }
    .lamp-glow i:nth-child(5) { left: 81%; top: 36%; width: 7%; animation-delay: -5.6s; }

    @keyframes lamp-glow {
        0%, 100% { opacity: .12; transform: translate(-50%, -50%) scale(.9); }
        45% { opacity: .8; transform: translate(-54%, -48%) scale(1.08); }
        70% { opacity: .45; transform: translate(-47%, -52%) scale(1); }
    }

    /* 3. Sonar sweep on the inline-SVG logo: the wedge turns once, then the contact blips. */
    .wordmark svg path,
    .app-brand svg path {
        transform-box: view-box;
        transform-origin: 50px 50px;
        animation: sonar-sweep 1.4s cubic-bezier(.3, .1, .2, 1) .2s 1 both;
    }

    .wordmark svg .signal,
    .app-brand svg circle[r="4"] {
        transform-box: fill-box;
        transform-origin: center;
        animation: sonar-blip .9s ease-out 1.45s 1 both;
    }

    @keyframes sonar-sweep {
        from { transform: rotate(-360deg); }
        to { transform: rotate(0deg); }
    }

    @keyframes sonar-blip {
        0% { transform: scale(1); }
        35% { transform: scale(2.1); opacity: .55; }
        100% { transform: scale(1); opacity: 1; }
    }
}

/* The glow layer sits over the painting only; it is laid out even without motion so the markup
   stays inert and the painting shows through unchanged. */
.lamp-scene { position: relative; display: block; line-height: 0; }
.lamp-scene > img { display: block; width: 100%; height: auto; }
.lamp-glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
