/* The book (round 7): the closed cover standing for most of the scroll, then a quick riffle, then it lies down.
   book.js drives every transform; without it (or before it loads) the book shows as its standing cover.
   Read work/website/wilco-io-2026-11/_content-first/r7/_paste-notes-book.md before changing anything here:
   no overflow/opacity/filter/clip-path on .bk7-book, .bk7-leaf, .bk7-cvl or anything between .bk7-scene and them
   (it flattens the 3D), and no transform/filter/overflow scroll container on any ancestor of .bk7-stage. */
/* The book is drawn at one design size (350 x 522, 58 thick) and scaled by --bk7-k. */
.bk7{--cv:#F0B21F;--cvd:#D99D12;
  --bk7-k:1;--bk7-stage:700px;--bk7-floor:610px;--bk7-pin:1500;--bk7-trig:1000;--bk7-top:0px;
  --bk7-sx:40;--bk7-fx:-80;--bk7-fz:1.06;--bk7-ox:105;
  color:var(--ink);overflow:clip;min-width:0;padding:64px 0}
.bk7 *{box-sizing:border-box}
/* the track is only tall while the page can scroll (data-bk7-mode="track", set by the script) */
.bk7-track{position:relative}
.bk7[data-bk7-mode="track"] .bk7-track{height:calc(var(--bk7-stage) + var(--bk7-pin) * 1px)}
.bk7[data-bk7-mode="track"] .bk7-stage{position:-webkit-sticky;position:sticky;top:var(--bk7-top)}
.bk7-stage{height:var(--bk7-stage);max-width:1440px;margin:0 auto;padding:0 var(--side);display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:32px;align-items:center}
.bk7-words{grid-column:1 / span 5}
.bk7-words h2{margin:0;font-weight:700;font-size:64px;line-height:1;letter-spacing:-.025em}
.bk7-nw{white-space:nowrap}
.bk7-e{font-weight:400;letter-spacing:0;font-size:.7em;vertical-align:.06em;margin-left:.08em}
.bk7-words p{margin:24px 0 0;font-weight:500;font-size:28px;line-height:1.2;letter-spacing:-.015em;max-width:14em}

/* the scene holds the perspective. It is NOT preserve-3d, so the floor shadow always paints under the book. */
.bk7-scene{grid-column:7 / span 6;position:relative;height:var(--bk7-stage);perspective:2600px;perspective-origin:50% 42%}
.bk7-floor{position:absolute;left:calc(50% - 800px);top:calc(var(--bk7-floor) - 800px);width:1600px;height:1600px;pointer-events:none}
.bk7-sh{position:absolute;left:50%;top:50%;pointer-events:none;will-change:transform,opacity}
/* standing: a tight contact line under the foot and a soft shadow falling back and to the right */
.bk7-shs{width:350px;height:58px;margin:-29px 0 0 -175px;border-radius:6px;background:rgba(16,20,24,.40);box-shadow:0 0 6px 3px rgba(16,20,24,.30)}
.bk7-shs2{width:620px;height:380px;margin:-330px 0 0 -250px;border-radius:50%;
  background:radial-gradient(closest-side,rgba(16,20,24,.16),rgba(16,20,24,.07) 55%,rgba(16,20,24,0))}
/* lying: the footprint of the whole book, plus a wider soft halo */
.bk7-shf{width:522px;height:350px;margin:-175px 0 0 -261px;border-radius:4px;background:rgba(16,20,24,.5);box-shadow:0 0 6px 2px rgba(16,20,24,.4),0 0 26px 10px rgba(16,20,24,.14)}
.bk7-shf2{width:700px;height:520px;margin:-270px 0 0 -330px;border-radius:50%;
  background:radial-gradient(closest-side,rgba(16,20,24,.24),rgba(16,20,24,.10) 60%,rgba(16,20,24,0))}

/* the book: a real box around its own centre. Nothing in this 3D chain has overflow, opacity, filter or clip-path. */
.bk7-book{position:absolute;left:calc(50% - 175px);top:calc(var(--bk7-floor) - 261px);width:350px;height:522px;
  transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transform-origin:50% 50%;will-change:transform}
.bk7-f{position:absolute;left:0;top:0;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.bk7-dim,.bk7-cast,.bk7-gloss{position:absolute;inset:0;pointer-events:none}
.bk7-dim{background:#101418;opacity:0;will-change:opacity}
.bk7-back{width:350px;height:522px;background:var(--cv);border-radius:4px 2px 2px 4px;transform:translateZ(-29px) rotateY(180deg)}
.bk7-spine{left:146px;width:58px;height:522px;background:var(--cv);transform:rotateY(-90deg) translateZ(176.5px);border-radius:3px;
  display:flex;align-items:center;justify-content:center}
.bk7-spine b{position:absolute;left:0;right:0;bottom:0;height:36px;background:#141414}
.bk7-spine span{writing-mode:vertical-rl;font-weight:800;font-size:37px;line-height:1;letter-spacing:.035em;text-transform:uppercase;color:#121212;white-space:nowrap;margin-bottom:30px}
.bk7-fore{left:146px;width:58px;height:522px;transform:rotateY(90deg) translateZ(172.5px);
  background:linear-gradient(90deg,var(--cvd) 0 2px,transparent 2px calc(100% - 2px),var(--cvd) calc(100% - 2px)),
    repeating-linear-gradient(90deg,#fdfdfb 0 1.4px,#e4e3df 1.4px 2px),#fbfbf9}
.bk7-head,.bk7-foot{top:232px;width:347px;height:58px;
  background:linear-gradient(180deg,var(--cvd) 0 2px,transparent 2px calc(100% - 2px),var(--cvd) calc(100% - 2px)),
    repeating-linear-gradient(180deg,#fdfdfb 0 1.4px,#e4e3df 1.4px 2px),#fbfbf9}
.bk7-head{transform:rotateX(90deg) translateZ(259px)}
.bk7-foot{transform:rotateX(-90deg) translateZ(259px)}

/* leaves turn on the spine edge */
.bk7-leaf,.bk7-cvl{position:absolute;left:0;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transform-origin:0 50%;will-change:transform}
.bk7-leaf{top:2px;width:347px;height:518px}
.bk7-cvl{top:0;width:350px;height:522px}
.bk7-cvf{width:350px;height:522px;border-radius:2px 5px 5px 2px;background:var(--cv);overflow:hidden}
.bk7-cvf picture{display:block;width:100%;height:100%}
.bk7-cvf img{display:block;width:100%;height:100%;object-fit:cover}
.bk7-hinge{position:absolute;top:0;bottom:0;left:9px;width:3px;background:linear-gradient(90deg,rgba(16,20,24,.16),rgba(255,255,255,.20))}
.bk7-gloss{left:-100%;width:300%;background:linear-gradient(100deg,rgba(255,255,255,0) 36%,rgba(255,255,255,.26) 47%,rgba(255,255,255,0) 58%);will-change:transform}
.bk7-cvb{width:350px;height:522px;background:#fff;border-radius:5px 2px 2px 5px;transform:rotateY(180deg) translateZ(.4px)}

/* paper */
.bk7-pg{width:347px;height:518px;background:#fff;overflow:hidden;color:#1b1f24}
.bk7-fr{padding:0 26px 0 38px;border-radius:0 2px 2px 0}
.bk7-bk{padding:0 38px 0 26px;border-radius:2px 0 0 2px;transform:rotateY(180deg) translateZ(.4px)}
.bk7-gut{position:absolute;top:0;bottom:0;left:0;width:60px;background:linear-gradient(90deg,rgba(16,20,24,.16),rgba(16,20,24,.05) 10px,rgba(16,20,24,0) 40px)}
.bk7-bk .bk7-gut{left:auto;right:0;background:linear-gradient(270deg,rgba(16,20,24,.16),rgba(16,20,24,.05) 10px,rgba(16,20,24,0) 40px)}
.bk7-curl{position:absolute;inset:0;pointer-events:none;opacity:0;will-change:opacity;background:linear-gradient(90deg,rgba(16,20,24,0) 22%,rgba(255,255,255,.10) 42%,rgba(16,20,24,.08) 66%,rgba(16,20,24,.30))}
.bk7-bk .bk7-curl{transform:scaleX(-1)}
.bk7-cast{background:linear-gradient(90deg,rgba(16,20,24,.5),rgba(16,20,24,.18) 45%,rgba(16,20,24,0) 85%);opacity:0;will-change:opacity}
.bk7-run{margin:0;height:56px;padding-top:30px;font-size:10px;line-height:12px;letter-spacing:.08em;text-transform:uppercase;color:rgba(16,20,24,.5)}
.bk7-bk .bk7-run{text-align:left}
.bk7-fr .bk7-run{text-align:right}
.bk7-txt{height:437.5px;overflow:hidden;font-size:12.5px;line-height:17.5px;-webkit-hyphens:auto;hyphens:auto;text-align:left}
.bk7-txt p{margin:0}
.bk7-txt p + p{text-indent:1.3em}
.bk7-txt h4{margin:0;padding-top:17.5px;font-size:12.5px;line-height:17.5px;font-weight:700}
.bk7-otxt{position:absolute;left:38px;right:26px;bottom:24px;height:262.5px}
.bk7-cn{margin:28px 0 0;font-size:13px;line-height:18px;font-weight:500;color:rgba(16,20,24,.55)}
.bk7-ct{margin:6px 0 0;font-weight:700;font-size:25px;line-height:27px;letter-spacing:-.015em;max-width:11em}
.bk7-title{display:flex;flex-direction:column;height:100%;padding:118px 0 44px}
.bk7-tt{margin:0;font-weight:700;font-size:34px;line-height:1;letter-spacing:-.02em}
.bk7-ts{margin:14px 0 0;font-size:14px;line-height:19px;max-width:15em}
.bk7-ta{margin:auto 0 0;font-weight:600;font-size:14px}
.bk7-toch{margin:0 0 14px;font-weight:700;font-size:20px;letter-spacing:-.01em}
.bk7-toc{list-style:none;margin:0;padding:0;font-size:11.5px;line-height:15px}
.bk7-toc li{padding:0 0 5px}
.bk7-static{top:2px;transform:translateZ(12.6px)}
/* while the book is shut the loose leaves are hidden inside it: fewer 3D planes to sort while it turns and falls */
.bk7-book:not([data-bk7-open]) .bk7-leaf,.bk7-book:not([data-bk7-open]) .bk7-static{visibility:hidden}

/* one tap target over the whole scene (no visible button) */
.bk7-hit{position:absolute;inset:0;z-index:5;border:0;padding:0;margin:0;background:transparent;cursor:pointer;border-radius:16px;-webkit-tap-highlight-color:transparent}
.bk7-hit:focus-visible{outline:3px solid var(--ink);outline-offset:-3px}

/* short laptop screens: a smaller book so the whole stage fits under the top bar */
@media (min-width:1061px) and (max-height:820px){
  .bk7{--bk7-k:.8;--bk7-stage:580px;--bk7-floor:510px}
}
@media (max-width:1360px){
  .bk7-words h2{font-size:56px}
  .bk7-words p{font-size:24px}
}
/* stacked: words above, book below */
@media (max-width:1060px){
  .bk7{--bk7-k:.78;--bk7-stage:740px;--bk7-floor:500px;--bk7-pin:1300;--bk7-trig:860;--bk7-sx:0;--bk7-fx:0;--bk7-ox:175;padding:48px 0}
  .bk7-stage{display:flex;flex-direction:column;align-items:stretch;justify-content:center}
  .bk7-words{flex:none}
  .bk7-words p{max-width:none}
  .bk7-scene{flex:none;height:560px;margin-top:8px}
}
@media (max-width:600px){
  .bk7{--bk7-k:.5;--bk7-stage:520px;--bk7-floor:318px;--bk7-pin:1100;--bk7-trig:720;--bk7-fz:.94;--bk7-rz:.84}
  .bk7-words h2{font-size:40px}
  .bk7-words p{font-size:22px;margin-top:12px}
  .bk7-scene{height:372px;perspective:1500px}
}
@media (max-width:600px) and (max-height:700px){
  .bk7{--bk7-k:.44;--bk7-stage:470px;--bk7-floor:284px}
  .bk7-scene{height:330px}
}

/* short windows (a phone on its side, a laptop with a tiny window): a small book beside the words, the whole stage
   inside the window under the top bar */
@media (max-height:519.98px) and (min-width:601px){
  .bk7{--bk7-k:.46;--bk7-stage:320px;--bk7-floor:292px;--bk7-pin:1000;--bk7-trig:660;--bk7-sx:40;--bk7-fx:-80;--bk7-ox:105;--bk7-fz:1;padding:24px 0}
  .bk7-stage{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:32px;align-items:center}
  .bk7-words{grid-column:1 / span 6}
  .bk7-words h2{font-size:40px}
  .bk7-words p{font-size:22px;margin-top:12px;max-width:14em}
  .bk7-scene{grid-column:7 / span 6;height:var(--bk7-stage);margin-top:0;perspective:1500px}
}

/* before book.js runs (and without script): the standing cover, scaled to the stage, no 3D */
.bk7:not([data-bk7-mode]) .bk7-book{top:calc(50% - 261px);transform:scale(var(--bk7-k))}   /* centred in its scene, even space above and below */
.bk7:not([data-bk7-mode]) .bk7-sh{opacity:0}
@media (prefers-reduced-motion:reduce){ .bk7 *{transition:none !important;animation:none !important} }
