/* Primordial WoW site motion v3 — 2026-11-10
   Midway between v1 (too faint) and v2 (too strong), about 55-60% of v2.
   Loaded site-wide from includes/header.php.
   Animate transform and opacity only. Shop cards: hover-only (no continuous per-card motion).
   Under prefers-reduced-motion, larger movement (fades, sweeps, lifts, frost drift) is
   turned off, but the ambient ember field and gold panel glow stay — they are the
   atmosphere of the site, not large motion. */

/* ---------- Keyframes ---------- */
@keyframes pwEmberDrift {
    from { transform: translate(0, 0); }
    to   { transform: translate(-700px, 500px); }
}
@keyframes pwMotionFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes pwBorderGlow {
    0%, 100% { opacity: .35; }
    50%      { opacity: .7; }
}
@keyframes pwRunePulse {
    0%, 100% { opacity: .5; transform: scale(1); }
    50%      { opacity: .75; transform: scale(1.05); }
}
@keyframes pwFrostDrift {
    from { transform: translateY(0) scale(1); opacity: .28; }
    to   { transform: translateY(8px) scale(1.04); opacity: .48; }
}
@keyframes pwGoldGlow {
    0%, 100% { opacity: .28; }
    50%      { opacity: .55; }
}
@keyframes pwBadgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.04); opacity: .92; }
}

:root { --pw-rune: url('/img/pw-rune.svg'); }

/* ---------- Site-wide ember field (all main pages) ---------- */
/* Fewer, smaller sparks than v2, still clearly visible above page backgrounds. */
.pw-ember-field {
    position: fixed;
    inset: -250px;
    z-index: 40;
    pointer-events: none;
    opacity: .55;
    background-image:
        radial-gradient(circle, rgba(255, 220, 120, .7) 0 1px, rgba(234, 88, 12, .32) 2.5px, transparent 6px),
        radial-gradient(circle, rgba(255, 200, 80, .65) 0 .8px, rgba(220, 38, 38, .28) 2px, transparent 5.5px),
        radial-gradient(circle, rgba(255, 230, 140, .75) 0 1.2px, rgba(234, 179, 8, .35) 3px, transparent 7px),
        radial-gradient(circle, rgba(255, 180, 80, .65) 0 1px, rgba(234, 88, 12, .28) 2.5px, transparent 6px),
        radial-gradient(circle, rgba(255, 210, 100, .7) 0 .8px, rgba(220, 38, 38, .26) 2px, transparent 5.5px),
        radial-gradient(circle, rgba(255, 232, 150, .65) 0 1.2px, rgba(234, 179, 8, .3) 3px, transparent 6.5px),
        radial-gradient(circle, rgba(255, 190, 90, .7) 0 1px, rgba(234, 88, 12, .28) 2.5px, transparent 6px);
    background-size:
        560px 460px, 700px 540px, 520px 420px, 760px 580px,
        640px 500px, 680px 520px, 500px 400px;
    background-position:
        8% 12%, 28% 70%, 52% 24%, 78% 82%,
        88% 18%, 42% 88%, 16% 48%;
    animation: pwEmberDrift 48s linear infinite;
    mix-blend-mode: screen;
}

/* Hide the original, very faint home.css ember layer so it does not stack with this one. */
body.home::before { opacity: 0 !important; animation: none !important; }

/* ---------- 1. Gentle hover sweep + lift ---------- */
.item-card > .relative,
.news-card,
.dn-pack,
.pw-card { position: relative; }
.item-card > .relative { overflow: hidden; }

.item-card > .relative::after,
.news-card::after,
.dn-pack::before,
.pw-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 32%, rgba(255, 236, 170, .42) 50%, transparent 68%);
    transform: translateX(-140%);
    opacity: 0;
    pointer-events: none;
    transition: transform .75s ease, opacity .28s ease;
    z-index: 3;
}
.item-card:hover > .relative::after,
.news-card:hover::after,
.dn-pack:hover::before,
.pw-card:hover::after {
    transform: translateX(140%);
    opacity: 1;
}

.pw-card,
.news-card,
.dn-pack,
.item-card {
    transition: transform .3s ease !important;
}
.pw-card:hover,
.news-card:hover,
.dn-pack:hover,
.item-card:hover {
    transform: translateY(-5px) scale(1.012) !important;
}

/* ---------- 2. Slightly shorter page-load fade ---------- */
.pw-fade,
.pw-pitch-hero,
body.shop .glass-container,
body.donate .glass-container,
body.news .glass-container,
.wow-panel {
    animation: pwMotionFadeUp .72s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.pw-cards > .pw-fade:nth-child(1),
.dn-grid > .pw-fade:nth-child(1),
body.news .grid > .pw-fade:nth-child(1) { animation-delay: .04s !important; }
.pw-cards > .pw-fade:nth-child(2),
.dn-grid > .pw-fade:nth-child(2),
body.news .grid > .pw-fade:nth-child(2) { animation-delay: .09s !important; }
.pw-cards > .pw-fade:nth-child(3),
.dn-grid > .pw-fade:nth-child(3),
body.news .grid > .pw-fade:nth-child(3) { animation-delay: .14s !important; }
.pw-cards > .pw-fade:nth-child(4),
.dn-grid > .pw-fade:nth-child(4),
body.news .grid > .pw-fade:nth-child(4) { animation-delay: .19s !important; }
.pw-cards > .pw-fade:nth-child(5),
.dn-grid > .pw-fade:nth-child(5),
body.news .grid > .pw-fade:nth-child(5) { animation-delay: .24s !important; }
.pw-cards > .pw-fade:nth-child(6),
.dn-grid > .pw-fade:nth-child(6),
body.news .grid > .pw-fade:nth-child(n+6) { animation-delay: .29s !important; }

/* ---------- 4. Softer gold border glow on panels ---------- */
.wow-panel,
.glass-container,
.realm-card {
    box-shadow:
        0 20px 40px -12px rgba(0, 0, 0, .8),
        0 0 0 1px rgba(242, 207, 82, .32),
        0 0 14px rgba(242, 207, 82, .22),
        0 0 28px rgba(234, 88, 12, .14) !important;
}
.realm-card::before,
.glass-container::before,
.wow-panel::before {
    animation: pwBorderGlow 5.5s ease-in-out infinite;
    border-color: rgba(242, 207, 82, .42) !important;
    box-shadow: inset 0 0 12px rgba(242, 207, 82, .14);
}
.dn-pack.selected::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1px solid rgba(242, 207, 82, .7);
    box-shadow: 0 0 12px rgba(242, 207, 82, .32);
    opacity: .55;
    pointer-events: none;
    animation: pwBorderGlow 5s ease-in-out infinite;
    z-index: 1;
}

/* ---------- 5. Slightly smaller, dimmer corner runes ---------- */
.pw-pitch-hero { position: relative; }
.pw-pitch-hero::after,
body.donate .glass-container::after,
body.news .glass-decoration::before {
    content: '';
    position: absolute;
    inset: 10px;
    background:
        var(--pw-rune) left top / 28px 28px no-repeat,
        var(--pw-rune) right top / 28px 28px no-repeat,
        var(--pw-rune) left bottom / 28px 28px no-repeat,
        var(--pw-rune) right bottom / 28px 28px no-repeat;
    opacity: .62;
    pointer-events: none;
    animation: pwRunePulse 6.5s ease-in-out infinite;
    z-index: 2;
}
body.shop .glass-container {
    background-image:
        var(--pw-rune), var(--pw-rune), var(--pw-rune), var(--pw-rune) !important;
    background-size: 28px 28px !important;
    background-position: 12px 12px, calc(100% - 12px) 12px, 12px calc(100% - 12px), calc(100% - 12px) calc(100% - 12px) !important;
    background-repeat: no-repeat !important;
}

/* ---------- 6. Lighter frost mist on the home hero ---------- */
.pw-pitch-hero::before {
    content: '';
    position: absolute;
    left: -12%;
    right: -12%;
    top: -40%;
    height: 150%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(160, 220, 255, .24), transparent 70%),
        radial-gradient(ellipse at 18% 45%, rgba(186, 230, 255, .13), transparent 55%),
        radial-gradient(ellipse at 82% 40%, rgba(140, 200, 255, .12), transparent 55%);
    pointer-events: none;
    z-index: 0;
    animation: pwFrostDrift 16s ease-in-out infinite alternate;
}
.pw-pitch-hero > * { position: relative; z-index: 1; }

/* ---------- 7. Sale badge pulse ---------- */
.pw-sale-badge { animation: pwBadgePulse 2.4s ease-in-out infinite; }

/* ---------- 8. Gold button sheen (opacity, not filter) ---------- */
.btn-gold {
    animation: none !important;
    position: relative;
    filter: drop-shadow(0 0 8px rgba(234, 88, 12, 0.35));
}
.btn-gold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 250, 220, .4), transparent 62%);
    opacity: .32;
    pointer-events: none;
    animation: pwGoldGlow 3s ease-in-out infinite;
}

/* ---------- Reduced motion ---------- */
/* Keep embers and the gold panel glow. Drop large movement only. */
@media (prefers-reduced-motion: reduce) {
    .pw-fade,
    .pw-pitch-hero,
    body.shop .glass-container,
    body.donate .glass-container,
    body.news .glass-container,
    .wow-panel,
    .pw-card,
    .news-card,
    .dn-pack,
    .item-card,
    .pw-btn,
    .limited-stock-badge,
    .tab-content,
    .tab-panel,
    .btn-gold,
    .btn-gold::after,
    .pw-sale-badge {
        animation: none !important;
        transition: none !important;
    }
    .pw-fade,
    .pw-pitch-hero,
    body.shop .glass-container,
    body.donate .glass-container,
    body.news .glass-container,
    .wow-panel {
        opacity: 1 !important;
        transform: none !important;
    }
    .item-card > .relative::after,
    .news-card::after,
    .dn-pack::before,
    .pw-card::after { display: none !important; }

    .pw-pitch-hero::before { animation: none !important; opacity: .28; }

    .pw-pitch-hero::after,
    body.donate .glass-container::after,
    body.news .glass-decoration::before {
        animation: none !important;
        opacity: .62;
        transform: none !important;
    }

    .pw-ember-field { animation-duration: 80s; }
    .realm-card::before,
    .glass-container::before,
    .wow-panel::before,
    .dn-pack.selected::after { animation-duration: 10s; }

    .pw-card:hover,
    .news-card:hover,
    .dn-pack:hover,
    .item-card:hover { transform: none !important; }
}
