
#story-intro {
  --story-dark: #0b1c33;          
  --ink: #151515;
  --paper: #f6efdd;
  --story-scale: 1;
  --panel-ink: 6px;
  --focus-momo: #d95c12;
  --focus-polo: #1766c4;
  --focus-gold: #a86e00;
  --focus-action: #e02d24;
  --focus-good: #178a3f;
  --focus-worry: #7236b0;
  position: fixed;
  inset: 0;
  z-index: 10060;                 
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(160, 120, 60, 0.13) 1.6px, transparent 2px) 0 0 / 15px 15px,
    radial-gradient(circle at 50% 50%, rgba(160, 120, 60, 0.08) 1.2px, transparent 1.6px) 7.5px 7.5px / 15px 15px,
    var(--paper);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  contain: layout paint style;
}
#story-intro .story-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1980px;
  height: 1080px;
  margin: -540px 0 0 -990px;
  transform: scale(var(--story-scale));
  transform-origin: 50% 50%;
  overflow: hidden;
  pointer-events: none;
  background: #cfe6f7;
  border-radius: calc(var(--panel-ink) * 0.6);
  box-shadow:
    0 0 0 var(--panel-ink) var(--ink),
    calc(var(--panel-ink) * 1.8) calc(var(--panel-ink) * 2) 0 calc(var(--panel-ink) * 0.6) rgba(21, 21, 21, 0.18);
}
#story-intro.is-caption .story-stage { top: var(--stage-centre, 50%); }
#story-intro .story-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  backface-visibility: hidden;
}
#story-intro .story-layer.is-shown { opacity: 1; }
#story-intro .story-shake,
#story-intro .story-cam {
  position: absolute;
  inset: 0;
}
#story-intro .story-cam img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;              
  display: block;
}
#story-intro .story-glow,
#story-intro .story-light {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
#story-intro .story-glow {
  background: radial-gradient(circle, rgba(255, 226, 150, 0.85) 0%, rgba(255, 196, 80, 0.38) 38%, rgba(255, 190, 60, 0) 70%);
}
#story-intro .story-light {
  background: radial-gradient(circle, rgba(255, 250, 235, 1) 0%, rgba(255, 245, 225, 0.45) 45%, rgba(255, 245, 225, 0) 72%);
}
#story-intro .story-glint,
#story-intro .story-heart,
#story-intro .story-sweat,
#story-intro .story-lines {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
#story-intro .story-glint svg,
#story-intro .story-heart svg,
#story-intro .story-sweat svg,
#story-intro .story-lines svg { width: 100%; height: 100%; display: block; overflow: visible; }
#story-intro .story-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#story-intro .story-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 72% at 50% 48%, rgba(8, 22, 48, 0) 55%, rgba(8, 22, 48, 0.9) 100%);
  opacity: 0.12;
  transition: opacity 900ms ease;
}
#story-intro .story-dialogue {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#story-intro .story-say {
  --say-ink: #1c2a4a;               
  position: absolute; left: 0; top: 0; z-index: 2;
  width: max-content; box-sizing: border-box;
  isolation: isolate; opacity: 0; pointer-events: none;
  rotate: var(--tilt, 0deg);
  transform: scale(.9); transform-origin: var(--ox, 50%) var(--oy, 100%);
  transition: opacity 160ms ease-out, transform 200ms ease-out;
  will-change: transform, opacity;
}
#story-intro .story-say.show { opacity: 1; transform: none; }
#story-intro .story-say.out { opacity: 0; transform: scale(.92); transition: opacity 150ms ease-in, transform 150ms ease-in; }
#story-intro .story-say.enter { animation: storyBoing 540ms cubic-bezier(.3, 1.3, .5, 1) backwards; }
#story-intro .story-say.enter.again,
#story-intro .story-say[data-who="narrator"].enter.again { animation: storyAgain 260ms cubic-bezier(.3, 1.4, .5, 1) backwards; }
@keyframes storyAgain {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes storyBoing {
  0%   { opacity: 0; transform: scale(.35) rotate(-7deg); }
  45%  { opacity: 1; transform: scale(1.09) rotate(2.5deg); }
  70%  { transform: scale(.96) rotate(-1.2deg); }
  86%  { transform: scale(1.02) rotate(.4deg); }
  100% { opacity: 1; transform: none; }
}
#story-intro .story-say[data-who="narrator"] {
  --tilt: 0deg;
  padding: 20px 42px 22px;
  background: #fff3d1; border: 5px solid #6b4423; border-radius: 26px;
  box-shadow: 6px 8px 0 rgba(107, 68, 35, .92), 0 16px 30px rgba(20, 50, 90, .22);
  font-family: Nunito, 'Baloo 2', sans-serif; font-weight: 800;
  font-size: max(39px, calc(16px / var(--story-scale, 1))); line-height: 1.42;
  color: #5a3517; text-align: center;
}
#story-intro .story-say[data-who="narrator"].enter { animation: storyDrop 600ms cubic-bezier(.3, 1.25, .5, 1) backwards; }
@keyframes storyDrop {
  0%   { opacity: 0; transform: translateY(-34px) scale(.94); }
  55%  { opacity: 1; transform: translateY(5px) scale(1.02); }
  80%  { transform: translateY(-2px); }
  100% { opacity: 1; transform: none; }
}
#story-intro .story-say[data-who="momo"],
#story-intro .story-say[data-who="polo"] {
  padding: 24px 36px 22px;
  font-family: Fredoka, 'Baloo 2', sans-serif;
  font-weight: 600; font-size: max(44px, calc(17px / var(--story-scale, 1))); line-height: 1.26; letter-spacing: .3px;
  color: var(--say-ink); text-align: center;
}
#story-intro .story-say[data-who="momo"] { --tilt: -1.2deg; }
#story-intro .story-say[data-who="polo"] { --tilt: 1.2deg; }
#story-intro .story-say-shape { position: absolute; left: 0; top: 0; z-index: -1; overflow: visible; pointer-events: none; }
#story-intro .story-say[data-who="narrator"] .story-say-shape { display: none; }
#story-intro .story-say-shape .fill { fill: #fff; stroke: var(--say-ink); stroke-width: 5.5; stroke-linejoin: round; }
#story-intro .story-say-shape .shade { fill: var(--say-ink); opacity: .88; }
#story-intro .story-say[data-tail="up"] .story-say-shape { transform: scaleY(-1); }
#story-intro .story-say-text { position: relative; display: block; white-space: nowrap; }
#story-intro .story-say .w {
  display: inline-block; transform-origin: 50% 85%;
  transition: opacity 140ms ease-out, scale 280ms cubic-bezier(.3, 1.8, .55, 1), translate 280ms cubic-bezier(.3, 1.8, .55, 1);
}
#story-intro .story-say.revealing .w { opacity: 0; scale: .62; translate: 0 7px; }
#story-intro .story-say.revealing .w.in { opacity: 1; scale: 1; translate: 0 0; }
#story-intro .story-say .w.k .kw { color: #e65c00; }
#story-intro .story-say .w.k[data-focus="momo"]   .kw { color: var(--focus-momo); }
#story-intro .story-say .w.k[data-focus="polo"]   .kw { color: var(--focus-polo); }
#story-intro .story-say .w.k[data-focus="gold"]   .kw { color: var(--focus-gold); }
#story-intro .story-say .w.k[data-focus="action"] .kw { color: var(--focus-action); }
#story-intro .story-say .w.k[data-focus="good"]   .kw { color: var(--focus-good); }
#story-intro .story-say .w.k[data-focus="worry"]  .kw { color: var(--focus-worry); }
#story-intro .story-say.revealing .w.k:not(.in) { scale: .55; }
#story-intro .story-veil,
#story-intro .story-curtain {
  position: absolute;
  inset: 0;
  background: var(--story-dark);
  pointer-events: none;
}
#story-intro .story-veil { opacity: 1; }
#story-intro .story-curtain { opacity: 0; }
#story-intro .story-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-bottom: 13vh;
  box-sizing: border-box;
  transition: opacity 260ms ease;
}
#story-intro .story-start.is-gone { opacity: 0; pointer-events: none; }
#story-intro .story-play[aria-disabled="true"] { opacity: 0; transform: scale(.45); cursor: progress; pointer-events: none; }
#story-intro .story-progress {
  width: clamp(140px, 20vmin, 220px);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(21, 21, 21, 0.25);
  overflow: hidden;
  transition: opacity 300ms ease;
}
#story-intro .story-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #88ecfb, #4ba5f4);
  transition: width 240ms ease;
}
#story-intro .story-progress.is-done { opacity: 0; }
#story-intro .story-play:focus,
#story-intro .story-play:focus-visible { outline: none; }
#story-intro .story-caption {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  top: var(--caption-top, 70%);
  display: none;
  justify-content: center;
  pointer-events: none;
}
#story-intro.is-caption .story-caption { display: flex; }
#story-intro .story-caption .story-say { position: relative; margin-top: 30px; --tilt: 0deg; }
#story-intro .story-caption .story-say[data-who="narrator"] {
  padding: 10px 20px 11px; border-width: 3px; border-radius: 16px;
  box-shadow: 3px 4px 0 rgba(107, 68, 35, .92), 0 8px 16px rgba(20, 50, 90, .22);
  font-size: clamp(16px, 4.6vw, 24px);
}
#story-intro .story-caption .story-say[data-who="momo"],
#story-intro .story-caption .story-say[data-who="polo"] { padding: 12px 18px 11px; font-size: clamp(17px, 5.2vw, 26px); }
#story-intro .story-caption .story-say-shape .fill { stroke-width: 3.5; }
#story-intro .story-rotate {
  display: none;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  color: #3b3226;
  font: 600 15px/1.3 'Baloo 2', Nunito, sans-serif;
  text-align: left;
}
#story-intro .story-rotate svg { width: 26px; height: 26px; flex: none; }
#story-intro.is-caption .story-rotate { display: flex; }
#story-intro .story-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  #story-intro .story-say, #story-intro .story-say.out { transform: none; }
  #story-intro .story-say.enter, #story-intro .story-say[data-who="narrator"].enter { animation: none; }
  #story-intro .story-say .w { transition: opacity 120ms ease-out; }
  #story-intro .story-say.revealing .w { scale: 1; translate: 0 0; }
}
