/* ==========================================================================
   LET KERALA — Apple-Style Cinematic Scroll Hero Experience
   Editorial, documentary-grade visual storytelling controlled by scroll.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Sticky Scroll Track Architecture
   -------------------------------------------------------------------------- */
.cinematic-hero-track {
  position: relative;
  width: 100%;
  height: 520vh; /* Provides deliberate, luxurious scroll room for the 5 acts */
  background-color: var(--paper, #fcf9f4);
}

.cinematic-viewport {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b1e13; /* Deep Kerala botanical foundation */
  isolation: isolate;
  will-change: transform;
}

/* Bottom transition gradient smoothing into the warm cream intro */
.cinematic-viewport::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--paper, #fcf9f4));
  z-index: 8;
  pointer-events: none;
  opacity: var(--exit-cream-opacity, 0);
  transition: opacity 0.3s ease;
}

/* --------------------------------------------------------------------------
   2. Cinematic Camera & Visual Staging Layers
   -------------------------------------------------------------------------- */
.cinematic-camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* Shared scene visual layer rules */
.scene-layer {
  position: absolute;
  inset: -40px; /* Slight overflow to allow seamless 3D scale and dolly movements */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scene 1: Western Ghats Kerala Landscape (Morning light & mist) */
.scene-kerala {
  background-image: linear-gradient(90deg, rgba(10, 30, 18, 0.85), rgba(10, 30, 18, 0.42)),
                    url("images/spice-01.jpg");
  opacity: 1;
  z-index: 2;
}

/* Scene 2: Deep Spice Plantation Canopy (Pepper vines on shade trees) */
.scene-plantation {
  background-image: linear-gradient(rgba(10, 32, 20, 0.4), rgba(7, 24, 15, 0.65)),
                    url("images/pepper-plantation.jpg");
  opacity: 0;
  z-index: 3;
}

/* Scene 3: Black Pepper Macro Cluster (Rich Idukki berries) */
.scene-pepper-macro {
  background-image: linear-gradient(180deg, rgba(5, 16, 10, 0.7) 0%, rgba(5, 16, 10, 0.35) 45%, rgba(5, 16, 10, 0.85) 100%),
                    radial-gradient(circle at 50% 50%, rgba(4, 14, 9, 0.3) 0%, rgba(4, 14, 9, 0.85) 85%),
                    url("images/pepper-cluster.jpg");
  opacity: 0;
  z-index: 4;
  filter: brightness(0.8) contrast(1.08);
}

/* Scene 4: Kerala Canopy Mist (The botanical flight transition) */
.scene-mist-transition {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(20, 52, 34, 0.5) 0%, rgba(10, 30, 18, 0.85) 100%);
  opacity: 0;
  z-index: 5;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(8px);
}

/* Scene 5: Green Cardamom Macro (Dewy pod showing rich ridges) */
.scene-cardamom-macro {
  background-image: linear-gradient(180deg, rgba(5, 16, 10, 0.7) 0%, rgba(5, 16, 10, 0.35) 45%, rgba(5, 16, 10, 0.85) 100%),
                    radial-gradient(circle at 50% 50%, rgba(4, 14, 9, 0.3) 0%, rgba(4, 14, 9, 0.85) 85%),
                    url("images/cardamom-cluster.jpg");
  opacity: 0;
  z-index: 6;
  filter: brightness(0.8) contrast(1.08);
}

/* Scene 6: Return to Kerala Light & Warm Cream Brand Reveal */
.scene-brand-finish {
  background-image: radial-gradient(circle at 50% 40%, rgba(246, 218, 140, 0.15) 0%, rgba(12, 34, 22, 0.85) 70%),
                    url("images/spice-10.jpg");
  opacity: 0;
  z-index: 7;
}

/* --------------------------------------------------------------------------
   3. Narrative Story Overlays (Consistent Typography & Gold Accents)
   -------------------------------------------------------------------------- */
.cinematic-story {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-stage {
  position: absolute;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  will-change: opacity, transform;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.story-stage.stage-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

/* Frosted Glassmorphic Editorial Card Shield */
.story-card-glass {
  background: rgba(6, 20, 13, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 200, 103, 0.32);
  border-radius: 24px;
  padding: 40px 48px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.72),
              inset 0 1px 0 rgba(255, 255, 255, 0.16);
  max-width: 580px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

/* Subtle corner light sheen on card */
.story-card-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240, 200, 103, 0.6), transparent);
}

/* Stage 1: The Initial Kerala Introduction (Matching existing hero copy) */
.stage-1-intro {
  max-width: 690px;
  margin-left: max(24px, calc((100vw - 1180px) / 2));
  margin-right: auto;
  padding: 80px 0;
  color: #ffffff;
}

.stage-content-wrap {
  will-change: transform;
}

.stage-1-intro .eyebrow {
  color: #f0c867;
}

.stage-1-intro h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.5rem, 7.5vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin: 17px 0 22px;
  color: #ffffff;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.65);
}

.stage-1-intro h1 em {
  color: #f2c967;
  font-style: italic;
  font-weight: 500;
}

.stage-1-intro p {
  max-width: 500px;
  color: #f0f5ee;
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 24px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

/* Stage 2: Born in the Spice Hills */
.stage-2-canopy {
  display: flex;
  justify-content: center;
}

.stage-2-canopy .story-card-glass {
  text-align: center;
  max-width: 720px;
  padding: 44px 52px;
}

.stage-2-canopy .story-badge {
  display: inline-block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f0c867;
  margin-bottom: 16px;
  position: relative;
  padding: 0 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.stage-2-canopy .story-badge::before,
.stage-2-canopy .story-badge::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px;
  height: 1px;
  background: rgba(240, 200, 103, 0.5);
}

.stage-2-canopy .story-badge::before { left: -14px; }
.stage-2-canopy .story-badge::after { right: -14px; }

.stage-2-canopy h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.8);
  margin: 0 auto;
}

/* Stage 3: Black Pepper Editorial Macro */
.stage-3-pepper {
  display: flex;
  justify-content: flex-start;
  margin-left: max(24px, calc((100vw - 1180px) / 2));
  margin-right: auto;
}

.stage-3-pepper .story-card-glass {
  max-width: 540px;
}

/* Stage 4: Green Cardamom Editorial Macro */
.stage-4-cardamom {
  display: flex;
  justify-content: flex-end;
  margin-right: max(24px, calc((100vw - 1180px) / 2));
  margin-left: auto;
}

.stage-4-cardamom .story-card-glass {
  max-width: 540px;
}

/* Shared High-Contrast Editorial Styling for Pepper & Cardamom */
.story-num {
  display: inline-block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f0c867 !important; /* Luminous gold */
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.stage-3-pepper h2,
.stage-4-cardamom h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #ffffff !important;
  margin: 0 0 14px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9);
}

.story-statement {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-style: italic;
  font-weight: 500;
  color: #fde59b !important; /* Warm golden light: instant legibility */
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.stage-3-pepper p,
.stage-4-cardamom p,
.stage-5-brand p {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.75;
  color: #f0f5ee !important; /* Crisp clear off-white */
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* Stage 5: The Final LET KERALA Reveal */
.stage-5-brand {
  display: flex;
  justify-content: center;
}

.stage-5-brand .story-card-glass {
  text-align: center;
  max-width: 680px;
  padding: 48px 56px;
}

.stage-5-brand .brand-badge {
  display: inline-block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f0c867;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.stage-5-brand h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #ffffff;
  margin: 0 0 18px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
}

.stage-5-brand p {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: #e5ede3;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   4. Scroll Indicator / Story Hint
   -------------------------------------------------------------------------- */
.cinematic-scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 12;
  pointer-events: none;
  opacity: var(--hint-opacity, 1);
  transition: opacity 0.4s ease;
}

.cinematic-scroll-hint span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d1dcce;
}

.cinematic-scroll-hint .hint-line {
  width: 1px;
  height: 24px;
  background: linear-gradient(to bottom, #d8a83e, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.3; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* --------------------------------------------------------------------------
   5. Reduced Motion & Mobile Fallbacks
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cinematic-hero-track {
    height: auto !important;
  }
  .cinematic-viewport {
    position: relative !important;
    height: auto !important;
    min-height: 600px;
  }
  .scene-layer {
    transform: none !important;
    transition: none !important;
  }
  .scene-kerala {
    opacity: 1 !important;
  }
  .scene-plantation,
  .scene-pepper-macro,
  .scene-cardamom-macro,
  .scene-brand-finish {
    display: none !important;
  }
  .story-stage {
    display: none !important;
  }
  .stage-1-intro {
    display: block !important;
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .cinematic-scroll-hint {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .cinematic-hero-track {
    height: 260vh; /* Smooth, natural scroll distance without user trapping */
  }
  .cinematic-viewport {
    min-height: 500px;
  }
  .botanical-drift {
    display: none !important; /* Save >1.3MB of animated PNGs and eliminate GPU compositing on mobile */
  }
  .stage-1-intro {
    padding: 40px 0 60px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    text-align: left;
  }
  .stage-1-intro h1 {
    font-size: clamp(2.3rem, 7.5vw, 3.2rem) !important;
    line-height: 1.08 !important;
    margin: 12px 0 16px !important;
  }
  .stage-1-intro p {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    max-width: 100% !important;
  }
  .stage-1-intro .button {
    padding: 13px 20px;
    font-size: 0.72rem;
    min-height: 48px;
    align-items: center;
  }
  .story-stage {
    width: calc(100% - 32px);
    max-width: 100%;
  }
  .stage-3-pepper,
  .stage-4-cardamom {
    margin-left: 0;
    margin-right: 0;
    justify-content: center;
  }
  .story-card-glass {
    padding: 22px 18px;
    max-width: 100%;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .stage-2-canopy h2 {
    font-size: clamp(1.75rem, 6vw, 2.3rem);
    line-height: 1.15;
  }
  .stage-3-pepper h2,
  .stage-4-cardamom h2 {
    font-size: clamp(1.8rem, 6.5vw, 2.4rem);
    letter-spacing: -0.02em;
    margin: 8px 0 10px;
  }
  .story-statement {
    font-size: 1.08rem;
    margin: 6px 0 10px;
  }
  .story-card-glass p {
    font-size: 0.88rem;
    line-height: 1.6;
  }
  .stage-5-brand h2 {
    font-size: clamp(2.2rem, 7vw, 3rem);
  }
  .cinematic-scroll-hint {
    bottom: 20px;
  }
}
