Skip to content
VibeCodeBench
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.)51.0 KB · 577 lines · no libraries
Download
<!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="#f6f4ed">
  <title>almost. — A small exercise in patience</title>
  <style>
    :root{--paper:#f6f4ed;--ink:#293e33;--muted:#738075;--line:#d8dbce;--orange:#f47746;--lavender:#dcd5ed;--green:#dbe6cb;--white:#fffef9;--radius:15px}
    *{box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{margin:0;background:var(--paper);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
    button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
    button{font:inherit;color:inherit;cursor:pointer}
    button:focus-visible,a:focus-visible{outline:3px solid #8464ba;outline-offset:5px}
    button:disabled{cursor:default}
    a{color:inherit;text-decoration:none}
    svg{display:block;flex-shrink:0}
    .wrap{max-width:1256px;padding:0 44px;margin:auto}
    .topbar{height:94px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:24px}
    .logo{display:flex;align-items:center;gap:12px;min-height:44px;font-size:32px;font-weight:800;letter-spacing:-2px}
    .logo-mark{display:grid;grid-template-columns:9px 9px;grid-template-rows:9px 9px;gap:3px;transform:rotate(-7deg)}
    .logo-mark i{background:var(--ink);border-radius:1px}.logo-mark i:last-child{background:var(--orange);transform:translate(1px,2px) rotate(9deg)}
    .logo .period{color:var(--orange);margin-left:-3px}
    .navigation{display:flex;align-items:center;gap:32px;font-size:12px;font-weight:600}
    .nav-link{position:relative;min-height:44px;display:flex;align-items:center;background:none;border:0;padding:0 2px}
    .nav-link.active:after{content:"";position:absolute;height:2px;background:var(--orange);bottom:8px;left:0;right:0;transform:rotate(-2deg)}
    .feedback-count{font-size:10px;border:1px solid #c9cfc1;min-width:20px;height:20px;display:inline-grid;place-items:center;border-radius:50%;margin-left:7px}
    .system-status{display:flex;gap:8px;align-items:center;border:1px solid #d7ddcd;background:#eef0e6;border-radius:30px;padding:10px 14px;font-family:monospace;font-size:10px;white-space:nowrap;letter-spacing:.2px}
    .status-dot{height:6px;width:6px;border-radius:50%;background:#6e8b4c}
    .hero{padding:49px 0 36px;display:grid;grid-template-columns:1fr 300px;align-items:center;gap:45px}
    .eyebrow{display:flex;align-items:center;gap:9px;font-size:9px;font-weight:700;letter-spacing:1.9px;line-height:1.6;text-transform:uppercase}
    .eyebrow .tiny-square{width:6px;height:6px;background:var(--orange);transform:rotate(10deg)}
    h1{font-family:Georgia,'Times New Roman',serif;font-weight:400;letter-spacing:-3.7px;font-size:68px;line-height:1.05;margin:19px 0 20px}
    h1 em{font-weight:400;position:relative;display:inline-block;color:#c25835;letter-spacing:-3px}
    .underline{position:absolute;left:0;bottom:-8px;width:100%;height:12px;overflow:visible}
    .hero-copy{color:#758074;line-height:1.7;font-size:13px;max-width:550px;margin:0}
    .hero-aside{position:relative;padding:0 10px 0 32px;align-self:center;margin-top:12px}
    .hero-stamp{width:95px;height:95px;margin:0 0 16px 39px;position:relative;display:grid;place-items:center;transform:rotate(10deg)}
    .hero-stamp>svg{position:absolute;inset:0;width:100%;height:100%;color:var(--orange)}
    .stamp-face{transform:rotate(-10deg);font-family:Georgia,serif;font-size:40px;line-height:1;position:relative;top:-2px}
    .hero-aside p{font-family:Georgia,serif;font-style:italic;font-size:19px;line-height:1.4;margin:0;transform:rotate(-4deg)}
    .hero-aside small{display:block;font-family:monospace;font-size:9px;letter-spacing:.3px;margin-top:13px;color:var(--muted);transform:rotate(-4deg)}
    .section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:5px 0 13px}
    .section-heading h2{margin:0;font-size:10px;letter-spacing:1.6px;font-weight:700}
    .time-estimate{display:flex;align-items:center;gap:6px;font-family:monospace;font-size:10px;color:var(--muted)}
    .workspace{display:grid;grid-template-columns:minmax(0,1fr) 306px;gap:20px;align-items:stretch;scroll-margin-top:20px}
    .experiment{border:1px solid #b7c0ae;background:var(--white);border-radius:var(--radius);overflow:hidden;position:relative;min-width:0;box-shadow:0 3px 0 #e6e7dc}
    .experiment-header{height:54px;padding:0 24px;border-bottom:1px solid #e2e5d9;display:flex;align-items:center;justify-content:space-between;gap:10px}
    .experiment-label{display:flex;gap:10px;align-items:center;font-size:9px;letter-spacing:1.45px;font-weight:700}
    .experiment-label .mini-dot{height:6px;width:6px;border-radius:50%;background:var(--orange)}
    .window-dots{display:flex;gap:5px}.window-dots i{width:5px;height:5px;border:1px solid #b6bead;border-radius:50%}.window-dots i:nth-child(2){transform:translateY(1px)}
    .stage{padding:28px 28px 0;min-height:305px;position:relative}
    .stage-title{font-family:Georgia,serif;font-size:28px;font-weight:400;letter-spacing:-.65px;line-height:1.15;margin:0 0 9px}
    .stage-description{font-size:12px;color:var(--muted);line-height:1.6;margin:0}
    .arena{position:relative;margin:22px 0 0;height:173px;border:1px dashed #d9ddce;border-radius:9px;background-color:#fbfcf6;background-image:radial-gradient(#dbe0d2 .7px,transparent .7px);background-size:13px 13px;overflow:hidden}
    .arena-caption{position:absolute;bottom:11px;left:14px;color:#a0a795;font-size:8px;letter-spacing:1px;pointer-events:none;text-transform:uppercase}
    .arena-number{position:absolute;right:13px;bottom:9px;font-family:monospace;font-size:10px;color:#8c9785}
    .dodge-button{position:absolute;width:226px;min-height:53px;left:calc(50% - 113px);top:54px;border:1px solid #263c31;border-radius:7px;background:var(--ink);color:var(--white);font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:19px;box-shadow:3px 4px 0 #bdc8ac;transition:left .3s ease,top .3s ease,transform .2s,box-shadow .2s;z-index:2;padding:12px}
    .dodge-button.caught{background:#526a3e;box-shadow:3px 4px 0 #d4dcbf}
    .dodge-button:hover{box-shadow:2px 3px 0 #bdc8ac}
    .button-arrow{font-size:18px;font-weight:400;line-height:1}
    .dodge-trail{position:absolute;left:calc(50% - 103px);top:60px;height:51px;width:222px;border:1px dashed #d2d9c6;border-radius:7px;transform:rotate(-4deg);pointer-events:none}
    .stage-foot{height:57px;margin-top:20px;border-top:1px solid #e3e6da;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 24px}
    .stage-hint{font-family:monospace;font-size:9px;color:#8a9380;line-height:1.5;max-width:65%}
    .text-button{min-height:44px;border:0;background:none;padding:5px 0 5px 12px;font-size:10px;white-space:nowrap;display:flex;align-items:center;gap:9px;text-decoration:underline;text-decoration-color:#c0c8b7;text-underline-offset:4px}
    .side-stack{display:flex;flex-direction:column;gap:15px}
    .tracker{background:var(--lavender);padding:24px 23px 20px;border:1px solid #c8bfdc;border-radius:var(--radius);position:relative;flex:1}
    .tracker-top{display:flex;align-items:center;justify-content:space-between;font-size:9px;font-weight:700;letter-spacing:1.4px}
    .tracker-mark{width:23px;height:23px;border:1px solid #8f849d;border-radius:50%;display:grid;place-items:center;transform:rotate(8deg);font-size:14px;letter-spacing:0;font-weight:400}
    .tracker-title{font-family:Georgia,serif;font-size:31px;letter-spacing:-1px;font-weight:400;line-height:1.1;margin:17px 0 8px}
    .tracker-caption{font-size:10px;color:#746b81;margin:0;line-height:1.6}
    .step-list{margin:20px 0 0;padding:0;list-style:none;display:grid;gap:7px}
    .step-link{width:100%;border:0;background:none;display:flex;align-items:center;min-height:34px;gap:10px;text-align:left;font-size:11px;padding:2px 0;color:#81778d}
    .step-link .step-icon{border:1px solid #b9aecb;width:21px;height:21px;border-radius:50%;font-family:monospace;font-size:9px;display:grid;place-items:center;flex-shrink:0}
    .step-link.current{color:var(--ink);font-weight:600}.step-link.current .step-icon{background:var(--ink);border-color:var(--ink);color:white}
    .step-link.done{color:#4f6247}.step-link.done .step-icon{border-color:#859578;background:#cdd7b9}
    .step-link .current-tag{font-size:8px;font-weight:400;padding:3px 5px;border-radius:3px;background:#ece6f6;color:#6b5f7c;margin-left:auto;letter-spacing:.4px}
    .complaint-card{border:1px solid #d9ddce;border-radius:var(--radius);padding:17px 20px;background:#eeefe4;display:flex;align-items:center;gap:13px;min-height:101px}
    .complaint-card svg{color:#6b785a;transform:rotate(-8deg)}
    .complaint-card strong{font-family:Georgia,serif;font-weight:400;font-size:16px;line-height:1.3;display:block}
    .complaint-card button{background:transparent;border:0;border-bottom:1px solid #afb9a2;font-size:10px;min-height:34px;padding:3px 0;display:flex;align-items:center;gap:19px}
    .extras-heading{display:flex;align-items:center;gap:13px;margin:34px 0 15px}
    .extras-heading h2{font-size:9px;letter-spacing:1.5px;white-space:nowrap;margin:0;font-weight:600;color:#798272}
    .extras-heading:after{height:1px;background:var(--line);content:"";flex:1}
    .extras{display:grid;grid-template-columns:1fr 1fr 1fr;gap:18px}
    .extra-card{position:relative;min-height:167px;border:1px solid var(--line);border-radius:11px;padding:18px 20px;background:#f9f8f1;display:flex;flex-direction:column;align-items:flex-start}
    .extra-top{display:flex;align-items:center;justify-content:space-between;width:100%;font-size:8px;color:#8c9483;font-family:monospace;letter-spacing:.8px}
    .extra-top .tag{background:#eceee2;border-radius:3px;padding:4px 6px;font-family:Arial,sans-serif;font-size:7px;letter-spacing:.6px;text-transform:uppercase}
    .extra-title{font-family:Georgia,serif;font-size:19px;line-height:1.1;letter-spacing:-.35px;font-weight:400;margin:14px 0 6px}
    .extra-description{color:#87907f;font-size:10px;line-height:1.6;margin:0}
    .extra-button{min-height:33px;padding:6px 0 0;border:0;background:none;font-size:9px;display:flex;gap:7px;align-items:center;margin-top:auto}
    .tiny-progress{display:flex;align-items:center;gap:9px;width:100%;margin:15px 0 3px}
    .tiny-track{height:6px;background:#e1e5d7;border-radius:2px;flex:1;overflow:hidden}.tiny-track span{display:block;width:99%;height:100%;background:#a6b58d;border-radius:2px}
    .tiny-progress b{font-family:monospace;font-size:9px;font-weight:400}
    .crooked-tiles{display:flex;position:absolute;right:20px;bottom:22px;gap:5px;align-items:center}
    .crooked-tiles span{width:20px;height:26px;border:1px solid #89977b;border-radius:3px;background:#e3e8d7;transition:transform .55s ease;transform:rotate(-6deg)}
    .crooked-tiles span:nth-child(2){transform:translateY(-2px) rotate(5deg);background:#dcd5ed;border-color:#b1a5c3}.crooked-tiles span:nth-child(3){transform:translateY(2px) rotate(-3deg);background:#f2c9ac;border-color:#d7a37d}
    .cookie-drawing{position:absolute;right:22px;bottom:18px;transform:rotate(12deg);color:#be8a55}
    footer{border-top:1px solid var(--line);margin:30px 0 0;min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:20px;color:#8b9384;font-size:9px;line-height:1.7}
    .footer-note{display:flex;align-items:center;gap:7px}.footer-note i{width:4px;height:4px;background:#aab39e;border-radius:50%}
    .finish-link{border:0;background:none;padding:10px 0;min-height:44px;color:#68765e;text-decoration:underline;text-underline-offset:4px;font-size:10px}
    .toast{position:fixed;bottom:23px;left:50%;transform:translate(-50%,14px);background:var(--ink);color:#fffef7;border:1px solid #55634e;border-radius:10px;padding:14px 20px;font-size:12px;max-width:calc(100% - 32px);width:max-content;box-shadow:0 8px 30px #293e3320;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:30;line-height:1.5;text-align:center}
    .toast.show{opacity:1;transform:translate(-50%,0)}
    .demo-bar{display:none;position:fixed;top:12px;left:50%;transform:translateX(-50%);border:1px solid #bd7958;background:#fff4e8;color:#82462d;border-radius:30px;z-index:40;box-shadow:0 3px 12px #493e2910;min-height:40px;padding:8px 12px 8px 16px;align-items:center;gap:13px;white-space:nowrap;font-size:10px}
    .demo-bar.visible{display:flex}.demo-dot{width:6px;height:6px;border-radius:50%;background:var(--orange)}
    .demo-bar button{background:none;border:0;font-size:10px;text-decoration:underline;min-height:26px;color:#82462d}
    .demo-cursor{position:fixed;width:25px;height:32px;left:0;top:0;pointer-events:none;z-index:45;opacity:0;transition:left .65s ease,top .65s ease,opacity .25s;filter:drop-shadow(1px 2px 1px #263c3130)}
    .demo-cursor.visible{opacity:1}
    .loading-area{margin:34px 0 20px;padding:21px 0 0}
    .loading-top{display:flex;justify-content:space-between;align-items:baseline;gap:15px;margin-bottom:14px;font-size:11px}
    .loading-percent{font-family:Georgia,serif;font-size:38px;letter-spacing:-2px;line-height:1}
    .loading-percent small{font-size:20px;margin-left:2px;letter-spacing:0}
    .big-track{height:17px;border:1px solid #bac4ac;padding:3px;border-radius:4px;background:#edf0e6;overflow:hidden}
    .big-fill{height:100%;width:5%;background:var(--orange);border-radius:1px;transition:width .65s ease}
    .loading-bottom{display:flex;justify-content:space-between;gap:14px;font-size:9px;font-family:monospace;color:#929a87;line-height:1.5;margin:10px 0 19px}
    .stage-actions{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-top:17px;flex-wrap:wrap}
    .solid-button{min-height:45px;border:1px solid var(--ink);background:var(--ink);color:var(--white);border-radius:6px;padding:11px 17px;display:inline-flex;align-items:center;justify-content:center;gap:13px;font-size:11px;font-weight:600}
    .plain-button{background:none;border:1px solid #c7cebd;border-radius:6px;padding:11px 14px;min-height:45px;font-size:11px}
    .cookie-board{min-height:182px;background:#f6f5ec;border:1px dashed #d5dbc8;border-radius:9px;position:relative;margin:19px 0 0;padding:13px;display:grid;grid-template-columns:1fr 1fr;gap:9px;align-content:center}
    .cookie-note{background:#fff9e7;border:1px solid #d6c49b;border-radius:7px;min-height:66px;display:flex;align-items:center;gap:9px;padding:8px 5px 8px 11px;box-shadow:1px 3px 0 #e5ddc7;min-width:0}
    .cookie-note:nth-child(2){transform:rotate(1deg)}.cookie-note:nth-child(3){transform:rotate(-1.5deg)}.cookie-note:nth-child(4){transform:translate(1px,1px)}
    .cookie-note .cookie-icon{width:24px;height:24px;color:#be8a55}
    .cookie-note strong{font-size:10px;font-weight:600;display:block;line-height:1.5}.cookie-note small{display:block;font-size:8px;color:#9b8e70;line-height:1.5}
    .cookie-close{margin-left:auto;flex-shrink:0;background:none;border:0;min-height:44px;min-width:44px;font-size:21px;color:#9a8964;padding:0;border-radius:5px}
    .cookie-close:hover{background:#f0e5c9}
    .cookie-after{margin-top:14px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
    .cookie-after p{margin:0;font-size:10px;color:var(--muted);line-height:1.5;flex:1;min-width:100px}
    .cookie-after .solid-button{font-size:10px;min-height:41px}
    .done-stage{padding-top:22px;padding-bottom:2px;text-align:center;display:flex;align-items:center;flex-direction:column;justify-content:center;min-height:305px}
    .medal{width:71px;height:71px;margin:0 auto 13px;position:relative;color:var(--orange);transform:rotate(-7deg)}
    .medal svg{width:100%;height:100%}.medal .medal-check{position:absolute;inset:0;display:grid;place-items:center;font-size:27px;color:var(--ink)}
    .done-stage .stage-title{font-size:34px;margin-bottom:10px}.done-stage .stage-description{max-width:380px}
    .award-label{font-family:monospace;font-size:8px;letter-spacing:1.4px;margin:19px 0 5px;color:#9b7650;line-height:1.6}
    .done-stage .stage-actions{justify-content:center;gap:12px;margin-top:17px}
    .tiny-misaligned{position:relative;top:1px}
    @media(min-width:1450px){.wrap{max-width:1350px;padding:0 55px}.hero{padding:56px 0 42px}h1{font-size:76px}.arena{height:196px}.stage{min-height:328px}.done-stage{min-height:328px}.tracker{padding-top:26px}.step-list{gap:12px}.extra-card{min-height:177px}}
    @media(max-width:1050px){.wrap{padding:0 28px}.workspace{grid-template-columns:minmax(0,1fr) 270px;gap:16px}.hero{grid-template-columns:1fr 210px;gap:20px}h1{font-size:57px}.hero-aside{padding-left:12px}.hero-aside p{font-size:17px}.hero-stamp{margin-left:25px}.stage{padding-left:22px;padding-right:22px}.tracker{padding-left:20px;padding-right:20px}.extra-card{padding:17px}.crooked-tiles{gap:3px;right:14px}.crooked-tiles span{width:16px;height:23px}.cookie-note .cookie-icon{display:none}.navigation{gap:24px}}
    @media(max-width:780px){.wrap{padding:0 22px}.topbar{height:77px}.navigation{gap:20px}.system-status{display:none}.hero{padding:37px 0 29px;grid-template-columns:1fr 154px;gap:8px}h1{font-size:50px;letter-spacing:-2.7px}h1 em{letter-spacing:-2px}.hero-aside{padding-left:10px}.hero-aside p{font-size:15px}.hero-aside small{font-size:8px}.hero-stamp{height:75px;width:75px;margin-left:18px}.stamp-face{font-size:31px}.eyebrow{font-size:8px;letter-spacing:1.25px}.workspace{grid-template-columns:1fr}.side-stack{display:grid;grid-template-columns:1.2fr 1fr;gap:15px}.tracker{padding:18px}.tracker-title{font-size:25px;margin-top:12px}.tracker-caption{font-size:10px}.step-list{margin-top:11px;gap:2px}.complaint-card{padding:20px;flex-direction:column;align-items:flex-start;justify-content:center;gap:16px}.complaint-card strong{font-size:21px}.complaint-card button{font-size:11px;min-height:44px}.extras{gap:10px}.extra-card{min-height:183px;padding:16px 13px}.extra-title{font-size:18px;max-width:140px}.extra-description{font-size:9px;max-width:140px}.crooked-tiles{position:static;margin-top:13px}.extra-button{min-height:40px}.extra-card:nth-child(3) .extra-button{position:absolute;bottom:13px;left:76px;font-size:8px;max-width:65px;line-height:1.6}.cookie-drawing{width:33px;height:33px;right:12px;bottom:18px}.extra-card:nth-child(2) .extra-button{max-width:85px}.stage{min-height:305px}.cookie-note .cookie-icon{display:block}}
    @media(max-width:520px){.wrap{padding:0 19px}.topbar{height:73px;gap:12px}.logo{font-size:29px;gap:10px}.logo-mark{transform:scale(.9) rotate(-7deg)}.navigation{gap:16px;font-size:10px}.nav-link.active{display:none}.feedback-count{min-width:18px;height:18px;font-size:9px}.hero{display:block;position:relative;padding:32px 0 31px}.eyebrow{font-size:7px;letter-spacing:1.05px;gap:7px}h1{font-size:clamp(41px,11.6vw,58px);line-height:1.07;margin-top:18px;margin-bottom:20px;letter-spacing:-2.5px}h1 em{letter-spacing:-2px}.hero-copy{font-size:11px;max-width:265px;line-height:1.75}.hero-aside{position:absolute;right:0;bottom:26px;padding:0;margin:0;pointer-events:none}.hero-aside p,.hero-aside small{display:none}.hero-stamp{width:58px;height:58px;margin:0;transform:rotate(14deg)}.stamp-face{font-size:25px}.section-heading{margin-top:0;gap:5px}.section-heading h2{font-size:8px;letter-spacing:1.2px}.time-estimate{font-size:8px;gap:4px}.time-estimate svg{width:11px}.experiment-header{padding:0 17px;height:48px}.experiment-label{font-size:8px;letter-spacing:1px}.stage{padding:23px 17px 0;min-height:294px}.stage-title{font-size:25px}.stage-description{font-size:11px}.arena{margin-top:20px;height:173px}.dodge-button{width:210px;left:calc(50% - 105px);font-size:11px;gap:13px}.dodge-trail{width:207px;left:calc(50% - 96px)}.arena-caption{font-size:7px;left:10px;letter-spacing:.5px}.stage-foot{padding:0 17px;margin-top:19px;height:57px}.stage-hint{font-size:8px;max-width:58%}.text-button{font-size:9px;gap:5px}.side-stack{gap:10px;grid-template-columns:1.12fr 1fr}.tracker{padding:16px 13px;border-radius:12px}.tracker-top{font-size:7px;letter-spacing:.8px;gap:4px}.tracker-mark{width:19px;height:19px;font-size:12px}.tracker-title{font-size:24px;margin-top:12px}.tracker-caption{font-size:9px}.step-link{font-size:9px;gap:7px;min-height:34px}.step-link .step-icon{width:18px;height:18px;font-size:8px}.step-link .current-tag{display:none}.complaint-card{padding:17px 14px;border-radius:12px;gap:15px}.complaint-card strong{font-size:20px}.complaint-card svg{width:30px;height:30px}.complaint-card button{font-size:10px;gap:10px}.extras-heading{margin-top:28px;gap:9px}.extras-heading h2{font-size:7px;letter-spacing:1px}.extras{grid-template-columns:1fr;gap:10px}.extra-card{min-height:135px;padding:16px 18px}.extra-title{font-size:21px;max-width:none;margin-top:11px}.extra-description{font-size:10px;max-width:240px}.extra-top{font-size:8px}.extra-top .tag{font-size:7px}.tiny-progress{position:absolute;right:18px;bottom:25px;width:100px;margin:0}.extra-card .extra-button{min-height:34px;margin-top:5px}.extra-card:nth-child(2) .extra-button{max-width:none}.extra-card:nth-child(3) .extra-button{position:static;font-size:9px;max-width:none;min-height:34px;line-height:normal}.crooked-tiles{position:absolute;right:23px;bottom:25px;margin:0;gap:5px}.crooked-tiles span{width:23px;height:30px}.cookie-drawing{width:43px;height:43px;right:41px;bottom:20px}footer{align-items:flex-start;flex-direction:column;gap:0;padding-top:15px;margin-top:24px;padding-bottom:14px}.footer-note{font-size:8px}.finish-link{font-size:10px}.cookie-board{padding:10px;gap:7px;min-height:176px}.cookie-note{gap:3px;padding-left:7px;min-height:66px}.cookie-note .cookie-icon{display:none}.cookie-note strong{font-size:9px}.cookie-note small{font-size:7px}.cookie-close{min-width:38px;font-size:20px;min-height:44px}.cookie-after{gap:8px;margin-top:12px}.cookie-after .solid-button{padding:10px 11px;font-size:9px}.cookie-after p{font-size:9px}.loading-area{margin-top:23px}.loading-bottom{font-size:8px}.stage-actions{gap:8px}.plain-button,.solid-button{font-size:10px;padding:11px 12px}.done-stage{min-height:330px;padding-bottom:12px}.done-stage .stage-title{font-size:29px}.done-stage .stage-actions{gap:8px}.award-label{font-size:7px;letter-spacing:1px}.demo-bar{font-size:9px;gap:8px;top:8px;max-width:calc(100% - 16px);padding:7px 10px}.demo-bar button{font-size:9px}.toast{font-size:11px;bottom:15px}}
    @media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}.demo-cursor{display:none}}
  </style>
</head>
<body>
  <div class="demo-bar" id="demoBar"><span class="demo-dot"></span><span>20-second demo · touch anywhere to take over</span><button type="button" id="stopDemo">Stop</button></div>
  <div class="demo-cursor" id="demoCursor" aria-hidden="true"><svg viewBox="0 0 25 32"><path d="M3 2v25l6-6 5 10 5-2-5-10 9-1Z" fill="#fffef9" stroke="#293e33" stroke-width="1.8" stroke-linejoin="round"/></svg></div>
  <div class="wrap">
    <header class="topbar">
      <a class="logo" href="#" id="homeLink" aria-label="Almost, start over"><span class="logo-mark" aria-hidden="true"><i></i><i></i><i></i><i></i></span><span>almost<span class="period">.</span></span></a>
      <nav class="navigation" aria-label="Main navigation">
        <a class="nav-link active" href="#experiment">The experiment</a>
        <button class="nav-link" id="feedbackNav" type="button">Leave feedback <span class="feedback-count" id="feedbackCount">0</span><span style="margin-left:8px" aria-hidden="true">↗</span></button>
        <div class="system-status"><span class="status-dot"></span>All systems operational-ish</div>
      </nav>
    </header>

    <main>
      <section class="hero" aria-labelledby="pageTitle">
        <div>
          <div class="eyebrow"><span class="tiny-square"></span>THE DEPARTMENT OF MINOR INCONVENIENCES</div>
          <h1 id="pageTitle">Good things take time.<br>This takes <em>a little more.<svg class="underline" viewBox="0 0 320 12" preserveAspectRatio="none" aria-hidden="true"><path d="M3 7 Q135 0 317 5 M23 11 Q174 5 291 9" fill="none" stroke="#e79a70" stroke-width="1.6" stroke-linecap="round"/></svg></em></h1>
          <p class="hero-copy">A beautifully inefficient experience, made just for you.<br>Nothing is broken. It just feels that way.</p>
        </div>
        <aside class="hero-aside" aria-label="Please remain slightly annoyed">
          <div class="hero-stamp" aria-hidden="true">
            <svg viewBox="0 0 100 100"><path d="M50 3 58 11 69 7 73 19 86 19 87 32 97 39 91 50 97 61 86 68 86 81 73 82 69 94 57 90 50 98 41 90 30 94 26 82 13 81 13 68 3 61 9 50 3 38 14 32 14 19 27 19 31 7 42 11Z" fill="currentColor"/></svg>
            <span class="stamp-face">☺</span>
          </div>
          <p>Please remain<br>slightly annoyed.</p>
          <small>— Management, probably</small>
        </aside>
      </section>

      <div class="section-heading"><h2>THE PATIENCE TEST</h2><span class="time-estimate"><svg width="13" height="13" viewBox="0 0 16 16" fill="none" aria-hidden="true"><circle cx="8" cy="8" r="6" stroke="currentColor"/><path d="M8 4v4l3 2" stroke="currentColor"/></svg>Est. 30 seconds. Give or take.</span></div>
      <section class="workspace" id="experiment" aria-label="The patience test">
        <div class="experiment">
          <div class="experiment-header"><span class="experiment-label"><span class="mini-dot"></span><span id="experimentLabel">01 — THE ELUSIVE BUTTON</span></span><span class="window-dots" aria-hidden="true"><i></i><i></i><i></i></span></div>
          <div class="stage" id="stage"></div>
          <div class="stage-foot"><span class="stage-hint" id="stageHint">A SIMPLE CLICK. WHAT COULD GO WRONG?</span><button type="button" class="text-button" id="skipStage">Skip this nonsense <span aria-hidden="true">↗</span></button></div>
        </div>
        <aside class="side-stack">
          <div class="tracker">
            <div class="tracker-top">YOUR JOURNEY <span class="tracker-mark" id="trackerFace" aria-hidden="true">:)</span></div>
            <h2 class="tracker-title" id="trackerTitle">So far, so good.</h2>
            <p class="tracker-caption" id="trackerCaption">A few small things stand between<br>you and a completely normal day.</p>
            <ol class="step-list">
              <li><button type="button" class="step-link current" data-step="1"><span class="step-icon">1</span><span>Catch the button</span><span class="current-tag">YOU ARE HERE</span></button></li>
              <li><button type="button" class="step-link" data-step="2"><span class="step-icon">2</span><span>Trust the process</span><span class="current-tag" hidden>YOU ARE HERE</span></button></li>
              <li><button type="button" class="step-link" data-step="3"><span class="step-icon">3</span><span>Clear your cookies</span><span class="current-tag" hidden>YOU ARE HERE</span></button></li>
            </ol>
          </div>
          <div class="complaint-card">
            <svg width="34" height="34" viewBox="0 0 40 40" fill="none" aria-hidden="true"><path d="M7 8h26v19H21l-8 6v-6H7Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/><path d="M13 15h15M13 20h10" stroke="currentColor" stroke-width="1.2"/></svg>
            <div><strong>Not enjoying yourself?<br>Excellent. It’s working.</strong><button type="button" id="complaintButton">File a complaint <span aria-hidden="true">↗</span></button></div>
          </div>
        </aside>
      </section>

      <div class="extras-heading"><h2>IT’S THE LITTLE THINGS</h2></div>
      <section class="extras" aria-label="A few extra inconveniences">
        <article class="extra-card">
          <div class="extra-top"><span>INCONVENIENCE № 01</span><span class="tag">in progress</span></div>
          <h3 class="extra-title">So close. So, so close.</h3>
          <p class="extra-description">The last 1% has a lot on its mind.</p>
          <div class="tiny-progress" aria-hidden="true"><div class="tiny-track"><span id="miniFill"></span></div><b id="miniPercent">99%</b></div>
          <button class="extra-button" type="button" id="extraProgress">Check on it <span aria-hidden="true">↗</span></button>
        </article>
        <article class="extra-card">
          <div class="extra-top"><span>INCONVENIENCE № 02</span><span class="tag">freshly baked</span></div>
          <h3 class="extra-title">A cookie situation.</h3>
          <p class="extra-description">We don’t use cookies. Just notices.</p>
          <button class="extra-button" type="button" id="extraCookies">Oh, crumbs <span aria-hidden="true">↗</span></button>
          <svg class="cookie-drawing" width="44" height="44" viewBox="0 0 50 50" fill="none" aria-hidden="true"><path d="M42 24c-7 1-11-3-11-9-6 1-10-2-10-9C10 8 4 17 6 28c2 11 14 19 25 15 9-3 13-10 11-19Z" fill="#e7cda8" stroke="currentColor" stroke-width="1.3"/><circle cx="16" cy="20" r="2" fill="currentColor"/><circle cx="25" cy="31" r="2.5" fill="currentColor"/><circle cx="13" cy="31" r="1.5" fill="currentColor"/><circle cx="32" cy="36" r="1.5" fill="currentColor"/><circle cx="35" cy="8" r="2" fill="currentColor"/><circle cx="42" cy="16" r="1" fill="currentColor"/></svg>
        </article>
        <article class="extra-card">
          <div class="extra-top"><span>INCONVENIENCE № 03</span><span class="tag">close enough</span></div>
          <h3 class="extra-title">One pixel <span class="tiny-misaligned">off.</span></h3>
          <p class="extra-description" id="tidyDescription">You noticed. Now you can’t unnotice.</p>
          <button class="extra-button" type="button" id="straighten">Straighten things out <span aria-hidden="true">↗</span></button>
          <div class="crooked-tiles" id="tiles" aria-hidden="true"><span></span><span></span><span></span></div>
        </article>
      </section>
    </main>
    <footer><span class="footer-note"><i></i>Made with unnecessary attention to inconvenience. <span class="tiny-misaligned">©</span> almost.</span><button type="button" class="finish-link" id="directFinish">I’ve been patient enough. Take me to the thank-you. ↗</button></footer>
  </div>
  <div class="toast" id="toast" role="status" aria-live="polite"></div>

  <script>
    (() => {
      'use strict';
      const $ = id => document.getElementById(id);
      const stage = $('stage');
      const cookieIcon = '<svg class="cookie-icon" viewBox="0 0 32 32" fill="none" aria-hidden="true"><path d="M27 15c-5 0-7-3-7-7-4 0-6-2-6-5C6 4 2 10 3 18c1 8 9 13 17 10 6-2 9-7 7-13Z" fill="#ead2ab" stroke="currentColor"/><circle cx="10" cy="13" r="1.5" fill="currentColor"/><circle cx="16" cy="21" r="2" fill="currentColor"/><circle cx="8" cy="21" r="1" fill="currentColor"/></svg>';
      let currentStep = 1, dodges = 0, progress = 5, setbacks = 0, cookieClicks = 0, notices = 1;
      let complaints = 0, tidyClicks = 0, toastTimer = null, loadingTimer = null, holdUntil = 0;
      let suppressClickUntil = 0, lastDodge = 0, demo = false, demoTimers = [], demoLoop = null;
      const completed = new Set();

      function toast(message) {
        $('toast').textContent = message;
        $('toast').classList.add('show');
        clearTimeout(toastTimer);
        toastTimer = setTimeout(() => $('toast').classList.remove('show'), 3300);
      }

      function stopLoading() {
        if (loadingTimer !== null) clearInterval(loadingTimer);
        loadingTimer = null;
      }

      function updateTracker() {
        const headlines = ['','So far, so good.','Trust issues? Fair.','Nearly free. Nearly.','Look at you. You did it.'];
        const captions = ['','A few small things stand between<br>you and a completely normal day.','Progress is rarely a straight line.<br>This one has taken it personally.','Just one tiny administrative task.<br>And then its identical colleagues.','Your patience has been noted.<br>No further action is required. Really.'];
        $('trackerTitle').textContent = headlines[currentStep];
        $('trackerCaption').innerHTML = captions[currentStep];
        $('trackerFace').textContent = currentStep === 4 ? ':)' : currentStep === 2 ? ':/' : ':)';
        document.querySelectorAll('[data-step]').forEach(button => {
          const n = Number(button.dataset.step);
          button.classList.toggle('current', n === currentStep);
          button.classList.toggle('done', completed.has(n));
          button.querySelector('.step-icon').textContent = completed.has(n) ? '✓' : n;
          button.querySelector('.current-tag').hidden = n !== currentStep;
          if (n === currentStep) button.setAttribute('aria-current','step');
          else button.removeAttribute('aria-current');
        });
      }

      function setStep(step, focus = false) {
        stopLoading();
        currentStep = step;
        stage.className = 'stage';
        $('skipStage').hidden = false;
        const labels = ['','01 — THE ELUSIVE BUTTON','02 — THE RELUCTANT PROGRESS BAR','03 — THE COOKIE SITUATION','COMPLETE — PATIENCE ACKNOWLEDGED'];
        $('experimentLabel').textContent = labels[step];
        if (step === 1) {
          dodges = 0; lastDodge = 0; suppressClickUntil = 0;
          $('stageHint').textContent = 'A SIMPLE CLICK. WHAT COULD GO WRONG?';
          stage.innerHTML = '<h2 class="stage-title" tabindex="-1">Go on. Click the button.</h2><p class="stage-description" id="dodgeDescription">It has somewhere else to be. You understand.</p><div class="arena" id="arena"><div class="dodge-trail" aria-hidden="true"></div><button type="button" class="dodge-button" id="dodgeButton"><span id="dodgeLabel">Let’s get this over with</span><span class="button-arrow" aria-hidden="true">↗</span></button><span class="arena-caption" id="arenaCaption">YOUR NEXT VERY SIMPLE TASK</span><span class="arena-number" id="dodgeCount">0 / 3 escapes</span></div>';
          const button = $('dodgeButton');
          button.addEventListener('pointerenter', event => {
            if (!demo && event.pointerType === 'mouse' && dodges < 3) dodgeButton();
          });
          button.addEventListener('pointerdown', event => {
            if (!demo && dodges < 3) {
              event.preventDefault();
              suppressClickUntil = Date.now() + 420;
              if (Date.now() - lastDodge > 220) dodgeButton();
            }
          });
          button.addEventListener('click', () => {
            if (demo || Date.now() < suppressClickUntil) return;
            if (dodges < 3) { dodgeButton(); return; }
            completed.add(1); setStep(2, true);
          });
        } else if (step === 2) {
          progress = 5; setbacks = 0; holdUntil = 0;
          $('stageHint').textContent = 'ESTIMATED TIME REMAINING: YES.';
          stage.innerHTML = '<h2 class="stage-title" tabindex="-1">Just a moment. Almost there.</h2><p class="stage-description" id="loadingDescription">We’re processing your request to process your request.</p><div class="loading-area"><div class="loading-top"><span id="loadingStatus">Making excellent progress…</span><span class="loading-percent"><span id="percent">5</span><small>%</small></span></div><div class="big-track" role="progressbar" aria-label="Unnecessarily complicated progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="5" id="progressTrack"><div class="big-fill" id="progressFill"></div></div><div class="loading-bottom"><span id="loadingRemark">PLEASE DON’T STARE. IT GETS NERVOUS.</span><span>100% organic waiting</span></div><div class="stage-actions"><button type="button" class="plain-button" id="encourage">Offer gentle encouragement ↗</button><button type="button" class="solid-button" id="goodEnough">Good enough. Continue <span aria-hidden="true">→</span></button></div></div>';
          $('encourage').addEventListener('click', () => {
            if (progress >= 100) { toast('It’s finished. The encouragement can rest now.'); return; }
            if (holdUntil > Date.now()) {
              $('loadingDescription').textContent = 'It appreciates your enthusiasm. It is still reconsidering.';
              return;
            }
            setProgress(Math.min(99, progress + 24));
            $('loadingDescription').textContent = '“You can do it, little bar.” That seems to be helping.';
            if (progress >= 99) reachNinetyNine();
          });
          $('goodEnough').addEventListener('click', () => { completed.add(2); setStep(3, true); });
          if (!demo) startLoading();
        } else if (step === 3) {
          cookieClicks = 0; notices = 1;
          $('stageHint').textContent = 'NO ACTUAL COOKIES. ONLY EMOTIONAL CRUMBS.';
          stage.innerHTML = '<h2 class="stage-title" tabindex="-1">One last little cookie notice.</h2><p class="stage-description" id="cookieDescription">Nothing to accept. Just close it. How hard can it be?</p><div class="cookie-board" id="cookieBoard" aria-label="Fictional cookie notices"></div><div class="cookie-after"><p id="cookieStatus">A completely unnecessary formality.</p><button class="solid-button" id="closeAll" type="button">Close all. For real. <span aria-hidden="true">→</span></button></div>';
          renderCookies();
          $('closeAll').addEventListener('click', () => { completed.add(3); finish(true); });
        } else {
          stage.classList.add('done-stage');
          $('skipStage').hidden = true;
          $('stageHint').textContent = 'YOU MAY NOW RETURN TO YOUR REGULARLY SCHEDULED DAY.';
          stage.innerHTML = '<div class="medal" aria-hidden="true"><svg viewBox="0 0 80 80"><path d="m40 3 7 6 9-2 4 9 10 1 1 10 7 7-4 9 4 9-8 6-1 10-10 1-5 9-9-3-8 5-7-7-10 1-3-9-10-3 1-10-6-8 5-8-3-10 9-5 1-10 10-1 5-9Z" fill="#f5cda5" stroke="#dca16d"/></svg><span class="medal-check">✓</span></div><h2 class="stage-title" tabindex="-1">Thank you for your patience.</h2><p class="stage-description">The button has settled down. The bar has made peace with itself.<br>And the cookies have left the building. You did brilliantly.</p><div class="award-label">CERTIFIED: EXCEPTIONALLY GOOD AT PUTTING UP WITH THINGS</div><div class="stage-actions"><button type="button" class="solid-button" id="restButton">Do absolutely nothing <span aria-hidden="true">✓</span></button><button type="button" class="plain-button" id="restartButton">Again, for some reason ↻</button></div>';
          $('restButton').addEventListener('click', () => {
            $('restButton').textContent = 'A well-earned moment of peace. ✓';
            $('restButton').disabled = true;
            toast('No more tasks. No more notices. Enjoy your day.');
          });
          $('restartButton').addEventListener('click', () => { completed.clear(); setStep(1, true); });
        }
        updateTracker();
        if (focus && !demo) stage.querySelector('h2').focus({preventScroll:true});
      }

      function dodgeButton() {
        const button = $('dodgeButton');
        const arena = $('arena');
        if (!button || !arena || dodges >= 3) return;
        lastDodge = Date.now();
        dodges++;
        const maxX = Math.max(6, arena.clientWidth - button.offsetWidth - 10);
        const positions = [[10,15],[maxX,78],[Math.max(8,(arena.clientWidth-button.offsetWidth)/2),48]];
        button.style.left = positions[dodges-1][0] + 'px';
        button.style.top = positions[dodges-1][1] + 'px';
        button.style.transform = dodges === 1 ? 'rotate(-2deg)' : dodges === 2 ? 'rotate(2deg)' : 'rotate(-.5deg)';
        $('dodgeCount').textContent = dodges + ' / 3 escapes';
        const labels = ['','Oops. Over here now.','Nothing personal.','Okay. I’m staying.'];
        $('dodgeLabel').textContent = labels[dodges];
        $('dodgeDescription').textContent = ['','A small scheduling conflict. Try again.','It’s really committing to the bit.','It’s tired now. One more click and we’re moving on.'][dodges];
        $('stageHint').textContent = dodges === 3 ? 'THE BUTTON HAS AGREED TO COOPERATE.' : 'IT GIVES UP AFTER THREE LITTLE ESCAPES.';
        if (dodges === 3) {
          button.classList.add('caught');
          $('arenaCaption').textContent = 'AN AGREEMENT HAS BEEN REACHED';
        }
      }

      function setProgress(value) {
        progress = Math.round(Math.max(0, Math.min(100, value)));
        if ($('progressFill')) {
          $('progressFill').style.width = progress + '%';
          $('percent').textContent = progress;
          $('progressTrack').setAttribute('aria-valuenow', progress);
          $('miniFill').style.width = progress + '%';
          $('miniPercent').textContent = progress + '%';
        }
      }

      function reachNinetyNine() {
        if (holdUntil > Date.now()) return;
        holdUntil = Date.now() + 1250;
        $('loadingStatus').textContent = '99%. A perfectly good place to reconsider.';
        $('loadingRemark').textContent = 'RECALIBRATING THE CALIBRATION.';
      }

      function startLoading() {
        stopLoading();
        loadingTimer = setInterval(() => {
          if (currentStep !== 2 || demo) { stopLoading(); return; }
          if (holdUntil) {
            if (Date.now() < holdUntil) return;
            holdUntil = 0;
            setbacks++;
            if (setbacks <= 2) {
              setProgress(setbacks === 1 ? 63 : 81);
              $('loadingStatus').textContent = setbacks === 1 ? 'A little backwards is still a direction.' : 'It forgot something. Again.';
              $('loadingDescription').textContent = setbacks === 1 ? '99% was feeling a little overconfident.' : 'The final 1% has requested a second opinion.';
              holdUntil = Date.now() + 1050;
              // Negative value marks a pause after a setback, rather than a new 99%.
              holdUntil = -holdUntil;
              return;
            }
            completeLoading(); return;
          }
          setProgress(Math.min(99, progress + (progress < 70 ? 7 : 4)));
          if (progress >= 99) reachNinetyNine();
        }, 240);
        // Pauses use a dedicated wrapper so the bar's backwards slide stays visible.
        clearInterval(loadingTimer);
        loadingTimer = setInterval(loadingTick, 240);
      }

      function loadingTick() {
        if (currentStep !== 2 || demo) { stopLoading(); return; }
        if (holdUntil < 0) {
          if (Date.now() < -holdUntil) return;
          holdUntil = 0;
        }
        if (holdUntil > 0) {
          if (Date.now() < holdUntil) return;
          holdUntil = 0;
          setbacks++;
          if (setbacks <= 2) {
            setProgress(setbacks === 1 ? 63 : 81);
            $('loadingStatus').textContent = setbacks === 1 ? 'A little backwards is still a direction.' : 'It forgot something. Again.';
            $('loadingDescription').textContent = setbacks === 1 ? '99% was feeling a little overconfident.' : 'The final 1% has requested a second opinion.';
            holdUntil = -(Date.now() + 1100);
            return;
          }
          completeLoading(); return;
        }
        setProgress(Math.min(99, progress + (progress < 70 ? 7 : 4)));
        if (progress >= 99) reachNinetyNine();
      }

      function completeLoading() {
        setProgress(100); stopLoading();
        $('loadingStatus').textContent = 'Done. Actually, genuinely done.';
        $('loadingDescription').textContent = 'A round of applause for this completely avoidable journey.';
        $('loadingRemark').textContent = 'PROGRESS HAS LEFT THE CHAT.';
        $('stageHint').textContent = 'GOOD THINGS COME TO THOSE WHO CLICK CONTINUE.';
        $('goodEnough').innerHTML = 'Finally. Continue <span aria-hidden="true">→</span>';
      }

      function renderCookies() {
        const board = $('cookieBoard');
        if (!board) return;
        const names = ['A cookie notice.','Another cookie notice.','The notice’s notice.','One for the road.'];
        board.innerHTML = Array.from({length:notices}, (_,i) => '<div class="cookie-note">' + cookieIcon + '<div><strong>' + names[i] + '</strong><small>We thought you’d like one.</small></div><button type="button" class="cookie-close" aria-label="Close cookie notice ' + (i+1) + '">×</button></div>').join('');
        board.querySelectorAll('.cookie-close').forEach(button => button.addEventListener('click', () => closeCookie(true)));
      }

      function closeCookie(focus = false) {
        if (currentStep !== 3) return;
        cookieClicks++;
        if (cookieClicks <= 3) {
          notices = Math.min(4, notices+1);
          renderCookies();
          const lines = ['','Closing one has opened two. Naturally.','The Close button has invited a colleague.','This meeting could have been a biscuit.'];
          $('cookieDescription').textContent = lines[cookieClicks];
          $('cookieStatus').textContent = cookieClicks === 3 ? 'Four is the limit. We do have standards.' : notices + ' notices. Zero actual cookies.';
          if (cookieClicks === 3) $('closeAll').innerHTML = 'Enough. Thank me now. <span aria-hidden="true">→</span>';
          if (focus && !demo) $('cookieBoard').querySelector('.cookie-close').focus({preventScroll:true});
        } else {
          completed.add(3); finish(true);
        }
      }

      function finish(focus = false) {
        completed.add(1); completed.add(2); completed.add(3);
        setStep(4, focus);
      }

      function jumpTo(step) {
        setStep(step, true);
        $('experiment').scrollIntoView({behavior:window.matchMedia('(prefers-reduced-motion: reduce)').matches?'auto':'smooth',block:'start'});
      }

      function complain() {
        complaints++;
        $('feedbackCount').textContent = complaints > 99 ? '99+' : complaints;
        const messages = [
          'Your complaint is important to us. It is now complaint #1 of 1.',
          'We’ve escalated your complaint to a slightly taller desk.',
          'Your feedback has been filed under “Understandable”.',
          'Management is nodding sympathetically from a safe distance.',
          'Your complaint has received a little gold star. Thank you.'
        ];
        toast(messages[Math.min(complaints-1,messages.length-1)]);
        $('complaintButton').innerHTML = 'File another complaint <span aria-hidden="true">↗</span>';
      }

      $('complaintButton').addEventListener('click', complain);
      $('feedbackNav').addEventListener('click', complain);
      $('skipStage').addEventListener('click', () => {
        if (currentStep < 3) { completed.add(currentStep); setStep(currentStep+1,true); }
        else finish(true);
      });
      $('directFinish').addEventListener('click', () => {
        finish(true);
        $('experiment').scrollIntoView({behavior:window.matchMedia('(prefers-reduced-motion: reduce)').matches?'auto':'smooth',block:'start'});
      });
      $('homeLink').addEventListener('click', event => { event.preventDefault(); completed.clear(); setStep(1); window.scrollTo({top:0,behavior:'smooth'}); });
      $('extraProgress').addEventListener('click', () => jumpTo(2));
      $('extraCookies').addEventListener('click', () => jumpTo(3));
      document.querySelectorAll('[data-step]').forEach(button => button.addEventListener('click', () => setStep(Number(button.dataset.step),true)));
      $('straighten').addEventListener('click', () => {
        tidyClicks++;
        const tiles = $('tiles').children;
        if (tidyClicks % 3 === 1) {
          tiles[0].style.transform='rotate(3deg)';tiles[1].style.transform='translateY(1px) rotate(-4deg)';tiles[2].style.transform='rotate(7deg)';
          $('tidyDescription').textContent='Better? No. Different? Absolutely.';
          $('straighten').innerHTML='Just a tiny adjustment <span aria-hidden="true">↗</span>';
        } else if (tidyClicks % 3 === 2) {
          tiles[0].style.transform='translateY(1px) rotate(-1deg)';tiles[1].style.transform='rotate(1deg)';tiles[2].style.transform='translateY(-1px) rotate(-2deg)';
          $('tidyDescription').textContent='One pixel between you and inner peace.';
          $('straighten').innerHTML='One. Last. Time. <span aria-hidden="true">↗</span>';
        } else {
          Array.from(tiles).forEach(tile => tile.style.transform='none');
          document.querySelector('.extra-title .tiny-misaligned').style.top='0';
          $('tidyDescription').textContent='There. A small, deeply satisfying victory.';
          $('straighten').innerHTML='Disturb the peace <span aria-hidden="true">↗</span>';
        }
      });

      function pointAt(selector) {
        const element = document.querySelector(selector);
        if (!element || !demo) return;
        const rect = element.getBoundingClientRect();
        $('demoCursor').style.left = (rect.left + rect.width * .65) + 'px';
        $('demoCursor').style.top = (rect.top + rect.height * .6) + 'px';
      }

      function schedule(ms, action) {
        demoTimers.push(setTimeout(() => { if (demo) action(); }, ms));
      }

      function playDemoCycle() {
        if (!demo) return;
        demoTimers.forEach(clearTimeout); demoTimers = [];
        completed.clear(); setStep(1);
        pointAt('#dodgeButton');
        schedule(1300, () => { dodgeButton(); pointAt('#dodgeButton'); });
        schedule(2600, () => { dodgeButton(); pointAt('#dodgeButton'); });
        schedule(3900, () => { dodgeButton(); pointAt('#dodgeButton'); });
        schedule(5100, () => { completed.add(1); setStep(2); pointAt('#progressTrack'); setProgress(45); });
        schedule(6100, () => { setProgress(99); $('loadingStatus').textContent='99%. A perfectly good place to reconsider.'; });
        schedule(7300, () => { setProgress(63); $('loadingStatus').textContent='A little backwards is still a direction.'; $('loadingDescription').textContent='99% was feeling a little overconfident.'; });
        schedule(8400, () => setProgress(99));
        schedule(9400, () => { setProgress(81); $('loadingStatus').textContent='It forgot something. Again.'; });
        schedule(10400, () => { completeLoading(); pointAt('#goodEnough'); });
        schedule(11500, () => { completed.add(2); setStep(3); pointAt('.cookie-close'); });
        schedule(12600, () => { closeCookie(); pointAt('.cookie-close'); });
        schedule(13700, () => { closeCookie(); pointAt('.cookie-close'); });
        schedule(14800, () => { closeCookie(); pointAt('#closeAll'); });
        schedule(16000, () => { finish(); pointAt('#restButton'); });
        schedule(17600, () => { $('restButton').textContent='A well-earned moment of peace. ✓'; $('restButton').disabled=true; });
      }

      function startDemo() {
        if (demo) return;
        demo = true;
        $('demoBar').classList.add('visible');
        $('demoCursor').classList.add('visible');
        playDemoCycle();
        demoLoop = setInterval(playDemoCycle, 20500);
      }

      function stopDemo() {
        if (!demo) return;
        demo = false;
        demoTimers.forEach(clearTimeout); demoTimers = [];
        clearInterval(demoLoop); demoLoop = null;
        $('demoBar').classList.remove('visible');
        $('demoCursor').classList.remove('visible');
        if (currentStep === 2 && progress < 100) { holdUntil = 0; startLoading(); }
      }

      $('stopDemo').addEventListener('click', stopDemo);
      document.addEventListener('pointerdown', event => { if(event.isTrusted) stopDemo(); }, {capture:true,passive:true});
      document.addEventListener('touchstart', event => { if(event.isTrusted) stopDemo(); }, {capture:true,passive:true});
      document.addEventListener('keydown', event => { if(event.isTrusted) stopDemo(); }, {capture:true});
      document.addEventListener('wheel', event => { if(event.isTrusted) stopDemo(); }, {capture:true,passive:true});
      window.addEventListener('hashchange', () => { if(location.hash === '#demo') startDemo(); else stopDemo(); });
      setStep(1);
      if (location.hash === '#demo') startDemo();
    })();
  </script>
</body>
</html>