// Promo Video — Scenes 5-8
//   5. Personality-adaptive (43-53s)
//   6. Parent dashboard (53-63s)
//   7. Founder note (63-71s)
//   8. Brand close (71-75s)

// ============================================================================
// SCENE 5 — Personality-adaptive. Pi pulls Rina's chess hobby into a proof.
// ============================================================================
function Scene5Personality() {
  const { localTime } = useSprite();
  const t = localTime;

  const interests = [
    { label: 'Chess', detail: 'club captain · ECF 1450', icon: '♞', highlight: true },
    { label: 'Piano', detail: 'Grade 7 — ABRSM', icon: '𝄞' },
    { label: 'Cross-country', detail: 'school 1st team', icon: '◇' },
    { label: 'Sci-fi', detail: 'reads 100 books/yr', icon: '☆' },
  ];

  return (
    <div style={{
      position: 'absolute', inset: 0,
      background: palette.paper,
      paddingTop: 130,
      display: 'flex', justifyContent: 'center',
    }}>
      <SceneNumber idx={5} total={8} label="Personality-adaptive" />
      <PaperChrome time="RINA · CONTEXT" />

      <div style={{
        width: 1640,
        display: 'grid',
        gridTemplateColumns: '1fr 1.3fr',
        gap: 56,
        marginTop: 24,
      }}>
        {/* LEFT — context card */}
        <div style={{
          opacity: Math.min(1, t / 0.5),
          transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, t / 0.6))) * 20}px)`,
          background: palette.card,
          border: `1px solid ${palette.hair}`,
          borderRadius: 18,
          padding: '32px 32px 28px',
          height: 'fit-content',
          boxShadow: '0 24px 60px -40px rgba(0,0,0,0.18)',
        }}>
          <div style={{
            fontFamily: fonts.mono, fontSize: 13, letterSpacing: '0.08em',
            color: palette.muted, textTransform: 'uppercase',
            display: 'flex', justifyContent: 'space-between',
          }}>
            <span><SparkGlyph size={11} color={palette.accent} /> Student context</span>
            <span>read by every tutor</span>
          </div>
          <div style={{
            fontFamily: fonts.serif, fontSize: 38,
            color: palette.inkDeep, letterSpacing: '-0.015em',
            marginTop: 18,
          }}>Rina · <span style={{ fontStyle: 'italic' }}>Year 8</span></div>
          <div style={{
            fontFamily: fonts.sans, fontSize: 16, color: palette.muted,
            marginTop: 6,
          }}>Cambridge · age 12 · parent-managed account</div>

          <div style={{
            marginTop: 26, paddingTop: 22, borderTop: `1px solid ${palette.hair}`,
            display: 'flex', flexDirection: 'column', gap: 14,
          }}>
            {interests.map((it, i) => {
              const showAt = 1.0 + i * 0.25;
              const op = Math.max(0, Math.min(1, (t - showAt) / 0.4));
              const highlightAt = 3.4;
              const isLit = it.highlight && t >= highlightAt;
              const litOp = isLit ? Math.min(1, (t - highlightAt) / 0.4) : 0;
              return (
                <div key={it.label} style={{
                  opacity: op,
                  transform: `translateY(${(1 - op) * 8}px)`,
                  display: 'grid', gridTemplateColumns: '54px 1fr',
                  gap: 16, alignItems: 'center',
                  padding: '12px 16px',
                  borderRadius: 10,
                  background: isLit
                    ? `color-mix(in oklch, ${palette.accentSoft} ${60 * litOp}%, transparent)`
                    : 'transparent',
                  border: isLit
                    ? `1px solid color-mix(in oklch, ${palette.accent} ${40 * litOp}%, transparent)`
                    : '1px solid transparent',
                  transition: 'background 200ms',
                }}>
                  <div style={{
                    width: 54, height: 54, borderRadius: '50%',
                    background: isLit ? palette.accentSoft : palette.paper2,
                    border: `1px solid ${isLit ? palette.accent : palette.hair}`,
                    color: isLit ? palette.accentDeep : palette.inkDeep,
                    display: 'grid', placeItems: 'center',
                    fontFamily: fonts.serif, fontSize: 28,
                  }}>{it.icon}</div>
                  <div>
                    <div style={{
                      fontFamily: fonts.serif, fontSize: 22, color: palette.inkDeep,
                      letterSpacing: '-0.008em',
                    }}>{it.label}</div>
                    <div style={{
                      fontFamily: fonts.mono, fontSize: 12, letterSpacing: '0.05em',
                      color: palette.muted,
                    }}>{it.detail}</div>
                  </div>
                </div>
              );
            })}
          </div>

          {/* Pi reads chip */}
          {t >= 3.0 && (
            <div style={{
              marginTop: 22,
              opacity: Math.min(1, (t - 3.0) / 0.4),
              fontFamily: fonts.mono, fontSize: 12, letterSpacing: '0.06em',
              color: palette.accentDeep, textTransform: 'uppercase',
              display: 'flex', alignItems: 'center', gap: 10,
              paddingTop: 14, borderTop: `1px dashed ${palette.hair}`,
            }}>
              <span style={{
                display: 'inline-block', width: 8, height: 8, borderRadius: '50%',
                background: palette.accent,
                animation: 'pulse 1.4s infinite',
              }} />
              Pi reading context…
            </div>
          )}
        </div>

        {/* RIGHT — Pi's response with chess moves */}
        <div style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
          {/* Chat bubble */}
          {t >= 4.0 && (
            <div style={{
              opacity: Math.min(1, (t - 4.0) / 0.5),
              transform: `translateY(${(1 - Easing.easeOutBack(Math.min(1, (t - 4.0) / 0.6))) * 18}px)`,
              padding: '26px 32px',
              background: palette.paper2,
              border: `1px solid ${palette.hair}`,
              borderRadius: 18, borderBottomLeftRadius: 6,
              fontFamily: fonts.sans, fontSize: 28, lineHeight: 1.45,
              color: palette.inkDeep,
            }}>
              <div style={{
                fontFamily: fonts.mono, fontSize: 14, letterSpacing: '0.08em',
                color: palette.accentDeep, textTransform: 'uppercase', marginBottom: 10,
              }}>Professor Pi</div>
              <span>Like your </span>
              <span style={{
                background: palette.accentSoft,
                padding: '2px 10px', borderRadius: 6,
                color: palette.accentDeep, fontWeight: 600,
                fontStyle: 'italic',
              }}>chess opening</span>
              <span> — let's plan the </span>
              <strong style={{ fontWeight: 600 }}>first 3 moves</strong>
              <span> of this proof. Move 1: what's being asked.</span>
            </div>
          )}

          {/* Mini chess board animating 3 moves */}
          {t >= 5.5 && (
            <div style={{
              opacity: Math.min(1, (t - 5.5) / 0.5),
              transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, (t - 5.5) / 0.6))) * 18}px)`,
              background: palette.card,
              border: `1px solid ${palette.hair}`,
              borderRadius: 16,
              padding: '24px 28px',
              boxShadow: '0 24px 60px -40px rgba(0,0,0,0.18)',
            }}>
              <div style={{
                display: 'flex', justifyContent: 'space-between',
                marginBottom: 16,
                fontFamily: fonts.mono, fontSize: 13, letterSpacing: '0.06em',
                color: palette.muted, textTransform: 'uppercase',
              }}>
                <span>Same 3-move pattern, applied to the proof</span>
                <span>chess → algebra</span>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 18 }}>
                {[
                  { n: 'Move 01', chess: 'Control centre', algebra: 'Identify what\'s asked' },
                  { n: 'Move 02', chess: 'Develop pieces',  algebra: 'Lay out the knowns' },
                  { n: 'Move 03', chess: 'Castle — safety', algebra: 'Pick the operation' },
                ].map((m, i) => {
                  const showAt = 6.0 + i * 0.5;
                  const op = Math.max(0, Math.min(1, (t - showAt) / 0.45));
                  return (
                    <div key={i} style={{
                      opacity: op,
                      transform: `translateY(${(1 - Easing.easeOutBack(op)) * 14}px)`,
                      padding: '18px 18px 20px',
                      background: palette.paper2,
                      border: `1px solid ${palette.hair}`,
                      borderRadius: 12,
                    }}>
                      <div style={{
                        fontFamily: fonts.mono, fontSize: 12, letterSpacing: '0.08em',
                        color: palette.accentDeep, textTransform: 'uppercase',
                      }}>{m.n}</div>
                      <div style={{
                        marginTop: 12,
                        display: 'flex', alignItems: 'center', gap: 12,
                        fontFamily: fonts.serif, fontSize: 19, color: palette.inkDeep,
                      }}>
                        <span style={{ fontSize: 24, color: palette.muted }}>♞</span>
                        <span style={{ fontStyle: 'italic' }}>{m.chess}</span>
                      </div>
                      <div style={{
                        marginTop: 10, paddingTop: 10,
                        borderTop: `1px dashed ${palette.hair}`,
                        fontFamily: fonts.sans, fontSize: 16, color: palette.inkSoft,
                      }}>↳ {m.algebra}</div>
                    </div>
                  );
                })}
              </div>
            </div>
          )}
        </div>
      </div>
    </div>
  );
}

// ============================================================================
// SCENE 6 — Parent dashboard. Transparency: parent sees the week.
// ============================================================================
function Scene6Dashboard() {
  const { localTime } = useSprite();
  const t = localTime;

  const sessions = [
    { day: 'MON', topic: 'Fractions ↔ decimals',         mins: 22, energy: 'green', who: 'Pi'     },
    { day: 'TUE', topic: 'Expanding brackets',           mins: 15, energy: 'amber', who: 'Pi'     },
    { day: 'WED', topic: '— rest day (Mentor advised)',   mins: 0,  energy: 'red',   who: 'Mentor' },
    { day: 'THU', topic: 'Ratio & proportion',           mins: 28, energy: 'green', who: 'Pi'     },
    { day: 'FRI', topic: 'Recap — Friday test prep',     mins: 18, energy: 'amber', who: 'Pi'     },
  ];

  const energyColor = (k) => k === 'green' ? palette.go : k === 'amber' ? palette.amber : palette.stop;
  const energyLabel = (k) => k === 'green' ? 'GREEN' : k === 'amber' ? 'AMBER' : 'RED';

  return (
    <div style={{
      position: 'absolute', inset: 0,
      background: palette.paper,
      paddingTop: 130,
      display: 'flex', justifyContent: 'center',
    }}>
      <SceneNumber idx={6} total={8} label="What parents see" />
      <PaperChrome time="DASHBOARD · WEEK 03" />

      <div style={{
        width: 1640,
        opacity: Math.min(1, t / 0.5),
        transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, t / 0.6))) * 20}px)`,
      }}>
        {/* Browser chrome */}
        <div style={{
          background: palette.card,
          border: `1px solid ${palette.hair}`,
          borderRadius: 16,
          overflow: 'hidden',
          boxShadow: '0 40px 100px -50px rgba(0,0,0,0.22)',
        }}>
          {/* URL bar */}
          <div style={{
            display: 'flex', alignItems: 'center', gap: 14,
            padding: '14px 22px',
            background: palette.paper2,
            borderBottom: `1px solid ${palette.hair}`,
          }}>
            <div style={{ display: 'flex', gap: 8 }}>
              {['#ff5f57', '#febc2e', '#28c840'].map(c => (
                <i key={c} style={{ width: 12, height: 12, borderRadius: '50%', background: c, display: 'inline-block' }} />
              ))}
            </div>
            <div style={{
              flex: 1, marginLeft: 16,
              padding: '6px 14px',
              background: palette.card,
              border: `1px solid ${palette.hair}`,
              borderRadius: 8,
              fontFamily: fonts.mono, fontSize: 13,
              color: palette.muted,
            }}>aitutors<SparkGlyph size={9} color={palette.accent} />me/dashboard/parent</div>
            <span style={{
              fontFamily: fonts.mono, fontSize: 11, letterSpacing: '0.08em',
              color: palette.muted, textTransform: 'uppercase',
            }}>parent · jason</span>
          </div>

          {/* Dashboard body */}
          <div style={{ padding: '32px 36px 36px' }}>
            {/* Heading row */}
            <div style={{
              display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
              paddingBottom: 18, borderBottom: `1px solid ${palette.hair}`,
            }}>
              <div>
                <div style={{
                  fontFamily: fonts.mono, fontSize: 13, letterSpacing: '0.08em',
                  color: palette.muted, textTransform: 'uppercase',
                }}>Rina · week of May 18</div>
                <div style={{
                  fontFamily: fonts.serif, fontSize: 36,
                  color: palette.inkDeep, marginTop: 6, letterSpacing: '-0.015em',
                }}>What Rina actually did this week.</div>
              </div>
              <div style={{ display: 'flex', gap: 32 }}>
                {[
                  { lbl: 'Sessions', val: '4', sub: '1 rest day' },
                  { lbl: 'Time',     val: '83', sub: 'minutes total' },
                  { lbl: 'Topics',   val: '4', sub: 'maths · KS3' },
                ].map((s, i) => (
                  <div key={i} style={{
                    opacity: Math.min(1, Math.max(0, (t - 0.6 - i * 0.15) / 0.4)),
                    textAlign: 'right',
                  }}>
                    <div style={{
                      fontFamily: fonts.serif, fontSize: 40, color: palette.inkDeep,
                      fontStyle: 'italic', letterSpacing: '-0.02em',
                    }}>{s.val}</div>
                    <div style={{ fontFamily: fonts.mono, fontSize: 11, letterSpacing: '0.06em', color: palette.muted, textTransform: 'uppercase' }}>
                      {s.lbl} · {s.sub}
                    </div>
                  </div>
                ))}
              </div>
            </div>

            {/* Session list */}
            <div style={{ marginTop: 20 }}>
              {sessions.map((s, i) => {
                const showAt = 1.4 + i * 0.25;
                const op = Math.max(0, Math.min(1, (t - showAt) / 0.4));
                const isRest = s.energy === 'red';
                return (
                  <div key={i} style={{
                    opacity: op,
                    transform: `translateX(${(1 - op) * -16}px)`,
                    display: 'grid',
                    gridTemplateColumns: '90px 140px 1fr 120px 130px',
                    gap: 22, alignItems: 'center',
                    padding: '18px 8px',
                    borderBottom: `1px solid ${palette.hair}`,
                  }}>
                    <span style={{
                      fontFamily: fonts.mono, fontSize: 13, letterSpacing: '0.08em',
                      color: palette.muted,
                    }}>{s.day}</span>
                    <span style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
                      <span style={{
                        width: 14, height: 14, borderRadius: '50%',
                        background: energyColor(s.energy),
                        boxShadow: `0 0 0 4px color-mix(in srgb, ${energyColor(s.energy)} 18%, transparent)`,
                      }} />
                      <span style={{
                        fontFamily: fonts.mono, fontSize: 12, letterSpacing: '0.08em',
                        color: energyColor(s.energy), fontWeight: 600,
                      }}>{energyLabel(s.energy)}</span>
                    </span>
                    <span style={{
                      fontFamily: fonts.serif, fontSize: 22, color: palette.inkDeep,
                      fontStyle: isRest ? 'italic' : 'normal',
                      letterSpacing: '-0.008em',
                    }}>{s.topic}</span>
                    <span style={{
                      fontFamily: fonts.mono, fontSize: 13, color: palette.muted,
                      letterSpacing: '0.04em', textTransform: 'uppercase',
                    }}>{s.who}</span>
                    <span style={{
                      fontFamily: fonts.serif, fontStyle: 'italic',
                      fontSize: 22, color: isRest ? palette.muted : palette.inkDeep,
                      textAlign: 'right',
                    }}>{isRest ? '— rest —' : `${s.mins} min`}</span>
                  </div>
                );
              })}
            </div>

            {/* Mentor note */}
            {t >= 4.6 && (
              <div style={{
                marginTop: 22,
                opacity: Math.min(1, (t - 4.6) / 0.5),
                padding: '20px 24px',
                background: palette.accentSoft,
                border: `1px solid color-mix(in oklch, ${palette.accent} 30%, ${palette.hair})`,
                borderRadius: 12,
                display: 'flex', gap: 16, alignItems: 'flex-start',
              }}>
                <span style={{
                  fontFamily: fonts.mono, fontSize: 13, letterSpacing: '0.08em',
                  color: palette.accentDeep, textTransform: 'uppercase',
                  flex: 'none', paddingTop: 3,
                }}>Mentor flagged ↓</span>
                <span style={{
                  fontFamily: fonts.sans, fontSize: 19, color: palette.inkDeep,
                  lineHeight: 1.45,
                }}>
                  Wednesday: Rina logged a <strong style={{ color: palette.stop, fontWeight: 600 }}>RED</strong> after football practice. I suggested rest instead of pushing through. She accepted.
                </span>
              </div>
            )}
          </div>
        </div>
      </div>
    </div>
  );
}

// ============================================================================
// SCENE 7 — Founder note.
// ============================================================================
function Scene7Founder() {
  const { localTime } = useSprite();
  const t = localTime;

  return (
    <div style={{
      position: 'absolute', inset: 0,
      background: 'oklch(0.97 0.018 68)', // cream
      paddingTop: 130,
      display: 'flex', justifyContent: 'center',
    }}>
      <SceneNumber idx={7} total={8} label="From the founder" />
      <PaperChrome time="JASON · CAMBRIDGE" />

      <div style={{
        width: 1500,
        display: 'grid',
        gridTemplateColumns: '380px 1fr',
        gap: 64,
        alignItems: 'start',
        marginTop: 16,
      }}>
        {/* Photo placeholder */}
        <div style={{
          opacity: Math.min(1, t / 0.5),
          transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, t / 0.6))) * 20}px)`,
          width: 380, height: 460,
          background: palette.paper2,
          border: `1px solid ${palette.hair}`,
          borderRadius: 12,
          position: 'relative', overflow: 'hidden',
          display: 'grid', placeItems: 'center',
        }}>
          {/* striped texture */}
          <div style={{
            position: 'absolute', inset: 0,
            backgroundImage: `repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in oklch, ${palette.accent} 10%, transparent) 14px 15px)`,
          }} />
          <div style={{
            position: 'relative',
            fontFamily: fonts.mono, fontSize: 12,
            letterSpacing: '0.08em', textTransform: 'uppercase',
            color: palette.muted,
            background: palette.paper, padding: '8px 14px',
            border: `1px solid ${palette.hair}`, borderRadius: 4,
          }}>Photo · Jason &amp; Rina</div>

          <div style={{
            position: 'absolute', bottom: 16, left: 18, right: 18,
            fontFamily: fonts.mono, fontSize: 11, letterSpacing: '0.08em',
            color: palette.quiet, textTransform: 'uppercase',
            display: 'flex', justifyContent: 'space-between',
          }}>
            <span>Cambridge · 2026</span>
            <span>03 months in</span>
          </div>
        </div>

        {/* Letter */}
        <div style={{ paddingTop: 16 }}>
          {/* Opening line */}
          {t >= 0.5 && (
            <div style={{
              opacity: Math.min(1, (t - 0.5) / 0.5),
              transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, (t - 0.5) / 0.6))) * 12}px)`,
              fontFamily: fonts.serif, fontStyle: 'italic',
              fontSize: 56, lineHeight: 1.1,
              color: palette.inkDeep, letterSpacing: '-0.02em',
              maxWidth: 1000,
            }}>
              Built for my daughter.<br />
              Now sharing with yours.
            </div>
          )}

          {/* Body */}
          {t >= 2.2 && (
            <div style={{
              opacity: Math.min(1, (t - 2.2) / 0.6),
              transform: `translateY(${(1 - Easing.easeOutCubic(Math.min(1, (t - 2.2) / 0.6))) * 12}px)`,
              marginTop: 32,
              fontFamily: fonts.serif, fontSize: 24, lineHeight: 1.55,
              color: palette.ink, letterSpacing: '-0.005em',
              maxWidth: 920,
            }}>
              Rina is 12. Avid reader, Grade 7 piano, runs cross-country. The generic AI homework helpers we tried{' '}
              <span style={{ background: 'oklch(0.92 0.05 25 / 0.5)', padding: '0 6px' }}>did her work for her</span>{' '}
              — or felt like a quiz machine that didn't know it was 9pm on a Thursday.
            </div>
          )}

          {/* Signature */}
          {t >= 5.2 && (
            <div style={{
              opacity: Math.min(1, (t - 5.2) / 0.5),
              marginTop: 36,
              display: 'flex', alignItems: 'center', gap: 22,
            }}>
              <span style={{
                fontFamily: '"Caveat", "Brush Script MT", cursive',
                fontSize: 56, color: palette.inkDeep,
                letterSpacing: '0.01em',
                transform: 'rotate(-3deg)', display: 'inline-block',
              }}>— Jason</span>
              <span style={{
                fontFamily: fonts.mono, fontSize: 13,
                letterSpacing: '0.08em', color: palette.muted,
                textTransform: 'uppercase',
              }}>Founder · aitutors<SparkGlyph size={9} color={palette.accent} />me</span>
            </div>
          )}
        </div>
      </div>
    </div>
  );
}

// ============================================================================
// SCENE 8 — Brand close. Wordmark blooms with sparkle.
// ============================================================================
function Scene8Close() {
  const { localTime, duration } = useSprite();
  const t = localTime;

  // Bg sweeps from paper to deep navy over 0-1s
  const bgT = Math.min(1, t / 0.9);

  // Mark scale
  const markT = Math.min(1, Math.max(0, (t - 0.4) / 0.9));
  const markScale = 0.6 + 0.4 * Easing.easeOutBack(markT);
  const markOp = markT;

  // Sparkle burst
  const sparkT = Math.min(1, Math.max(0, (t - 1.1) / 1.0));
  const sparkSpin = sparkT * 540;
  const sparkScale = 0.4 + 1.6 * Easing.easeOutBack(Math.min(1, sparkT * 1.5));

  // Tagline
  const tagOp = Math.min(1, Math.max(0, (t - 1.4) / 0.6));
  const tagTy = (1 - Easing.easeOutCubic(tagOp)) * 14;

  return (
    <div style={{
      position: 'absolute', inset: 0,
      background: `color-mix(in oklch, ${palette.paper} ${(1 - bgT) * 100}%, ${palette.inkDeep})`,
      display: 'flex', flexDirection: 'column',
      alignItems: 'center', justifyContent: 'center',
      gap: 36,
    }}>
      {/* Subtle paper grain overlay on dark */}
      <div style={{
        position: 'absolute', inset: 0,
        backgroundImage:
          'radial-gradient(circle at 22% 18%, rgba(255,255,255,0.04) 0 1px, transparent 1px),' +
          'radial-gradient(circle at 78% 64%, rgba(255,255,255,0.03) 0 1px, transparent 1px)',
        backgroundSize: '11px 11px, 17px 17px',
        opacity: bgT,
        pointerEvents: 'none',
      }} />

      {/* Burst rays */}
      {sparkT > 0 && (
        <svg
          width="800" height="800" viewBox="-400 -400 800 800"
          style={{
            position: 'absolute',
            top: '50%', left: '50%',
            transform: `translate(-50%, calc(-50% - 30px)) scale(${sparkScale})`,
            opacity: Math.min(1, sparkT * 2) * (1 - Math.max(0, (sparkT - 0.6) / 0.4) * 0.6),
            pointerEvents: 'none',
          }}
        >
          {[...Array(12)].map((_, i) => {
            const ang = (i / 12) * Math.PI * 2;
            const r1 = 60, r2 = 280;
            const x1 = Math.cos(ang) * r1, y1 = Math.sin(ang) * r1;
            const x2 = Math.cos(ang) * r2, y2 = Math.sin(ang) * r2;
            return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke={palette.accent} strokeWidth="2" strokeLinecap="round" opacity={0.7} />;
          })}
        </svg>
      )}

      {/* Wordmark */}
      <div style={{
        opacity: markOp,
        transform: `scale(${markScale})`,
        zIndex: 5,
        fontFamily: fonts.serif,
        fontSize: 160, fontWeight: 500,
        color: palette.onDark,
        letterSpacing: '-0.03em',
        display: 'inline-flex', alignItems: 'center', gap: 0,
        lineHeight: 1,
      }}>
        <span>aitutors</span>
        <span style={{
          display: 'inline-block',
          width: 96, height: 96,
          margin: '0 12px',
          transform: `rotate(${sparkSpin}deg) scale(${0.6 + 0.4 * Math.min(1, sparkT * 1.2)})`,
          transformOrigin: 'center',
        }}>
          <SparkGlyph size={96} color={palette.accent} />
        </span>
        <span>me</span>
      </div>

      {/* Tagline */}
      <div style={{
        opacity: tagOp,
        transform: `translateY(${tagTy}px)`,
        zIndex: 5,
        fontFamily: fonts.serif, fontStyle: 'italic',
        fontSize: 36,
        color: palette.onDark2,
        letterSpacing: '-0.01em',
        textAlign: 'center',
      }}>
        The AI tutor that finally fits your kid's life.
      </div>

      {/* URL chip */}
      {t >= 1.9 && (
        <div style={{
          opacity: Math.min(1, (t - 1.9) / 0.5),
          zIndex: 5,
          marginTop: 18,
          fontFamily: fonts.mono, fontSize: 18,
          letterSpacing: '0.18em', textTransform: 'uppercase',
          color: palette.accent,
          padding: '12px 28px',
          border: `1px solid color-mix(in oklch, ${palette.accent} 50%, transparent)`,
          borderRadius: 999,
        }}>
          aitutors.me
        </div>
      )}
    </div>
  );
}

Object.assign(window, {
  Scene5Personality, Scene6Dashboard, Scene7Founder, Scene8Close,
});
