/* ============================================================
   CINEMATIC HERO — hero.css
   Sri Ganapathi Catering Service
   ============================================================ */

/* ---------- CONTAINER ---------- */
#cinematic-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  background: #070102;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- STAGE (holds curtains + reveal) ---------- */
.ch-stage {
  position: absolute;
  inset: 0;
}

/* ---------- TEMPLE CURTAINS ---------- */
.ch-curtain {
  position: absolute;
  top: 0;
  width: 51%;
  height: 100%;
  z-index: 12;
  will-change: transform;
  overflow: hidden;
}

/* Cloth fold texture via repeating gradients */
.ch-curtain-left {
  left: 0;
  transform: translateX(0);
  transition: transform 3.2s cubic-bezier(0.77, 0, 0.18, 1);
  background:
    repeating-linear-gradient(
      to right,
      rgba(255,255,255,0.07) 0px, rgba(0,0,0,0) 7px,
      rgba(0,0,0,0.20) 13px, rgba(255,255,255,0.05) 20px,
      rgba(0,0,0,0.12) 27px, rgba(0,0,0,0) 36px,
      rgba(255,255,255,0.04) 42px, rgba(0,0,0,0) 50px
    ),
    linear-gradient(172deg, #4A0810 0%, #7A0F1C 18%, #9B1828 34%, #6B0F1A 52%, #9B1828 68%, #7A0F1C 84%, #3D0608 100%);
}
.ch-curtain-left.open { transform: translateX(-102%); }

.ch-curtain-right {
  right: 0;
  transform: translateX(0);
  transition: transform 3.2s cubic-bezier(0.77, 0, 0.18, 1);
  background:
    repeating-linear-gradient(
      to left,
      rgba(255,255,255,0.07) 0px, rgba(0,0,0,0) 7px,
      rgba(0,0,0,0.20) 13px, rgba(255,255,255,0.05) 20px,
      rgba(0,0,0,0.12) 27px, rgba(0,0,0,0) 36px,
      rgba(255,255,255,0.04) 42px, rgba(0,0,0,0) 50px
    ),
    linear-gradient(188deg, #4A0810 0%, #7A0F1C 18%, #9B1828 34%, #6B0F1A 52%, #9B1828 68%, #7A0F1C 84%, #3D0608 100%);
}
.ch-curtain-right.open { transform: translateX(102%); }

/* Gold trim on inner edges */
.ch-curtain-left::after {
  content: '';
  position: absolute;
  right: 0; top: 0; height: 100%; width: 20px;
  background: linear-gradient(90deg,
    rgba(140,90,10,0.3), #C9973C 20%, #F5D76E 50%, #C9973C 80%, rgba(140,90,10,0.3));
  box-shadow: 0 0 36px rgba(212,160,23,0.8), inset -3px 0 10px rgba(0,0,0,0.4);
}
.ch-curtain-right::after {
  content: '';
  position: absolute;
  left: 0; top: 0; height: 100%; width: 20px;
  background: linear-gradient(90deg,
    rgba(140,90,10,0.3), #F5D76E 20%, #C9973C 50%, #F5D76E 80%, rgba(140,90,10,0.3));
  box-shadow: 0 0 36px rgba(212,160,23,0.8), inset 3px 0 10px rgba(0,0,0,0.4);
}

/* ---------- TOP VALANCE (temple drape) ---------- */
.ch-valance {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 20;
  background: linear-gradient(180deg, #1A0305 0%, #5A0A14 55%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ch-valance-text {
  font-family: 'Playfair Display', serif;
  color: #D4A017;
  font-size: 0.82rem;
  letter-spacing: 7px;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(212,160,23,0.9);
  animation: valancePulse 2.5s ease-in-out infinite;
}
@keyframes valancePulse {
  0%,100% { opacity: 0.7; }
  50%      { opacity: 1; text-shadow: 0 0 40px rgba(212,160,23,1); }
}
/* Valance fringe */
.ch-valance::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(
    90deg, #C9973C 0px, #C9973C 6px, transparent 6px, transparent 14px
  );
  opacity: 0.7;
}

/* ---------- REVEAL BACKDROP ---------- */
.ch-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 35%,
    #1C0610 0%, #0F0208 50%, #060102 100%);
  z-index: 1;
}

/* ---------- DIVINE GLOW AURA ---------- */
.ch-glow {
  position: absolute;
  left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  width: 680px; height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(212,160,23,0.28) 0%,
    rgba(160,50,20,0.12) 40%,
    transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.ch-glow.active { opacity: 1; animation: glowPulse 3.5s ease-in-out infinite; }
@keyframes glowPulse {
  0%,100% { transform: translate(-50%,-50%) scale(1);    opacity: 0.85; }
  50%      { transform: translate(-50%,-50%) scale(1.09); opacity: 1; }
}

/* ---------- LIGHT RAYS ---------- */
.ch-rays {
  position: absolute;
  left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  width: 1100px; height: 1100px;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}
.ch-rays.active { opacity: 1; }
.ch-ray {
  position: absolute;
  left: 50%; top: 50%;
  transform-origin: 0 0;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(212,160,23,0.55), rgba(212,160,23,0.15) 50%, transparent);
  border-radius: 1px;
}

/* ---------- GANESHA IMAGE ---------- */
.ch-ganesha {
  position: absolute;
  left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  width: min(180px, 45vw);
  max-height: 40vh;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.4s ease, filter 1.8s ease;
  filter: drop-shadow(0 0 0px rgba(212,160,23,0));
  z-index: 3;
  pointer-events: none;
}
.ch-ganesha.active {
  opacity: 1;
  filter:
    drop-shadow(0 0 40px rgba(212,160,23,0.7))
    drop-shadow(0  5px 20px rgba(0,0,0,0.6));
  animation: ganeshaFloat 5s ease-in-out infinite 1.5s;
}
@keyframes ganeshaFloat {
  0%,100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 10px)); }
}

/* ---------- DIYA LAMPS ---------- */
.ch-diya {
  position: absolute;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 4;
}
.ch-diya.active { opacity: 1; }
.ch-diya-left  { left:  10%; }
.ch-diya-right { right: 10%; }

.ch-diya-base {
  width: 54px; height: 22px;
  background: linear-gradient(180deg, #C9973C 0%, #8B5E1A 50%, #4A2A08 100%);
  border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6), inset 0 -4px 10px rgba(0,0,0,0.3);
  position: relative;
}
.ch-diya-base::after {
  content: '';
  position: absolute;
  top: -5px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 8px;
  background: radial-gradient(circle, #E8C97A, #8B5E1A);
  border-radius: 50%;
}
/* Diya glow pool on floor */
.ch-diya::after {
  content: '';
  position: absolute;
  bottom: -14px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 22px;
  background: radial-gradient(ellipse, rgba(255,165,0,0.35), transparent);
  border-radius: 50%;
  animation: poolGlow 0.4s ease-in-out infinite alternate;
}
@keyframes poolGlow {
  from { opacity: 0.5; transform: translateX(-50%) scaleX(1); }
  to   { opacity: 1;   transform: translateX(-50%) scaleX(1.15); }
}

.ch-flame-wrap {
  position: relative;
  width: 22px; height: 40px;
  margin-bottom: 3px;
}
.ch-flame {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 32px;
  background: radial-gradient(ellipse at center 75%,
    #FFF9C4 0%, #FFD740 22%, #FF8F00 55%, #E64A19 82%, transparent 100%);
  border-radius: 60% 40% 50% 50% / 80% 80% 20% 20%;
  animation: flameDance 0.14s ease-in-out infinite alternate;
  filter: blur(0.6px);
}
.ch-flame-inner {
  width: 8px; height: 18px;
  bottom: 4px;
  background: radial-gradient(ellipse at center 65%,
    #FFFFFF 0%, #FFF9C4 45%, transparent 100%);
  animation: flameDanceIn 0.11s ease-in-out infinite alternate;
  filter: blur(0.3px);
}
@keyframes flameDance {
  from { transform: translateX(-50%) scaleX(1)    scaleY(1)    rotate(-4deg); }
  to   { transform: translateX(-50%) scaleX(0.86) scaleY(1.12) rotate(4deg); }
}
@keyframes flameDanceIn {
  from { transform: translateX(-50%) scaleX(1)    scaleY(1)    rotate(3deg); }
  to   { transform: translateX(-50%) scaleX(0.82) scaleY(1.1)  rotate(-3deg); }
}

/* ---------- DIVINE FOG ---------- */
.ch-fog {
  position: absolute;
  bottom: 0; left: -5%; right: -5%;
  height: 220px;
  background: linear-gradient(to top,
    rgba(12,3,6,0.75) 0%, rgba(25,8,14,0.35) 40%, transparent 100%);
  pointer-events: none;
  z-index: 2;
  animation: fogDrift 9s ease-in-out infinite alternate;
}
@keyframes fogDrift {
  from { opacity: 0.7; transform: scaleX(1.00); }
  to   { opacity: 1.0; transform: scaleX(1.03); }
}

/* ---------- FLOWER PETALS ---------- */
.ch-petals {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 5; overflow: hidden;
}
.petal {
  position: absolute; top: -6%;
  animation: petalFall linear forwards;
}
@keyframes petalFall {
  0%   { transform: translateY(0)      rotate(0deg)   scale(0.7); opacity: 0; }
  8%   { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(108vh)  rotate(680deg) scale(0.45); opacity: 0; }
}

/* ---------- SPARKLES ---------- */
.ch-sparkles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 5; overflow: hidden;
}
.sparkle {
  position: absolute;
  border-radius: 50%;
  background: #F5D76E;
  box-shadow: 0 0 8px #F5D76E, 0 0 20px rgba(245,215,110,0.6);
  animation: sparklePop ease-out forwards;
}
@keyframes sparklePop {
  0%   { transform: scale(0); opacity: 0; }
  25%  { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(0.1); opacity: 0; }
}

/* ---------- HERO CONTENT ---------- */
.ch-content {
  position: absolute; z-index: 8;
  text-align: center;
  width: 100%; max-width: 860px;
  padding: 0 20px;
  opacity: 0;
  left: 50%; top: 55%;
  transform: translate(-50%, 28px);
  transition: opacity 1.1s ease, transform 1.1s ease;
  pointer-events: none;
}
.ch-content.active {
  opacity: 1; transform: translate(-50%, 0); pointer-events: auto;
}
.ch-label {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(201,151,60,0.14);
  border: 1px solid rgba(201,151,60,0.4);
  color: #E8C97A;
  font-size: 0.76rem; letter-spacing: 3.5px;
  text-transform: uppercase;
  padding: 8px 22px; border-radius: 50px;
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}
.ch-label-dot {
  width: 7px; height: 7px;
  background: #C9973C; border-radius: 50%;
  animation: labelDot 1.5s ease-in-out infinite;
}
@keyframes labelDot {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,151,60,0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(201,151,60,0); }
}
.ch-h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 900; color: #fff;
  line-height: 1.1; margin-bottom: 10px;
  text-shadow: 0 4px 32px rgba(0,0,0,0.6);
}
.ch-h1 .gold-shimmer {
  background: linear-gradient(90deg,
    #C9973C 0%, #E8C97A 30%, #fffbe0 50%, #E8C97A 70%, #C9973C 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerSlide 3s linear infinite;
}
@keyframes shimmerSlide {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.ch-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: rgba(255,255,255,0.80);
  font-style: italic; margin-bottom: 36px;
}
.ch-btns {
  display: flex; gap: 16px;
  justify-content: center; flex-wrap: wrap;
  margin-bottom: 42px;
}
.ch-scroll {
  display: flex; flex-direction: column;
  align-items: center; gap: 7px;
}
.ch-scroll span {
  color: rgba(255,255,255,0.38);
  font-size: 0.68rem; letter-spacing: 3px; text-transform: uppercase;
}
.ch-scroll-dot {
  width: 8px; height: 8px;
  background: #C9973C; border-radius: 50%;
  animation: scrollBounce 1.8s ease-in-out infinite;
}

/* ---------- NAVBAR — hidden until hero done ---------- */
#navbar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-100%) !important;
  transition: opacity 0.8s ease, transform 0.8s ease !important;
}
#navbar.ch-ready {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

/* ---------- RESPONSIVE ---------- */

/* Mobile Enhancements */
@media (max-width: 768px) {
  .ch-rays { display: none; }
  .ch-glow { width: 120vw; height: 120vw; max-width: 500px; max-height: 500px; }
  .ch-diya-left  { left:  3%; }
  .ch-diya-right { right: 3%; }
  .ch-valance  { height: 52px; }
  .ch-valance-text { font-size: 0.55rem; letter-spacing: 2px; }
  .ch-diya-base { width: 38px; height: 16px; }
  .ch-flame { width: 12px; height: 22px; }
  .ch-flame-wrap { width: 16px; height: 28px; }

  .ch-label {
    font-size: 0.65rem;
    padding: 6px 14px;
    letter-spacing: 1.5px;
    white-space: normal;
  }
  .ch-content {
    width: 100%;
    padding: 0 15px;
    top: 44%;
  }
  .ch-h1 {
    font-size: 2.2rem;
  }
  .ch-btns {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .ch-btns a {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .ch-h1 { font-size: 1.85rem; }
  .ch-diya { display: none; }
  .ch-label {
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 6px 12px;
  }
  .ch-content {
    top: 40%;
  }
  .ch-ganesha {
    width: min(220px, 60vw);
    top: 24%;
  }
}

/* Desktop Side-by-Side Layout */
@media (min-width: 769px) {
  .ch-ganesha {
    left: 28%; top: 50%;
    width: min(340px, 40vw);
    max-height: 70vh;
  }
  .ch-glow { left: 28%; top: 50%; }
  .ch-rays { left: 28%; top: 50%; }

  .ch-content {
    left: auto; right: 4%; top: 50%;
    transform: translateY(calc(-50% + 28px));
    width: 45%; max-width: 600px;
    text-align: left;
  }
  .ch-content.active {
    transform: translateY(-50%);
  }
  .ch-btns { justify-content: flex-start; }
  .ch-scroll { align-items: flex-start; margin-top: 20px; }
}
