/* Local scene loops: no extra image downloads, layout movement or input layer. */
.story-cover-atmosphere {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    mask-image: linear-gradient(#000 65%, transparent);
}
.has-cover-motion .story-card-category { z-index: 1; }
.story-cover-light, .story-cover-particle {
    position: absolute;
    display: block;
    pointer-events: none;
    animation-play-state: paused;
}
.story-cover-light {
    inset: -12%;
    opacity: .3;
    background: radial-gradient(ellipse at 18% 20%, rgb(255 210 139 / 38%), transparent 58%);
    animation: story-light-breathe 7s ease-in-out infinite paused;
}
.story-cover-particle {
    left: var(--x);
    top: var(--y);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #f6ddb5;
    opacity: 0;
    animation: story-dust-float calc(9s * var(--speed)) ease-in-out var(--delay) infinite paused;
}
.is-cover-running .story-cover-atmosphere > span { animation-play-state: running; }
.stories-banner.is-enhanced .story-feature.has-cover-motion:not(.is-cover-running) img { animation-play-state: paused; }

/* Each particle moves independently, with the foreground kept sparse. */
[data-weather="rain"] .story-cover-particle {
    top: -10%;
    width: 1px;
    height: calc(16px * var(--size));
    border-radius: 1px;
    background: linear-gradient(transparent, rgb(205 230 242 / 65%));
    animation-name: story-rain-fall;
    animation-duration: calc(1.3s * var(--speed));
    animation-timing-function: linear;
}
[data-weather="snow"] .story-cover-particle {
    top: -5%;
    width: calc(3px * var(--size));
    height: calc(3px * var(--size));
    background: #eff9ff;
    animation-name: story-snow-fall;
    animation-duration: calc(6s * var(--speed));
    animation-timing-function: linear;
}
[data-weather="leaves"] .story-cover-particle {
    top: -8%;
    width: calc(8px * var(--size));
    height: calc(4px * var(--size));
    border-radius: 1px 80% 1px 80%;
    background: #cfa852;
    animation-name: story-leaf-fall;
    animation-duration: calc(9s * var(--speed));
    animation-timing-function: linear;
}
[data-light="forest"] .story-cover-particle { background: #a8c47b; }
[data-weather="embers"] .story-cover-particle {
    top: 90%;
    width: calc(2px * var(--size));
    height: calc(3px * var(--size));
    background: #ffcd7c;
    box-shadow: 0 0 4px rgb(255 141 57 / 50%);
    animation-name: story-ember-rise;
    animation-duration: calc(5s * var(--speed));
}
[data-weather="signals"] .story-cover-particle {
    width: 1px;
    height: calc(25px * var(--size));
    background: linear-gradient(transparent, #a4e5ed, transparent);
    animation-name: story-signal-rise;
    animation-duration: calc(4s * var(--speed));
}
[data-weather="mist"] .story-cover-particle {
    top: 45%;
    left: calc(var(--x) - 35%);
    width: 65%;
    height: 65%;
    background: radial-gradient(ellipse, rgb(167 185 197 / 16%), transparent 68%);
    animation-name: story-mist-drift;
    animation-duration: calc(12s * var(--speed));
}

/* Lighting stays broad enough to follow both the wide card and banner crop. */
[data-light="street"] .story-cover-light { background: radial-gradient(ellipse at 85% 65%, rgb(162 220 237 / 35%), transparent 32%), radial-gradient(ellipse at 10% 30%, rgb(235 164 78 / 23%), transparent 40%); }
[data-light="window"] .story-cover-light { background: linear-gradient(120deg, transparent 20%, rgb(255 249 221 / 35%) 48%, transparent 70%); animation-name: story-window-light; animation-duration: 10s; }
[data-light="sun"] .story-cover-light { background: radial-gradient(ellipse at 12% 15%, rgb(255 239 179 / 45%), transparent 65%); }
[data-light="warning"] .story-cover-light { background: radial-gradient(ellipse at 90% 55%, rgb(216 43 49 / 32%), transparent 23%); animation-duration: 4.5s; }
[data-light="shop"] .story-cover-light { background: radial-gradient(ellipse at 50% 65%, rgb(255 188 101 / 42%), transparent 40%); }
[data-light="candle"] .story-cover-light { background: radial-gradient(ellipse at 45% 8%, rgb(255 178 73 / 42%), transparent 48%); animation-name: story-candle-glow; animation-duration: 3.8s; }
[data-light="fire"] .story-cover-light { background: radial-gradient(ellipse at 75% 75%, rgb(255 124 55 / 40%), transparent 55%); animation-name: story-candle-glow; animation-duration: 4.2s; }
[data-light="energy"] .story-cover-light { background: radial-gradient(ellipse at 50% 5%, rgb(100 203 255 / 55%), transparent 45%); animation-duration: 5s; }
[data-light="sea"] .story-cover-light { background: radial-gradient(ellipse at 30% 80%, rgb(97 192 166 / 32%), transparent 60%); animation-duration: 9s; }
[data-light="forest"] .story-cover-light { background: radial-gradient(ellipse at 8% 12%, rgb(226 240 183 / 35%), transparent 60%); }

@keyframes story-light-breathe { 0%, 100% { opacity: .2; } 50% { opacity: .85; } }
@keyframes story-window-light { 0%, 100% { opacity: .2; transform: translateX(-7%); } 50% { opacity: .7; transform: translateX(7%); } }
@keyframes story-candle-glow { 0%, 100% { opacity: .3; } 24% { opacity: .7; } 42% { opacity: .4; } 65% { opacity: .8; } 83% { opacity: .55; } }
@keyframes story-dust-float { 0%, 100% { opacity: 0; transform: translate(0, 10px) scale(var(--size)); } 30%, 65% { opacity: .5; } 90% { transform: translate(24px, -28px) scale(var(--size)); opacity: 0; } }
@keyframes story-rain-fall { 0% { opacity: 0; transform: translate(14px, -20px) rotate(12deg); } 15%, 75% { opacity: .6; } 100% { opacity: 0; transform: translate(-55px, 430px) rotate(12deg); } }
@keyframes story-snow-fall { 0% { opacity: 0; transform: translate(0, -10px); } 15%, 70% { opacity: .7; } 100% { opacity: 0; transform: translate(85px, 390px); } }
@keyframes story-leaf-fall { 0% { opacity: 0; transform: translate(0, -10px) rotate(0); } 15%, 65% { opacity: .75; } 50% { transform: translate(-24px, 140px) rotate(155deg) scaleX(.5); } 100% { opacity: 0; transform: translate(48px, 360px) rotate(330deg); } }
@keyframes story-ember-rise { 0% { opacity: 0; transform: translate(0, 0); } 20%, 55% { opacity: .75; } 100% { opacity: 0; transform: translate(32px, -230px) scale(.3); } }
@keyframes story-signal-rise { 0%, 100% { opacity: 0; } 35%, 60% { opacity: .45; } from { transform: translateY(80px); } to { transform: translateY(-100px); } }
@keyframes story-mist-drift { 0%, 100% { opacity: 0; transform: translateX(-15%); } 35%, 65% { opacity: .7; } 95% { transform: translateX(25%); } }

@media (prefers-reduced-motion: reduce) {
    .story-cover-atmosphere { display: none; }
    .story-cover-atmosphere > span { animation: none !important; }
}
