/* Diwali 2026 makeover (owner, 8 Nov: "subtle, grand and beautiful", off by itself after about 7 days).
   Applies only while the Worker marks the page <html data-festive="diwali"> (tools/festive.js decides the dates), so when the
   window ends nothing here matches and the site is exactly as before. Music mode (html.lite) is left alone; "Animations off"
   (html.still) and reduced motion keep the colours but nothing moves. Decor never takes clicks. */
html[data-festive="diwali"]:not(.lite){--a1:#f4c26b;--a2:#ff8a3d;--beam:#fbe4b8;--bp-diya:#ffcf6b;--bp-diya-glow:rgba(255,170,70,.42)}

/* Warm light over the hero, on top of the existing sky (its own element: the hero's ::before/::after are the night sky) */
.bp-glow{position:absolute;inset:0;pointer-events:none;background:radial-gradient(70% 60% at 50% 32%,rgba(255,170,70,.14),rgba(255,140,60,.045) 45%,transparent 70%)}

/* Toran: a thin marigold string across the top of the hero (scrolls away with it) */
.bp-toran{position:absolute;left:0;right:0;top:0;height:44px;pointer-events:none;z-index:2;overflow:hidden}
.bp-toran svg{display:block;width:100%;height:44px}
.bp-toran .tl{fill:none;stroke:#f4c26b;stroke-opacity:.5;stroke-width:1}
.bp-toran .ts{stroke:#f4c26b;stroke-opacity:.4;stroke-width:1}
.bp-toran .tm{fill:url(#bpMarigold)}
.bp-toran .tf{fill:#3f6b3a;opacity:.85}
.bp-toran .tg{transform-origin:center top;animation:bpSway 6s ease-in-out infinite}
@keyframes bpSway{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2deg)}}

/* Greeting with a diya, above the hero title */
.bp-greet{position:relative;z-index:3;display:inline-flex;align-items:center;gap:10px;margin:0 0 14px;color:#f4c26b;
  font:700 12px/1.2 var(--text,system-ui),sans-serif;letter-spacing:.2em;text-transform:uppercase;text-shadow:0 0 18px rgba(255,170,70,.35)}
.bp-greet svg{width:24px;height:20px;flex:none;overflow:visible}
.bp-greet .bp-fl{transform-origin:50% 100%;animation:bpFlicker 1.6s ease-in-out infinite}
.bp-greet .bp-fl2{fill:#fff3c4}
@keyframes bpFlicker{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.14) translateY(-.5px)}}

/* Embers rising behind the hero text */
.bp-embers{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:hidden}
.bp-embers i{position:absolute;bottom:-8px;width:3px;height:3px;border-radius:50%;background:var(--bp-diya);box-shadow:0 0 8px #ffb347,0 0 2px #fff3c4;opacity:0;animation:bpRise 9s linear infinite}
.bp-embers i:nth-child(3n){width:2px;height:2px}
.bp-embers i:nth-child(4n){background:#ff9d3d;box-shadow:0 0 8px #ff8a3d}
@keyframes bpRise{0%{transform:translate(0,0);opacity:0}12%{opacity:.85}70%{opacity:.6}100%{transform:translate(var(--dx,12px),-78vh);opacity:0}}

/* Rangoli line art: beside section titles and Back to top */
.bp-rangoli{display:inline-block;width:30px;height:30px;vertical-align:middle;margin:0 0 0 12px;color:#f4c26b;opacity:.85}
.bp-rangoli svg{display:block;width:100%;height:100%}
.bp-rangoli .rs{fill:none;stroke:currentColor;stroke-width:1.1}
.bp-rangoli .rd{fill:#ff8a3d}

/* Play button: diya gold with a warm glow; the loading ring turns gold through --a1 already */
html[data-festive="diwali"]:not(.lite) .play-btn{background:radial-gradient(circle at 50% 32%,#ffe7b3,#f4c26b 62%,#e9a64a);color:#1b1206}
html[data-festive="diwali"]:not(.lite) .play-btn:hover{box-shadow:0 0 0 6px rgba(244,194,107,.16),0 0 28px var(--bp-diya-glow)}

/* Seek and volume: two warm tones, still calm (no rainbow) */
html[data-festive="diwali"]:not(.lite) input[type=range]::-webkit-slider-runnable-track{background:linear-gradient(90deg,#ff8a3d,#f4c26b var(--p),rgba(238,234,246,.14) var(--p))}
html[data-festive="diwali"]:not(.lite) input[type=range]::-moz-range-progress{background:linear-gradient(90deg,#ff8a3d,#f4c26b)}
html[data-festive="diwali"]:not(.lite) input[type=range]::-webkit-slider-thumb{background:#ffe7b3;box-shadow:0 0 0 4px rgba(244,194,107,.22),0 0 10px rgba(255,170,70,.5)}

/* Phuljhari: a short sparkler burst when the music first starts, once per visit */
.bp-burst{position:fixed;width:0;height:0;pointer-events:none;z-index:2147483000}
.bp-burst i{position:absolute;left:-1px;top:-6px;width:2px;height:12px;border-radius:2px;background:linear-gradient(#fff6d6,#ffb347 60%,rgba(255,138,61,0));
  transform:rotate(var(--r)) translateY(0) scaleY(.3);opacity:0;animation:bpBurst .75s cubic-bezier(.2,.7,.3,1) forwards;animation-delay:var(--d,0s)}
@keyframes bpBurst{15%{opacity:1}100%{transform:rotate(var(--r)) translateY(-42px) scaleY(1);opacity:0}}

/* MaxxImmerse: a faint layer of warm sparks over whichever visual is on, behind the controls */
.bp-imm-sparks{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:hidden;mix-blend-mode:screen}
.bp-imm-sparks i{position:absolute;bottom:-6px;width:3px;height:3px;border-radius:50%;background:var(--bp-diya);box-shadow:0 0 10px #ffb347;opacity:0;animation:bpRise 11s linear infinite}
.bp-imm-sparks i:nth-child(odd){width:2px;height:2px}

/* Stillness: "Animations off" and reduced motion keep the look, nothing moves; music mode hides the decor entirely */
html.still .bp-toran .tg,html.still .bp-greet .bp-fl,html.still .bp-embers,html.still .bp-burst,html.still .bp-imm-sparks{animation:none!important}
html.still .bp-embers,html.still .bp-imm-sparks,html.still .bp-burst{display:none}
@media (prefers-reduced-motion:reduce){.bp-toran .tg,.bp-greet .bp-fl{animation:none}.bp-embers,.bp-imm-sparks,.bp-burst{display:none}}
html.lite .bp-glow,html.lite .bp-toran,html.lite .bp-greet,html.lite .bp-embers,html.lite .bp-rangoli,html.lite .bp-burst,html.lite .bp-imm-sparks{display:none!important}
@media (max-width:700px){.bp-toran,.bp-toran svg{height:34px}.bp-greet{font-size:11px;letter-spacing:.16em;margin-bottom:10px}.bp-rangoli{width:24px;height:24px;margin-left:8px}}
@media print{.bp-toran,.bp-embers,.bp-burst,.bp-imm-sparks{display:none}}

/* ---- Diwali, part 2 (owner 8 Nov: "subtle dynamic effects across the site"; same end date) ----
   Only transform/opacity animate, nothing writes styles per frame, and every loop pauses while off screen or scrolling. */

/* Sky lanterns: two or three faint lanterns drifting up behind everything, very slowly */
.bp-lanterns{position:fixed;inset:0;pointer-events:none;z-index:-1;overflow:hidden;contain:strict}
.bp-lantern{position:absolute;bottom:-70px;width:22px;height:30px;opacity:0;will-change:transform,opacity;animation:bpLantern 46s linear infinite}
.bp-lantern::before{content:"";position:absolute;inset:0;border-radius:40% 40% 46% 46%/34% 34% 62% 62%;background:radial-gradient(circle at 50% 70%,#fff1c2 0,#ffc36b 32%,#ff8a3d 70%,rgba(255,138,61,.5) 100%);box-shadow:0 0 18px 6px rgba(255,160,70,.32)}
.bp-lantern::after{content:"";position:absolute;left:50%;bottom:-5px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:#fff3c4;box-shadow:0 0 8px #ffcf6b}
@keyframes bpLantern{0%{transform:translate(0,0) rotate(-3deg);opacity:0}8%{opacity:.34}50%{transform:translate(var(--lx,20px),-60vh) rotate(3deg)}88%{opacity:.26}100%{transform:translate(calc(var(--lx,20px)*-.5),-118vh) rotate(-2deg);opacity:0}}
html.bp-scrolling .bp-lantern,.bp-paused .bp-lantern{animation-play-state:paused}
body:has(.imm.open) .bp-lanterns{display:none}

/* Section titles: a short gold line draws in once, when the title scrolls into view */
.bp-uline{position:absolute;left:0;bottom:-10px;height:2px;width:72px;border-radius:2px;pointer-events:none;
  background:linear-gradient(90deg,#ff8a3d,#f4c26b 60%,rgba(244,194,107,0));transform:scaleX(0);transform-origin:left;transition:transform 1.1s cubic-bezier(.2,.8,.2,1) .15s}
.bp-uline::after{content:"";position:absolute;right:8px;top:-2px;width:6px;height:6px;border-radius:50%;background:#ffe2a8;box-shadow:0 0 10px #ffb347;opacity:0;transition:opacity .6s 1s}
.bp-seen .bp-uline{transform:scaleX(1)}
.bp-seen .bp-uline::after{opacity:.9}
.bp-uline.c{left:50%;margin-left:-36px;transform-origin:center}

/* Footer: a row of diyas, flames flicker only while the row is on screen */
.bp-diyas{display:flex;justify-content:center;gap:clamp(18px,4vw,46px);padding:18px 0 6px;pointer-events:none}
.bp-diyas svg{width:30px;height:26px;overflow:visible}
.bp-diyas .bp-fl{transform-origin:50% 100%;animation:bpFlicker 1.7s ease-in-out infinite;animation-play-state:paused}
.bp-diyas .halo{opacity:.55;transform-origin:center;animation:bpHalo 3.2s ease-in-out infinite;animation-play-state:paused}
.bp-diyas.bp-on .bp-fl,.bp-diyas.bp-on .halo{animation-play-state:running}
.bp-diyas svg:nth-child(2) .bp-fl{animation-delay:-.4s}.bp-diyas svg:nth-child(3) .bp-fl{animation-delay:-.9s}.bp-diyas svg:nth-child(4) .bp-fl{animation-delay:-1.3s}.bp-diyas svg:nth-child(5) .bp-fl{animation-delay:-.2s}
@keyframes bpHalo{50%{opacity:.85;transform:scale(1.12)}}

/* Desktop cursor: a few tiny gold sparks trail the pointer */
.bp-spark{position:fixed;left:0;top:0;width:4px;height:4px;margin:-2px 0 0 -2px;border-radius:50%;pointer-events:none;z-index:2147483000;
  background:#ffe2a8;box-shadow:0 0 6px #ffb347;animation:bpSpark .7s ease-out forwards}
@keyframes bpSpark{from{opacity:.9;transform:translate(var(--x),var(--y)) scale(1)}to{opacity:0;transform:translate(calc(var(--x) + var(--dx)),calc(var(--y) + 18px)) scale(.3)}}

/* "Spin me around": a short shower of marigold petals */
.bp-petal{position:fixed;top:-20px;width:10px;height:12px;border-radius:60% 0 60% 0;pointer-events:none;z-index:2147483000;
  background:linear-gradient(135deg,#ffcf6b,#ff8a3d);opacity:.9;animation:bpPetal var(--t,2.4s) cubic-bezier(.3,.2,.5,1) forwards}
@keyframes bpPetal{to{transform:translate(var(--dx,30px),105vh) rotate(var(--r,540deg));opacity:0}}

html.still .bp-lanterns,html.still .bp-spark,html.still .bp-petal{display:none!important}
html.still .bp-diyas .bp-fl,html.still .bp-diyas .halo{animation:none}
html.still .bp-uline,html.lite .bp-uline{transition:none}
@media (prefers-reduced-motion:reduce){.bp-lanterns,.bp-spark,.bp-petal{display:none!important}.bp-diyas .bp-fl,.bp-diyas .halo{animation:none}.bp-uline{transition:none}}
html.lite .bp-lanterns,html.lite .bp-diyas,html.lite .bp-uline,html.lite .bp-spark,html.lite .bp-petal{display:none!important}
@media print{.bp-lanterns,.bp-diyas,.bp-spark,.bp-petal{display:none}}
