/* ==========================================================
   The front page: one scroll-driven scene. A tall section (.story) holds a sticky, screen-sized stage; story.js
   turns the scroll position into where the cookie, the jar and the lid are. The jar and the lid are pictures moved
   by transforms; the cookie is drawn live on a canvas between the glass layers (js/cookie3d.js). Nothing moves but
   as far as the reader scrolls (nothing runs by itself), so the scene also shows where the device asks for less
   motion. Without JavaScript or WebGL the stage is a plain picture of the closed jar and the text sits under it.
   ========================================================== */
.story{position:relative;height:500vh;height:calc(var(--scenes,5) * 100svh)}
.stage{
  position:sticky;top:0;height:100vh;height:100svh;height:100dvh;overflow:hidden;
  -webkit-user-select:none;user-select:none;
}
.light{
  position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(60% 55% at 50% 44%,var(--spot) 0%,transparent 70%);
}
.jar{position:absolute;left:0;top:0;will-change:transform;visibility:hidden}
.jar .layer{position:absolute;left:0;top:0;width:100%;height:auto;will-change:transform}
.jar img{pointer-events:none;-webkit-user-drag:none}
.jar .lid{transform-origin:50% 38.1%;will-change:transform}
.jar .cookie3d{position:absolute;left:0;top:0;display:block;pointer-events:none;will-change:transform}
.copy{
  position:absolute;left:var(--gutter);right:var(--gutter);top:0;
  text-align:center;opacity:0;pointer-events:none;will-change:transform,opacity;
}
.copy p{font-family:var(--font-read);font-size:clamp(19px,2.4vw,24px);line-height:1.4;color:var(--ink-2);max-width:30ch;margin:0 auto}
.copy p b{font-weight:500;color:var(--ink)}
.copy h2{font-size:clamp(23px,3.3vw,36px);line-height:1.12;font-weight:600;letter-spacing:-.025em;max-width:22ch;margin:0 auto 10px}
.copy .steps{display:flex;flex-direction:column;gap:6px;margin:10px auto 0;padding:0;list-style:none;font-size:clamp(16px,1.9vw,18.5px);color:var(--ink-2)}
.copy .steps b{font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums;margin-right:6px}
/* the invitation under the cookie: one quiet line in the site's own face, like the menu and the buttons */
.copy.prompt p{font-family:var(--font-ui);font-size:clamp(15.5px,1.8vw,17.5px);line-height:1.4;font-weight:500;letter-spacing:-.005em;color:var(--ink-2)}
.copy.last .btn{margin-top:14px;pointer-events:auto}
.copy.on{pointer-events:auto}
/* on wide screens the text keeps to the left third, beside the jar, so nothing ever sits under the animation */
@media (min-width:1024px){
  .copy:not(.prompt):not(.last){left:var(--gutter);right:auto;width:min(36vw,440px);text-align:left}
  .copy:not(.prompt):not(.last) p,.copy:not(.prompt):not(.last) h2,.copy:not(.prompt):not(.last) .steps{margin-left:0;margin-right:0}
  .copy.last{left:var(--gutter);right:auto;width:min(36vw,440px);text-align:left}
  .copy.last p{margin-left:0}
}

/* the plain version: no JavaScript (or no WebGL) */
html:not(.js) .story{height:auto}
html:not(.js) .stage{
  position:relative;height:auto;overflow:visible;
  padding:calc(var(--header-h) + env(safe-area-inset-top,0px) + 28px) var(--gutter) 24px;
  display:flex;flex-direction:column;align-items:center;gap:28px;
}
html:not(.js) .jar{position:relative;width:min(78vw,380px);visibility:visible;margin:12px 0}
html:not(.js) .jar .layer{position:static;width:100%}
html:not(.js) .jar .layer:not(.still){display:none}
html:not(.js) .cookie3d,html:not(.js) .copy.prompt{display:none}
html:not(.js) .copy{position:static;opacity:1;pointer-events:auto;max-width:560px}
html:not(.js) .light{top:0;bottom:auto;height:100svh}
.jar .still{display:none}
html:not(.js) .jar .still{display:block}

/* ---------- download ---------- */
.download{position:relative;padding:88px var(--gutter) 96px;text-align:center;background:var(--bg)}
.download::before{content:"";position:absolute;left:var(--gutter);right:var(--gutter);top:0;height:1px;background:var(--line)}
.download h2{font-size:clamp(26px,3.6vw,38px);line-height:1.1;font-weight:600;letter-spacing:-.025em}
.download .sub{font-family:var(--font-read);font-size:clamp(18px,2.1vw,21px);color:var(--ink-2);max-width:36ch;margin:12px auto 28px}
.download .fine{font-size:13.5px;color:var(--muted);margin-top:22px}
.download .fine a{text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line-3)}
.download .fine a:hover{text-decoration-color:currentColor}
