/* (iteration) All books → book page (rise.js): the clicked block's print rises to the top of the window, spreads
   across the screen and becomes the book page's ground. Layers as press.css: colour, the drawing pressed in, grain. */
.rise{position:fixed;left:0;top:0;z-index:300;overflow:hidden;isolation:isolate;pointer-events:none;
  clip-path:var(--c0);transition:clip-path .62s cubic-bezier(.65,0,.25,1),opacity .45s ease}
.rise.s1{clip-path:var(--c1)}
.rise.s2{clip-path:var(--c2);transition-duration:.54s}
.rise.s3{opacity:0}
.rise-ink{position:absolute;inset:0;background:var(--blk)}
.rise-press{position:absolute;inset:0;pointer-events:none;
  filter:drop-shadow(-.8px -.8px 0 rgba(255,250,238,.20)) drop-shadow(.9px .9px 0 rgba(25,12,0,.19)) drop-shadow(1.2px 1.2px 1.2px rgba(25,12,0,.08))}
.rise-press i{position:absolute;inset:0;background:color-mix(in srgb,var(--blk) 96%,#000);
  -webkit-mask:var(--m) var(--sx,0) var(--sy,0)/var(--tile,300px) auto repeat;mask:var(--m) var(--sx,0) var(--sy,0)/var(--tile,300px) auto repeat}
.rise-grain{position:absolute;inset:0;pointer-events:none;background:var(--paper-tex);mix-blend-mode:multiply;opacity:.9}
/* the cover stays where it stood while the colour rises and spreads, then goes with the overlay */
.rise-cover{position:absolute;z-index:2;object-fit:cover;background:#fff;box-shadow:-1px 1px 1.5px rgba(0,0,0,.28),-10px 6px 16px -6px rgba(0,0,0,.5)}
@media (prefers-reduced-motion:reduce){.rise{transition:none!important}}

/* ===== the book page on its book's ground (html.bk-tint, set by rise.js on #/book/…) ===== */
/* the colour sits on html; body goes clear, or its background would paint over the pressed ground beneath it */
html.bk-tint{background:var(--tblk)!important;background-image:none!important}
html.bk-tint body{background:transparent!important;background-image:none!important}
.bk-ground{display:none}
html.bk-tint .bk-ground{display:block;position:fixed;inset:0;z-index:-1;pointer-events:none;--blk:var(--tblk);--m:var(--tm);background:var(--tblk)}
html.bk-tint .bk-ground .rise-press i{-webkit-mask:var(--tm) 0 0/300px auto repeat;mask:var(--tm) 0 0/300px auto repeat}
/* surfaces that paint their own paper go clear, so the ground shows through */
html.bk-tint body header.top,html.bk-tint body.scrolled header.top,html.bk-tint #app,html.bk-tint #app main.bookp{background:transparent!important;background-image:none!important;box-shadow:none!important;border-color:transparent!important}
/* on the dark grounds the ink turns to cream */
html.bk-tint:not(.bk-tint-light){--paper:var(--tblk);--ink:#F7EFE3;--ink2:rgba(247,239,227,.84);--ink3:rgba(247,239,227,.62);
  --line:rgba(247,239,227,.2);--hair:rgba(247,239,227,.14);--hair2:rgba(247,239,227,.24);--red:#FFFFFF;color-scheme:dark}
html.bk-tint:not(.bk-tint-light) body,html.bk-tint:not(.bk-tint-light) #app main.bookp{color:var(--ink)}
html.bk-tint:not(.bk-tint-light) #app main.bookp :is(h1,h2,h3,a,li,span,div,button){color:inherit}
html.bk-tint:not(.bk-tint-light) #app main.bookp .chl a{color:var(--ink)!important}
html.bk-tint:not(.bk-tint-light) #app main.bookp :is(.kicker,.dim,.mn,.num,.bprog){color:var(--ink3)!important}
html.bk-tint:not(.bk-tint-light) body header.top :is(a,button,svg,.ic){color:var(--ink)!important;stroke:currentColor}
/* Begin / Read later carry a hard-coded near-black: on a dark book page they are white (the user, 2026-11-23) */
html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns :is(.btn,.btn *){color:#FFFFFF!important;stroke:currentColor}
html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .blater.on{color:var(--red)!important}
html.bk-tint-light{--paper:var(--tblk)}
/* the page fades in on the ground as the overlay lifts */
html.bk-arriving #app main.bookp{animation:bk-in .5s .1s cubic-bezier(.2,.7,.2,1) both}
@keyframes bk-in{from{opacity:0;transform:translateY(10px)}}
/* the book page's pressed drawing: fainter than on the tile, but there under the text */
html.bk-tint .bk-ground .rise-press{opacity:.45;filter:drop-shadow(-.7px -.7px 0 rgba(255,250,238,.16)) drop-shadow(.8px .8px 0 rgba(25,12,0,.15))}
/* the pressed pattern is full behind the cover, fades gradually behind the contents so the text sits on a quiet
   ground, and comes back to full past the contents' right edge (rise.js sets --fa/--fb/--fc from the real columns). Desktop: across, from the left column; phones (contents below the cover): downward. */
html.bk-tint .bk-ground .rise-press{
  -webkit-mask:linear-gradient(90deg,#000 0,#000 var(--fa,24%),rgba(0,0,0,.5) calc(var(--fa,24%) + 10%),rgba(0,0,0,.14) var(--fb,46%),rgba(0,0,0,.14) var(--fc,76%),rgba(0,0,0,.55) calc(var(--fc,76%) + 6%),#000 calc(var(--fc,76%) + 12%),#000 100%);
          mask:linear-gradient(90deg,#000 0,#000 var(--fa,24%),rgba(0,0,0,.5) calc(var(--fa,24%) + 10%),rgba(0,0,0,.14) var(--fb,46%),rgba(0,0,0,.14) var(--fc,76%),rgba(0,0,0,.55) calc(var(--fc,76%) + 6%),#000 calc(var(--fc,76%) + 12%),#000 100%)}
/* single column (narrow windows, phones): text runs over the pattern everywhere, so the whole pattern sits at the
   same faint level it has behind the contents on a wide screen (rise.js adds .stacked when the layout stacks) */
html.bk-tint .bk-ground .rise-press.stacked{-webkit-mask:linear-gradient(rgba(0,0,0,.14),rgba(0,0,0,.14))!important;mask:linear-gradient(rgba(0,0,0,.14),rgba(0,0,0,.14))!important}
/* the sidebar on a book page takes the book's own ground, so it reads as part of the page and its cream type shows;
   on a light ground it keeps the ground colour with dark type, the same way */
html.bk-tint .siderail{background:var(--tblk) var(--paper-tex)!important;background-blend-mode:multiply!important;color:var(--ink)!important;
  box-shadow:0 0 0 1px var(--line),18px 0 48px -24px rgba(0,0,0,.45)!important}
html.bk-tint .siderail a,html.bk-tint .siderail a span,html.bk-tint .siderail button{color:var(--ink)!important}
html.bk-tint .siderail a .ic,html.bk-tint .siderail a svg{color:var(--ink)!important;stroke:currentColor}
html.bk-tint .siderail a:not(.on){opacity:.82}
html.bk-tint .siderail a.on{background:color-mix(in srgb,var(--ink) 10%,transparent)!important;opacity:1}
@media (hover:hover){html.bk-tint .siderail a:hover{background:color-mix(in srgb,var(--ink) 7%,transparent)!important;opacity:1}}
html.bk-tint:not(.bk-tint-light) .siderail .brand img{filter:brightness(0) invert(.95) sepia(.25)}
/* the block opens straight out to the whole screen in one slow, eased movement (no column first) */
.rise{transition:clip-path .9s cubic-bezier(.45,0,.15,1),opacity .45s ease!important}
.rise.open{clip-path:var(--c2)!important}
.rise-cover{transition:none}
/* pop-ups and boxes laid over a dark book page are white: they keep the site's normal dark ink */
html.bk-tint:not(.bk-tint-light) :is(#picker,#kmodal,#finder,.finder,.fx,#cpanel,.float,#selbar){
  --paper:#FCFBF9;--ink:#1C1B19;--ink2:#3E3730;--ink3:#776B5D;--line:rgba(60,48,36,.13);--hair:rgba(60,48,36,.1);--hair2:rgba(60,48,36,.16);--red:#C4000C;
  color:var(--ink);color-scheme:light}

/* on a dark book page, hovering Begin / Read later brightens to white instead of turning red */
@media (hover:hover){
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn:hover,
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn:hover *{color:#FFFFFF!important;stroke:currentColor}
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn:hover::before{background:#FFFFFF!important}
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn{opacity:.88;transition:opacity .2s,color .2s}
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn:hover{opacity:1}
}
/* Begin in the page's accent, white on a dark book page (like "In Read later") */
html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn.pri,
html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn.pri *{color:var(--red)!important;stroke:currentColor}
@media (hover:hover){html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn.pri:hover,
  html.bk-tint:not(.bk-tint-light) body #app#app main.bookp .btns .btn.pri:hover *{color:#FFFFFF!important}}

/* book page → chapter (rise.js): the reader's paper opens out from around the cover, then lifts off the chapter */
.opw{position:fixed;left:0;top:0;z-index:310;pointer-events:none;background-image:var(--paper-tex);
  clip-path:var(--c0);box-shadow:0 0 0 1px rgba(0,0,0,.04);transition:clip-path .72s cubic-bezier(.65,0,.25,1),opacity .4s ease}
.opw.go{clip-path:var(--c1)}
.opw.out{opacity:0}
@media (prefers-reduced-motion:reduce){.opw{transition:none}}

/* the opening (rise.js): the pressed drawings grow and soften with the expansion, on the same curve */
.rise .rise-press{transition:transform .9s cubic-bezier(.45,0,.15,1),opacity .9s cubic-bezier(.45,0,.15,1);will-change:transform}
.rise.s3{transition:opacity .5s ease!important}

/* ===== smooth openings (rise.js, rewritten 2026-11-17): GPU-only. The overlay's ground is one static layer
   (colour + grain blended inside its own background, no full-screen mix-blend), the drawings a promoted layer. ===== */
.rise{transition:none!important;clip-path:none}
.rise .rise-ink{background:var(--blk) var(--paper-tex);background-blend-mode:multiply}
.rise .rise-press{transition:none!important;will-change:transform,opacity;
  filter:drop-shadow(-.7px -.7px 0 rgba(255,250,238,.16)) drop-shadow(.8px .8px 0 rgba(25,12,0,.15))}
.rise .rise-grain{display:none}
.rise .rise-cover{will-change:transform;transition:none!important}
.rise.open,.rise.s1,.rise.s2,.rise.s3{clip-path:none}
/* book page -> reader */
.opw{position:fixed;left:0;top:0;z-index:310;pointer-events:none;background:none!important;clip-path:none!important;transition:none!important;box-shadow:none!important}
.opw-sheet{position:absolute;left:0;top:0;width:100%;height:100%;transform-origin:0 0;will-change:transform}
.opw-art{position:absolute;object-fit:cover;transform-origin:50% 50%;will-change:transform,opacity;
  box-shadow:-.5px .5px .5px rgba(0,0,0,.2)}
/* the reader's text eases up into place as the sheet lifts */
html.rd-arriving #app > main{animation:rd-in .62s .05s cubic-bezier(.32,.72,0,1) both}
@keyframes rd-in{from{opacity:0;transform:translateY(14px)}}
html.bk-arriving #app main.bookp :is(.bi,.bkmain,.btns,.chl){animation:bk-in2 .6s cubic-bezier(.32,.72,0,1) both}
@keyframes bk-in2{from{opacity:0;transform:translateY(10px)}}
