/**
 * ==============================================================================
 * RED MONSTER STUDIOZ — ULTRA-CINEMATIC FESTIVAL ENGINE (CSS)
 * Sky Crackers & Fireworks + Glowing Hanging Kandils + Fairy String Lights
 * Sacred Rotating Rangoli Hero Halo + Animated Terracotta Diyas with Petals
 * High-End Animation Studio Grade Aesthetics (60 FPS GPU-Accelerated)
 * ==============================================================================
 */

/* ==============================================================================
   1. DIWALI THEME DESIGN TOKENS (ROYAL DEEPOTSAV GOLD & AMBER)
   ============================================================================== */
body.theme-diwali {
  --red-primary: #FFB300 !important;
  --red-neon: #FFD700 !important;
  --orange-accent: #FF7700 !important;
  --accent-red: #FFB300 !important;
  --accent-glow: rgba(255, 179, 0, 0.55) !important;
  --glow-red: rgba(255, 179, 0, 0.5) !important;
  --glow-subtle: rgba(255, 179, 0, 0.25) !important;
  --gradient-brand: linear-gradient(135deg, #FFE082 0%, #FFB300 45%, #FF6F00 100%) !important;
  --accent-gradient: linear-gradient(135deg, #FFE082 0%, #FFB300 45%, #FF6F00 100%) !important;
  --border-active: rgba(255, 215, 0, 0.75) !important;
  --gradient-card-border: linear-gradient(135deg, rgba(255, 215, 0, 0.6) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 111, 0, 0.4) 100%) !important;
}

body.theme-diwali .rm-w-red {
  color: #FFD700 !important;
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.75), 0 0 35px rgba(255, 160, 0, 0.45) !important;
}

body.theme-diwali .rm-ideas-brush {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  letter-spacing: 0.035em !important;
  display: inline-block !important;
  padding-right: 12px !important;
  background: linear-gradient(135deg, #FFD54F 0%, #FF9800 52%, #FF6D00 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 14px rgba(255, 152, 0, 0.55)) !important;
}

body.theme-diwali .rm-nav-liquid-pill {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 143, 0, 0.18) 100%) !important;
  border-color: rgba(255, 215, 0, 0.7) !important;
  box-shadow: 0 0 28px rgba(255, 193, 7, 0.55), inset 0 0 16px rgba(255, 215, 0, 0.25) !important;
}

body.theme-diwali .btn-submit-footer,
body.theme-diwali .rm-btn-primary,
body.theme-diwali .btn-primary {
  background: linear-gradient(135deg, #FFD54F 0%, #FF9800 60%, #E65100 100%) !important;
  color: #0A0C14 !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 4px 25px rgba(255, 179, 0, 0.5), 0 0 40px rgba(255, 143, 0, 0.25) !important;
  letter-spacing: 0.04em !important;
}

body.theme-diwali .btn-submit-footer:hover,
body.theme-diwali .rm-btn-primary:hover,
body.theme-diwali .btn-primary:hover {
  background: linear-gradient(135deg, #FFF176 0%, #FFA726 60%, #F57C00 100%) !important;
  box-shadow: 0 6px 36px rgba(255, 193, 7, 0.8), 0 0 55px rgba(255, 152, 0, 0.45) !important;
  transform: translateY(-2px);
}

body.theme-diwali #rmTopAnnouncementBar {
  background: linear-gradient(90deg, rgba(255, 179, 0, 0.2) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(255, 111, 0, 0.2) 100%) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.45) !important;
  box-shadow: 0 4px 30px rgba(255, 179, 0, 0.3) !important;
}

body.theme-diwali .rm-ann-badge {
  background: linear-gradient(135deg, #FFD54F 0%, #FF8F00 100%) !important;
  color: #0A0C14 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.7) !important;
}

/* ==============================================================================
   2. TOP FESTIVE FAIRY STRING LIGHTS (TWINKLING CHHOTI BATTIYAN)
   ============================================================================== */
.rm-fairy-lights-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 14px;
  pointer-events: none;
  z-index: 1002; /* Flushed to the very top edge of the screen */
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  overflow: visible; /* NO CUT GLOW! Radiant light flows softly downward */
}

.rm-fairy-bulb {
  width: 8px;
  height: 12px;
  border-radius: 50% 50% 60% 60%;
  position: relative;
  will-change: opacity, transform;
  animation: rmBulbTwinkle 1.8s infinite ease-in-out alternate;
}

.rm-fairy-bulb::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 2px;
  width: 4px;
  height: 3px;
  background: #334155;
  border-radius: 1px;
}

.rm-fairy-bulb.gold {
  background: #FFD54F;
  box-shadow: 0 2px 14px 2px rgba(255, 213, 79, 0.85);
  animation-delay: 0s;
}

.rm-fairy-bulb.amber {
  background: #FF9800;
  box-shadow: 0 2px 14px 2px rgba(255, 152, 0, 0.85);
  animation-delay: 0.4s;
}

.rm-fairy-bulb.crimson {
  background: #FF1744;
  box-shadow: 0 2px 14px 2px rgba(255, 23, 68, 0.85);
  animation-delay: 0.9s;
}

.rm-fairy-bulb.emerald {
  background: #00E676;
  box-shadow: 0 2px 14px 2px rgba(0, 230, 118, 0.85);
  animation-delay: 1.3s;
}

@keyframes rmBulbTwinkle {
  0% { opacity: 0.40; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.50; transform: scale(0.92); }
}

/* ==============================================================================
   3. SWAYING TRADITIONAL HANGING KANDILS (DIWALI SKY LANTERNS)
   ============================================================================== */
.rm-kandil-lantern {
  position: fixed;
  top: 20px;
  z-index: 1000;
  pointer-events: none;
  transform-origin: top center;
  will-change: transform;
  animation: rmKandilSway 4.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 25px rgba(255, 152, 0, 0.55));
  transition: opacity 0.5s ease;
}

.rm-kandil-lantern svg {
  display: block;
  transform-origin: top center;
}

.rm-kandil-left {
  left: 20px;
  animation-delay: 0s;
}

.rm-kandil-right {
  right: 20px;
  animation-delay: -2.2s;
}

@keyframes rmKandilSway {
  0% { transform: rotate(-5deg); }
  50% { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}

@media (max-width: 991px) {
  .rm-kandil-lantern {
    top: 8px;
  }
  .rm-kandil-lantern svg {
    width: 42px !important;
    height: 83px !important;
  }
  .rm-kandil-left { left: 4px; }
  .rm-kandil-right { right: 4px; }
}

@media (max-width: 640px) {
  .rm-kandil-lantern {
    top: 4px;
    opacity: 0.90;
  }
  .rm-kandil-lantern svg {
    width: 28px !important;
    height: 56px !important;
  }
  .rm-kandil-left { left: 2px; }
  .rm-kandil-right { right: 2px; }

  #rmTopAnnouncementBar,
  body.theme-diwali #rmTopAnnouncementBar {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
  #rmTopAnnouncementBar .rm-ann-inner,
  body.theme-diwali #rmTopAnnouncementBar .rm-ann-inner {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 11.5px !important;
    gap: 8px !important;
  }

  .rm-crackers-hint-pill {
    bottom: 78px;
    font-size: 11px;
    padding: 5px 14px;
    max-width: 88vw;
    text-align: center;
  }
}

/* ==============================================================================
   4. ROTATING SACRED GOLDEN RANGOLI / MANDALA HALO BEHIND HERO
   ============================================================================== */
#rmHeroMandalaWrapper {
  position: absolute;
  top: 50%;
  left: 32%; /* Placed directly behind the headline "WE BRING IDEAS TO LIFE" on desktop! */
  transform: translate(-50%, -50%);
  width: 720px;
  height: 720px;
  pointer-events: none;
  z-index: 5 !important; /* In front of vignette (z:3) & blur (z:2), cleanly behind text (z:10) */
  contain: layout paint;
}

.rm-hero-festive-mandala {
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: screen;
  will-change: transform;
  animation: rmMandalaSpin 75s linear infinite;
  transform-origin: center center;
  filter: drop-shadow(0 0 35px rgba(255, 179, 0, 0.35));
}

@keyframes rmMandalaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 991px) {
  #rmHeroMandalaWrapper {
    width: 440px;
    height: 440px;
    top: 42%;
    left: 50%; /* Centered behind the mobile headline like in screenshot */
  }
  .rm-hero-festive-mandala {
    opacity: 0.28;
  }
}

/* ==============================================================================
   5. REALISTIC ANIMATED CLAY DIYAS WITH RANGOLI PETALS BASE
   ============================================================================== */
.rm-diya-container {
  position: fixed;
  bottom: 22px;
  z-index: 998;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.rm-diya-left {
  left: 260px;
  bottom: 20px;
}

.rm-diya-right {
  right: 115px; /* Offset to clear sound toggle */
}

@media (max-width: 768px) {
  .rm-diya-container {
    bottom: 14px;
  }
  .rm-diya-left {
    left: 74px;
    bottom: 14px;
    transform: scale(0.62);
    transform-origin: bottom left;
  }
  .rm-diya-right {
    display: none; /* Keep mobile clean */
  }
}

.rm-diya-svg {
  width: 84px;
  height: 74px;
  filter: drop-shadow(0 0 30px rgba(255, 152, 0, 0.95)) drop-shadow(0 0 60px rgba(255, 193, 7, 0.55));
}

/* Multi-Layered Flame Physics with Organic Flicker */
.rm-diya-flame {
  transform-origin: 42px 35px;
  will-change: transform;
  animation: rmFlameFlicker 1.6s infinite ease-in-out alternate;
}

.rm-diya-flame-inner {
  transform-origin: 42px 30px;
  will-change: transform;
  animation: rmFlameInnerFlicker 1.1s infinite ease-in-out alternate;
}

.rm-diya-halo {
  transform-origin: 42px 25px;
  will-change: transform;
  animation: rmHaloPulse 2.2s infinite ease-in-out;
}

@keyframes rmFlameFlicker {
  0% { transform: scale(1) rotate(-2deg); opacity: 0.92; }
  25% { transform: scale(1.06, 1.15) rotate(1.5deg); opacity: 1; }
  50% { transform: scale(0.95, 0.96) rotate(-1deg); opacity: 0.88; }
  75% { transform: scale(1.10, 1.20) rotate(2.5deg); opacity: 1; }
  100% { transform: scale(1.02, 1.05) rotate(-1.5deg); opacity: 0.94; }
}

@keyframes rmFlameInnerFlicker {
  0% { transform: scale(1) rotate(1.5deg); opacity: 0.95; }
  50% { transform: scale(1.15, 1.26) rotate(-2deg); opacity: 1; }
  100% { transform: scale(0.92, 0.94) rotate(1deg); opacity: 0.9; }
}

@keyframes rmHaloPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.28); opacity: 1; }
}

/* Deepawali Ambient Festive Styling across the Full Site */
body.theme-diwali .service-card,
body.theme-diwali .portfolio-card,
body.theme-diwali .story-card,
body.theme-diwali .core-card,
body.theme-diwali .rm-card {
  border: 1px solid rgba(255, 215, 0, 0.40) !important;
  box-shadow: 0 8px 32px rgba(255, 179, 0, 0.12), inset 0 0 16px rgba(255, 215, 0, 0.04) !important;
}

body.theme-diwali .section-title h2,
body.theme-diwali .studio-section-title h2 {
  color: #FFFDE7 !important;
  text-shadow: 0 0 18px rgba(255, 179, 0, 0.35) !important;
}

/* ==============================================================================
   6. FULLSCREEN SKY CRACKERS & FIREWORKS CANVAS (GPU ACCELERATED IN BACKGROUND)
   ============================================================================== */
#rmFestiveCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 996; /* Visible floating stardust & sky fireworks across the entire website */
  display: block;
}

/* Eliminate expensive Gaussian backdrop-filter in hero during Diwali theme */
body.theme-diwali .rm-hero-bg-blur {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: linear-gradient(90deg, rgba(5, 11, 22, 0.88) 0%, rgba(5, 11, 22, 0.65) 40%, transparent 60%) !important;
}

/* Interactive Click Hint Badge */
.rm-crackers-hint-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: #FFD54F;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(255, 179, 0, 0.35);
  pointer-events: none;
  animation: rmPillFade 6s forwards 3s;
  user-select: none;
}

@keyframes rmPillFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); visibility: hidden; }
}


/* ==============================================================================
   7. FESTIVE THEME ADAPTATION FOR MODERN CINEMATIC FOOTER
   ============================================================================== */
[data-festive="diwali"] .modern-footer,
.rm-festive-active .modern-footer {
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.96) 0%, rgba(22, 12, 5, 0.98) 100%) !important;
  border-top: 1px solid rgba(255, 179, 0, 0.4) !important;
  box-shadow: 0 -10px 40px rgba(255, 152, 0, 0.12) !important;
  position: relative;
  padding-bottom: 50px !important;
}

[data-festive="diwali"] .modern-footer::before,
.rm-festive-active .modern-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #FFB300 20%, #FF5722 50%, #FFD54F 80%, transparent);
}

[data-festive="diwali"] .footer-heading,
.rm-festive-active .footer-heading {
  color: #FFF8E1 !important;
}

[data-festive="diwali"] .footer-heading::after,
.rm-festive-active .footer-heading::after {
  background: linear-gradient(90deg, #FFB300 0%, #FF5722 100%) !important;
  box-shadow: 0 0 10px rgba(255, 179, 0, 0.6);
}

[data-festive="diwali"] .social-pill:hover,
.rm-festive-active .social-pill:hover {
  border-color: #FFB300 !important;
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.5) !important;
  color: #FFD54F !important;
}

[data-festive="diwali"] .footer-nav-list li a:hover,
.rm-festive-active .footer-nav-list li a:hover {
  color: #FFD54F !important;
  transform: translateX(6px);
}

[data-festive="diwali"] .footer-contact-item i,
.rm-festive-active .footer-contact-item i {
  color: #FFB300 !important;
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.5);
}

[data-festive="diwali"] .footer-form .btn-submit-footer,
.rm-festive-active .footer-form .btn-submit-footer {
  background: linear-gradient(135deg, #FF5722 0%, #E65100 50%, #D81B60 100%) !important;
  border: 1px solid rgba(255, 213, 79, 0.45) !important;
  box-shadow: 0 6px 20px rgba(230, 81, 0, 0.45) !important;
}

[data-festive="diwali"] .footer-form .btn-submit-footer:hover,
.rm-festive-active .footer-form .btn-submit-footer:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 152, 0, 0.65), 0 0 15px rgba(255, 213, 79, 0.5) !important;
}

[data-festive="diwali"] .footer-form .form-control:focus,
.rm-festive-active .footer-form .form-control:focus {
  border-color: #FFB300 !important;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.35) !important;
}

/* Christmas Theme Footer Adaptation */
[data-festive="christmas"] .modern-footer {
  border-top: 1px solid rgba(16, 185, 129, 0.4) !important;
}
[data-festive="christmas"] .footer-heading::after {
  background: linear-gradient(90deg, #10B981, #EF4444) !important;
}
[data-festive="christmas"] .footer-form .btn-submit-footer {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}
