/* =========================================================
   DIWALI 2026 — festive layer (lights, fireworks, offer banner)
   Everything here hangs off html.festive, which js/diwali.js sets
   only inside the festive window, so after the end date the site
   goes back to normal without a redeploy.
   ========================================================= */

:root {
  --dw-gold: #fbbf24;
  --dw-gold-soft: #fde68a;
  --dw-saffron: #f97316;
  --dw-marigold: #f59e0b;
  --dw-rose: #f43f5e;
  --dw-maroon: #4a0e1c;
  --dw-deep: #1c0810;
}

/* Hidden by default; shown only while the festival is on */
.festive-only { display: none; }
html.festive .festive-only { display: block; }

/* ---------- Header string lights (jhalar) ---------- */
.festive-lights {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 22px;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

/* The wire */
.festive-lights::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.45) 6%, rgba(251, 191, 36, 0.45) 94%, transparent);
}

.festive-bulb {
  position: absolute;
  top: 3px;
  width: 6px;
  height: 9px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--bulb, var(--dw-gold));
  box-shadow: 0 0 6px 1px var(--bulb, var(--dw-gold)), 0 0 14px 2px color-mix(in srgb, var(--bulb, var(--dw-gold)) 45%, transparent);
  animation: festiveTwinkle 2.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* Little cap on each bulb */
.festive-bulb::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -2px;
  width: 4px;
  height: 3px;
  border-radius: 1px;
  background: #3f3f46;
}

.festive-bulb:nth-child(even) { top: 6px; }

@keyframes festiveTwinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Hero fireworks canvas ---------- */
.festive-fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Diwali offer banner ---------- */
.diwali-offer {
  padding: 56px 0 24px;
  background: var(--bg);
}

.diwali-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 22%, rgba(251, 191, 36, 0.22), transparent 42%),
    radial-gradient(circle at 70% 90%, rgba(244, 63, 94, 0.18), transparent 45%),
    linear-gradient(135deg, #2a0a14 0%, var(--dw-maroon) 45%, #1a0a05 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 24px 60px rgba(28, 8, 16, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.08) inset;
}

/* Rangoli dot pattern, very faint */
.diwali-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(251, 191, 36, 0.16) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 70%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 70%);
  pointer-events: none;
}

/* Marigold toran along the top edge */
.diwali-toran {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30px;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle at 11px 9px, #fb923c 0 7px, transparent 7.5px) 0 0 / 22px 18px repeat-x,
    radial-gradient(circle at 11px 9px, #facc15 0 7px, transparent 7.5px) 11px 0 / 22px 18px repeat-x;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

/* Mango-leaf drops hanging from the toran */
.diwali-toran::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 16px;
  background: radial-gradient(ellipse 5px 8px at 33px 8px, #16a34a 0 95%, transparent 100%) 0 0 / 66px 16px repeat-x;
  opacity: 0.9;
}

.diwali-copy {
  position: relative;
  z-index: 2;
  padding: 58px 44px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.diwali-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--dw-gold-soft);
  font: 700 12px/1 var(--font-body);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.diwali-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: #fff;
}

.diwali-title .gold {
  background: linear-gradient(100deg, #fde68a 0%, #fbbf24 40%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.diwali-text {
  color: #fde7d2;
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 520px;
}

.diwali-points {
  list-style: none;
  display: grid;
  gap: 8px;
  color: #fff7ed;
  font-size: 15px;
}

.diwali-points li { display: flex; gap: 10px; align-items: baseline; }
.diwali-points li::before { content: "✦"; color: var(--dw-gold); font-size: 13px; }

.diwali-countdown {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fff;
  font: 600 14px/1.2 var(--font-body);
}

.diwali-countdown strong {
  font: 800 22px/1 var(--font-heading);
  color: var(--dw-gold);
}

.diwali-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.btn-diwali {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 45%, #ea580c 100%);
  color: #2a0a00;
  border: 0;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45);
  font-weight: 800;
}

.btn-diwali-ghost {
  background: transparent;
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .btn-diwali:hover { box-shadow: 0 14px 34px rgba(245, 158, 11, 0.6); }
  .btn-diwali-ghost:hover { background: rgba(253, 230, 138, 0.1); color: #fff; }
}

.diwali-note { color: rgba(253, 231, 210, 0.7); font-size: 12.5px; }

/* Photo side */
.diwali-photo {
  position: relative;
  min-height: 100%;
  overflow: hidden;
}

.diwali-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  display: block;
}

/* Warm wash that blends the photo into the card */
.diwali-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--dw-maroon) 0%, rgba(74, 14, 28, 0.55) 22%, rgba(74, 14, 28, 0) 50%),
    linear-gradient(0deg, rgba(28, 8, 16, 0.55) 0%, transparent 35%);
}

/* Row of diyas along the bottom of the photo */
.diwali-diyas {
  position: absolute;
  left: 8%;
  right: 6%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.diya { position: relative; width: 46px; height: 40px; }
.diya svg { width: 100%; height: 100%; overflow: visible; }

.diya-flame {
  transform-origin: 23px 18px;
  animation: diyaFlicker 1.6s ease-in-out infinite;
}

.diya:nth-child(2) .diya-flame { animation-duration: 1.9s; animation-delay: -0.4s; }
.diya:nth-child(3) .diya-flame { animation-duration: 1.4s; animation-delay: -0.8s; }
.diya:nth-child(4) .diya-flame { animation-duration: 2.1s; animation-delay: -1.1s; }

@keyframes diyaFlicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  30% { transform: scale(0.94, 1.08) rotate(-3deg); }
  60% { transform: scale(1.04, 0.95) rotate(2deg); }
}

.diya-glow {
  position: absolute;
  left: 50%;
  top: -6px;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.55), transparent 65%);
  animation: festiveTwinkle 2.2s ease-in-out infinite;
}

/* ---------- "Happy Diwali" greeting on opening the site ---------- */
.diwali-wish {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 45%, rgba(74, 14, 28, 0.55), rgba(10, 3, 8, 0.82) 70%);
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}

.diwali-wish.show { opacity: 1; }

.diwali-wish-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.diwali-wish-card {
  position: relative;
  width: min(440px, 100%);
  padding: 46px 30px 30px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.28), transparent 55%),
    linear-gradient(160deg, #3a0c18 0%, var(--dw-maroon) 50%, #1c0810 100%);
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(251, 191, 36, 0.18);
  transform: translateY(14px) scale(0.94);
  transition: transform 450ms var(--ease-out);
}

.diwali-wish.show .diwali-wish-card {
  transform: translateY(0) scale(1);
  animation: wishFloat 4s ease-in-out 600ms infinite;
}

@keyframes wishFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Rangoli dots behind the card text */
.diwali-wish-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(251, 191, 36, 0.14) 1.2px, transparent 1.6px);
  background-size: 20px 20px;
  pointer-events: none;
}

.diwali-wish-card > * { position: relative; }
.diwali-wish-card .diwali-toran { position: absolute; }

.diwali-wish-close {
  position: absolute;
  top: 30px;
  right: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  color: #fde68a;
  font: 500 22px/1 var(--font-body);
  cursor: pointer;
}

.diwali-wish-close:focus-visible { outline: 2px solid var(--dw-gold); outline-offset: 2px; }

.diwali-wish-diya {
  width: 74px;
  height: 64px;
  margin: 4px auto 6px;
}

.diwali-wish-diya svg { width: 100%; height: 100%; overflow: visible; }
.diwali-wish-diya .diya-flame { transform-origin: 23px 18px; animation: diyaFlicker 1.6s ease-in-out infinite; }
.diwali-wish-diya .diya-glow { width: 90px; height: 90px; top: -16px; }

.diwali-wish-title {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  font-size: clamp(46px, 12vw, 64px);
  line-height: 1;
  background: linear-gradient(100deg, #fef3c7 0%, #fbbf24 45%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(251, 191, 36, 0.35));
  margin-bottom: 14px;
}

.diwali-wish-text { color: #fde7d2; font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
.diwali-wish-sign { color: var(--dw-gold-soft); font-size: 13.5px; font-weight: 600; margin-bottom: 20px; }
.diwali-wish-cta { display: inline-flex; }

@media (hover: hover) and (pointer: fine) {
  .diwali-wish-close:hover { background: rgba(0, 0, 0, 0.5); color: #fff; }
}

@media (max-width: 480px) {
  .diwali-wish { padding: 16px; }
  .diwali-wish-card { padding: 42px 20px 24px; border-radius: 20px; }
  .diwali-wish-text { font-size: 15px; }
  .diwali-wish-cta { width: 100%; justify-content: center; }
}

/* ---------- Light mode: the card keeps its festive night look ---------- */
:root[data-theme="light"] .diwali-offer { background: var(--bg); }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .diwali-card { grid-template-columns: 1fr; }
  .diwali-photo { order: -1; height: 230px; }
  .diwali-photo::after {
    background: linear-gradient(0deg, var(--dw-maroon) 0%, rgba(74, 14, 28, 0.4) 35%, transparent 70%);
  }
  .diwali-copy { padding: 22px 20px 26px; gap: 14px; }
  .diwali-text { font-size: 15.5px; }
  .diwali-diyas { bottom: 6px; }
  .diya { width: 38px; height: 33px; }
}

@media (max-width: 480px) {
  .diwali-offer { padding: 40px 0 12px; }
  .diwali-countdown { gap: 8px; padding: 9px 14px; font-size: 13px; }
  .diwali-countdown strong { font-size: 17px; white-space: nowrap; }
  .diwali-actions { width: 100%; }
  .diwali-actions .btn { flex: 1 1 100%; justify-content: center; text-align: center; }
}

/* ---------- Reduced motion: keep the colour, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .festive-bulb, .diya-flame, .diya-glow { animation: none; }
  .diwali-wish.show .diwali-wish-card { animation: none; }
  .diwali-wish-card { transform: none; }
}

/* Page content always sits above the fireworks canvas */
.festive-fireworks ~ .container,
.festive-fireworks ~ .hero-content { position: relative; z-index: 2; }

/* ---------- Small Diwali offer poster at the top of the hero ---------- */
.diwali-mini {
  position: absolute;
  z-index: 3;
  display: block;
  color: #fff;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.25), transparent 60%),
    linear-gradient(160deg, #3a0c18 0%, var(--dw-maroon) 55%, #1c0810 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 34px rgba(251, 191, 36, 0.18);
}

.diwali-mini-toran {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  z-index: 2;
  background:
    radial-gradient(circle at 7px 6px, #fb923c 0 5px, transparent 5.5px) 0 0 / 14px 12px repeat-x,
    radial-gradient(circle at 7px 6px, #facc15 0 5px, transparent 5.5px) 7px 0 / 14px 12px repeat-x;
}

.diwali-mini-photo { display: block; position: relative; }
.diwali-mini-photo img { display: block; width: 100%; height: 110px; object-fit: cover; object-position: 50% 58%; }
.diwali-mini-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--dw-maroon) 0%, transparent 60%);
}

.diwali-mini-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 16px 16px; }
.diwali-mini-tag { color: var(--dw-gold-soft); font: 700 11px/1 var(--font-body); letter-spacing: 1.4px; text-transform: uppercase; }
.diwali-mini-title { font: 800 18px/1.15 var(--font-heading); text-transform: uppercase; }
.diwali-mini-date { color: var(--dw-gold); font: 700 13.5px/1.2 var(--font-body); }
.diwali-mini-cta {
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 45%, #ea580c 100%);
  color: #2a0a00;
  font: 800 13px/1 var(--font-body);
  letter-spacing: 0.4px;
}

/* Wide screens: a hanging poster in the open right side of the hero */
@media (min-width: 1200px) {
  .diwali-mini {
    top: calc(var(--header-h) + 40px);
    right: max(28px, 6vw);
    width: 240px;
    transform-origin: 50% -20px;
    animation: posterSwing 5s ease-in-out infinite;
  }
  /* the strings it hangs from */
  .diwali-mini::before,
  .diwali-mini::after { content: none; }
}

@keyframes posterSwing {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@media (hover: hover) and (pointer: fine) and (min-width: 1200px) {
  .diwali-mini:hover { animation-play-state: paused; box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 44px rgba(251, 191, 36, 0.3); }
}

/* Phones and tablets: a slim festive strip above the headline */
@media (max-width: 1199px) {
  .diwali-mini {
    top: calc(var(--header-h) + 26px);
    left: 16px;
    right: 16px;
    border-radius: 14px;
  }
  .diwali-mini-photo { display: none; }
  .diwali-mini-toran { height: 10px; background-size: 12px 10px, 12px 10px; }
  .diwali-mini-body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 16px 12px 10px 14px;
  }
  .diwali-mini-title { display: none; }
  .diwali-mini-tag { font-size: 12px; }
  .diwali-mini-date { font-size: 12.5px; flex: 1 1 auto; }
  .diwali-mini-cta { margin: 0 0 0 auto; padding: 8px 12px; font-size: 12.5px; }

  /* make room for the strip above the hero text */
  html.festive .hero > .hero-content,
  html.festive .hero > .container { padding-top: 118px !important; } /* beats the inline 20px on blog/careers heroes */
}

@media (max-width: 380px) {
  .diwali-mini-date { flex-basis: 100%; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .diwali-mini { animation: none; }
}
