{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"announce-title","type":"registry:component","title":"Announce Title","description":"Launch title animation, product announcement intro with kinetic typography. A four-shot launch title: the eyebrow rushes past the camera on a receding type plane and lands on a colour field, the name assembles word by word on paper, and a macro pan across the tagline cuts wide as the line builds itself last word first while a white sweep drains it out of colour.","dependencies":["remotion","@remotion/google-fonts"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>.","registryDependencies":["https://kuchi.kalarislabs.com/r/kuchi-ui.json"],"files":[{"path":"components/kuchi/announce-title.tsx","type":"registry:component","target":"components/kuchi/announce-title.tsx","content":"/*! Portions Copyright (c) 2026 Sri Nath (snap-cn). MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\r\n\r\nimport { loadFont as loadGoogleSans } from \"@remotion/google-fonts/GoogleSans\";\r\nimport type { CSSProperties, ReactNode } from \"react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n  AbsoluteFill,\r\n  continueRender,\r\n  delayRender,\r\n  getRemotionEnvironment,\r\n  useCurrentFrame,\r\n  useVideoConfig,\r\n} from \"remotion\";\r\nimport {\r\n  resolveFont,\r\n  KuchiUIProvider,\r\n  useKuchiTheme,\r\n} from \"@/lib/kuchi-ui\";\r\n\r\n// Loaded through @remotion/google-fonts, never a CSS variable — a Remotion\r\n// bundle has none of the app's CSS, so `var(--font-…)` gets you the right face\r\n// in the Player and a fallback in the mp4 (design-system rule 4).\r\nconst { fontFamily: SANS } = loadGoogleSans(\"normal\", {\r\n  weights: [\"400\"],\r\n  subsets: [\"latin\"],\r\n});\r\n\r\nexport interface AnnounceTitleProps {\r\n  /**\r\n   * The face this scene paints its words in — a label from `fonts.ts`\r\n   * (\"Inter\", \"Space Grotesk\", \"Instrument Serif\") or a CSS family you have\r\n   * loaded yourself. Unset, the scene keeps the face it was designed around.\r\n   *\r\n   * Overrides `theme.fontFamily`, which is how a brand kit re-skins a whole\r\n   * timeline from one value.\r\n   */\r\n  fontFamily?: string;\r\n  /** The word that rushes past the camera and lands on the colour field. */\r\n  eyebrow?: string;\r\n  /** The product name, assembled word by word on the paper card. */\r\n  title?: string;\r\n  /** The closing line. Revealed last word first, then drained to white. */\r\n  tagline?: string;\r\n  /** Ground behind the opening rush. */\r\n  voidColor?: string;\r\n  /** The colour field the eyebrow lands on. */\r\n  fieldColor?: string;\r\n  /** Paper the title is set on. */\r\n  paperColor?: string;\r\n  /** Ink the title is set in. */\r\n  titleColor?: string;\r\n  /** Ground behind both closing shots, under the glow. */\r\n  nightColor?: string;\r\n  /** The glow lifting the closing ground off the base, low and centre. */\r\n  glowColor?: string;\r\n  /** How far that glow lifts it, 0–1. Above ~0.3 the ground stops reading black. */\r\n  glowStrength?: number;\r\n  /** Where the tagline settles once the white has swept through it. */\r\n  taglineColor?: string;\r\n  /**\r\n   * The eyebrow and the macro line, drawn white for the dark shots they sit\r\n   * on. With the shots' colours set to transparent — the scene as an overlay —\r\n   * they want ink that reads on whatever is under them.\r\n   */\r\n  inkColor?: string;\r\n  /**\r\n   * The mark the closing line is led by, as an SVG path drawn in a\r\n   * `0 0 100 100` box. Pass your own logo's path, or `\"\"` for no mark at all.\r\n   */\r\n  symbolPath?: string;\r\n  /**\r\n   * Gradient stops for the mark, spaced evenly from its first tip to the last.\r\n   * Two colours give a plain ramp, one a flat fill. A comma-separated string\r\n   * works too, which is what the customizer's text control passes. Defaults to\r\n   * the ten measured stops of the four-point spark.\r\n   */\r\n  symbolColors?: string[] | string;\r\n  /** Multiplier on the mark's size, in both the macro shot and the close. */\r\n  symbolScale?: number;\r\n  speed?: number;\r\n}\r\n\r\n/** The mark, resolved once and handed to both shots that draw it. */\r\ninterface SymbolStyle {\r\n  path: string;\r\n  colors: string[];\r\n  scale: number;\r\n}\r\n\r\n// --- The shot list ---------------------------------------------------------\r\n//\r\n// Four shots and three hard cuts, in composition frames at 30fps, measured off\r\n// the reference. Nothing crossfades and nothing is continuous across a cut: the\r\n// rush and the settle are two different shots of the same word, and the macro\r\n// shot is not a magnified frame of the closing one — its star travels *right*\r\n// while its type travels left, which the closing shot's never does.\r\n\r\nconst PLANE_OUT = 18;\r\nconst FIELD_OUT = 41;\r\nconst PAPER_OUT = 80;\r\nconst MACRO_OUT = 110;\r\n\r\n/** The reference is 802px wide; every measured px below is in those units. */\r\nconst REF_W = 802;\r\nconst REF_H = 450;\r\n\r\n// --- Motion ---------------------------------------------------------------\r\n\r\n/**\r\n * Every settle in this piece is the same curve: an exponential lag, fitted\r\n * frame by frame against the reference. The excess over the resting value\r\n * shrinks by a constant fraction per frame — 0.76 for the eyebrow's scale, 0.82\r\n * for the title words, 0.79 for the closing line — which is a first-order\r\n * approach, not any of the standard cubic-beziers.\r\n *\r\n * A raw exponential never arrives, and on a frame clock that tail is not a\r\n * settle, it is a run of identical frames. So it is normalised over a fixed\r\n * window: `settle` is 0 at `t = 0` and exactly 1 at `t = span`, keeping the\r\n * shape of the measured decay in between and leaving nothing to snap on the\r\n * last frame.\r\n */\r\nfunction settle(t: number, span: number, decay: number): number {\r\n  if (t <= 0) return 0;\r\n  if (t >= span) return 1;\r\n  return (1 - decay ** t) / (1 - decay ** span);\r\n}\r\n\r\nfunction clamp01(v: number): number {\r\n  return v < 0 ? 0 : v > 1 ? 1 : v;\r\n}\r\n\r\n/** Linear interpolation through a table of `[position, value]` samples. */\r\nfunction sample(table: readonly (readonly [number, number])[], p: number) {\r\n  if (p <= table[0][0]) return table[0][1];\r\n  const last = table[table.length - 1];\r\n  if (p >= last[0]) return last[1];\r\n  for (let i = 1; i < table.length; i++) {\r\n    const [x1, y1] = table[i];\r\n    if (p <= x1) {\r\n      const [x0, y0] = table[i - 1];\r\n      return y0 + ((y1 - y0) * (p - x0)) / (x1 - x0);\r\n    }\r\n  }\r\n  return last[1];\r\n}\r\n\r\n/**\r\n * Motion blur, done the way a camera does it: sample the shot several times\r\n * across the window the shutter is open and average the samples.\r\n *\r\n * Averaging is the whole trick. Stacking N copies at `1/N` opacity does *not*\r\n * average them — alpha compositing leaves the fully-overlapped core at\r\n * `1 - (1 - 1/N)^N`, about 63%, so white type comes out grey. Painting\r\n * back-to-front at `1, 1/2, 1/3 … 1/N` composites to the exact mean instead,\r\n * which is both correct and free.\r\n *\r\n * A directional `feGaussianBlur` would be cheaper but only smears along one\r\n * fixed axis, and neither blur here is axis-aligned: the opening rush is radial\r\n * (every point moves away from the vanishing point along its own line) and the\r\n * exit is staggered per letter. Sampling the real transform gets both for\r\n * nothing, and it gets the streak's density right too — a real streak is denser\r\n * where the subject dwelt.\r\n */\r\nfunction Shutter({\r\n  frame,\r\n  samples,\r\n  open,\r\n  children,\r\n}: {\r\n  frame: number;\r\n  /** Sub-frame samples. The streak reads as ghosts if they land >5px apart. */\r\n  samples: number;\r\n  /** Shutter window, in frames. 0.5 is a film shutter; longer smears harder. */\r\n  open: number;\r\n  children: (subFrame: number) => ReactNode;\r\n}) {\r\n  const layers: ReactNode[] = [];\r\n  const n = Math.max(2, Math.round(samples));\r\n  for (let i = 0; i < n; i++) {\r\n    // i = 0 is the oldest sample and sits at the back at full opacity; each\r\n    // newer one is laid over it at 1/(i+1). See the note above.\r\n    layers.push(\r\n      <AbsoluteFill key={i} style={{ opacity: 1 / (i + 1) }}>\r\n        {children(frame - open + (open * i) / (n - 1))}\r\n      </AbsoluteFill>,\r\n    );\r\n  }\r\n  return <>{layers}</>;\r\n}\r\n\r\n// --- Type -----------------------------------------------------------------\r\n\r\n/**\r\n * `geometricPrecision` is not a nicety here. Hinting bends each glyph's outline\r\n * so its stems land on whole pixels; as a size slides, every stem re-snaps to a\r\n * different grid and the letterforms change shape frame to frame. Measured on\r\n * the shape invariant that cannot change under a scale, a line's ink drifted\r\n * 3.41% with hinting on and 0.22% with it off. Every line in this piece is\r\n * either being scaled or being panned at 14x, so all of them need it.\r\n *\r\n * `willChange` is the opposite: right in the Player, wrong in the render. It\r\n * hands the scale to the compositor, which resamples a bitmap instead of\r\n * re-rasterising type — fine for one continuous tab with an 8ms budget, and\r\n * actively wrong across the parallel tabs a render is spread over, where each\r\n * tab inherits a stale raster from whatever scale it drew last.\r\n *\r\n * The tracking is measured, not taste. At the reference's cap heights the three\r\n * lines set to 183.7px, 230.4px and 693px of ink, and Google Sans at those cap\r\n * heights is wider than that — display type in the reference is tracked hard in,\r\n * body type barely at all.\r\n */\r\nfunction lineStyle(\r\n  fontSize: number,\r\n  tracking: number,\r\n  face: string,\r\n): CSSProperties {\r\n  return {\r\n    fontFamily: face,\r\n    fontSize,\r\n    fontWeight: 400,\r\n    lineHeight: 1,\r\n    letterSpacing: `${tracking}em`,\r\n    // CSS adds the tracking after the *last* character too, so a centred line\r\n    // sits half a gap off its ink centre. Cancel the space it never uses.\r\n    marginRight: `${-tracking}em`,\r\n    whiteSpace: \"pre\",\r\n    textRendering: \"geometricPrecision\",\r\n    ...(getRemotionEnvironment().isRendering\r\n      ? null\r\n      : { willChange: \"transform\" as const }),\r\n  };\r\n}\r\n\r\nconst EYEBROW_SIZE = 41.6 / REF_W;\r\nconst EYEBROW_TRACK = -0.0666;\r\nconst TITLE_SIZE = 41.3 / REF_W;\r\nconst TITLE_TRACK = -0.0563;\r\nconst TAGLINE_SIZE = 35 / REF_W;\r\nconst TAGLINE_TRACK = -0.015;\r\n\r\n/**\r\n * Distance from the vertical centre of a flex-centred line box down to the\r\n * text baseline, as a fraction of the font size. Google Sans's ascent and\r\n * descent are not symmetric about the em box, so a centred line does not put\r\n * its baseline on the frame's centre line; this is the measured difference.\r\n */\r\nconst BASELINE_DROP = 0.335;\r\n\r\n/** Baselines, measured: 236.87, 240.40 and 233.5 in reference px. */\r\nconst EYEBROW_BASELINE = 236.87 / REF_H;\r\nconst TITLE_BASELINE = 240.4 / REF_H;\r\nconst TAGLINE_BASELINE = 233.5 / REF_H;\r\n\r\n/**\r\n * A single line of the piece, placed by its baseline rather than by centring\r\n * its box. The three lines share a cap height to within 1% but sit on three\r\n * different baselines 3.5px apart, so centring cannot place all of them.\r\n */\r\nfunction Line({\r\n  children,\r\n  fontSize,\r\n  tracking,\r\n  baseline,\r\n  height,\r\n  style,\r\n}: {\r\n  children: ReactNode;\r\n  fontSize: number;\r\n  tracking: number;\r\n  /** Baseline position as a fraction of the frame height. */\r\n  baseline: number;\r\n  height: number;\r\n  style?: CSSProperties;\r\n}) {\r\n  const face = useKuchiTheme().fontFamily ?? SANS;\r\n  return (\r\n    <Stage offset={(baseline - 0.5) * height - BASELINE_DROP * fontSize}>\r\n      <div style={{ ...lineStyle(fontSize, tracking, face), ...style }}>\r\n        {children}\r\n      </div>\r\n    </Stage>\r\n  );\r\n}\r\n\r\n/**\r\n * Centres its child in the frame and then shifts it by `offset` px.\r\n *\r\n * The shift is a wrapper rather than a `top` on the fill, because an\r\n * `AbsoluteFill` keeps `bottom: 0` — moving its top edge shortens the box and\r\n * moves its centre by only half of what you asked for.\r\n */\r\nfunction Stage({\r\n  offset,\r\n  children,\r\n  align = \"center\",\r\n}: {\r\n  offset: number;\r\n  children: ReactNode;\r\n  align?: \"center\" | \"flex-start\";\r\n}) {\r\n  return (\r\n    <AbsoluteFill style={{ alignItems: align, justifyContent: \"center\" }}>\r\n      <div style={{ transform: `translateY(${offset}px)` }}>{children}</div>\r\n    </AbsoluteFill>\r\n  );\r\n}\r\n\r\n/**\r\n * Fit scales for the three lines, measured once behind `delayRender()`.\r\n *\r\n * Every measurement in this file was taken off one reference sentence, and a\r\n * font size fixed to it clips the moment somebody writes a longer one — the\r\n * default tagline here is one character longer than the reference's and 14%\r\n * wider, because \"Ready-made\" and \"Remotion,\" carry wider glyphs than \"Perfect\"\r\n * and \"massive\". A character count cannot see that; only layout can. So each\r\n * line is drawn once into a hidden probe, its real width read off it, and the\r\n * size scaled down if it would overrun its share of the frame. Lines that\r\n * already fit are left at exactly the measured size.\r\n *\r\n * `offsetWidth` is layout px and is untouched by the transforms these lines\r\n * later carry, which is what makes it the right tool here. The render is held\r\n * until the measurement has re-rendered, so frame 0 is never captured with the\r\n * wrong geometry.\r\n */\r\ninterface LineFit {\r\n  text: string;\r\n  fontSize: number;\r\n  tracking: number;\r\n  /** Widest this line may draw, in px. */\r\n  maxWidth: number;\r\n}\r\n\r\nfunction useFitScales(lines: LineFit[]): {\r\n  probes: ReactNode;\r\n  scales: number[];\r\n} {\r\n  // The probe measures in the same face the words paint in — a ruler in a\r\n  // different typeface fits the lines to the wrong width.\r\n  const face = useKuchiTheme().fontFamily ?? SANS;\r\n  const refs = useRef<(HTMLSpanElement | null)[]>([]);\r\n  const [handle] = useState(() => delayRender(\"announce-title: measure lines\"));\r\n  const [measured, setMeasured] = useState<{\r\n    key: string;\r\n    widths: number[];\r\n  } | null>(null);\r\n  const count = lines.length;\r\n  // Every input the measurement depends on. The `lines` array itself is a fresh\r\n  // object each render, so depending on it would re-measure forever.\r\n  const key = lines.map((l) => `${l.text}@${Math.round(l.fontSize)}`).join(\"|\");\r\n\r\n  useEffect(() => {\r\n    setMeasured({\r\n      key,\r\n      widths: Array.from(\r\n        { length: count },\r\n        (_, i) => refs.current[i]?.offsetWidth ?? 0,\r\n      ),\r\n    });\r\n  }, [key, count]);\r\n\r\n  useEffect(() => {\r\n    if (measured) continueRender(handle);\r\n  }, [measured, handle]);\r\n\r\n  const probes = (\r\n    <div\r\n      style={{\r\n        position: \"absolute\",\r\n        top: 0,\r\n        left: 0,\r\n        visibility: \"hidden\",\r\n        pointerEvents: \"none\",\r\n      }}\r\n    >\r\n      {lines.map((line, i) => (\r\n        <span\r\n          // biome-ignore lint/suspicious/noArrayIndexKey: positional slot\r\n          key={i}\r\n          ref={(el) => {\r\n            refs.current[i] = el;\r\n          }}\r\n          style={lineStyle(line.fontSize, line.tracking, face)}\r\n        >\r\n          {line.text}\r\n        </span>\r\n      ))}\r\n    </div>\r\n  );\r\n\r\n  // Stored with the key it was taken for, so a text change falls back to the\r\n  // measured default for one frame rather than scaling by a stale width.\r\n  const scales = lines.map((line, i) => {\r\n    const w = measured?.key === key ? measured.widths[i] : undefined;\r\n    return w && w > line.maxWidth ? line.maxWidth / w : 1;\r\n  });\r\n\r\n  return { probes, scales };\r\n}\r\n\r\n// --- The symbol -----------------------------------------------------------\r\n\r\n/**\r\n * The kuchi mark, the same outline `public/logo.svg` draws, refitted into the\r\n * `0 0 100 100` box this scene draws marks in. The ink fills 86% of the box\r\n * rather than all of it: a solid mark carries far more weight than the thin\r\n * four-point spark this replaced, and at a full-bleed fit it stopped reading as\r\n * an accent beside the line and started reading as a second subject.\r\n *\r\n * It is the default for `symbolPath`, not a fixture: any path drawn in the same\r\n * box drops straight in, and an empty one leaves the line bare.\r\n */\r\nexport const MARK_PATH =\r\n  \"M18.92 0H67.08Q86 0 86 18.92V67.08Q86 86 67.08 86H18.92Q0 86 0 67.08V18.92Q0 0 18.92 0Z\";\r\n\r\n/**\r\n * The default fill, as ten measured stops from the blue tip to the red one. It\r\n * is not a two-stop ramp in any colour space: sRGB is off by 70/255 and oklab by\r\n * 58/255, because the real ramp holds its blue flat and then collapses it.\r\n * Interpolating the measurements is both shorter and exact.\r\n *\r\n * `symbolColors` replaces it with any number of stops, spaced evenly — two\r\n * colours give a plain ramp, one gives a flat fill.\r\n */\r\nexport const SPARK_RAMP: readonly (readonly [number, string])[] = [\r\n  [0, \"#0365f3\"],\r\n  [0.17, \"#1c5cf1\"],\r\n  [0.31, \"#3a54ec\"],\r\n  [0.41, \"#554ce5\"],\r\n  [0.52, \"#7041cb\"],\r\n  [0.62, \"#9b3894\"],\r\n  [0.72, \"#ca3068\"],\r\n  [0.83, \"#e2284c\"],\r\n  [0.93, \"#e71d32\"],\r\n  [1, \"#e91927\"],\r\n];\r\n\r\n/**\r\n * The bloom is the mark's own gradient, blurred — not a flat halo. It reads\r\n * pink beside the red tip and blue beside the blue one, which a single colour\r\n * cannot do, and stacking it twice at two radii is what gets the falloff right:\r\n * the real one decays exponentially over about 1.9 radii, and one Gaussian is\r\n * 15/255 short of that at two radii while a tight one plus a wide one is not.\r\n * The two together also blow the mark's centre out to near-white, which is what\r\n * makes it read as a light source rather than a shape.\r\n */\r\nconst BLOOM_PASSES = [0.0825, 0.0315, 0.009, 0.009];\r\n\r\n/** Accepts an array or the comma-separated string the customizer passes. */\r\nfunction symbolColorList(colors?: string[] | string): string[] {\r\n  const list = typeof colors === \"string\" ? colors.split(\",\") : (colors ?? []);\r\n  return list.map((c) => c.trim()).filter(Boolean);\r\n}\r\n\r\n/** The stops to paint with: the measured ramp, or evenly-spaced overrides. */\r\nfunction symbolStops(colors: string[]): readonly (readonly [number, string])[] {\r\n  if (colors.length === 0) return SPARK_RAMP;\r\n  if (colors.length === 1)\r\n    return [\r\n      [0, colors[0]],\r\n      [1, colors[0]],\r\n    ];\r\n  return colors.map((c, i) => [i / (colors.length - 1), c] as const);\r\n}\r\n\r\nfunction Mark({\r\n  path,\r\n  colors,\r\n  size,\r\n  width,\r\n  rotation,\r\n  spread = 1,\r\n  id,\r\n}: {\r\n  /** Any path drawn in a `0 0 100 100` box. Empty draws nothing. */\r\n  path: string;\r\n  colors: string[];\r\n  size: number;\r\n  /** Frame width. The bloom is a lens artefact, so it is sized in frame px. */\r\n  width: number;\r\n  /** Degrees. At 0 the tips point N/E/S/W and the red one is up. */\r\n  rotation: number;\r\n  /**\r\n   * How much of the mark the ramp is spent across, as a fraction of its\r\n   * height. Below 1 the ends become plateaus and both tips read saturated,\r\n   * which is what the giant one does; 1 spends the whole ramp across the mark.\r\n   */\r\n  spread?: number;\r\n  id: string;\r\n}) {\r\n  if (!path) return null;\r\n  const stops = symbolStops(colors);\r\n  const edge = 0.5 + spread / 2;\r\n  // Bloom radii are fractions of the FRAME, converted into this mark's own\r\n  // viewBox units. Sized in the mark's units instead, the giant one would carry\r\n  // a blur the width of the screen and wash the whole shot out.\r\n  const blur = (f: number) => (f * width * 100) / size;\r\n  return (\r\n    <svg\r\n      viewBox=\"0 0 100 100\"\r\n      width={size}\r\n      height={size}\r\n      style={{\r\n        display: \"block\",\r\n        overflow: \"visible\",\r\n        transform: `rotate(${rotation}deg)`,\r\n      }}\r\n    >\r\n      <title>symbol</title>\r\n      <defs>\r\n        <linearGradient id={id} x1=\"0.5\" y1={edge} x2=\"0.5\" y2={1 - edge}>\r\n          {stops.map(([at, color]) => (\r\n            <stop key={at} offset={`${at * 100}%`} stopColor={color} />\r\n          ))}\r\n        </linearGradient>\r\n        {[...new Set(BLOOM_PASSES)].map((r) => (\r\n          <filter\r\n            key={r}\r\n            id={`${id}-${r}`}\r\n            x=\"-300%\"\r\n            y=\"-300%\"\r\n            width=\"700%\"\r\n            height=\"700%\"\r\n          >\r\n            <feGaussianBlur stdDeviation={blur(r)} />\r\n          </filter>\r\n        ))}\r\n      </defs>\r\n      {BLOOM_PASSES.map((r, i) => (\r\n        <path\r\n          // Four passes, widest first: the bloom is light being added, and\r\n          // alpha compositing can only ever darken toward the source. Screen is\r\n          // what makes a second pass brighten instead of repaint, and it is why\r\n          // the mark's centre blows out to near-white. One Gaussian cannot do\r\n          // this falloff — the real one decays exponentially over ~1.9 radii and\r\n          // is still lifting the ground four radii out.\r\n          // biome-ignore lint/suspicious/noArrayIndexKey: fixed pass order\r\n          key={i}\r\n          d={path}\r\n          fill={`url(#${id})`}\r\n          filter={`url(#${id}-${r})`}\r\n          style={{ mixBlendMode: \"screen\" }}\r\n        />\r\n      ))}\r\n      <path d={path} fill={`url(#${id})`} />\r\n    </svg>\r\n  );\r\n}\r\n\r\n// --- Shot 1: the receding plane -------------------------------------------\r\n\r\n/**\r\n * The eyebrow laid on a plane raked away from the viewer, rushing away from the\r\n * camera. Same construction as a static receding-type plane — `perspective` on\r\n * the stage and `rotateX` on the slab — with two things animated: the\r\n * magnification, and the rake, which flattens as the plane recedes and the lens\r\n * stops caring.\r\n *\r\n * The magnification is a measured table, not a curve. It does not decay at a\r\n * constant rate: it slows from 0.83 per frame to 0.90 around frame 12 and then\r\n * speeds back up to 0.77, the same decelerate-hold-accelerate shape the macro\r\n * shot's pan has. Nothing analytic fits that in a way worth defending, and\r\n * thirteen measurements interpolated are shorter than a fit anyway.\r\n *\r\n * The magnification is applied *outside* the perspective stage on purpose. Push\r\n * it in as translateZ and the rake's warp grows with it, so the first frames\r\n * fold into an unreadable wedge; kept outside, the warp is the rake's alone and\r\n * the frames match. It is also why the type is laid out large and scaled *down*\r\n * rather than small and scaled up — a browser rasterises a glyph at its layout\r\n * size, and a 30x magnification of a 60px glyph is a bitmap, not type.\r\n */\r\nconst PLANE_MAG: readonly (readonly [number, number])[] = [\r\n  [2, 52.6],\r\n  [3, 43.7],\r\n  [4, 36.3],\r\n  [5, 30.2],\r\n  [6, 25.1],\r\n  [7, 19.8],\r\n  [8, 16.1],\r\n  [9, 13.6],\r\n  [10, 11.75],\r\n  [11, 10.4],\r\n  [12, 9.3],\r\n  [13, 8.45],\r\n  [14, 7.5],\r\n  [15, 6.35],\r\n  [16, 5.2],\r\n  [17, 4.0],\r\n];\r\n/** Layout size of the plane's type, as a multiple of the eyebrow's own. */\r\nconst PLANE_BASE = 6;\r\nconst PLANE_PERSPECTIVE = 0.36;\r\n/**\r\n * Rake per frame, from the measured height of the plane's own vanishing line.\r\n * It starts nearly floor-like — the horizon is inside the frame until frame 8 —\r\n * and is flat by the cut. Read off `atan(perspective / |horizon - origin|)`.\r\n */\r\nconst PLANE_RAKE: readonly (readonly [number, number])[] = [\r\n  [5, 81],\r\n  [7, 68],\r\n  [9, 55],\r\n  [11, 41],\r\n  [13, 31],\r\n  [15, 20],\r\n  [17, 14],\r\n];\r\n\r\nfunction RecedingPlane({\r\n  text,\r\n  frame,\r\n  width,\r\n  height,\r\n  fontSize,\r\n  ink,\r\n}: {\r\n  text: string;\r\n  frame: number;\r\n  width: number;\r\n  height: number;\r\n  fontSize: number;\r\n  ink: string;\r\n}) {\r\n  const face = useKuchiTheme().fontFamily ?? SANS;\r\n  const mag = sample(PLANE_MAG, frame);\r\n  const rake = sample(PLANE_RAKE, frame);\r\n  return (\r\n    <Stage\r\n      offset={(EYEBROW_BASELINE - 0.5) * height - BASELINE_DROP * fontSize}\r\n    >\r\n      <div style={{ transform: `scale(${mag / PLANE_BASE})` }}>\r\n        <div\r\n          style={{\r\n            perspective: PLANE_PERSPECTIVE * width,\r\n            transformStyle: \"preserve-3d\",\r\n          }}\r\n        >\r\n          <div\r\n            style={{\r\n              ...lineStyle(fontSize * PLANE_BASE, EYEBROW_TRACK, face),\r\n              color: ink,\r\n              transform: `rotateX(${rake}deg)`,\r\n            }}\r\n          >\r\n            {text}\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </Stage>\r\n  );\r\n}\r\n\r\n// --- Shot 2: the eyebrow settles on the field -----------------------------\r\n\r\n/**\r\n * The same word, flat, finishing the move the rush started: 1.530x down to rest\r\n * at 0.7605 per frame, then torn off to the left.\r\n *\r\n * The scale pivots on the baseline. The glyph rasteriser gives each origin\r\n * quarter-pixel precision horizontally and none at all vertically, so a scale\r\n * that moves the baseline makes the type climb the pixel grid in whole-pixel\r\n * jumps — sit still, jump, sit still. Pivot on the baseline and its device Y\r\n * never changes, so there is nothing to snap.\r\n *\r\n * The reference pivots ~24px higher than that, which is a different bug wearing\r\n * a nicer face, so the difference is paid as an explicit translate instead: the\r\n * measured vertical motion, with the pivot that renders correctly.\r\n */\r\nconst EYEBROW_ENTER = 0.53;\r\nconst EYEBROW_DECAY = 0.7605;\r\nconst EYEBROW_SPAN = 18;\r\n/** Reference pivot, above the baseline, in ems of the eyebrow's own size. */\r\nconst PIVOT_LIFT = 23.87 / 41.6;\r\n\r\n/**\r\n * The exit. Displacement runs -2.1, -6.7, -18, -56, -222px on frames 35 to 39 —\r\n * an exponential run-up at about 3x per frame, leftward, with the blur trail\r\n * left behind it on the right. It is a rigid translate: the cap height and the\r\n * baseline are unchanged on the last frame anyone can measure, so nothing\r\n * stretches and nothing scales.\r\n *\r\n * It is also staggered across the word at about a fifth of a frame per letter,\r\n * which is what makes it read as the word being *pulled* rather than sliding:\r\n * by frame 38 the \"I\" has travelled 56px and the \"g\" five and a half.\r\n */\r\nconst EXIT_FROM = 35;\r\nconst EXIT_BASE = 3.2;\r\nconst EXIT_STEP = 2.1 / REF_W;\r\nconst EXIT_LETTER_DELAY = 0.215;\r\n\r\nfunction eyebrowExit(frame: number, letter: number, width: number): number {\r\n  const t = frame - EXIT_FROM - letter * EXIT_LETTER_DELAY;\r\n  if (t < 0) return 0;\r\n  return -EXIT_STEP * width * EXIT_BASE ** t;\r\n}\r\n\r\nfunction EyebrowLine({\r\n  text,\r\n  frame,\r\n  width,\r\n  height,\r\n  fontSize,\r\n  ink,\r\n}: {\r\n  text: string;\r\n  frame: number;\r\n  width: number;\r\n  height: number;\r\n  fontSize: number;\r\n  ink: string;\r\n}) {\r\n  const scale =\r\n    1 +\r\n    EYEBROW_ENTER *\r\n      (1 - settle(frame - PLANE_OUT, EYEBROW_SPAN, EYEBROW_DECAY));\r\n  const letters = [...text];\r\n  return (\r\n    <Line\r\n      fontSize={fontSize}\r\n      tracking={EYEBROW_TRACK}\r\n      baseline={EYEBROW_BASELINE}\r\n      height={height}\r\n      style={{\r\n        color: ink,\r\n        display: \"flex\",\r\n        transformOrigin: \"50% 100%\",\r\n        transform: `translateY(${PIVOT_LIFT * fontSize * (scale - 1)}px) scale(${scale})`,\r\n      }}\r\n    >\r\n      {letters.map((ch, i) => (\r\n        // Letters are positional slots, not identities — a repeated letter must\r\n        // still carry its own place in the stagger.\r\n        <span\r\n          // biome-ignore lint/suspicious/noArrayIndexKey: positional slot\r\n          key={i}\r\n          style={{ transform: `translateX(${eyebrowExit(frame, i, width)}px)` }}\r\n        >\r\n          {ch}\r\n        </span>\r\n      ))}\r\n    </Line>\r\n  );\r\n}\r\n\r\n// --- Shot 3: the title assembles ------------------------------------------\r\n\r\n/**\r\n * Each word of the title slides in from the right into a slot that is already\r\n * laid out and centred — the words never push each other around. All three\r\n * close their gap at the same 0.82 per frame, but the lead word travels 1.63x\r\n * as far as the two behind it, and the three are genuinely independent: on one\r\n * measured frame they move -2.4px, -4.6px and -22.2px.\r\n *\r\n * Each word also *pops* in at 29-46% opacity rather than fading from nothing,\r\n * and eases to full at 0.79 per frame. The chromaticity of the deficit is\r\n * constant the whole way, so it is alpha of the final violet — not a grey, not\r\n * a lighter hue.\r\n *\r\n * There is no motion blur on this shot. A word covers 27px between its first\r\n * two frames and is still crisp.\r\n */\r\nconst TITLE_DECAY = 0.82;\r\nconst TITLE_SPAN = 30;\r\nconst TITLE_ALPHA_DECAY = 0.79;\r\n/** Per word: [frame it appears, px it starts to the right, opacity it pops in at]. */\r\nconst TITLE_ENTRY: readonly (readonly [number, number, number])[] = [\r\n  [41, 143, 0.39],\r\n  [48, 87, 0.46],\r\n  [54, 88, 0.29],\r\n];\r\n\r\nfunction TitleLine({\r\n  words,\r\n  frame,\r\n  width,\r\n  height,\r\n  fontSize,\r\n  color,\r\n}: {\r\n  words: string[];\r\n  frame: number;\r\n  width: number;\r\n  height: number;\r\n  fontSize: number;\r\n  color: string;\r\n}) {\r\n  return (\r\n    <Line\r\n      fontSize={fontSize}\r\n      tracking={TITLE_TRACK}\r\n      baseline={TITLE_BASELINE}\r\n      height={height}\r\n      style={{ display: \"flex\", color }}\r\n    >\r\n      {words.map((word, i) => {\r\n        // Words past the third reuse the trailing word's entry, spaced by the\r\n        // same 6-frame stagger, so a longer title still assembles.\r\n        const extra = Math.max(0, i - (TITLE_ENTRY.length - 1));\r\n        const [at, travel, pop] = TITLE_ENTRY[i - extra];\r\n        const t = frame - at - extra * 6;\r\n        if (t < 0) return null;\r\n        const x =\r\n          ((travel * width) / REF_W) * (1 - settle(t, TITLE_SPAN, TITLE_DECAY));\r\n        return (\r\n          <span\r\n            // biome-ignore lint/suspicious/noArrayIndexKey: positional slot\r\n            key={i}\r\n            style={{\r\n              opacity: 1 - (1 - pop) * TITLE_ALPHA_DECAY ** t,\r\n              transform: `translateX(${x}px)`,\r\n            }}\r\n          >\r\n            {i === 0 ? word : ` ${word}`}\r\n          </span>\r\n        );\r\n      })}\r\n    </Line>\r\n  );\r\n}\r\n\r\n// --- The closing ground ---------------------------------------------------\r\n\r\n/**\r\n * Both closing shots share one ground: a flat near-black navy with a single\r\n * broad glow sitting low and centre. Fitted against an 81-point grid, the worst\r\n * error is 2.4/255 — there is no second glow, no red component and no motion.\r\n * The apparently different ground under the macro shot is this same glow seen\r\n * at that shot's magnification.\r\n */\r\nfunction nightGround(glow: string, strength: number): string {\r\n  const [r, g, b] = hexToRgb(glow);\r\n  return `radial-gradient(circle ${((500 / REF_W) * 100).toFixed(\r\n    1,\r\n  )}% at 50% 68%, rgba(${r},${g},${b},${strength}), transparent)`;\r\n}\r\n\r\n// --- Shot 4: the macro pan ------------------------------------------------\r\n\r\n/**\r\n * A macro shot of the closing line's middle, panning left. The velocity is a\r\n * settle and a launch overlapping — it decelerates from 52px/frame to 9 at the\r\n * hold, then accelerates away to 105 by the last frame — and integrating that\r\n * pair of exponentials is what places the type.\r\n *\r\n * The star crosses the other way at the same speed, which is the whole reason\r\n * this is a separate composition rather than a magnified frame of the closing\r\n * shot: at this magnification the closing shot's star would be six frame widths\r\n * off to the right.\r\n */\r\nconst MACRO_SIZE = 487 / REF_W;\r\nconst MACRO_BASELINE = 347 / REF_H;\r\nconst MACRO_HOLD = 90;\r\n/** ∫16.6·0.81^t and ∫1.37·1.255^t, the fitted settle and launch. */\r\nfunction macroPan(frame: number): number {\r\n  const t = frame - MACRO_HOLD;\r\n  return -(78.8 * (1 - 0.81 ** t) + 6.03 * (1.255 ** t - 1));\r\n}\r\n/**\r\n * Where along the line the frame centre sits at the hold, as a fraction of the\r\n * line rather than a pixel offset — the reference holds on the middle of its\r\n * sentence, and a pixel offset would land mid-word on any other one.\r\n */\r\nconst MACRO_ANCHOR = 0.505;\r\nconst MACRO_STAR_AT_HOLD = 565 / REF_W;\r\nconst MACRO_STAR_SIZE = 1.255;\r\nconst MACRO_STAR_SPIN = 2.9;\r\n/** The mark crosses the other way at the same speed, and rides low. */\r\nconst MACRO_STAR_Y = 60 / REF_H;\r\n/** The giant mark spends its ramp over two thirds of itself, so both tips\r\n *  reach full saturation inside the frame instead of holding at the midpoint. */\r\nconst MACRO_STAR_SPREAD = 0.55;\r\n\r\nfunction MacroShot({\r\n  tagline,\r\n  symbol,\r\n  frame,\r\n  width,\r\n  height,\r\n  ink,\r\n}: {\r\n  tagline: string;\r\n  symbol: SymbolStyle;\r\n  frame: number;\r\n  width: number;\r\n  height: number;\r\n  ink: string;\r\n}) {\r\n  const face = useKuchiTheme().fontFamily ?? SANS;\r\n  const pan = (macroPan(frame) * width) / REF_W;\r\n  const fontSize = MACRO_SIZE * width;\r\n  return (\r\n    <>\r\n      <Stage\r\n        align=\"flex-start\"\r\n        offset={(MACRO_BASELINE - 0.5) * height - BASELINE_DROP * fontSize}\r\n      >\r\n        <div\r\n          style={{\r\n            ...lineStyle(fontSize, TAGLINE_TRACK, face),\r\n            color: ink,\r\n            // The percentage is of the line's own width, so the hold lands on\r\n            // the same part of any sentence; the px is the camera.\r\n            transform: `translateX(${width / 2 + pan}px) translateX(${-MACRO_ANCHOR * 100}%)`,\r\n          }}\r\n        >\r\n          {tagline}\r\n        </div>\r\n      </Stage>\r\n      <AbsoluteFill style={{ alignItems: \"center\", justifyContent: \"center\" }}>\r\n        <div\r\n          style={{\r\n            transform: `translate(${(MACRO_STAR_AT_HOLD - 0.5) * width - pan}px, ${MACRO_STAR_Y * height}px)`,\r\n          }}\r\n        >\r\n          <Mark\r\n            path={symbol.path}\r\n            colors={symbol.colors}\r\n            size={MACRO_STAR_SIZE * symbol.scale * width}\r\n            width={width}\r\n            rotation={MACRO_STAR_SPIN * (frame - MACRO_HOLD) - 50}\r\n            spread={MACRO_STAR_SPREAD}\r\n            id=\"announce-title-macro-symbol\"\r\n          />\r\n        </div>\r\n      </AbsoluteFill>\r\n    </>\r\n  );\r\n}\r\n\r\n// --- Shot 5: the closing line ---------------------------------------------\r\n\r\n/**\r\n * The line arrives whole-word at a time from the right end backwards, while the\r\n * group slides right into place at 0.792 per frame. Words do not fade: each one\r\n * is simply there, at full opacity, on its frame.\r\n *\r\n * The colour is one gradient fixed in the line's own coordinates — crimson at\r\n * the left end, blue at the right — with a white wipe crossing it left to right\r\n * at 31.7px/frame. That the tint is fixed to the *text* and the wipe is fixed to\r\n * the *clock* is the measurable part: a column 131px ahead of the wipe reads\r\n * violet on one frame and blue on another, so neither can be keyed to the other.\r\n *\r\n * The word that appears last is already white, because the wipe crossed its\r\n * ground four frames before it existed.\r\n */\r\nconst TAGLINE_TRAVEL = 417 / REF_W;\r\nconst TAGLINE_DECAY = 0.792;\r\nconst TAGLINE_SPAN = 30;\r\n// Half a frame early, so every word crosses its threshold on the frame the\r\n// reference shows it rather than the one after.\r\nconst TAGLINE_FIRST = 111.5;\r\nconst TAGLINE_STAGGER = 2.833;\r\n/** Ink extent of the settled line, in reference px — the wipe's coordinates. */\r\nconst TAGLINE_INK = 693;\r\nconst WIPE_START = 124.6;\r\nconst WIPE_SPEED = 31.7 / TAGLINE_INK;\r\nconst WIPE_EDGE = 165 / TAGLINE_INK;\r\n\r\n/** The tint, measured across the settled line and read as line-local stops. */\r\nconst TINT_RAMP: readonly (readonly [number, string])[] = [\r\n  [0, \"#8a2447\"],\r\n  [0.24, \"#842647\"],\r\n  [0.33, \"#722e57\"],\r\n  [0.5, \"#58406d\"],\r\n  [0.66, \"#434e90\"],\r\n  [0.76, \"#3654ab\"],\r\n  [0.85, \"#2f5ed1\"],\r\n  [1, \"#3266e5\"],\r\n];\r\n\r\nfunction hexToRgb(hex: string): [number, number, number] {\r\n  const n = Number.parseInt(hex.slice(1), 16);\r\n  return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\r\n}\r\n\r\n/**\r\n * The tint and the wipe as one paint. Two stacked layers would need the tint\r\n * layer masked by the wipe, and a mask on `background-clip: text` is a second\r\n * clip the renderer has to resolve per frame; a dozen interpolated stops is one\r\n * paint and costs nothing.\r\n */\r\nfunction taglineFill(front: number, rest: string): string {\r\n  const [rr, rg, rb] = hexToRgb(rest);\r\n  const stops: string[] = [];\r\n  const n = 14;\r\n  for (let i = 0; i <= n; i++) {\r\n    const p = i / n;\r\n    let below = TINT_RAMP[0];\r\n    let above = TINT_RAMP[TINT_RAMP.length - 1];\r\n    for (let j = 1; j < TINT_RAMP.length; j++) {\r\n      if (p <= TINT_RAMP[j][0]) {\r\n        below = TINT_RAMP[j - 1];\r\n        above = TINT_RAMP[j];\r\n        break;\r\n      }\r\n    }\r\n    const span = above[0] - below[0];\r\n    const local = span > 0 ? (p - below[0]) / span : 0;\r\n    const [r0, g0, b0] = hexToRgb(below[1]);\r\n    const [r1, g1, b1] = hexToRgb(above[1]);\r\n    const drained = clamp01((front - p) / WIPE_EDGE + 0.5);\r\n    const mix = (a: number, b: number, target: number) =>\r\n      Math.round((a + (b - a) * local) * (1 - drained) + target * drained);\r\n    stops.push(\r\n      `rgb(${mix(r0, r1, rr)},${mix(g0, g1, rg)},${mix(b0, b1, rb)}) ${(p * 100).toFixed(1)}%`,\r\n    );\r\n  }\r\n  return `linear-gradient(90deg, ${stops.join(\", \")})`;\r\n}\r\n\r\n/** The star's own travel and exit, both measured on its centre and its radius. */\r\nconst STAR_REST_X = 781.4 / REF_W;\r\nconst STAR_REST_Y = 227 / REF_H;\r\nconst STAR_SIZE = 60 / REF_W;\r\n/**\r\n * The mark barely turns: it arrives a touch off square and squares up as it\r\n * settles. An earlier read of a full 270° spin was the 4-fold symmetry fooling\r\n * a harmonic fit — every frame of the reference has its red tip up.\r\n */\r\nconst STAR_TURN = 30;\r\nconst STAR_EXIT = 134;\r\nconst STAR_GONE = 139;\r\n\r\nfunction ClosingShot({\r\n  words,\r\n  symbol,\r\n  frame,\r\n  width,\r\n  height,\r\n  fontSize,\r\n  rest,\r\n}: {\r\n  words: string[];\r\n  symbol: SymbolStyle;\r\n  frame: number;\r\n  width: number;\r\n  height: number;\r\n  fontSize: number;\r\n  rest: string;\r\n}) {\r\n  const slide =\r\n    -TAGLINE_TRAVEL *\r\n    width *\r\n    (1 - settle(frame - MACRO_OUT, TAGLINE_SPAN, TAGLINE_DECAY));\r\n  const front = WIPE_SPEED * (frame - WIPE_START);\r\n  const starLife = 1 - clamp01((frame - STAR_EXIT) / (STAR_GONE - STAR_EXIT));\r\n  return (\r\n    <>\r\n      <Line\r\n        fontSize={fontSize}\r\n        tracking={TAGLINE_TRACK}\r\n        baseline={TAGLINE_BASELINE}\r\n        height={height}\r\n        style={{\r\n          display: \"flex\",\r\n          transform: `translateX(${slide}px)`,\r\n          backgroundImage: taglineFill(front, rest),\r\n          backgroundClip: \"text\",\r\n          WebkitBackgroundClip: \"text\",\r\n          color: \"transparent\",\r\n        }}\r\n      >\r\n        {words.map((word, i) => (\r\n          <span\r\n            // biome-ignore lint/suspicious/noArrayIndexKey: positional slot\r\n            key={i}\r\n            style={{\r\n              visibility:\r\n                frame >=\r\n                TAGLINE_FIRST + (words.length - 1 - i) * TAGLINE_STAGGER\r\n                  ? \"visible\"\r\n                  : \"hidden\",\r\n            }}\r\n          >\r\n            {i === 0 ? word : ` ${word}`}\r\n          </span>\r\n        ))}\r\n      </Line>\r\n      {starLife > 0 && (\r\n        <Stage offset={(STAR_REST_Y - 0.5) * height}>\r\n          <div\r\n            style={{\r\n              transform: `translateX(${(STAR_REST_X - 0.5) * width + slide}px) scale(${starLife})`,\r\n              opacity: starLife,\r\n            }}\r\n          >\r\n            <Mark\r\n              path={symbol.path}\r\n              colors={symbol.colors}\r\n              size={STAR_SIZE * symbol.scale * width}\r\n              width={width}\r\n              rotation={\r\n                -STAR_TURN *\r\n                (1 - settle(frame - MACRO_OUT, TAGLINE_SPAN, TAGLINE_DECAY))\r\n              }\r\n              id=\"announce-title-symbol\"\r\n            />\r\n          </div>\r\n        </Stage>\r\n      )}\r\n    </>\r\n  );\r\n}\r\n\r\n// --- The piece ------------------------------------------------------------\r\n\r\nexport function AnnounceTitle({\r\n  eyebrow = \"Introducing\",\r\n  title = \"kuchi 1.0\",\r\n  tagline = \"Ready-made scenes for Remotion, in one command.\",\r\n  voidColor = \"#100022\",\r\n  fieldColor = \"#5600f5\",\r\n  paperColor = \"#fcfcfa\",\r\n  titleColor = \"#4800c9\",\r\n  nightColor = \"#000028\",\r\n  glowColor = \"#08ff4b\",\r\n  glowStrength = 0.139,\r\n  taglineColor = \"#f2f8ff\",\r\n  inkColor = \"#ffffff\",\r\n  symbolPath = MARK_PATH,\r\n  symbolColors,\r\n  symbolScale = 1,\r\n  fontFamily,\r\n  speed = 1,\r\n}: AnnounceTitleProps) {\r\n  const face = resolveFont(fontFamily) ?? SANS;\r\n  const frame = useCurrentFrame() * speed;\r\n  const { width, height } = useVideoConfig();\r\n\r\n  const symbol: SymbolStyle = {\r\n    path: symbolPath,\r\n    colors: symbolColorList(symbolColors),\r\n    scale: symbolScale,\r\n  };\r\n  const titleWords = title.split(/\\s+/).filter(Boolean);\r\n  const taglineWords = tagline.split(/\\s+/).filter(Boolean);\r\n\r\n  // Widest each line may draw, as a share of the frame. The eyebrow's is the\r\n  // tightest because it enters at 1.53x, so its resting width is what has to\r\n  // leave room; the tagline's sits just above the reference's own 0.864, so the\r\n  // sentence everything was measured against is never scaled at all.\r\n  const { probes, scales } = useFitScales([\r\n    {\r\n      text: eyebrow,\r\n      fontSize: EYEBROW_SIZE * width,\r\n      tracking: EYEBROW_TRACK,\r\n      maxWidth: 0.55 * width,\r\n    },\r\n    {\r\n      text: title,\r\n      fontSize: TITLE_SIZE * width,\r\n      tracking: TITLE_TRACK,\r\n      maxWidth: 0.8 * width,\r\n    },\r\n    {\r\n      text: tagline,\r\n      fontSize: TAGLINE_SIZE * width,\r\n      tracking: TAGLINE_TRACK,\r\n      maxWidth: 0.88 * width,\r\n    },\r\n  ]);\r\n  const eyebrowSize = EYEBROW_SIZE * width * scales[0];\r\n  const titleSize = TITLE_SIZE * width * scales[1];\r\n  const taglineSize = TAGLINE_SIZE * width * scales[2];\r\n\r\n  const shot = () => {\r\n    if (frame < PLANE_OUT) {\r\n      return (\r\n        <AbsoluteFill style={{ backgroundColor: voidColor }}>\r\n          {/* A full-frame shutter, sampled twenty times: by the last frames the\r\n              outer letters cover 90px between one frame and the next, and at ten\r\n              samples that is a row of ghosts rather than a streak. */}\r\n          <Shutter frame={frame} samples={20} open={1}>\r\n            {(f) => (\r\n              <RecedingPlane\r\n                text={eyebrow}\r\n                frame={f}\r\n                width={width}\r\n                height={height}\r\n                fontSize={eyebrowSize}\r\n                ink={inkColor}\r\n              />\r\n            )}\r\n          </Shutter>\r\n        </AbsoluteFill>\r\n      );\r\n    }\r\n\r\n    if (frame < FIELD_OUT) {\r\n      // The exit covers 200px on its last frame; sampled at a film shutter that\r\n      // is a row of ghosts, so the sample count follows the distance travelled.\r\n      const travel = Math.abs(eyebrowExit(frame, 0, width));\r\n      return (\r\n        <AbsoluteFill style={{ backgroundColor: fieldColor }}>\r\n          <Shutter\r\n            frame={frame}\r\n            samples={Math.min(44, Math.max(6, travel / 4))}\r\n            open={travel > 0 ? 1 : 0.5}\r\n          >\r\n            {(f) => (\r\n              <EyebrowLine\r\n                text={eyebrow}\r\n                frame={f}\r\n                width={width}\r\n                height={height}\r\n                fontSize={eyebrowSize}\r\n                ink={inkColor}\r\n              />\r\n            )}\r\n          </Shutter>\r\n        </AbsoluteFill>\r\n      );\r\n    }\r\n\r\n    if (frame < PAPER_OUT) {\r\n      return (\r\n        <AbsoluteFill style={{ backgroundColor: paperColor }}>\r\n          <TitleLine\r\n            words={titleWords}\r\n            frame={frame}\r\n            width={width}\r\n            height={height}\r\n            fontSize={titleSize}\r\n            color={titleColor}\r\n          />\r\n        </AbsoluteFill>\r\n      );\r\n    }\r\n\r\n    return (\r\n      <AbsoluteFill\r\n        style={{\r\n          backgroundColor: nightColor,\r\n          backgroundImage: nightGround(glowColor, glowStrength),\r\n        }}\r\n      >\r\n        {frame < MACRO_OUT ? (\r\n          <MacroShot\r\n            tagline={tagline}\r\n            symbol={symbol}\r\n            frame={frame}\r\n            width={width}\r\n            height={height}\r\n            ink={inkColor}\r\n          />\r\n        ) : (\r\n          <ClosingShot\r\n            words={taglineWords}\r\n            symbol={symbol}\r\n            frame={frame}\r\n            width={width}\r\n            height={height}\r\n            fontSize={taglineSize}\r\n            rest={taglineColor}\r\n          />\r\n        )}\r\n      </AbsoluteFill>\r\n    );\r\n  };\r\n\r\n  return (\r\n    <KuchiUIProvider theme={{ fontFamily: face }}>\r\n      <AbsoluteFill>\r\n        {probes}\r\n        {shot()}\r\n      </AbsoluteFill>\r\n    </KuchiUIProvider>\r\n  );\r\n}\r\n"}]}