/* Explain: Defines dynamic glow and pulse effects for interactive elements. */
/* Painting-colour ambience.

   The palette of the works themselves — crimson, electric blue, acid green,
   magenta, orange, violet — no longer sits in a separate block behind each
   section. It now flows down the whole page as one continuous field carried by
   the page background (see css/main.css), so one section's colour melts into
   the next with no seam and no hard edge anywhere.

   What remains here is the light a framed print throws when the pointer settles
   on it. That bloom is no longer a fixed colour chosen by the wall's running
   order: it is read from the work itself (see js/glow.js) and handed to the
   frame as two custom properties, so a green work blooms green, a blue work
   blooms blue, and a black-and-white piece gives off a soft white light. Until
   a piece has been read — or when it has no colour of its own to name — the
   studio's gold stands in, so the wall is never left without its light. */

/* The light on a work is drawn up slowly: when the pointer settles on a print
   its own colour rises from nothing at all over many seconds, deepening a little
   at a time until the bloom is fully under way, and it just as slowly sinks away
   again when the pointer leaves. Nothing is switched on. */
.print-frame {
    transition: box-shadow 5200ms cubic-bezier(0.33, 0, 0.2, 1);
}

/* While the pointer rests on a print its light keeps breathing: it gathers to
   full bloom, eases back to almost nothing, and swells again — a slow, even
   pulse instead of a glow that simply switches on and sits still. */
.print-frame:hover,
.print-frame:focus-visible {
    animation:
        nd-print-glow-build 11s cubic-bezier(0.33, 0, 0.2, 1) forwards,
        nd-print-glow-breathe 13s ease-in-out 11s infinite;
}

/* The build is long on purpose. The first breath of light is barely there and
   very wide, and the bloom only reaches its full depth after ten seconds or
   more — the frame appears to warm up out of the dark rather than light up.
   Every stage is a broad, heavily blurred haze with almost no spread of its
   own, so the colour never reads as a solid band sitting on the frame's edge. */
@keyframes nd-print-glow-build {
    0% {
        box-shadow:
            0 0 0 0 rgba(242, 190, 78, 0),
            0 0 0 0 rgba(242, 190, 78, 0);
    }
    16% {
        box-shadow:
            0 0 52px 4px var(--print-glow-strong, rgba(242, 190, 78, 0.035)),
            0 12px 120px 10px var(--print-glow, rgba(242, 190, 78, 0.028));
    }
    42% {
        box-shadow:
            0 0 86px 10px var(--print-glow-strong, rgba(242, 190, 78, 0.045)),
            0 18px 176px 24px var(--print-glow, rgba(242, 190, 78, 0.035));
    }
    70% {
        box-shadow:
            0 0 118px 18px var(--print-glow-strong, rgba(242, 190, 78, 0.055)),
            0 26px 244px 42px var(--print-glow, rgba(242, 190, 78, 0.043));
    }
    100% {
        box-shadow:
            0 0 148px 26px var(--print-glow-strong, rgba(242, 190, 78, 0.062)),
            0 34px 304px 62px var(--print-glow, rgba(242, 190, 78, 0.05));
    }
}

/* Once the light has finished building it keeps a shallow, slow breath — the
   haze widens and thins a little, then gathers back, so the bloom stays alive
   without ever pulsing hard. */
@keyframes nd-print-glow-breathe {
    0%,
    100% {
        box-shadow:
            0 0 148px 26px var(--print-glow-strong, rgba(242, 190, 78, 0.062)),
            0 34px 304px 62px var(--print-glow, rgba(242, 190, 78, 0.05));
    }
    50% {
        box-shadow:
            0 0 186px 30px var(--print-glow-strong, rgba(242, 190, 78, 0.05)),
            0 40px 366px 74px var(--print-glow, rgba(242, 190, 78, 0.04));
    }
}

@media (prefers-reduced-motion: reduce) {
    .print-frame {
        transition: none;
    }

    .print-frame:hover,
    .print-frame:focus-visible {
        animation: none;
        box-shadow:
            0 0 148px 26px var(--print-glow-strong, rgba(242, 190, 78, 0.062)),
            0 34px 304px 62px var(--print-glow, rgba(242, 190, 78, 0.05));
    }
}

/* The featured room in the carousel carries the studio's gold rim now instead
   of a passing palette colour: the active frame takes the same warm metallic
   gold used across the whole site, so every room that steps forward sits in
   the collection's one gold rather than cycling through the painting hues. */
.interior-swiper .swiper-slide.swiper-slide-active .interior-frame {
    border-color: var(--accent-color);
}

/* ==========================================================================
   The on-display frame: a solid gold border with light moving over it.

   While the pointer rests on a room, the frame takes the same polished gold
   banding the collection's framed works wear — a warm, solid border instead of
   the thin hairline it holds at rest — and a soft highlight keeps travelling
   around that border, so the gold reads as a lit band with light running over
   it. The border is drawn inside the frame's own rounded shape and cut down to
   a thin band, so the gold sits exactly on the frame's edge and never crosses
   the photograph.
   ========================================================================== */

@property --nd-room-glint {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.interior-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
    -webkit-mask-clip: content-box, border-box;
    -webkit-mask-composite: xor;
    mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
    mask-clip: content-box, border-box;
    mask-composite: exclude;
    /* The travelling highlight rides on top of the solid gold band, so the
       border always stays fully gold and the light simply passes over it. */
    background:
        conic-gradient(
            from var(--nd-room-glint, 0deg),
            rgba(255, 254, 244, 0.3) 0deg,
            rgba(255, 254, 244, 0.8) 5deg,
            rgba(255, 248, 210, 0.66) 14deg,
            rgba(255, 232, 140, 0.36) 30deg,
            rgba(250, 214, 96, 0.14) 54deg,
            rgba(244, 198, 74, 0.05) 82deg,
            rgba(240, 190, 70, 0) 116deg,
            rgba(240, 190, 70, 0) 360deg
        ),
        linear-gradient(168deg, #fff4c9 0%, #e6c05c 15%, #a8791d 38%, #7d5a12 50%, #cf9f2f 66%, #f6e5a2 85%, #b8891f 100%);
    opacity: 0;
    transition: opacity 520ms ease;
    will-change: opacity;
}

/* The gold border settles onto the frame as the pointer arrives, and the
   highlight begins its slow travel around the border. */
.interior-frame-link:hover .interior-frame::before,
.interior-frame-link:focus-visible .interior-frame::before {
    opacity: 1;
    animation: nd-room-glint-travel 6.5s linear infinite;
}

@keyframes nd-room-glint-travel {
    to {
        --nd-room-glint: 360deg;
    }
}

/* The frame gathers a touch of warm light around itself as the gold settles on,
   so the border reads as lit rather than flat. */
.interior-frame-link:hover .interior-frame,
.interior-frame-link:focus-visible .interior-frame {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(242, 190, 78, 0.2), var(--shadow-cinematic);
}

@media (prefers-reduced-motion: reduce) {
    .interior-frame::before {
        transition: none;
    }

    .interior-frame-link:hover .interior-frame::before,
    .interior-frame-link:focus-visible .interior-frame::before {
        animation: none;
    }
}