/* ===== DIWALI + KALI PUJA FESTIVE THEME =====
   Every rule is scoped under html.diwali — diwali.js adds that class only during the festive dates. */

html.diwali {
  --accent: #C2410C;
  --paper: #FFF4E2;
  --gold: #E3A21A;
  --night: #170B26;
  --kali: #8E1330;
  --bn: 'Tiro Bangla', 'Newsreader', Georgia, serif
}

.diwali .scroll-progress { background: linear-gradient(90deg, var(--kali), var(--accent), var(--gold)) }

/* ribbon */
.dw-ribbon {
  position: relative;
  background: var(--night);
  color: #FBE7C0;
  text-align: center;
  padding: 10px 20px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap
}

.dw-ribbon::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: radial-gradient(circle, #FFC94A 0 2.5px, transparent 3px) 0 50%/18px 6px repeat-x;
  animation: dwTwinkle 1.6s steps(2) infinite
}

.dw-ribbon [lang="bn"] { font-family: var(--bn); font-size: 17px; letter-spacing: 0; color: var(--gold) }

.dw-diya { display: inline-flex; width: 22px; height: 22px; flex-shrink: 0 }
.dw-diya svg { width: 100%; height: 100% }
.dw-flame { transform-origin: 20px 19px; animation: dwFlicker 1.2s ease-in-out infinite alternate }

@keyframes dwFlicker {
  0% { transform: scale(1, 1) rotate(-3deg); opacity: .9 }
  100% { transform: scale(.88, 1.12) rotate(3deg); opacity: 1 }
}

@keyframes dwTwinkle { 50% { opacity: .45 } }

/* navbar */
.diwali .navbar { background: rgba(255, 244, 226, .9); border-bottom: 2px solid var(--gold) }
.diwali .nav-social a:hover,
.diwali .nav-social a:focus-visible { box-shadow: 0 10px 22px rgba(227, 162, 26, .45) }

.diwali .btn-accent { box-shadow: 0 12px 30px rgba(194, 65, 12, .28), inset 0 -3px 0 rgba(227, 162, 26, .6) }

/* hero: night sky */
.diwali .hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 78% 40%, rgba(227, 162, 26, .16), transparent 60%),
    radial-gradient(ellipse at 10% 0%, rgba(142, 19, 48, .10), transparent 55%)
}

.diwali .hero-grid { position: relative; z-index: 1 }

.dw-greet { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap }
.dw-greet [lang="bn"] { font-family: var(--bn); font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.2; color: var(--kali) }
.dw-greet small {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--night);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px
}
.dw-greet small .dw-diya { width: 18px; height: 18px }

.diwali .glow { background: var(--gold); opacity: .26 }
.diwali .frame { border: 2px solid var(--gold); opacity: .6 }

/* Maa Kali faded background: left edge to middle */
.dw-kali-bg {
  position: absolute;
  z-index: 0;
  top: 0; bottom: 0; left: 0;
  width: 50%;
  pointer-events: none;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: .16;
  -webkit-mask-image: linear-gradient(to right, #000 55%, transparent 100%), linear-gradient(to bottom, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 55%, transparent 100%), linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-composite: intersect
}

.dw-kali-empty {
  opacity: 1;
  -webkit-mask-image: none;
  mask-image: none;
  border: 2px dashed rgba(142, 19, 48, .3);
  display: flex;
  align-items: flex-end;
  padding: 16px
}
.dw-kali-empty span { font-size: 11px; line-height: 1.4; color: rgba(23, 11, 38, .55) }

/* firecracker bursts */
.dw-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none }

.dw-burst {
  position: absolute;
  width: var(--s);
  height: var(--s);
  translate: -50% -50%;
  opacity: 0;
  animation: dwBurst 3.6s ease-out infinite
}

.dw-burst i {
  position: absolute;
  left: 50%; top: 50%;
  width: 3px;
  height: 30%;
  margin-left: -1.5px;
  border-radius: 3px;
  transform-origin: 50% 0;
  transform: rotate(var(--a)) translateY(18%);
  background: linear-gradient(to bottom, transparent, var(--c));
  box-shadow: 0 0 6px var(--c)
}

.dw-burst i::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -3px;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c)
}

@keyframes dwBurst {
  0% { opacity: 0; scale: .1 }
  8% { opacity: 1 }
  40% { opacity: .9; scale: 1 }
  60%, 100% { opacity: 0; scale: 1.15 }
}

/* extra crackers (CSS only) */
.dw-burst:nth-child(odd) { animation-duration: 4.2s }
.dw-burst:nth-child(3n) { animation-duration: 3s }

/* centre flash */
.dw-burst::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14%; height: 14%;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--c) 45%, transparent 70%);
  filter: blur(1px)
}

/* crackle glitter ring that pops after the main burst */
.dw-burst::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: #FFF3C4;
  color: #FFF3C4;
  box-shadow:
    40px 0, 34.6px 20px, 20px 34.6px, 0 40px, -20px 34.6px, -34.6px 20px,
    -40px 0, -34.6px -20px, -20px -34.6px, 0 -40px, 20px -34.6px, 34.6px -20px,
    22px 8px var(--c), -8px 22px var(--c), -22px -8px var(--c), 8px -22px var(--c);
  opacity: 0;
  animation: dwCrackle 3.6s ease-out infinite;
  animation-delay: inherit
}

@keyframes dwCrackle {
  0%, 30% { opacity: 0; scale: .3 }
  38% { opacity: 1; scale: calc(var(--s) / 100px) }
  44% { opacity: .2 }
  50% { opacity: 1 }
  56% { opacity: .3 }
  64%, 100% { opacity: 0; scale: calc(var(--s) / 85px); translate: 0 10px }
}

/* rockets shooting up, then popping into a ring of stars */
.dw-sky::before,
.dw-sky::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 3px; height: 40px;
  border-radius: 3px;
  background: linear-gradient(to top, transparent, #FFC94A 70%, #fff);
  box-shadow: 0 0 8px #FFC94A;
  opacity: 0;
  animation: dwRocket 5s cubic-bezier(.2, .6, .4, 1) infinite
}
.dw-sky::before { left: 24% }
.dw-sky::after { left: 76%; animation-delay: 2.4s; animation-duration: 5.6s }

@keyframes dwRocket {
  0% { opacity: 0; translate: 0 0; height: 40px }
  5% { opacity: 1 }
  38% { opacity: 1; translate: 6px -70vh; height: 40px }
  40% {
    opacity: 1; translate: 6px -70vh; width: 4px; height: 4px; border-radius: 50%; background: #fff;
    box-shadow: 0 0 10px 3px #FFC94A,
      50px 0 #FF7A3D, 35px 35px #FFC94A, 0 50px #FF4D6D, -35px 35px #FFE9A8,
      -50px 0 #FF7A3D, -35px -35px #FFC94A, 0 -50px #FF4D6D, 35px -35px #7FE0D2
  }
  48% { opacity: .9; scale: 1.6 }
  58%, 100% { opacity: 0; translate: 6px -66vh; width: 4px; height: 4px; border-radius: 50%; scale: 1.9 }
}

/* falling sparkle dust over the hero */
.diwali .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, #FFE9A8 0 1.2px, transparent 1.8px) 0 0/140px 160px,
    radial-gradient(circle, #FF7A3D 0 1px, transparent 1.6px) 60px 40px/190px 210px,
    radial-gradient(circle, #FFC94A 0 1.4px, transparent 2px) 110px 90px/230px 180px;
  opacity: .55;
  animation: dwDust 14s linear infinite, dwTwinkle 1.8s steps(2) infinite
}

@keyframes dwDust {
  to { background-position: 0 160px, 60px 250px, 110px 270px }
}

/* ticker with string lights */
.diwali .ticker { position: relative; background: var(--night); border-color: var(--gold) }
.diwali .ticker-track span { color: #FBE7C0; display: inline-flex; align-items: center; gap: 14px }
.diwali .ticker-track span::before {
  content: '';
  width: 8px; height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #FFC94A;
  box-shadow: 0 0 8px 2px rgba(255, 201, 74, .7)
}

.dw-lights {
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 8px;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle, #FF7A3D 0 3px, transparent 3.5px) 0 50%/48px 8px repeat-x,
    radial-gradient(circle, #FFC94A 0 3px, transparent 3.5px) 16px 50%/48px 8px repeat-x,
    radial-gradient(circle, #FF4D6D 0 3px, transparent 3.5px) 32px 50%/48px 8px repeat-x;
  animation: dwTwinkle 1.4s steps(2) infinite
}

/* sections */
.diwali .section {
  border-top: 0;
  background-image: radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px);
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 22px 10px
}

.diwali .section-head .num { display: inline-flex; align-items: center; gap: 8px }
.diwali .section-head .num::before {
  content: '';
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 4c4 6 5 10 0 15c-5-5-4-9 0-15z' fill='%23FFB020'/%3E%3Cpath d='M4 22h32c-2 9-9 13-16 13S6 31 4 22z' fill='%23C2410C'/%3E%3C/svg%3E") center/contain no-repeat
}

.diwali .check-list li { border-color: rgba(227, 162, 26, .35) }
.diwali .img-frame { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 6px }

.diwali .why-grid,
.diwali .why-card { border-color: rgba(227, 162, 26, .4) }

.diwali .flavor-card { border-color: rgba(227, 162, 26, .5); transition: box-shadow .3s ease, transform .3s ease }
.diwali .flavor-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(227, 162, 26, .25) }
.diwali .flavor-badge-onimg { box-shadow: 0 6px 16px rgba(194, 65, 12, .35) }

/* menu: night sky with gold stars */
.diwali .menu-section {
  background-color: var(--night);
  background-image:
    radial-gradient(circle, rgba(255, 233, 168, .7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 201, 74, .45) 0 1.5px, transparent 2px);
  background-size: 90px 90px, 150px 150px;
  background-position: 0 0, 40px 60px
}
.diwali .menu-section .section-head .num { color: var(--gold) }
.diwali .menu-card { background: rgba(255, 244, 226, .05); border-color: rgba(227, 162, 26, .35) }
.diwali .menu-badge { background: var(--gold); color: var(--night); font-weight: 700 }
.diwali .menu-order:hover { background: var(--gold); border-color: var(--gold); color: var(--night) }
.diwali .bulk-banner { border-color: rgba(227, 162, 26, .5) }

.diwali .reviews-section,
.diwali .insta-section { background-color: #FBEBD3 }
.diwali .stars { color: var(--gold); text-shadow: 0 0 1px var(--night) }
.diwali .qr-card { border: 2px solid var(--gold) }

.diwali .faq-grid,
.diwali .faq-item { border-color: rgba(227, 162, 26, .4) }

.diwali .info-item i { background: rgba(194, 65, 12, .09) }
.diwali .contact-info,
.diwali .message-card,
.diwali .map-frame { border-color: rgba(227, 162, 26, .5) }

/* footer */
.diwali .footer { position: relative; background: var(--night) }
.diwali .footer::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  background: radial-gradient(circle, #FFC94A 0 2.5px, transparent 3px) 0 50%/18px 6px repeat-x;
  animation: dwTwinkle 1.6s steps(2) infinite
}
.dw-foot-greet { font-family: var(--bn); color: var(--gold); font-size: 1.15rem }

.diwali .sticky-bar { background: rgba(255, 244, 226, .95); border-top: 2px solid var(--gold) }

@media (max-width:768px) {
  .dw-ribbon { font-size: 12px; gap: 8px; padding: 8px 14px 12px }
  .dw-kali-bg { width: 100%; bottom: auto; height: 70%; opacity: .12 }
  .dw-burst { --s: 80px !important }
}

@media (prefers-reduced-motion:reduce) {
  .dw-burst { animation: none; opacity: .5 }
  .dw-burst::before, .dw-sky::before, .dw-sky::after, .diwali .hero::after { animation: none; opacity: 0 }
  .dw-flame, .dw-lights, .dw-ribbon::after, .diwali .footer::before { animation: none }
}
