/* ============================================================
   Kids Nutrition Academy — Sunny & Moody character layer
   Used on the character variants. Keys out the clips' light
   background with mix-blend-mode so they read as cut-outs.
   ============================================================ */

/* ---------- shared keyed-video character ---------- */
.kvid {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  /* lift the near-white clip background to pure white, then DARKEN
     blend drops it onto the light page so the character reads cut-out */
  mix-blend-mode: darken;
  filter: brightness(1.08) contrast(1.05) saturate(1.03);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
                      linear-gradient(to bottom, #000 80%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
              linear-gradient(to bottom, #000 80%, transparent 99%);
  mask-composite: intersect;
}

/* ============================================================
   FRAMING HERO (Variant: characters frame the hero)
   ============================================================ */
.chero {
  position: relative;
  margin-top: -84px;
  padding-top: 104px;
  padding-bottom: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  min-height: clamp(620px, 94vh, 920px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% 18%, #fffefb 0%, var(--cream-soft) 42%, var(--cream) 78%, var(--cream-deep) 100%);
}
/* playful confetti dots */
.chero::before, .chero::after {
  content: ""; position: absolute; border-radius: 50%; z-index: 0; pointer-events: none;
}
.chero::before { width: 16px; height: 16px; background: var(--acc-orange); top: 22%; left: 30%; box-shadow: 120px 60px 0 -2px var(--acc-teal), 280px -30px 0 -4px var(--red), -60px 120px 0 -3px var(--acc-yellow); opacity: .8; }
.chero::after { width: 12px; height: 12px; background: var(--acc-blue); top: 30%; right: 28%; box-shadow: -90px 80px 0 -1px var(--acc-yellow), 60px 160px 0 -3px var(--red), 30px -40px 0 -2px var(--acc-teal); opacity: .8; }

.chero__inner { position: relative; z-index: 3; width: 100%; max-width: 760px; margin-inline: auto; text-align: center; }
.chero__eyebrow {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--red); font-size: clamp(.9rem, .82rem + .4vw, 1.1rem); margin: 0 0 .6rem;
}
.chero .stars { color: var(--acc-yellow); margin-bottom: 1rem; font-size: 1.4rem; }
.chero h1 {
  font-family: var(--disp); text-transform: uppercase; color: var(--ink);
  font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.2rem); line-height: 1.12; letter-spacing: .01em;
  text-wrap: balance; padding-bottom: .08em; margin: 0 0 1.7rem;
}
.chero h1 .hl { color: var(--red); }
.chero__sub { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--ink-soft); max-width: 30ch; margin: 0 auto 1.6rem; }
.chero__cta { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; }

.chero__char {
  position: absolute; bottom: 0; z-index: 2; pointer-events: none;
  width: clamp(190px, 23vw, 330px);
  height: clamp(380px, 80%, 800px);
}
.chero__char--left { left: clamp(-28px, 0.5vw, 40px); }
.chero__char--right { right: clamp(-28px, 0.5vw, 40px); }

/* dramatic project-in intro (base = on-screen; JS adds .preenter to fly them in,
   so even if the transition is skipped they still end up visible) */
.chero__char { transition: transform 1.05s var(--ease), opacity .8s var(--ease); }
.chero__char--right { transition-delay: .18s; }
.chero__char--left.preenter { transform: translateX(-155%) translateY(6%) scale(.78) rotate(-6deg); opacity: 0; }
.chero__char--right.preenter { transform: translateX(155%) translateY(6%) scale(.78) rotate(6deg); opacity: 0; }
/* gentle idle bob once settled */
.chero__char .kvid { animation: floaty 4.5s ease-in-out 1.4s infinite; }
.chero__char--right .kvid { animation-delay: 1.7s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }

@media (prefers-reduced-motion: reduce) {
  .chero__char--left, .chero__char--right { animation: none; }
  .chero__char .kvid { animation: none; }
}

@media (max-width: 820px) {
  .chero { min-height: clamp(560px, 88vh, 760px); }
  .chero__char { width: clamp(140px, 38vw, 230px); height: clamp(300px, 62%, 560px); opacity: .96; }
  .chero__char--left { left: -10%; }
  .chero__char--right { right: -10%; }
  .chero h1 { font-size: clamp(2rem, 1.2rem + 6vw, 3.2rem); }
  .chero__sub { max-width: 26ch; }
}
@media (max-width: 540px) {
  .chero__inner { background: radial-gradient(80% 60% at 50% 46%, var(--cream-soft) 40%, transparent 72%); padding: 1rem .5rem; border-radius: 20px; }
  .chero__char { opacity: .82; }
}

/* ============================================================
   JOURNEY peekers (Variant 2: characters travel the page)
   ============================================================ */
.peeker {
  position: absolute; bottom: 0; z-index: 4; pointer-events: none;
  width: clamp(120px, 16vw, 220px); height: clamp(240px, 30vw, 420px);
  opacity: 0; transition: transform .8s var(--ease), opacity .6s var(--ease);
}
.peeker--left { left: 0; transform: translateX(-110%); }
.peeker--right { right: 0; transform: translateX(110%); }
.peeker.in { opacity: 1; transform: translateX(0); }
.peeker .kvid { object-position: center 14%; }

/* a small fixed companion that waves along as you scroll (variant 2) */
.buddy {
  position: fixed; bottom: 0; left: 8px; z-index: 40; pointer-events: none;
  width: clamp(96px, 12vw, 150px); height: clamp(150px, 19vw, 240px);
  opacity: 0; transform: translateY(110%); transition: transform .6s var(--ease), opacity .5s var(--ease);
}
.buddy.show { opacity: 1; transform: translateY(0); }
.buddy .kvid { mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, #000 86%, transparent); }
@media (max-width: 600px) { .buddy { display: none; } }

/* ============================================================
   PROBLEM section — Sunny rests her hand on the M (no photo box)
   ============================================================ */
.problem2 { position: relative; overflow: hidden; }
.problem2__grid {
  display: grid;
  grid-template-columns: minmax(190px, var(--sunny-col, 300px)) 1fr;
  gap: clamp(0.25rem, 0rem + 1.5vw, 1.75rem);
  align-items: center;
  min-height: 480px;
}
.problem2__charcol { align-self: end; justify-self: end; position: relative; z-index: 2; pointer-events: none; }
.problem2__sunny-box {
  width: var(--sunny-w, 256px);
  aspect-ratio: 30 / 71;
  transform: translate(var(--sunny-x, 22px), var(--sunny-y, -28px));
}
.problem2__sunny {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 51% 50%;
  mix-blend-mode: darken;
  filter: brightness(1.06) contrast(1.04) saturate(1.02);
}
.problem2--hide-sunny .problem2__charcol { display: none; }
.problem2--hide-sunny .problem2__grid { grid-template-columns: 1fr; min-height: 0; }

.problem2__body { align-self: end; padding-bottom: clamp(0.5rem, 0rem + 2vw, 2.5rem); }
.problem2__body .eyebrow { color: var(--red); }
.problem2__head {
  font-family: var(--disp); text-transform: uppercase; line-height: 0.92;
  font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.4rem); letter-spacing: 0.01em;
  color: #814043; margin: 0 0 1.1rem;
}
.problem2__m {
  float: left;
  font-size: var(--m-size, 4.2em);
  line-height: 0.62;
  color: var(--m-color, var(--red));
  margin: 0.04em 0.09em 0 0;
  font-weight: 900;
}
.problem2__body p { margin: 0 0 1rem; font-size: 1.1rem; color: var(--ink); max-width: 46ch; }
.problem2__body p.muted { color: var(--ink-soft); }
.problem2__body .split__cta { margin-top: 0.75rem; }

@media (max-width: 900px) {
  .problem2 { overflow: visible; }
  .problem2__grid { grid-template-columns: 1fr; gap: 0.75rem; min-height: 0; text-align: left; }
  .problem2__charcol { justify-self: start; align-self: end; }
  .problem2__sunny-box { width: clamp(160px, 42vw, 230px); transform: translate(0, 0); }
  .problem2__body { align-self: start; padding-bottom: 0; }
}
