/* Diwali 2026 (seasonal). Loaded after styles.css. To switch off: remove the
   diwali.css link and diwali.js script, the "golden" body class, the
   .dw-lanterns block at the top of <main> and the .dw-greet line from index.html. */

:root {
  --flame-core: #fff8dc;
  --flame-mid: #ffc24b;
  --flame-edge: #f08a3c;
  --glow: rgba(255, 176, 64, 0.38);
}

/* Warm headline gradient (also used by the button border) */
.golden { --gradient: linear-gradient(120deg, #f5a524, #f0782f 50%, #e94e80); }
:root[data-theme="dark"] .golden { --gradient: linear-gradient(120deg, #ffc24b, #ff8a3d 50%, #ff6f9d); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .golden { --gradient: linear-gradient(120deg, #ffc24b, #ff8a3d 50%, #ff6f9d); } }

/* Greeting above the stats pill */
.dw-greet {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 0 0 26px; font-size: 17px; color: var(--text-muted);
}
.dw-greet-hi { display: inline-flex; align-items: center; gap: 14px; }
.dw-deva {
  font-family: "Kohinoor Devanagari", "Noto Sans Devanagari", "Mukta", sans-serif;
  font-size: 30px; font-weight: 700; letter-spacing: .01em; line-height: 1.3;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dw-en { font-weight: 500; }
.dw-sep { display: none; }
@media (max-width: 480px) {
  .dw-greet { font-size: 15px; margin-bottom: 20px; }
  .dw-deva { font-size: 24px; }
}

/* Sky lanterns: one layer from the top of the page down to the marquee's
   top border. diwali.js sets --sky-h so the layer ends exactly on that line
   and the lanterns lift off it. The hero glow lives here too, fading out
   well before any edge. */
.golden main { position: relative; }
.dw-lanterns {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  height: var(--sky-h, 100vh); overflow: hidden; pointer-events: none;
}
.golden .dw-lanterns::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse min(560px, 80vw) 32% at 50% 33%, rgba(255, 170, 60, .2), rgba(240, 110, 80, .07) 55%, transparent 100%);
  animation: dw-breathe 6s ease-in-out infinite;
}
.dw-lantern {
  position: absolute; left: var(--x); bottom: calc(-32px * var(--s));
  width: calc(22px * var(--s)); height: calc(30px * var(--s));
  animation: dw-rise var(--d) linear var(--delay) infinite;
  will-change: transform;
}
.dw-lantern::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 38% 38% 22% 22% / 30% 30% 16% 16%;
  background: radial-gradient(ellipse 60% 55% at 50% 78%, #fff3c4 0, #ffc24b 35%, #f08a3c 75%, #d9603a 100%);
  box-shadow: 0 0 calc(22px * var(--s)) calc(5px * var(--s)) var(--glow);
  animation: dw-sway var(--sway) ease-in-out infinite alternate, dw-glow 3s ease-in-out infinite;
}
/* Start just under the line, small and dim; brighten and grow as they rise */
@keyframes dw-rise {
  0% { transform: translateY(0) scale(.65); opacity: 0; }
  5% { opacity: calc(var(--o, .9) * .65); }
  45% { transform: translateY(calc(var(--sky-h, 100vh) * -.45)) scale(1); opacity: var(--o, .9); }
  80% { opacity: calc(var(--o, .9) * .8); }
  100% { transform: translateY(calc(var(--sky-h, 100vh) * -1 - 40px)) scale(1.05); opacity: 0; }
}
@keyframes dw-sway { from { transform: translateX(-8px) rotate(-4deg); } to { transform: translateX(8px) rotate(4deg); } }
@keyframes dw-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
@media (max-width: 720px) {
  .dw-lantern:nth-child(n+10) { display: none; }
}

@keyframes dw-flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  20% { transform: scale(.94, 1.06) skewX(-2deg); }
  45% { transform: scale(1.04, .95) skewX(1.5deg); }
  70% { transform: scale(.97, 1.04) skewX(-1deg); }
}
@keyframes dw-breathe { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .dw-diya-flame, .dw-diya .dw-glow, .golden .dw-lanterns::before { animation: none !important; }
  .dw-lantern { display: none; }
}

/* Diya and lotus beside the greeting: bold geometric */
.dw-diya { display: inline-block; width: 44px; height: 44px; flex: none; }
.dw-diya svg { width: 100%; height: 100%; overflow: visible; }
.dw-greet-hi .dw-diya:last-child svg { transform: scaleX(-1); }
.dw-diya-flame {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: dw-flicker 2.4s ease-in-out infinite;
}
.dw-greet-hi .dw-diya:last-child .dw-diya-flame { animation-delay: -1.1s; animation-duration: 2.8s; }
.dw-diya .dw-glow { transform-box: fill-box; transform-origin: center; animation: dw-breathe 3s ease-in-out infinite; }
.dw-lotus { display: block; width: 76px; height: 38px; margin: 0 auto 4px; }
.dw-lotus svg { width: 100%; height: 100%; }
@media (max-width: 480px) {
  .dw-diya { width: 36px; height: 36px; }
  .dw-lotus { width: 62px; height: 31px; }
}
