/* ==========================================================================
   Signature hero — "Diya to Ganga"
   A lamp lights, its glow opens onto the series, the title rises like a river.
   The title text is always visible (never hidden for the intro); JS only
   reveals the photo behind it and crossfades the photos.
   ========================================================================== */

/* Lenis smooth-scroll housekeeping */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

@layer pages {
  .sh {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: #000;
    padding-block: calc(var(--header-h) + var(--space-xl)) var(--space-3xl);
  }

  /* ----- Scenes ----- */
  .sh__media {
    position: absolute;
    inset: 0;
    z-index: -3;
    clip-path: circle(150% at 50% 88%);
    will-change: clip-path, transform;
  }
  .sh__scene { position: absolute; inset: -4%; opacity: 0; }
  .sh__scene.is-active { opacity: 1; }
  .sh__scene img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); }

  .sh__embers { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }

  .sh::before { /* shade so text always reads */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
      /* lightened 2026-11-13 — was 32% glow / 90-55-10% side shade / 35% bottom */
      radial-gradient(ellipse 60% 50% at 50% 100%, color-mix(in oklab, var(--saffron-500) 16%, transparent), transparent 70%),
      linear-gradient(90deg, color-mix(in oklab, var(--ink-950) 68%, transparent) 0%, color-mix(in oklab, var(--ink-950) 30%, transparent) 40%, transparent 70%),
      linear-gradient(0deg, var(--ink-950) 0%, transparent 22%);
  }

  /* The lamp that opens the scene */
  .sh__flame {
    position: absolute;
    left: 50%;
    top: 88%;
    width: 14px;
    height: 22px;
    translate: -50% -50%;
    border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
    background: radial-gradient(circle at 50% 70%, #fff6d8, var(--flame-400) 45%, var(--saffron-500) 70%, transparent 72%);
    box-shadow: 0 0 40px 18px color-mix(in oklab, var(--flame-400) 55%, transparent), 0 0 120px 60px color-mix(in oklab, var(--saffron-500) 25%, transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
  }
  .sh__curtain { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; }

  /* ----- Copy ----- */
  .sh__inner { position: relative; z-index: 3; }
  .sh__copy { max-width: 46rem; }
  .sh__dev {
    display: block;
    margin-top: var(--space-m);
    font-family: var(--font-sanskrit);
    font-size: var(--step-3);
    line-height: 1.3;
    color: var(--flame-400);
    text-shadow: 0 0 28px color-mix(in oklab, var(--saffron-500) 60%, transparent);
  }
  .sh__title {
    margin-top: var(--space-2xs);
    font-size: clamp(3.4rem, 1.6rem + 8vw, 9.5rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.03em;
    perspective: 600px;
  }
  /* Descenders (g, p) hang below the tight 0.88 line box. The line's
     overflow:hidden is the reveal mask, and background-clip:text only paints
     inside each char's box — so both get extra room below (and to the right
     for italic overhang), cancelled by negative margins so spacing is unchanged. */
  .sh__line { display: block; overflow: hidden; padding-bottom: 0.3em; margin-bottom: -0.22em; padding-right: 0.15em; }
  .sh__line--2 { padding-left: 0.9em; font-style: italic; font-weight: 500; }
  .sh__title .char {
    background: var(--gradient-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transform-origin: 50% 100%;
    padding-block: 0.05em 0.28em;
    margin-block: -0.05em -0.28em;
  }
  .sh__line--2 .char { padding-right: 0.08em; margin-right: -0.08em; }
  .no-split .sh__title .sh__line { background: var(--gradient-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

  .sh__lead { margin-top: var(--space-l); max-width: 34rem; font-size: var(--step-1); font-weight: 300; color: var(--cream-100); }
  .sh .btn-row { margin-top: var(--space-l); }
  .sh .btn { will-change: transform; }

  /* Scene counter on the right (01 / 05 · name · bar · arrows) removed
     2026-11-14 at user request — the banner keeps only the title block. */

  /* ----- Scroll cue ----- */
  .sh__cue { position: absolute; z-index: 3; left: 50%; bottom: 1.6rem; translate: -50% 0; display: grid; justify-items: center; gap: 0.5rem;
    font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--color-text-muted); }
  .sh__cue i { width: 1px; height: 3rem; background: linear-gradient(var(--flame-400), transparent); transform-origin: top; animation: shcue 2.2s var(--ease-out) infinite; }
  @keyframes shcue { 0% { scale: 1 0; } 50% { scale: 1 1; transform-origin: top; } 51% { transform-origin: bottom; } 100% { scale: 1 0; transform-origin: bottom; } }

  /* ----- River of episode titles ----- */
  .sh-river { position: relative; overflow: hidden; padding-block: var(--space-m); background: var(--ink-950);
    border-block: 1px solid var(--color-border); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .sh-river__track { display: flex; width: max-content; gap: 2.5rem; white-space: nowrap; }
  .sh-river__track + .sh-river__track { margin-top: 0.6rem; }
  .sh-river__item { display: inline-flex; align-items: baseline; gap: 0.8rem; font-family: var(--font-display); font-size: var(--step-2); color: var(--cream-100); text-decoration: none; transition: color var(--duration); }
  .sh-river__item:hover { color: var(--flame-400); }
  .sh-river__item b { font-family: var(--font-body); font-size: 0.5em; font-weight: 600; letter-spacing: 0.15em; color: var(--gold-400); }
  .sh-river__item::after { content: "✦"; margin-left: 1.7rem; font-size: 0.5em; color: var(--saffron-500); }
  .sh-river__track--slow .sh-river__item { font-size: var(--step-1); color: var(--color-text-faint); }

  @media (width < 48rem) {
    .sh { align-items: end; padding-bottom: calc(var(--space-3xl) + 4rem); }
    .sh__line--2 { padding-left: 0.4em; }
    .sh__cue { display: none; }
    .sh::before { background: linear-gradient(0deg, var(--ink-950) 3%, color-mix(in oklab, var(--ink-950) 50%, transparent) 50%, color-mix(in oklab, var(--ink-950) 15%, transparent)); }
  }

  /* The title text is visible ALL the time (user request 2026-11-14):
     no hidden intro state, no fade-in, no fade-out on scroll. */

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

/* Lighter photo shading (2026-11-13) — legibility now comes from soft shadows
   on the text itself, so bright scenes (e.g. the marigold hall) stay readable. */
@layer pages {
  .sh__title .sh__line { filter: drop-shadow(0 4px 22px color-mix(in oklab, var(--ink-950) 85%, transparent)); }
  .sh .eyebrow, .sh__dev, .sh__lead {
    text-shadow: 0 1px 2px color-mix(in oklab, var(--ink-950) 70%, transparent), 0 2px 18px color-mix(in oklab, var(--ink-950) 85%, transparent);
  }
  .site-header--overlay:not(.is-scrolled) .main-nav__list a,
  .site-header--overlay:not(.is-scrolled) .brand {
    text-shadow: 0 1px 10px color-mix(in oklab, var(--ink-950) 90%, transparent);
  }
  .site-header--overlay:not(.is-scrolled)::after {   /* faint top shade so the menu reads on bright photos */
    content: "";
    position: absolute;
    inset: 0 0 -2rem;
    z-index: -2;
    background: linear-gradient(180deg, color-mix(in oklab, var(--ink-950) 55%, transparent), transparent);
    pointer-events: none;
  }
}
