Back to the app
The code
The Most Uncomfortable Web Page by GPT-6.1 Sol
Exactly as the AI wrote it. Shown as text, so nothing runs on this page.
index.html
works · auto-checked (Checked by an automated pass. Not hand-played yet.)<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#f5f2e9">
<title>Almost. — A small test of patience</title>
<style>
:root{--paper:#f5f2e9;--ink:#272923;--muted:#72746a;--line:#d5d5c9;--orange:#f85a35;--yellow:#ede887;--green:#d9e6ce;--white:#fffef7;--radius:18px}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:Arial,Helvetica,sans-serif}button{font:inherit;cursor:pointer;color:inherit;touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid var(--orange);outline-offset:5px}button:disabled{cursor:default}::selection{background:var(--yellow)}[hidden]{display:none!important}.shell{max-width:1440px;margin:auto;padding:0 5.3%}.masthead{height:99px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:18px}.brand{font-size:31px;font-weight:900;letter-spacing:-1.8px;display:flex;align-items:center;gap:11px}.brand-mark{height:32px;width:32px;transform:rotate(-7deg);position:relative;border:2px solid var(--ink);border-radius:9px}.brand-mark:before,.brand-mark:after{content:'';position:absolute;top:9px;width:4px;height:4px;background:var(--ink);border-radius:50%}.brand-mark:before{left:6px}.brand-mark:after{right:6px}.brand-mark i{position:absolute;bottom:6px;left:9px;width:11px;border-top:2px solid var(--ink);transform:rotate(9deg)}.tagline{font-size:10px;font-family:monospace;text-transform:uppercase;letter-spacing:1.7px;margin-left:20px;line-height:1.7;font-weight:400;max-width:180px}.header-right{display:flex;align-items:center;gap:25px}.live{font-size:11px;letter-spacing:.7px;display:flex;gap:8px;align-items:center}.live:before{content:'';width:7px;height:7px;background:var(--orange);border-radius:50%}.exit{background:none;border:0;border-bottom:1px solid var(--ink);font-size:12px;padding:12px 0}.hero{position:relative;padding:52px 0 36px;display:flex;justify-content:space-between;gap:30px}.eyebrow{font-family:monospace;font-size:11px;letter-spacing:1.5px;text-transform:uppercase;display:flex;align-items:center;gap:11px}.eyebrow:before{content:'';width:24px;height:1px;background:var(--orange)}h1{font-size:clamp(52px,6.2vw,88px);letter-spacing:-5.1px;line-height:.99;font-weight:800;margin:21px 0 23px;max-width:850px}h1 em{font-family:Georgia,'Times New Roman',serif;font-weight:400;letter-spacing:-4px}h1 .off{position:relative;top:1px;left:1px}.intro{font-size:15px;color:#64665c;line-height:1.65;max-width:520px;margin:0}.hero-side{position:relative;flex:0 0 175px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:12px}.sun{width:123px;height:123px;background:var(--orange);clip-path:polygon(50% 0,59% 17%,75% 7%,76% 27%,96% 25%,86% 43%,100% 55%,80% 61%,87% 80%,66% 79%,60% 100%,47% 84%,30% 97%,28% 77%,7% 80%,16% 60%,0 49%,19% 40%,10% 21%,32% 24%,35% 3%,47% 18%);transform:rotate(9deg);display:grid;place-items:center}.sun-face{font-size:35px;letter-spacing:4px;transform:rotate(-9deg);margin-top:-9px;font-family:monospace}.stamp-caption{font-family:monospace;font-size:10px;text-transform:uppercase;text-align:center;letter-spacing:1px;line-height:1.6;transform:rotate(5deg);margin-top:14px}.section-bar{border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:19px 0;font-family:monospace;font-size:11px;letter-spacing:1px}.section-bar .right{color:var(--muted);letter-spacing:0}.workspace{display:grid;grid-template-columns:1.62fr 1fr;gap:22px;align-items:start}.left-column{display:grid;gap:21px}.card{border:1px solid #cccec0;border-radius:var(--radius);background:#faf9f2;overflow:hidden;position:relative}.card-top{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 0;gap:15px}.card-label{font-family:monospace;text-transform:uppercase;font-size:10px;letter-spacing:1px;display:flex;align-items:center;gap:9px}.number{color:var(--muted)}.status{border:1px solid #d7d8cc;border-radius:50px;font:10px monospace;padding:5px 9px;white-space:nowrap;color:var(--muted);background:#fffdf6}.status.done{background:var(--green);border-color:#bbceb0;color:#42613a}.card h2{font-size:23px;letter-spacing:-.7px;margin:13px 24px 7px}.card-desc{margin:0 24px;color:var(--muted);font-size:12px;line-height:1.6}.dodge-card{min-height:242px}.arena{height:118px;position:relative;margin:0 22px 5px;display:flex;align-items:center;justify-content:center;overflow:hidden}.target{position:absolute;min-height:47px;padding:0 25px;background:var(--orange);border:1px solid var(--orange);border-radius:9px;color:#fffdf5;font-weight:700;font-size:13px;box-shadow:0 4px 0 #ce4326;transform:translate(var(--dx,0px),var(--dy,0px));transition:transform .2s ease,background .2s;white-space:nowrap}.target:active{box-shadow:none}.arena-note{position:absolute;bottom:3px;font:10px monospace;color:#85877a;left:0;right:0;text-align:center}.progress-card{min-height:228px}.progress-row{display:flex;justify-content:space-between;align-items:center;margin:24px 24px 8px;gap:15px}.progress-track{height:13px;background:#e3e4d8;border-radius:3px;flex:1;overflow:hidden}.progress-fill{height:100%;width:0;background:var(--ink);border-radius:3px;transition:width .12s linear}.percent{font-family:monospace;font-weight:bold;font-size:18px;min-width:47px;text-align:right}.progress-bottom{margin:14px 24px 21px;display:flex;align-items:center;justify-content:space-between;gap:15px}.progress-copy{color:var(--muted);font:10px/1.5 monospace;max-width:280px}.small-btn{background:var(--white);border:1px solid #bec1b2;padding:11px 14px;border-radius:7px;font-size:11px;min-height:42px;white-space:nowrap}.small-btn:hover{background:var(--yellow)}.cookie-card{background:var(--yellow);border-color:#cfcd78;min-height:491px;transform:rotate(.7deg);overflow:visible}.cookie-card .card-top{padding:20px 22px 0}.cookie-card h2{margin:13px 22px 7px}.cookie-card .card-desc{margin:0 22px;color:#666648;max-width:300px}.cookie-stage{height:202px;position:relative;margin:12px 22px 4px;display:grid;place-items:center}.cookie-svg{width:109px;height:109px;transform:rotate(-11deg)}.cookie-note{position:absolute;bottom:8px;right:0;padding:7px 9px;background:#f9f6c7;border:1px solid #c7c474;border-radius:3px;font:10px monospace;transform:rotate(-5deg)}.cookie-actions{display:flex;flex-direction:column;gap:9px;padding:0 22px 22px}.cookie-actions button{min-height:45px;font-weight:700;font-size:12px;border:1px solid var(--ink);border-radius:8px}.accept{background:var(--ink);color:var(--white)}.reject{background:transparent}.reject:hover{background:#f8f3ae}.tiny{font:9px/1.5 monospace;text-align:center;color:#737347;margin:0}.mini-cookie{position:absolute;width:175px;min-height:95px;padding:13px;background:#fffce3;border:1px solid #aaa66b;box-shadow:3px 4px 0 #aaaa7133;border-radius:9px;font:10px/1.5 monospace;transform:rotate(var(--r));pointer-events:none}.mini-cookie strong{font-family:Arial,sans-serif;font-size:13px;display:block;margin-bottom:3px}.mini-cookie .mini-dot{position:absolute;right:10px;top:10px;width:10px;height:10px;border:1px solid #9a9868;border-radius:50%}.check-strip{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:26px 0 0;padding:19px 23px;border:1px dashed #bfc2b3;border-radius:12px}.check-copy{display:flex;align-items:center;gap:14px}.checks{display:flex;gap:5px}.check{height:25px;width:25px;border:1px solid #b7baab;border-radius:50%;display:grid;place-items:center;color:#999d8b;font:11px monospace}.check.on{background:var(--ink);color:var(--paper);border-color:var(--ink)}.check-text{font-size:12px;font-weight:600}.finish{background:#dfdfd4;color:#828675;border:1px solid #d4d5c9;min-height:44px;border-radius:8px;padding:10px 21px;font-size:12px;font-weight:700;transition:background .3s}.finish.ready{background:var(--ink);color:var(--white);border-color:var(--ink)}.footer{padding:26px 0 24px;display:flex;align-items:center;justify-content:space-between;color:var(--muted);font:10px monospace;gap:20px}.footer button{border:0;border-bottom:1px dotted #9b9e8e;padding:8px 0;background:none;font:10px monospace}.footer .fine{display:flex;gap:18px}.demo-badge{position:fixed;left:50%;top:14px;transform:translateX(-50%);z-index:30;background:var(--ink);color:var(--white);border:1px solid #55594b;padding:10px 14px;border-radius:30px;box-shadow:0 5px 20px #282a231a;font:10px monospace;cursor:pointer}.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);border:1px solid #33372d;border-radius:9px;background:var(--ink);color:var(--paper);padding:13px 19px;z-index:24;font:12px/1.5 monospace;max-width:90vw;text-align:center;pointer-events:none}.close-window{position:fixed;right:25px;bottom:25px;width:300px;background:var(--white);border:1px solid var(--ink);border-radius:13px;box-shadow:7px 8px 0 #27292316;z-index:20;padding:19px;transform:rotate(-1deg)}.close-window .window-label{font:10px monospace;letter-spacing:1px;color:var(--muted)}.close-window h3{font-size:19px;letter-spacing:-.5px;margin:12px 0 6px}.close-window p{font-size:12px;line-height:1.6;color:var(--muted);margin:0 0 12px}.close-buttons{display:flex;flex-wrap:wrap;gap:6px}.close-buttons button{background:var(--paper);border:1px solid #b8bcab;border-radius:5px;min-height:44px;padding:9px 12px;font-size:11px}.actually-close{width:100%;background:none;border:0;text-decoration:underline;font-size:10px;padding:13px 0 0;min-height:40px}.final-screen{min-height:calc(100vh - 100px);padding:70px 0 45px;display:flex;flex-direction:column;align-items:center;text-align:center;position:relative}.final-medal{width:119px;height:119px;display:grid;place-items:center;border:2px solid var(--ink);border-radius:50%;background:var(--yellow);transform:rotate(-9deg);box-shadow:6px 6px 0 #dedfcf;margin-bottom:29px}.final-medal svg{width:62px;height:62px}.final-screen h1{font-size:clamp(50px,6.7vw,88px);margin:20px 0 23px;max-width:900px}.final-screen p{max-width:470px;color:#6c7061;line-height:1.8;font-size:15px;margin:0 0 30px}.receipt{width:min(100%,410px);text-align:left;background:var(--white);border:1px solid #cfd1c1;padding:23px 25px;transform:rotate(1deg);margin:0 0 30px;box-shadow:4px 5px 0 #e6e6d9}.receipt-head{font:10px monospace;letter-spacing:1px;margin-bottom:16px}.receipt-line{display:flex;justify-content:space-between;border-top:1px dashed #d4d5c9;padding:11px 0 0;margin-top:11px;font:11px monospace;gap:15px}.receipt-line strong{font-weight:400}.reset{background:var(--ink);color:var(--white);border:0;border-radius:8px;padding:15px 23px;font-size:12px;min-height:46px}.final-foot{margin-top:22px;font:10px monospace;color:var(--muted)}.paper-piece{position:absolute;width:11px;height:24px;background:var(--orange);transform:rotate(24deg);left:8%;top:28%}.paper-piece.two{background:var(--yellow);left:auto;right:7%;top:43%;transform:rotate(-27deg);width:20px;height:10px}.paper-piece.three{background:#bdcbb0;left:14%;top:72%;width:13px;height:13px;transform:rotate(12deg)}@media(min-width:1550px){.hero{padding-top:65px}.hero h1{font-size:94px}.workspace{gap:25px}}@media(max-width:850px){.shell{padding:0 5%}.tagline{display:none}.hero-side{flex-basis:125px}.sun{width:100px;height:100px}h1{letter-spacing:-3px;font-size:65px}.workspace{grid-template-columns:1.3fr 1fr;gap:15px}.card-top{padding-left:18px;padding-right:18px}.card h2{margin-left:18px;margin-right:18px;font-size:21px}.card-desc{margin-left:18px;margin-right:18px}.cookie-card{min-height:504px}.card-label{font-size:9px;letter-spacing:.3px}.progress-bottom{align-items:flex-start;flex-direction:column;gap:10px}.progress-card{min-height:240px}.header-right{gap:15px}.check-strip{padding:15px}.check-text{font-size:11px}}@media(max-width:620px){.masthead{height:79px}.brand{font-size:28px}.brand-mark{width:29px;height:29px}.live{display:none}.exit{font-size:11px}.hero{padding:36px 0 28px;gap:0}.hero-side{position:absolute;right:0;top:25px;width:65px;padding:0}.sun{width:57px;height:57px}.sun-face{font-size:20px;letter-spacing:2px;margin-top:-3px}.stamp-caption{display:none}.eyebrow{font-size:9px;letter-spacing:.8px}h1{font-size:54px;letter-spacing:-3px;line-height:1.03;margin:22px 0 19px}h1 em{letter-spacing:-3px}.hero h1{max-width:340px}.intro{font-size:13px;max-width:320px}.section-bar{font-size:9px;padding:17px 0;letter-spacing:.7px}.workspace{grid-template-columns:1fr;gap:18px}.left-column{gap:18px}.card-top{padding:18px 20px 0}.card h2{margin-left:20px;margin-right:20px;font-size:23px}.card-desc{margin-left:20px;margin-right:20px}.card-label{font-size:10px;letter-spacing:.7px}.cookie-card{min-height:432px;transform:rotate(.4deg);margin:0 2px}.cookie-stage{height:158px}.cookie-svg{width:93px;height:93px}.progress-bottom{flex-direction:row;align-items:center}.progress-copy{max-width:160px}.progress-card{min-height:229px}.check-strip{align-items:stretch;flex-direction:column;gap:16px;margin-top:22px;padding:18px}.check-copy{justify-content:space-between;flex-direction:row-reverse}.finish{width:100%}.footer{align-items:flex-start;font-size:9px;line-height:1.6}.footer .fine{flex-direction:column;gap:0;align-items:flex-start}.footer>span{max-width:110px;text-align:right}.close-window{right:15px;bottom:15px;max-width:calc(100vw - 30px)}.final-screen{padding-top:46px}.final-screen h1{font-size:56px}.final-screen p{font-size:14px}.final-medal{width:100px;height:100px}.paper-piece{left:0}.paper-piece.two{right:0}.paper-piece.three{left:1%}.demo-badge{font-size:9px;white-space:nowrap;top:7px}.mini-cookie{width:167px}.arena{height:123px}.dodge-card{min-height:247px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
</style>
</head>
<body>
<div class="shell">
<header class="masthead">
<div class="brand"><span class="brand-mark" aria-hidden="true"><i></i></span>almost.<span class="tagline">Department of minor<br>inconveniences</span></div>
<div class="header-right"><span class="live">ALL SYSTEMS MOSTLY OPERATIONAL</span><button class="exit" id="exit">Skip to the good part ↗</button></div>
</header>
<main id="experience">
<section class="hero">
<div><div class="eyebrow">A small test of your patience</div><h1>Please remain<br><em>slightly</em> anno<span class="off">y</span>ed.</h1><p class="intro">Three tiny tasks. A perfectly unreasonable interface.<br>How hard could it possibly be?</p></div>
<div class="hero-side" aria-hidden="true"><div class="sun"><span class="sun-face">:|</span></div><div class="stamp-caption">Certified<br>mildly inconvenient</div></div>
</section>
<div class="section-bar"><span>YOUR PATIENCE ASSESSMENT</span><span class="right" id="taskCount">0 of 3 inconveniences resolved</span></div>
<div class="workspace">
<div class="left-column">
<section class="card dodge-card" aria-labelledby="dodgeTitle">
<div class="card-top"><span class="card-label"><span class="number">01 /</span> TARGET ACQUISITION</span><span class="status" id="dodgeStatus">elusive</span></div>
<h2 id="dodgeTitle">Just press the button.</h2><p class="card-desc" id="dodgeDesc">It has somewhere else to be. Apparently.</p>
<div class="arena" id="arena"><button class="target" id="dodge">Press me ↗</button><span class="arena-note" id="dodgeNote">a very normal, stationary button</span></div>
</section>
<section class="card progress-card" aria-labelledby="progressTitle">
<div class="card-top"><span class="card-label"><span class="number">02 /</span> OPTIMISM SIMULATOR</span><span class="status" id="progressStatus">standing by</span></div>
<h2 id="progressTitle">Nearly. Almost. Basically.</h2><p class="card-desc">We're just finishing the finishing touches.</p>
<div class="progress-row"><div class="progress-track" id="progressTrack" role="progressbar" aria-label="Completion progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-fill" id="progressFill"></div></div><span class="percent" id="percent">0%</span></div>
<div class="progress-bottom"><span class="progress-copy" id="progressCopy">Estimated time: yes.</span><button class="small-btn" id="progressBtn">Let's get started →</button></div>
</section>
</div>
<section class="card cookie-card" aria-labelledby="cookieTitle">
<div class="card-top"><span class="card-label"><span class="number">03 /</span> CRUMB MANAGEMENT</span><span class="status" id="cookieStatus">1 notice</span></div>
<h2 id="cookieTitle">We use cookies.</h2><p class="card-desc" id="cookieDesc">Not actual cookies. Just a little rectangle between you and inner peace.</p>
<div class="cookie-stage" id="cookieStage">
<svg class="cookie-svg" viewBox="0 0 120 120" aria-hidden="true"><path d="M98 33c-13 2-22-9-20-21C54 3 26 15 15 38 1 67 16 99 44 108c28 9 57-6 64-34 3-11 2-22-2-31-5 1-9-4-8-10Z" fill="#c89b5a" stroke="#272923" stroke-width="2"/><path d="M29 30c-12 17-12 39-1 55" fill="none" stroke="#e6c48b" stroke-width="4" stroke-linecap="round"/><g fill="#473b2d"><path d="m43 29 9 2-3 10-8-3z"/><path d="m72 45 8-3 4 8-10 6z"/><path d="m29 57 7-2 5 7-8 6z"/><path d="m55 70 9-3 3 10-10 3z"/><path d="m84 81 7 3-4 9-8-4z"/><path d="m40 92 7-4 4 7-7 4z"/></g><g fill="#a6753d"><circle cx="57" cy="51" r="2"/><circle cx="68" cy="92" r="2"/><circle cx="26" cy="78" r="2"/><circle cx="91" cy="63" r="2"/></g></svg>
<span class="cookie-note" id="cookieNote">100% imaginary ingredients</span>
</div>
<div class="cookie-actions"><button class="accept" id="accept">Fine. Accept the imaginary cookies.</button><button class="reject" id="reject">No thanks, I value my peace.</button><p class="tiny">No tracking. No storage. Just emotional crumbs.</p></div>
</section>
</div>
<div class="check-strip"><div class="check-copy"><div class="checks" aria-hidden="true"><span class="check" id="check0">1</span><span class="check" id="check1">2</span><span class="check" id="check2">3</span></div><span class="check-text" id="checkText">A little patience goes a very long way.</span></div><button class="finish" id="finish" aria-disabled="true">Claim your inner peace <span aria-hidden="true">↗</span></button></div>
<footer class="footer"><div class="fine"><span>MADE WITH UNNECESSARY FRICTION.</span><button id="openClose">One more thing to close ↗</button></div><span>Nothing is broken.<br>That's the problem.</span></footer>
</main>
<main class="final-screen" id="final" hidden tabindex="-1">
<div class="paper-piece" aria-hidden="true"></div><div class="paper-piece two" aria-hidden="true"></div><div class="paper-piece three" aria-hidden="true"></div>
<div class="final-medal" aria-hidden="true"><svg viewBox="0 0 80 80" fill="none"><path d="m19 41 14 14 29-31" stroke="#272923" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/><path d="m16 7-6 9M65 62l7 10M66 13l7-6" stroke="#272923" stroke-width="2" stroke-linecap="round"/></svg></div>
<div class="eyebrow">Assessment sufficiently complete</div><h1>Thank you for<br>your <em>patience.</em></h1>
<p>You made it. The buttons have settled down. The cookies have gone home. You may now unclench your jaw.</p>
<div class="receipt"><div class="receipt-head">YOUR RECEIPT FOR ABSOLUTELY NOTHING</div><div class="receipt-line"><span>Inconveniences resolved</span><strong id="receiptCount">3 / 3</strong></div><div class="receipt-line"><span>Time generously donated</span><strong id="receiptTime">0 seconds</strong></div><div class="receipt-line"><span>Patience remaining</span><strong>more than we deserve</strong></div><div class="receipt-line"><span>Total due</span><strong>one deep breath</strong></div></div>
<button class="reset" id="restart">I have learned nothing. Again ↻</button><span class="final-foot">This button stays exactly where it is.</span>
</main>
</div>
<button class="demo-badge" id="demoBadge" hidden>DEMO IN PROGRESS · tap anywhere to take over</button>
<div class="toast" id="toast" role="status" hidden></div>
<aside class="close-window" id="closeWindow" aria-label="A small, optional inconvenience" hidden><div class="window-label">A QUICK FOLLOW-UP</div><h3>Before you close this…</h3><p id="closeCopy">Would you like another close button?</p><div class="close-buttons" id="closeButtons"></div><button class="actually-close" id="actuallyClose">Close all of these. Actually.</button></aside>
<div id="announce" aria-live="polite" style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"></div>
<script>
(()=>{
'use strict';
const $=id=>document.getElementById(id);
let done=[false,false,false],dodges=0,notices=1,rollbacks=0,progress=0,progressRunning=false,raf=0,started=Date.now(),finished=false,toastTimer=0,closeCount=0;
let demo=false,demoTimers=[];
const reduceMotion=window.matchMedia('(prefers-reduced-motion: reduce)').matches;
function say(message){$('announce').textContent=message;}
function toast(message){clearTimeout(toastTimer);$('toast').textContent=message;$('toast').hidden=false;toastTimer=setTimeout(()=>$('toast').hidden=true,2800);}
function mark(index){if(done[index])return;done[index]=true;update();}
function update(){const n=done.filter(Boolean).length;$('taskCount').textContent=n+' of 3 inconveniences resolved';done.forEach((v,i)=>{const c=$('check'+i);c.classList.toggle('on',v);c.textContent=v?'✓':String(i+1);});$('finish').classList.toggle('ready',n===3);$('finish').setAttribute('aria-disabled',n===3?'false':'true');$('checkText').textContent=n===3?'You have earned a completely normal button.':n===0?'A little patience goes a very long way.':n===1?'One down. Your optimism is noted.':'Two down. The end is suspiciously close.';if(n===3)say('All three tasks complete. Claim your inner peace.');}
function dodgeAttempt(){if(done[0]||finished)return;if(dodges>=3){$('dodge').textContent='Caught. Nicely done ✓';$('dodge').style.setProperty('--dx','0px');$('dodge').style.setProperty('--dy','0px');$('dodge').style.background='#506648';$('dodge').style.borderColor='#506648';$('dodge').style.boxShadow='0 4px 0 #394c32';$('dodgeStatus').textContent='caught';$('dodgeStatus').classList.add('done');$('dodgeDesc').textContent='It has accepted its responsibilities.';$('dodgeNote').textContent='personal growth looks good on a button';mark(0);say('Button caught. One inconvenience resolved.');return;}dodges++;const a=$('arena');const max=Math.max(0,(a.clientWidth-$('dodge').offsetWidth)/2-10);const shifts=[[-.9,-17],[.86,15],[-.25,-19]];const p=shifts[dodges-1];$('dodge').style.setProperty('--dx',Math.round(max*p[0])+'px');$('dodge').style.setProperty('--dy',p[1]+'px');$('dodge').textContent=['Not quite ↗','Over here, actually ↙','Okay. One last try.'][dodges-1];$('dodgeNote').textContent=['it just remembered an appointment','a button with commitment issues','it has run out of excuses'][dodges-1];say(dodges===3?'The button will stay still now. Press it once more.':'The button moved. Try pressing it again.');}
$('dodge').addEventListener('pointerdown',e=>{if(e.button!==0)return;e.preventDefault();dodgeAttempt();});
$('dodge').addEventListener('click',e=>{if(e.detail===0)dodgeAttempt();});
function setProgress(n){progress=n;$('progressFill').style.width=n+'%';$('percent').textContent=Math.floor(n)+'%';$('progressTrack').setAttribute('aria-valuenow',String(Math.floor(n)));}
function runProgress(){if(progressRunning||done[1]||finished)return;progressRunning=true;$('progressBtn').disabled=true;$('progressBtn').textContent='Please hold…';$('progressStatus').textContent='almost there';$('progressCopy').textContent=rollbacks===0?'Counting the seconds. Incorrectly.':'Applying additional optimism…';const from=progress;const duration=rollbacks===0?2800:1500;const target=rollbacks<2?99:100;const start=performance.now();function tick(now){if(finished)return;const t=Math.min(1,(now-start)/duration);setProgress(from+(target-from)*(1-Math.pow(1-t,2)));if(t<1){raf=requestAnimationFrame(tick);return;}if(target===100){progressRunning=false;$('progressStatus').textContent='actually done';$('progressStatus').classList.add('done');$('progressCopy').textContent='We checked. This is a real 100%.';$('progressBtn').textContent='A small miracle ✓';$('progressBtn').disabled=true;mark(1);say('Progress is actually complete.');}else{raf=requestAnimationFrame(()=>{const hold=setTimeout(()=>{if(finished)return;rollbacks++;setProgress(rollbacks===1?76:91);progressRunning=false;$('progressBtn').disabled=false;$('progressBtn').textContent=rollbacks===1?'Encourage it →':'One more tiny push →';$('progressCopy').textContent=rollbacks===1?'We found some more finishing touches.':'99% was feeling a little too confident.';$('progressStatus').textContent='reconsidering';say('Progress slid back. Press the encouragement button to continue.');},650);progressHolds.push(hold);});}}raf=requestAnimationFrame(tick);}
let progressHolds=[];
$('progressBtn').addEventListener('click',runProgress);
function refuseCookies(){if(done[2]||finished)return;if(notices<5)notices++;$('cookieStatus').textContent=notices+' notices';$('cookieDesc').textContent=notices<5?'Your preference has been noted. By another cookie notice.':'The notices have formed a small committee.';const mini=document.createElement('div');mini.className='mini-cookie';const idx=notices-2;mini.style.left=(idx%2===0?0:Math.max(10,$('cookieStage').clientWidth-181))+'px';mini.style.top=(4+idx*25)+'px';mini.style.setProperty('--r',[-7,5,-3,7][idx%4]+'deg');const strong=document.createElement('strong');strong.textContent=['Cookies about cookies.','One quick cookie question.','Your peace matters to us.','We have a quorum.'][idx%4];const dot=document.createElement('span');dot.className='mini-dot';mini.append(strong,document.createTextNode('Please accept our acceptance policy.'),dot);if($('cookieStage').querySelectorAll('.mini-cookie').length<4)$('cookieStage').appendChild(mini);$('cookieNote').hidden=true;$('reject').textContent=notices>=5?'I see where this is going.':'No. And please do not multiply.';if(notices>=5)toast('The committee recommends the dark button.');say(notices+' imaginary cookie notices. Accept the cookies to resolve them all.');}
function acceptCookies(){if(done[2]||finished)return;$('cookieStage').querySelectorAll('.mini-cookie').forEach(n=>n.remove());$('cookieStatus').textContent='crumbs cleared';$('cookieStatus').classList.add('done');$('cookieDesc').textContent='Your imaginary preferences have been thoroughly imagined.';$('cookieNote').hidden=false;$('cookieNote').textContent='peace, at last';$('accept').textContent='Imaginary cookies accepted ✓';$('accept').disabled=true;$('reject').hidden=true;$('cookieStage').style.opacity='.65';mark(2);say('All cookie notices resolved. No data was collected.');}
$('reject').addEventListener('click',refuseCookies);$('accept').addEventListener('click',acceptCookies);
function addClose(){if(closeCount>=6){$('closeCopy').textContent='Six is plenty. We do have standards.';return;}closeCount++;const b=document.createElement('button');b.textContent=closeCount===1?'Close ×':'Close '+closeCount+' ×';b.addEventListener('click',()=>{addClose();$('closeCopy').textContent=closeCount<6?'Good news. You now have more options.':'Six is plenty. We do have standards.';say('Another close button appeared. Use Close all of these to dismiss the panel.');});$('closeButtons').appendChild(b);}
function openClose(){if(finished)return;$('closeWindow').hidden=false;if(closeCount===0)addClose();}
$('openClose').addEventListener('click',openClose);
$('actuallyClose').addEventListener('click',()=>{$('closeWindow').hidden=true;$('openClose').focus({preventScroll:true});});
function showFinal(){if(finished)return;finished=true;cancelAnimationFrame(raf);progressHolds.forEach(clearTimeout);progressHolds=[];$('closeWindow').hidden=true;$('toast').hidden=true;clearTimeout(toastTimer);$('experience').hidden=true;$('final').hidden=false;$('receiptCount').textContent=done.filter(Boolean).length+' / 3';$('receiptTime').textContent=Math.max(1,Math.round((Date.now()-started)/1000))+' seconds';$('exit').hidden=true;window.scrollTo({top:0,behavior:'instant'});$('final').focus({preventScroll:true});say('Thank you for your patience. You reached the final screen.');}
$('finish').addEventListener('click',()=>{if(done.every(Boolean))showFinal();else toast('Resolve the three tasks — or use “Skip to the good part” above.');});
$('exit').addEventListener('click',showFinal);
function reset(){cancelAnimationFrame(raf);progressHolds.forEach(clearTimeout);progressHolds=[];clearTimeout(toastTimer);done=[false,false,false];dodges=0;notices=1;rollbacks=0;progress=0;progressRunning=false;finished=false;started=Date.now();$('experience').hidden=false;$('final').hidden=true;$('exit').hidden=false;$('toast').hidden=true;$('closeWindow').hidden=true;closeCount=0;$('closeButtons').replaceChildren();$('closeCopy').textContent='Would you like another close button?';$('dodge').removeAttribute('style');$('dodge').textContent='Press me ↗';$('dodgeStatus').textContent='elusive';$('dodgeStatus').classList.remove('done');$('dodgeDesc').textContent='It has somewhere else to be. Apparently.';$('dodgeNote').textContent='a very normal, stationary button';setProgress(0);$('progressStatus').textContent='standing by';$('progressStatus').classList.remove('done');$('progressCopy').textContent='Estimated time: yes.';$('progressBtn').textContent="Let's get started →";$('progressBtn').disabled=false;$('cookieStatus').textContent='1 notice';$('cookieStatus').classList.remove('done');$('cookieDesc').textContent='Not actual cookies. Just a little rectangle between you and inner peace.';$('cookieStage').querySelectorAll('.mini-cookie').forEach(n=>n.remove());$('cookieStage').style.opacity='1';$('cookieNote').hidden=false;$('cookieNote').textContent='100% imaginary ingredients';$('accept').disabled=false;$('accept').textContent='Fine. Accept the imaginary cookies.';$('reject').hidden=false;$('reject').textContent='No thanks, I value my peace.';update();window.scrollTo({top:0,behavior:'instant'});}
$('restart').addEventListener('click',()=>{stopDemo();reset();$('dodge').focus({preventScroll:true});});
function schedule(fn,time){demoTimers.push(setTimeout(()=>{if(demo)fn();},time));}
function view(id){if(demo)$(id).scrollIntoView({behavior:reduceMotion?'instant':'smooth',block:'center'});}
function demoCycle(){if(!demo)return;demoTimers=[];reset();schedule(()=>{view('arena');dodgeAttempt();},1000);schedule(dodgeAttempt,1900);schedule(dodgeAttempt,2800);schedule(dodgeAttempt,3700);schedule(()=>{view('progressTitle');runProgress();},4400);schedule(runProgress,8300);schedule(runProgress,10900);schedule(()=>{view('cookieTitle');refuseCookies();},13100);schedule(refuseCookies,14000);schedule(acceptCookies,15000);schedule(()=>{openClose();},15900);schedule(addClose,16500);schedule(addClose,17100);schedule(()=>{$('closeWindow').hidden=true;},17600);schedule(showFinal,18200);schedule(demoCycle,21000);}
function stopDemo(){if(!demo)return;demo=false;demoTimers.forEach(clearTimeout);demoTimers=[];$('demoBadge').hidden=true;}
document.addEventListener('pointerdown',e=>{if(e.isTrusted)stopDemo();},{capture:true,passive:true});document.addEventListener('touchstart',e=>{if(e.isTrusted)stopDemo();},{capture:true,passive:true});document.addEventListener('keydown',e=>{if(e.isTrusted)stopDemo();},{capture:true});$('demoBadge').addEventListener('click',stopDemo);
if(location.hash.toLowerCase()==='#demo'){demo=true;$('demoBadge').hidden=false;demoCycle();}
})();
</script>
</body>
</html>
