/* ==========================================================================
   Ojhaji V3 home: the opening scroll story, ported from V2 (Sidharth via HQ, 19 Nov: "from V2 we should take the
   starting scroll effect … till the what are you planning thing"). Rules copied from v2/v2/assets/css/v2.css
   (V2 itself is untouched); its .plate panels are .kplate here (V3 already has a .plate). Motion only with html.motion
   (set in the page head: JS on, no prefers-reduced-motion, calm mode off); otherwise still scenes, then text.
   ========================================================================== */
.scene { position: relative; }
.stage { position: relative; display: flex; flex-direction: column; }
.stage > .art { order: 2; width: 100%; height: 68svh; min-height: 380px; max-height: 760px; }
.layer { order: 1; padding: calc(var(--bar) + 28px) var(--gutter) 24px; }
.scene + .scene .layer { padding-top: 48px; }
.panel { max-width: 34rem; margin-bottom: 18px; }
.panel h2, .panel h1 { margin-bottom: .25em; }
.panel p:last-child { margin-bottom: 0; }

/* Street (hero) */
.scene--street { background: #E3EEDC; }
.hero-title { font-size: clamp(3rem, 13vw, 6.6rem); letter-spacing: -.01em; margin-bottom: .2em; color: var(--tulsi-deep); }
.hero-sub { font-size: 1.14rem; font-weight: 500; color: var(--ink); }
/* A soft rice-white glow behind the hero text so it reads over the sky, wires and trees from the first frame. */
.panel--hero { position: relative; isolation: isolate; }
.panel--hero::before {
  content: ""; position: absolute; inset: -40px -36px -32px -36px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(253, 250, 240, .94), rgba(253, 250, 240, .82) 62%, rgba(253, 250, 240, 0));
}
.panel--hero .hint { color: #34443A; }
.hint { font-size: .95rem; color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.hint::before { content: ""; width: 26px; height: 2px; background: var(--haldi); }
.threshold { display: none; }
.door-glow { display: none; }

/* Kitchen */
.scene--kitchen { background: var(--limewash); }
.kplate {
  background: var(--rice); border: 1px solid rgba(31, 77, 43, .25); border-radius: 14px;
  padding: 18px 20px 20px; box-shadow: 0 1px 0 rgba(31, 77, 43, .08), 0 18px 40px -24px rgba(22, 58, 32, .45);
}
.kplate--rule { background: var(--tulsi); color: var(--rice); border: 3px double rgba(217, 154, 30, .8); }
.kplate--rule h2 { color: var(--rice); }
.kplate--rule p { color: #DCE6D8; }
.kplate .who { font-size: .95rem; color: var(--muted); margin-bottom: 6px; }
.rule-dots { display: none; }

/* ==========================================================================
   Motion mode: sticky stages driven by --p / classes set in v2.js
   ========================================================================== */
.motion .scene { height: calc(var(--len, 2.5) * 100svh); }
.motion .stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: block; }
.motion .stage > .art { position: absolute; inset: 0; height: 100%; max-height: none; min-height: 0; }
.motion .layer { position: absolute; inset: 0; padding: 0; z-index: 2; pointer-events: none; }
.motion .layer a, .motion .layer button { pointer-events: auto; }
.motion .scene + .scene .layer { padding-top: 0; }
.motion [data-from] {
  position: absolute; opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1), visibility 0s .6s;
}
.motion [data-from].on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* hero */
.motion .panel--hero { left: var(--gutter); right: var(--gutter); top: calc(var(--bar) + 18px); max-width: 36rem; }
.motion .threshold {
  display: block; left: 0; right: 0; top: 56%; text-align: center; margin: 0 auto; padding: 0 var(--gutter);
  font-family: var(--display); font-size: clamp(2.2rem, 9vw, 4.6rem); color: var(--tulsi-deep); line-height: 1.05;
}
.motion .door-glow { display: block; position: absolute; inset: 0; background: #F4CF79; opacity: 0; z-index: 1; pointer-events: none; }
.motion .scene--kitchen .door-glow { opacity: 1; }
@media (min-width: 900px) {
  .motion .panel--hero { left: 5vw; top: 16vh; max-width: 28vw; }
  .motion .panel--hero .hero-title { font-size: clamp(3.4rem, 5.6vw, 6rem); }
}

/* kitchen plates */
.motion .scene--kitchen .kplate { left: var(--gutter); right: var(--gutter); top: calc(var(--bar) + 14px); max-width: 30rem; }
.motion .rule-dots {
  display: flex; gap: 8px; position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%);
  list-style: none; margin: 0; padding: 7px 11px; background: rgba(255, 253, 247, .9); border-radius: 999px;
}
.rule-dots li { width: 8px; height: 8px; border-radius: 50%; background: rgba(31, 77, 43, .25); transition: background .3s; }
.rule-dots li.in { background: var(--tulsi); }

/* Kitchen chef doodle (placeholder) and the rule signs. data-rule is set by v2.js; without motion he stays at rest. */
.chef-arm-up, .nosign, .nosign-slash { opacity: 0; }
.nosign, .nosign-slash { transform-box: fill-box; transform-origin: center; transform: scale(.6); transition: opacity .35s ease, transform .45s cubic-bezier(.2, .9, .3, 1.3); }
.chef[data-rule="1"] .nosign--1, .chef[data-rule="2"] .nosign--2, .chef[data-rule="3"] .nosign--3,
.chef:not([data-rule="0"]) .nosign-slash { opacity: 1; transform: none; }
.chef:not([data-rule="0"]) .chef-arm-up { opacity: 1; }
.chef:not([data-rule="0"]) .chef-arm-rest--r { opacity: 0; }
.chef-head { transform-box: fill-box; transform-origin: 50% 95%; }
.chef-forearm { transform-box: fill-box; transform-origin: 30% 100%; }
.motion .chef.shake .chef-head { animation: headshake .9s ease-in-out; }
.motion .chef.shake .chef-forearm { animation: wag .9s ease-in-out; }
@keyframes headshake { 15% { transform: rotate(-9deg); } 35% { transform: rotate(9deg); } 55% { transform: rotate(-7deg); } 75% { transform: rotate(6deg); } 100% { transform: none; } }
@keyframes wag { 15% { transform: rotate(-14deg); } 35% { transform: rotate(12deg); } 55% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } 100% { transform: none; } }

.cue {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25;
  transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px 11px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--haldi); color: var(--ink); font: 600 .98rem/1.15 var(--body);
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 253, 247, .55);
  width: max-content; max-width: calc(100vw - 32px); text-align: center; transition: opacity .3s ease, transform .3s ease;
}
.cue:hover { background: #E8AE38; }
.cue.is-off { opacity: 0; pointer-events: none; transform: translate(-50%, 18px); }
.cue-chev { width: 20px; height: 20px; flex: none; }
.cue.tap .cue-chev { transform: rotate(180deg); }
.motion .cue:not(.tap) .cue-chev { animation: bob 1.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- V3 additions and Design's V2 review fixes (review-v2 #2, #3, B4, B7) ---------- */
.story .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.story .hero-actions .btn { min-height: 52px; }
.story .hero-actions .hint { margin: 0; }
.story .hero-sub { max-width: 34rem; }
/* no blank haldi screen: the kitchen takes over the moment the street stops (p in v2.js style is per-scene rect) */
.motion .scene--kitchen { margin-top: -100svh; }
/* the street stays on top while it plays; when it scrolls away it uncovers the kitchen, already in place underneath */
.motion .scene--street { z-index: 2; }
.motion .scene--kitchen { z-index: 1; }
.motion .scene--street.is-done, .motion .scene--street.is-done * { visibility: hidden !important; }
/* threshold under the toran on phones, full colour once on */
@media (max-width: 559px) { .motion .threshold { top: 64%; } }
/* phones: lift the kitchen art above the pill so the nameplate stays visible; the strip below reads as the counter */
@media (max-width: 559px) {
  .motion .scene--kitchen .stage { background: #1E3F27; }
  .motion .scene--kitchen .stage > .art { inset: 0 0 auto 0; height: calc(100% - 76px); }
  .motion .scene--kitchen .kplate { padding: 12px 14px; }
  .motion .scene--kitchen .kplate h2 { font-size: 1.7rem; }
  .motion .rule-dots { display: none; }
}
.story .stage > .art { display: block; }
/* still mode (reduced motion / no JS): the two scenes are short pictures, ordering stays one tap away */
html:not(.motion) .story .stage > .art { height: 46svh; min-height: 260px; max-height: 520px; }
html:not(.motion) .story .threshold, html:not(.motion) .story .door-glow { display: none; }
.cue[hidden] { display: none; }

/* Design checklist B (19 Nov) */
@media (max-width: 559px) { .motion .story .hero-actions .hint { display: none; } }   /* the pill says it on phones */
@media (min-width: 900px) { html:not(.motion) .story .scene--kitchen .stage > .art { height: 600px; max-height: none; } }   /* chef, sign and nameplate whole */
/* Home speed (Marketing's live Lighthouse, mobile TBT): the sections after the occasions are laid out only when they come
   near the screen. The sizes are their rough phone heights, so the scrollbar barely moves when they render. */
#plan ~ .section { content-visibility: auto; contain-intrinsic-size: auto 760px; }
