/* My story: one stick figure walks a single line (life.js), pinned and scroll-scrubbed. */
#life{position:relative;color:var(--ink);font-family:var(--sans);background:var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");--paper:#F3F1EC;--ink:#1E1E1C;--mut:#6B6A64;--block:#DCDBD5;--pane:#C9C8C2;--mono:"Geist Mono",ui-monospace,monospace;--sans:"Geist",system-ui,sans-serif;--serif:"Newsreader",Georgia,serif}
#lifesvg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
#lifesvg path,#lifesvg rect,#lifesvg circle,#lifesvg ellipse{fill:none;stroke:var(--ink);stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
#lifesvg .ground{stroke-width:6}
#lifesvg .thin{stroke-width:2.5}#lifesvg .thick{stroke-width:7}
#lifesvg .solid{fill:var(--ink);stroke:none}#lifesvg .paper{fill:var(--paper);stroke:none}#lifesvg .paper.stroke,#lifesvg .stroke{stroke:var(--ink);stroke-width:4}
#lifesvg .block{fill:var(--block);stroke:none}#lifesvg .win{fill:#1c1c1a;stroke:none}#lifesvg .pane{fill:var(--pane);stroke:none}#lifesvg .mull{stroke:var(--paper);stroke-width:4}
#lifesvg .f path{stroke-width:6}#lifesvg .f circle{fill:var(--ink);stroke:none}
#lifesvg .f.w path,#lifesvg .wl{stroke:#F3F1EC}#lifesvg .f.w circle,#lifesvg .wf{fill:#F3F1EC;stroke:none}#lifesvg .wl.thin{stroke-width:2.5}
#lifesvg .sc{stroke-width:2.6;stroke:#3a3a37}
#lifesvg .beam{stroke-width:22;stroke-linecap:butt}
#lifesvg .dash{stroke-dasharray:4 9}
#lifesvg .cn{stroke-width:2.4}
#lifesvg .rainp{stroke:#8d918f;stroke-width:2}
#lifesvg #rain.on .rainp{animation:rain .5s linear infinite}
@keyframes rain{to{transform:translate(-10px,34px)}}
#lifesvg .water{fill:#7d8a8d;fill-opacity:.42;stroke:#3d4446;stroke-width:3}
#lifesvg #wb{stroke-width:7}#lifesvg #wh{fill:var(--ink);stroke:none}
#lifesvg .lb{font:500 var(--lbs,13px)/1 var(--mono);letter-spacing:.08em;fill:var(--mut);stroke:none}
#lifesvg .lb.inv{fill:#F3F1EC}#lifesvg .lb.sm{font-size:calc(var(--lbs,13px)*.85)}
#lifesvg .lbig{font:400 56px/1 var(--serif);fill:var(--ink);stroke:none}
#lifesvg .lr{--p:0}
#lifesvg .lr[data-fx=pop]{opacity:var(--p);transform:translateY(calc((1 - var(--p)) * 16px)) scale(calc(.86 + .14 * var(--p)));transform-box:fill-box;transform-origin:50% 100%}
#lifesvg .lr[data-fx=fade]{opacity:var(--p)}
#lifesvg .lr[data-fx=draw] .dr{stroke-dasharray:1 1;stroke-dashoffset:calc(1 - var(--p))}
#lifesvg .lr[data-fx=bar]{opacity:min(1,calc(var(--p) * 4))}
#lifesvg .lr[data-fx=bar] .fill{transform:scaleX(var(--p));transform-box:fill-box;transform-origin:0 50%}
#lifesvg .crowd .cn{visibility:hidden}
#lifesvg .lr[data-fx=count] text{opacity:min(1,calc(var(--p) * 8))}
#life .lcap{position:absolute;left:clamp(16px,6vw,96px);top:clamp(28px,9vh,110px);width:min(440px,calc(100vw - 32px));opacity:0;transform:translateY(12px);transition:opacity .45s ease,transform .6s cubic-bezier(.23,1,.32,1);pointer-events:none;z-index:3}
#life .lcap.on{opacity:1;transform:none;pointer-events:auto}
#life .lcap .lyr{font:500 12px/1 var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--mut)}
#life .lcap h1,#life .lcap h2{font:400 clamp(36px,4.6vw,64px)/1 var(--serif);letter-spacing:-.025em;margin:14px 0 16px}
#life .lcap p{font-size:clamp(15px,1.15vw,18px);line-height:1.5;color:#2c2c29;max-width:38ch}
#life .lcap p+p{margin-top:10px}
#life .lstats{display:grid;grid-template-columns:1fr 1fr;gap:18px 26px;margin-top:6px}
#life .lstats div{border-top:1.5px solid var(--ink);padding-top:10px}
#life .lstats b{display:block;font:400 clamp(30px,3vw,44px)/1 var(--serif);letter-spacing:-.02em}
#life .lstats span{display:block;font:500 11px/1.35 var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--mut);margin-top:6px}
#life .lcue{margin-top:26px;font:500 12px/1 var(--mono);letter-spacing:.1em;color:var(--mut);display:flex;gap:10px;align-items:center}
#life .lcue i{width:1.5px;height:34px;background:var(--ink);transform-origin:top;animation:cue 1.6s cubic-bezier(.23,1,.32,1) infinite}
@keyframes cue{0%{transform:scaleY(0)}60%{transform:scaleY(1)}100%{transform:scaleY(1);opacity:0}}
#life .llinks{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
#life .llinks a{font:500 13px/1 var(--mono);letter-spacing:.04em;text-decoration:none;border:1.5px solid var(--ink);padding:12px 16px;border-radius:999px;transition:background-color .15s,color .15s}
#life .llinks a:hover{background:var(--ink);color:var(--paper)}
#life .ltl{position:absolute;left:50%;bottom:22px;transform:translateX(-50%);width:min(560px,calc(100vw - 32px));z-index:3;font:500 11px/1 var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--mut)}
#life .ltl .lbar{height:2px;background:rgba(30,30,28,.15);margin-top:9px;overflow:hidden}
#life .ltl .lbar i{display:block;height:100%;background:var(--ink);transform-origin:left;transform:scaleX(0)}
@media (max-width:700px){#life .lcap{top:22px}#life .lcap h1,#life .lcap h2{margin:10px 0 12px}#life .lstats{gap:12px 18px}}
@media (prefers-reduced-motion:reduce){#life .lcap{transition:opacity .2s}#life .lcue i,#life .rainp{animation:none!important}}
#life .lstage{position:sticky;top:var(--navh,0px);height:calc(100svh - var(--navh,0px));overflow:hidden}
#life a{color:inherit}

/* v2: the acted story */
#life #lifesvg .boil{filter:url(#boil)}
#life #lifesvg.moving .boil{filter:none}  /* the line only wobbles while you pause: filters are too heavy to run while scrolling */
#life #lifesvg .ac path{stroke-width:6}#life #lifesvg .ac circle{fill:var(--ink);stroke:none}
#life #lifesvg .burst{fill:var(--paper);stroke:var(--ink);stroke-width:3}
#life #lifesvg .fxt{font:600 26px/1 var(--sans);fill:var(--ink);stroke:none}
#life #lifesvg .fxw{font-family:var(--serif);font-weight:500;fill:var(--ink);stroke:var(--paper);stroke-width:6px;paint-order:stroke;letter-spacing:-.02em}
#life #lifesvg .fxn,#life #lifesvg .fxs{font-family:var(--sans);font-weight:600;fill:var(--ink);stroke:none}
#life #lifesvg .fxs{font-size:15px}
#life #lifesvg .drop{fill:#7d8a8d;stroke:none}
#life #lifesvg .crayon{stroke:#3a3a37;stroke-width:3;fill:none}
#life #lifesvg .smear{stroke:var(--ink);stroke-width:14;opacity:.18;fill:none;stroke-linecap:round}
#life #lifesvg .spot{fill:#fff;stroke:none;mix-blend-mode:soft-light}
#life #lifesvg .chart{stroke:var(--ink);stroke-width:3;fill:none}
#life #lifesvg .cloud{fill:#5f6566;stroke:none}
#life #lifesvg .rainp2{stroke:#7d8a8d;stroke-width:2}
#life #lifesvg .water2{fill:#7d8a8d;fill-opacity:.45;stroke:#3d4446;stroke-width:3}
#life #lifesvg .conf{fill:#9aa3a6;stroke:none}
#life #lifesvg .far{fill:none;stroke:#cfccc4;stroke-width:3}
#life #lifesvg .pitch{stroke:#bdb9b0;stroke-width:8}
#life #lifesvg .mull2{stroke:var(--paper);stroke-width:2.5}
#life #lifesvg #wh{filter:drop-shadow(0 1px 0 rgba(0,0,0,.15))}

/* lcap backdrop: art passing behind a caption never fights the text */
#life .lcap{background:radial-gradient(120% 120% at 20% 30%,rgba(243,241,236,.94) 55%,rgba(243,241,236,0) 100%);padding:14px 18px 18px;margin:-14px -18px}

#life #lifesvg .ropeC{fill:none;stroke:#8a6a3a;stroke-width:4}

#life .lcap .lmap{display:block;width:100%;max-width:280px;height:auto;margin-top:12px;border-radius:8px}
