{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "word-stack",
  "title": "Word Stack",
  "description": "Caps words stack in a tight poster, the last one swapped for a serif gradient italic.",
  "dependencies": ["remotion"],
  "files": [
    {
      "path": "registry/remocn/word-stack/index.tsx",
      "content": "\"use client\";\n\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nexport interface WordStackProps {\n  words?: string[];\n  accent?: string;\n  theme?: \"dark\" | \"light\";\n  speed?: number;\n}\n\n// [advance, inkLeft, inkRight, inkTop, inkBottom, outline] per 1000 em,\n// baseline at y = 0, y down. Overlaps removed (fontTools + skia-pathops).\ntype Glyph = readonly [number, number, number, number, number, string];\n\nconst GLYPHS: Record<string, Glyph> = {\n  A: [\n    710,\n    8,\n    702,\n    703,\n    0,\n    \"M8 0 298 -703H414L702 0H590L505 -220H206L121 0ZM472 -306 355 -606 239 -306Z\",\n  ],\n  B: [\n    654,\n    77,\n    614,\n    703,\n    0,\n    \"M77 0V-703H357Q465 -703 527 -660Q588 -618 588 -536Q588 -485 566 -452Q544 -419 510 -402Q479 -386 446 -381Q520 -367 566 -322Q614 -275 614 -190Q614 -120 581 -78Q548 -36 493 -18Q439 0 374 0ZM182 -84H367Q422 -84 453 -103Q483 -121 496 -149Q508 -178 508 -209Q508 -252 488 -281Q468 -310 431 -324Q394 -338 340 -338H182ZM182 -421H351Q406 -421 443 -444Q480 -467 480 -521Q480 -564 451 -591Q422 -619 355 -619H182Z\",\n  ],\n  C: [\n    707,\n    41,\n    676,\n    715,\n    12,\n    \"M377 12Q276 12 200 -34Q125 -81 83 -164Q41 -246 41 -354Q41 -460 81 -541Q122 -623 197 -669Q271 -715 376 -715Q485 -715 565 -659Q645 -604 671 -492L562 -466Q542 -549 493 -588Q443 -628 375 -628Q305 -628 255 -593Q206 -557 179 -495Q153 -433 153 -352Q153 -270 180 -207Q207 -145 256 -110Q305 -75 372 -75Q444 -75 496 -118Q548 -162 563 -239L676 -211Q647 -103 567 -45Q486 12 377 12Z\",\n  ],\n  D: [\n    708,\n    77,\n    665,\n    703,\n    0,\n    \"M77 0V-703H305Q429 -703 509 -661Q589 -620 627 -542Q665 -463 665 -355Q665 -236 621 -157Q577 -78 495 -39Q413 0 299 0ZM182 -87H289Q553 -87 553 -352Q553 -433 526 -492Q500 -552 443 -584Q386 -616 294 -616H182Z\",\n  ],\n  E: [\n    591,\n    77,\n    556,\n    703,\n    0,\n    \"M77 0V-703H549V-616H182V-416H501V-330H182V-87H556V0Z\",\n  ],\n  F: [567, 77, 539, 703, 0, \"M77 0V-703H539V-616H182V-417H501V-330H182V0Z\"],\n  G: [\n    721,\n    42,\n    670,\n    715,\n    12,\n    \"M392 12Q276 12 198 -34Q121 -81 81 -162Q42 -244 42 -350Q42 -458 81 -540Q121 -622 196 -669Q271 -715 376 -715Q447 -715 508 -692Q568 -668 610 -620Q653 -573 670 -500L559 -474Q543 -554 494 -591Q445 -628 376 -628Q306 -628 256 -593Q207 -558 180 -494Q154 -431 154 -346Q154 -271 177 -209Q200 -148 251 -112Q302 -75 387 -75Q437 -75 486 -91Q535 -106 571 -149V-279H344V-366H669V-112Q630 -59 581 -32Q531 -5 482 3Q432 12 392 12Z\",\n  ],\n  H: [\n    729,\n    77,\n    651,\n    703,\n    0,\n    \"M77 0V-703H182V-404H547V-703H651V0H547V-317H182V0Z\",\n  ],\n  I: [\n    373,\n    40,\n    333,\n    703,\n    0,\n    \"M40 0V-83H134V-620H40V-703H333V-620H239V-83H333V0Z\",\n  ],\n  J: [\n    550,\n    23,\n    482,\n    703,\n    12,\n    \"M262 12Q194 12 145 -10Q96 -32 65 -74Q35 -117 23 -179L132 -208Q141 -142 170 -108Q199 -74 262 -74Q320 -74 348 -105Q377 -136 377 -205V-616H115V-703H482V-205Q482 -148 466 -107Q450 -66 421 -40Q392 -14 352 -1Q312 12 262 12Z\",\n  ],\n  K: [\n    678,\n    77,\n    657,\n    703,\n    0,\n    \"M77 0V-703H182V-387L510 -703H647L381 -445L657 0H532L303 -371L182 -254V0Z\",\n  ],\n  L: [555, 77, 530, 703, 0, \"M77 0V-703H182V-87H530V0Z\"],\n  M: [\n    886,\n    58,\n    829,\n    703,\n    0,\n    \"M58 0 97 -703H269L443 -106L618 -703H790L829 0H727L694 -622L504 0H383L192 -622L159 0Z\",\n  ],\n  N: [\n    739,\n    77,\n    662,\n    703,\n    0,\n    \"M77 0V-703H225L561 -116V-703H662V0H523L178 -590V0Z\",\n  ],\n  O: [\n    769,\n    42,\n    728,\n    715,\n    12,\n    \"M385 12Q279 12 202 -32Q125 -76 83 -158Q42 -240 42 -352Q42 -464 83 -545Q125 -626 202 -671Q279 -715 385 -715Q490 -715 567 -671Q645 -626 686 -545Q728 -464 728 -352Q728 -240 686 -158Q645 -76 567 -32Q490 12 385 12ZM384 -75Q456 -75 508 -109Q560 -142 587 -204Q615 -267 615 -352Q615 -437 587 -499Q560 -561 508 -594Q456 -628 384 -628Q313 -628 261 -594Q209 -561 182 -499Q154 -437 154 -352Q154 -267 182 -204Q209 -142 261 -109Q313 -75 384 -75Z\",\n  ],\n  P: [\n    630,\n    77,\n    597,\n    703,\n    0,\n    \"M77 0V-703H350Q474 -703 535 -652Q597 -601 597 -503Q597 -408 534 -356Q472 -304 344 -304H182V0ZM182 -389H348Q417 -389 454 -419Q491 -449 491 -502Q491 -550 458 -584Q424 -619 347 -619H182Z\",\n  ],\n  Q: [\n    769,\n    42,\n    728,\n    715,\n    154,\n    \"M425 154Q387 154 361 131Q335 108 335 71V9Q260 1 202 -32Q125 -76 83 -158Q42 -240 42 -352Q42 -464 83 -545Q125 -626 202 -671Q279 -715 385 -715Q490 -715 567 -671Q645 -626 686 -545Q728 -464 728 -352Q728 -240 686 -158Q645 -76 567 -32Q509 1 433 9V47Q433 63 438 68Q442 74 458 74H538V154ZM384 -75Q456 -75 508 -109Q560 -142 587 -204Q615 -267 615 -352Q615 -437 587 -499Q560 -561 508 -594Q456 -628 384 -628Q313 -628 261 -594Q209 -561 182 -499Q154 -437 154 -352Q154 -267 182 -204Q209 -142 261 -109Q313 -75 384 -75Z\",\n  ],\n  R: [\n    648,\n    77,\n    611,\n    703,\n    0,\n    \"M77 0V-703H362Q608 -703 608 -513Q608 -354 433 -327L611 0H493L318 -322H182V0ZM182 -406H360Q428 -406 465 -433Q502 -460 502 -512Q502 -563 465 -591Q428 -619 359 -619H182Z\",\n  ],\n  S: [\n    623,\n    29,\n    582,\n    715,\n    12,\n    \"M323 12Q243 12 181 -14Q119 -41 80 -92Q41 -143 29 -216L147 -240Q151 -159 195 -116Q240 -74 320 -74Q370 -74 403 -89Q437 -104 453 -132Q470 -160 470 -196Q470 -247 439 -272Q409 -297 356 -308L270 -327Q242 -333 207 -344Q172 -354 140 -375Q108 -396 87 -430Q66 -465 66 -519Q66 -587 102 -630Q137 -673 194 -694Q251 -715 318 -715Q391 -715 445 -692Q500 -669 533 -626Q567 -583 579 -523L462 -499Q458 -541 441 -569Q424 -598 394 -614Q363 -629 315 -629Q276 -629 244 -618Q212 -606 193 -583Q173 -561 173 -525Q173 -485 204 -461Q234 -438 299 -424L387 -404Q436 -393 481 -371Q526 -348 554 -307Q582 -267 582 -200Q582 -133 550 -85Q519 -38 460 -13Q402 12 323 12Z\",\n  ],\n  T: [656, 24, 631, 703, 0, \"M275 0V-616H24V-703H631V-616H380V0Z\"],\n  U: [\n    685,\n    65,\n    620,\n    703,\n    12,\n    \"M342 12Q257 12 195 -19Q133 -51 99 -109Q65 -167 65 -247V-703H170V-254Q170 -171 216 -123Q262 -75 342 -75Q423 -75 469 -123Q515 -171 515 -256V-703H620V-247Q620 -167 586 -109Q553 -51 490 -19Q428 12 342 12Z\",\n  ],\n  V: [688, 21, 667, 703, 0, \"M283 0 21 -703H134L345 -95L554 -703H667L405 0Z\"],\n  W: [\n    955,\n    27,\n    928,\n    703,\n    0,\n    \"M177 0 27 -703H133L253 -84L417 -703H539L702 -84L822 -703H928L777 0H626L477 -588L328 0Z\",\n  ],\n  X: [\n    675,\n    21,\n    655,\n    703,\n    0,\n    \"M21 0 272 -365 31 -703H157L337 -434L515 -703H636L398 -362L655 0H524L333 -284L145 0Z\",\n  ],\n  Y: [\n    633,\n    19,\n    614,\n    703,\n    0,\n    \"M264 0V-284L19 -703H129L317 -373L503 -703H614L369 -284V0Z\",\n  ],\n  Z: [\n    606,\n    28,\n    572,\n    703,\n    0,\n    \"M28 0V-67L439 -613H62V-703H569V-635L160 -90H572V0Z\",\n  ],\n};\nconst KERN_PAIRS =\n  \"AA30 AC-23 AG-23 AI6 AM6 AO-23 AQ-23 AT-109 AU-18 AV-91 AW-46 AX9 AY-90 AZ18 BB9 BC18 BD9 BE9 BF9 BG18 BH9 BK9 BL9 BM10 BN9 BO18 BP9 BQ18 BR9 BS19 BT-26 BU15 BV-13 BX-12 BY-26 CA-3 CC6 CG6 CI-13 CO6 CQ6 CS18 CT-28 CU5 CV-12 CX-22 CY-24 CZ-10 DA-22 DC27 DG27 DI-5 DJ-16 DO27 DQ27 DS5 DT-46 DU9 DV-29 DW-4 DX-33 DY-40 DZ-26 EC-19 EG-19 EI10 EJ-13 EO-19 EQ-19 ES-9 ET4 EX5 EZ7 FA-81 FC-10 FG-10 FJ-34 FM-8 FO-10 FQ-10 FS-18 FT11 FV11 FW9 FX-3 FZ-5 GB7 GC18 GD7 GE7 GF7 GG18 GH7 GK7 GL7 GM8 GN7 GO18 GP7 GQ18 GR7 GS15 GT-34 GU9 GV-17 GX-14 GY-32 HJ-6 HT-5 HU10 HW4 HY-12 IA6 IC-5 IG-5 II30 IJ-4 IO-5 IQ-5 IS-3 IU10 IW5 IX3 IZ4 JA-12 JB8 JC8 JD8 JE8 JF8 JG8 JH8 JI7 JJ-7 JK8 JL8 JN8 JO8 JP8 JQ8 JR8 JS9 JU19 JW10 JX-3 JY-7 JZ-3 KA10 KC-36 KG-36 KJ-12 KO-36 KQ-36 KS-17 KT-5 KU-4 KV-4 KX4 KY-4 KZ11 LA9 LB-18 LC-48 LD-18 LE-18 LF-18 LG-48 LH-18 LJ-17 LK-18 LL-18 LM-9 LN-18 LO-48 LP-18 LQ-48 LR-18 LS-32 LT-138 LU-45 LV-126 LW-68 LY-129 LZ5 MA6 MM7 MS7 MT-17 MV-11 MY-19 NJ-6 NT-5 NU10 NW4 NY-12 OA-22 OC27 OG27 OI-5 OJ-16 OO27 OQ27 OS5 OT-46 OU9 OV-29 OW-4 OX-33 OY-40 OZ-26 PA-84 PC10 PG10 PI-6 PJ-58 PO10 PQ10 PT-18 PU11 PW14 PX-25 PY-9 PZ-32 QA-22 QC27 QG27 QI-5 QJ-16 QO27 QQ27 QS5 QT-46 QU9 QV-29 QW-4 QX-33 QY-40 QZ-26 RB7 RC9 RD7 RE7 RF7 RG9 RH7 RJ-17 RK7 RL7 RM12 RN7 RO9 RP7 RQ9 RR7 RS6 RT-16 RU10 RW11 RY-11 SB6 SC14 SD6 SE6 SF6 SG14 SH6 SK6 SL6 SM11 SN6 SO14 SP6 SQ14 SR6 SS20 ST-18 SU13 SV-6 SX-12 SY-24 TA-109 TB-5 TC-46 TD-5 TE-5 TF-5 TG-46 TH-5 TJ-31 TK-5 TL-5 TM-17 TN-5 TO-46 TP-5 TQ-46 TR-5 TS-27 TT15 TV8 TW10 UA-18 UB10 UC10 UD10 UE10 UF10 UG10 UH10 UI10 UJ-10 UK10 UL10 UN10 UO10 UP10 UQ10 UR10 US9 UU21 UW13 UX-4 UY-6 UZ-7 VA-90 VC-27 VG-27 VJ-35 VM-11 VO-27 VQ-27 VS-16 VT8 VV11 VW10 VY5 VZ-10 WA-46 WB4 WC-4 WD4 WE4 WF4 WG-4 WH4 WI5 WJ-27 WK4 WL4 WN4 WO-4 WP4 WQ-4 WR4 WS-3 WT10 WU13 WV10 WW28 WY3 XA8 XC-35 XG-35 XJ-14 XO-35 XQ-35 XS-19 XU-7 XV-6 XY-5 XZ10 YA-90 YB-12 YC-40 YD-12 YE-12 YF-12 YG-40 YH-12 YJ-39 YK-12 YL-12 YM-19 YN-12 YO-40 YP-12 YQ-40 YR-12 YS-30 YU-6 YV4 YW3 YZ-13 ZB3 ZC-24 ZD3 ZE3 ZF3 ZG-24 ZH3 ZI35 ZJ-13 ZK3 ZL3 ZN3 ZO-24 ZP3 ZQ-24 ZR3 ZS-8 ZV4 ZW6 ZX9 ZZ10\";\n\n// Instrument Serif Italic 400, lowercase: the closing word.\nconst SERIF: Record<string, Glyph> = {\n  a: [\n    474,\n    13,\n    452,\n    516,\n    9,\n    \"M89 9Q53 9 33 -22Q13 -53 13 -113Q13 -170 29 -228Q45 -285 73 -337Q101 -389 136 -429Q172 -469 212 -492Q251 -516 290 -516Q309 -516 326 -508Q343 -501 354 -485Q360 -476 366 -476Q372 -476 378 -485Q389 -501 396 -506Q403 -510 409 -510Q415 -510 418 -507Q421 -504 419 -496L330 -113Q319 -65 335 -52Q341 -48 350 -48Q373 -48 392 -79Q410 -110 429 -175Q432 -186 442 -186Q449 -186 451 -180Q453 -174 451 -166Q432 -72 400 -32Q368 9 323 9Q284 9 268 -24Q251 -57 264 -114L277 -169Q278 -174 277 -176Q276 -177 275 -177Q270 -178 267 -172Q212 -71 170 -31Q127 9 89 9ZM114 -42Q138 -42 167 -71Q196 -100 224 -146Q253 -192 277 -245Q301 -298 316 -347Q330 -396 330 -430Q330 -491 287 -491Q261 -491 232 -468Q203 -444 176 -404Q150 -364 128 -314Q107 -263 94 -208Q81 -154 81 -102Q81 -67 90 -54Q98 -42 114 -42Z\",\n  ],\n  b: [\n    431,\n    34,\n    418,\n    743,\n    9,\n    \"M136 9Q102 9 76 -10Q49 -28 38 -66Q28 -103 41 -159L153 -640Q158 -658 154 -665Q149 -672 135 -673L105 -676Q96 -677 93 -681Q91 -684 92 -689Q94 -698 106 -700Q142 -706 170 -714Q198 -723 215 -737Q223 -743 230 -743Q235 -743 237 -741Q241 -737 239 -728L148 -335Q147 -328 151 -327Q155 -326 158 -332Q213 -437 256 -476Q300 -516 338 -516Q375 -516 396 -485Q418 -454 418 -394Q418 -337 402 -280Q385 -222 356 -170Q328 -118 292 -78Q255 -38 215 -14Q175 9 136 9ZM139 -16Q165 -16 194 -40Q223 -63 250 -102Q278 -142 300 -192Q322 -241 335 -294Q348 -346 348 -395Q348 -433 340 -448Q332 -464 312 -464Q290 -464 262 -437Q234 -410 205 -366Q176 -321 151 -269Q126 -217 111 -166Q96 -116 96 -77Q96 -16 139 -16Z\",\n  ],\n  c: [\n    351,\n    15,\n    352,\n    516,\n    9,\n    \"M142 9Q87 9 51 -36Q15 -82 15 -153Q15 -220 36 -284Q58 -349 94 -402Q131 -454 176 -485Q220 -516 265 -516Q313 -516 346 -490Q351 -486 352 -484Q353 -481 351 -473L324 -342Q321 -328 311 -328Q300 -328 298 -343L293 -414Q290 -460 280 -474Q269 -488 249 -488Q221 -488 192 -460Q163 -433 138 -386Q114 -340 100 -284Q85 -227 85 -169Q85 -43 167 -43Q206 -43 238 -79Q269 -115 296 -191Q299 -201 310 -201Q316 -201 317 -196Q318 -192 315 -179Q305 -124 279 -82Q253 -40 218 -16Q182 9 142 9Z\",\n  ],\n  d: [\n    474,\n    13,\n    473,\n    743,\n    9,\n    \"M90 9Q53 9 33 -22Q13 -53 13 -113Q13 -170 29 -228Q45 -285 73 -337Q101 -389 136 -429Q172 -469 212 -492Q251 -516 290 -516Q317 -516 337 -502Q344 -497 349 -499Q353 -501 354 -508L386 -640Q391 -658 386 -665Q382 -672 368 -673L338 -676Q329 -677 326 -681Q324 -684 325 -689Q327 -698 339 -700Q375 -706 403 -714Q431 -723 448 -737Q456 -743 463 -743Q468 -743 470 -741Q474 -737 472 -728L330 -113Q319 -65 335 -52Q341 -48 350 -48Q373 -48 392 -79Q410 -110 429 -175Q432 -186 442 -186Q449 -186 451 -180Q453 -174 451 -166Q432 -72 398 -32Q365 9 320 9Q281 9 264 -24Q248 -57 261 -114L272 -160Q273 -165 272 -167Q271 -168 270 -168Q265 -169 262 -163Q214 -69 171 -30Q128 9 90 9ZM114 -42Q138 -42 167 -71Q196 -100 224 -146Q253 -192 277 -245Q301 -298 316 -347Q330 -396 330 -430Q330 -491 287 -491Q261 -491 232 -468Q203 -444 176 -404Q150 -364 128 -314Q107 -263 94 -208Q81 -154 81 -102Q81 -67 90 -54Q100 -42 114 -42Z\",\n  ],\n  e: [\n    348,\n    12,\n    357,\n    516,\n    9,\n    \"M129 9Q76 9 44 -32Q12 -74 12 -150Q12 -216 36 -281Q59 -346 97 -399Q135 -452 180 -484Q226 -516 269 -516Q316 -516 336 -494Q357 -471 357 -433Q357 -388 326 -344Q294 -299 238 -264Q181 -229 105 -212Q83 -207 82 -187Q81 -180 81 -173V-158Q81 -101 100 -72Q120 -43 154 -43Q192 -43 228 -78Q263 -113 287 -177Q290 -186 299 -186Q305 -186 306 -181Q308 -176 306 -169Q274 -81 228 -36Q183 9 129 9ZM92 -250Q90 -243 94 -238Q99 -234 106 -236Q168 -253 210 -288Q252 -322 274 -365Q295 -408 295 -449Q295 -491 262 -491Q233 -491 199 -457Q165 -423 136 -368Q107 -313 92 -250Z\",\n  ],\n  f: [\n    273,\n    21,\n    404,\n    748,\n    0,\n    \"M32 0Q26 0 23 -3Q20 -6 22 -13L123 -445Q128 -466 120 -475Q114 -482 99 -482H78Q62 -482 62 -496Q62 -510 80 -510Q111 -510 126 -518Q142 -526 147 -550Q160 -607 186 -652Q211 -696 247 -722Q283 -748 326 -748Q361 -748 382 -732Q404 -715 404 -686Q404 -664 392 -650Q381 -637 364 -637Q343 -637 336 -649Q330 -661 328 -677Q327 -693 322 -705Q317 -717 299 -717Q276 -717 258 -694Q241 -672 227 -610L207 -523Q206 -517 208 -514Q211 -510 218 -510H298Q309 -510 313 -505Q315 -502 313 -496Q310 -482 295 -482H208Q198 -482 195 -472L88 -11Q85 0 74 0Z\",\n  ],\n  g: [\n    401,\n    -68,\n    462,\n    598,\n    216,\n    \"M93 216Q14 216 -27 187Q-68 158 -68 118Q-68 83 -40 50Q-13 16 61 -27Q72 -33 74 -40Q75 -48 64 -55Q36 -73 30 -97Q25 -121 43 -131L119 -175Q129 -180 130 -188Q130 -195 119 -201Q92 -217 78 -246Q65 -276 65 -311Q65 -365 92 -412Q118 -458 162 -487Q207 -516 262 -516Q285 -516 301 -510Q313 -506 319 -518Q336 -555 362 -576Q389 -598 418 -598Q439 -598 450 -587Q462 -576 462 -557Q462 -538 451 -526Q440 -514 423 -514Q410 -514 404 -519Q397 -524 392 -529Q387 -534 376 -534Q354 -534 341 -509Q337 -500 339 -492Q341 -485 347 -477Q373 -443 373 -391Q373 -344 352 -302Q332 -259 296 -230Q261 -200 215 -190Q197 -186 182 -180Q168 -175 146 -161L106 -137Q91 -128 98 -114Q105 -101 137 -89L223 -57Q279 -37 300 -8Q322 21 322 60Q322 108 290 143Q259 178 207 197Q155 216 93 216ZM132 -293Q132 -247 146 -226Q159 -206 184 -206Q216 -206 244 -236Q271 -265 288 -312Q305 -358 305 -408Q305 -458 292 -476Q279 -495 253 -495Q222 -495 194 -466Q166 -436 149 -390Q132 -344 132 -293ZM104 191Q143 191 177 178Q211 165 232 141Q254 117 254 84Q254 51 238 30Q221 8 173 -10L154 -17Q136 -24 118 -22Q100 -20 84 -12Q30 18 11 44Q-8 70 -8 101Q-8 138 19 164Q46 191 104 191Z\",\n  ],\n  h: [\n    476,\n    7,\n    454,\n    743,\n    9,\n    \"M322 9Q286 9 268 -21Q250 -51 266 -114L343 -404Q354 -443 346 -458Q339 -473 325 -473Q303 -473 276 -446Q248 -418 218 -370Q189 -323 162 -264Q134 -204 111 -138Q88 -73 74 -11Q71 0 60 0H18Q11 0 8 -4Q6 -7 7 -13L153 -640Q158 -658 154 -665Q149 -672 135 -673L105 -676Q96 -677 93 -681Q91 -684 92 -689Q94 -698 106 -700Q142 -706 170 -714Q198 -723 215 -737Q223 -743 230 -743Q235 -743 237 -741Q241 -737 239 -728L141 -303Q140 -296 144 -295Q148 -294 151 -300Q191 -382 227 -429Q263 -476 294 -496Q326 -516 352 -516Q389 -516 406 -486Q423 -456 406 -394L330 -104Q323 -76 329 -62Q335 -48 351 -48Q371 -48 390 -74Q409 -101 431 -175Q434 -186 444 -186Q452 -186 454 -180Q455 -174 453 -166Q434 -98 412 -60Q390 -21 368 -6Q345 9 322 9Z\",\n  ],\n  i: [\n    288,\n    19,\n    268,\n    710,\n    10,\n    \"M122 10Q89 10 75 -14Q61 -39 74 -95L148 -412Q153 -434 150 -446Q146 -459 131 -459Q113 -459 92 -432Q70 -406 43 -332Q39 -319 29 -319Q23 -319 20 -322Q17 -326 21 -337Q43 -406 68 -445Q92 -484 117 -500Q142 -516 163 -516Q198 -516 212 -492Q226 -467 213 -411L139 -94Q134 -72 138 -60Q141 -47 156 -47Q174 -47 196 -74Q217 -100 244 -174Q248 -187 258 -187Q264 -187 267 -184Q270 -180 266 -169Q245 -101 220 -62Q194 -22 169 -6Q144 10 122 10ZM204 -605Q185 -605 172 -618Q160 -632 160 -651Q160 -678 176 -694Q193 -710 214 -710Q234 -710 248 -698Q261 -685 261 -665Q261 -637 244 -621Q227 -605 204 -605Z\",\n  ],\n  j: [\n    266,\n    -107,\n    261,\n    710,\n    215,\n    \"M-35 215Q-70 215 -88 196Q-107 176 -107 148Q-107 127 -96 116Q-85 106 -72 106Q-53 106 -46 118Q-40 131 -39 147Q-38 163 -34 176Q-30 188 -16 188Q-5 188 4 175Q14 162 25 114L148 -412Q153 -434 150 -446Q146 -459 131 -459Q113 -459 92 -432Q70 -406 43 -332Q39 -319 29 -319Q23 -319 20 -322Q17 -326 21 -337Q43 -406 68 -445Q92 -484 117 -500Q142 -516 163 -516Q198 -516 212 -492Q227 -467 214 -411L110 37Q91 120 52 168Q14 215 -35 215ZM204 -605Q185 -605 172 -618Q160 -632 160 -651Q160 -678 176 -694Q193 -710 214 -710Q234 -710 248 -698Q261 -685 261 -665Q261 -637 244 -621Q227 -605 204 -605Z\",\n  ],\n  k: [\n    447,\n    7,\n    425,\n    743,\n    9,\n    \"M318 9Q267 9 235 -74L180 -219Q170 -243 155 -243Q140 -243 129 -218Q119 -196 108 -158Q96 -121 86 -77L71 -11Q68 0 57 0H18Q11 0 8 -4Q6 -7 7 -13L153 -640Q157 -657 153 -664Q149 -672 135 -673L105 -676Q95 -677 93 -682Q91 -685 92 -689Q94 -698 106 -700Q149 -707 175 -716Q201 -725 215 -737Q223 -743 229 -743Q235 -743 237 -740Q241 -737 239 -728L146 -332Q145 -325 149 -324Q153 -323 156 -329L189 -388Q261 -516 351 -516Q385 -516 405 -498Q425 -480 425 -449Q425 -400 378 -351Q330 -302 253 -271Q241 -266 237 -258Q234 -250 239 -239L297 -91Q307 -66 317 -56Q327 -45 342 -45Q365 -45 377 -74Q389 -102 398 -173Q400 -186 410 -186Q413 -186 415 -185Q421 -181 420 -166Q415 -82 388 -36Q362 9 318 9ZM165 -288Q161 -279 164 -274Q168 -270 177 -272Q260 -293 311 -341Q362 -389 362 -447Q362 -485 333 -485Q299 -485 254 -432Q209 -380 165 -288Z\",\n  ],\n  l: [\n    240,\n    20,\n    240,\n    743,\n    10,\n    \"M74 10Q41 10 27 -14Q13 -39 26 -95L153 -640Q158 -658 154 -665Q149 -672 135 -673L105 -676Q96 -677 93 -681Q91 -684 92 -689Q94 -698 106 -700Q142 -706 170 -714Q198 -723 215 -737Q223 -743 230 -743Q235 -743 237 -741Q241 -737 239 -728L91 -94Q86 -72 90 -60Q93 -47 108 -47Q126 -47 148 -74Q169 -100 196 -174Q200 -187 210 -187Q216 -187 219 -184Q222 -180 218 -169Q197 -101 172 -62Q146 -22 121 -6Q96 10 74 10Z\",\n  ],\n  m: [\n    745,\n    19,\n    723,\n    516,\n    9,\n    \"M591 9Q555 9 537 -21Q519 -51 535 -114L612 -404Q623 -443 616 -458Q608 -473 594 -473Q574 -473 548 -446Q522 -418 494 -371Q465 -324 438 -264Q411 -204 388 -139Q365 -74 350 -11Q347 0 336 0H297Q290 0 287 -4Q285 -7 286 -13L378 -404Q387 -443 380 -458Q374 -473 360 -473Q341 -473 315 -446Q289 -418 261 -371Q233 -324 206 -264Q179 -204 156 -139Q133 -74 119 -11Q116 0 105 0H64Q57 0 54 -4Q52 -7 53 -13L148 -412Q153 -434 150 -446Q146 -459 131 -459Q113 -459 92 -432Q70 -406 43 -332Q39 -319 29 -319Q23 -319 20 -322Q17 -326 21 -337Q43 -406 68 -445Q92 -484 117 -500Q142 -516 163 -516Q196 -516 210 -492Q224 -467 211 -411L186 -303Q185 -296 189 -295Q193 -294 196 -300Q254 -420 301 -468Q348 -516 387 -516Q424 -516 440 -486Q455 -456 441 -394L420 -303Q419 -296 423 -295Q427 -294 430 -300Q468 -381 502 -428Q535 -476 565 -496Q595 -516 621 -516Q658 -516 675 -486Q692 -456 675 -394L599 -104Q592 -76 598 -62Q604 -48 620 -48Q640 -48 660 -74Q679 -101 700 -175Q703 -186 713 -186Q721 -186 722 -180Q724 -174 722 -166Q703 -98 681 -60Q659 -21 636 -6Q614 9 591 9Z\",\n  ],\n  n: [\n    521,\n    19,\n    499,\n    516,\n    9,\n    \"M53 -13 148 -412Q153 -434 150 -446Q146 -459 131 -459Q113 -459 92 -432Q70 -406 43 -332Q39 -319 29 -319Q23 -319 20 -322Q17 -326 21 -337Q43 -406 68 -445Q92 -484 117 -500Q142 -516 163 -516Q196 -516 210 -492Q224 -467 211 -411L186 -303Q185 -296 189 -295Q193 -294 196 -300Q235 -381 271 -428Q307 -476 339 -496Q371 -516 397 -516Q434 -516 451 -486Q468 -456 451 -394L375 -104Q368 -76 374 -62Q380 -48 396 -48Q416 -48 436 -74Q455 -101 476 -175Q479 -186 489 -186Q497 -186 498 -180Q500 -174 498 -166Q479 -98 457 -60Q435 -21 412 -6Q390 9 367 9Q331 9 313 -21Q295 -51 311 -114L388 -404Q399 -443 392 -458Q384 -473 370 -473Q348 -473 320 -446Q292 -418 263 -370Q234 -323 206 -263Q178 -203 156 -138Q133 -73 119 -11Q116 0 105 0H64Q57 0 54 -4Q52 -7 53 -13Z\",\n  ],\n  o: [\n    414,\n    20,\n    393,\n    516,\n    9,\n    \"M154 9Q92 9 56 -42Q20 -94 20 -182Q20 -247 41 -307Q62 -367 96 -414Q131 -461 174 -488Q216 -516 259 -516Q321 -516 357 -465Q393 -414 393 -325Q393 -260 372 -200Q351 -140 316 -93Q282 -46 240 -18Q197 9 154 9ZM152 -15Q184 -15 214 -46Q245 -77 270 -128Q295 -179 310 -242Q325 -304 325 -367Q325 -492 260 -492Q229 -492 198 -462Q167 -431 142 -380Q118 -329 103 -266Q88 -204 88 -141Q88 -15 152 -15Z\",\n  ],\n  p: [\n    450,\n    -89,\n    430,\n    583,\n    205,\n    \"M-76 205Q-89 205 -89 194Q-89 184 -73 182L-59 180Q-39 177 -30 168Q-20 160 -15 138L118 -436Q120 -444 116 -448Q111 -453 103 -448Q93 -443 84 -438Q75 -432 66 -426Q57 -420 51 -422Q45 -425 45 -432Q45 -439 55 -446Q83 -465 113 -479Q130 -487 134 -505L147 -562Q152 -583 173 -583H191Q203 -583 209 -576Q215 -569 212 -556L205 -527Q203 -518 207 -515Q210 -512 218 -513Q241 -516 262 -516Q336 -516 383 -474Q430 -432 430 -345Q430 -277 405 -214Q380 -150 339 -100Q298 -50 249 -20Q200 9 151 9Q124 9 100 -2Q92 -6 87 -3Q83 -1 82 6L52 138Q47 160 52 167Q58 174 77 177L103 181Q121 184 121 193Q121 205 104 205ZM110 -115Q97 -46 123 -25Q135 -16 153 -16Q188 -16 224 -46Q260 -75 291 -124Q322 -174 341 -236Q360 -298 360 -363Q360 -430 331 -460Q302 -489 246 -489Q196 -489 189 -455Z\",\n  ],\n  q: [\n    425,\n    13,\n    420,\n    516,\n    205,\n    \"M134 205Q121 205 121 194Q121 184 137 182L162 180Q182 178 191 169Q200 160 205 138L276 -168Q277 -173 276 -175Q275 -176 274 -176Q269 -177 266 -171Q232 -102 202 -63Q171 -24 144 -8Q116 9 90 9Q53 9 33 -22Q13 -53 13 -113Q13 -170 29 -228Q45 -285 73 -337Q101 -389 136 -429Q172 -469 212 -492Q251 -516 290 -516Q309 -516 326 -508Q343 -501 354 -485Q360 -476 366 -476Q372 -476 378 -485Q389 -501 396 -506Q403 -510 409 -510Q415 -510 418 -507Q421 -504 419 -496L272 138Q267 160 272 168Q278 175 296 178L313 181Q331 184 331 193Q331 205 314 205ZM114 -42Q138 -42 167 -71Q196 -100 224 -146Q253 -192 277 -245Q301 -298 316 -347Q330 -396 330 -430Q330 -491 287 -491Q261 -491 232 -468Q203 -444 176 -404Q150 -364 128 -314Q107 -263 94 -208Q81 -154 81 -102Q81 -67 90 -54Q100 -42 114 -42Z\",\n  ],\n  r: [\n    368,\n    19,\n    404,\n    516,\n    0,\n    \"M64 0Q57 0 54 -4Q52 -7 53 -13L148 -412Q153 -434 150 -446Q146 -459 131 -459Q113 -459 92 -432Q70 -406 43 -332Q39 -319 29 -319Q23 -319 20 -322Q17 -326 21 -337Q43 -406 68 -445Q92 -484 117 -500Q142 -516 163 -516Q196 -516 210 -492Q224 -467 211 -411L200 -364Q199 -357 203 -356Q207 -355 210 -361Q248 -448 279 -482Q310 -516 350 -516Q377 -516 390 -502Q404 -487 404 -462Q404 -437 392 -422Q380 -407 361 -407Q345 -407 338 -415Q331 -423 328 -434Q324 -444 320 -452Q316 -460 307 -460Q292 -460 268 -422Q244 -384 216 -320Q189 -255 164 -175Q138 -95 119 -11Q116 0 105 0Z\",\n  ],\n  s: [\n    302,\n    -15,\n    305,\n    516,\n    9,\n    \"M116 9Q83 9 46 -1Q10 -11 -9 -26Q-16 -32 -15 -44L7 -175Q9 -188 19 -188Q30 -188 30 -174L32 -126Q34 -69 60 -42Q85 -16 122 -16Q154 -16 177 -36Q200 -57 200 -97Q200 -120 193 -140Q186 -159 171 -182Q156 -204 130 -236Q96 -280 80 -312Q63 -343 63 -377Q63 -440 102 -478Q142 -516 203 -516Q230 -516 256 -508Q281 -500 298 -484Q307 -477 304 -466L276 -332Q273 -319 264 -319Q255 -319 253 -333L250 -381Q246 -441 234 -467Q223 -493 187 -493Q155 -493 135 -471Q115 -449 115 -418Q115 -385 133 -358Q151 -330 182 -288Q223 -234 238 -202Q252 -170 252 -137Q252 -95 234 -62Q215 -29 184 -10Q153 9 116 9Z\",\n  ],\n  t: [\n    272,\n    38,\n    293,\n    649,\n    9,\n    \"M102 9Q68 9 49 -18Q30 -45 43 -105L126 -467Q128 -475 124 -478Q121 -482 114 -482H76Q62 -482 62 -495Q62 -502 67 -506Q72 -510 79 -510H115Q138 -510 142 -531L166 -638Q169 -649 180 -649H221Q228 -649 231 -645Q233 -642 232 -636L207 -525Q205 -517 209 -514Q212 -510 219 -510H276Q293 -510 293 -497Q293 -482 272 -482H218Q196 -482 191 -461L107 -95Q102 -73 108 -60Q115 -48 131 -48Q154 -48 174 -74Q193 -100 215 -173Q219 -186 228 -186Q235 -186 237 -180Q239 -174 234 -158Q215 -90 192 -54Q170 -18 147 -4Q124 9 102 9Z\",\n  ],\n  u: [\n    508,\n    21,\n    488,\n    516,\n    9,\n    \"M115 9Q78 9 64 -24Q51 -58 66 -113L145 -403Q153 -432 149 -448Q145 -464 131 -464Q108 -464 84 -429Q61 -394 44 -332Q41 -321 31 -321Q26 -321 24 -323Q19 -328 22 -341Q45 -425 82 -470Q120 -516 165 -516Q201 -516 213 -483Q225 -450 209 -393L129 -103Q114 -49 130 -37Q135 -34 142 -34Q162 -34 188 -61Q214 -88 242 -135Q271 -182 299 -242Q327 -302 350 -368Q373 -434 388 -499Q391 -510 402 -510H442Q449 -510 452 -506Q454 -503 453 -497L359 -95Q351 -62 363 -52Q368 -48 376 -48Q418 -48 464 -175Q468 -188 478 -188Q484 -188 486 -183Q489 -178 486 -170Q459 -85 422 -38Q385 9 344 9Q319 9 306 -3Q280 -27 296 -96L322 -207Q323 -212 322 -214Q321 -215 320 -215Q315 -216 312 -210Q254 -90 205 -40Q156 9 115 9Z\",\n  ],\n  v: [\n    412,\n    20,\n    398,\n    516,\n    9,\n    \"M151 9Q102 9 78 -28Q54 -65 69 -123L146 -412Q155 -445 144 -455Q139 -459 130 -459Q109 -459 88 -429Q68 -399 44 -331Q40 -319 30 -319Q25 -319 22 -324Q19 -328 21 -335Q79 -516 166 -516Q200 -516 212 -488Q224 -460 211 -411L132 -113Q121 -71 130 -48Q140 -26 165 -26Q194 -26 226 -54Q259 -82 288 -127Q317 -172 335 -226Q353 -280 353 -332Q353 -374 344 -398Q335 -423 326 -440Q316 -457 316 -477Q316 -516 350 -516Q398 -516 398 -410Q398 -334 376 -260Q354 -185 318 -124Q282 -64 238 -28Q195 9 151 9Z\",\n  ],\n  w: [\n    609,\n    20,\n    592,\n    516,\n    9,\n    \"M137 9Q96 9 74 -23Q52 -55 66 -110L146 -412Q155 -445 144 -455Q139 -459 130 -459Q109 -459 88 -429Q68 -399 44 -331Q40 -319 30 -319Q25 -319 22 -324Q19 -328 21 -335Q79 -516 166 -516Q200 -516 212 -488Q224 -460 211 -411L127 -92Q118 -58 126 -42Q134 -26 150 -26Q199 -26 260 -146Q320 -267 366 -499Q369 -510 380 -510H419Q426 -510 429 -506Q431 -503 430 -497L350 -92Q343 -59 352 -42Q360 -26 379 -26Q408 -26 438 -54Q468 -82 492 -127Q517 -172 532 -226Q547 -280 547 -332Q547 -374 540 -398Q534 -423 527 -440Q520 -457 520 -477Q520 -516 554 -516Q578 -516 585 -490Q592 -463 592 -410Q592 -334 574 -260Q555 -185 524 -124Q492 -64 452 -28Q411 9 366 9Q323 9 300 -24Q277 -58 290 -122Q291 -127 290 -129Q289 -130 288 -130Q283 -131 280 -125Q252 -69 217 -30Q182 9 137 9Z\",\n  ],\n  x: [\n    450,\n    -24,\n    463,\n    516,\n    10,\n    \"M33 10Q5 10 -10 -6Q-24 -21 -24 -46Q-24 -69 -12 -84Q-1 -99 18 -99Q34 -99 42 -91Q49 -83 53 -72Q57 -62 62 -54Q67 -46 78 -46Q103 -46 132 -100Q160 -154 186 -238Q191 -252 192 -263Q193 -274 192 -288L184 -412Q183 -438 175 -448Q167 -459 155 -459Q133 -459 113 -432Q93 -406 80 -332Q77 -319 67 -319Q62 -319 59 -322Q54 -326 56 -337Q68 -406 90 -445Q111 -484 136 -500Q160 -516 181 -516Q212 -516 230 -494Q247 -473 250 -421L253 -374Q254 -368 258 -368Q263 -367 266 -373Q302 -452 336 -484Q369 -516 406 -516Q434 -516 448 -500Q463 -485 463 -460Q463 -437 452 -422Q441 -407 421 -407Q405 -407 398 -415Q390 -423 386 -434Q382 -444 378 -452Q373 -460 363 -460Q348 -460 329 -438Q310 -415 293 -378Q276 -341 265 -296Q262 -282 262 -271Q261 -260 262 -246L271 -100Q273 -69 282 -56Q291 -43 306 -43Q325 -43 345 -72Q365 -100 378 -174Q381 -187 392 -187Q396 -187 398 -185Q403 -181 402 -169Q393 -101 374 -62Q354 -23 331 -7Q308 9 287 9Q250 9 230 -14Q210 -38 206 -95L201 -170Q200 -177 196 -177Q192 -177 189 -171L171 -127Q114 10 33 10Z\",\n  ],\n  y: [\n    418,\n    -107,\n    408,\n    516,\n    215,\n    \"M-27 215Q-65 215 -86 196Q-107 176 -107 148Q-107 127 -96 116Q-85 106 -72 106Q-53 106 -45 116Q-37 126 -33 140Q-29 153 -20 163Q-12 173 7 173Q44 173 80 144Q116 114 139 62Q162 11 159 -53L144 -412Q143 -438 135 -448Q127 -459 115 -459Q93 -459 73 -432Q53 -406 40 -332Q37 -319 27 -319Q22 -319 19 -322Q14 -326 16 -337Q28 -406 50 -445Q71 -484 96 -500Q120 -516 141 -516Q172 -516 190 -494Q208 -473 210 -421L224 -37Q224 -30 228 -28Q233 -27 237 -33Q272 -82 300 -134Q329 -187 346 -238Q363 -289 363 -332Q363 -374 354 -398Q345 -423 336 -440Q326 -457 326 -477Q326 -516 360 -516Q408 -516 408 -410Q408 -352 388 -284Q368 -215 334 -144Q299 -74 254 -10Q210 54 162 105Q113 156 64 186Q16 215 -27 215Z\",\n  ],\n  z: [\n    385,\n    -13,\n    402,\n    516,\n    9,\n    \"M0 9Q-13 9 -13 -6Q-13 -25 4 -44Q20 -62 46 -77L291 -401Q296 -409 294 -412Q291 -414 284 -411Q272 -406 256 -406Q230 -406 206 -416Q183 -427 163 -437Q143 -447 124 -447Q95 -447 81 -420Q67 -392 67 -332Q67 -319 55 -319Q43 -319 43 -337Q43 -406 60 -445Q76 -484 101 -500Q126 -516 152 -516Q181 -516 200 -505Q219 -494 234 -480Q249 -465 266 -454Q283 -443 310 -443Q322 -443 326 -455Q337 -478 354 -497Q371 -516 386 -516Q402 -516 402 -500Q402 -486 392 -475Q381 -464 362 -448Q344 -432 321 -401L94 -99Q90 -94 93 -90Q96 -87 103 -90Q115 -95 130 -95Q152 -95 176 -86Q200 -78 224 -69Q247 -60 265 -60Q294 -60 308 -86Q322 -113 322 -173Q322 -186 334 -186Q346 -186 346 -168Q346 -101 330 -62Q313 -23 288 -7Q263 9 237 9Q210 9 190 -2Q170 -12 154 -25Q137 -38 122 -48Q107 -58 89 -58Q66 -58 57 -42Q47 -21 30 -6Q14 9 0 9Z\",\n  ],\n};\nconst SERIF_KERN_PAIRS =\n  \"af-14 ag-18 at-12 ay-28 bg-8 bx-22 dg-18 dt-12 dy-28 fa-28 fc-22 fd-22 fe-22 ff-22 fg-24 fh-18 fi-18 fj-18 fk-18 fl-18 fm-12 fn-12 fo-32 fp-12 fq-22 fr-12 fs-12 ft-22 fu-12 fx-22 fy-18 ga-12 gc-12 gd-12 ge-12 go-12 gq-12 gx-8 hg-14 ig-14 ja-18 jc-18 jd-18 je-18 jf-14 jg-32 ji-12 jo-18 jq-18 kc-10 kd-10 ke-10 kf-12 ko-10 kq-10 kt-10 ky-8 lg-14 mg-14 ng-14 og-8 ox-22 pg-8 px-22 qx-14 ra-18 rc-18 rd-18 re-18 rg-18 ro-18 rq-18 ry20 tc-6 td-6 te-6 tg-18 to-6 tq-6 ug-14 vo-12 xb-12 xc-18 xd-18 xe-18 xo-18 xq-18 yo-12 zb-10\";\n\nconst parseKern = (pairs: string) =>\n  new Map(pairs.split(\" \").map((p) => [p.slice(0, 2), Number(p.slice(2))]));\nconst KERN = parseKern(KERN_PAIRS);\nconst SERIF_KERN = parseKern(SERIF_KERN_PAIRS);\n\ninterface Face {\n  glyphs: Record<string, Glyph>;\n  kern: Map<string, number>;\n  track: number;\n  space: number;\n  upper: boolean;\n}\n// Schibsted Grotesk 500 caps carry the stack; the last word turns serif.\nconst SANS: Face = {\n  glyphs: GLYPHS,\n  kern: KERN,\n  track: -12,\n  space: 242,\n  upper: true,\n};\nconst ITALIC: Face = {\n  glyphs: SERIF,\n  kern: SERIF_KERN,\n  track: 0,\n  space: 170,\n  upper: false,\n};\n\n// gradients.sh \"silk\" on the closing word: violet into a peach sheen.\nconst SILK = { violet: \"#8a7bff\", peach: \"#f3d6c0\", blue: \"#3b3fd8\" } as const;\n\n// Negative: the first word is already mid-push on frame 0.\nconst START = -5;\nconst INTERVAL = 17;\nconst DURATION = 15;\n\nconst EASE_PUSH = Easing.bezier(0.72, 0, 0.18, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\nconst THEMES = {\n  dark: {\n    bg: \"#0A0A0B\",\n    key: \"rgba(255,255,255,0.05)\",\n    fg: \"#F3F2EF\",\n    grain: 0.07,\n  },\n  light: {\n    bg: \"#F5F4F0\",\n    key: \"rgba(255,255,255,0.9)\",\n    fg: \"#121214\",\n    grain: 0.045,\n  },\n} as const;\n\ninterface SetWord {\n  glyphs: { d: string; x: number }[];\n  left: number;\n  ink: number;\n  top: number;\n  bot: number;\n}\n\nfunction setWord(word: string, face: Face): SetWord {\n  const glyphs: { d: string; x: number }[] = [];\n  let x = 0;\n  let prev = \"\";\n  let left = 0;\n  let right = 0;\n  let top = 1;\n  let bot = 0;\n  const text = face.upper ? word.toUpperCase() : word.toLowerCase();\n  for (const ch of text) {\n    const g = face.glyphs[ch];\n    if (!g) {\n      x += face.space;\n      prev = \"\";\n      continue;\n    }\n    x += face.kern.get(prev + ch) ?? 0;\n    if (glyphs.length === 0) left = x + g[1];\n    right = x + g[2];\n    top = Math.max(top, g[3]);\n    bot = Math.max(bot, g[4]);\n    glyphs.push({ d: g[5], x });\n    x += g[0] + face.track;\n    prev = ch;\n  }\n  return { glyphs, left, ink: Math.max(1, right - left), top, bot };\n}\n\nfunction Grain({ opacity }: { opacity: number }) {\n  const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  return (\n    <svg\n      width=\"100%\"\n      height=\"100%\"\n      style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n      aria-hidden\n    >\n      <filter id={id}>\n        <feTurbulence\n          type=\"fractalNoise\"\n          baseFrequency=\"0.9\"\n          numOctaves={2}\n          seed={13}\n          stitchTiles=\"stitch\"\n        />\n        <feColorMatrix values=\"0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0\" />\n      </filter>\n      <rect width=\"100%\" height=\"100%\" filter={`url(#${id})`} />\n    </svg>\n  );\n}\n\nexport function WordStack({\n  words = [\"Even\", \"solo\", \"builders\", \"deserve\", \"cinematic\", \"launches\"],\n  accent = \"#3B5BFD\",\n  theme = \"dark\",\n  speed = 1,\n}: WordStackProps) {\n  const t = useCurrentFrame() * speed;\n  const { width: W, height: H } = useVideoConfig();\n  const u = H / 720;\n  const c = THEMES[theme];\n  const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const clipId = `w${uid}`;\n  const heroClip = `h${uid}`;\n  const heroFill = `f${uid}`;\n\n  const list = words.length > 0 ? words : [\"remocn\"];\n  const n = list.length;\n  const set = list.map((w, i) =>\n    setWord(w, n > 1 && i === n - 1 ? ITALIC : SANS),\n  );\n  const m = Math.round(Math.min(W, H) * 0.115);\n  const Wc = W - m * 2;\n  const Hc = H - m * 2;\n  const gapMin = 14 * u;\n  const gapBase = 22 * u;\n  const gapMax = 46 * u;\n\n  const ratio = set.map((s) => (s.top + s.bot) / s.ink);\n  const tail = ratio.slice(-Math.min(3, n));\n  const fitW = Math.min(\n    Wc,\n    (Hc - gapMin * (tail.length - 1)) / tail.reduce((a, b) => a + b, 0),\n  );\n  const widths = ratio.map((r) => Math.min(fitW, (Hc * 0.62) / r));\n  const heights = widths.map((w, i) => w * ratio[i]);\n\n  const states: number[][] = [];\n  states.push(heights.map((_, i) => H - m + gapBase * (i + 1) + sum(0, i)));\n  for (let k = 0; k < n; k++) {\n    let j = k;\n    if (k === n - 1) j = Math.max(0, n - 3);\n    else\n      while (j > 0 && sum(j - 1, k + 1) + gapMin * (k - j + 1) <= Hc + 0.5) j--;\n    const count = k - j + 1;\n    const total = sum(j, k + 1);\n    const full = j > 0;\n    const room = count > 1 ? (Hc - total) / (count - 1) : 0;\n    const gap =\n      count > 1\n        ? full\n          ? Math.min(Math.max(room, gapMin), gapMax)\n          : Math.min(gapBase, Math.max(room, gapMin))\n        : 0;\n    const blockH = total + gap * (count - 1);\n    const top = m + (Hc - blockH) / 2;\n    const y: number[] = new Array(n).fill(0);\n    let cursor = top;\n    for (let i = j; i <= k; i++) {\n      y[i] = cursor;\n      cursor += heights[i] + gap;\n    }\n    let above = Math.min(top - gapBase, m);\n    for (let i = j - 1; i >= 0; i--) {\n      y[i] = above - heights[i];\n      above = y[i] - gapBase;\n    }\n    let below = Math.max(top + blockH + gapBase, H - m);\n    for (let i = k + 1; i < n; i++) {\n      y[i] = below;\n      below += heights[i] + gapBase;\n    }\n    states.push(y);\n  }\n\n  function sum(from: number, to: number) {\n    let s = 0;\n    for (let i = from; i < to; i++) s += heights[i];\n    return s;\n  }\n\n  const step = Math.max(\n    -1,\n    Math.min(n - 1, Math.floor((t - START) / INTERVAL)),\n  );\n  // Before the first push (frames 0–1) both ends are the off-screen state.\n  const from = states[Math.max(0, step)];\n  const to = states[step + 1];\n  const p =\n    step < 0\n      ? 0\n      : interpolate(\n          t,\n          [\n            START + step * INTERVAL,\n            START + step * INTERVAL + DURATION + (step === n - 1 ? 4 : 0),\n          ],\n          [0, 1],\n          { ...CLAMP, easing: EASE_PUSH },\n        );\n  const ys = to.map((v, i) => from[i] + (v - from[i]) * p);\n\n  // The silk sheen eases across the closing word as it lands and holds.\n  const lastAt = START + (n - 1) * INTERVAL;\n  const sheen = interpolate(t, [lastAt, lastAt + 70], [0.28, 0.62], {\n    ...CLAMP,\n    easing: EASE_PUSH,\n  });\n  const stops =\n    theme === \"light\"\n      ? [accent, SILK.violet, \"#d9876c\"]\n      : [SILK.violet, SILK.peach, accent];\n  const hero = set[n - 1];\n\n  return (\n    <AbsoluteFill style={{ background: c.bg, overflow: \"hidden\" }}>\n      <AbsoluteFill\n        style={{\n          background: `radial-gradient(ellipse 75% 85% at 35% 30%, ${c.key}, transparent 70%)`,\n        }}\n      />\n      <svg\n        width={W}\n        height={H}\n        viewBox={`0 0 ${W} ${H}`}\n        style={{ position: \"absolute\", inset: 0 }}\n        aria-hidden\n      >\n        <defs>\n          <clipPath id={clipId}>\n            <rect x={0} y={m} width={W} height={Hc} />\n          </clipPath>\n          <clipPath id={heroClip}>\n            {hero.glyphs.map((g, gi) => (\n              <path\n                key={`${gi}-${g.x}`}\n                d={g.d}\n                transform={`translate(${g.x} 0)`}\n              />\n            ))}\n          </clipPath>\n          <linearGradient\n            id={heroFill}\n            gradientUnits=\"userSpaceOnUse\"\n            x1={hero.left}\n            y1={-hero.top}\n            x2={hero.left + hero.ink}\n            y2={hero.bot + hero.ink * 0.12}\n          >\n            <stop offset={0} stopColor={stops[0]} />\n            <stop offset={sheen} stopColor={stops[1]} />\n            <stop offset={1} stopColor={stops[2]} />\n          </linearGradient>\n        </defs>\n        <g clipPath={`url(#${clipId})`}>\n          {set.map((word, i) => {\n            const y = ys[i];\n            if (y > H || y + heights[i] < 0) return null;\n            const s = widths[i] / word.ink;\n            const x = (W - widths[i]) / 2 - word.left * s;\n            const at = `translate(${x} ${y + word.top * s}) scale(${s})`;\n            if (n > 1 && i === n - 1) {\n              return (\n                <g key={`${i}-${list[i]}`} transform={at}>\n                  <rect\n                    x={word.left - 40}\n                    y={-word.top - 40}\n                    width={word.ink + 80}\n                    height={word.top + word.bot + 80}\n                    fill={`url(#${heroFill})`}\n                    clipPath={`url(#${heroClip})`}\n                  />\n                </g>\n              );\n            }\n            return (\n              <g key={`${i}-${list[i]}`} transform={at} fill={c.fg}>\n                {word.glyphs.map((g, gi) => (\n                  <path\n                    key={`${gi}-${g.x}`}\n                    d={g.d}\n                    transform={`translate(${g.x} 0)`}\n                  />\n                ))}\n              </g>\n            );\n          })}\n        </g>\n      </svg>\n      <Grain opacity={c.grain} />\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/word-stack.tsx"
    }
  ],
  "type": "registry:component"
}
