{"id":39,"date":"2026-10-04T07:15:52","date_gmt":"2026-10-04T07:15:52","guid":{"rendered":"https:\/\/scrollcraftstudio.com\/?page_id=39"},"modified":"2026-10-04T16:24:52","modified_gmt":"2026-10-04T16:24:52","slug":"scrollcraft-studios","status":"publish","type":"page","link":"https:\/\/scrollcraftstudio.com\/","title":{"rendered":"Scrollcraft Studio"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"39\" class=\"elementor elementor-39\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1098fd9 e-con-full e-flex e-con e-parent\" data-id=\"1098fd9\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ffcafda elementor-widget elementor-widget-html\" data-id=\"ffcafda\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<title>Scrollcraft Studio<\/title>\r\n<meta name=\"description\" content=\"Scrollcraft Studio designs and builds websites, content platforms, and the tools behind them.\">\r\n<link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\r\n<link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\r\n<link rel=\"stylesheet\" href=\"https:\/\/fonts.googleapis.com\/css2?family=Funnel+Display:wght@300..800&family=Funnel+Sans:ital,wght@0,300..800;1,300..800&display=swap\">\r\n<style>\r\n\/* Layout concept: one fixed field of ~200,000 pixels sits behind the page. Each section holds the field in a new\r\n   formation (star wordmark, light sea, the four client sites, a double helix, wordmark again) while short copy sits beside it.\r\n   Deliberately single-theme: the pixels need a dark room. *\/\r\n:root{\r\n  --bg:#08090B;\r\n  --fg:#ECE8E1;\r\n  --fg-2:#8E9198;\r\n  --line:rgba(236,232,225,.14);\r\n  --scrim:rgba(8,9,11,.9);\r\n  --tint:#ECE8E1;\r\n  --brand:#8572D6;\r\n  --brand-2:#E7E2F4;\r\n  --f-display:\"Funnel Display\", \"Helvetica Neue\", Arial, sans-serif;\r\n  --f-text:\"Funnel Sans\", \"Helvetica Neue\", Arial, sans-serif;\r\n  --gutter:clamp(16px, 4vw, 64px);\r\n  color-scheme:dark;\r\n}\r\n*,*::before,*::after{ box-sizing:border-box }\r\nhtml.lenis, html.lenis body{ height:auto }\r\n.lenis.lenis-smooth{ scroll-behavior:auto !important }\r\nhtml, body{ background:var(--bg); color:var(--fg) }\r\nbody{ margin:0; font-family:var(--f-text); font-size:clamp(16px, .35vw + 14.5px, 19px); line-height:1.55; -webkit-font-smoothing:antialiased; overflow-x:clip }\r\na{ color:inherit }\r\n:focus-visible{ outline:2px solid var(--tint); outline-offset:4px }\r\nh1, h2, h3{ text-wrap:balance; margin:0 }\r\np{ text-wrap:pretty; margin:0 }\r\nimg{ max-width:100% }\r\n.sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }\r\n.skip{ position:fixed; left:var(--gutter); top:-60px; z-index:30; background:var(--fg); color:var(--bg); padding:10px 14px; font-size:14px; text-decoration:none }\r\n.skip:focus{ top:12px }\r\n\r\n#gl{ position:fixed; inset:0; width:100%; height:100%; z-index:0; display:block; pointer-events:none; background:var(--bg) }\r\n.nogl #gl{ display:none }\r\nmain{ position:relative; z-index:1 }\r\n\r\n\/* ---------- header ---------- *\/\r\n.top{ position:fixed; inset:0 0 auto 0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:calc(env(safe-area-inset-top, 0px) + 22px) var(--gutter) 22px; pointer-events:none }\r\n.top > *{ pointer-events:auto }\r\n.logo{ display:flex; align-items:center; gap:.3em; text-decoration:none; font-family:var(--f-display); font-weight:600; font-size:18px; letter-spacing:-.015em; white-space:nowrap }\r\n.logo{ color:var(--brand-2) }\r\n.logo i{ width:9px; height:9px; background:var(--brand); box-shadow:0 0 10px rgba(133,114,214,.5); display:block; flex:none }\r\n.logo span{ color:var(--brand); font-weight:500 }\r\n.nav{ display:flex; gap:clamp(18px, 2.4vw, 32px); font-size:14px }\r\n.nav a{ color:var(--fg-2); text-decoration:none; transition:color .2s ease }\r\n.nav a:hover{ color:var(--fg) }\r\n\r\n\/* ---------- pixel progress ---------- *\/\r\n.dots{ position:fixed; right:calc(var(--gutter) - 6px); top:50%; transform:translateY(-50%); z-index:20; display:grid; gap:6px }\r\n.dots button{ width:22px; height:22px; padding:0; border:0; background:none; cursor:pointer; display:grid; place-items:center }\r\n.dots button::before{ content:\"\"; width:5px; height:5px; border-radius:50%; background:var(--fg-2); opacity:.5; transition:width .35s ease, height .35s ease, opacity .35s ease, background-color .35s ease }\r\n.dots button:hover::before{ opacity:1 }\r\n.dots button.on::before{ width:9px; height:9px; background:var(--tint); opacity:1 }\r\n@media (max-width:760px){ .dots{ display:none } }\r\n@media (max-width:520px){ .nav .opt{ display:none } .nav{ gap:18px } }\r\n\r\n\/* ---------- scenes ---------- *\/\r\n.scene{ position:relative }\r\n.scene-inner{ position:sticky; top:0; height:100svh; display:grid; padding:calc(env(safe-area-inset-top, 0px) + 104px) var(--gutter) clamp(36px, 7vh, 72px) }\r\n.content{ min-width:0 }\r\n.gl .content{ opacity:var(--p, 1); transform:translateY(calc((1 - var(--p, 1)) * 26px)); filter:blur(calc((1 - var(--p, 1)) * 8px)); will-change:opacity, transform }\r\n.eyebrow{ display:flex; align-items:center; gap:10px; font-size:13px; letter-spacing:.02em; color:var(--fg-2) }\r\n.eyebrow::before{ content:\"\"; width:6px; height:6px; border-radius:50%; background:var(--tint); flex:none }\r\n.h-xl{ font-family:var(--f-display); font-weight:420; font-size:clamp(40px, 5.4vw, 88px); line-height:.98; letter-spacing:-.035em }\r\n.h-l{ font-family:var(--f-display); font-weight:480; font-size:clamp(38px, 5vw, 82px); line-height:.98; letter-spacing:-.03em }\r\n.muted{ color:var(--fg-2) }\r\n\r\n.hero{ height:100svh }\r\n.hero .scene-inner{ position:relative; align-items:end }\r\n.hero .content{ display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); gap:28px clamp(24px, 6vw, 120px); align-items:end }\r\n.hero h1{ max-width:22ch }\r\n.hero-side{ display:grid; gap:22px; justify-items:start; max-width:36ch; margin-left:auto }\r\n.hero-side p{ color:var(--fg-2) }\r\n.cue{ display:flex; align-items:center; gap:12px; font-size:13px; color:var(--fg-2) }\r\n.cue::before{ content:\"\"; width:1px; height:34px; background:linear-gradient(var(--fg), transparent); transform-origin:top; animation:cue 2.2s cubic-bezier(.6,0,.2,1) infinite }\r\n@keyframes cue{ 0%{ transform:scaleY(0) } 50%{ transform:scaleY(1); transform-origin:top } 51%{ transform-origin:bottom } 100%{ transform:scaleY(0); transform-origin:bottom } }\r\n.wordmark-fb{ display:none }\r\n.nogl .wordmark-fb small{ color:var(--brand); display:block; font-size:.2em; font-weight:600; letter-spacing:.6em; text-transform:uppercase; margin-top:.25em }\r\n.nogl .wordmark-fb{ color:var(--brand-2); text-shadow:0 0 40px rgba(110,91,194,.35); display:block; position:absolute; inset:28% var(--gutter) auto; font-family:var(--f-display); font-weight:600; font-size:clamp(64px, 15vw, 260px); line-height:.9; letter-spacing:-.045em }\r\n\r\n.statement{ height:150svh }\r\n.statement .content{ align-self:start; margin-top:0; display:grid; gap:20px 28px; max-width:min(100%, 1080px) }\r\n.statement .h-xl{ max-width:23ch }\r\n.statement p.note{ max-width:44ch; color:var(--fg-2) }\r\n\r\n.work{ height:170svh }\r\n.work .scene-inner{ align-items:center }\r\n.work .content{ display:grid; gap:22px; max-width:min(40vw, 520px); justify-items:start }\r\n.desc{ max-width:40ch; color:color-mix(in srgb, var(--fg) 78%, var(--bg)) }\r\n.tags{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:4px 0; font-size:14px; color:var(--fg-2) }\r\n.tags li + li::before{ content:\"\u00b7\"; padding-inline:9px }\r\n.visit{ display:inline-flex; align-items:center; gap:10px; font-size:15px; text-decoration:none; padding-block:6px; background:linear-gradient(var(--tint), var(--tint)) 0 100% \/ 100% 1px no-repeat; transition:background-size .4s ease }\r\n.visit:hover{ background-size:0 1px; background-position:100% 100% }\r\n.visit span{ transition:transform .3s ease }\r\n.visit:hover span{ transform:translate(3px, -3px) }\r\n.shot{ display:none }\r\n\r\n.services{ height:260svh }\r\n.services .scene-inner{ align-items:center }\r\n.services .content{ display:grid; gap:26px; max-width:min(42vw, 560px) }\r\n.svc{ list-style:none; margin:0; padding:0; border-top:1px solid var(--line) }\r\n.svc li{ display:grid; grid-template-columns:2.2em minmax(0, 1fr); gap:4px 12px; padding-block:16px; border-bottom:1px solid var(--line) }\r\n.svc .n{ font-size:13px; color:var(--fg-2); font-variant-numeric:tabular-nums; padding-top:.5em }\r\n.svc h3{ font-family:var(--f-display); font-weight:500; font-size:clamp(22px, 2vw, 30px); letter-spacing:-.02em; line-height:1.1 }\r\n.svc p{ grid-column:2; color:var(--fg-2); font-size:15px }\r\n\r\n.contact{ height:130svh }\r\n.contact .scene-inner{ align-items:end; grid-template-rows:1fr auto }\r\n.contact .content{ position:relative; z-index:1; display:grid; gap:20px; max-width:min(46vw, 600px); align-self:end }\r\n.contact .content p{ color:var(--fg-2); max-width:40ch }\r\n.enquiry{ display:grid; gap:14px; margin-top:4px }\r\n.enquiry .row{ display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:14px 22px }\r\n.field{ display:grid; gap:6px; min-width:0 }\r\n.field > span{ font-size:12.5px; letter-spacing:.02em; color:var(--fg-2) }\r\n.field em{ font-style:normal; opacity:.6 }\r\n.field input, .field select, .field textarea{\r\n  width:100%; font:400 16px\/1.4 var(--f-text); color:var(--fg); background:rgba(236,232,225,.03);\r\n  border:0; border-bottom:1px solid var(--line); border-radius:0; padding:10px 2px; outline:none; transition:border-color .2s ease, background .2s ease\r\n}\r\n.field textarea{ resize:vertical; min-height:72px }\r\n.field select{ appearance:none; -webkit-appearance:none; background-image:linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%); background-position:calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size:5px 5px; background-repeat:no-repeat; padding-right:28px }\r\n.field select option{ background:var(--bg); color:var(--fg) }\r\n.field input:focus, .field select:focus, .field textarea:focus{ border-bottom-color:var(--tint); background:rgba(236,232,225,.06) }\r\n.field [aria-invalid=\"true\"]{ border-bottom-color:#E2546F }\r\n.err{ min-height:0; font-size:12px; color:#F08BA0 }\r\n.err:empty{ display:none }\r\n.form-foot{ display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; margin-top:6px }\r\n.send{ display:inline-flex; align-items:center; gap:10px; font:500 15px\/1 var(--f-text); color:var(--bg); background:var(--fg); border:0; padding:14px 20px; cursor:pointer; transition:background .2s ease, transform .2s ease }\r\n.send:hover{ background:#fff }\r\n.send span{ transition:transform .25s ease }\r\n.send:hover span{ transform:translateX(3px) }\r\n.form-status{ font-size:14px; color:var(--fg-2); max-width:44ch }\r\n.foot{ position:relative; z-index:1; display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px 24px; margin-top:clamp(28px, 5vh, 56px); padding-top:18px; border-top:1px solid var(--line); font-size:13px; color:var(--fg-2) }\r\n.foot a{ text-decoration:none }\r\n.foot a:hover{ color:var(--fg) }\r\n\r\n\/* no WebGL or reduced motion: plain, complete pages *\/\r\n.nogl .work .scene-inner{ grid-template-columns:minmax(0, 5fr) minmax(0, 7fr); gap:clamp(24px, 4vw, 64px) }\r\n.nogl .work .content{ max-width:none }\r\n.nogl .shot{ display:block; align-self:center; width:100%; height:auto; aspect-ratio:16 \/ 10; object-fit:cover; object-position:top; border:1px solid var(--line) }\r\n.nogl .scene:not(.hero){ height:auto }\r\n.nogl .scene:not(.hero) .scene-inner{ position:relative; height:auto; min-height:100svh; align-content:center }\r\n.nogl .contact .scene-inner{ min-height:80svh }\r\n\r\n@media (max-width:760px){\r\n  .work .desc{ font-size:15px; line-height:1.5 }\r\n  .work .content{ gap:14px }\r\n  .hero .h-xl{ font-size:33px }\r\n  .hero .content{ grid-template-columns:1fr }\r\n  .hero-side{ margin-left:0 }\r\n  .work .scene-inner, .services .scene-inner{ align-items:end }\r\n  .work .content, .services .content{ max-width:none }\r\n  .gl .work .content, .gl .services .content, .gl .contact .content{ margin-inline:calc(var(--gutter) * -1); padding:56px var(--gutter) 0; background:linear-gradient(transparent, var(--scrim) 48px) }\r\n  .services .content{ gap:16px }\r\n  .svc li{ padding-block:8px }\r\n  .svc p{ display:none }\r\n  .svc p{ font-size:14px }\r\n  .nogl .work .scene-inner{ grid-template-columns:1fr; align-content:center }\r\n  .nogl .shot{ grid-row:1 }\r\n}\r\n@media (max-height:700px) and (min-width:761px){ .svc p{ display:none } }\r\n@media (max-height:820px) and (min-width:761px){ .contact .h-l{ font-size:clamp(32px, 4vw, 56px) } .contact .content > p{ display:none } }\r\n@media (max-width:760px){\r\n  .enquiry .row{ grid-template-columns:1fr }\r\n  .gl .contact{ height:auto }\r\n  .gl .contact .scene-inner{ position:relative; height:auto; min-height:100svh; padding-top:44svh }\r\n  .gl .contact .content{ max-width:none; background:linear-gradient(transparent, var(--bg) 56px) }\r\n}\r\n@media (max-width:760px){ .gl.mobile-scenes .scene:not(.contact){ touch-action:pan-x pinch-zoom } }\r\n@media (prefers-reduced-motion: reduce){ .cue::before{ animation:none } }\r\n<\/style>\r\n<script>\r\ndocument.documentElement.classList.add(!matchMedia('(prefers-reduced-motion: reduce)').matches && 'WebGL2RenderingContext' in window ? 'gl' : 'nogl');\r\n<\/script>\r\n\r\n<a class=\"skip\" href=\"#main\">Skip to content<\/a>\r\n<canvas id=\"gl\" aria-hidden=\"true\"><\/canvas>\r\n\r\n<header class=\"top\">\r\n  <a class=\"logo\" href=\"#top\" aria-label=\"Scrollcraft Studio, back to top\">Scrollcraft <span>Studio<\/span><\/a>\r\n  <nav class=\"nav\" aria-label=\"Sections\">\r\n    <a href=\"#work\">Work<\/a>\r\n    <a class=\"opt\" href=\"#services\">Services<\/a>\r\n    <a href=\"#contact\">Contact<\/a>\r\n  <\/nav>\r\n<\/header>\r\n<nav class=\"dots\" aria-label=\"Scenes\"><\/nav>\r\n\r\n<main id=\"main\">\r\n  <section class=\"scene hero\" id=\"top\" data-scene=\"0\" data-label=\"Intro\" data-tint=\"#B4A7E8\">\r\n    <div class=\"scene-inner\">\r\n      <p class=\"wordmark-fb\" aria-hidden=\"true\">Scrollcraft<small>Studio<\/small><\/p>\r\n      <div class=\"content\">\r\n        <h1 class=\"h-xl\">Websites that hold attention.<br><span class=\"muted\">Platforms that deliver results.<\/span><\/h1>\r\n        <div class=\"hero-side\">\r\n          <p>Scrollcraft Studio is a design and build studio, connecting marketing, sales, writing, design, and data.<\/p>\r\n          <p class=\"cue\">Scroll<\/p>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene statement\" id=\"approach\" data-scene=\"1\" data-label=\"Approach\" data-tint=\"#A9BCE0\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Approach<\/p>\r\n        <h2 class=\"h-xl\"><span class=\"muted\">Every site is designed and tailored<\/span> for both form and function.<\/h2>\r\n        <p class=\"note\">Beyond exceptional design, we build tools that drive performance: workflows, lead capture, reporting, and integrations that connect writing, sales, marketing, design, and data.<\/p>\r\n        <p class=\"note\">We scope each build around your requirements, then design a tailored, holistic solution.<\/p>\r\n      <\/div>\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene work\" id=\"work\" data-scene=\"2\" data-label=\"(Re)in Asia\" data-tint=\"#E2546F\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Selected work \u00b7 01 \/ 04<\/p>\r\n        <h2 class=\"h-l\">(Re)in Asia<\/h2>\r\n        <p class=\"desc\">The daily read for Asia-Pacific insurance and reinsurance professionals. Behind the site sits a suite of tools we built for the team: story planning, homepage curation, a daily newsletter builder, and sales and partner reporting.<\/p>\r\n        <ul class=\"tags\"><li>Editorial platform &amp; CMS<\/li><li>Publishing tools<\/li><li>Sales &amp; data reporting<\/li><\/ul>\r\n        <a class=\"visit\" href=\"https:\/\/www.reinasia.com\/\" target=\"_blank\" rel=\"noopener\">Visit reinasia.com <span aria-hidden=\"true\">\u2197<\/span><\/a>\r\n      <\/div>\r\n      <img loading=\"lazy\" class=\"shot\" src=\"https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/reinasia.webp\" width=\"1440\" height=\"2276\" loading=\"lazy\" decoding=\"async\" alt=\"The reinasia.com homepage: a features carousel, the latest news list and navigation for specialist hubs.\">\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene work\" data-scene=\"3\" data-label=\"GitGud\" data-tint=\"#E8623A\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Selected work \u00b7 02 \/ 04<\/p>\r\n        <h2 class=\"h-l\">GitGud<\/h2>\r\n        <p class=\"desc\">Gaming news and culture, plus an Academy built around an in-browser training game. Players learn a skill, see it demonstrated, then practise it in playable drills, starting with an aim trainer and a corner-strafing exercise shown in first person and from above.<\/p>\r\n        <ul class=\"tags\"><li>Editorial platform<\/li><li>Academy &amp; learning UX<\/li><li>In-browser training game<\/li><\/ul>\r\n        <a class=\"visit\" href=\"https:\/\/gitgudhq.com\/\" target=\"_blank\" rel=\"noopener\">Visit gitgudhq.com <span aria-hidden=\"true\">\u2197<\/span><\/a>\r\n      <\/div>\r\n      <img loading=\"lazy\" class=\"shot\" src=\"https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/gitgud.webp\" width=\"1440\" height=\"2090\" loading=\"lazy\" decoding=\"async\" alt=\"The GitGud homepage: a newspaper-style masthead, a lead story slot and the Academy panel.\">\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene work\" data-scene=\"4\" data-label=\"Asia Consumer Insurance Awards\" data-tint=\"#5CC8C2\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Selected work \u00b7 03 \/ 04<\/p>\r\n        <h2 class=\"h-l\">Asia Consumer Insurance Awards<\/h2>\r\n        <p class=\"desc\">(Re)in Asia's awards programme for consumer insurance, recognising the insurers making a real difference for households across Asia.<\/p>\r\n        <ul class=\"tags\"><li>Awards showcase<\/li><li>Entry management platform<\/li><li>Backend workflows &amp; tools<\/li><\/ul>\r\n        <a class=\"visit\" href=\"https:\/\/asiaconsumerinsuranceawards.com\/\" target=\"_blank\" rel=\"noopener\">Visit the site <span aria-hidden=\"true\">\u2197<\/span><\/a>\r\n      <\/div>\r\n      <img loading=\"lazy\" class=\"shot\" src=\"https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/consumer.webp\" width=\"1440\" height=\"2560\" loading=\"lazy\" decoding=\"async\" alt=\"The Asia Consumer Insurance Awards homepage: trophies photographed in blue light behind the programme logo.\">\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene work\" data-scene=\"5\" data-label=\"Asia Commercial Insurance Awards\" data-tint=\"#6E9BEA\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Selected work \u00b7 04 \/ 04<\/p>\r\n        <h2 class=\"h-l\">Asia Commercial Insurance Awards<\/h2>\r\n        <p class=\"desc\">(Re)in Asia's awards programme for commercial and specialty insurance, recognising excellence in how Asia's businesses are protected.<\/p>\r\n        <ul class=\"tags\"><li>Awards showcase<\/li><li>Entry management platform<\/li><li>Backend workflows &amp; tools<\/li><\/ul>\r\n        <a class=\"visit\" href=\"https:\/\/asiacommercialinsuranceawards.com\/\" target=\"_blank\" rel=\"noopener\">Visit the site <span aria-hidden=\"true\">\u2197<\/span><\/a>\r\n      <\/div>\r\n      <img loading=\"lazy\" class=\"shot\" src=\"https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/commercial.webp\" width=\"1440\" height=\"2600\" loading=\"lazy\" decoding=\"async\" alt=\"The Asia Commercial Insurance Awards homepage: a container ship at sea behind the programme logo and entry countdown.\">\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene services\" id=\"services\" data-scene=\"6\" data-label=\"Services\" data-tint=\"#F0C35A\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Services<\/p>\r\n        <h2 class=\"h-l\">What we do<\/h2>\r\n        <ol class=\"svc\">\r\n          <li><span class=\"n\">01<\/span><h3>Web design<\/h3><p>Sites designed for form and function, from first sketch to launch.<\/p><\/li>\r\n          <li><span class=\"n\">02<\/span><h3>Motion &amp; interaction<\/h3><p>Scroll-led storytelling, interactive graphics, and motion that give a brand its own pace.<\/p><\/li>\r\n          <li><span class=\"n\">03<\/span><h3>Content platforms<\/h3><p>Everything from newsrooms and specialist hubs to academies and learning platforms.<\/p><\/li>\r\n          <li><span class=\"n\">04<\/span><h3>Platform tools<\/h3><p>Lead capture, sales and marketing integrations, newsletters, dashboards, and reporting that connect writing, sales, marketing, design, and data.<\/p><\/li>\r\n          <li><span class=\"n\">05<\/span><h3>Development &amp; support<\/h3><p>Fast, accessible builds on WordPress or headless stacks, with hosting, updates, and support after launch.<\/p><\/li>\r\n        <\/ol>\r\n      <\/div>\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <section class=\"scene contact\" id=\"contact\" data-scene=\"7\" data-label=\"Contact\" data-tint=\"#B4A7E8\">\r\n    <div class=\"scene-inner\">\r\n      <div class=\"content\">\r\n        <p class=\"eyebrow\">Contact<\/p>\r\n        <h2 class=\"h-l\">Start a project<\/h2>\r\n        <p>Tell us what the site needs to do. We'll reply with questions, an approach, and a rough timeline.<\/p>\r\n        <form class=\"enquiry\" id=\"enquiry\" novalidate>\r\n          <div class=\"row\">\r\n            <label class=\"field\" for=\"f-name\"><span>Name<\/span><input id=\"f-name\" name=\"name\" type=\"text\" autocomplete=\"name\" required><small class=\"err\" id=\"e-name\"><\/small><\/label>\r\n            <label class=\"field\" for=\"f-email\"><span>Email<\/span><input id=\"f-email\" name=\"email\" type=\"email\" autocomplete=\"email\" required><small class=\"err\" id=\"e-email\"><\/small><\/label>\r\n          <\/div>\r\n          <div class=\"row\">\r\n            <label class=\"field\" for=\"f-company\"><span>Company <em>optional<\/em><\/span><input id=\"f-company\" name=\"company\" type=\"text\" autocomplete=\"organization\"><\/label>\r\n            <label class=\"field\" for=\"f-type\"><span>Project<\/span>\r\n              <select id=\"f-type\" name=\"type\">\r\n                <option value=\"\">Choose one<\/option>\r\n                <option>New website<\/option>\r\n                <option>Redesign<\/option>\r\n                <option>Editorial platform<\/option>\r\n                <option>Awards or event site<\/option>\r\n                <option>Motion or interactive feature<\/option>\r\n                <option>Ongoing support<\/option>\r\n              <\/select>\r\n            <\/label>\r\n          <\/div>\r\n          <label class=\"field\" for=\"f-msg\"><span>What does the site need to do?<\/span><textarea id=\"f-msg\" name=\"message\" rows=\"3\" required><\/textarea><small class=\"err\" id=\"e-msg\"><\/small><\/label>\r\n          <div class=\"form-foot\">\r\n            <button class=\"send\" type=\"submit\">Send enquiry <span aria-hidden=\"true\">\u2192<\/span><\/button>\r\n            <p class=\"form-status\" id=\"form-status\" role=\"status\" aria-live=\"polite\"><\/p>\r\n          <\/div>\r\n        <\/form>\r\n      <\/div>\r\n      <footer class=\"foot\">\r\n        <span>\u00a9 2026 Playfair Media Limited<\/span>\r\n        <span>17\/F, 80 Gloucester Road, Wan Chai, Hong Kong<\/span>\r\n        <a href=\"https:\/\/scrollcraftstudio.com\/\" target=\"_blank\" rel=\"noopener\">scrollcraftstudio.com<\/a>\r\n        <a href=\"#top\">Back to top \u2191<\/a>\r\n      <\/footer>\r\n    <\/div>\r\n  <\/section>\r\n<\/main>\r\n\r\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/lenis@1.3.26\/dist\/lenis.min.js\"><\/script>\r\n<script>\r\n(() => {\r\n  'use strict';\r\n  const doc = document.documentElement;\r\n  const $ = (s, c = document) => c.querySelector(s);\r\n  const $$ = (s, c = document) => Array.from(c.querySelectorAll(s));\r\n  const clamp = (v, a = 0, b = 1) => (v < a ? a : v > b ? b : v);\r\n  const lerp = (a, b, t) => a + (b - a) * t;\r\n  const smooth = (a, b, v) => { const t = clamp((v - a) \/ (b - a)); return t * t * (3 - 2 * t); };\r\n  const setVar = (el, k, v) => { const key = '_v' + k; if (el[key] !== v) { el[key] = v; el.style.setProperty(k, v); } };\r\n  const RM = matchMedia('(prefers-reduced-motion: reduce)').matches;\r\n  const FINE = matchMedia('(hover: hover) and (pointer: fine)').matches;\r\n\r\n  \/* ---------- enquiry form (not connected to a handler in this preview) ---------- *\/\r\n  const form = $('#enquiry'), status = $('#form-status');\r\n  const showErr = (input, msgEl, msg) => {\r\n    input.setAttribute('aria-invalid', msg ? 'true' : 'false');\r\n    if (msgEl) msgEl.textContent = msg || '';\r\n    if (msg) input.setAttribute('aria-describedby', msgEl.id); else input.removeAttribute('aria-describedby');\r\n  };\r\n  form.addEventListener('submit', e => {\r\n    e.preventDefault();\r\n    const name = $('#f-name'), email = $('#f-email'), msg = $('#f-msg');\r\n    const bad = [];\r\n    const nm = name.value.trim(), em = email.value.trim(), ms = msg.value.trim();\r\n    showErr(name, $('#e-name'), nm ? '' : 'Add your name so we know who to reply to.'); if (!nm) bad.push(name);\r\n    const okEmail = \/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$\/.test(em);\r\n    showErr(email, $('#e-email'), okEmail ? '' : 'Enter an email address like name@company.com.'); if (!okEmail) bad.push(email);\r\n    showErr(msg, $('#e-msg'), ms ? '' : 'Tell us a little about the project.'); if (!ms) bad.push(msg);\r\n    if (bad.length) { status.textContent = ''; bad[0].focus(); return; }\r\n    status.textContent = `Thanks, ${nm.split(' ')[0]}. This preview isn't connected to an inbox yet, so nothing was sent.`;\r\n  });\r\n\r\n  \/* ---------- scenes, scrolling, progress ---------- *\/\r\n  const sections = $$('[data-scene]');\r\n  const n = sections.length;\r\n  const hex = h => [1, 3, 5].map(i => parseInt(h.slice(i, i + 2), 16));\r\n  const tints = sections.map(s => hex(s.dataset.tint || '#ECE8E1'));\r\n\r\n  let lenis = null;\r\n  if (!RM && typeof window.Lenis === 'function') {\r\n    try { lenis = new window.Lenis({ lerp: 0.085, smoothWheel: true, wheelMultiplier: 0.9 }); } catch (e) { lenis = null; }\r\n  }\r\n  const ease = t => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) \/ 2);\r\n  const SCROLL_DUR = 2600, LINK_DUR = 1300, STEP = 0.06;\r\n  let held = false;\r\n  \/\/ On desktop, one scroll gesture moves one scene: the page glides there while the particles change, and input waits.\r\n  const guided = () => !!lenis && FINE && doc.classList.contains('gl');\r\n  const mobileGuided = () => !!lenis && !RM && !FINE && innerWidth <= 760 && doc.classList.contains('gl');\r\n  const refreshMobileGuidance = () => doc.classList.toggle('mobile-scenes', mobileGuided());\r\n  refreshMobileGuidance();\r\n  addEventListener('resize', refreshMobileGuidance);\r\n  const goToY = (y, dur = 1.2) => {\r\n    if (lenis) lenis.scrollTo(y, { duration: dur, easing: ease, force: true });\r\n    else window.scrollTo({ top: y, behavior: RM ? 'auto' : 'smooth' });\r\n  };\r\n  $$('a[href^=\"#\"]').forEach(a => a.addEventListener('click', e => {\r\n    const id = a.getAttribute('href');\r\n    if (id.length < 2) return;\r\n    const target = $(id);\r\n    if (!target) return;\r\n    e.preventDefault();\r\n    const scene = id === '#main' ? sections[0] : target.closest('[data-scene]');\r\n    if (scene) jumpTo(sections.indexOf(scene)); else goToY(target.getBoundingClientRect().top + scrollY);\r\n    if (!target.hasAttribute('tabindex')) target.setAttribute('tabindex', '-1');\r\n    target.focus({ preventScroll: true });\r\n  }));\r\n\r\n  const dotsNav = $('.dots');\r\n  const dots = sections.map((s, k) => {\r\n    const b = document.createElement('button');\r\n    b.type = 'button';\r\n    b.setAttribute('aria-label', 'Go to ' + s.dataset.label);\r\n    b.addEventListener('click', () => jumpTo(k));\r\n    dotsNav.appendChild(b);\r\n    return b;\r\n  });\r\n\r\n  let vh = innerHeight, lastY = scrollY, velS = 0, activeDot = -1;\r\n  const state = { S: 0 };\r\n  \/\/ where each scene rests: the middle of its pinned stretch, or the top of a scene that scrolls normally\r\n  const settle = new Array(n).fill(0);\r\n  let pinned = [];\r\n  const refreshPinned = () => { pinned = sections.map(s => getComputedStyle(s.firstElementChild).position === 'sticky'); };\r\n  refreshPinned();\r\n  addEventListener('resize', refreshPinned);\r\n  function readScroll() {\r\n    const y = scrollY, max = Math.max(0, doc.scrollHeight - innerHeight);\r\n    sections.forEach((s, k) => {\r\n      const r = s.getBoundingClientRect(), top = r.top + y;\r\n      settle[k] = k === 0 ? 0 : Math.min(max, Math.max(0, pinned[k] ? top + (r.height - innerHeight) \/ 2 : top));\r\n    });\r\n    let i = 0;\r\n    while (i < n - 1 && settle[i + 1] <= y) i++;\r\n    let t = 0;\r\n    if (i < n - 1 && y > settle[i]) t = clamp((y - settle[i]) \/ Math.max(1, settle[i + 1] - settle[i]));\r\n    state.S = i + t;\r\n  }\r\n  \/\/ what the particles are showing; a change always plays through to the end\r\n  const disp = { cur: 0, from: 0, to: 0, mix: 0, active: false, t0: 0, dur: 0, target: 0, queued: -1, cool: 0 };\r\n  \/* ---------- mobile swipe controller ---------- *\/\r\n  let mobileQueued = -1, mobileNeedsAlignment = true;\r\n  addEventListener('pageshow', () => { mobileNeedsAlignment = true; });\r\n  const swipe = { id: null, x: 0, y: 0, fired: false, ignored: true };\r\n  const resetSwipe = () => { swipe.id = null; swipe.fired = false; swipe.ignored = true; };\r\n  addEventListener('touchstart', e => {\r\n    resetSwipe();\r\n    if (!mobileGuided() || e.touches.length !== 1) return;\r\n    if (e.target.closest('input, textarea, select, button, [contenteditable]')) return;\r\n    \/\/ A gesture beginning inside the long contact form stays native all the way to its top.\r\n    if (disp.cur === n - 1 && scrollY > settle[n - 1] + 2) return;\r\n    const t = e.touches[0];\r\n    swipe.id = t.identifier; swipe.x = t.clientX; swipe.y = t.clientY; swipe.ignored = false;\r\n    swipe.fired = disp.active || held || performance.now() < disp.cool;\r\n  }, { passive: true });\r\n  addEventListener('touchmove', e => {\r\n    if (!mobileGuided() || swipe.ignored) return;\r\n    if (e.touches.length !== 1) { swipe.ignored = true; return; }\r\n    const t = e.touches[0];\r\n    if (t.identifier !== swipe.id) { swipe.ignored = true; return; }\r\n    const dx = t.clientX - swipe.x, dy = swipe.y - t.clientY;\r\n    if (Math.abs(dx) > 8 && Math.abs(dx) > Math.abs(dy)) { swipe.ignored = true; return; }\r\n    if (Math.abs(dy) < 8) return;\r\n    \/\/ Upward swipes on Contact scroll its contents; a fresh downward swipe at its top goes back.\r\n    if (!swipe.fired && disp.cur === n - 1 && dy > 0) { swipe.ignored = true; return; }\r\n    if (e.cancelable) e.preventDefault();\r\n    if (swipe.fired || Math.abs(dy) < 40) return;\r\n    swipe.fired = true;\r\n    if (disp.active || held || performance.now() < disp.cool) return;\r\n    const next = clamp(disp.cur + (dy > 0 ? 1 : -1), 0, n - 1);\r\n    if (next !== disp.cur) mobileQueued = next;\r\n  }, { passive: false });\r\n  addEventListener('touchend', e => { if (!e.touches.length) resetSwipe(); }, { passive: true });\r\n  addEventListener('touchcancel', resetSwipe, { passive: true });\r\n  \/* ---------- mobile swipe controller end ---------- *\/\r\n\r\n  function begin(to, now, quick) {\r\n    disp.from = disp.cur; disp.to = to; disp.target = to; disp.t0 = now; disp.active = true;\r\n    disp.dur = RM ? 1 : quick ? LINK_DUR : SCROLL_DUR;\r\n    if (quick || guided() || mobileGuided()) {\r\n      \/\/ hold scroll input while the change plays, so a fast flick or trackpad momentum can't skip scenes\r\n      if (lenis && (guided() || mobileGuided())) { lenis.stop(); held = true; }\r\n      if (lenis) lenis.scrollTo(settle[to], { duration: disp.dur * 0.92 \/ 1000, easing: ease, force: true });\r\n      else window.scrollTo({ top: settle[to], behavior: RM ? 'auto' : 'smooth' });\r\n    }\r\n  }\r\n  \/\/ links and the scene dots: go straight there, faster than scrolling\r\n  function jumpTo(k) {\r\n    if (k < 0) return;\r\n    mobileQueued = -1;\r\n    if (!doc.classList.contains('gl')) { goToY(settle[k]); return; }\r\n    if (disp.active) { disp.t0 = performance.now() - disp.mix * LINK_DUR; disp.dur = LINK_DUR; }\r\n    disp.queued = k;\r\n  }\r\n  function updateDisp(now) {\r\n    if (mobileGuided() && mobileNeedsAlignment && document.readyState === 'complete' && !disp.active) {\r\n      \/\/ Reloads, deep links and history restoration start with a complete matching scene.\r\n      const linked = location.hash ? sections.findIndex(s => '#' + s.id === location.hash) : -1;\r\n      const k = linked >= 0 ? linked : clamp(Math.round(state.S), 0, n - 1);\r\n      disp.cur = disp.from = disp.to = disp.target = k;\r\n      disp.mix = 0; mobileNeedsAlignment = false;\r\n      lenis.scrollTo(k === n - 1 ? Math.max(scrollY, settle[k]) : settle[k], { immediate: true, force: true });\r\n    }\r\n    if (mobileGuided() && !disp.active && disp.cur === n - 1 && scrollY < settle[n - 1]) {\r\n      \/\/ A native drag inside the form stops at its top; the next fresh swipe can leave it.\r\n      lenis.scrollTo(settle[n - 1], { immediate: true, force: true });\r\n    }\r\n    if (held && !disp.active && (now > disp.cool || (!guided() && !mobileGuided()))) { lenis.start(); held = false; }\r\n    if (!disp.active) {\r\n      let next = -1, quick = false;\r\n      if (disp.queued >= 0) { next = disp.queued; quick = true; disp.queued = -1; }\r\n      else if (mobileGuided() && mobileQueued >= 0) { next = mobileQueued; mobileQueued = -1; }\r\n      else if (held) next = -1;\r\n      else if (guided()) {\r\n        \/\/ a big jump (scrollbar, keyboard, find in page) goes straight to the nearest scene; a scroll gesture moves one scene\r\n        if (Math.abs(state.S - disp.cur) > 1.2) { next = Math.max(0, Math.min(n - 1, Math.round(state.S))); quick = true; }\r\n        else if (state.S > disp.cur + STEP) next = Math.min(n - 1, disp.cur + 1);\r\n        else if (state.S < disp.cur - STEP) next = Math.max(0, disp.cur - 1);\r\n      } else if (mobileGuided()) {\r\n        \/\/ Touch swipes and explicit navigation choose a scene; native contact scrolling cannot queue another.\r\n        next = -1;\r\n      } else {\r\n        if (Math.abs(state.S - disp.target) > 0.58) disp.target = Math.max(0, Math.min(n - 1, Math.round(state.S)));\r\n        next = disp.target;\r\n      }\r\n      if (next >= 0 && next !== disp.cur) begin(next, now, quick);\r\n      else if (quick && next === disp.cur) goToY(settle[next]);\r\n    }\r\n    if (disp.active) {\r\n      disp.mix = clamp((now - disp.t0) \/ disp.dur);\r\n      if (disp.mix >= 1) {\r\n        disp.cur = disp.to; disp.active = false; disp.cool = now + 280;\r\n        if (mobileGuided() && !(disp.cur === n - 1 && document.activeElement.matches('input, textarea, select, [contenteditable]'))) {\r\n          lenis.scrollTo(settle[disp.cur], { immediate: true, force: true });\r\n        }\r\n      }\r\n    }\r\n    if (!disp.active) { disp.from = disp.to = disp.cur; disp.mix = 0; }\r\n  }\r\n  function writeChrome() {\r\n    if (doc.classList.contains('gl')) sections.forEach((s, k) => {\r\n      const p = disp.active\r\n        ? (k === disp.from ? 1 - smooth(0, 0.28, disp.mix) : 0) + (k === disp.to ? smooth(0.72, 1, disp.mix) : 0)\r\n        : (k === disp.cur ? 1 : 0);\r\n      setVar(s, '--p', p.toFixed(3));\r\n    });\r\n    const a = tints[disp.from], b = tints[disp.to], m = smooth(0.3, 0.8, disp.mix);\r\n    setVar(doc, '--tint', `rgb(${Math.round(lerp(a[0], b[0], m))},${Math.round(lerp(a[1], b[1], m))},${Math.round(lerp(a[2], b[2], m))})`);\r\n    const on = disp.active ? disp.to : disp.cur;\r\n    if (on !== activeDot) {\r\n      dots.forEach((d, k) => { d.classList.toggle('on', k === on); if (k === on) d.setAttribute('aria-current', 'step'); else d.removeAttribute('aria-current'); });\r\n      activeDot = on;\r\n    }\r\n  }\r\n\r\n  \/* ---------- the pixel field ---------- *\/\r\n  const canvas = $('#gl');\r\n  let gl = null;\r\n  if (doc.classList.contains('gl')) {\r\n    try { gl = canvas.getContext('webgl2', { antialias: false, alpha: false, depth: false, stencil: false, premultipliedAlpha: true, powerPreference: 'high-performance' }); } catch (e) { gl = null; }\r\n  }\r\n  const fallback = () => { gl = null; doc.classList.remove('gl'); doc.classList.add('nogl'); sections.forEach(s => s.style.removeProperty('--p')); };\r\n  if (!gl || (!FINE && innerWidth <= 760 && !lenis)) fallback();\r\n\r\n  const BIG = innerWidth >= 900 && !matchMedia('(pointer: coarse)').matches;\r\n  const TW = BIG ? 448 : 256;\r\n  const N = TW * TW;\r\n\r\n  const FOV = 35 * Math.PI \/ 180, CAMZ = 10, PAGE_AR = 1.6;\r\n  const SRC = ['https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/reinasia.webp', 'https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/gitgud.webp', 'https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/consumer.webp', 'https:\/\/scrollcraftstudio.com\/wp-content\/uploads\/2026\/10\/commercial.webp'];\r\n  const STYLE = [0, 4, 1, 2, 3, 0, 5];      \/\/ flow, lift, burst, rain, vortex, flow, unwind (indexed by the scene being left)\r\n  const KIND = [0, 1, 2, 2, 2, 2, 3, 0];    \/\/ stars, sea, page x4, helix, stars\r\n  const GAIN = [3.3, 1.05, 1.0, 2.0];       \/\/ HDR energy per kind\r\n  const BRAND = [[217, 62, 92], [228, 98, 58], [87, 198, 194], [96, 146, 228]];\r\n  const TEMP = [[255, 214, 172], [255, 246, 236], [180, 202, 255]];\r\n  const LOCKUP = [{ t: 'Scrollcraft', fs: 260, wt: 800 }, { t: 'STUDIO', fs: 56, wt: 600, track: 0.62 }];\r\n  const LOCKUP_END = [{ t: 'Scrollcraft', fs: 260, wt: 800 }, { t: 'STUDIO', fs: 78, wt: 700, track: 0.42 }];\r\n\r\n  \/* particles: one instanced quad each, stretched along its screen-space velocity *\/\r\n  const VS = `#version 300 es\r\nprecision highp float;\r\nprecision highp int;\r\nprecision highp sampler2D;\r\nlayout(location = 0) in float aRand;\r\nlayout(location = 1) in vec2 aCorner;\r\nuniform sampler2D uPosA;\r\nuniform sampler2D uPosB;\r\nuniform sampler2D uColA;\r\nuniform sampler2D uColB;\r\nuniform sampler2D uWake;\r\nuniform int uTexW;\r\nuniform float uMix, uMixPrev, uStyle, uKindA, uKindB, uTime, uDt, uShutter, uTilt, uIntro, uIntroPrev, uBrush, uDpr, uFocus, uAspect, uAperture, uGainA, uGainB, uVel, uBreath, uSolid, uGrainK;\r\nuniform vec2 uWH, uPar, uHalfRes, uWakeTexel;\r\nuniform float uDis, uPart;\r\nuniform vec3 uImgC, uHelC, uWordC;\r\nuniform mat4 uProj, uView;\r\nout vec4 vCol;\r\nout vec2 vQ;\r\nout float vStretch;\r\nout float vDen;\r\nout float vSoft;\r\nout float vAdd;\r\nout float vCov;\r\nout float vBead;\r\nout vec4 vShape;\r\n\r\nfloat hash(float n){ return fract(sin(n) * 43758.5453123); }\r\nvec3 toLin(vec3 c){ return mix(c \/ 12.92, pow((c + .055) \/ 1.055, vec3(2.4)), step(.04045, c)); }\r\nfloat h2(vec2 p){ vec3 q = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); }\r\nfloat vnoise(vec2 p){ vec2 i = floor(p), f = fract(p); f = f * f * (3. - 2. * f);\r\n  return mix(mix(h2(i), h2(i + vec2(1., 0.)), f.x), mix(h2(i + vec2(0., 1.)), h2(i + vec2(1., 1.)), f.x), f.y); }\r\n\/\/ the grain the letters crumble into, fixed in screen space and shared with the text shader\r\nfloat grain(vec2 ndc){ vec2 q = ndc * vec2(uAspect, 1.) * uGrainK; return .62 * vnoise(q) + .38 * vnoise(q * 2.3 + 17.3); }\r\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, s, -s, c); }\r\nfloat eio(float t){ return t < .5 ? 4. * t * t * t : 1. - pow(-2. * t + 2., 3.) * .5; }\r\n\/\/ a slow, swirling current: the curl of a smooth field, so particles stream around each other without bunching up\r\nfloat psi(vec2 q, float t){\r\n  return sin(q.x * 1.7 + 1.3 * sin(q.y * 1.1 + t * .21)) * cos(q.y * 1.3 - .7 + .9 * sin(q.x * .8 - t * .17))\r\n       + .5 * sin(q.x * 3.1 + q.y * 2.3 + t * .29);\r\n}\r\nvec2 flow(vec2 q, float t){\r\n  const float E = .03;\r\n  float dx = psi(q + vec2(E, 0.), t) - psi(q - vec2(E, 0.), t);\r\n  float dy = psi(q + vec2(0., E), t) - psi(q - vec2(0., E), t);\r\n  vec2 v = vec2(dy, -dx) \/ (2. * E);\r\n  float l = length(v);\r\n  return l > 2.2 ? v * 2.2 \/ l : v;\r\n}\r\n\/\/ each wordmark particle lives for a few seconds, then is reborn close by\r\nvoid life(vec3 rr, float tm, out float age, out float cyc){\r\n  float lt = tm * (.2 + .16 * rr.y) + rr.x * 9.;\r\n  age = fract(lt); cyc = floor(lt);\r\n}\r\n\r\n\/\/ shape weights: x halo, y spiked star, z nebula haze, w hard disc (page pixels); remainder = soft star\r\nvoid props(float kind, float I, vec3 rr, out float add, out vec4 shp, out float sz, out float tw, out float am, out float ap){\r\n  am = 1.; ap = 1.;\r\n  if (kind < .5) {\r\n    add = 1.; tw = .3; ap = .15; shp = vec4(0.); sz = mix(1. + rr.z * .2, 1.9 + 1.3 * rr.z * rr.z, step(.95, I));\r\n  } else if (kind < 1.5) {\r\n    add = 1.; tw = .25; ap = .3;\r\n    if (I > .95) { shp = vec4(1., 0., 0., 0.); sz = 3.; }\r\n    else         { shp = vec4(0.); sz = 1. + rr.z * .6; }\r\n  } else if (kind < 2.5) {\r\n    add = 0.; tw = 0.; shp = vec4(0., 0., 0., 1.); sz = 1.;\r\n  } else {\r\n    add = 1.; tw = .2; shp = vec4(0.); sz = 1.1 + rr.z * .8;\r\n  }\r\n}\r\n\r\nvec3 particlePos(float mixv, float tm, vec3 A, vec3 B, vec3 rr, float auraF, out float e, out float w, out float m, out float hz, out vec4 kw){\r\n  float sweep = clamp(A.x \/ uWH.x + .5, 0., 1.);\r\n  float d;\r\n  if (uStyle < .5) d = sweep * .38 + rr.x * .12;\r\n  else if (uStyle < 1.5) d = rr.x * .5;\r\n  else if (uStyle < 2.5) d = sweep * .42 + rr.y * .08;\r\n  else if (uStyle < 3.5) d = clamp(length(A.xy - uImgC.xy) \/ 3., 0., 1.) * .4 + rr.z * .1;\r\n  else if (uStyle < 4.5) d = rr.x * .5;\r\n  else d = clamp(B.x \/ uWH.x + .5, 0., 1.) * .4 + rr.x * .1;\r\n  m = clamp((mixv - d) \/ .5, 0., 1.);\r\n  e = eio(m);\r\n  w = sin(m * 3.14159265);\r\n  \/\/ how much this particle currently belongs to each kind of formation: x sea, y page, z helix, w stars\r\n  kw = mix(vec4(step(.5, uKindA) * step(uKindA, 1.5), step(1.5, uKindA) * step(uKindA, 2.5), step(2.5, uKindA), step(uKindA, .5)),\r\n           vec4(step(.5, uKindB) * step(uKindB, 1.5), step(1.5, uKindB) * step(uKindB, 2.5), step(2.5, uKindB), step(uKindB, .5)), e);\r\n  vec3 p = mix(A, B, e);\r\n  vec3 mid = mix(A, B, .5);\r\n  if (uStyle < .5) {\r\n    vec3 q = mid * .45;\r\n    vec3 f = vec3(\r\n      sin(q.y * 2.3 + q.z * 1.1 + tm * .35 + rr.x * 6.2832),\r\n      sin(q.z * 1.9 + q.x * 1.7 + tm * .3 + rr.y * 6.2832),\r\n      sin(q.x * 2.1 + q.y * 1.3 + tm * .25 + rr.z * 6.2832));\r\n    p += f * w * 1.4;\r\n  } else if (uStyle < 1.5) {\r\n    vec2 dir = normalize(mid.xy - uImgC.xy + (rr.xy - .5) * .8);\r\n    p.xy += dir * w * (.9 + rr.y * 1.8);\r\n    p.z += w * (.8 + rr.z * 1.6);\r\n  } else if (uStyle < 2.5) {\r\n    p.y -= w * (2.4 + rr.y * 3.2);\r\n    p.x += (rr.x - .5) * w * .5;\r\n    p.z += (rr.z - .5) * w * 1.5;\r\n  } else if (uStyle < 3.5) {\r\n    vec3 c = vec3(uImgC.x, 0., 0.);\r\n    vec3 o = p - c;\r\n    o.xz = rot(w * (3.5 + rr.x * 2.5)) * o.xz;\r\n    o.y += sin(rr.y * 6.2832 + tm * .5) * w * .6;\r\n    p = c + o * (1. - w * .2);\r\n  } else if (uStyle < 4.5) {\r\n    p.y += w * (2. + rr.y * 3.5);\r\n    p.x += sin(rr.z * 6.2832 + tm * .4) * w * .7;\r\n    p.z += (rr.x - .5) * w * 2.;\r\n  } else {\r\n    \/\/ unwind: settle into a calm, flat band of light at the word's height, then open out into the letters\r\n    p.y = mix(p.y, uWordC.y + (p.y - uWordC.y) * .15, w * .85);\r\n    p.z *= 1. - w * .9;\r\n  }\r\n  float sea = step(p.y, -uWH.y * .2);\r\n  p.y += kw.x * sea * (sin(p.x * .7 + tm * .45) * .22 + sin(p.z * .9 + tm * .32 + p.x * .35) * .26);\r\n  hz = 0.;\r\n  if (kw.z > 0.) {\r\n    vec3 o = p - uHelC;\r\n    vec3 sp = o;\r\n    sp.yz = rot(tm * .3) * sp.yz;\r\n    hz = sp.z;\r\n    sp.xz = rot(-.22) * sp.xz;\r\n    sp.xy = rot(.2) * sp.xy;\r\n    p = uHelC + mix(o, sp, kw.z);\r\n  }\r\n  float tW = kw.y * uTilt;\r\n  if (tW > 0.) { vec3 o = p - uImgC; o.xz = rot((-.2 + uPar.x * .22) * tW) * o.xz; o.yz = rot(uPar.y * .14 * tW) * o.yz; p = uImgC + o; }\r\n  float calmK = (1. - kw.y * .9) * (1. - kw.w * step(-1.5, p.z) * .95);\r\n  p += (rr - .5) * calmK * (.008 * sin(tm * (.15 + .25 * rr.x) + rr.y * 6.2832) + min(abs(uVel) * .0005, .05));\r\n  \/\/ the background sky drifts very slowly\r\n  float sky = kw.w * smoothstep(-2., -4., p.z);\r\n  p.xy += sky * vec2(sin(tm * (.03 + .03 * rr.x) + rr.y * 6.2832), cos(tm * (.025 + .02 * rr.z) + rr.x * 6.2832)) * (.15 + .25 * rr.z);\r\n  \/\/ the wordmark is alive: every particle flows along the current, fades out and is reborn close by;\r\n  \/\/ the aura streams further, drifting off the letters like vapour, and the opening one breathes\r\n  float word = kw.w * (1. - smoothstep(-1.5, -3., p.z));\r\n  if (word > 0.) {\r\n    vec2 o = p.xy - uWordC.xy;\r\n    p.xy = uWordC.xy + o * (1. + .012 * sin(tm * .55) * word * uBreath);\r\n    float age, cyc;\r\n    life(rr, tm, age, cyc);\r\n    vec2 jit = vec2(hash(cyc * 13.17 + rr.z * 91.3), hash(cyc * 7.31 + rr.y * 53.7)) - .5;\r\n    float spark = step(.985, rr.z) * auraF, floater = step(.4, p.z);\r\n    vec2 h = p.xy + jit * (mix(.012, .04, auraF) + floater * .3);\r\n    vec2 v = flow(h * 1.5, tm);\r\n    float travel = mix(.008, .16, auraF) + floater * .2 + spark * .3;\r\n    vec2 dd = v * (age - .3) * travel + auraF * vec2(0., age * .05) + spark * vec2(0., age * .25);\r\n    p.xy = mix(p.xy, h + dd, word);\r\n    p.z += word * (age - .5) * .12 * (rr.y - .5);\r\n  }\r\n  return p;\r\n}\r\n\r\nvec3 gather(vec3 p, vec3 rr, float k0){\r\n  if (k0 <= 0.) return p;\r\n  vec3 s = (rr - .5) * vec3(uWH.x * 1.8, uWH.y * 1.8, 16.);\r\n  float k = clamp(k0 * 1.5 - rr.x * .5, 0., 1.);\r\n  k = k * k * (3. - 2. * k);\r\n  return mix(p, s, k);\r\n}\r\n\r\n\/\/ cursor wake: particles slide down the slope of a slowly built pressure field left behind the cursor;\r\n\/\/ also hands back the pressure where the particle sits, so the letters can dissolve there\r\nvec3 wake(vec3 p, vec3 rr, float k, out float g){\r\n  vec4 c0 = uProj * uView * vec4(p, 1.);\r\n  vec2 uv = c0.xy \/ c0.w * .5 + .5;\r\n  vec4 wk = texture(uWake, uv);\r\n  g = wk.g;\r\n  float gL = texture(uWake, uv - vec2(uWakeTexel.x, 0.)).g;\r\n  float gR = texture(uWake, uv + vec2(uWakeTexel.x, 0.)).g;\r\n  float gD = texture(uWake, uv - vec2(0., uWakeTexel.y)).g;\r\n  float gU = texture(uWake, uv + vec2(0., uWakeTexel.y)).g;\r\n  vec2 grad = vec2(gR - gL, gU - gD) * .5;\r\n  vec2 push = (-grad * .65 + wk.ba * .35) * vec2(1. \/ uAspect, 1.);\r\n  float ds = c0.w \/ 10.;\r\n  vec2 d2d = push * uWH * .5 * ds * k * (.8 + .4 * rr.y);\r\n  float L = length(d2d);\r\n  d2d *= min(L, .45) \/ max(L, 1e-5);     \/\/ the letters open about a stroke wide; nothing gets flung\r\n  return vec3(d2d, wk.g * (rr.z - .35) * .2) * uBrush;\r\n}\r\n\r\nvoid main(){\r\n  int id = gl_InstanceID;\r\n  ivec2 tc = ivec2(id % uTexW, id \/ uTexW);\r\n  vec4 pa = texelFetch(uPosA, tc, 0);\r\n  vec4 pb = texelFetch(uPosB, tc, 0);\r\n  vec4 ca = texelFetch(uColA, tc, 0);\r\n  vec4 cb = texelFetch(uColB, tc, 0);\r\n  if (ca.a + cb.a < .002) { gl_Position = vec4(2., 2., 2., 1.); return; }\r\n  float r = aRand;\r\n  vec3 rr = vec3(hash(r * 91.7 + .3), hash(r * 37.3 + 1.7), hash(r * 53.1 + 4.3));\r\n\r\n  float e, w, m, hz, e1, w1, m1, hz1;\r\n  vec4 kw, kw1;\r\n  float auraF = step(1.5, uKindA < .5 ? pa.w : pb.w);   \/\/ wordmark aura (persists) vs the particles that form the letters\r\n  vec3 p = particlePos(uMix, uTime, pa.xyz, pb.xyz, rr, auraF, e, w, m, hz, kw);\r\n  vec3 p1 = particlePos(mix(uMix, uMixPrev, uShutter), uTime - uDt * uShutter, pa.xyz, pb.xyz, rr, auraF, e1, w1, m1, hz1, kw1);\r\n  p = gather(p, rr, uIntro);\r\n  p1 = gather(p1, rr, uIntroPrev);\r\n  float gHome = 0., erode = 0.;\r\n  float wEarly = kw.w * (1. - smoothstep(-1.5, -3., p.z));\r\n  if (uBrush > .001) {\r\n    vec3 dl = wake(p, rr, mix(1., uPart, wEarly), gHome);\r\n    vec4 ch = uProj * uView * vec4(p, 1.);\r\n    float D = smoothstep(.04, .3, gHome) * uDis;\r\n    float n = grain(ch.xy \/ ch.w);\r\n    erode = smoothstep(n - .1, n, D);        \/\/ this grain of the letters has crumbled: the particle takes over here\r\n    dl *= mix(1., erode, wEarly);            \/\/ and only then does it move\r\n    dl.z += erode * wEarly * (1. - auraF) * rr.x * rr.x * .9;   \/\/ and lifts a little towards you\r\n    p += dl; p1 += dl;\r\n  }\r\n\r\n  float addA, szA, twA, amA, apA, addB, szB, twB, amB, apB;\r\n  vec4 shA, shB;\r\n  props(uKindA, ca.a, rr, addA, shA, szA, twA, amA, apA);\r\n  props(uKindB, cb.a, rr, addB, shB, szB, twB, amB, apB);\r\n  float add = mix(addA, addB, e);\r\n  float wq = kw.w * (1. - smoothstep(-1.5, -3., p.z));\r\n  float matter = wq;                         \/\/ wordmark particles are solid matter: alpha-blended discs in flat colour\r\n  vDen = 0.;\r\n  float flight = smoothstep(.12, .55, w);\r\n  add = max(add, flight);\r\n  vec4 shp = mix(shA, shB, e);\r\n  shp.w *= 1. - flight;\r\n  add = mix(add, 0., matter);\r\n  shp = mix(shp, vec4(0., 0., 0., 1.), matter);\r\n\r\n  vec4 mv = uView * vec4(p, 1.);\r\n  float depth = max(-mv.z, .1);\r\n  float base = mix(pa.w * szA, pb.w * szB, e) * uDpr * (10. \/ depth);\r\n  float apE = mix(mix(apA, apB, e), 1.5, wq * smoothstep(.25, .9, p.z));   \/\/ motes floating in front of the word fall out of focus\r\n  float coc = uAperture * apE * abs(depth - uFocus) \/ depth * uDpr;\r\n  float size = sqrt(base * base + coc * coc);\r\n  float px = clamp(size, mix(1., 2.5 * uDpr, add), 48. * uDpr);\r\n  float I = mix(ca.a * amA, cb.a * amB, e) * mix(uGainA, uGainB, e);\r\n  I *= mix(1., (base * base) \/ (px * px), add);\r\n  I *= smoothstep(38., 14., depth);\r\n  float tws = sin(uTime * (.25 + rr.y * .5) + r * 71.);\r\n  I *= mix(1., .7 + .3 * tws * tws, mix(twA, twB, e) * smoothstep(2., 5., size \/ uDpr));\r\n  \/\/ a share of the background stars blink, slowly\r\n  float blink = kw.w * step(.7, rr.x) * smoothstep(-2., -4., p.z);\r\n  I *= mix(1., .25 + 1.6 * pow(.5 + .5 * sin(uTime * (.3 + .45 * rr.y) + r * 53.), 8.), blink);\r\n  float word = kw.w * (1. - smoothstep(-1.5, -3., p.z));\r\n  \/\/ each particle fades in, flows, and fades out; once the letters are lit, the forming particles hand over to them\r\n  float age, cyc;\r\n  life(rr, uTime, age, cyc);\r\n  I *= mix(1., mix(.55 + .45 * sin(age * 3.14159), pow(sin(age * 3.14159), 1.4), auraF), word);\r\n  I *= mix(1., .4 + 1.2 * rr.z, w);\r\n  I *= 1. - flight * step(1.5, uKindA) * step(uKindA, 2.5) * .6;\r\n  I *= 1. + 1.2 * exp(-pow((m - .9) * 12., 2.)) * step(1.5, uKindB) * step(uKindB, 2.5);\r\n  I *= mix(1., .3 + .7 * smoothstep(-.6, .6, hz), kw.z);\r\n  \/\/ matter is either text or particle: visible only where its grain has crumbled, or while the letters are still forming\r\n  float lf = pow(sin(age * 3.14159), 1.4);\r\n  float vis = mix(1., mix(erode, .7 * lf, auraF), uSolid);   \/\/ at rest: the letters are text, and a few motes float around them\r\n  vis *= mix(1., .35 + .65 * rr.z, max(flight, uIntro));\r\n  I = mix(I, vis, matter);\r\n  vCov = mix(1., vis, matter);\r\n  vBead = matter;\r\n  if (I < .003) { gl_Position = vec4(2., 2., 2., 1.); return; }\r\n\r\n  vCol = vec4(toLin(mix(ca.rgb, cb.rgb, e)) * I, 1.);\r\n  vSoft = clamp(coc \/ max(base, 1.), 0., 1.);\r\n  vAdd = add;\r\n  vShape = shp;\r\n\r\n  vec4 c0 = uProj * mv;\r\n  vec4 c1 = uProj * uView * vec4(p1, 1.);\r\n  vec2 s0 = c0.xy \/ c0.w * uHalfRes, s1 = c1.xy \/ c1.w * uHalfRes;\r\n  vec2 dv = s0 - s1;\r\n  float L = length(dv);\r\n  float len = min(L, 30. * uDpr);\r\n  vec2 ax = L > .01 ? dv \/ L : vec2(1., 0.);\r\n  vec2 pr = vec2(-ax.y, ax.x);\r\n  float rad = px * .5;\r\n  float st = len * .5 \/ rad;\r\n  vCol.rgb \/= mix(1., 1. + st, add);\r\n  vec2 sp = s0 - ax * len * .5 + ax * aCorner.x * (rad + len * .5) + pr * aCorner.y * rad;\r\n  gl_Position = vec4(sp \/ uHalfRes * c0.w, c0.z, c0.w);\r\n  vQ = aCorner * vec2(1. + st, 1.);\r\n  vStretch = st;\r\n}`;\r\n\r\n  const FS = `#version 300 es\r\nprecision highp float;\r\nin vec4 vCol;\r\nin vec2 vQ;\r\nin float vStretch;\r\nin float vSoft;\r\nin float vAdd;\r\nin vec4 vShape;\r\nin float vDen;\r\nin float vCov;\r\nin float vBead;\r\nlayout(location = 0) out vec4 o;\r\nlayout(location = 1) out vec4 oDen;\r\nvoid main(){\r\n  vec2 q = vec2(max(abs(vQ.x) - vStretch, 0.) * sign(vQ.x), vQ.y);\r\n  float d2 = dot(q, q);\r\n  if (d2 > 1.) discard;\r\n  float star = exp(-d2 * 8.) + .14 * exp(-d2 * 2.2);\r\n  float glow = .7 * exp(-d2 * 26.) + .3 * exp(-d2 * 4.5);\r\n  vec2 aq = abs(q);\r\n  float spike = glow + .5 * (exp(-aq.x * 36.) * exp(-aq.y * 2.) + exp(-aq.y * 36.) * exp(-aq.x * 2.));\r\n  float haze = exp(-d2 * 1.6);\r\n  float disc = 1. - smoothstep(mix(.6, .1, vSoft), 1., sqrt(d2));\r\n  float rest = clamp(1. - vShape.x - vShape.y - vShape.z - vShape.w, 0., 1.);\r\n  float f = star * rest + glow * vShape.x + spike * vShape.y + haze * vShape.z + disc * vShape.w;\r\n  float den = vDen * exp(-d2 * 3.2);\r\n  if (f < .002 && den < .004) discard;\r\n  vec3 col = vCol.rgb * mix(1., .84 + .26 * (1. - d2) + .08 * (q.y - q.x), vBead);   \/\/ soft bead shading on the wordmark's matter\r\n  o = vec4(col * f, f * (1. - vAdd) * vCov);\r\n  oDen = vec4(den, 0., 0., 0.);\r\n}`;\r\n\r\n  \/* the crisp screenshot: drawn last, straight to the screen, never bloomed or tone mapped; a soft band of light crosses it as it appears *\/\r\n  const QVS = `#version 300 es\r\nprecision highp float;\r\nin vec2 aUV;\r\nuniform vec3 uImgC;\r\nuniform vec2 uSize, uPar;\r\nuniform float uTilt;\r\nuniform mat4 uProj, uView;\r\nout vec2 vUV;\r\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, s, -s, c); }\r\nvoid main(){\r\n  vec3 p = vec3(uImgC.xy + (aUV - .5) * vec2(uSize.x, -uSize.y), 0.);\r\n  vec3 o = p - uImgC;\r\n  o.xz = rot((-.2 + uPar.x * .22) * uTilt) * o.xz;\r\n  o.yz = rot(uPar.y * .14 * uTilt) * o.yz;\r\n  p = uImgC + o;\r\n  vUV = aUV;\r\n  gl_Position = uProj * uView * vec4(p, 1.);\r\n}`;\r\n\r\n  const QFS = `#version 300 es\r\nprecision highp float;\r\nin vec2 vUV;\r\nuniform sampler2D uTex;\r\nuniform float uA, uR, uSweep;\r\nuniform vec2 uSize;\r\nout vec4 outColor;\r\nvoid main(){\r\n  vec2 q = abs(vUV - .5) * uSize - (uSize * .5 - uR);\r\n  float sd = length(max(q, 0.)) + min(max(q.x, q.y), 0.) - uR;\r\n  float aa = fwidth(sd) * 1.2;\r\n  float msk = 1. - smoothstep(-aa, aa, sd);\r\n  float a = uA * msk;\r\n  float band = exp(-pow(vUV.x * .78 + vUV.y * .22 - (uSweep * 1.6 - .3), 2.) * 55.) * (1. - uSweep) * .5;\r\n  outColor = vec4((texture(uTex, vUV).rgb + band) * a, a);\r\n}`;\r\n\r\n  \/* the wordmark: crisp flat text in the logo colours, drawn after tone mapping like the screenshots;\r\n     where the cursor passes it crumbles, grain by grain, into the particles it is made of *\/\r\n  const TVS = `#version 300 es\r\nprecision highp float;\r\nin vec2 aUV;\r\nuniform vec4 uRect;\r\nuniform mat4 uProj, uView;\r\nout vec2 vUV;\r\nout vec2 vNdc;\r\nvoid main(){\r\n  vec2 xy = vec2(uRect.x + aUV.x * uRect.z, uRect.y - aUV.y * uRect.w);\r\n  vUV = aUV;\r\n  gl_Position = uProj * uView * vec4(xy, 0., 1.);\r\n  vNdc = gl_Position.xy \/ gl_Position.w;\r\n}`;\r\n\r\n  const TFS = `#version 300 es\r\nprecision highp float;\r\nin vec2 vUV;\r\nin vec2 vNdc;\r\nuniform sampler2D uText, uWake;\r\nuniform vec2 uTarget;\r\nuniform float uA, uBrushT, uDis, uSplit, uGrainK, uAspect;\r\nuniform vec3 uColA, uColB;\r\nout vec4 o;\r\nfloat h2(vec2 p){ vec3 q = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); }\r\nfloat vnoise(vec2 p){ vec2 i = floor(p), f = fract(p); f = f * f * (3. - 2. * f);\r\n  return mix(mix(h2(i), h2(i + vec2(1., 0.)), f.x), mix(h2(i + vec2(0., 1.)), h2(i + vec2(1., 1.)), f.x), f.y); }\r\nfloat grain(vec2 ndc){ vec2 q = ndc * vec2(uAspect, 1.) * uGrainK; return .62 * vnoise(q) + .38 * vnoise(q * 2.3 + 17.3); }\r\nvoid main(){\r\n  float mask = texture(uText, vUV).a;\r\n  if (mask < .002) discard;\r\n  float wk = uBrushT > .001 ? texture(uWake, gl_FragCoord.xy \/ uTarget).g : 0.;\r\n  float D = smoothstep(.04, .3, wk) * uDis;\r\n  float erode = 0.;\r\n  if (D > .001) { float n = grain(vNdc); erode = smoothstep(n, n + .1, D); }   \/\/ the text leaves one band after the particle arrives\r\n  vec3 C = mix(uColA, uColB, step(uSplit, vUV.y));\r\n  float a = mask * (1. - erode) * uA;\r\n  o = vec4(C * a, a);   \/\/ premultiplied flat sRGB straight onto the screen: never bloomed, never tone mapped\r\n}`;\r\n\r\n  \/* post: full-screen pass, bloom chain, composite, cursor-wake field *\/\r\n  const PVS = `#version 300 es\r\nin vec2 aUV;\r\nout vec2 vUV;\r\nvoid main(){ vUV = aUV; gl_Position = vec4(aUV * 2. - 1., 0., 1.); }`;\r\n\r\n  const BFS = `#version 300 es\r\nprecision mediump float;\r\nin vec2 vUV;\r\nuniform sampler2D uTex;\r\nuniform vec2 uTexel;\r\nuniform int uMode;\r\nuniform float uThr, uKnee;\r\nout vec4 o;\r\nvec3 tap(vec2 d){\r\n  vec4 s = texture(uTex, vUV + d * uTexel);\r\n  if (uMode != 0) return s.rgb;\r\n  float br = max(s.r, max(s.g, s.b));\r\n  float k = clamp(br - uThr + uKnee, 0., 2. * uKnee);\r\n  k = k * k \/ (4. * uKnee + 1e-4);\r\n  return s.rgb * (max(k, br - uThr) \/ max(br, 1e-4)) * (1. - smoothstep(0., .25, s.a));\r\n}\r\nvoid main(){\r\n  vec3 c;\r\n  if (uMode == 2) {\r\n    c = (tap(vec2(-1., 1.)) + tap(vec2(0., 1.)) * 2. + tap(vec2(1., 1.))\r\n       + tap(vec2(-1., 0.)) * 2. + tap(vec2(0.)) * 4. + tap(vec2(1., 0.)) * 2.\r\n       + tap(vec2(-1., -1.)) + tap(vec2(0., -1.)) * 2. + tap(vec2(1., -1.))) \/ 16.;\r\n  } else {\r\n    c = tap(vec2(0.)) * .125\r\n      + (tap(vec2(-2., 2.)) + tap(vec2(2., 2.)) + tap(vec2(-2., -2.)) + tap(vec2(2., -2.))) * .03125\r\n      + (tap(vec2(0., 2.)) + tap(vec2(-2., 0.)) + tap(vec2(2., 0.)) + tap(vec2(0., -2.))) * .0625\r\n      + (tap(vec2(-1., 1.)) + tap(vec2(1., 1.)) + tap(vec2(-1., -1.)) + tap(vec2(1., -1.))) * .125;\r\n  }\r\n  o = vec4(c, 1.);\r\n}`;\r\n\r\n  const CFS = `#version 300 es\r\nprecision highp float;\r\nin vec2 vUV;\r\nuniform sampler2D uHdr, uBloom;\r\nuniform vec2 uRes;\r\nuniform vec3 uBg;\r\nuniform float uExposure, uBloomAmt, uGrain, uVig, uTime, uSS;\r\nuniform vec2 uTx;\r\nout vec4 o;\r\nvec3 agxCurve(vec3 x){ vec3 x2 = x * x, x4 = x2 * x2;\r\n  return 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + .4298 * x2 + .1191 * x - .00232; }\r\nvec3 tonemap(vec3 c){\r\n  const mat3 M  = mat3(.842479062, .042328242, .042375655, .078433600, .878468636, .078433600, .079223745, .079166127, .879142974);\r\n  const mat3 Mi = mat3(1.196879005, -.052896852, -.052971636, -.098020881, 1.151903130, -.098043450, -.099029744, -.098961177, 1.151073673);\r\n  c = M * c;\r\n  c = clamp((log2(max(c, 1e-10)) + 12.47393) \/ 16.5, 0., 1.);\r\n  return clamp(Mi * agxCurve(c), 0., 1.);\r\n}\r\nvec3 srgb(vec3 c){ return mix(c * 12.92, 1.055 * pow(max(c, 0.), vec3(1. \/ 2.4)) - .055, step(.0031308, c)); }\r\nfloat ign(vec2 p){ return fract(52.9829189 * fract(.06711056 * p.x + .00583715 * p.y)); }\r\nvoid main(){\r\n  vec4 h = uSS > 1.01\r\n    ? (texture(uHdr, vUV + uTx * vec2(-.25, -.25)) + texture(uHdr, vUV + uTx * vec2(.25, -.25)) + texture(uHdr, vUV + uTx * vec2(-.25, .25)) + texture(uHdr, vUV + uTx * vec2(.25, .25))) * .25\r\n    : texture(uHdr, vUV);\r\n  vec2 ca = (vUV - .5) * .003;\r\n  vec3 bl = vec3(texture(uBloom, vUV - ca).r, texture(uBloom, vUV).g, texture(uBloom, vUV + ca).b);\r\n  vec3 lin = (h.rgb + bl * uBloomAmt) * uExposure;\r\n  float r = length((vUV - .5) * vec2(uRes.x \/ uRes.y, 1.));\r\n  float vig = 1. - uVig * smoothstep(.5, 1.3, r);\r\n  vec3 col = tonemap(lin * vig) + uBg * vig;\r\n  vec3 page = srgb(h.rgb \/ max(h.a, 1e-4));\r\n  col = mix(col, page, clamp(h.a, 0., 1.));\r\n  col += (ign(gl_FragCoord.xy + fract(uTime * 7.) * 193.) - .5) * uGrain * (1. - h.a);\r\n  col += (ign(gl_FragCoord.xy) + ign(gl_FragCoord.xy + 41.) - 1.) \/ 255.;\r\n  o = vec4(col, 1.);\r\n}`;\r\n\r\n  \/\/ wake field: r = pressure impulse, g = smoothed pressure (what particles feel), ba = smoothed drift\r\n  const WFS = `#version 300 es\r\nprecision highp float;\r\nin vec2 vUV;\r\nuniform sampler2D uPrev;\r\nuniform vec2 uA, uB, uVel;\r\nuniform float uAmt, uRad, uAspect, uDecay, uRate;\r\nout vec4 o;\r\nvoid main(){\r\n  vec4 s = texture(uPrev, vUV);\r\n  vec2 pa = (vUV - uA) * vec2(uAspect, 1.), ba = (uB - uA) * vec2(uAspect, 1.);\r\n  float h = clamp(dot(pa, ba) \/ max(dot(ba, ba), 1e-8), 0., 1.);\r\n  float d = length(pa - ba * h);\r\n  float g = exp(-d * d \/ (uRad * uRad)) * uAmt;\r\n  float imp = min(s.r * uDecay + g, 1.2);\r\n  float sm = mix(s.g, imp, uRate);\r\n  vec2 v = s.ba * uDecay + uVel * g * .12;\r\n  o = vec4(imp, sm, v);\r\n}`;\r\n\r\n  let prog = null, qprog = null, bprog = null, cprog = null, wprog = null, tprog = null, qvao = null, vao = null;\r\n  const U = {}, QU = {}, BU = {}, CU = {}, WU = {}, TU = {};\r\n  const textTex = [];\r\n  let posTex = [], colTex = [], pageTex = [], built = false, introT0 = 0, dims = null;\r\n  let builtW = 0, builtH = 0;\r\n  const posData = [], colData = [];\r\n  const imgCols = [];\r\n  let images = [];\r\n  const layout = { img: [0, 0], imgW: 1, hel: [0, 0], word0: [0, 0], word7: [0, 0] };\r\n  const PP = { fmt: 0, w: 0, h: 0, hdr: null, mips: [], ss: 1, den: null, denH: null, mrt: false };\r\n  \/\/ the logo: pearl \"Scrollcraft\" with violet light flowing through it, and violet \"STUDIO\" with pale light flowing through it\r\n  \/\/ (scene-linear values for the lit letters; sRGB bytes for the particles)\r\n  const LOGO = {\r\n    pearl: [231 \/ 255, 226 \/ 255, 244 \/ 255],   \/\/ #E7E2F4, as in the header logo\r\n    violet: [133 \/ 255, 114 \/ 255, 214 \/ 255],  \/\/ #8572D6\r\n    partsA: [231, 226, 244], partsB: [133, 114, 214]\r\n  };\r\n  const WK = { a: null, b: null, w: 0, h: 0, ok: false, lx: null, ly: null };\r\n  let dummyTex = null;\r\n\r\n  function compile(type, src) {\r\n    const sh = gl.createShader(type);\r\n    gl.shaderSource(sh, src); gl.compileShader(sh);\r\n    if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(sh));\r\n    return sh;\r\n  }\r\n  function link(vs, fs, attribs) {\r\n    const p = gl.createProgram();\r\n    gl.attachShader(p, compile(gl.VERTEX_SHADER, vs));\r\n    gl.attachShader(p, compile(gl.FRAGMENT_SHADER, fs));\r\n    if (attribs) Object.keys(attribs).forEach(k => gl.bindAttribLocation(p, attribs[k], k));\r\n    gl.linkProgram(p);\r\n    if (!gl.getProgramParameter(p, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(p));\r\n    return p;\r\n  }\r\n  function locs(p, store, names) { names.forEach(nm => { store[nm] = gl.getUniformLocation(p, nm); }); }\r\n  function makeTex(internal, format, type, data) {\r\n    const t = gl.createTexture();\r\n    gl.bindTexture(gl.TEXTURE_2D, t);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n    gl.texImage2D(gl.TEXTURE_2D, 0, internal, TW, TW, 0, format, type, data);\r\n    return t;\r\n  }\r\n  function makePageTex(img) {\r\n    const c = document.createElement('canvas');\r\n    c.width = 1440; c.height = Math.round(1440 \/ PAGE_AR);\r\n    const ctx = c.getContext('2d');\r\n    if (img) ctx.drawImage(img, 0, 0, img.naturalWidth, img.naturalWidth \/ PAGE_AR, 0, 0, c.width, c.height);\r\n    else { ctx.fillStyle = '#222'; ctx.fillRect(0, 0, c.width, c.height); }\r\n    const t = gl.createTexture();\r\n    gl.bindTexture(gl.TEXTURE_2D, t);\r\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, c);\r\n    gl.generateMipmap(gl.TEXTURE_2D);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n    const ani = gl.getExtension('EXT_texture_filter_anisotropic');\r\n    if (ani) gl.texParameterf(gl.TEXTURE_2D, ani.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(8, gl.getParameter(ani.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));\r\n    return t;\r\n  }\r\n  function makeTarget(w, h, fmt) {\r\n    const tex = gl.createTexture();\r\n    gl.bindTexture(gl.TEXTURE_2D, tex);\r\n    gl.texStorage2D(gl.TEXTURE_2D, 1, fmt, w, h);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n    const fb = gl.createFramebuffer();\r\n    gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n    const ok = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\r\n    if (ok) { gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT); }\r\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n    if (!ok) { gl.deleteFramebuffer(fb); gl.deleteTexture(tex); return null; }\r\n    return { fb, tex, w, h };\r\n  }\r\n  const dropTarget = t => { if (t) { gl.deleteFramebuffer(t.fb); gl.deleteTexture(t.tex); } };\r\n  function sizePost() {\r\n    let ss = BIG ? Math.min(1.6, Math.max(1, 2 \/ dpr)) : 1;\r\n    if (canvas.width * canvas.height * ss * ss > 6.5e6) ss = Math.max(1, Math.sqrt(6.5e6 \/ (canvas.width * canvas.height)));\r\n    const w = Math.round(canvas.width * ss), h = Math.round(canvas.height * ss);\r\n    if (w < 2 || h < 2) return;   \/\/ a hidden or collapsed window: wait for a real size\r\n    PP.ss = ss;\r\n    if (!PP.hdr || PP.w !== w || PP.h !== h) {\r\n      [PP.hdr, ...PP.mips].forEach(dropTarget);\r\n      if (!PP.fmt) PP.fmt = gl.getExtension('EXT_color_buffer_float') ? gl.RGBA16F : gl.SRGB8_ALPHA8;\r\n      PP.hdr = makeTarget(w, h, PP.fmt);\r\n      if (!PP.hdr) { PP.fmt = gl.SRGB8_ALPHA8; PP.hdr = makeTarget(w, h, PP.fmt); }\r\n      if (!PP.hdr) throw new Error('No render target');\r\n      const mipFmt = PP.fmt === gl.RGBA16F ? gl.RGBA16F : gl.RGBA8;\r\n      PP.mips = [];\r\n      const sh = BIG ? (ss > 1.2 ? 2 : 1) : 2;\r\n      let mw = w >> sh, mh = h >> sh;\r\n      for (let i = 0; i < (BIG ? 5 : 4) && mw > 8 && mh > 8; i++, mw >>= 1, mh >>= 1) {\r\n        const t = makeTarget(mw, mh, mipFmt);\r\n        if (t) PP.mips.push(t);\r\n      }\r\n      PP.w = w; PP.h = h;\r\n      PP.mrt = false;\r\n    }\r\n    \/\/ cursor wake field (desktop only; needs float targets for signed drift)\r\n    const ww = BIG ? 192 : 0, wh = Math.max(24, Math.round(ww * innerHeight \/ innerWidth));\r\n    if (FINE && ww && PP.fmt === gl.RGBA16F && (WK.w !== ww || WK.h !== wh)) {\r\n      dropTarget(WK.a); dropTarget(WK.b);\r\n      WK.a = makeTarget(ww, wh, gl.RGBA16F); WK.b = makeTarget(ww, wh, gl.RGBA16F);\r\n      WK.ok = !!(WK.a && WK.b); WK.w = ww; WK.h = wh;\r\n    }\r\n    lastBound = [-1, -1];\r\n  }\r\n  function getDims() {\r\n    const H = 2 * CAMZ * Math.tan(FOV \/ 2), aspect = innerWidth \/ innerHeight;\r\n    return { H, W: H * aspect, aspect, mobile: aspect < 0.9, ppu: innerHeight \/ H };\r\n  }\r\n\r\n  \/* ---------- formations: xyz in world units; w = base sprite size in CSS px at the focal plane;\r\n     colour alpha = light energy (0..1), shaped by the kind's gain in the shader ---------- *\/\r\n  const fontReady = () => Promise.race([\r\n    document.fonts ? Promise.all([document.fonts.load('800 200px \"Funnel Display\"'), document.fonts.load('600 60px \"Funnel Display\"')]) : Promise.resolve(),\r\n    new Promise(r => setTimeout(r, 2500))\r\n  ]);\r\n  function starColour(C, i, I) {\r\n    const r = Math.random(), t = r < 0.4 ? TEMP[0] : r < 0.85 ? TEMP[1] : TEMP[2], k = Math.sqrt(I) * 0.6;\r\n    C[i * 4] = lerp(t[0], 255, k); C[i * 4 + 1] = lerp(t[1], 250, k); C[i * 4 + 2] = lerp(t[2], 245, k); C[i * 4 + 3] = I * 255;\r\n  }\r\n  const powerI = (lo, hi, p) => lo + (hi - lo) * Math.pow(Math.random(), p);\r\n  \/\/ draw the wordmark lockup at scale S (white letters on transparent)\r\n  function drawLockup(spec, S) {\r\n    const c = document.createElement('canvas'), ctx = c.getContext('2d', { willReadFrequently: true });\r\n    const font = l => `${l.wt} ${l.fs * S}px \"Funnel Display\", \"Helvetica Neue\", Arial, sans-serif`;\r\n    const widthOf = l => {\r\n      ctx.font = font(l);\r\n      if (!l.track) return ctx.measureText(l.t).width;\r\n      let w = 0;\r\n      for (const ch of l.t) w += ctx.measureText(ch).width + l.track * l.fs * S;\r\n      return w - l.track * l.fs * S;\r\n    };\r\n    const ws = spec.map(widthOf), tw = Math.max(...ws), pad = 16 * S;\r\n    const hs = spec.map(l => l.fs * S * 0.92), gap = spec.length > 1 ? spec[0].fs * S * 0.16 : 0;\r\n    const th = hs.reduce((a, b) => a + b, 0) + gap * (spec.length - 1);\r\n    c.width = Math.ceil(tw + pad * 2); c.height = Math.ceil(th + pad * 2);\r\n    ctx.fillStyle = '#fff'; ctx.textBaseline = 'middle';\r\n    let y = pad;\r\n    spec.forEach((l, i) => {\r\n      ctx.font = font(l);\r\n      const cy = y + hs[i] \/ 2;\r\n      let x = pad + (tw - ws[i]) \/ 2;\r\n      if (l.track) { for (const ch of l.t) { ctx.fillText(ch, x, cy); x += ctx.measureText(ch).width + l.track * l.fs * S; } }\r\n      else ctx.fillText(l.t, x, cy);\r\n      y += hs[i] + gap;\r\n    });\r\n    c.split = spec.length > 1 ? (pad + hs[0] + gap \/ 2) \/ c.height : 2;\r\n    return c;\r\n  }\r\n  \/\/ the lockup as a sampling mask: lightly softened alpha, weighted sample points, and blurred versions on demand\r\n  function glyphs(spec) {\r\n    const sharp = drawLockup(spec, 1);\r\n    const c = document.createElement('canvas'); c.width = sharp.width; c.height = sharp.height;\r\n    const ctx = c.getContext('2d', { willReadFrequently: true });\r\n    const alphaOf = cv => { const d = cv.getContext('2d', { willReadFrequently: true }).getImageData(0, 0, cv.width, cv.height).data, a = new Uint8Array(cv.width * cv.height); for (let i = 0; i < a.length; i++) a[i] = d[i * 4 + 3]; return a; };\r\n    const cache = {};\r\n    const blur = r => {\r\n      if (cache[r]) return cache[r];\r\n      const t = document.createElement('canvas'); t.width = c.width; t.height = c.height;\r\n      const tc = t.getContext('2d', { willReadFrequently: true });\r\n      if ('filter' in tc) tc.filter = `blur(${r}px)`;\r\n      tc.drawImage(sharp, 0, 0);\r\n      return (cache[r] = alphaOf(t));\r\n    };\r\n    if ('filter' in ctx) ctx.filter = 'blur(1.5px)';\r\n    ctx.drawImage(sharp, 0, 0);\r\n    ctx.filter = 'none';\r\n    const data = ctx.getImageData(0, 0, c.width, c.height).data, pts = [], wts = [];\r\n    const A = new Uint8Array(c.width * c.height);\r\n    for (let yy = 0; yy < c.height; yy++) for (let x = 0; x < c.width; x++) {\r\n      const a = data[(yy * c.width + x) * 4 + 3];\r\n      A[yy * c.width + x] = a;\r\n      if (a > 51) { pts.push(x, yy); wts.push((a \/ 255) * (a \/ 255)); }\r\n    }\r\n    return { w: c.width, h: c.height, pts, wts, A, blur, split: sharp.split };\r\n  }\r\n  function uploadText(k, cv) {\r\n    if (!textTex[k]) textTex[k] = gl.createTexture();\r\n    gl.bindTexture(gl.TEXTURE_2D, textTex[k]);\r\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, cv);\r\n    gl.generateMipmap(gl.TEXTURE_2D);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n    const ani = gl.getExtension('EXT_texture_filter_anisotropic');\r\n    if (ani) gl.texParameterf(gl.TEXTURE_2D, ani.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(8, gl.getParameter(ani.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));\r\n  }\r\n  \/\/ the particles that make up the wordmark, as a flat list of [x, y, energy, size, z] in glyph pixels; pxs = screen px per glyph px\r\n  \/\/ size under 1.5 marks the particles that form the letters; 1.5 and over marks the aura that keeps streaming once the letters are lit\r\n  function wordPoints(g, pxs) {\r\n    const out = [], w = g.w, h = g.h, mob = dims.mobile;\r\n    const cell = (mob ? 1.8 : 1.4) \/ pxs;\r\n    for (let y = cell * 0.5; y < h; y += cell) for (let x = cell * 0.5; x < w; x += cell) {\r\n      const jx = x + (Math.random() - 0.5) * cell * 0.9, jy = y + (Math.random() - 0.5) * cell * 0.9;\r\n      if (jx < 0 || jy < 0 || jx >= w || jy >= h || !(g.A[(jy | 0) * w + (jx | 0)] >= 110)) continue;   \/\/ inside the letters only\r\n      out.push(jx, jy, 1, 1.0 + Math.random() * 0.15, (Math.random() - 0.5) * 0.02);   \/\/ energy 1 = exact colour, the letter marker\r\n    }\r\n    \/\/ a few motes that float around the logo, never on it\r\n    const motes = mob ? 140 : 320;\r\n    for (let m = 0, tries = 0; m < motes && tries < motes * 60; tries++) {\r\n      const ang = Math.random() * Math.PI * 2, rad = 0.5 + Math.random() * 0.75;\r\n      const x = w * (0.5 + Math.cos(ang) * rad * 0.6), y = h * (0.5 + Math.sin(ang) * rad * 1.05);\r\n      const xi = x | 0, yi = y | 0;\r\n      if (xi >= 0 && yi >= 0 && xi < w && yi < h && g.A[yi * w + xi] > 20) continue;\r\n      if (Math.random() < 0.06) out.push(x, y, 0.5 + Math.random() * 0.3, 2.2, 0.6 + Math.random() * 1.4);\r\n      else out.push(x, y, 0.45 + 0.45 * Math.random(), 1.5 + Math.random() * 0.7, (Math.random() - 0.5) * 0.06);\r\n      m++;\r\n    }\r\n    return out;\r\n  }\r\n  function skyStar(P, C, i, W, H, spread) {\r\n    P[i * 4] = (Math.random() - 0.5) * W * spread; P[i * 4 + 1] = (Math.random() - 0.5) * H * spread; P[i * 4 + 2] = -4 - Math.random() * 25;\r\n    P[i * 4 + 3] = (1.8 + Math.random() * 1.2) * (dims.mobile ? 0.7 : 1);\r\n    starColour(C, i, powerI(0.015, 0.45, 4));\r\n  }\r\n  function wordColour(C, i, I, studios) {\r\n    const c = studios ? LOGO.partsB : LOGO.partsA;\r\n    C[i * 4] = c[0]; C[i * 4 + 1] = c[1]; C[i * 4 + 2] = c[2]; C[i * 4 + 3] = I * 255;\r\n  }\r\n  function buildStarText(k, worldW, cx, cy, spec) {\r\n    const P = posData[k], C = colData[k], g = glyphs(spec), { W, H } = dims;\r\n    const sc = worldW \/ g.w, hw = g.w * sc \/ 2, hh = g.h * sc \/ 2, np = g.wts.length;\r\n    layout.half = hh;\r\n    \/\/ crisp letters of light take over once the particles have formed them\r\n    const S = Math.min(3, Math.max(1, 2 * sc * dims.ppu * dpr), 4096 \/ g.w);\r\n    const tc = drawLockup(spec, S);\r\n    uploadText(k, tc);\r\n    layout.text = layout.text || {};\r\n    layout.text[k] = { x0: cx - hw, y0: cy + hh, w: tc.width \/ S * sc, h: tc.height \/ S * sc, split: tc.split };\r\n    const pts = wordPoints(g, sc * dims.ppu), cnt = pts.length \/ 5;\r\n    \/\/ shuffle, so that if there are more points than particles the word is thinned evenly, not cut off\r\n    for (let i = cnt - 1; i > 0; i--) {\r\n      const j = Math.random() * (i + 1) | 0;\r\n      for (let q = 0; q < 5; q++) { const t = pts[i * 5 + q]; pts[i * 5 + q] = pts[j * 5 + q]; pts[j * 5 + q] = t; }\r\n    }\r\n    const letters = Math.min(Math.floor(N * 0.6), cnt);\r\n    const thin = cnt \/ letters, boost = (dims.mobile ? 1.3 : 1) * thin;\r\n    const sky = BIG ? 4000 : 1800;\r\n    for (let i = 0; i < N; i++) {\r\n      if (i < sky) { skyStar(P, C, i, W, H, 2.6); continue; }   \/\/ stars first, so the letters draw over them\r\n      const j = i - sky;\r\n      let x, y, I = 0, sz = 1, z = 0;\r\n      if (j < letters) { const o = j * 5; x = pts[o]; y = pts[o + 1]; I = Math.min(1, pts[o + 2] * boost); sz = pts[o + 3]; z = pts[o + 4]; }\r\n      else { const q = (Math.random() * np | 0) * 2; x = g.pts[q] + Math.random(); y = g.pts[q + 1] + Math.random(); }\r\n      \/\/ particles nearer the camera are pulled in so they still sit over the letters on screen\r\n      const k = 1 - z \/ CAMZ;\r\n      P[i * 4] = (cx + x * sc - hw) * k;\r\n      P[i * 4 + 1] = (cy - (y * sc - hh)) * k;\r\n      P[i * 4 + 2] = z + (Math.random() - 0.5) * 0.02;\r\n      P[i * 4 + 3] = sz * (dims.mobile ? 0.8 : 1);\r\n      wordColour(C, i, I, sz >= 1.5 ? Math.random() < 0.3 : y > g.split * g.h);\r\n    }\r\n  }\r\n  function buildSea(k) {\r\n    const P = posData[k], C = colData[k], { W, H } = dims;\r\n    const sky = BIG ? 3500 : 1500;\r\n    const gw = BIG ? 430 : 230, gh = BIG ? 250 : 150, cells = gw * gh;\r\n    for (let i = 0; i < N; i++) {\r\n      if (i < sky) {\r\n        skyStar(P, C, i, W, H, 2.8);\r\n        P[i * 4 + 1] = -H * 0.08 + Math.random() * H * 0.9;\r\n        continue;\r\n      }\r\n      const j = i - sky, cell = j < cells ? j : (Math.random() * cells | 0);\r\n      const u = (cell % gw) \/ (gw - 1), far = (cell \/ gw | 0) \/ (gh - 1);\r\n      P[i * 4] = (u - 0.5) * W * (1.15 + far * 2.8);\r\n      P[i * 4 + 1] = -H * (dims.mobile ? 0.45 : 0.47);\r\n      P[i * 4 + 2] = lerp(3.5, dims.mobile ? -9 : -16, far);\r\n      const glint = j < cells && Math.random() < 0.01;\r\n      P[i * 4 + 3] = glint ? 3 : 2;\r\n      const l = 0.7 + Math.random() * 0.3;\r\n      C[i * 4] = 150 * l; C[i * 4 + 1] = 178 * l; C[i * 4 + 2] = 232 * l;\r\n      C[i * 4 + 3] = j < cells ? (glint ? 255 : powerI(0.12, 0.67, 2) * 255) : 0;\r\n    }\r\n  }\r\n  function shuffled() {\r\n    const a = new Uint32Array(N);\r\n    for (let i = 0; i < N; i++) a[i] = i;\r\n    for (let i = N - 1; i > 0; i--) { const j = Math.random() * (i + 1) | 0; const t = a[i]; a[i] = a[j]; a[j] = t; }\r\n    return a;\r\n  }\r\n  function buildPage(k, img, worldW, cx, cy) {\r\n    const P = posData[k], C = colData[k];\r\n    const rows = Math.floor(Math.sqrt(N \/ PAGE_AR)), cols = Math.floor(N \/ rows), cells = rows * cols;\r\n    const sp = worldW \/ cols, worldH = rows * sp, size = Math.max(1.2, sp * dims.ppu * 1.7);\r\n    if (img && !imgCols[k]) {\r\n      const c = document.createElement('canvas'); c.width = cols; c.height = rows;\r\n      const ctx = c.getContext('2d', { willReadFrequently: true });\r\n      ctx.imageSmoothingQuality = 'high';\r\n      ctx.drawImage(img, 0, 0, img.naturalWidth, img.naturalWidth \/ PAGE_AR, 0, 0, cols, rows);\r\n      try { imgCols[k] = ctx.getImageData(0, 0, cols, rows).data; } catch (e) { imgCols[k] = null; }\r\n    }\r\n    const data = imgCols[k];\r\n    const perm = shuffled();\r\n    for (let i = 0; i < N; i++) {\r\n      const cell = perm[i] < cells ? perm[i] : (Math.random() * cells | 0);\r\n      const x = cell % cols, y = cell \/ cols | 0;\r\n      P[i * 4] = cx - worldW \/ 2 + (x + 0.5) * sp;\r\n      P[i * 4 + 1] = cy + worldH \/ 2 - (y + 0.5) * sp;\r\n      P[i * 4 + 2] = 0;\r\n      P[i * 4 + 3] = size * (0.92 + Math.random() * 0.16);\r\n      if (data) { C[i * 4] = data[cell * 4]; C[i * 4 + 1] = data[cell * 4 + 1]; C[i * 4 + 2] = data[cell * 4 + 2]; }\r\n      else { const l = 40 + Math.random() * 40; C[i * 4] = l; C[i * 4 + 1] = l; C[i * 4 + 2] = l; }\r\n      C[i * 4 + 3] = 255;\r\n    }\r\n  }\r\n  function hsl(r, g, b) {\r\n    r \/= 255; g \/= 255; b \/= 255;\r\n    const mx = Math.max(r, g, b), mn = Math.min(r, g, b), d = mx - mn, l = (mx + mn) \/ 2;\r\n    const s = d === 0 ? 0 : d \/ (1 - Math.abs(2 * l - 1));\r\n    let h = 0;\r\n    if (d) h = mx === r ? ((g - b) \/ d) % 6 : mx === g ? (b - r) \/ d + 2 : (r - g) \/ d + 4;\r\n    return [(h * 60 + 360) % 360, s, l];\r\n  }\r\n  let strandPool = null;\r\n  function buildHelix(k, cx, cy, L, R) {\r\n    const P = posData[k], C = colData[k];\r\n    if (!strandPool) {\r\n      const pool = [];\r\n      imgCols.forEach(d => {\r\n        if (!d) return;\r\n        for (let j = 0; j < d.length; j += 4 * 5) {\r\n          const c = hsl(d[j], d[j + 1], d[j + 2]);\r\n          if (c[1] > 0.35 && c[2] > 0.25 && c[2] < 0.8) pool.push([c[0], d[j], d[j + 1], d[j + 2]]);\r\n        }\r\n      });\r\n      if (pool.length < 200) BRAND.forEach((b, i) => { for (let j = 0; j < 100; j++) pool.push([i * 90, b[0], b[1], b[2]]); });\r\n      pool.sort((a, b) => a[0] - b[0]);\r\n      strandPool = pool;\r\n    }\r\n    const pool = strandPool, np = pool.length;\r\n    const turns = dims.mobile ? 2.4 : 3.6, rungs = Math.round(turns * 10), TAU = Math.PI * 2, GROOVE = Math.PI * 0.78;\r\n    const PAIRS = [[BRAND[0], BRAND[2]], [BRAND[1], BRAND[3]]];\r\n    const ends = v => smooth(0, 0.06, v) * smooth(1, 0.94, v);\r\n    const jit = s => (Math.random() - 0.5) * s;\r\n    for (let i = 0; i < N; i++) {\r\n      const u = Math.random();\r\n      let x, y, z, col, I, size = 1.8;\r\n      if (u < 0.42 || u >= 0.72) {\r\n        const s = Math.random(), ang = s * turns * TAU + ((u < 0.21 || u >= 0.86) ? 0 : GROOVE);\r\n        const tr = Math.sqrt(Math.random()) * 0.03, ta = Math.random() * TAU;\r\n        x = cx + (s - 0.5) * L + Math.cos(ta) * tr;\r\n        y = cy + Math.cos(ang) * (R + Math.sin(ta) * tr);\r\n        z = Math.sin(ang) * (R + Math.sin(ta) * tr);\r\n        const c = pool[Math.min(np - 1, s * np | 0)];\r\n        col = [c[1], c[2], c[3]];\r\n        I = (u < 0.42 ? 0.12 + Math.random() * 0.1 : 0) * ends(s);\r\n      } else {\r\n        const j = Math.random() * rungs | 0, s = (j + 0.5) \/ rungs, ang = s * turns * TAU, t = Math.random();\r\n        const pair = PAIRS[(j * 7 + 3) % 2], flip = ((j * 13) % 3) === 0;\r\n        const ay = Math.cos(ang) * R, az = Math.sin(ang) * R, by = Math.cos(ang + GROOVE) * R, bz = Math.sin(ang + GROOVE) * R;\r\n        x = cx + (s - 0.5) * L + jit(0.022);\r\n        y = cy + lerp(ay, by, t) + jit(0.022);\r\n        z = lerp(az, bz, t) + jit(0.022);\r\n        col = (t < 0.5) !== flip ? pair[0] : pair[1];\r\n        I = (Math.abs(t - 0.5) < 0.035 ? 0.1 : 0.4) * ends(s);\r\n      }\r\n      P[i * 4] = x; P[i * 4 + 1] = y; P[i * 4 + 2] = z; P[i * 4 + 3] = size;\r\n      C[i * 4] = col[0]; C[i * 4 + 1] = col[1]; C[i * 4 + 2] = col[2]; C[i * 4 + 3] = I * 255;\r\n    }\r\n  }\r\n\r\n  function buildWords() {\r\n    const { W, H, mobile } = dims;\r\n    if (mobile) { buildStarText(0, W * 0.86, 0, H * 0.12, LOCKUP); layout.word0 = [0, H * 0.12]; }\r\n    else { buildStarText(0, Math.min(W * 0.66, H * 1.9), 0, H * 0.1, LOCKUP); layout.word0 = [0, H * 0.1]; }\r\n    if (mobile) { buildStarText(7, W * 0.84, 0, H * 0.24, LOCKUP_END); layout.word7 = [0, H * 0.24]; }\r\n    else { buildStarText(7, Math.min(W * 0.4, H * 1.15), W * 0.25, H * 0.07, LOCKUP_END); layout.word7 = [W * 0.25, H * 0.07]; }\r\n  }\r\n  function uploadFormation(k) {\r\n    gl.bindTexture(gl.TEXTURE_2D, posTex[k]);\r\n    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, TW, TW, gl.RGBA, gl.FLOAT, posData[k]);\r\n    gl.bindTexture(gl.TEXTURE_2D, colTex[k]);\r\n    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, TW, TW, gl.RGBA, gl.UNSIGNED_BYTE, colData[k]);\r\n    lastBound = [-1, -1];\r\n  }\r\n  function buildAll() {\r\n    dims = getDims();\r\n    const { W, H, mobile } = dims;\r\n    builtW = innerWidth; builtH = innerHeight;\r\n    const img = mobile ? { cx: 0, cy: H * 0.19, w: W * 0.92 } : { cx: W * 0.215, cy: H * 0.01, w: Math.min(W * 0.52, H * 1.1) };\r\n    const hel = mobile ? { cx: 0, cy: H * 0.25, L: W * 1.05, R: 0.3 } : { cx: W * 0.21, cy: H * 0.0, L: Math.min(W * 0.48, H * 1.2), R: 0.5 };\r\n    layout.img = [img.cx, img.cy]; layout.imgW = img.w;\r\n    layout.hel = [hel.cx, hel.cy];\r\n    for (let k = 0; k < n; k++) if (!posData[k]) { posData[k] = new Float32Array(N * 4); colData[k] = new Uint8Array(N * 4); }\r\n    buildWords();\r\n    buildSea(1);\r\n    for (let j = 0; j < 4; j++) buildPage(2 + j, images[j], img.w, img.cx, img.cy);\r\n    buildHelix(6, hel.cx, hel.cy, hel.L, hel.R);\r\n    for (let k = 0; k < n; k++) {\r\n      if (!posTex[k]) {\r\n        posTex[k] = makeTex(gl.RGBA32F, gl.RGBA, gl.FLOAT, posData[k]);\r\n        colTex[k] = makeTex(gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, colData[k]);\r\n      } else {\r\n        gl.bindTexture(gl.TEXTURE_2D, posTex[k]);\r\n        gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, TW, TW, gl.RGBA, gl.FLOAT, posData[k]);\r\n        gl.bindTexture(gl.TEXTURE_2D, colTex[k]);\r\n        gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, TW, TW, gl.RGBA, gl.UNSIGNED_BYTE, colData[k]);\r\n      }\r\n    }\r\n    lastBound = [-1, -1];\r\n  }\r\n\r\n  let dpr = 1;\r\n  function sizeCanvas() {\r\n    dpr = Math.min(window.devicePixelRatio || 1, BIG ? 2 : 1.5);\r\n    canvas.width = Math.round(innerWidth * dpr);\r\n    canvas.height = Math.round(innerHeight * dpr);\r\n    sizePost();\r\n  }\r\n\r\n  async function initGL() {\r\n    try {\r\n      prog = link(VS, FS);\r\n      qprog = link(QVS, QFS, { aUV: 0 });\r\n      bprog = link(PVS, BFS, { aUV: 0 });\r\n      cprog = link(PVS, CFS, { aUV: 0 });\r\n      wprog = link(PVS, WFS, { aUV: 0 });\r\n      tprog = link(TVS, TFS, { aUV: 0 });\r\n      locs(prog, U, ['uPosA', 'uPosB', 'uColA', 'uColB', 'uWake', 'uTexW', 'uMix', 'uMixPrev', 'uStyle', 'uKindA', 'uKindB', 'uTime', 'uDt', 'uShutter', 'uTilt', 'uIntro', 'uIntroPrev', 'uBrush', 'uDpr', 'uFocus', 'uAspect', 'uAperture', 'uGainA', 'uGainB', 'uVel', 'uWH', 'uPar', 'uHalfRes', 'uWakeTexel', 'uImgC', 'uHelC', 'uWordC', 'uBreath', 'uSolid', 'uDis', 'uPart', 'uGrainK', 'uProj', 'uView']);\r\n      locs(qprog, QU, ['uImgC', 'uSize', 'uPar', 'uTilt', 'uProj', 'uView', 'uTex', 'uA', 'uR', 'uSweep']);\r\n      locs(bprog, BU, ['uTex', 'uTexel', 'uMode', 'uThr', 'uKnee']);\r\n      locs(cprog, CU, ['uHdr', 'uBloom', 'uRes', 'uBg', 'uExposure', 'uBloomAmt', 'uGrain', 'uVig', 'uTime', 'uSS', 'uTx']);\r\n      locs(wprog, WU, ['uPrev', 'uA', 'uB', 'uVel', 'uAmt', 'uRad', 'uAspect', 'uDecay', 'uRate']);\r\n      locs(tprog, TU, ['uRect', 'uProj', 'uView', 'uText', 'uWake', 'uTarget', 'uA', 'uBrushT', 'uDis', 'uSplit', 'uGrainK', 'uAspect', 'uColA', 'uColB']);\r\n      gl.useProgram(tprog); gl.uniform1i(TU.uText, 8); gl.uniform1i(TU.uWake, 7);\r\n      dummyTex = gl.createTexture();\r\n      gl.bindTexture(gl.TEXTURE_2D, dummyTex);\r\n      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));\r\n\r\n      const rand = new Float32Array(N);\r\n      for (let i = 0; i < N; i++) rand[i] = Math.random();\r\n      vao = gl.createVertexArray();\r\n      gl.bindVertexArray(vao);\r\n      gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\r\n      gl.bufferData(gl.ARRAY_BUFFER, rand, gl.STATIC_DRAW);\r\n      gl.enableVertexAttribArray(0);\r\n      gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);\r\n      gl.vertexAttribDivisor(0, 1);\r\n      gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\r\n      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\r\n      gl.enableVertexAttribArray(1);\r\n      gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);\r\n\r\n      qvao = gl.createVertexArray();\r\n      gl.bindVertexArray(qvao);\r\n      gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\r\n      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1]), gl.STATIC_DRAW);\r\n      gl.enableVertexAttribArray(0);\r\n      gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\r\n      gl.bindVertexArray(null);\r\n\r\n      gl.useProgram(prog);\r\n      gl.uniform1i(U.uPosA, 0); gl.uniform1i(U.uPosB, 1); gl.uniform1i(U.uColA, 2); gl.uniform1i(U.uColB, 3); gl.uniform1i(U.uWake, 7);\r\n      gl.uniform1i(U.uTexW, TW);\r\n      gl.disable(gl.DEPTH_TEST);\r\n      sizeCanvas();\r\n      images = await Promise.all(SRC.map(src => new Promise(res => {\r\n        const im = new Image();\r\n        im.onload = () => res(im); im.onerror = () => res(null);\r\n        im.src = src;\r\n      })));\r\n      await fontReady();\r\n      pageTex = images.map(makePageTex);\r\n      buildAll();\r\n      built = true;\r\n      introT0 = performance.now();\r\n    } catch (err) {\r\n      console.error(err);\r\n      fallback();\r\n    }\r\n  }\r\n  canvas.addEventListener('webglcontextlost', e => { e.preventDefault(); built = false; fallback(); });\r\n\r\n  \/* ---------- camera ---------- *\/\r\n  function perspective(fovy, aspect, near, far) {\r\n    const f = 1 \/ Math.tan(fovy \/ 2), nf = 1 \/ (near - far);\r\n    return new Float32Array([f \/ aspect, 0, 0, 0, 0, f, 0, 0, 0, 0, (far + near) * nf, -1, 0, 0, 2 * far * near * nf, 0]);\r\n  }\r\n  function lookAt(ex, ey, ez) {\r\n    let zx = ex, zy = ey, zz = ez;\r\n    let l = Math.hypot(zx, zy, zz); zx \/= l; zy \/= l; zz \/= l;\r\n    let xx = zz, xy = 0, xz = -zx;\r\n    l = Math.hypot(xx, xy, xz) || 1; xx \/= l; xy \/= l; xz \/= l;\r\n    const yx = zy * xz - zz * xy, yy = zz * xx - zx * xz, yz = zx * xy - zy * xx;\r\n    return new Float32Array([\r\n      xx, yx, zx, 0,\r\n      xy, yy, zy, 0,\r\n      xz, yz, zz, 0,\r\n      -(xx * ex + xy * ey + xz * ez), -(yx * ex + yy * ey + yz * ez), -(zx * ex + zy * ey + zz * ez), 1\r\n    ]);\r\n  }\r\n\r\n  \/* ---------- pointer: a slow wake through the stars (first, second and last scenes); a 3D tilt on the client pages ---------- *\/\r\n  const ptr = { x: 0, y: 0, tx: 0, ty: 0, inside: false };\r\n  if (FINE) {\r\n    addEventListener('pointermove', e => {\r\n      if (e.pointerType !== 'mouse') return;\r\n      ptr.tx = (e.clientX \/ innerWidth) * 2 - 1;\r\n      ptr.ty = -((e.clientY \/ innerHeight) * 2 - 1);\r\n      ptr.inside = true;\r\n    }, { passive: true });\r\n    document.addEventListener('pointerleave', () => { ptr.inside = false; });\r\n    addEventListener('blur', () => { ptr.inside = false; });\r\n  }\r\n  function updateWake(dt, active) {\r\n    const tx = ptr.tx * 0.5 + 0.5, ty = ptr.ty * 0.5 + 0.5;\r\n    const stroke = ptr.inside && active;\r\n    const ax = stroke && WK.lx !== null ? WK.lx : tx, ay = stroke && WK.ly !== null ? WK.ly : ty;\r\n    const aspect = canvas.width \/ canvas.height;\r\n    const seg = Math.hypot((tx - ax) * aspect, ty - ay);\r\n    WK.lx = stroke ? tx : null; WK.ly = stroke ? ty : null;\r\n    gl.bindFramebuffer(gl.FRAMEBUFFER, WK.b.fb);\r\n    gl.viewport(0, 0, WK.w, WK.h);\r\n    gl.disable(gl.BLEND);\r\n    gl.useProgram(wprog);\r\n    gl.bindVertexArray(qvao);\r\n    gl.activeTexture(gl.TEXTURE7);\r\n    gl.bindTexture(gl.TEXTURE_2D, WK.a.tex);\r\n    gl.uniform1i(WU.uPrev, 7);\r\n    gl.uniform2f(WU.uA, ax, ay);\r\n    gl.uniform2f(WU.uB, tx, ty);\r\n    gl.uniform2f(WU.uVel, (tx - ax) * 2, (ty - ay) * 2);\r\n    gl.uniform1f(WU.uAmt, stroke ? Math.min(0.5, seg * 10) : 0);\r\n    gl.uniform1f(WU.uRad, 0.045);\r\n    gl.uniform1f(WU.uAspect, aspect);\r\n    gl.uniform1f(WU.uDecay, Math.pow(0.984, dt * 60));\r\n    gl.uniform1f(WU.uRate, 1 - Math.pow(0.965, dt * 60));\r\n    gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n    const t = WK.a; WK.a = WK.b; WK.b = t;\r\n  }\r\n\r\n  const wOf = (k, from, to, m) => (from === to ? (from === k ? 1 : 0) : (from === k ? 1 - m : 0) + (to === k ? m : 0));\r\n  let lastBound = [-1, -1], lastNow = 0, prevMix = 0, prevPair = '', prevIntro = 1;\r\n  function render(now) {\r\n    const t = now \/ 1000;\r\n    const dt = lastNow ? Math.min(1 \/ 30, (now - lastNow) \/ 1000) : 1 \/ 60;\r\n    lastNow = now;\r\n    const { from, to } = disp;\r\n    const mix = disp.mix;\r\n    const mixv = from === to ? 0 : mix;\r\n    const pair = from + ':' + to;\r\n    if (pair !== prevPair) { prevMix = mixv; prevPair = pair; }\r\n\r\n    ptr.x = lerp(ptr.x, ptr.tx, 0.05);\r\n    ptr.y = lerp(ptr.y, ptr.ty, 0.05);\r\n    const w0 = wOf(0, from, to, mix), w7 = wOf(7, from, to, mix), starW = w0 + w7;\r\n    const wordC = starW > 0.001 ? [(layout.word0[0] * w0 + layout.word7[0] * w7) \/ starW, (layout.word0[1] * w0 + layout.word7[1] * w7) \/ starW] : (to === 7 ? layout.word7 : layout.word0);\r\n    const brushW = starW + wOf(1, from, to, mix) + wOf(6, from, to, mix);\r\n    if (WK.ok) updateWake(dt, brushW > 0.05);\r\n\r\n    const proj = perspective(FOV, canvas.width \/ canvas.height, 0.1, 100);\r\n    const imgW = [2, 3, 4, 5].reduce((s, k) => s + wOf(k, from, to, mix), 0);\r\n    const view = lookAt(ptr.x * 0.35 * imgW, ptr.y * 0.2 * imgW, CAMZ);\r\n    const tilt = (dims.mobile ? 0.45 : 1) * imgW;\r\n    const par = FINE ? [ptr.x, ptr.y] : [0, 0];\r\n    const intro = Math.pow(1 - clamp((now - introT0) \/ 3600), 3);\r\n    const solid0 = smooth(0.86, 1, w0) * (1 - smooth(0.01, 0.15, intro)), solid7 = smooth(0.86, 1, w7);\r\n\r\n    \/\/ 1. particles into the HDR target\r\n    gl.bindFramebuffer(gl.FRAMEBUFFER, PP.hdr.fb);\r\n    if (PP.mrt) gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1]);\r\n    gl.viewport(0, 0, PP.w, PP.h);\r\n    gl.clearColor(0, 0, 0, 0);\r\n    gl.clear(gl.COLOR_BUFFER_BIT);\r\n    gl.enable(gl.BLEND);\r\n    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\r\n    gl.useProgram(prog);\r\n    gl.bindVertexArray(vao);\r\n    if (lastBound[0] !== from || lastBound[1] !== to) {\r\n      gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, posTex[from]);\r\n      gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, posTex[to]);\r\n      gl.activeTexture(gl.TEXTURE2); gl.bindTexture(gl.TEXTURE_2D, colTex[from]);\r\n      gl.activeTexture(gl.TEXTURE3); gl.bindTexture(gl.TEXTURE_2D, colTex[to]);\r\n      lastBound = [from, to];\r\n    }\r\n    gl.activeTexture(gl.TEXTURE7);\r\n    gl.bindTexture(gl.TEXTURE_2D, WK.ok ? WK.a.tex : dummyTex);\r\n    gl.uniform1f(U.uMix, mixv);\r\n    gl.uniform1f(U.uMixPrev, prevMix);\r\n    gl.uniform1f(U.uStyle, STYLE[Math.min(from, STYLE.length - 1)]);\r\n    gl.uniform1f(U.uKindA, KIND[from]);\r\n    gl.uniform1f(U.uKindB, KIND[to]);\r\n    gl.uniform1f(U.uGainA, GAIN[KIND[from]]);\r\n    gl.uniform1f(U.uGainB, GAIN[KIND[to]]);\r\n    gl.uniform1f(U.uTime, t);\r\n    gl.uniform1f(U.uDt, dt);\r\n    gl.uniform1f(U.uShutter, 2);\r\n    gl.uniform1f(U.uVel, velS);\r\n    gl.uniform1f(U.uTilt, dims.mobile ? 0.45 : 1);\r\n    gl.uniform3f(U.uWordC, wordC[0], wordC[1], 0);\r\n    gl.uniform1f(U.uBreath, 0);\r\n    gl.uniform1f(U.uSolid, smooth(0.5, 1, solid0) + smooth(0.5, 1, solid7));\r\n    gl.uniform1f(U.uGrainK, innerHeight \/ 9);\r\n    gl.uniform1f(U.uIntro, intro);\r\n    gl.uniform1f(U.uIntroPrev, prevIntro);\r\n    gl.uniform1f(U.uBrush, WK.ok ? brushW : 0);\r\n    gl.uniform1f(U.uDpr, dpr * PP.ss);\r\n    gl.uniform1f(U.uFocus, CAMZ);\r\n    gl.uniform1f(U.uAspect, PP.w \/ PP.h);\r\n    gl.uniform1f(U.uAperture, BIG ? 12 : 6);\r\n    gl.uniform2f(U.uWH, dims.W, dims.H);\r\n    gl.uniform2f(U.uPar, par[0], par[1]);\r\n    gl.uniform2f(U.uHalfRes, PP.w \/ 2, PP.h \/ 2);\r\n    gl.uniform2f(U.uWakeTexel, WK.ok ? 1 \/ WK.w : 0.01, WK.ok ? 1 \/ WK.h : 0.01);\r\n    gl.uniform3f(U.uImgC, layout.img[0], layout.img[1], 0);\r\n    gl.uniform3f(U.uHelC, layout.hel[0], layout.hel[1], 0);\r\n    gl.uniformMatrix4fv(U.uProj, false, proj);\r\n    gl.uniformMatrix4fv(U.uView, false, view);\r\n    const dissolve = WK.ok ? 1 : 0;\r\n    gl.uniform1f(U.uDis, dissolve);\r\n    gl.uniform1f(U.uPart, 1.25);\r\n    gl.drawArraysInstanced(gl.TRIANGLE_STRIP, 0, 4, N);\r\n    \/\/ soften the letter coverage once, at half resolution, before the letters read it\r\n    if (PP.mrt) {\r\n      gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.NONE]);\r\n      if (starW > 0.001) {\r\n        gl.disable(gl.BLEND);\r\n        gl.useProgram(bprog);\r\n        gl.bindVertexArray(qvao);\r\n        gl.bindFramebuffer(gl.FRAMEBUFFER, PP.denH.fb);\r\n        gl.viewport(0, 0, PP.denH.w, PP.denH.h);\r\n        gl.activeTexture(gl.TEXTURE5);\r\n        gl.bindTexture(gl.TEXTURE_2D, PP.den.tex);\r\n        gl.uniform1i(BU.uTex, 5);\r\n        gl.uniform1i(BU.uMode, 1);\r\n        gl.uniform2f(BU.uTexel, 1 \/ PP.den.w, 1 \/ PP.den.h);\r\n        gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n        gl.bindFramebuffer(gl.FRAMEBUFFER, PP.hdr.fb);\r\n        gl.viewport(0, 0, PP.w, PP.h);\r\n        gl.enable(gl.BLEND);\r\n        gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\r\n      }\r\n    }\r\n    gl.bindVertexArray(vao);\r\n    prevMix = mixv;\r\n    prevIntro = intro;\r\n\r\n    \/\/ 2. bloom chain: bright-pass + downsample, then tent upsample back up\r\n    gl.useProgram(bprog);\r\n    gl.bindVertexArray(qvao);\r\n    gl.activeTexture(gl.TEXTURE5);\r\n    gl.uniform1i(BU.uTex, 5);\r\n    gl.uniform1f(BU.uThr, 1.0);\r\n    gl.uniform1f(BU.uKnee, 0.6);\r\n    gl.disable(gl.BLEND);\r\n    let src = PP.hdr;\r\n    PP.mips.forEach((mp, i) => {\r\n      gl.bindFramebuffer(gl.FRAMEBUFFER, mp.fb);\r\n      gl.viewport(0, 0, mp.w, mp.h);\r\n      gl.bindTexture(gl.TEXTURE_2D, src.tex);\r\n      gl.uniform2f(BU.uTexel, 1 \/ src.w, 1 \/ src.h);\r\n      gl.uniform1i(BU.uMode, i === 0 ? 0 : 1);\r\n      gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n      src = mp;\r\n    });\r\n    gl.enable(gl.BLEND);\r\n    gl.blendFunc(gl.ONE, gl.ONE);\r\n    gl.uniform1i(BU.uMode, 2);\r\n    for (let i = PP.mips.length - 2; i >= 0; i--) {\r\n      const mp = PP.mips[i], s = PP.mips[i + 1];\r\n      gl.bindFramebuffer(gl.FRAMEBUFFER, mp.fb);\r\n      gl.viewport(0, 0, mp.w, mp.h);\r\n      gl.bindTexture(gl.TEXTURE_2D, s.tex);\r\n      gl.uniform2f(BU.uTexel, 1 \/ s.w, 1 \/ s.h);\r\n      gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n    }\r\n\r\n    \/\/ 3. composite to the screen: exposure, bloom, vignette, AgX tone map, grain, dither\r\n    gl.disable(gl.BLEND);\r\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n    gl.viewport(0, 0, canvas.width, canvas.height);\r\n    gl.useProgram(cprog);\r\n    gl.activeTexture(gl.TEXTURE5); gl.bindTexture(gl.TEXTURE_2D, PP.hdr.tex);\r\n    gl.activeTexture(gl.TEXTURE6); gl.bindTexture(gl.TEXTURE_2D, PP.mips.length ? PP.mips[0].tex : PP.hdr.tex);\r\n    gl.uniform1i(CU.uHdr, 5);\r\n    gl.uniform1i(CU.uBloom, 6);\r\n    gl.uniform2f(CU.uRes, canvas.width, canvas.height);\r\n    gl.uniform3f(CU.uBg, 8 \/ 255, 9 \/ 255, 11 \/ 255);\r\n    gl.uniform1f(CU.uExposure, 1.0);\r\n    gl.uniform1f(CU.uBloomAmt, PP.mips.length ? 0.22 + 0.25 * wOf(6, from, to, mix) : 0);\r\n    gl.uniform1f(CU.uGrain, 0.015);\r\n    gl.uniform1f(CU.uVig, 0.4);\r\n    gl.uniform1f(CU.uTime, t);\r\n    gl.uniform1f(CU.uSS, PP.ss);\r\n    gl.uniform2f(CU.uTx, 1 \/ canvas.width, 1 \/ canvas.height);\r\n    gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n\r\n    \/\/ 4. once a page has finished forming, the real screenshot takes over (no bloom, no tone map)\r\n    gl.enable(gl.BLEND);\r\n    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\r\n    for (let k = 2; k <= 5; k++) {\r\n      const a = smooth(0.86, 1, wOf(k, from, to, mix));\r\n      if (a <= 0.001) continue;\r\n      gl.useProgram(qprog);\r\n      gl.activeTexture(gl.TEXTURE4);\r\n      gl.bindTexture(gl.TEXTURE_2D, pageTex[k - 2]);\r\n      gl.uniform1i(QU.uTex, 4);\r\n      gl.uniform1f(QU.uA, a);\r\n      gl.uniform1f(QU.uSweep, a);\r\n      gl.uniform1f(QU.uR, layout.imgW * 0.008);\r\n      gl.uniform1f(QU.uTilt, tilt);\r\n      gl.uniform2f(QU.uSize, layout.imgW, layout.imgW \/ PAGE_AR);\r\n      gl.uniform2f(QU.uPar, par[0], par[1]);\r\n      gl.uniform3f(QU.uImgC, layout.img[0], layout.img[1], 0);\r\n      gl.uniformMatrix4fv(QU.uProj, false, proj);\r\n      gl.uniformMatrix4fv(QU.uView, false, view);\r\n      gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n    }\r\n    \/\/ 5. the wordmark itself: flat logo colours, after tone mapping, like the screenshots\r\n    [[0, solid0], [7, solid7]].forEach(([k, sv]) => {\r\n      const tx = layout.text && layout.text[k], a = smooth(0, 0.5, sv);\r\n      if (a <= 0.001 || !tx || !textTex[k]) return;\r\n      gl.useProgram(tprog);\r\n      gl.bindVertexArray(qvao);\r\n      gl.activeTexture(gl.TEXTURE8); gl.bindTexture(gl.TEXTURE_2D, textTex[k]);\r\n      gl.activeTexture(gl.TEXTURE7); gl.bindTexture(gl.TEXTURE_2D, WK.ok ? WK.a.tex : dummyTex);\r\n      gl.uniform4f(TU.uRect, tx.x0, tx.y0, tx.w, tx.h);\r\n      gl.uniformMatrix4fv(TU.uProj, false, proj);\r\n      gl.uniformMatrix4fv(TU.uView, false, view);\r\n      gl.uniform2f(TU.uTarget, canvas.width, canvas.height);\r\n      gl.uniform1f(TU.uA, a);\r\n      gl.uniform1f(TU.uDis, dissolve);\r\n      gl.uniform1f(TU.uBrushT, WK.ok ? 1 : 0);\r\n      gl.uniform1f(TU.uSplit, tx.split);\r\n      gl.uniform1f(TU.uGrainK, innerHeight \/ 9);\r\n      gl.uniform1f(TU.uAspect, canvas.width \/ canvas.height);\r\n      gl.uniform3fv(TU.uColA, LOGO.pearl); gl.uniform3fv(TU.uColB, LOGO.violet);\r\n      gl.drawArrays(gl.TRIANGLES, 0, 6);\r\n    });\r\n    gl.bindVertexArray(null);\r\n  }\r\n\r\n  function frame(now) {\r\n    if (lenis) lenis.raf(now);\r\n    const y = scrollY, dy = y - lastY;\r\n    lastY = y;\r\n    velS += (dy - velS) * 0.15;\r\n    if (Math.abs(velS) < 0.02) velS = 0;\r\n    readScroll();\r\n    updateDisp(now);\r\n    writeChrome();\r\n    if (gl && built && PP.hdr) render(now);\r\n    requestAnimationFrame(frame);\r\n  }\r\n\r\n  let rz = 0;\r\n  addEventListener('resize', () => {\r\n    vh = innerHeight;\r\n    clearTimeout(rz);\r\n    rz = setTimeout(() => {\r\n      if (!gl || !built || innerWidth < 2 || innerHeight < 2) return;\r\n      sizeCanvas();\r\n      if (innerWidth !== builtW || Math.abs(innerHeight - builtH) > 140) buildAll();\r\n    }, 160);\r\n  });\r\n\r\n  if (gl) initGL();\r\n  requestAnimationFrame(frame);\r\n})();\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Scrollcraft Studio Skip to content Scrollcraft Studio Work Services Contact ScrollcraftStudio Websites that hold attention.Platforms that deliver results. Scrollcraft Studio is a design and build studio, connecting marketing, sales, writing, design, and data. Scroll Approach Every site is designed and tailored for both form and function. Beyond exceptional design, we build tools that drive performance: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_canvas","meta":{"footnotes":""},"class_list":["post-39","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/pages\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":25,"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/pages\/39\/revisions"}],"predecessor-version":[{"id":79,"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=\/wp\/v2\/pages\/39\/revisions\/79"}],"wp:attachment":[{"href":"https:\/\/scrollcraftstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}